/* allpcs.ca public site: a dense "data portal" stylesheet for people who read a lot of specs at once. Small type,
   tabular figures, ruled grids, panel header bands, a dark masthead and spec sheets in two columns.
   Colour scheme: follows the system (prefers-color-scheme) unless the visitor picks light or dark, which the server
   renders as html[data-theme="light"|"dark"] (theme cookie). */

:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --panel-head: #eceff3;
    --border: #d3d8df;
    --rule: #e5e8ec;
    --zebra: #f8f9fa;
    --hover: #eaf2fb;
    --text: #151a21;
    --muted: #5a6472;
    --accent: #0a6b4d;
    --accent-soft: #e1f2ea;
    --sources: var(--accent);
    --link: #1a5aa8;
    --ink: #0e1b28;
    --ink-text: #e7edf4;
    --ink-muted: #9aabbf;
    --ink-2: #16283a;
    --ink-line: rgba(231, 237, 244, 0.12);
    --glow: #4cc79a;
    --on-accent: #ffffff;
    --warn: #7a5000;
    --warn-soft: #fff3d1;
    --danger: #a3261e;
    --danger-soft: #fce6e3;
    --info: #1d4e96;
    --info-soft: #e3ecfa;
    --radius: 2px;
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --header-h: 44px;
    color-scheme: light dark;
}

:root[data-theme="light"] { color-scheme: light; }

/* The dark palette twice: when the system asks for it and the visitor hasn't picked light, and when they picked dark. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0e13;
        --surface: #11171e;
        --panel-head: #18202a;
        --border: #27313d;
        --rule: #1c2530;
        --zebra: #141b23;
        --hover: #17263a;
        --text: #dce3ea;
        --muted: #8b98a7;
        --accent: #4cc79a;
        --accent-soft: #123126;
        --sources: #3f8f72;
        --link: #82b4ff;
        --ink: #05080c;
        --ink-text: #e3e9f0;
        --ink-muted: #7f90a4;
        --ink-2: #0d1620;
        --ink-line: rgba(227, 233, 240, 0.10);
        --on-accent: #06251a;
        --warn: #f0c060;
        --warn-soft: #33290f;
        --danger: #f08a80;
        --danger-soft: #3a1815;
        --info: #8fb4f0;
        --info-soft: #172640;
    }
}

:root[data-theme="dark"] {
    --bg: #0a0e13;
    --surface: #11171e;
    --panel-head: #18202a;
    --border: #27313d;
    --rule: #1c2530;
    --zebra: #141b23;
    --hover: #17263a;
    --text: #dce3ea;
    --muted: #8b98a7;
    --accent: #4cc79a;
    --accent-soft: #123126;
    --sources: #3f8f72;
    --link: #82b4ff;
    --ink: #05080c;
    --ink-text: #e3e9f0;
    --ink-muted: #7f90a4;
    --ink-2: #0d1620;
    --ink-line: rgba(227, 233, 240, 0.10);
    --on-accent: #06251a;
    --warn: #f0c060;
    --warn-soft: #33290f;
    --danger: #f08a80;
    --danger-soft: #3a1815;
    --info: #8fb4f0;
    --info-soft: #172640;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 13px/1.4 var(--font);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }

/* Headings: compact titles, section labels */
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.005em; margin: 0.5em 0 0.2em; }
h2 {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
    margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
h3 { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 4px; }
h1:focus { outline: none; }

.container { max-width: 1440px; margin: 0 auto; padding: 0 20px; }
/* Data tools (the explorer) use the whole window; header and footer follow so their edges line up. */
body:has([data-wide-page]) .container { max-width: none; }

.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.small { font-size: 0.78rem; }
.lead { font-size: 0.95rem; max-width: 80ch; }
.note {
    background: var(--warn-soft); color: var(--text); border-left: 3px solid var(--warn); padding: 4px 8px; border-radius: var(--radius);
    font-size: 0.78rem;
}

ul.plain { list-style: none; padding: 0; margin: 0; }
.list-links li { padding: 3px 0; border-bottom: 1px solid var(--rule); font-size: 0.82rem; }
.columns { columns: 14rem; column-gap: 1.5rem; }

/* Masthead, banner, footer */
.site-header { background: var(--ink); border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--header-h); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1rem; color: #fff; letter-spacing: 0.01em; }
.brand span { color: #5fd3a6; }
.header-nav {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
}
.header-nav > a { color: var(--ink-text); }
.header-nav > a:hover { color: #fff; }
.units { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius); overflow: hidden; }
.units a { padding: 1px 8px; color: var(--ink-muted); }
.units a.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }
.sample-banner { background: var(--info-soft); color: var(--info); text-align: center; font-size: 0.72rem; padding: 2px 16px; }
.site-footer { border-top: 1px solid var(--border); margin-top: 28px; padding: 10px 0 20px; color: var(--muted); font-size: 0.72rem; }

/* Home: a dark hero continuing the masthead (search, kinds, totals), then cards, kinds, coming soon, why, brands.
   Full-width bands paint past the container with a spread shadow clipped to their own height. */
.home { font-size: 0.95rem; }
.home h2 { font-size: 1.1rem; font-weight: 700; text-transform: none; letter-spacing: -0.01em; color: var(--text); margin: 0; padding: 0; border: 0; text-wrap: balance; }
.home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin: 34px 0 12px; }
.home-head a { font-size: 0.85rem; }
.home-hero { position: relative; background: var(--ink); color: var(--ink-text); padding: 52px 0 0;
    box-shadow: 0 0 0 100vmax var(--ink); clip-path: inset(0 -100vmax); }
