/* =====================================================================
   VRM Dashboard — shared design system
   build: 2026-08-21-b
   Signature: real UK number-plate styling used for VRM inputs & chips
   throughout, tying every screen back to the actual subject matter.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
    --canvas: #F5F6F4;
    --surface: #FFFFFF;
    --surface-sunken: #EEF1EE;
    --border: #DDE2DD;
    --ink: #12181B;
    --muted: #5B6670;
    --faint: #8A9199;

    --brand: #0B3D2E;
    --brand-ink: #0B3D2E;
    --brand-soft: #E7EFEA;
    --brand-line: #C6D8CE;
    /* Foreground/text use of the accent colour (links, headings, icons).
       Equals --brand in light mode; dark mode gives each accent a
       brighter tint here specifically, since the same saturated hues
       that read fine on white lose contrast against a dark canvas. */
    --brand-text: #0B3D2E;

    --plate-yellow: #FFD100;
    --plate-white: #FFFFFF;
    --plate-blue: #12297A;

    --success: #1E7A46;
    --success-soft: #E7F4EC;
    --success-line: #BEE0CB;

    --danger: #B3261E;
    --danger-soft: #FBEAE9;
    --danger-line: #F0C2BF;

    --warning: #9A6700;
    --warning-soft: #FBF3DF;
    --warning-line: #E9D190;

    --info: #1D5A8A;
    --info-soft: #E8F1F8;
    --info-line: #BFDAEC;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(18, 24, 27, 0.06);
    --shadow-md: 0 4px 16px rgba(18, 24, 27, 0.08);
    --shadow-lg: 0 12px 32px rgba(18, 24, 27, 0.12);

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-data: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 600;
    margin: 0;
}

a { color: var(--brand-text); }
a:hover { color: var(--ink); }

/* ---------------------------------------------------------------
   Topbar / nav — shared across index.php and valuation.php
   --------------------------------------------------------------- */
.topbar {
    background: var(--brand);
    color: #fff;
    padding: 0 24px;
}
.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
}
.wordmark-badge {
    width: 28px; height: 20px;
    background: var(--plate-yellow);
    border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1.5px rgba(18,24,27,0.65);
}
.wordmark-badge span {
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 9px;
    color: #12181B;
    letter-spacing: 0.5px;
}
.topnav {
    display: flex;
    gap: 4px;
}
.topnav a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.topnav a.active { color: #fff; background: rgba(255,255,255,0.14); }

.env-pill {
    font-family: var(--font-data);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(255,209,0,0.18);
    color: var(--plate-yellow);
    border: 1px solid rgba(255,209,0,0.35);
}

/* ---------------------------------------------------------------
   Page shell
   --------------------------------------------------------------- */
.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}
.page-head {
    margin-bottom: 28px;
}
.page-head h1 {
    font-size: 1.7rem;
    letter-spacing: -0.01em;
}
.page-head p {
    color: var(--muted);
    margin: 6px 0 0;
    font-size: 0.95rem;
}

/* ---------------------------------------------------------------
   Plate-styled search — the signature element
   --------------------------------------------------------------- */
