/* Component colors for the existing editor, driving panel and invitation. */
#shell #content .ws-editor,
body.wf-drive,
body.drive-invite {
  --sd-ink: var(--wf-ink);
  --sd-body: #d0d4d1;
  --sd-mute: var(--wf-muted);
  --sd-rule: var(--wf-line);
  --sd-green: var(--wf-sage);
  --sd-bg: var(--wf-bg);
  --ws-ivory: var(--wf-surface);
  --ws-paper: var(--wf-surface);
  --ws-celadon: #2c2e2f;
  --ws-rail: var(--wf-raised);
  --drive-action: var(--wf-sage);
  --drive-fog: var(--wf-bg);
  --panel-selected: #303a40;
  --panel-hover: #313436;
  --panel-positive: #afceab;
  --panel-caution: #e2c28d;
  --panel-error: #edaca3;
  color: var(--wf-ink);
}
body.wf-drive,
body.wf-drive:has(#wd-account:not([hidden])),
.wf-drive .wd-workspace.wd-welcome,
body.drive-invite {
  background: var(--wf-bg);
}
body.wf-drive .wd-account > section,
body.drive-invite > main,
body.wf-drive .wd-sheet,
#content .ws-editor .ws-manage {
  background: linear-gradient(150deg, #2b2d2e, var(--wf-surface) 55%);
  color: var(--wf-ink);
  border-color: var(--wf-line);
  box-shadow: 0 8px 26px #0003;
  color-scheme: dark;
}
.wf-drive .wd-header,
#content .ws-editor .ws-dialog-head {
  background: linear-gradient(106deg, var(--wf-surface), #2b2d2e);
  color: var(--wf-ink);
  border-color: var(--wf-line);
}
body.wf-drive .wd-brand strong,
.wf-drive .wd-account :is(h1, h2),
body.drive-invite :is(h1, h2),
.wf-drive .wd-sheet h1,
#content .ws-editor .ws-heading h1 {
  color: var(--wf-ink);
  font-weight: 560;
}
.wf-drive .wd-brand > span,
.wf-drive .wd-account p,
body.drive-invite p,
body.drive-invite section,
#content .ws-editor .ws-heading p {
  color: var(--wf-muted);
  border-color: var(--wf-line);
}
body.wf-drive .sd-primary,
body.drive-invite button:not(.secondary),
#content .ws-editor .sd-primary,
#content .ws-editor .ws-heading > .sd-secondary {
  background: var(--wf-sage);
  border-color: var(--wf-sage);
  color: #1a251b;
  box-shadow: none;
}
body.wf-drive .sd-primary:hover:enabled,
body.drive-invite button:not(.secondary):hover:enabled,
#content .ws-editor .sd-primary:hover:enabled,
#content .ws-editor .ws-heading > .sd-secondary:hover:enabled {
  background: #bad5b3;
  border-color: #bad5b3;
  color: #1a251b;
}
body.wf-drive .sd-secondary,
body.drive-invite button.secondary,
#content .ws-editor :is(.sd-secondary, .wf-farm-tools button),
#content .ws-editor .ws-heading .ws-topline :is(.sd-text, .sd-secondary) {
  background: var(--wf-raised);
  color: var(--wf-blue);
  border-color: var(--wf-line);
  box-shadow: none;
}
body.wf-drive .sd-secondary:hover:enabled,
body.wf-drive a.sd-secondary:hover,
body.drive-invite button.secondary:hover:enabled,
#content .ws-editor :is(.sd-secondary, .sd-text, .wf-farm-tools button):hover:enabled,
#content .ws-editor .ws-heading .ws-topline :is(.sd-text, .sd-secondary):hover:enabled {
  color: #bad6e5;
  background: var(--panel-hover);
  border-color: #535b5e;
}
body.wf-drive .sd-text,
body.wf-drive .wd-header-actions :is(.sd-secondary, .sd-text),
#content .ws-editor :is(.sd-text, .ws-back, .ws-mode button),
#content .ws-editor .ws-dialog-head .sd-text {
  color: var(--wf-blue);
  background: transparent;
}
body.wf-drive .sd-text:hover:enabled,
body.wf-drive .wd-header-actions :is(.sd-secondary, .sd-text):hover,
#content .ws-editor .ws-dialog-head .sd-text:hover {
  color: #bad6e5;
  background: var(--panel-hover);
}
body.wf-drive :is(.wd-header, .wd-account, .wd-sheet, .wd-guidance, .wd-map-tools) :focus-visible,
body.drive-invite :is(button, input):focus-visible,
#content .ws-editor :focus-visible:where(:not(.leaflet-container *)) {
  outline-color: var(--wf-blue);
}
body.wf-drive .wd-account-form :is(input, select),
body.wf-drive #wd-origin-search,
body.drive-invite input,
#content .ws-editor input:not([type="checkbox"]):not([type="range"]):where(:not(.leaflet-container *)),
#content .ws-editor select:where(:not(.leaflet-container *)) {
  background-color: var(--wf-bg);
  color: var(--wf-ink);
  border-color: #525657;
  color-scheme: dark;
}
body.wf-drive :is(.wd-account-form input, #wd-origin-search)::placeholder,
body.drive-invite input::placeholder,
#content .ws-editor input:where(:not(.leaflet-container *))::placeholder {
  color: #a8b2ae;
}
body.wf-drive #wd-mapbox-choice input,
#content .ws-editor :is(input[type="checkbox"], input[type="range"]):where(:not(.leaflet-container *)) {
  accent-color: var(--wf-blue);
}
.wf-drive .wd-account-form label,
body.drive-invite label,
#content .ws-editor :is(.ws-filters, .ws-form, .wf-farm-tools) label {
  color: var(--sd-body);
}

