/* =========================================================
   FleetCalc — "Trip Sheet" redesign concept
   Light-first money instrument. Taxi-gold brand accent,
   green reserved for profit, receipt as the hero element.
   Concept stylesheet — demo only, live pages untouched.
========================================================= */

/* ---------- Tokens ---------- */
:root {
    --paper: #F4F3EE;
    --panel: #FFFFFF;
    --panel-2: #FAF9F4;
    --ink: #1A1C18;
    --ink-2: #4A4E45;
    --ink-3: #80857A;
    --line: #E4E2D8;
    --line-strong: #C9C7BA;
    --gold: #F0A500;
    --gold-deep: #8F6400;
    --gold-soft: #FBF0D7;
    --profit: #1D7A46;
    --profit-soft: #E2F0E6;
    --loss: #C0392B;
    --loss-soft: #F9E7E3;
    --warn: #8F6400;
    --warn-soft: #FBF0D7;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(26, 28, 24, .05);
    --shadow-md: 0 6px 20px rgba(26, 28, 24, .10);

    --topbar-h: 58px;
    --strip-h: 72px;
    --bar-h: 64px;
    --container: 1200px;

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;

    /* Aliases: the engine (app.js) sets inline colors using the live site's token names */
    --text: var(--ink);
    --danger: var(--loss);
}

body:not(.light-theme),
html[data-theme="dark"] body:not(.light-theme) {
    --paper: #141511;
    --panel: #1C1E19;
    --panel-2: #23251F;
    --ink: #F0EFE7;
    --ink-2: #C3C5B9;
    --ink-3: #909486;
    --line: #2E3128;
    --line-strong: #3F4336;
    --gold: #F2B02E;
    --gold-deep: #E0A32A;
    --gold-soft: #3A3522;
    --profit: #4CC07C;
    --profit-soft: #1E3327;
    --loss: #E26850;
    --loss-soft: #3A241F;
    --warn: #E0A32A;
    --warn-soft: #3A3522;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .5);
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.app-page { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0)); }

[hidden] { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--gold-soft); color: var(--ink); }

.num, .metric-value, .rs-value, .value-tag, .acc-summary {
    font-variant-numeric: tabular-nums;
}

.muted { color: var(--ink-3); }
.small { font-size: 13px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    height: var(--topbar-h);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    max-width: var(--container); margin: 0 auto; padding: 0 20px;
    height: 100%; display: flex; align-items: center; gap: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }

.plate-mark {
    width: 34px; height: 34px; border-radius: 8px; display: block;
    box-shadow: inset 0 0 0 2px rgba(26, 28, 24, .85);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700; font-size: 19px; letter-spacing: -0.02em;
}
.brand-name b { font-weight: 800; color: var(--gold-deep); }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }

.nav-link {
    display: inline-block; padding: 7px 12px; border-radius: 8px;
    color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--ink); background: var(--panel-2); }
.nav-link[aria-current="page"] {
    color: var(--ink); font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--gold);
    border-radius: 8px 8px 0 0;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
    width: 38px; height: 38px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent;
    color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line); }

.overflow-menu {
    position: absolute; right: 20px; top: calc(var(--topbar-h) - 6px);
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--shadow-md);
    min-width: 210px; padding: 6px; z-index: 50;
}
.menu-item {
    display: block; width: 100%; text-align: left; padding: 10px 12px;
    background: none; border: 0; border-radius: 8px; cursor: pointer;
    color: var(--ink); font-size: 14.5px; font-family: var(--font); text-decoration: none;
}
.menu-item:hover { background: var(--panel-2); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 26px; }

.hero-kicker { font-size: 15px; font-weight: 500; color: var(--ink-3); margin-bottom: 10px; }

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(30px, 4.6vw, 46px);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
    max-width: 18ch;
}

.hero-sub {
    margin-top: 12px; color: var(--ink-2);
    font-size: 17px; max-width: 56ch;
}