.search-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 32px;
}
.search-panel form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.plate-field { display: flex; flex-direction: column; gap: 6px; }
.plate-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* The plate itself: yellow plaque, blue GB strip, embossed black text */
.plate-input-wrap {
    display: flex;
    align-items: stretch;
    height: 56px;
    border-radius: 6px;
    border: 2.5px solid #12181B;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    width: fit-content;
}
.plate-gb-strip {
    background: var(--plate-blue);
    color: #fff;
    width: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.6rem;
    letter-spacing: 0.03em;
    gap: 3px;
    flex-shrink: 0;
}
.plate-gb-strip .stars { font-size: 8px; line-height: 1; color: #FFD100; }
.plate-input-wrap input[type="text"] {
    background: var(--plate-yellow);
    border: none;
    outline: none;
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #12181B;
    padding: 0 16px;
    width: 230px;
    height: 100%;
}
.plate-input-wrap input[type="text"]::placeholder {
    color: rgba(18,24,27,0.35);
    letter-spacing: 0.06em;
}
.plate-field.small .plate-input-wrap { height: 48px; }
.plate-field.small .plate-input-wrap input[type="text"] { font-size: 1.15rem; width: 150px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.field input[type="text"],
.field input[type="number"] {
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.field.narrow input { width: 110px; }

.btn {
    height: 56px;
    padding: 0 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn:hover { filter: brightness(0.85); }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; justify-content: center; }

/* ---------------------------------------------------------------
   Result plate chip — used as the page/result header
   --------------------------------------------------------------- */
.result-plate {
    display: inline-flex;
    align-items: stretch;
    height: 46px;
    border-radius: 5px;
    border: 2px solid #12181B;
    overflow: hidden;
    margin-bottom: 20px;
}
.result-plate .plate-gb-strip { width: 26px; font-size: 0.5rem; }
.result-plate .plate-text {
    background: var(--plate-yellow);
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    color: #12181B;
}

/* ---------------------------------------------------------------
   Cards
   --------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
}
.card-head:hover { background: var(--surface-sunken); }
.card-head:focus-visible, .subgroup-head:focus-visible {
    outline: 2px solid var(--brand-text);
    outline-offset: -2px;
}
.card.is-open .card-head { border-bottom-color: var(--border); }
.card-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.02rem;
}
.card-head-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.card-chevron {
    color: var(--faint);
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}
.card.is-open .card-chevron { transform: rotate(180deg); }
.card-body { padding: 20px 22px 24px; display: none; }
.card.is-open .card-body { display: block; }

/* Hero summary inside the vehicle-details card */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.hero-photo {
    max-width: 220px;
    max-height: 140px;
    object-fit: contain;
    flex-shrink: 0;
}
.hero-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}
.hero-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
}

/* ---------------------------------------------------------------
   Glossary tooltips — pure CSS, keyboard accessible via :focus
   --------------------------------------------------------------- */
.gloss {
    position: relative;
    border-bottom: 1px dotted var(--muted);
    cursor: help;
}
.gloss-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 260px;
    background: var(--ink);
    color: var(--canvas);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 20;
    white-space: normal;
    text-align: left;
}
.gloss-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ink);
}
.gloss:hover .gloss-tip,
.gloss:focus .gloss-tip,
.gloss:focus-visible .gloss-tip {
    display: block;
}

.flag-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--warning-soft);
    border: 1px solid var(--warning-line);
    color: #6b4d00;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 0.88rem;
    margin-bottom: 18px;
}

/* ---------------------------------------------------------------
   Data groups / grids
   --------------------------------------------------------------- */
.section-title {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-text);
    margin: 22px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title:first-child { margin-top: 0; }
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.data-item {
    background: var(--surface);
    padding: 10px 14px;
}
.data-key {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 2px;
}
.data-value {
    font-family: var(--font-data);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}