.home-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(var(--ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--ink-line) 1px, transparent 1px);
    background-size: 32px 32px; background-position: center top;
    mask-image: radial-gradient(ellipse 38% 90% at 62% 0%, #000 15%, transparent 95%);
    -webkit-mask-image: radial-gradient(ellipse 38% 90% at 62% 0%, #000 15%, transparent 95%); }
.home-hero > * { position: relative; }
.home-eyebrow { font: 600 0.75rem var(--font); color: var(--glow); letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.home-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.025em; margin: 10px 0 14px; max-width: 18ch; text-wrap: balance; color: var(--ink-text); }
.home-hero h1 em { font-style: normal; color: var(--glow); }
.home-lead { color: var(--ink-muted); font-size: 1.1rem; max-width: 60ch; margin: 0 0 24px; }
.home-search { display: flex; max-width: 640px; background: var(--surface); border-radius: 8px; padding: 5px; gap: 6px; }
.home-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.05rem; padding: 8px 10px; color: var(--text); }
.home-search input:focus { outline: none; }
.home-search:focus-within { box-shadow: 0 0 0 3px var(--glow); }
.home-search button { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; padding: 9px 16px; border: 0; border-radius: 6px;
    background: var(--accent); color: var(--on-accent); cursor: pointer; }
.home-search button:hover { filter: brightness(1.08); }
.home-search svg { width: 16px; height: 16px; }
.home-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.home-kinds a { color: var(--ink-text); font-size: 0.9rem; border: 1px solid var(--ink-line); padding: 4px 11px; border-radius: 20px; display: inline-flex; gap: 6px; }
.home-kinds a b { color: var(--ink-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.home-kinds a:hover { border-color: var(--glow); text-decoration: none; }
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 44px 0 0; background: var(--ink-2);
    border-top: 1px solid var(--ink-line); box-shadow: 0 0 0 100vmax var(--ink-2); clip-path: inset(0 -100vmax); }
.home-stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 16px 24px; border-left: 1px solid var(--ink-line); min-width: 0; }
.home-stats div:first-child { border-left: 0; padding-left: 0; }
.home-stats dd { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.home-stats dt { color: var(--ink-muted); font-size: 0.85rem; }

.home-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.home-card { height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; color: var(--text); }
.home-card:hover { border-color: var(--accent); text-decoration: none; }
.home-card-photo { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--accent); max-width: 100%;
    background: radial-gradient(circle at 50% 60%, var(--accent-soft), var(--panel-head) 70%); }
.home-card-photo > svg { width: 42%; height: auto; }
.home-card-photo picture, .home-card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-card-photo .home-badge { position: absolute; top: 10px; left: 10px; }
.home-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.home-card-kind { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.home-card-name { font-weight: 650; font-size: 1.05rem; line-height: 1.25; }
.home-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.home-chip { font-size: 0.8rem; padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-card-meta { margin-top: auto; padding-top: 4px; font-size: 0.8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.home-badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.home-badge.new { background: var(--accent-soft); color: var(--accent); }
.home-badge.est { background: var(--warn-soft); color: var(--warn); }
.home-badge.soon { background: var(--info-soft); color: var(--info); }

.home-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0 28px; }
.home-kindgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.home-kindtile { height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px;
    display: grid; grid-template-columns: 38px 1fr; gap: 2px 12px; align-items: center; color: var(--text); }
.home-kindtile:hover { border-color: var(--accent); text-decoration: none; }
.home-kindtile svg { grid-row: span 2; width: 38px; height: 38px; color: var(--accent); }
.home-kindtile b { font-size: 1.05rem; }
.home-kindtile span { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.home-timeline li { position: relative; padding: 0 0 16px 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.home-timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.home-timeline .when { flex-basis: 100%; font: 500 0.8rem var(--mono); color: var(--muted); }
.home-timeline a { font-weight: 600; color: var(--text); }
.home-timeline .muted { font-size: 0.85rem; }

.home-trust { margin-top: 38px; padding: 28px 0; background: var(--surface); border-block: 1px solid var(--border);
    box-shadow: 0 0 0 100vmax var(--surface); clip-path: inset(0 -100vmax);
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; }
.home-trust h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--text); display: flex; gap: 8px; align-items: center; }
.home-trust h3 svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.home-trust p { margin: 0; color: var(--muted); max-width: 52ch; }
.home-brands { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.home-brands a { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-weight: 600; }
.home-brands a:hover { border-color: var(--accent); text-decoration: none; }
.home-brands small { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 0.8rem; }

@media (max-width: 960px) {
    .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .home-hero { padding-top: 32px; }
    .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-stats div, .home-stats div:first-child { border-left: 0; padding: 12px 0; }
    .home-cards, .home-trust { grid-template-columns: minmax(0, 1fr); }
    .home-search button { padding: 9px 12px; }
}

/* About and site stats (T-035): an ink band like the home hero, headline tiles with 30-day trends, then bar charts
   drawn as plain flex bars (hover for the value; the metric pages also give the figures as a table). */
.header-nav > a[aria-current="page"] { color: var(--glow); }
.about { font-size: 0.95rem; }
.about h2 { font-size: 1.1rem; font-weight: 700; text-transform: none; letter-spacing: -0.01em; color: var(--text); margin: 0; padding: 0; border: 0; }
.about-hero { background: var(--ink); color: var(--ink-text); padding: 48px 0 36px; box-shadow: 0 0 0 100vmax var(--ink); clip-path: inset(0 -100vmax); }
.about-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin: 10px 0 14px; max-width: 22ch; text-wrap: balance; color: var(--ink-text); }
.about-hero .home-lead { margin: 0; }
.about-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.about-points li { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; }
.about-points h2 { font-size: 1rem; margin-bottom: 4px; }
.about-points p { margin: 0; color: var(--muted); }
.about-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px;
    background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.about-tiles a { display: flex; flex-direction: column; gap: 2px; height: 100%; box-sizing: border-box; padding: 14px 16px 12px; background: var(--surface); color: var(--text); }
.about-tiles a:hover { text-decoration: none; background: var(--hover); }
.about-tile-name { color: var(--muted); font-size: 0.85rem; }
.about-tiles .stats-chart { margin-top: 8px; }
.about-more { margin: 10px 0 0; text-align: right; font-weight: 600; }

.stats-page h1 { margin-bottom: 4px; }
.stats-page h2 { margin-top: 28px; }
.stats-lead { color: var(--muted); max-width: 70ch; margin: 0 0 14px; }
.stats-controls { position: sticky; top: var(--header-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
    padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--rule); }
.stats-seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.stats-seg a { padding: 5px 12px; border-radius: 4px; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stats-seg a:hover { color: var(--text); text-decoration: none; }
.stats-seg a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 10px; }
.stats-grid.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stats-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stats-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stats-card h3 { margin: 0; font-size: 0.9rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.stats-card h3 a { color: var(--muted); }
.stats-card h3 a:hover { color: var(--link); }
.stats-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.stats-delta { font-size: 0.78rem; color: var(--accent); }
.stats-metric-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.stats-metric-head h1 { margin: 0; }

.stats-chart { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 6px; margin-top: 10px; }
.stats-plot { height: 96px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--border);
    background-image: linear-gradient(var(--rule) 1px, transparent 1px); background-size: 100% 50%; }
.stats-slot { flex: 1 1 0; max-width: 56px; height: 100%; display: flex; align-items: flex-end; }
.stats-bar { width: 100%; min-height: 2px; background: var(--sources); border-radius: 3px 3px 0 0; }
.stats-slot:hover .stats-bar { background: var(--accent); }
.stats-bar.partial { opacity: 0.55; }
.stats-axis { display: flex; flex-direction: column; justify-content: space-between; height: 96px; margin-top: -0.5em; font-size: 0.7rem; color: var(--muted);
    text-align: right; font-variant-numeric: tabular-nums; }
.stats-x { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); padding-top: 2px; }
.stats-chart.large .stats-plot, .stats-chart.large .stats-axis { height: 260px; }
.stats-chart.large .stats-plot { background-size: 100% 25%; }
.stats-chart.spark { display: block; margin-top: 0; }
.stats-chart.spark .stats-plot { height: 30px; gap: 1px; border-bottom: 0; background: none; }
.stats-chart.spark .stats-bar { border-radius: 1px 1px 0 0; }
/* The masthead wraps to several lines on phones, so the period switches stay in place there. */
@media (max-width: 700px) { .stats-controls { position: static; } }

/* Search */
.search-form { display: flex; gap: 6px; max-width: 560px; margin: 8px 0 12px; }
.search-form input { flex: 1; min-width: 0; font: inherit; font-size: 0.9rem; padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); }
.search-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 18px 0 6px; }
.search-group-head h2 { border: 0; margin: 0; }

