/* Bilfund (bilfund.dk). Look shared with Optalt: warm paper background, Bricolage Grotesque headlines, Figtree text,
   one green accent for "good buy" and a marker yellow for the headline figure only. */
:root {
  --bg: #f6f7f4; --surface: #ffffff; --ink: #15201a; --muted: #5d6a62; --line: #dfe4de; --soft: #edf1ec;
  --accent: #1d7a4c; --accent-ink: #ffffff; --mark: #f3c548;
  --top: #ffffff; --top-bg: #1d7a4c; --good: #17613c; --good-bg: #d6eedf; --fair: #5d6a62; --fair-bg: #eceee9;
  --high: #9b3b22; --high-bg: #f6e1da; --warn: #8a5a00; --warn-bg: #fbf0d4;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 12px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #101612; --surface: #172019; --ink: #e8efe9; --muted: #9aa99f; --line: #2a362d; --soft: #1d2820;
  --accent: #5cc48d; --accent-ink: #0d1a12; --mark: #c9a12c;
  --top: #0d1a12; --top-bg: #5cc48d; --good: #8fe0b2; --good-bg: #1d3a29; --fair: #a9b6ad; --fair-bg: #222b25;
  --high: #f0a48d; --high-bg: #3a221b; --warn: #f1cf7a; --warn-bg: #3a3018; color-scheme: dark;
} }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 48px; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
img { max-width: 100%; }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 800; font-size: 24px; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: var(--mark); }
.logo svg { width: 20px; height: 20px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: 999px; font-weight: 500; font-size: 15px; }
nav a:hover { background: var(--soft); }
nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* hero */
.hero { padding: 28px 0 22px; max-width: 760px; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 800; line-height: 1.03; }
.hero.small h1 { font-size: clamp(30px, 5vw, 46px); }
.mark { background: linear-gradient(transparent 60%, var(--mark) 60%, var(--mark) 90%, transparent 90%); padding: 0 4px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.lede { font-size: 18px; margin: 14px 0 0; max-width: 62ch; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.section-title h2, .h2 { font-size: 24px; font-weight: 800; }
.h2 { margin: 32px 0 4px; }
.section-title p, .sub { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

/* two columns: content + floating model list */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 32px; align-items: start; }
@media (max-width: 899px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } .side { order: -1; margin-bottom: 16px; } }
.side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); scrollbar-width: thin; }
@media (max-width: 899px) { .side { position: static; max-height: none; } }
.models summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-family: var(--display); font-weight: 800; font-size: 18px; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.models summary::-webkit-details-marker { display: none; }
.models summary::after { content: "▾"; font-size: 14px; color: var(--muted); margin-left: 8px; }
.models[open] summary::after { content: "▴"; }
@media (min-width: 900px) { .models summary { cursor: default; pointer-events: none; } .models summary::after, .models[open] summary::after { content: none; } }
.sm-count { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); background: var(--soft); padding: 1px 8px; border-radius: 999px; margin-left: auto; }
.model-list { list-style: none; margin: 0; padding: 6px; }
.model-list a { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 10px; padding: 7px 8px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.model-list a:hover { background: var(--soft); }
.model-list a[aria-current="page"] { background: var(--soft); box-shadow: inset 3px 0 0 var(--accent); }
.model-list img { grid-row: 1 / span 3; width: 64px; height: 43px; object-fit: cover; border-radius: 6px; align-self: center; background: var(--soft); }
.sm-name { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.sm-meta { font-size: 12.5px; color: var(--muted); }
.sm-good { font-size: 12.5px; color: var(--accent); font-weight: 600; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 5px 13px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* compact car rows */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rows-head, .row > summary { display: grid; grid-template-columns: minmax(0, 1fr) 128px 150px; gap: 14px; align-items: center; }
.rows-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 16px 6px; }
.rows-head span:nth-child(2), .rows-head span:nth-child(3) { text-align: right; }
.row { border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row > summary { list-style: none; cursor: pointer; padding: 10px 16px; }
.row > summary::-webkit-details-marker { display: none; }
.row > summary:hover, .row[open] > summary { background: color-mix(in srgb, var(--soft) 70%, var(--surface)); }
.row:has(.r-thumb) > summary { grid-template-columns: 56px minmax(0, 1fr) 128px 150px; }
.r-thumb { width: 56px; height: 38px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.r-car { min-width: 0; display: flex; flex-direction: column; }
.r-model { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.r-var { font-weight: 600; font-size: 15.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-spec { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-warn { color: var(--warn); cursor: help; }
.r-price { text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.r-price b { font-family: var(--display); font-weight: 800; font-size: 19px; }
.r-price small, .r-deal small { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.r-deal { text-align: right; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.pill { display: inline-block; font-size: 13.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.top { background: var(--top-bg); color: var(--top); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.fair { background: var(--fair-bg); color: var(--fair); }
.pill.high { background: var(--high-bg); color: var(--high); }
.pill.info { background: var(--soft); color: var(--muted); font-weight: 600; }
.r-detail { padding: 2px 16px 14px; display: grid; gap: 10px; font-size: 14px; background: color-mix(in srgb, var(--soft) 70%, var(--surface)); }
.row:has(.r-thumb) .r-detail { padding-left: 86px; }
.r-facts { margin: 0; color: var(--muted); }
.r-warns { margin: 0; padding: 8px 12px 8px 28px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; }
.r-go { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dealer { color: var(--muted); }
.feats { display: flex; flex-wrap: wrap; gap: 6px; }
.feat { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.feat.cond { border-style: dashed; color: var(--muted); }
@media (max-width: 600px) {
  .rows-head { display: none; }
  .row > summary, .row:has(.r-thumb) > summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "car price" "car deal"; row-gap: 4px; padding: 10px 12px; }
  .r-thumb { display: none; }
  .r-car { grid-area: car; } .r-price { grid-area: price; } .r-deal { grid-area: deal; }
  .r-price small, .r-deal small { display: none; }
  .r-spec { white-space: normal; }
  .row:has(.r-thumb) .r-detail, .r-detail { padding: 2px 12px 12px; }
}
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* model page */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.model-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 8px; }
@media (max-width: 700px) { .model-head { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.photo { margin: 0; }
.photo img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; display: block; background: var(--soft); }
.credit { font-size: 11.5px; color: var(--muted); margin: 6px 2px 0; }
.credit a { color: var(--muted); }
.model-text h1 { font-size: clamp(30px, 4.6vw, 48px); font-weight: 800; line-height: 1.05; }
.facts { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; }
.facts div { display: flex; flex-direction: column; }
.facts b { font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1.1; }
.facts span { font-size: 13px; color: var(--muted); }
.value-teaser { font-size: 15px; margin: 14px 0 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.link-out { font-size: 14px; font-weight: 600; text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.link-out:hover { border-color: var(--accent); color: var(--accent); }
.link-out.strong { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.link-out.strong:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 14px 0 10px; margin: 14px 0 4px; border-top: 1px solid var(--line); }
.filters label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; color: var(--muted); gap: 4px; }
.filters select { font-size: 14.5px; font-weight: 500; color: var(--ink); padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-width: 112px; }
.filters .check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; padding-bottom: 7px; }
@media (max-width: 600px) { .filters label { flex: 1 1 45%; } .filters select { min-width: 0; width: 100%; } }
.count { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.more { text-align: center; margin: 18px 0; }
.btn { display: inline-block; border: 1px solid var(--ink); background: var(--surface); padding: 9px 20px; border-radius: 999px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.small { padding: 6px 14px; font-size: 14px; background: var(--ink); color: var(--bg); }
.btn.small:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.note { background: var(--soft); border-radius: var(--r); padding: 18px 20px; margin-top: 28px; }
.note h2 { font-size: 19px; margin-bottom: 6px; }
.note p { margin: 0; }
.empty { color: var(--muted); padding: 20px 16px; margin: 0; }

/* value page */
.tblwrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.vtbl { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
.vtbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.vtbl td { padding: 7px 12px; border-top: 1px solid var(--soft); }
.vtbl td a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.vtbl td img { width: 48px; height: 32px; object-fit: cover; border-radius: 5px; }
.barcell { position: relative; min-width: 130px; }
.barcell .bar { position: absolute; left: 12px; top: 50%; height: 8px; margin-top: -4px; width: calc((100% - 96px) * var(--w) / 100); background: color-mix(in srgb, var(--high) 45%, transparent); border-radius: 4px; }
.barcell .bar.alt { background: color-mix(in srgb, var(--mark) 80%, transparent); }
.barcell .bar.pct { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.barcell .num { position: relative; float: right; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.vblock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; scroll-margin-top: 16px; }
.vblock:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.vhead { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.vhead img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; }
.vhead b { font-family: var(--display); font-size: 18px; display: block; }
.vhead small { color: var(--muted); font-size: 12.5px; }
.vlist { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.vlist li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--soft); }
.vlist li:nth-child(-n+2) { font-weight: 600; }
.vlist .pos { color: var(--accent); white-space: nowrap; }
.vlist .neg { color: var(--high); white-space: nowrap; }

/* prose page */
.prose { max-width: 720px; padding: 8px 0; }
.prose h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; }
.prose h2 { font-size: 22px; margin: 28px 0 8px; }
.prose p, .prose li { font-size: 17px; }
.tiers { list-style: none; padding: 0; display: grid; gap: 8px; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-right: 6px; }
.tag.top { background: var(--top-bg); color: var(--top); } .tag.good { background: var(--good-bg); color: var(--good); }
.tag.fair { background: var(--fair-bg); color: var(--fair); } .tag.high { background: var(--high-bg); color: var(--high); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 13px; }
.prose .credits li { font-size: 14px; color: var(--muted); }

.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; max-width: 760px; }
.code { background: var(--soft); padding: 12px 14px; border-radius: 10px; font-size: 14px; overflow-x: auto; }