/* Studio loads the cartographic editor's base sheet when it opens. */
#content .ws-editor :is(.ws-frame, .ws-empty, .ws-side, .ws-dialog-body) {
  background: var(--wf-surface);
  color: var(--wf-ink);
  border-color: var(--wf-line);
  box-shadow: none;
}
#content .ws-editor :is(.ws-toolbar, .ws-filters, .ws-tabs, .ws-info, .wf-farm-tools) {
  background: var(--wf-raised);
  color: var(--sd-body);
  border-color: var(--wf-line);
}
#content .ws-editor select:where(:not(.leaflet-container *)) {
  background-image: linear-gradient(45deg, transparent 50%, var(--wf-blue) 50%),
                    linear-gradient(135deg, var(--wf-blue) 50%, transparent 50%);
}
#content .ws-editor .ws-filters input[type="search"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%2396BBD0' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='6'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E");
}
#content .ws-editor .ws-result-count {
  background: var(--wf-surface);
  border-color: var(--wf-blue);
  color: var(--wf-ink);
}
#content .ws-editor .ws-property-table,
#content .ws-editor .ws-property-table th,
#content .ws-editor .ws-property-table td {
  border-color: var(--wf-line);
  color: var(--sd-body);
}
#content .ws-editor .ws-property-table th { background: var(--wf-raised); }
#content .ws-editor .ws-property-table td { background: var(--wf-surface); }
#content .ws-editor .ws-property-table tbody tr:nth-child(even) td { background: #282a2b; }
#content .ws-editor .ws-property-table tbody tr:hover td { background: var(--panel-hover); }
#content .ws-editor .ws-property-table tbody tr.is-selected td { background: var(--panel-selected); }
#content .ws-editor .ws-property-table tr.is-selected td:first-child { box-shadow: inset 3px 0 var(--wf-blue); }
#content .ws-editor :is(.ws-tab, .ws-status) { color: var(--wf-muted); }
#content .ws-editor .ws-tab[aria-selected="true"] {
  background: var(--panel-selected);
  color: var(--wf-blue);
  border-bottom-color: var(--wf-blue);
}
#content .ws-editor :is(.ws-chip, .ws-route-summary, .ws-confirm-contact, .ws-item, .ws-mode) {
  background: var(--wf-raised);
  border-color: var(--wf-line);
  color: var(--wf-ink);
}
#content .ws-editor .ws-item:hover { background: var(--panel-hover); }
#content .ws-editor .ws-item[aria-pressed="true"] {
  color: var(--wf-blue);
  background: var(--panel-selected);
  border-color: #647e8b;
}
#content .ws-editor .ws-manage::backdrop { background: #111314bb; }
#content .ws-editor :is(.sd-danger, .ws-info[data-kind="error"]) {
  background: #392b29;
  color: var(--panel-error);
  border-color: #67504d;
}
#content .ws-editor .ws-status[data-status="published"] {
  color: var(--panel-positive);
  background: #303b32;
}
#content .ws-editor :is(.ws-linked, .ws-status[data-status="mapping"], .ws-osm-status[data-state="ready"]) {
  color: var(--panel-positive);
}
#content .ws-editor .ws-broken { color: var(--panel-error); }
#content .ws-editor :is(.ws-status[data-status="update_requested"], .ws-osm-status[data-state="retry"],
  .ws-osm-status[data-state="partial"], .ws-osm-status[data-state="unavailable"]) {
  color: var(--panel-caution);
}
@media (max-width: 680px) {
  #content .ws-editor .ws-property-table tbody tr { background: var(--wf-surface); }
  #content .ws-editor .ws-property-table tbody tr:nth-child(even) { background: #282a2b; }
  #content .ws-editor .ws-property-table tbody tr:hover { background: var(--panel-hover); }
  #content .ws-editor .ws-property-table tbody tr.is-selected {
    background: var(--panel-selected);
    box-shadow: inset 3px 0 var(--wf-blue);
  }
  #content .ws-editor .ws-property-table tbody tr td,
  #content .ws-editor .ws-property-table tbody tr:is(:nth-child(even), :hover, .is-selected) td {
    background: transparent;
    box-shadow: none;
  }
}

