/* MOTwise shared theme v13
   One visual theme contract for Dashboard v2 + all six feature pages.
   This file is intentionally presentation-only: no dashboard geometry, Health Score,
   timeline rendering, feature logic, or landing-page rules are defined here. */

html[data-theme="light"],html[data-mw-theme="light"]{
  color-scheme:light;
  --mt-page:#f4f7fb;
  --mt-surface:#ffffff;
  --mt-surface-2:#f8fbff;
  --mt-surface-3:#eef4fa;
  --mt-text:#081a33;
  --mt-text-2:#314b65;
  --mt-muted:#60758d;
  --mt-muted-2:#7c8fa3;
  --mt-line:#d8e3ee;
  --mt-line-strong:#c7d5e3;
  --mt-blue:#0b63e6;
  --mt-green:#078f47;
  --mt-green-bg:#eaf7ef;
  --mt-amber:#a86700;
  --mt-amber-bg:#fff5df;
  --mt-red:#b83b36;
  --mt-red-bg:#ffe9e7;
  --mt-purple:#6f42d9;
  --mt-field:#ffffff;
  --mt-shadow:rgba(18,45,74,.06);
}
html[data-theme="dark"],html[data-mw-theme="dark"]{
  color-scheme:dark;
  --mt-page:#07182e;
  --mt-surface:#0c223d;
  --mt-surface-2:#102943;
  --mt-surface-3:#15324f;
  --mt-text:#f5f8fd;
  --mt-text-2:#d8e3ef;
  --mt-muted:#b7c5d5;
  --mt-muted-2:#94a9bd;
  --mt-line:#31506f;
  --mt-line-strong:#466886;
  --mt-blue:#79a9ff;
  --mt-green:#62df95;
  --mt-green-bg:#153a30;
  --mt-amber:#ffc866;
  --mt-amber-bg:#453719;
  --mt-red:#ff8a84;
  --mt-red-bg:#482526;
  --mt-purple:#b59aff;
  --mt-field:#102943;
  --mt-shadow:rgba(0,0,0,.22);
}

/* =========================
   Dashboard v2
   ========================= */
html[data-theme] body.v2-body,
html[data-mw-theme] body.v2-body{
  background:var(--mt-page)!important;
  color:var(--mt-text)!important;
}
html[data-theme] body.v2-body .v2-main-wrap,
html[data-theme] body.v2-body .v2-content,
html[data-mw-theme] body.v2-body .v2-main-wrap,
html[data-mw-theme] body.v2-body .v2-content{
  background:var(--mt-page)!important;
  color:var(--mt-text)!important;
}
html[data-theme] body.v2-body .v2-topbar,
html[data-mw-theme] body.v2-body .v2-topbar{
  background:var(--mt-surface)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
}
html[data-theme] body.v2-body .v2-search,
html[data-theme] body.v2-body .v2-search label,
html[data-theme] body.v2-body .v2-analysis-status strong,
html[data-theme] body.v2-body .v2-top-action,
html[data-theme] body.v2-body .v2-icon-btn,
html[data-mw-theme] body.v2-body .v2-search,
html[data-mw-theme] body.v2-body .v2-search label,
html[data-mw-theme] body.v2-body .v2-analysis-status strong,
html[data-mw-theme] body.v2-body .v2-top-action,
html[data-mw-theme] body.v2-body .v2-icon-btn{
  color:var(--mt-text)!important;
}
html[data-theme] body.v2-body .v2-search small,
html[data-theme] body.v2-body .v2-analysis-status small,
html[data-mw-theme] body.v2-body .v2-search small,
html[data-mw-theme] body.v2-body .v2-analysis-status small{
  color:var(--mt-muted)!important;
}
html[data-theme] body.v2-body .v2-analysis-status,
html[data-mw-theme] body.v2-body .v2-analysis-status{
  background:var(--mt-surface)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
}
/* Number-plate field intentionally stays plate-coloured in both themes. */
html[data-theme] body.v2-body .v2-search-row input,
html[data-mw-theme] body.v2-body .v2-search-row input{
  background:#fff7d8!important;
  color:#111820!important;
  border-color:#dcae10!important;
}