/* Breadcrumbs */
.breadcrumbs ol { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.72rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; }

/* Badges: small square tags */
.badge {
    display: inline-block; font-size: 0.64rem; font-weight: 600; line-height: 1.55; padding: 0 5px; border-radius: var(--radius);
    text-transform: uppercase; letter-spacing: 0.05em;
    background: var(--surface); border: 1px solid var(--border); color: var(--muted); vertical-align: middle; white-space: nowrap;
}
.badge.status-current { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge.status-upcoming { background: var(--info-soft); border-color: transparent; color: var(--info); }
.badge.status-past { color: var(--muted); }
.badge.estimate { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 500; }
.badge.conflict { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.badge.selected, .badge.eligible { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* Data grids */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.8rem; background: var(--surface); border: 1px solid var(--border); }
table.data th, table.data td { padding: 4px 8px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
table.data thead th {
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600;
    position: sticky; top: var(--header-h); z-index: 2; background: var(--panel-head); border-bottom: 1px solid var(--border);
    padding-top: 6px; padding-bottom: 6px;
}
/* Inside a horizontal scroller the header sticks to the scroller, not the page: no masthead offset there. */
.table-scroll table.data thead th { top: 0; }
table.data tbody th { font-weight: 500; }
table.data tbody tr:nth-child(even) { background: var(--zebra); }
table.data tbody tr:hover { background: var(--hover); }
.num { text-align: right !important; }
.model-block, .year-block { margin-bottom: 14px; }

/* Vehicle page: panels with header bands, facts, a two-column spec sheet */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px 10px; }
.panel h2 { margin: 0 -12px 8px; padding: 6px 12px; background: var(--panel-head); border-bottom: 1px solid var(--border); }
dl.facts { display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: 2px 12px; margin: 0; font-size: 0.8125rem; }
dl.facts dt { color: var(--muted); font-size: 0.78rem; }
dl.facts dd { margin: 0; font-weight: 500; }
dl.facts dd.big { font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.incentives li { padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 0.8rem; }
.incentives li:last-child { border-bottom-style: none; }
.siblings { margin-top: 10px; font-size: 0.8rem; }
.siblings a { margin-right: 12px; }
/* Blazor drops whitespace between inline elements, so spacing is explicit. */
.siblings strong, .jurisdiction, .claim strong { margin-right: 6px; }
.incentives .badge, .incentives strong, .claim .badge, .product-head .badge { margin-right: 6px; }

/* Two columns split on the server (VehicleView.SplitColumns) so opening a section never moves others between columns;
   on narrow screens the column wrappers dissolve and the sections stack in their original order. */
.spec-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; align-items: start; margin-top: 8px; }
@media (max-width: 980px) {
    /* Flex so each section's inline "order" restores the category order even when one was pinned to the other column. */
    .spec-sheet { display: flex; flex-direction: column; }
    .spec-column { display: contents; }
}
.spec-category {
    break-inside: avoid; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0 10px 6px;
}
.spec-category h2 { margin: 0 -10px 4px; padding: 5px 10px; background: var(--panel-head); border-bottom: 1px solid var(--border); }

/* Spec rows as a grid: label | value | sources toggle on one line; an opened source list spans the full row below.
   The td dissolves (display: contents) so its value and details become grid items; the summary is pinned top-right. */
table.specs { display: block; width: 100%; border-collapse: collapse; font-size: 0.8rem; }
table.specs tbody { display: block; }
table.specs tr {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 8px;
    position: relative; padding: 3px 5.5rem 3px 0; border-bottom: 1px solid var(--rule);
}
table.specs tr:last-child, table.specs tr:last-child td { border-bottom: 0; }
table.specs th, table.specs td { padding: 3px 8px 3px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.specs th { padding: 0; border: 0; font-weight: 400; color: var(--muted); }
table.specs td { display: contents; }
table.specs .value { font-weight: 600; margin-right: 6px; }
tr.state-unknown .value, tr.state-not_applicable .value { color: var(--muted); font-style: italic; font-weight: 400; }

details.sources { margin-top: 4px; font-size: 0.72rem; }
details.sources summary { cursor: pointer; color: var(--sources); width: fit-content; }
details.sources ul { margin-top: 0; border-left: 2px solid var(--border); padding-left: 10px; }
table.specs details.sources { grid-column: 1 / -1; margin: 0 -5.5rem 0 0; }
table.specs details.sources summary { position: absolute; top: 3px; right: 0; }
table.specs details.sources[open] { margin-top: 4px; margin-bottom: 2px; }
/* Source name, badges and value on one line; metadata underneath. */
.claim { padding: 3px 0; }
.claim > div:nth-child(-n+2) { display: inline; }
.claim > div:nth-child(2)::before { content: "· "; color: var(--muted); }
.claim.selected { border-left: 2px solid var(--accent); margin-left: -12px; }
.reason { margin: 6px 0 0; font-style: italic; }
details.missing { margin: 4px 0 0; color: var(--muted); font-size: 0.75rem; }
details.missing summary { cursor: pointer; }
.quality { margin-top: 8px; font-size: 0.72rem; }

/* Data contributions (T-027): quiet invitations on product pages. */
.spec-gaps { margin: 6px 0 0; color: var(--muted); }
details.missing a.suggest { margin-left: 4px; color: var(--muted); text-decoration: underline dotted; font-size: 0.7rem; }
details.missing a.suggest:hover { color: var(--accent); }
.contributors { margin-top: 18px; }
.contributors > span { margin-right: 6px; }

/* Product photos (doc 04 §6.3): the photo panel takes the left column, key specs above dates the right one, on the
   same columns as the spec sheet below so everything lines up. One horizontal track holds every photo: one slide shows
   at a time, thumbnails pick it, phones swipe it. */
.product-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin-top: 10px; align-items: start; }
.product-facts { display: grid; gap: 10px; }
.media-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
    border-radius: var(--radius);
}
.media-track::-webkit-scrollbar { display: none; }
.media-slide { flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; }
.media-slide picture, .media-thumbs picture, .lb-item picture, .lb-strip picture { display: contents; }
.media-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.media-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.media-count {
    position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.7rem;
}
.credit { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 6px 0 0; font-size: 0.72rem; color: var(--muted); }
.badge.shown { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.badge.exact { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.media-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-top: 6px; }
.media-thumbs a, .media-more { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); outline-offset: 1px; }
.media-thumbs a.current { outline: 2px solid var(--accent); }
.media-thumb { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-more {
    border: 1px solid var(--border); background: var(--panel-head); color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
/* Standard views (doc 04 §6.4): one slot per view of the product's kind, empty ones marked. */
.views { margin-top: 14px; }
.views h3 { margin: 10px 0 6px; font-size: 0.8rem; }
.view-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.view-grid li { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.view-photo { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.view-photo picture { display: contents; }
.view-photo img, .view-empty { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.view-empty {
    display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); background: var(--zebra);
    color: var(--muted); font-size: 0.72rem;
}
.view-name { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Main photos in compare headings and the explorer's photo column (doc 04 §6.5–6.6). */
.thumb-photo { display: block; width: 100%; height: auto; max-width: 220px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); margin-bottom: 4px; }
.thumb-photo.small { width: 72px; margin: 0; }
.thumb-none { display: block; width: 72px; aspect-ratio: 3 / 2; border-radius: var(--radius); background: var(--zebra); }
@media (max-width: 980px) {
    .product-top { grid-template-columns: minmax(0, 1fr); }
    .media-thumbs { display: none; }
}
@media (max-width: 600px) {
    /* Edge to edge: the panel loses its side padding, border and corners; the caption keeps the page gutter. */
    .media.panel { margin-inline: -16px; padding-inline: 0; border-inline: 0; border-radius: 0; }
    .media.panel h2 { margin-inline: 0; padding-inline: 16px; }
    .media-track, .media-image { border-radius: 0; }
    .media .credit { padding: 0 16px; }
}

/* Lightbox: a full-screen dialog, one photo at a time, with its caption, credit and licence. */
.lightbox {
    width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
    background: rgba(6, 9, 13, 0.96); color: #dfe6ee;
}
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
body:has(.lightbox[open]) { overflow: hidden; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; font-size: 0.8rem; }
.lb-bar button {
    background: none; border: 1px solid #4a525c; border-radius: var(--radius); color: #fff; padding: 2px 10px; font: inherit; cursor: pointer;
}
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px; }
/* A definite width, so the photo's percentage max-width has something to resolve against. */
.lb-item { display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 0; margin: 0; }
.lb-item[hidden] { display: none; }
.lb-image { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 210px); margin: 0 auto; object-fit: contain; }
.lb-item figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-top: 8px; font-size: 0.78rem; }
.lb-credit { color: #93a1b1; }
.lb-credit a { color: #9cc4ff; }
.lb-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); padding: 8px 12px; border: 0; background: none;
    color: #fff; font-size: 34px; line-height: 1; opacity: 0.75; cursor: pointer;
}
.lb-arrow:hover { opacity: 1; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-strip { display: flex; gap: 6px; padding: 10px 18px 14px; overflow-x: auto; }
.lb-strip button {
    flex: 0 0 96px; aspect-ratio: 3 / 2; overflow: hidden; padding: 0; border: 0; border-radius: var(--radius); background: none;
    opacity: 0.55; cursor: pointer;
}
.lb-strip button.current { opacity: 1; outline: 2px solid #5fd3a6; }
.lb-thumb { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) {
    .lb-stage { padding: 0 8px; }
    .lb-arrow { display: none; }
}

/* Compare */
.compare-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 16px; }
.compare-add label { flex-basis: 100%; color: var(--muted); }
.compare-add select, .compare-add button {
    font: inherit; font-size: 0.8rem; padding: 3px 7px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text); max-width: 100%;
}
.compare-add button { background: var(--accent); border-color: var(--accent); color: #fff; cursor: pointer; }
.compare-toggle { margin: 0 0 8px; }
table.compare th, table.compare td { white-space: normal; vertical-align: top; min-width: 9rem; }
table.compare thead th { text-transform: none; font-size: 0.82rem; color: var(--text); }
table.compare tbody th[scope="row"], table.compare thead td {
    position: sticky; left: 0; background: var(--surface); color: var(--muted); font-weight: 400; z-index: 1;
}
table.compare tr.section th {
    background: var(--panel-head); color: var(--text); font-weight: 600; position: static;
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
}
table.compare tr.differs td { background: var(--warn-soft); }
table.compare td.state-unknown, table.compare td.state-not_applicable { color: var(--muted); font-style: italic; }
table.compare .badge { margin-left: 4px; }

/* Buttons */
.button { display: inline-block; background: var(--accent); color: #fff; padding: 4px 12px; border-radius: var(--radius); font-weight: 600; font-size: 0.8rem; border: 0; }
.button:hover { text-decoration: none; filter: brightness(1.08); }
.link-button { background: none; border: 0; padding: 4px 0; color: var(--accent); cursor: pointer; font: inherit; }

/* Explorer (T-042): the filters read as a sentence above a sidebar of panels (one per part) and the results. */
.to-results { display: none; }
.explorer-describe { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.describe-form { display: flex; flex-wrap: wrap; gap: 8px; }
.describe-form input {
    flex: 1 1 260px; min-width: 0; font: inherit; padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text);
}
.describe-form .button { font-size: 0.85rem; padding: 5px 14px; cursor: pointer; }
.describe-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.78rem; }
.describe-examples button {
    background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 1px 8px; color: var(--text);
    font: inherit; cursor: pointer;
}
.describe-examples button:hover { border-color: var(--accent); color: var(--accent); }
.explorer-describe .note { margin: 8px 0 0; }

.explorer-sentence { font-size: 1.3rem; line-height: 2; margin: 0 0 10px; text-wrap: pretty; }
.explorer-sentence .tw { white-space: nowrap; }
.explorer-sentence .tok {
    background: var(--accent-soft); color: var(--accent); border: 0; border-bottom: 2px dashed var(--accent); border-radius: var(--radius);
    padding: 0 6px; font: inherit; white-space: normal; cursor: pointer;
}
.explorer-sentence .tok.on { background: var(--accent); color: var(--on-accent); border-bottom-style: solid; }
.explorer-sentence .tok.empty, .explorer-sentence .tok.ghost { background: none; color: var(--muted); border-bottom-color: var(--muted); }
.gain { font-size: 0.62rem; font-weight: 600; color: var(--accent); margin-left: 2px; font-variant-numeric: tabular-nums; }
.explorer-sentence .gain { vertical-align: super; line-height: 0; }
.explorer-sentence .x, .panel .x {
    background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.8em; padding: 0 4px; cursor: pointer; vertical-align: middle;
}
.explorer-sentence .x:hover, .panel .x:hover { color: var(--danger); }
.add-part {
    background: none; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font: inherit; font-size: 0.75em;
    padding: 0 10px; cursor: pointer; vertical-align: middle;
}
.add-part:hover { border-color: var(--accent); color: var(--accent); }

.explorer { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.explorer.filters-closed { grid-template-columns: minmax(0, 1fr); }
.explorer.filters-closed .explorer-filters { display: none; }
.filters-toggle .when-closed { display: none; }
.filters-closed .filters-toggle .when-open { display: none; }
.filters-closed .filters-toggle .when-closed { display: inline; }
.explorer-filters {
    display: flex; flex-direction: column; gap: 10px; font-size: 0.78rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
    position: sticky; top: calc(var(--header-h) + 8px); max-height: calc(100vh - var(--header-h) - 16px); overflow: auto;
}
.explorer-filters input[type=search], .explorer-filters input[type=number], .explorer-filters select {
    font: inherit; font-size: 0.8rem; padding: 3px 7px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text); width: 100%; min-width: 0;
}
.filter-label {
    display: block; font-weight: 600; margin-bottom: 4px; padding: 0;
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted);
}
.panel { border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px; scroll-margin: 8px; }
.panel.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.phead { display: flex; align-items: flex-start; gap: 4px; margin-bottom: 6px; }
.phead > div { min-width: 0; flex: 1; }
.phead strong { font-size: 0.8rem; }
.phead .sum { display: block; color: var(--accent); }
.phead .gain { margin-left: auto; font-size: 0.7rem; padding-top: 2px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.seg button { background: none; border: 0; padding: 2px 8px; font: inherit; color: var(--text); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.hist { display: flex; gap: 2px; align-items: flex-end; height: 84px; }
.hist .bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; background: none; border: 0; padding: 0; cursor: pointer; }
.hist .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.hist .col i { display: block; background: var(--border); }
.hist .col i.in { background: var(--accent); }
.hist .bar:hover .col i { filter: brightness(0.9); }
.hist .bar-label { font-size: 0.6rem; color: var(--muted); text-align: center; padding-top: 2px; white-space: nowrap; overflow: visible; height: 1.2em; }
.step { display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; flex-wrap: wrap; }
.step button { background: none; border: 1px solid var(--border); border-radius: var(--radius); width: 26px; height: 26px; font: inherit; color: var(--text); cursor: pointer; }
.step b { font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.opts { display: grid; gap: 1px; }
.opt { display: flex; align-items: center; gap: 6px; padding: 1px 0; cursor: pointer; }
.opt input { width: auto; margin: 0; }
.opt .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt.zero { color: var(--muted); }
.sep { border-top: 1px dashed var(--rule); margin: 3px 0; }
.panel-search { margin-bottom: 6px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 0 12px; }
.panel-actions:empty { display: none; }
.range-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 6px; margin-top: 4px; }
.addbox { border-top: 1px solid var(--rule); padding-top: 8px; }
.add-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.add-list > .muted { flex-basis: 100%; }
.add-chip { background: var(--accent-soft); color: var(--accent); border: 0; border-radius: var(--radius); padding: 2px 8px; font: inherit; cursor: pointer; text-align: left; }
.add-chip:hover { filter: brightness(0.96); }

/* Pinned bar: one line above the results once the sentence has scrolled away (js/explorer-bar.js sets the attributes). */
.pinned-bar {
    display: none; position: sticky; top: var(--header-h); z-index: 4; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 4px 10px; margin-bottom: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}
html[data-sentence-away] .pinned-bar { display: block; }
.pinned-compact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 0.8rem; }
.pinned-compact .chip {
    background: var(--accent-soft); color: var(--accent); border: 0; border-radius: var(--radius); padding: 1px 8px; font: inherit; cursor: pointer;
    max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pinned-compact .chip.more { background: none; border: 1px solid var(--border); color: var(--muted); }
.pinned-count { margin-left: 6px; font-variant-numeric: tabular-nums; }
.pinned-full { display: none; align-items: flex-start; gap: 12px; }
.pinned-full .explorer-sentence { font-size: 1rem; line-height: 1.9; margin: 0; flex: 1; }
.pinned-full .button { cursor: pointer; margin-top: 4px; }
html[data-bar-open] .pinned-compact { display: none; }
html[data-bar-open] .pinned-full { display: flex; }

.relax { background: var(--warn-soft); color: var(--warn); padding: 6px 10px; border-radius: var(--radius); font-size: 0.85rem; }
.relax .link-button { color: var(--link); text-decoration: underline; }

.results-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 0.78rem; }
/* Dropdowns on <details data-menu> (js/menus.js closes them on Esc, outside clicks and Done/✕): the summary reads as a
   button with an arrow that flips when open. */
details[data-menu] { position: relative; }
details[data-menu] > summary {
    list-style: none; cursor: pointer; color: var(--accent); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2px 8px; background: var(--surface); white-space: nowrap; user-select: none;
}
details[data-menu] > summary::-webkit-details-marker { display: none; }
details[data-menu] > summary::after { content: " ▾"; }
details[data-menu][open] > summary { background: var(--accent-soft); border-color: var(--accent); }
details[data-menu][open] > summary::after { content: " ▴"; }
.columns-panel, .fit-panel {
    position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.15);
}
.columns-panel { width: 320px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; max-height: 65vh; }
.columns-head, .columns-foot { display: flex; align-items: center; padding: 6px 12px; }
.columns-head { justify-content: space-between; border-bottom: 1px solid var(--rule); font-size: 0.9rem; }
.columns-foot { justify-content: space-between; border-top: 1px solid var(--rule); }
.columns-foot .link-button:disabled { color: var(--muted); cursor: default; opacity: .6; }
.columns-foot .button { cursor: pointer; }
.menu-x { background: none; border: 0; padding: 2px 6px; font-size: 1rem; line-height: 1; color: var(--muted); cursor: pointer; }
.menu-x:hover { color: var(--text); }
.columns-list { overflow: auto; padding: 4px 12px 8px; flex: 1; }
.columns-list label { display: flex; align-items: baseline; gap: 6px; padding: 1px 0; font-size: 0.9rem; }
/* Ticked columns js/table-fit.js had to hide for the width. */
.columns-list label::after { margin-left: auto; padding-left: 8px; font-size: 0.75rem; color: var(--warn); white-space: nowrap; }
.columns-group { margin: 8px 0 2px; font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.explorer-table thead th { padding-left: 4px; padding-right: 4px; white-space: normal; }
.explorer-table button.sort { background: none; border: 0; padding: 4px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-align: inherit; }
.explorer-table button.sort.active { color: var(--accent); }
.explorer-table tbody th { white-space: normal; min-width: 12rem; }
/* Fitted to the width by js/table-fit.js (data-fit-id appears once it runs): no sideways scrolling; headers and text
   cells wrap under pressure so fewer columns need to hide. */
.table-scroll[data-fit-id] { overflow-x: hidden; }
.explorer-table td.wrap { white-space: normal; min-width: 9rem; }
/* "+2 hidden" next to Columns, or "Fit columns to the width" while scrolling sideways (js/table-fit.js sets data-state). */
.fit-note:not([data-state="hidden"]) .fit-more, .fit-note:not([data-state="off"]) .fit-back { display: none; }
.fit-more > summary.fit-chip { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-soft); }
.fit-more[open] > summary.fit-chip { border-color: var(--warn); background: var(--warn-soft); }
.fit-panel { width: 300px; max-width: calc(100vw - 32px); padding: 8px 12px; font-size: 0.85rem; }
.fit-panel p { margin: 0 0 6px; }
.fit-names { margin: 0 0 8px; padding-left: 18px; font-weight: 600; }
html[data-table-scroll] .table-scroll[data-fit-id] { overflow-x: auto; }

/* Phones and narrow windows: the sidebar, when shown, opens full width above the results; never chosen = hidden. */
@media (max-width: 860px) {
    .explorer { grid-template-columns: minmax(0, 1fr); }
    .explorer-filters { position: static; max-height: none; }
    .explorer.filters-auto .explorer-filters { display: none; }
    .filters-auto .filters-toggle .when-open { display: none; }
    .filters-auto .filters-toggle .when-closed { display: inline; }
    .to-results { display: inline-block; margin-bottom: 12px; font-weight: 600; }
    .explorer-sentence { font-size: 1.1rem; }
}

@media (max-width: 600px) {
    body { font-size: 13.5px; }
    .container { padding: 0 16px; }
    .site-header { position: static; }
    .pinned-bar { top: 0; }
    .header-nav { gap: 8px; }
    table.data thead th { top: 0; }
    /* The value column may wrap (a row of options, a set chip) instead of running over the label. */
    dl.facts { grid-template-columns: minmax(6rem, 40%) minmax(0, 1fr); }
    dl.facts dd { text-align: right; }
    dl.facts .value.options { justify-content: flex-end; }
}

@media print {
    .site-header, .site-footer, .media-thumbs, .lightbox { display: none; }
    .spec-category { border-color: #999; }
}

/* Blazor framework UI */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Report an error */
.report-form { display: grid; gap: 6px; max-width: 640px; margin: 16px 0; }
.report-form label { margin-top: 10px; font-weight: 500; }
.report-form input, .report-form select, .report-form textarea {
    font: inherit; font-size: 0.8rem; padding: 3px 7px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: inherit;
}
.report-form button {
    justify-self: start; margin-top: 16px; padding: 3px 7px; font: inherit; font-size: 0.8rem; font-weight: 600; border: 0;
    border-radius: var(--radius); background: var(--accent); color: #fff; cursor: pointer;
}
.report-form .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 0.82rem; }
.notice.error { border-color: var(--danger); background: var(--danger-soft); }

/* Product pages (T-021): options with the base configuration marked, sections below the spec sheet, explorer tabs. */
.value.options { display: inline-flex; flex-wrap: wrap; gap: 3px 4px; }
.option { padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius); white-space: nowrap; }
/* In the spec sheet's narrow value column a long option (a processor name) wraps instead of running under the sources toggle. */
table.specs .value.options { max-width: 100%; }
table.specs .option { white-space: normal; max-width: 100%; }
.option.base { border-color: var(--accent); }
.components, .benchmarks, .markets, .used-in, .configurations, .reviews { margin-top: 18px; }