.hero-meta {
    margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px;
    color: var(--ink-3); font-size: 13.5px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta .tick { width: 6px; height: 6px; border-radius: 2px; background: var(--gold); display: inline-block; }

/* ---------- Sticky receipt ticker (result strip) ---------- */
.result-strip {
    position: sticky; top: var(--topbar-h); z-index: 30;
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.result-strip-inner {
    max-width: var(--container); margin: 0 auto; padding: 12px 20px;
    display: flex; align-items: center; gap: 28px;
}

.rs-label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }

.rs-value {
    font-family: var(--font-display); font-weight: 800;
    font-size: 26px; letter-spacing: -0.02em; line-height: 1.1;
}
.rs-value.sm { font-size: 18px; font-weight: 700; }
.rs-currency { color: var(--ink-3); font-weight: 700; margin-right: 1px; }

.rs-hero .rs-value { color: var(--ink); }
.rs-hero.profit .rs-value { color: var(--profit); }
.rs-hero.loss .rs-value { color: var(--loss); }
.rs-hero.warn .rs-value { color: var(--warn); }

.rs-trend { font-size: 14px; margin-left: 4px; }
.rs-trend.up { color: var(--profit); }
.rs-trend.down { color: var(--loss); }

.rs-divider { width: 1px; align-self: stretch; background: var(--line); }

.rs-stat { display: flex; flex-direction: column; gap: 2px; }

.diagnostic {
    padding: 8px 20px; font-size: 13.5px; font-weight: 500;
    border-top: 1px dashed var(--line-strong);
}
.diagnostic.ok { background: var(--profit-soft); color: var(--profit); }
.diagnostic.warn { background: var(--warn-soft); color: var(--warn); }
.diagnostic.danger { background: var(--loss-soft); color: var(--loss); }

/* ---------- Perspective / city rows ---------- */
.app { max-width: var(--container); margin: 0 auto; padding: 22px 20px 0; }

.perspective-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.city-row { display: flex; align-items: center; gap: 12px; }

.row-label { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }

.seg-toggle {
    display: inline-flex; background: var(--panel-2);
    border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px;
}
.seg-btn {
    border: 0; background: transparent; cursor: pointer;
    font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--ink-2);
    padding: 8px 16px; border-radius: 999px;
}
.seg-toggle.seg-sm .seg-btn { padding: 6px 13px; font-size: 13.5px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: var(--gold); color: var(--ink); }

/* ---------- Saved scenarios / compare ---------- */
.saved-rail, .compare-banner {
    margin-top: 16px; padding: 12px 16px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
}
.rail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rail-title { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.scenario-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13.5px;
}
.scenario-chip .load { cursor: pointer; font-weight: 500; color: var(--ink); }
.scenario-chip .load:hover { color: var(--gold-deep); }
.scenario-chip .x {
    cursor: pointer; width: 20px; height: 20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-3); font-size: 13px;
}
.scenario-chip .x:hover { background: var(--loss-soft); color: var(--loss); }

.compare-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-color: var(--gold); background: var(--gold-soft); }
.compare-banner .muted { color: var(--ink-2); }

/* ---------- Buttons ---------- */
.primary-btn, .submit-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--gold); color: var(--ink);
    border: 1px solid var(--gold); border-radius: 10px;
    font-family: var(--font); font-weight: 700; font-size: 15px;
    padding: 11px 20px; cursor: pointer; min-height: 44px;
}
.primary-btn:hover, .submit-btn:hover { filter: brightness(1.05); }

.ghost-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: transparent; color: var(--ink-2);
    border: 1px solid var(--line-strong); border-radius: 10px;
    font-family: var(--font); font-weight: 600; font-size: 14px;
    padding: 9px 16px; cursor: pointer; min-height: 40px; text-decoration: none;
}
.ghost-btn:hover { color: var(--ink); background: var(--panel-2); }
.ghost-btn.small { padding: 6px 12px; min-height: 32px; font-size: 13px; }

.link-btn {
    background: none; border: 0; cursor: pointer; padding: 0;
    color: var(--gold-deep); font-family: var(--font); font-size: 13.5px; font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- Grid ---------- */
.grid {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px;
    margin-top: 22px; align-items: start;
}

/* ---------- Cards & accordions ---------- */
.card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 18px;
}

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.card-title {
    font-family: var(--font-display); font-weight: 700;
    font-size: 17px; letter-spacing: -0.01em;
}

.acc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); margin-top: 12px; overflow: hidden; }
.col-inputs > .acc:first-child, .vehicle-card + .acc, #driver_specific_inputs .acc, #owner_capital_inputs .acc { margin-top: 12px; }
#driver_specific_inputs, #owner_capital_inputs { margin-top: 0; }

.acc-head {
    list-style: none; display: flex; align-items: center; gap: 10px;
    padding: 15px 18px; cursor: pointer; user-select: none;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.acc-summary { margin-left: auto; color: var(--ink-3); font-size: 13.5px; font-weight: 500; }
.chev { color: var(--ink-3); transition: transform .18s; font-size: 15px; }
.acc[open] .chev { transform: rotate(180deg); }
.acc-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }

/* ---------- Fields ---------- */
.field { margin-top: 14px; }
.field:first-child { margin-top: 4px; }

.field label, .input-group label {
    display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px;
}
.field .unit { color: var(--ink-3); font-weight: 500; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

input[type="number"], input[type="text"], input[type="email"], select, textarea {
    width: 100%; min-height: 44px; padding: 10px 12px;
    background: var(--panel-2); border: 1px solid var(--line-strong);
    border-radius: var(--r-sm); color: var(--ink);
    font-family: var(--font); font-size: 15px;
}
select {
    appearance: none; -webkit-appearance: none;
    padding-right: 36px;
}
input:disabled { color: var(--ink-3); background: transparent; }
textarea { resize: vertical; }

.input-currency { position: relative; }
.input-currency .prefix {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--ink-3); font-weight: 600; font-size: 14px; pointer-events: none;
}
.input-currency input { padding-left: 30px; }