/* Override historical hard-coded light #results rules when dark is resolved. */
html[data-theme] body.v2-body #results,
html[data-mw-theme] body.v2-body #results{
  background:var(--mt-page)!important;
  color:var(--mt-text)!important;
}
html[data-theme] body.v2-body #results .v2-snapshot-grid,
html[data-theme] body.v2-body #results .v2-panel,
html[data-theme] body.v2-body #results .v2-vehicle-card,
html[data-theme] body.v2-body #results .v2-metric-card,
html[data-theme] body.v2-body #results .v2-dna,
html[data-theme] body.v2-body #results .v2-highlights,
html[data-theme] body.v2-body #results .v2-timeline-card,
html[data-theme] body.v2-body #results .v2-value-card,
html[data-theme] body.v2-body #results .v2-feature-card,
html[data-mw-theme] body.v2-body #results .v2-snapshot-grid,
html[data-mw-theme] body.v2-body #results .v2-panel,
html[data-mw-theme] body.v2-body #results .v2-vehicle-card,
html[data-mw-theme] body.v2-body #results .v2-metric-card,
html[data-mw-theme] body.v2-body #results .v2-dna,
html[data-mw-theme] body.v2-body #results .v2-highlights,
html[data-mw-theme] body.v2-body #results .v2-timeline-card,
html[data-mw-theme] body.v2-body #results .v2-value-card,
html[data-mw-theme] body.v2-body #results .v2-feature-card{
  background:var(--mt-surface)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
}
html[data-theme] body.v2-body #results .v2-vehicle-copy,
html[data-mw-theme] body.v2-body #results .v2-vehicle-copy{
  background:var(--mt-surface)!important;
  color:var(--mt-text)!important;
}
html[data-theme] body.v2-body #results .v2-vehicle-image-wrap,
html[data-theme] body.v2-body #results .v2-image-fallback,
html[data-mw-theme] body.v2-body #results .v2-vehicle-image-wrap,
html[data-mw-theme] body.v2-body #results .v2-image-fallback{
  background:linear-gradient(145deg,var(--mt-surface-3),var(--mt-surface))!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
}
html[data-theme] body.v2-body #results :where(h1,h2,h3,strong,.v2-metric-title,.v2-metric-value,.mw-proto-vehicle-name h2,.v2-vehicle-detail-grid strong),
html[data-mw-theme] body.v2-body #results :where(h1,h2,h3,strong,.v2-metric-title,.v2-metric-value,.mw-proto-vehicle-name h2,.v2-vehicle-detail-grid strong){
  color:var(--mt-text)!important;
}
html[data-theme] body.v2-body #results :where(p,small,.v2-muted,.mw-proto-vehicle-meta,.v2-vehicle-detail-grid small,.v2-depreciation-note,.v2-chart-year,.chart-label),
html[data-mw-theme] body.v2-body #results :where(p,small,.v2-muted,.mw-proto-vehicle-meta,.v2-vehicle-detail-grid small,.v2-depreciation-note,.v2-chart-year,.chart-label){
  color:var(--mt-muted)!important;
}
html[data-theme] body.v2-body #results .v2-kicker,
html[data-mw-theme] body.v2-body #results .v2-kicker{
  color:var(--mt-blue)!important;
}
html[data-theme] body.v2-body #results .v2-dna-grid>div,
html[data-theme] body.v2-body #results .mwx-row,
html[data-mw-theme] body.v2-body #results .v2-dna-grid>div,
html[data-mw-theme] body.v2-body #results .mwx-row{
  border-color:var(--mt-line)!important;
}
html[data-theme] body.v2-body #results .v2-recommendation,
html[data-mw-theme] body.v2-body #results .v2-recommendation{
  background:var(--mt-green-bg)!important;
  border-color:color-mix(in srgb,var(--mt-green) 38%,var(--mt-line))!important;
  color:var(--mt-text)!important;
}
html[data-theme] body.v2-body #results .v2-recommendation :where(.v2-kicker,h2),
html[data-mw-theme] body.v2-body #results .v2-recommendation :where(.v2-kicker,h2){color:var(--mt-green)!important}
html[data-theme] body.v2-body #results .v2-confidence,
html[data-theme] body.v2-body #results .v2-depreciation-stat,
html[data-mw-theme] body.v2-body #results .v2-confidence,
html[data-mw-theme] body.v2-body #results .v2-depreciation-stat{
  background:var(--mt-surface)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
}
html[data-theme] body.v2-body #results .priority-item,
html[data-mw-theme] body.v2-body #results .priority-item{color:var(--mt-text)!important}
html[data-theme] body.v2-body #results .v2-depreciation-chart svg line,
html[data-mw-theme] body.v2-body #results .v2-depreciation-chart svg line{stroke:var(--mt-line)!important}
html[data-theme] body.v2-body #results .v2-chart-value,
html[data-mw-theme] body.v2-body #results .v2-chart-value{fill:var(--mt-text)!important;color:var(--mt-text)!important}
html[data-theme] body.v2-body #results .v2-chart-year,
html[data-mw-theme] body.v2-body #results .v2-chart-year{fill:var(--mt-muted)!important;color:var(--mt-muted)!important}