/* Reviews published elsewhere (T-040): a count under the dates, and the list above Community discussion. */
.around-web dd a { font-weight: 600; }
.around-web dd .muted { display: block; }
.around-web .rating-score { font-size: 1.125rem; }
.reviews-table td.rating { white-space: nowrap; }
.reviews-table td.review-title { white-space: normal; overflow-wrap: anywhere; min-width: 16rem; }
.reviews-table .review-title a { font-weight: 600; }
.badge.lang { margin-left: 4px; background: var(--info-soft); border-color: transparent; color: var(--info); font-weight: 600; }
.reviews > .muted.small { margin: 6px 0 0; }
@media (max-width: 600px) {
    .reviews-table thead { display: none; }
    .reviews-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 4px 0; }
    .reviews-table td { border: 0; padding: 1px 8px; }
    .reviews-table td.review-title { grid-column: 1 / -1; min-width: 0; }
    .reviews-table td.num { text-align: left; }
}

/* Processors, graphics and NPU on a product page: a panel per kind. Several of a kind are compared in a table (a column
   each, a row per spec, performance as bars); on phones each spec name moves to its own row above the values. */
.cmp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.cmp-head { margin: 0; padding: 5px 10px; background: var(--panel-head); border-bottom: 1px solid var(--border); }
.cmp-count { margin-left: 0.4em; }
.cmp-count::before { content: "· "; }
.cmp-table { width: 100%; min-width: calc(11rem + var(--cols) * 8.5rem); border-collapse: collapse; table-layout: fixed; font-size: 0.8125rem; }
.cmp-table th, .cmp-table td { padding: 4px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.cmp-table tbody tr:last-child > * { border-bottom: 0; }
.cmp-corner { width: 11rem; }
.cmp-table thead th { font-weight: 400; padding-top: 7px; padding-bottom: 6px; border-bottom-color: var(--border); }
.cmp-table tbody th { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.cmp-table td { font-weight: 500; font-variant-numeric: tabular-nums; }
.cmp-table td.best { font-weight: 700; }
.cmp-title { display: block; font-weight: 600; font-size: 0.9rem; }
.cmp-paired { display: block; font-size: 0.75rem; color: var(--muted); }
.cmp-bar { display: block; height: 3px; max-width: 9rem; margin-top: 3px; background: var(--rule); border-radius: 2px; }
.cmp-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.cmp-mlabel { display: none; }
.cmp-shared { margin: 0; padding: 5px 10px; border-top: 1px solid var(--border); font-size: 0.78rem; }
.cmp-single { padding: 6px 10px 8px; }
.cmp-name { margin: 0 0 4px; }
.cmp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 20px; margin: 0; font-size: 0.8125rem; }
.cmp-facts div, .set-card dl div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.cmp-facts dt, .set-card dt { color: var(--muted); font-size: 0.78rem; }
.cmp-facts dd, .set-card dd { margin: 0; font-weight: 500; text-align: right; }

/* Option sets (doc 06 §3.3): a card per set in Configurations; a chip beside every option a set ties, linking to its card. */
.set-chip {
    display: inline-block; font-size: 0.7rem; font-weight: 500; line-height: 1.5; padding: 0 6px; border: 1px solid transparent;
    border-radius: var(--radius); background: var(--info-soft); color: var(--info); vertical-align: middle; max-width: 100%;
}
a.set-chip:hover { text-decoration: none; border-color: var(--info); }
.cmp-table thead .set-chip, .cmp-name .set-chip { margin-top: 3px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); align-items: start; gap: 8px; }
.set-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px 4px; font-size: 0.8125rem;
    scroll-margin-top: calc(var(--header-h) + 12px);
}
.set-card:target { border-color: var(--info); box-shadow: 0 0 0 1px var(--info); }
/* Name chip and kind on one row, the kind and badge on the right; when both don't fit, the kind moves to the next line. */
.set-card header { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; margin-bottom: 4px; }
.set-name { min-width: 0; margin: 0; font-size: 0.8rem; text-transform: none; letter-spacing: 0; line-height: 1.35; }
.set-name .set-chip { font-size: inherit; font-weight: 600; padding: 1px 7px; }
.set-meta { display: flex; flex-shrink: 0; align-items: center; gap: 6px; margin-left: auto; padding-top: 2px; }
.set-card dl { margin: 0; }
.set-card dl div:last-child { border-bottom: 0; }
.set-free { margin: 6px 0 0; }