/* Collapsible sub-accordion for spec categories */
.subgroup { border: 1px solid var(--border); border-radius: var(--radius-md); margin-top: 10px; overflow: hidden; }
.subgroup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: var(--surface-sunken);
    cursor: pointer;
    user-select: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.subgroup-head:hover { background: #E5E9E5; }
.subgroup-chevron { color: var(--faint); font-size: 0.7rem; transition: transform 0.2s ease; }
.subgroup.is-open .subgroup-chevron { transform: rotate(180deg); }
.subgroup-body { display: none; padding: 14px 16px; }
.subgroup.is-open .subgroup-body { display: block; }

/* ---------------------------------------------------------------
   Status tiles (stolen / salvage / scrap)
   --------------------------------------------------------------- */
.status-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.status-tile {
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.status-tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.status-tile-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; }
.status-clear { border-color: var(--success-line); background: var(--success-soft); }
.status-clear .status-dot { background: var(--success); }
.status-clear .status-tile-badge { color: var(--success); }
.status-alert { border-color: var(--danger-line); background: var(--danger-soft); }
.status-alert .status-dot { background: var(--danger); }
.status-alert .status-tile-badge { color: var(--danger); }
.status-unknown { border-color: var(--border); background: var(--surface-sunken); }
.status-unknown .status-dot { background: var(--faint); }
.status-tile-badge { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }

/* ---------------------------------------------------------------
   Tax / notice banners
   --------------------------------------------------------------- */
.notice {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    border: 1px solid;
}
.notice-success { background: var(--success-soft); border-color: var(--success-line); color: #1a5c37; }
.notice-danger { background: var(--danger-soft); border-color: var(--danger-line); color: #8f1f19; }
.notice-info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.notice-warning { background: var(--warning-soft); border-color: var(--warning-line); color: #6b4d00; }

.alert-box {
    background: var(--danger-soft);
    border: 1px solid var(--danger-line);
    color: #8f1f19;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.92rem;
}
.alert-box ul { margin: 8px 0 0 18px; padding: 0; }

.section-error {
    background: var(--danger-soft);
    border: 1px solid var(--danger-line);
    color: #8f1f19;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
}
.unavailable-notice {
    background: var(--surface-sunken);
    border: 1px dashed var(--border);
    color: var(--muted);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
}
.no-results {
    color: var(--muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* No-JS fallback: honour OS-level dark mode preference before our
   inline script has a chance to set data-theme from localStorage. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --canvas: #10151A;
        --surface: #1A2127;
        --surface-sunken: #212A31;
        --border: #313C44;
        --ink: #ECEFF1;
        --muted: #9AA7B0;
        --faint: #6B7880;
    }
}

/* ---------------------------------------------------------------
   Theme: dark mode override
   --------------------------------------------------------------- */
[data-theme="dark"] {
    --canvas: #10151A;
    --surface: #1A2127;
    --surface-sunken: #212A31;
    --border: #313C44;
    --ink: #ECEFF1;
    --muted: #9AA7B0;
    --faint: #6B7880;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ---------------------------------------------------------------
   Theme: accent colour presets — swap the brand hue, leave the
   plate colours (real UK plate yellow/blue) untouched.
   --------------------------------------------------------------- */
[data-accent="green"] { --brand: #0B3D2E; --brand-text: #0B3D2E; --brand-soft: #E7EFEA; --brand-line: #C6D8CE; }
[data-accent="blue"]  { --brand: #123C69; --brand-text: #123C69; --brand-soft: #E7EEF5; --brand-line: #C3D4E5; }
[data-accent="burgundy"] { --brand: #5C1A2B; --brand-text: #5C1A2B; --brand-soft: #F3E7EA; --brand-line: #E0C2CA; }
[data-accent="purple"] { --brand: #3B2159; --brand-text: #3B2159; --brand-soft: #ECE7F3; --brand-line: #D3C5E5; }
[data-accent="teal"] { --brand: #0E4B4B; --brand-text: #0E4B4B; --brand-soft: #E4F0EF; --brand-line: #BFDEDC; }

/* Dark mode: --brand stays the same solid hue for backgrounds (topbar,
   buttons — white text already contrasts fine there), but --brand-text
   switches to a brighter tint for use as foreground text/icon/link
   colour, since the light-mode-tuned dark hues are illegible against a
   dark canvas. */
[data-theme="dark"][data-accent="green"] { --brand-text: #4ADE9C; --brand-soft: rgba(11,61,46,0.35); --brand-line: rgba(198,216,206,0.25); }
[data-theme="dark"][data-accent="blue"]  { --brand-text: #6FA8E8; --brand-soft: rgba(18,60,105,0.35); --brand-line: rgba(195,212,229,0.25); }
[data-theme="dark"][data-accent="burgundy"] { --brand-text: #E894A8; --brand-soft: rgba(92,26,43,0.35); --brand-line: rgba(224,194,202,0.25); }
[data-theme="dark"][data-accent="purple"] { --brand-text: #C4A6E8; --brand-soft: rgba(59,33,89,0.35); --brand-line: rgba(211,197,229,0.25); }
[data-theme="dark"][data-accent="teal"] { --brand-text: #5FD4D4; --brand-soft: rgba(14,75,75,0.35); --brand-line: rgba(191,222,220,0.25); }

/* ---------------------------------------------------------------
   Theme toggle + accent swatches (topbar controls)
   --------------------------------------------------------------- */
.theme-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}
.theme-toggle {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,0.18); }
.accent-swatches { display: flex; align-items: center; gap: 6px; }
.accent-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.accent-dot:hover { transform: scale(1.15); }
.accent-dot.active { border-color: #fff; }
.accent-dot[data-accent-value="green"] { background: #0B3D2E; }
.accent-dot[data-accent-value="blue"] { background: #123C69; }
.accent-dot[data-accent-value="burgundy"] { background: #5C1A2B; }
.accent-dot[data-accent-value="purple"] { background: #3B2159; }
.accent-dot[data-accent-value="teal"] { background: #0E4B4B; }

/* ---------------------------------------------------------------
   Results toolbar (expand/collapse all)
   --------------------------------------------------------------- */
.results-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.expand-all-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.expand-all-btn:hover { background: var(--surface-sunken); border-color: var(--brand); }

/* ---------------------------------------------------------------
   Similar Listings — image-forward card grid
   --------------------------------------------------------------- */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.listing-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}
.listing-card-body { padding: 14px 16px 16px; }
.listing-price {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.listing-heading {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    margin-top: 2px;
}
.listing-heading:hover { color: var(--brand-text); }
.listing-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}
.listing-seller {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    line-height: 1.6;
}
.listing-seller a { font-size: inherit; }

/* Large carousel variant for listing cards (vs the small one in tables) */
.carousel-lg {
    width: 100%;
    height: 170px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
}
.carousel-lg img { width: 100%; height: 170px; object-fit: cover; }
.carousel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-sunken);
    color: var(--faint);
    font-size: 0.8rem;
}

/* ---------------------------------------------------------------
   Mileage chart
   --------------------------------------------------------------- */
.chart-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px 8px;
    height: 220px;
}

/* ---------------------------------------------------------------
   MOT test table
   --------------------------------------------------------------- */
.mot-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.mot-table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1.5px solid var(--border);
}
.mot-table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.mot-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.mot-pass { background: var(--success-soft); color: var(--success); }
.mot-fail { background: var(--danger-soft); color: var(--danger); }
.mot-note { font-size: 0.8rem; display: block; }
.mot-note-major, .mot-note-dangerous { color: var(--danger); }
.mot-note-minor, .mot-note-advisory { color: var(--muted); }

/* ---------------------------------------------------------------
   Generic data tables (valuation page: historic/similar listings)
   --------------------------------------------------------------- */
.data-table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
table.data-table th {
    text-align: left;
    background: var(--brand-soft);
    color: var(--brand-text);
    padding: 10px 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
table.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data-table tr:hover td { background: var(--surface-sunken); }

/* ---------------------------------------------------------------
   Valuation cards
   --------------------------------------------------------------- */
.valuation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.valuation-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}
.valuation-card.highlight {
    background: var(--brand);
    border-color: var(--brand);
}
.valuation-card.highlight .amount,
.valuation-card.highlight .label { color: #fff; }
.valuation-card .amount {
    font-family: var(--font-data);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
}
.valuation-card .label {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------
   Image carousel (similar listings)
   --------------------------------------------------------------- */
.carousel { position: relative; width: 120px; height: 72px; margin: 0 auto; overflow: hidden; border-radius: 8px; border: 1px solid var(--border); }
.carousel img { width: 120px; height: 72px; object-fit: cover; display: none; }
.carousel img.active { display: block; }
.carousel-controls { position: absolute; top: 50%; width: 100%; display: flex; justify-content: space-between; transform: translateY(-50%); pointer-events: none; padding: 0 4px; }
.carousel-button {
    background: rgba(18,24,27,0.65); color: #fff; font-weight: 700; border-radius: 50%;
    width: 20px; height: 20px; line-height: 20px; text-align: center; cursor: pointer;
    pointer-events: auto; user-select: none; font-size: 14px;
}
.carousel-button:hover { background: var(--brand); }
.img-thumb { border-radius: 8px; border: 1px solid var(--border); margin: 4px; max-width: 140px; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 720px) {
    .search-panel form { flex-direction: column; align-items: stretch; }
    .plate-input-wrap { width: 100%; }
    .plate-input-wrap input[type="text"] { width: 100%; }
    .btn-block-mobile { width: 100%; }
    .topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------------------------------------------------------------
   Print / "Save as PDF" — hides app chrome, force-expands every
   collapsed section so the full report prints regardless of what
   was open on screen.
   --------------------------------------------------------------- */
@media print {
    .topbar, .search-panel, .results-toolbar, .gloss-tip,
    .carousel-controls, .card-chevron, .subgroup-chevron {
        display: none !important;
    }
    body { background: #fff !important; color: #000 !important; }
    .card, .status-tile, .listing-card, .data-item, .valuation-card {
        box-shadow: none !important;
        break-inside: avoid;
    }
    .card-body, .subgroup-body { display: block !important; }
    .card-head, .subgroup-head { cursor: default; }
    a[href]:after { content: none !important; } /* no bare URLs after links */
    .page { padding: 0; }
}