input[type="range"] { width: 100%; accent-color: var(--gold); min-height: 28px; }
.slider-row { display: block; }

.value-tag {
    display: inline-block; background: var(--gold-soft); color: var(--gold-deep);
    font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 6px;
    margin-left: 4px;
}

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; margin-top: 10px; }
.check input { width: 17px; height: 17px; accent-color: var(--gold); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preset-chip {
    background: var(--panel-2); border: 1px solid var(--line-strong);
    border-radius: 999px; padding: 7px 13px; min-height: 34px;
    font-family: var(--font); font-size: 13.5px; font-weight: 600; color: var(--ink-2);
    cursor: pointer;
}
.preset-chip:hover { border-color: var(--gold); color: var(--ink); background: var(--gold-soft); }
.preset-chip.active { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.preset-chip.lg { padding: 10px 16px; font-size: 14.5px; min-height: 42px; }

/* Platform rocker */
.platform-rocker {
    position: relative; display: inline-flex; background: var(--panel-2);
    border: 1px solid var(--line-strong); border-radius: 12px; padding: 4px; gap: 2px;
}
.rocker-thumb {
    position: absolute; top: 4px; left: 4px;
    width: calc(50% - 6px); height: calc(100% - 8px);
    background: var(--ink); border-radius: 9px;
    transition: transform .2s ease;
}
.platform-rocker[data-active="bolt"] .rocker-thumb { transform: translateX(calc(100% + 4px)); }
.rocker-opt {
    position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer;
    padding: 9px 18px; color: var(--ink-3); border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
.rocker-opt[aria-checked="true"] { color: var(--paper); }
.rocker-opt[aria-checked="true"] svg { color: var(--gold); }

.tier-indicator {
    display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600;
    color: var(--gold-deep); background: var(--gold-soft);
    padding: 5px 11px; border-radius: 999px;
}

/* ---------- Vehicle carousel ---------- */
.vehicle-carousel {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px 2px 10px;
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.vehicle-carousel::-webkit-scrollbar { height: 6px; }
.vehicle-carousel::-webkit-scrollbar-track { background: transparent; }
.vehicle-carousel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.vehicle-chip {
    scroll-snap-align: start; flex: 0 0 168px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 10px; cursor: pointer;
    text-align: left; font-family: var(--font);
    transition: border-color .15s, background-color .15s;
}
.vehicle-chip:hover { border-color: var(--line-strong); }
.vehicle-chip.active { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }

.vc-img {
    position: relative; height: 84px; border-radius: 8px;
    background: radial-gradient(90% 90% at 50% 30%, var(--panel-2), var(--paper));
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
}
.vc-img img { max-height: 68px; max-width: 86%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(26,28,24,.18)); }

.vc-tier {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    background: var(--gold); color: var(--ink);
    font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px;
    box-shadow: inset 0 0 0 1.5px rgba(26, 28, 24, .8);
}

.vc-name { font-size: 13.5px; font-weight: 600; margin-top: 9px; color: var(--ink); }
.vc-rent { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; font-variant-numeric: tabular-nums; }

/* ---------- Receipt (results) ---------- */
.col-results { position: relative; }

.chart-card { padding: 18px; }
.canvas-wrap { height: 280px; position: relative; }
.canvas-wrap canvas { max-width: 100%; }

/* The signature trip sheet */
.metrics {
    position: relative; margin-top: 18px;
    background: var(--panel);
    border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    padding: 26px 20px 20px;
    box-shadow: var(--shadow-sm);
    animation: printIn .5s cubic-bezier(.2, .8, .25, 1) both;
}
/* torn perforation where the receipt meets the chart panel */
.metrics::before {
    content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 14px;
    background-image: radial-gradient(circle at 9px 0, var(--paper) 5.5px, transparent 6px);
    background-size: 26px 14px; background-position: 3px 0;
    background-repeat: repeat-x;
}

.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 2px; border-top: 2px dashed var(--line-strong); }
.metric:first-of-type { border-top: 0; padding-top: 0; }

.metric-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.metric-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.metric-value { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; text-align: right; }
.metric-value .cur, .metric-value.sm .cur { color: var(--ink-3); font-size: .8em; margin-right: 1px; }
.metric-value.sm { font-size: 18px; }

.metric-hero { display: block; position: relative; padding: 2px 0 16px; }
.metric-hero .metric-label { font-size: 14.5px; }
.metric-hero .metric-value { font-size: clamp(38px, 5vw, 50px); font-weight: 800; letter-spacing: -0.03em; text-align: left; color: var(--profit); margin-top: 2px; }
.metric-hero .metric-value .loss { color: var(--loss); }
.metric-hero .metric-sub { margin-top: 4px; }

/* rubber stamp verdict */
.stamp {
    position: absolute; top: 6px; right: 0;
    transform: rotate(-6deg);
    font-family: var(--font-display); font-weight: 800; font-size: 13px;
    letter-spacing: .09em; text-transform: uppercase;
    color: var(--profit); border: 2.5px solid currentColor; border-radius: 7px;
    padding: 5px 11px; opacity: .9;
    box-shadow: inset 0 0 0 1.5px var(--panel), inset 0 0 0 2.5px currentColor;
    animation: stampIn .22s cubic-bezier(.2, 1.4, .4, 1) .12s both;
}
body[data-verdict="loss"] .stamp { color: var(--loss); }
body[data-verdict="warn"] .stamp { color: var(--warn); }

/* Driver breakdown rows */
#driver_breakdown { margin-top: 4px; }
.brk-sentence { display: flex; gap: 12px; padding: 12px 2px; border-top: 2px dashed var(--line-strong); }
.brk-sentence.income { border-top: 0; }
.brk-icon {
    flex: 0 0 34px; height: 34px; border-radius: 9px;
    background: var(--panel-2); border: 1px solid var(--line);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.brk-line { font-size: 14.5px; color: var(--ink-2); }
.brk-line strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.brk-sentence.income .brk-line strong { color: var(--profit); }
.brk-sentence.cost .brk-line strong { color: var(--loss); }
.brk-note { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.brk-keep {
    display: flex; gap: 12px; align-items: center; margin-top: 14px;
    padding: 14px 14px; border-radius: var(--r-md);
    background: var(--profit-soft); border: 1px solid var(--profit);
}
.brk-keep .brk-line strong { color: var(--profit); font-size: 16px; }
.brk-keep.warn { background: var(--warn-soft); border-color: var(--warn); }
.brk-keep.warn .brk-line strong { color: var(--warn); }
.brk-keep.loss { background: var(--loss-soft); border-color: var(--loss); }
.brk-keep.loss .brk-line strong { color: var(--loss); }

/* value flash on recalculation */
.value-flash { animation: flashValue .45s ease; }
.value-flash.loss { --flash: var(--loss); }
@keyframes flashValue { 0% { opacity: .25; } 100% { opacity: 1; } }

@keyframes printIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stampIn { from { opacity: 0; transform: rotate(-6deg) scale(1.7); } to { opacity: .9; transform: rotate(-6deg) scale(1); } }

/* ---------- Hits ---------- */
.hits-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.hits-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--ink-2); }
.quick-hits { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.dynamic-hit { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 10px; padding: 12px; background: var(--panel-2); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.dynamic-hit .field { margin-top: 0; }
.del-btn {
    border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-3);
    width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.del-btn:hover { color: var(--loss); border-color: var(--loss); background: var(--loss-soft); }

/* ---------- Action bar ---------- */
.action-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
    background: var(--panel); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.action-bar { display: flex; height: var(--bar-h); }
.bar-btn {
    flex: 1; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; cursor: pointer;
    font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
.bar-btn:hover, .bar-btn.active { color: var(--gold-deep); }
.bar-btn svg { width: 20px; height: 20px; }

/* ---------- Modals ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(20, 21, 17, .5);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
    width: 100%; max-width: 420px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--shadow-md);
    padding: 22px;
}
.modal h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 12px; }
.modal ul { margin: 0 0 14px 18px; color: var(--ink-2); font-size: 14.5px; }
.modal li { margin-bottom: 6px; }
.modal input { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Where to next (CTA) ---------- */
.next-steps { margin-top: 56px; }
.section-heading {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.02em;
}
.section-subtitle { color: var(--ink-3); font-size: 15px; margin-top: 6px; }

.next-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 22px; }

.next-card {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 18px; text-decoration: none; color: var(--ink);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.next-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.next-glyph {
    flex: 0 0 40px; height: 40px; border-radius: 10px;
    background: var(--gold-soft); color: var(--gold-deep);
    display: inline-flex; align-items: center; justify-content: center;
}
.next-glyph svg { width: 20px; height: 20px; }

.next-card h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; }
.next-card p { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.45; }
.next-card .price-tag {
    display: inline-block; margin-left: 6px; background: var(--gold); color: var(--ink);
    font-size: 11.5px; font-weight: 800; padding: 1px 7px; border-radius: 5px; vertical-align: 2px;
}
.next-card.soon { opacity: .68; }
.soon-chip {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--ink-3);
    border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 7px; margin-left: 6px;
    vertical-align: 2px;
}

/* Newsletter — the one ink panel */
.newsletter-card {
    background: var(--ink); color: var(--paper);
    border-radius: var(--r-md); padding: 22px;
}
.newsletter-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.newsletter-card p { font-size: 13.5px; opacity: .75; margin-top: 5px; }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
/* scoped so the global input styles can't out-specify the inverted panel */
.newsletter-form input.newsletter-input {
    flex: 1 1 150px; min-height: 44px; padding: 10px 12px;
    background: color-mix(in srgb, var(--paper) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--paper) 25%, transparent);
    border-radius: 9px; color: var(--paper); font-family: var(--font); font-size: 14.5px;
}
.newsletter-form input.newsletter-input::placeholder { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.newsletter-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--gold); color: var(--ink);
    border: 0; border-radius: 9px; padding: 10px 18px; min-height: 44px;
    font-family: var(--font); font-weight: 700; font-size: 14.5px; cursor: pointer;
}
.newsletter-btn:hover { filter: brightness(1.06); }
.newsletter-success { font-weight: 600; margin-top: 12px; }
.newsletter-proof { font-size: 12.5px; opacity: .6; margin-top: 10px; }

/* ---------- Guides ---------- */
.guides { margin-top: 56px; }
.guide-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 22px; }
.guide-card {
    display: block; background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 18px; text-decoration: none; color: var(--ink);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.guide-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.guide-tag {
    display: inline-block; background: var(--gold-soft); color: var(--gold-deep);
    border: 1px solid var(--gold); border-radius: 4px;
    font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    padding: 2px 7px;
    box-shadow: inset 0 0 0 1px rgba(26, 28, 24, .25);
}
.guide-card h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; margin-top: 10px; letter-spacing: -0.01em; }
.guide-card p { font-size: 13.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.45; }

