/* Ricerca appearance. Cream/navy/gold are from the main Ricerca stylesheet.
 * Gold remains an accent; deep source gold is used for text on cream. */
:root{--ui-bg:#0a0e1a;--ui-panel:#0e1424;--ui-soft:#171f30;--ui-text:#f7f3ec;--ui-muted:#a4aabc;--ui-gold:#e8d5ae;--ui-accent:#c9a96e;--ui-line:#3b4861;--ui-positive:#7dd3a0;--ui-negative:#ed9e98;--ui-button-text:#0a0e1a;--ui-shadow:#0003}
:root[data-theme="light"]{color-scheme:light;--ui-bg:#f7f2ea;--ui-panel:#fffcf6;--ui-soft:#f8f1e6;--ui-text:#2d3142;--ui-muted:#2d3142;--ui-gold:#6b5524;--ui-accent:#c9a96e;--ui-line:#c9a96e;--ui-positive:#173c32;--ui-negative:#7f1d1d;--ui-button-text:#2d3142;--ui-shadow:#2d314212;--brand-ink:var(--ui-bg);--brand-ink2:var(--ui-panel);--brand-paper:var(--ui-text);--brand-mut:var(--ui-muted);--gold2:var(--ui-gold);--ink:var(--ui-text);--text:var(--ui-text);--forest:var(--ui-gold);--muted:var(--ui-muted);--paper:var(--ui-bg);--white:var(--ui-panel);--card:var(--ui-panel);--soft:var(--ui-soft);--line:var(--ui-line);--red:var(--ui-negative);--good:var(--ui-positive)}
html[data-theme] body{background:var(--ui-bg);color:var(--ui-text)}
html[data-theme] .workspace,html[data-theme] .sidebar,html[data-theme] .topbar{background:var(--ui-bg);backdrop-filter:none}
html[data-theme] .sidebar,html[data-theme] .topbar,html[data-theme] .main-footer{border-color:var(--ui-line)}
html[data-theme] .skip-link{background:var(--ui-accent);color:var(--ui-button-text);border:1px solid var(--ui-button-text)}
html[data-theme] :focus-visible{outline:3px solid var(--ui-gold);outline-offset:3px}
/* Control edges are stronger than decorative dividers in both brand palettes. */
:root{--ui-control-line:#78849b}
:root[data-theme="light"]{--ui-control-line:#80724e}
:root[data-style="ooa"]{--ui-control-line:#7c89b0}
:root[data-style="ooa"][data-theme="light"]{--ui-control-line:#737d9c}
html[data-theme] :is(input,select,textarea){border-color:var(--ui-control-line)}
html[data-theme] :is(.topbar input,.topbar select,.text-button,.icon-button,.main-footer button){min-height:44px;min-width:44px}
@media(max-width:680px){html[data-theme] .scope-controls select{padding-right:6px}}
/* Route changes focus the main landmark, not a control. Avoid outlining the
 * entire page as a gold footer rule; descendant controls retain their rings. */
html[data-theme] main#content[tabindex="-1"]:focus-visible{outline:none}
html[data-theme] :is(button,input,select,textarea):disabled{opacity:1;color:var(--ui-muted);background:var(--ui-soft);border-color:var(--ui-line);cursor:not-allowed}
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder{color:var(--ui-muted);opacity:1}
html[data-theme] :is(.panel,.stat,.map-feature,.table-wrap,.load-card,.pricing-card,.today-metric,.today-floor,.today-panel,.money-cash-card,.share-stat,.payables-card,.payable-row,.payables-empty,.mileage-receipt,.ops-metric,.ops-load-table,.compare-ranked-row,.settings-disclosure,.planning-controls,.numbers-summary>div,.money-summary>button,.hub-settings,.ops-truck-overview,.ops-brief,.quote-panel,.load-summary,.hub-strip){background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line);box-shadow:none}
html[data-theme] :is(.today-received,.compare-ranked-row.best,.pricing-card.featured,.quote-panel,.load-summary,.ops-brief){background:var(--ui-soft)}
html[data-theme] :is(.notice,.notice.warning,.notice.error,.empty-state,.upload-zone,.workspace-banner,.ops-attention,.intake-pending,.load-letter,.ops-help code,.hub-evidence-stats>div){background:var(--ui-soft);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme] :is(.notice.error,.intake-error,.mileage-unknown,.payable-status.overdue,.payables-form [role="alert"],#quick-plan-error:not(:empty),#ops-form-error:not(:empty)){color:var(--ui-negative)}
html[data-theme] :is(.field input,.field select,.field textarea,.search-input,.ops-help textarea,.planning-controls select,.planning-input,.ops-load-filters select,.scope-controls select,.payables-form .field textarea){background:var(--ui-bg);color:var(--ui-text);border-color:var(--ui-control-line)}
html[data-theme] .planning-input input{color:var(--ui-text)}
html[data-theme] :is(.button,.button.light){background:var(--ui-accent);color:var(--ui-button-text);border-color:var(--ui-accent)}
html[data-theme] .button:hover{background:var(--ui-accent);color:var(--ui-button-text);outline:1px solid var(--ui-gold)}
html[data-theme] :is(.button.secondary,.icon-button,.mode-button){background:var(--ui-panel);color:var(--ui-gold);border-color:var(--ui-line)}
html[data-theme] :is(.button.secondary:hover,.icon-button:hover,.upload-zone.dragover,.ops-load-row:hover,.ops-load-row:focus-visible,.today-load-row:hover){background:var(--ui-soft);color:var(--ui-text)}
html[data-theme] :is(.tag,.tag.sample,.today-sample,.scope-controls .sample-chip,.ops-load-row .tag){background:var(--ui-soft);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme] :is(.tag.red,.ops-load-row .tag.red){background:var(--ui-soft);color:var(--ui-negative);border-color:var(--ui-negative)}
html[data-theme] :is(h1,h2,h3,.today-heading h1,.today-panel-heading h2,.today-metric,.today-floor-value,.today-attention-row,.today-load-row,.today-receipt-split b,.ops-type,.ops-check,.ops-load-row,.ops-row-owed,.payables-card strong,.payable-row strong,.payable-row h3,.payables-empty h3,.payable-status,.money-summary strong,.compare-ranked-row,.model-context b,.load-stats strong,.ops-health-item){color:var(--ui-text)}
html[data-theme] :is(.quiet,.form-note,.field,.field small,.hero p,.page-heading p,.hero-aside small,.panel p,.modal-copy,.main-footer,.subnav>span,.stat-top,.stat-bottom,.stat-value small,.map-copy p,.legend-tiny,.expense-row,.receipt-row code,.receipt-source,.private-note p,.sidebar-foot,.breadcrumb,.local-status,.file-types,.upload-zone small,.import-doc small,.empty-state p,.pricing-card p,.pricing-card ul,.pricing-card.featured p,.pricing-card.featured ul,.pricing-intro p,.pricing-price small,.pricing-small,.faq details p,.data-banner,.money-large small,.load-stats small,.load-card-footer,.load-summary p,.cost-breakdown>div){color:var(--ui-muted)}
html[data-theme] :is(.today-heading>span,.today-metric-label,.today-metric>small,.today-floor-value>span,.today-floor-value>small,.today-floor-value strong small,.today-attention-row small,.today-panel p,.today-load-row small,.today-next-dates,.today-next-dates b,.today-receipt-context,.today-receipt-split span,.today-receipt-table td small,.today-formula dt,.planning-controls label,.planning-controls label small,.numbers-summary>div>span,.numbers-summary small,.numbers-advanced>summary>span,.money-summary span,.money-summary small,.money-cash-card>span:first-child,.money-sample-note,.payables-card span,.payables-card small,.payable-row p,.payable-row small,.payables-empty p,.mileage-receipt p,.mileage-receipt ul,.compare-columns,.model-context){color:var(--ui-muted)}
html[data-theme] :is(.ops-metric small,.ops-metric>span,.ops-workflow b,.ops-workflow i,.ops-load-meta,.ops-load-numbers small,.ops-card-actions>span,.ops-toolbar p,.ops-type small,.ops-reminder small,.ops-brief p,.ops-help,.ops-source pre,.ops-load-detail>p,.ops-load-detail ul,.ops-load-filters label,.ops-load-count,.ops-load-columns,.ops-row-date,.ops-row-lane small,.ops-truck-overview figcaption,.ops-truck-health small,.paperwork-privacy,#laya-status,.hub-strip small,.hub-checks label,.hub-effective small,.hub-evidence-stats small,.hub-source-list p,.hub-source-list small){color:var(--ui-muted)}
html[data-theme] :is(.text-button,.text-button:hover,.table-button,.settings-link,.hound-brand-name,.today-received>strong,.today-receipt-total,.today-floor-bottom a,.today-floor-bottom>.text-button,.today-panel-heading>a,.today-panel-heading>.text-button,.today-exclusions summary,.planning-title strong,.numbers-summary strong,.numbers-advanced>summary,.settings-disclosure>summary,.compare-entry>summary,.compare-ranked-row>strong,.ops-metric strong,.ops-load-numbers strong,.ops-help summary,.ops-help code,.ops-source summary,.ops-load-count a,.hub-strip b,.hub-strip .text-button,.hub-effective b,.money-large,.stat-value,.expense-row b,.cost-breakdown>div.total,.receipt-row strong,.modal-copy h3,.quote-panel p,.quote-panel small,.pricing-price,.load-summary h3){color:var(--ui-gold)}
html[data-theme] :is(.positive,.today-clear){color:var(--ui-positive)!important}
html[data-theme] :is(.negative,.load-stats strong.negative){color:var(--ui-negative)!important}
html[data-theme] :is(nav>a,.page-tabs a){color:var(--ui-muted)}
html[data-theme] :is(nav>a:hover,nav>a.active,.page-tabs a[aria-current="page"]){background:var(--ui-soft);color:var(--ui-gold)}
html[data-theme] :is(.ops-load-columns,th){background:var(--ui-soft);color:var(--ui-text)}
html[data-theme] table{background:var(--ui-panel)}
html[data-theme] td{color:var(--ui-muted);border-color:var(--ui-line)}
html[data-theme] td strong{color:var(--ui-text)}
html[data-theme] :is(.receipt-row,.ops-card-actions,.ops-reminder,.ops-load-list>li+li,.cost-breakdown>div,.money-record-links button,.today-attention-row,.today-load-row,.today-exclusions){border-color:var(--ui-line)}
html[data-theme] dialog{background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme] .intake-confirm-dialog{color:var(--ui-text)}
html[data-theme] #toast{background:var(--ui-accent);color:var(--ui-button-text)}
html[data-theme] .map-full,html[data-theme] .map-preview{background:var(--ui-bg)}
html[data-theme="light"] :is(.today-metric-label i,.today-floor-value i,.today-attention-icon,.today-attention-row>i,.today-load-row>span:last-child,.today-next .today-load-lane>span,.ops-row-lane strong>span,.ops-feature-link>span,.ops-feature-link h3 b,.ops-workflow,.ops-tabs,.job-illustration,.ops-line-illustration){color:var(--ui-gold)}
html[data-theme] .today-rate-track{background:var(--ui-line)}
html[data-theme] .today-rate-track>i{background:var(--ui-text)}
html[data-theme] .bar-track{background:var(--ui-soft)}
html[data-theme] .bar-track>i{background:var(--ui-accent)}
html[data-theme] .ops-load-row>span[data-label]:before,html[data-theme] .compare-ranked-row [data-label]:before{color:var(--ui-muted)}
/* One topbar control, with a full tap target; the phone brand keeps its own row. */
.theme-toggle{width:44px;height:44px;flex:none}
.theme-toggle svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-moon{display:none}
[data-theme="light"] .theme-toggle .theme-sun{display:none}
[data-theme="light"] .theme-toggle .theme-moon{display:block}
.theme-choices{display:flex;gap:10px;flex-wrap:wrap}
.theme-choices button{min-height:44px;min-width:100px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-panel);color:var(--ui-text);padding:9px 20px;font-weight:600}
.theme-choices button[aria-pressed="true"]{background:var(--ui-accent);color:var(--ui-button-text);border-color:var(--ui-gold)}
@media(max-width:680px){.topbar>.theme-toggle{grid-column:3;grid-row:3;justify-self:end}.topbar>.model-context{grid-column:1/3;grid-row:3;min-width:0;justify-content:flex-start;gap:15px}.topbar>.mobile-brand{justify-self:center}}
/* Map surfaces only. County/market fills, route strokes and score math are untouched. */
html[data-theme] .ricerca-map{--bg:var(--ui-bg);--panel:var(--ui-panel);--ink:var(--ui-text);--mut:var(--ui-muted);--line:var(--ui-line)}
html[data-theme] :is(#left,#card,#round,#compass,#roundbar,#method details){background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line);box-shadow:0 10px 30px var(--ui-shadow)}
html[data-theme] #maptitle,html[data-theme] #map-attribution{background:var(--ui-bg)!important;color:var(--ui-muted)!important;border-color:var(--ui-line)!important}
html[data-theme] #maptitle>div,html[data-theme] #map-attribution a{color:var(--ui-gold)!important}
html[data-theme] :is(.basebtn,#roundbar button,.market-actions button){background:var(--ui-accent);color:var(--ui-button-text);border-color:var(--ui-accent)}
html[data-theme] :is(.basebtn.clear,#roundbar button.off){background:var(--ui-soft);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme] :is(#market-filter,#market-select,.round-inputs input){background:var(--ui-bg);color:var(--ui-text);border-color:var(--ui-control-line)}
html[data-theme] .market-actions button:disabled{opacity:1;background:var(--ui-soft);color:var(--ui-muted);border-color:var(--ui-line)}
html[data-theme] :is(#map-nav button,#showpanel){background:var(--ui-panel)!important;color:var(--ui-gold)!important;border-color:var(--ui-line)!important}
html[data-theme] #tip{background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme] :is(#tip .t2,.live-cost-main strong,.live-basis summary,.personal-market h4,#round-economics h4,.round-live-stats strong,.travel-cost,.ricerca-map a){color:var(--ui-gold)}
html[data-theme] :is(.personal-market,.live-stale,.warn.soft,.warn.hard,#method code){background:var(--ui-soft);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme] .warn.hard{color:var(--ui-negative)}
/* Source verdict colors also color counties. Remap text inside these panels only. */
html[data-theme] :is(#tip,#card,#round,#compass) [style*="color:#2f855a"],html[data-theme] :is(#tip,#card,#round,#compass) [style*="color:#7fbf7f"],html[data-theme] :is(#tip,#card,#round,#compass) [style*="color:#4a7c59"]{color:var(--ui-positive)!important}
html[data-theme] :is(#tip,#card,#round,#compass) [style*="color:#c53030"]{color:var(--ui-negative)!important}
html[data-theme] :is(#tip,#card,#round,#compass) [style*="color:#e2a13c"],html[data-theme] :is(#tip,#card,#round,#compass) [style*="color:#b47d18"]{color:var(--ui-gold)!important}
html[data-theme="light"] #round [style*="color:#7a7064"],html[data-theme="light"] #left [style*="color:#2d3142"]{color:var(--ui-muted)!important}
/* The entrance is intentionally independent of the page theme. */
html[data-theme] .truck-intro{background:#000;color:#f5eddf}
html[data-theme] .truck-intro-skip{background:#0a0d14;color:#f3e4c8;border-color:#dfc99b70}