/* Buying decision intentionally remains a dark decision surface in both themes. */
html[data-theme] body.v2-body #results .v2-decision-card,
html[data-mw-theme] body.v2-body #results .v2-decision-card{
  background:linear-gradient(135deg,#061b39,#0d3b72)!important;
  color:#fff!important;
  border-color:#244e7c!important;
}
html[data-theme] body.v2-body #results .v2-decision-card :where(h2,h3,p,strong,small,span,.v2-kicker),
html[data-mw-theme] body.v2-body #results .v2-decision-card :where(h2,h3,p,strong,small,span,.v2-kicker){color:#fff!important}

/* Dashboard dialogs and controls follow the resolved theme too. */
html[data-theme] body.v2-body :where(dialog,.dialog-card),
html[data-mw-theme] body.v2-body :where(dialog,.dialog-card){background:var(--mt-surface)!important;color:var(--mt-text)!important;border-color:var(--mt-line)!important}
html[data-theme] body.v2-body .dialog-card :where(h2,h3,strong),
html[data-mw-theme] body.v2-body .dialog-card :where(h2,h3,strong){color:var(--mt-text)!important}
html[data-theme] body.v2-body .dialog-card :where(p,small,.muted),
html[data-mw-theme] body.v2-body .dialog-card :where(p,small,.muted){color:var(--mt-muted)!important}

/* =========================
   Feature suite: all six pages
   ========================= */