/* The map pane, driving geometry and cartographic symbols keep their own colors. */
.wf-drive .wd-online:not(.wd-offline),
.wf-drive .wd-category { color: var(--panel-positive); }
.wf-drive .wd-online:not(.wd-offline)::before,
.wf-drive .wd-dot { background: var(--wf-sage); }
.wf-drive .wd-online.wd-offline,
.wf-drive .wd-imagery-notice { color: var(--panel-caution); }
.wf-drive .wd-online.wd-offline::before { background: var(--panel-caution); }
.wf-drive .wd-metrics,
.wf-drive .wd-sheet h1,
.wf-drive .wd-metrics > div + div,
.wf-drive #wd-vehicle:not([hidden]) { border-color: var(--wf-line); }
.wf-drive .wd-stage { border-color: var(--wf-sage); }
.wf-drive .wd-stage:is([data-phase="public"], [data-phase="planned"]) { border-color: var(--wf-blue); }
.wf-drive .wd-stage strong,
.wf-drive .wd-metrics strong,
.wf-drive .wd-metrics > div:first-child strong,
.wf-drive #wd-trips button { color: var(--wf-ink); }
.wf-drive .wd-stage span,
.wf-drive .wd-metrics small,
.wf-drive .wd-origin small,
.wf-drive #wd-trips button small,
.wf-drive #wd-expiry,
.wf-drive #wd-imagery-disclosure,
.wf-drive #wd-mapbox-notice,
.wf-drive #wd-account-status:not(:empty) { color: var(--wf-muted); }
.wf-drive .wd-account .wd-identity,
.wf-drive .wd-sheet summary,
.wf-drive .wd-sheet summary::marker,
.wf-drive .wd-sheet #wd-close,
.wf-drive #wd-satellite-toggle { color: var(--wf-blue); }
.wf-drive .wd-sheet :is(#wd-directions-list, #wd-notes-text) { color: var(--sd-body); }
.wf-drive #wd-directions-list [aria-current="step"] {
  color: var(--wf-blue);
  background: var(--panel-selected);
}
body.wf-drive .wd-guidance,
body.wf-drive .wd-map-tools {
  background: var(--wf-surface);
  color: var(--wf-ink);
  border-color: var(--wf-line);
  box-shadow: 0 4px 16px #0004;
}
.wf-drive .wd-guidance strong { color: var(--wf-ink); }
.wf-drive .wd-guidance small,
.wf-drive #wd-next-turn { color: var(--sd-body); border-color: var(--wf-line); }
body.wf-drive .wd-turn,
.wf-drive .wd-map-tools button[aria-pressed="true"] {
  color: var(--wf-blue);
  border-color: #4d606b;
  background: var(--panel-selected);
}
.wf-drive .wd-map-tools button { color: var(--wf-blue); }
.wf-drive .wd-map-tools button:hover:enabled,
.wf-drive #wd-place-results button:hover,
.wf-drive #wd-trips button:hover { background: var(--panel-hover); color: var(--wf-blue); }
.wf-drive .wd-map-tools button:disabled { color: var(--wf-muted); }

body.wf-drive .wd-guidance.wd-mapbox-guidance {
  background: #203343;
  border-color: #415b6a;
  color: #f6f9fa;
}
.wf-drive .wd-mapbox-guidance .wd-turn {
  background: transparent;
  color: #f5f8fa;
  border-color: transparent;
}
.wd-guidance svg { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wd-turn svg { width: 35px; height: 35px; }
.wf-drive .wd-mapbox-guidance #wd-turn-distance { color: #c4ddea; }
#wd-turn-secondary { margin-top: 3px; }
#wd-turn-lanes:not([hidden]) { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
#wd-turn-lanes svg { width: 24px; height: 24px; color: #8799a5; }
#wd-turn-lanes .wd-valid-lane { color: #fff; }
#wd-turn-lanes .wd-active-lane { border-bottom: 2px solid #a4d7fa; }
.wd-other-direction { opacity: .55; }
.wf-drive #wd-place-results button {
  background: var(--wf-raised);
  color: var(--wf-blue);
  border-color: var(--wf-line);
}