/* ---------- Contact & footer ---------- */
.contact-section { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.contact-form { max-width: 640px; margin-top: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-group { margin-bottom: 14px; }
.select-wrapper { position: relative; }
.select-wrapper::after {
    content: ""; position: absolute; right: 14px; top: 50%;
    width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
    transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.success-message {
    display: none; margin-top: 14px; padding: 12px 16px;
    background: var(--profit-soft); color: var(--profit);
    border: 1px solid var(--profit); border-radius: var(--r-sm); font-size: 14.5px; font-weight: 500;
}

.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 26px 0 34px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.footer-note { color: var(--ink-3); font-size: 13.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.footer-links a:hover { color: var(--gold-deep); text-decoration: underline; }

/* ---------- PDF export ---------- */
body.pdf-rendering .no-pdf { display: none !important; }
body.pdf-rendering { padding-bottom: 0 !important; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
    .next-grid { grid-template-columns: 1fr 1fr; }
    .guide-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
    .grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 24px; }
    .col-results { position: sticky; top: calc(var(--topbar-h) + var(--strip-h) + 16px); }
    .canvas-wrap { height: 320px; }

    .action-bar {
        position: static; height: auto; background: none; border-top: 0;
        justify-content: flex-end; gap: 10px; padding: 0; margin-top: 20px;
    }
    .bar-btn {
        flex: 0 0 auto; flex-direction: row; gap: 8px;
        border: 1px solid var(--line-strong); border-radius: 10px;
        padding: 10px 16px; font-size: 14px; min-height: 42px; background: var(--panel);
    }

    .next-grid.featured-2 { grid-template-columns: 1fr 1fr; }
    .newsletter-card { grid-column: 1 / -1; display: flex; align-items: center; gap: 28px; }
    .newsletter-card .nl-copy { flex: 1 1 320px; }
    .newsletter-form { flex: 1 1 380px; margin-top: 0; }
}

@media (max-width: 1023px) {
    .site-nav { display: none; }
    .result-strip-inner { gap: 18px; padding: 10px 20px; }
    .rs-divider { display: none; }
    .rs-stat { margin-left: auto; }
    .rs-stat + .rs-stat { margin-left: 0; }
}

@media (max-width: 640px) {
    .app { padding: 18px 16px 0; }
    .site-header-inner { padding: 0 16px; }
    .hero { padding: 28px 0 22px; }
    .hero-meta { gap: 6px 14px; }
    .field-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .vehicle-chip { flex-basis: 150px; }
    .rs-value { font-size: 21px; }
    .rs-value.sm { font-size: 15px; }
    .rs-label { font-size: 11.5px; }
    .stamp { font-size: 11px; padding: 4px 8px; top: 0; }
    .result-strip-inner { flex-wrap: wrap; row-gap: 4px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .metrics, .stamp { animation: none; }
}

/* =========================================================
   Phase-2 additions — shared chrome for all main pages
========================================================= */

/* Legacy token aliases (retainer pages / engine inline styles) */
:root, body.light-theme {
    --text: var(--ink);
    --danger: var(--loss);
    --accent: var(--gold-deep);
    --accent-2: var(--gold-deep);
    --bg: var(--paper);
    --surface: var(--panel);
    --surface-2: var(--panel-2);
    --surface-3: var(--panel-2);
    --border: var(--line);
}
body:not(.light-theme) {
    --text: var(--ink);
    --danger: var(--loss);
    --accent: var(--gold-deep);
    --accent-2: var(--gold-deep);
    --bg: var(--paper);
    --surface: var(--panel);
    --surface-2: var(--panel-2);
    --surface-3: var(--panel-2);
    --border: var(--line);
}

/* ---------- Inner-page hero ---------- */
.page-hero { padding: 36px 0 8px; }
.page-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
}
.page-hero .page-sub { margin-top: 10px; color: var(--ink-2); font-size: 16.5px; max-width: 62ch; }
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 56px; }

/* ---------- Fuel price board ---------- */
.board {
    background: var(--ink); color: var(--paper);
    border-radius: var(--r-lg); padding: 28px 26px;
    margin-top: 20px;
}
.board-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.board-grid { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 14px; }
.board-chip { min-width: 118px; }
.board-chip .fuel-type { font-size: 12.5px; opacity: .65; font-weight: 600; }
.board-chip .fuel-price {
    font-family: var(--font-display); font-weight: 800; font-size: 27px;
    letter-spacing: -0.02em; color: var(--gold); margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.board-chip .fuel-unit { font-size: 11.5px; opacity: .55; }
.board-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(255,255,255,.22); }
.board-meta .seg-toggle { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.board-meta .seg-btn { color: rgba(255,255,255,.75); }
.board-meta .seg-btn.active { background: var(--gold); color: var(--ink); }
.board-note { font-size: 12.5px; opacity: .6; }

/* ---------- Fuel calculator sections ---------- */
.calc-section {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 22px; margin-top: 18px;
}
.calc-section > h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: 19px; letter-spacing: -0.01em; margin-bottom: 14px;
}
.calc-section .lede { color: var(--ink-3); font-size: 14px; margin-bottom: 12px; }

.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vehicle-opt {
    background: var(--panel-2); border: 1.5px solid var(--line);
    border-radius: var(--r-md); padding: 12px 14px; cursor: pointer;
    text-align: left; font-family: var(--font);
    transition: border-color .15s, background-color .15s;
}
.vehicle-opt:hover { border-color: var(--gold); }
.vehicle-opt.selected { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.vehicle-opt .v-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.vehicle-opt .v-detail { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.vehicle-opt .v-consumption { font-size: 13px; color: var(--gold-deep); font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

.km-slider-group { margin-top: 18px; }
.km-slider-group > label {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px;
}
.km-slider-group .km-value {
    font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; }
.result-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.result-card .r-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.result-card .r-value {
    font-family: var(--font-display); font-weight: 800; font-size: 22px;
    letter-spacing: -0.01em; color: var(--ink); margin-top: 3px;
    font-variant-numeric: tabular-nums;
}
.result-card .r-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.result-card.highlight { border-color: var(--gold); background: var(--gold-soft); }
.result-card.highlight .r-value { color: var(--gold-deep); }
.result-card.warn { border-color: var(--warn); background: var(--warn-soft); }
.result-card.warn .r-value { color: var(--warn); }

/* ---------- Ledger tables ---------- */
.table-wrap { overflow-x: auto; }
.ledger-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.ledger-table th {
    text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-3);
    padding: 8px 12px; border-bottom: 2px solid var(--line-strong); white-space: nowrap;
}
.ledger-table td {
    padding: 9px 12px; border-bottom: 1px solid var(--line);
    color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ledger-table tr:hover td { background: var(--panel-2); }
.ledger-table .col-highlight { color: var(--warn); font-weight: 600; }
.ledger-table .cheapest { color: var(--profit); font-weight: 700; }
.ledger-table .expensive { color: var(--loss); }
.ledger-table tr.highlight-row td { background: var(--gold-soft); color: var(--ink); font-weight: 600; }

/* ---------- FAQ ---------- */
.faq-item {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r-md); margin-top: 10px; overflow: hidden;
}
.faq-item summary {
    list-style: none; cursor: pointer; user-select: none;
    padding: 15px 18px; font-weight: 600; font-size: 15px; color: var(--ink);
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 19px; color: var(--ink-3); font-weight: 500; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-answer { padding: 2px 18px 18px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14.5px; }
.faq-item .faq-answer ul { margin: 8px 0 8px 20px; }
.faq-item .faq-answer li { margin-bottom: 5px; }
.faq-item .faq-answer strong { color: var(--ink); }
.faq-item .faq-answer a { color: var(--gold-deep); }

/* ---------- Alert signup ---------- */
.alert-signup {
    background: var(--gold-soft); border: 1px solid var(--gold);
    border-radius: var(--r-md); padding: 22px; margin-top: 18px; text-align: center;
}
.alert-signup h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.alert-signup p { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.alert-form { display: flex; gap: 10px; max-width: 430px; margin: 14px auto 0; }
.alert-form input { flex: 1; }
.alert-form .primary-btn { white-space: nowrap; }
.alert-signup .fineprint { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ---------- Prose (about page) ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin: 30px 0 10px; letter-spacing: -0.01em; }
.prose p, .prose li { color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }
.prose ul { margin: 8px 0 8px 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--gold-deep); }
.prose strong { color: var(--ink); }

/* ---------- Consent banner ---------- */
.consent {
    position: fixed; left: 16px; bottom: 16px; z-index: 70;
    max-width: 360px;
    background: var(--panel); border: 1px solid var(--line-strong);
    border-radius: var(--r-md); box-shadow: var(--shadow-md);
    padding: 16px;
}
.consent p { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.consent strong { color: var(--ink); }
.consent-actions { display: flex; gap: 8px; margin-top: 12px; }
@media (max-width: 480px) { .consent { left: 12px; right: 12px; max-width: none; } }
body.app-page .consent { bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 12px); }

/* ---------- Mobile sticky CTA (fuel page) ---------- */
.mobile-sticky-cta {
    position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 35; display: none;
}
.mobile-sticky-cta a {
    display: flex; align-items: center; justify-content: center;
    background: var(--gold); color: var(--ink); text-decoration: none;
    font-weight: 700; font-size: 15px; border-radius: 12px;
    padding: 14px 18px; box-shadow: var(--shadow-md);
}
@media (min-width: 1024px) { .mobile-sticky-cta { display: none !important; } }

/* ---------- Tracker page shared ---------- */
.tracker-wrap { max-width: 960px; margin: 0 auto; padding: 0 20px 40px; }
.site-footer--slim { border-top: 1px solid var(--line); padding: 22px 0 30px; margin-top: 40px; }

@media (max-width: 640px) {
    .board { padding: 22px 18px; }
    .board-chip .fuel-price { font-size: 22px; }
    .calc-section { padding: 16px; }
    .page-wrap { padding: 0 16px 48px; }
}

/* Breakdown icon tiles: gold for income, red for costs */
.brk-sentence.income .brk-icon { color: var(--profit); background: var(--profit-soft); border-color: var(--profit); }
.brk-sentence.cost .brk-icon { color: var(--loss); background: var(--loss-soft); border-color: var(--loss); }
.brk-keep .brk-icon { background: transparent; border-color: currentColor; color: inherit; }

/* ---------- AI Matchmaker: promo banner + homepage spotlight ---------- */
.mm-banner {
    background: linear-gradient(95deg, #8F6400 0%, var(--gold) 45%, #FFC64D 100%);
    border-bottom: 1px solid rgba(26, 28, 24, .25);
}
.mm-banner-inner {
    max-width: var(--container); margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 6px;
}
.mm-banner-link {
    flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
    padding: 11px 0; text-decoration: none; color: #1A1C18; min-width: 0;
}
.mm-banner-pulse {
    font-size: 10.5px; font-weight: 800; letter-spacing: .09em;
    background: #1A1C18; color: var(--gold); border-radius: 999px; padding: 3px 9px;
    animation: mmGlow 1.6s ease-in-out infinite;
}
@keyframes mmGlow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.mm-banner-text { font-size: 13.5px; line-height: 1.45; flex: 1; min-width: 220px; }
.mm-banner-text strong { font-weight: 800; }
.mm-banner-cta {
    font-weight: 800; font-size: 13.5px; white-space: nowrap;
    background: #1A1C18; color: #FFD37A; border-radius: 999px; padding: 7px 15px;
    transition: transform .12s;
}
.mm-banner-link:hover .mm-banner-cta { transform: translateX(3px); }
.mm-banner-close {
    background: none; border: none; color: rgba(26,28,24,.75); font-size: 22px; font-weight: 700;
    cursor: pointer; padding: 4px 8px; line-height: 1; border-radius: 6px;
}
.mm-banner-close:hover { color: #1A1C18; background: rgba(26,28,24,.08); }

.mm-spotlight {
    background:
        radial-gradient(900px 380px at 85% -10%, rgba(240,165,0,.16), transparent 60%),
        var(--panel-2);
    border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
    padding: 46px 0 42px; margin-top: 34px;
}
.mm-spot-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 34px; align-items: center; }
.mm-spot-tag {
    display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase; color: var(--gold-deep); background: var(--gold-soft);
    border: 1px solid var(--gold); border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
.mm-spot-title {
    font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 4vw, 36px);
    line-height: 1.08; color: var(--ink); margin: 0 0 12px;
}
.mm-spot-title em { font-style: normal; color: var(--gold-deep); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-color: var(--gold); }
.mm-spot-sub { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); margin: 0 0 16px; max-width: 640px; }
.mm-spot-points { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; }
.mm-spot-points li { font-size: 14px; color: var(--ink-2); padding-left: 26px; position: relative; }
.mm-spot-points li::before { content: "✓"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--profit); background: var(--profit-soft); border-radius: 999px; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.mm-spot-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mm-spot-btn {
    display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 16px;
    background: var(--gold); color: #1A1C18; text-decoration: none;
    padding: 14px 26px; border-radius: var(--r-md);
    box-shadow: 0 4px 18px rgba(240, 165, 0, .4); transition: transform .12s, box-shadow .12s;
}
.mm-spot-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 24px rgba(240, 165, 0, .5); }
.mm-spot-jev {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    font-size: 13px; font-weight: 600; color: var(--ink-3);
    border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px 6px 6px;
    background: var(--panel); transition: border-color .15s;
}
.mm-spot-jev:hover { border-color: var(--gold); color: var(--ink-2); }
.mm-spot-jev img { width: 22px; height: 22px; border-radius: 5px; }
.mm-spot-jev b { color: var(--ink); }

.mm-spot-visual { display: flex; flex-direction: column; align-items: center; gap: 0; }
.mm-spot-visual .mm-spot-ring { position: relative; width: 108px; height: 108px; }
.mm-spot-visual svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mm-spot-ring b {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--ink); padding-bottom: 10px;
}
.mm-spot-ring span {
    position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 22px;
}
.mm-spot-ring.r1 { z-index: 3; animation: mmFloat 5s ease-in-out infinite; }
.mm-spot-ring.r2 { margin: -30px 0 0 96px; z-index: 2; animation: mmFloat 6s .6s ease-in-out infinite; }
.mm-spot-ring.r3 { margin: -24px 0 0 -92px; z-index: 1; animation: mmFloat 7s .3s ease-in-out infinite; }
@keyframes mmFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.mm-spot-cap { font-size: 12px; color: var(--ink-3); text-align: center; margin: 20px 0 0; font-style: italic; }
@media (max-width: 860px) {
    .mm-spot-grid { grid-template-columns: 1fr; }
    .mm-spot-visual { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 14px; }
    .mm-spot-ring.r2 { margin: 0; } .mm-spot-ring.r3 { margin: 0; }
    .mm-spot-cap { width: 100%; }
}
@media (max-width: 560px) {
    .mm-banner-cta { display: none; }
}

/* ---------- Driver breakdown: inline cost editors ---------- */
.brk-sentence.brk-editable { cursor: default; }
.brk-edit-btn {
    align-self: center; flex: 0 0 auto; margin-left: auto;
    background: none; border: 1px solid var(--line-strong); color: var(--ink-3);
    border-radius: 7px; width: 27px; height: 27px; font-size: 13px; line-height: 1;
    cursor: pointer; opacity: 0; transition: opacity .12s, color .12s, border-color .12s;
}
.brk-editable:hover .brk-edit-btn, .brk-editable:focus-within .brk-edit-btn { opacity: 1; }
.brk-edit-btn:hover { color: var(--gold-deep); border-color: var(--gold); }
.brk-editable[data-open="1"] { border-color: var(--gold); }
.brk-editable[data-open="1"] .brk-edit-btn { opacity: 1; color: var(--gold-deep); border-color: var(--gold); }
.brk-sentence.brk-zero .brk-line strong { color: var(--ink-3); }
.brk-sentence.brk-zero::after {
    content: 'removed — tap ✎ to add back'; display: block;
    font-size: 11.5px; color: var(--ink-3); font-style: italic; margin-top: 2px;
}
.brk-editor {
    display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end;
    padding: 12px 4px 4px; margin-top: 10px;
    border-top: 1px dashed var(--line-strong); width: 100%;
}
.brk-field { display: flex; flex-direction: column; gap: 4px; }
.brk-field span { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; }
.brk-field input {
    width: 96px; padding: 7px 9px; font-size: 14px; font-variant-numeric: tabular-nums;
    border: 1px solid var(--line-strong); border-radius: 8px;
    background: var(--panel); color: var(--ink);
}
.brk-field input:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold); }
.brk-remove {
    background: none; border: 1px dashed rgba(192,57,43,.5); color: var(--loss);
    border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
    margin-left: auto;
}
.brk-remove:hover { background: var(--loss-soft); border-style: solid; }
@media (hover: none) {
    .brk-edit-btn { opacity: 1; } /* touch: always show */
}
.brk-done {
    background: var(--profit); color: #fff; border: none; border-radius: 8px;
    padding: 7px 14px; font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.brk-done:hover { filter: brightness(1.08); }
.brk-remove { margin-left: 0; }
.brk-editor .brk-done { margin-left: auto; }

/* "Why this car" strip — compact loss decomposition in the driver panel */
.brk-why {
    border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
    padding: 10px 13px; margin-top: 12px; background: var(--panel-2);
}
.brk-why-head {
    font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: var(--warn); margin-bottom: 7px;
}
.brk-why-row {
    font-size: 12.8px; color: var(--ink-2); line-height: 1.45; margin-bottom: 5px;
    display: flex; gap: 7px; align-items: baseline;
}
.brk-why-row:last-of-type { margin-bottom: 0; }
.brk-why-row b { color: var(--ink); }
.brk-why-tip {
    margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line);
    font-size: 11.8px; color: var(--ink-3);
}
.brk-why-tip a { color: var(--gold-deep); font-weight: 700; }