html[data-theme] body[data-feature],
html[data-mw-theme] body[data-feature]{
  background:var(--mt-page)!important;
  color:var(--mt-text)!important;
}
html[data-theme] body[data-feature] .mwf-main,
html[data-theme] body[data-feature] .mwf-content,
html[data-mw-theme] body[data-feature] .mwf-main,
html[data-mw-theme] body[data-feature] .mwf-content{
  background:var(--mt-page)!important;
  color:var(--mt-text)!important;
}
/* Sidebar is the same branded navy in both modes; its own text stays high-contrast. */
body[data-feature] .mwf-sidebar{background:linear-gradient(180deg,#061a33,#07294d)!important;color:#fff!important}
body[data-feature] .mwf-sidebar :where(.mwf-brand,.mwf-nav a,.mwf-nav i){color:#dce8f5!important}
body[data-feature] .mwf-sidebar .mwf-brand{color:#fff!important}
body[data-feature] .mwf-sidebar .mwf-brand span{color:#f5c400!important}
body[data-feature] .mwf-sidebar .mwf-brand small{color:#a8bdd2!important}
body[data-feature] .mwf-sidebar .mwf-nav a.active,
body[data-feature] .mwf-sidebar .mwf-nav a.active i{color:#fff!important}

html[data-theme] body[data-feature] .mwf-topbar,
html[data-mw-theme] body[data-feature] .mwf-topbar{
  background:color-mix(in srgb,var(--mt-surface) 96%,transparent)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
  box-shadow:0 4px 18px var(--mt-shadow)!important;
}
html[data-theme] body[data-feature] .mwf-vehicle-chip strong,
html[data-mw-theme] body[data-feature] .mwf-vehicle-chip strong{color:var(--mt-text)!important}
html[data-theme] body[data-feature] .mwf-vehicle-chip small,
html[data-mw-theme] body[data-feature] .mwf-vehicle-chip small{color:var(--mt-muted)!important}
html[data-theme] body[data-feature] .mwf-back,
html[data-theme] body[data-feature] .mwf-theme-toggle,
html[data-mw-theme] body[data-feature] .mwf-back,
html[data-mw-theme] body[data-feature] .mwf-theme-toggle{
  background:var(--mt-surface)!important;
  color:var(--mt-text)!important;
  border:1px solid var(--mt-line)!important;
  box-shadow:none!important;
}
.mwf-top-actions{display:flex;align-items:center;gap:9px;margin-left:auto}
.mwf-theme-toggle{width:40px;height:38px;border-radius:10px;display:grid;place-items:center;font:inherit;font-size:17px;cursor:pointer}
.mwf-theme-toggle:hover{border-color:var(--mt-line-strong)!important;background:var(--mt-surface-2)!important}

html[data-theme] body[data-feature] :where(.mwf-panel,.mwx-panel,.mwx-offer-grid>div,.mwx-repair-card,.ownership-results>div,.mwx-test,.mwx-chat-panel),
html[data-mw-theme] body[data-feature] :where(.mwf-panel,.mwx-panel,.mwx-offer-grid>div,.mwx-repair-card,.ownership-results>div,.mwx-test,.mwx-chat-panel){
  background:var(--mt-surface)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
  box-shadow:0 7px 22px var(--mt-shadow)!important;
}
html[data-theme] body[data-feature] :where(.mwx-metric,.phase2-list li,.mwx-boundary,.mwx-test header,.mwx-empty),
html[data-mw-theme] body[data-feature] :where(.mwx-metric,.phase2-list li,.mwx-boundary,.mwx-test header,.mwx-empty){
  background:var(--mt-surface-2)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line)!important;
}
html[data-theme] body[data-feature] :where(.mwf-title h1,.mwx-panel h2,.mwx-panel h3,.mwx-row strong,.mwx-repair-card h3,.mwx-cost strong,.mwx-big-value,.ownership-results strong,.mwx-test strong,.mwx-chat-head h2,.mwx-bot strong),
html[data-mw-theme] body[data-feature] :where(.mwf-title h1,.mwx-panel h2,.mwx-panel h3,.mwx-row strong,.mwx-repair-card h3,.mwx-cost strong,.mwx-big-value,.ownership-results strong,.mwx-test strong,.mwx-chat-head h2,.mwx-bot strong){
  color:var(--mt-text)!important;
}
html[data-theme] body[data-feature] :where(.mwf-title p,.mwx-metric small,.mwx-metric span,.mwx-row span,.mwx-row small,.mwx-repair-card span,.mwx-repair-card p,.mwx-prob small,.mwx-cost span,.ownership-results span,.ownership-form-grid label span,.mwx-test header span,.mwx-test-defects span,.mwx-test-defects p,.mwx-chat-head p,.mwx-chat-note,.mwx-empty),
html[data-mw-theme] body[data-feature] :where(.mwf-title p,.mwx-metric small,.mwx-metric span,.mwx-row span,.mwx-row small,.mwx-repair-card span,.mwx-repair-card p,.mwx-prob small,.mwx-cost span,.ownership-results span,.ownership-form-grid label span,.mwx-test header span,.mwx-test-defects span,.mwx-test-defects p,.mwx-chat-head p,.mwx-chat-note,.mwx-empty){
  color:var(--mt-muted)!important;
}
html[data-theme] body[data-feature] .mwf-kicker,
html[data-mw-theme] body[data-feature] .mwf-kicker{color:var(--mw-accent,var(--mt-blue))!important}
html[data-theme] body[data-feature] :where(.mwx-row,.mwx-cost,.mwx-score-line,.mwx-budget,.mwx-step,.mwx-test-defects>div),
html[data-mw-theme] body[data-feature] :where(.mwx-row,.mwx-cost,.mwx-score-line,.mwx-budget,.mwx-step,.mwx-test-defects>div){border-color:var(--mt-line)!important}

/* Inputs / selects / chat controls */
html[data-theme] body[data-feature] :where(.ownership-form-grid input,.ownership-form-grid select,.mwx-chat input),
html[data-mw-theme] body[data-feature] :where(.ownership-form-grid input,.ownership-form-grid select,.mwx-chat input){
  background:var(--mt-field)!important;
  color:var(--mt-text)!important;
  border-color:var(--mt-line-strong)!important;
}
html[data-theme] body[data-feature] :where(.ownership-form-grid input,.ownership-form-grid select,.mwx-chat input)::placeholder,
html[data-mw-theme] body[data-feature] :where(.ownership-form-grid input,.ownership-form-grid select,.mwx-chat input)::placeholder{color:var(--mt-muted-2)!important}

/* Chat workspace */
html[data-theme] body[data-feature] .mwx-conversation,
html[data-mw-theme] body[data-feature] .mwx-conversation{background:var(--mt-surface-2)!important;border-color:var(--mt-line)!important}
html[data-theme] body[data-feature] .mwx-bot,
html[data-mw-theme] body[data-feature] .mwx-bot{background:var(--mt-surface)!important;color:var(--mt-text)!important;border-color:var(--mt-line)!important}
html[data-theme] body[data-feature] .mwx-bot p,
html[data-mw-theme] body[data-feature] .mwx-bot p{color:var(--mt-text-2)!important}
body[data-feature] .mwx-user,body[data-feature] .mwx-user p{color:#fff!important}
html[data-theme] body[data-feature] .mwx-prompts button,
html[data-mw-theme] body[data-feature] .mwx-prompts button{background:var(--mt-surface)!important;color:var(--mt-text-2)!important;border-color:var(--mt-line)!important}

/* Semantic callouts keep meaning but adapt their contrast to the active theme. */
html[data-theme] body[data-feature] .mwx-badge.good,
html[data-mw-theme] body[data-feature] .mwx-badge.good{background:var(--mt-green-bg)!important;color:var(--mt-green)!important}
html[data-theme] body[data-feature] .mwx-badge.warn,
html[data-mw-theme] body[data-feature] .mwx-badge.warn{background:var(--mt-amber-bg)!important;color:var(--mt-amber)!important}
html[data-theme] body[data-feature] .mwx-badge.danger,
html[data-mw-theme] body[data-feature] .mwx-badge.danger{background:var(--mt-red-bg)!important;color:var(--mt-red)!important}
html[data-theme] body[data-feature] .mwx-note,
html[data-mw-theme] body[data-feature] .mwx-note{background:var(--mt-amber-bg)!important;border-color:color-mix(in srgb,var(--mt-amber) 42%,var(--mt-line))!important}
html[data-theme] body[data-feature] .mwx-note :where(strong,span),
html[data-mw-theme] body[data-feature] .mwx-note :where(strong,span){color:var(--mt-amber)!important}
html[data-theme] body[data-feature] .phase2-list li b,
html[data-mw-theme] body[data-feature] .phase2-list li b{background:var(--mt-green-bg)!important;color:var(--mt-green)!important}
html[data-theme] body[data-feature] .mwx-boundary,
html[data-mw-theme] body[data-feature] .mwx-boundary{color:var(--mt-text-2)!important}

/* The prominent intelligence banner remains intentionally navy in every theme. */
body[data-feature] .mwx-v1-hero{background:linear-gradient(135deg,#082542,#0a3d70)!important;color:#fff!important;border-color:rgba(255,255,255,.1)!important}
body[data-feature] .mwx-v1-hero :where(h2,strong){color:#fff!important}
body[data-feature] .mwx-v1-hero :where(p,span){color:#d6e4f1!important}
body[data-feature] .mwx-confidence:after{background:#0b3159!important}

/* Ownership highlighted tiles should not revert to light-only fills in dark mode. */
html[data-theme="dark"] body[data-feature="ownership"] .ownership-results>div:first-child,
html[data-theme="dark"] body[data-feature="ownership"] .ownership-results>div:nth-child(2),
html[data-mw-theme="dark"] body[data-feature="ownership"] .ownership-results>div:first-child,
html[data-mw-theme="dark"] body[data-feature="ownership"] .ownership-results>div:nth-child(2){background:#103637!important;border-color:#2a6262!important}

@media(max-width:620px){.mwf-top-actions{width:100%;justify-content:flex-end}.mwf-theme-toggle{width:38px;height:36px}}