@media (max-width: 600px) {
    .cmp-table { min-width: calc(var(--cols) * 6.5rem); }
    .cmp-corner, .cmp-table tbody th { display: none; }
    .cmp-mlabel { display: table-row; }
    .cmp-table .cmp-mlabel td { padding: 6px 8px 0; border-bottom: 0; color: var(--muted); font-weight: 400; font-size: 0.75rem; }
    .cmp-table th, .cmp-table td { padding-left: 8px; padding-right: 8px; }
    .cmp-title { font-size: 0.85rem; }
}
.benchmarks h3 { margin: 12px 0 4px; }
.explorer-tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0 0 12px; border-bottom: 1px solid var(--border); }
.explorer-tabs a { padding: 4px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); text-decoration: none; }
.explorer-tabs a:hover { color: var(--text); }
.explorer-tabs a.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---- Community (T-024): forums, threads, posts, account forms ---- */
.alert { padding: 6px 10px; border-radius: var(--radius); font-size: 0.82rem; margin: 8px 0; }
.alert p { margin: 2px 0; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--info-soft); color: var(--info); }
.badge.pinned { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge.staff { background: var(--info-soft); border-color: transparent; color: var(--info); text-transform: none; letter-spacing: 0; }
.button.secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.button.danger { background: var(--danger); }
button.button { cursor: pointer; font: inherit; font-weight: 600; font-size: 0.8rem; }
.link-button.mod { color: var(--warn); }

.forum-group { margin: 14px 0; }
table.data.forums td, table.data.threads td { white-space: normal; vertical-align: top; }
table.data .thread-title a { font-weight: 600; }
table.data .thread-title .badge { margin-right: 4px; }
table.data tr.status-pending, table.data tr.status-hidden { opacity: 0.75; }
.forum-head .lead, .thread-head p { margin: 4px 0; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; font-size: 0.8rem; }
.pager a, .pager span { padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pager span[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

ol.posts { list-style: none; padding: 0; margin: 10px 0; }
.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; }
.post:target { outline: 2px solid var(--accent); }
.post.status-pending { border-left: 3px solid var(--warn); }
.post.status-hidden { border-left: 3px solid var(--danger); opacity: 0.8; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.8rem; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.post-meta .author { font-weight: 600; }
.post-body { font-size: 0.86rem; line-height: 1.5; overflow-wrap: anywhere; }
.post-body p { margin: 6px 0; }
.post-body blockquote, blockquote.reported { margin: 6px 0; padding: 2px 10px; border-left: 3px solid var(--border); color: var(--muted); background: var(--zebra); }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
form.inline { display: inline; margin: 0; }
.reply { margin-top: 16px; }
.mod-tools { margin: 8px 0; padding: 6px 10px; border: 1px dashed var(--warn); border-radius: var(--radius); font-size: 0.8rem; }
.mod-tools summary { cursor: pointer; color: var(--warn); font-weight: 600; }
.inline-forms { display: flex; gap: 14px; margin: 6px 0; }
.move-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.move-form label { display: flex; flex-direction: column; gap: 2px; }

/* Community points (doc 05 §7): small and in context. */
.community-layout { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 16px; align-items: start; }
.top-contributors { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px 8px; margin-top: 14px; font-size: 0.8rem; }
.top-contributors h2 { font-size: 0.8rem; margin: 0 -12px 6px; padding: 6px 12px; background: var(--panel-head); border-bottom: 1px solid var(--border); }
.top-contributors ol { list-style: none; padding: 0; margin: 0; }
.top-contributors li { display: flex; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.top-contributors li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-contributors .position { color: var(--muted); min-width: 1.6em; }
.top-contributors .points { font-variant-numeric: tabular-nums; }
.top-contributors p { margin: 6px 0 0; }
@media (max-width: 860px) {
    .community-layout { grid-template-columns: minmax(0, 1fr); }
    .top-contributors { margin-top: 0; }
}
.post-meta .rank { color: var(--muted); font-size: 0.75rem; text-decoration: none; }
.post-meta .rank:hover { text-decoration: underline; }
.post.solution-preview { border-left: 3px solid var(--accent); }
.points-hint { margin: 2px 0 0; }
.header-points { font-size: 0.75rem; font-variant-numeric: tabular-nums; opacity: 0.85; }
table.data.leaderboard tr.me td { background: var(--accent-soft); }
.mine { margin: 6px 0; font-weight: 600; }
.leaderboard-filter { display: flex; align-items: end; gap: 8px; margin: 0 0 10px; font-size: 0.8rem; }
.leaderboard-filter label { display: flex; gap: 6px; align-items: center; }
.leaderboard-filter select { font: inherit; padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.member-points meter { width: 8rem; vertical-align: middle; margin: 0 6px; }
ul.badges { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.history tr.reversal td { color: var(--muted); }

.community-section { margin-top: 18px; }
.community-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0; }

.form-stack { display: flex; flex-direction: column; gap: 4px; max-width: 46rem; margin: 8px 0; }
.form-stack label { font-weight: 600; font-size: 0.8rem; margin-top: 6px; }
.form-stack label.choice { font-weight: 400; display: flex; gap: 6px; align-items: baseline; }
.form-stack input:not([type=checkbox]):not([type=radio]), .form-stack select, .form-stack textarea, .move-form select {
    font: inherit; font-size: 0.86rem; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); width: 100%;
}
.form-stack textarea { resize: vertical; line-height: 1.45; }
.form-stack .button { align-self: flex-start; margin-top: 8px; }
.form-stack fieldset { border: 0; padding: 0; margin: 6px 0 0; }
.form-stack legend { font-weight: 600; font-size: 0.8rem; margin-bottom: 2px; }
.form-stack .muted.small { margin: 0; }
.picker .row { display: flex; gap: 8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.account-box { max-width: 30rem; }
.account-section { margin: 12px 0; max-width: 46rem; }
.account-section.danger h2 { color: var(--danger); }
.prose { max-width: 50rem; font-size: 0.86rem; line-height: 1.55; }
.prose h2 { margin-top: 18px; }

/* Release notes: the About page's cards and the release list */
.release-section { margin-top: 28px; }
.release-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-top: 10px; }
@media (max-width: 700px) { .release-grid { grid-template-columns: 1fr; } }
.release-card { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; color: var(--text); min-width: 0; }
.release-card:hover { text-decoration: none; background: var(--hover); }
.release-kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.release-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.release-head strong { font-size: 1.5rem; letter-spacing: -0.02em; }
.release-card ul { margin: 6px 0 0; padding-left: 18px; }
.release-card .small { margin-top: 4px; }
.release-link { margin-top: auto; padding-top: 12px; font-weight: 600; color: var(--link); }
.release-list { max-width: 760px; }
.release-year { font-size: 1.1rem; margin: 28px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.release-item { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 20px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 600px) { .release-item { grid-template-columns: 1fr; } }
.release-item ul { margin: 0; padding-left: 18px; }
.release-version { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.release-badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 0.7rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }

/* Brands page (T-046): one filter bar, then the brands as cards (default) or a list whose rows open to the overview. */
.brands-lead { font-size: 1.15em; margin: 0 0 14px; max-width: none; }
.brands-lead strong { color: var(--accent); font-weight: 700; font-size: 1.25em; line-height: 1; }
.brands-bar {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; padding: 10px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.brands-field { display: flex; flex-direction: column; gap: 4px; }
.brands-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.brands-view { margin-left: auto; }
.brands-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.brands-seg a {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; font-weight: 600;
    background: var(--surface); color: var(--text);
}
.brands-seg a + a { border-left: 1px solid var(--border); }
.brands-seg a:hover { background: var(--hover); text-decoration: none; }
.brands-seg a.on, .brands-seg a.on:hover { background: var(--accent); color: var(--on-accent); }
.brands-seg svg { width: 14px; height: 14px; }
.brands-count { font-weight: 400; opacity: 0.8; font-variant-numeric: tabular-nums; }
.brands-bar select {
    font: inherit; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text);
}
#brands-origin { min-width: 190px; }
#brands-sort { min-width: 150px; }
.brands-apply { font: inherit; font-weight: 600; height: 32px; padding: 0 14px; cursor: pointer; }
.brands-showing { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 12px 0 10px; font-size: 0.92em; color: var(--muted); }
.brands-showing b { color: var(--text); font-variant-numeric: tabular-nums; }
.brands-empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 20px; text-align: center; }
.brands-empty p { margin: 0 0 6px; }

.brands-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.brands-cards > li { display: flex; min-width: 0; }
.brands-card {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; padding: 14px 16px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px; scroll-margin-top: calc(var(--header-h) + 12px);
}
.brands-card:hover { border-color: var(--accent); }
.brands-card-head { display: flex; align-items: center; gap: 12px; }
.brands-mono {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 6px;
    background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.08em;
}
.brands-card-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brands-card-name h2 { margin: 0; padding: 0; border: 0; font-size: 1.05rem; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--text); }
.brands-card-name h2 a { color: var(--text); }
.brands-card-name .muted { font-size: 0.92em; }
.brands-card-models { text-align: right; line-height: 1; }
.brands-card-models b { display: block; font-size: 1.45em; font-weight: 650; font-variant-numeric: tabular-nums; }
.brands-card-models span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.brands-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.brands-kinds span { font-size: 0.92em; padding: 1px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); }
.brands-card-text {
    margin: 0; font-size: 1em; line-height: 1.55; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.brands-card-overview.open .brands-card-text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.brands-more {
    margin-top: 2px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--link); cursor: pointer;
}
.brands-more:hover { text-decoration: underline; }
.brands-card-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; font-weight: 600; }

.brands-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.brands-lgrid {
    display: grid; align-items: center; gap: 12px;
    grid-template-columns: 20px minmax(140px, 1.4fr) minmax(110px, 1fr) minmax(140px, 1.4fr) 70px minmax(120px, 1.2fr);
}
.brands-lgrid .num { text-align: right; font-variant-numeric: tabular-nums; }
.brands-lhead {
    padding: 6px 12px; background: var(--panel-head); border-bottom: 1px solid var(--border);
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600;
}
.brands-row { border-bottom: 1px solid var(--rule); scroll-margin-top: calc(var(--header-h) + 12px); }
.brands-row:last-child { border-bottom: 0; }
.brands-row > summary { list-style: none; cursor: pointer; padding: 0 12px; min-height: 40px; }
.brands-row > summary::-webkit-details-marker { display: none; }
.brands-row > summary:hover, .brands-row[open] > summary { background: var(--hover); }
.brands-row > summary b { font-weight: 600; }
.brands-chev { width: 12px; height: 12px; color: var(--muted); transition: transform 0.12s; }
.brands-row[open] .brands-chev { transform: rotate(90deg); }
.brands-share { width: 100%; height: 6px; }
.brands-share .track { fill: var(--panel-head); }
.brands-share .bar { fill: var(--accent); }
.brands-detail { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 4px 12px 16px 44px; background: var(--zebra); border-top: 1px solid var(--rule); }
.brands-overview { flex: 999 1 480px; min-width: 0; max-width: 760px; }
.brands-overview p { margin: 10px 0 0; font-size: 1.08em; line-height: 1.6; }
.brands-links { flex: 1 1 220px; min-width: 0; padding-top: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.brands-go {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--radius);
    background: var(--accent); color: var(--on-accent); font-weight: 600;
}
.brands-go:hover { text-decoration: none; filter: brightness(1.08); }

@media (max-width: 760px) {
    .brands-view { margin-left: 0; }
    .brands-lgrid { grid-template-columns: 20px minmax(0, 1fr) 60px; }
    .brands-lhide { display: none; }
    .brands-detail { padding-left: 12px; }
}
