/* JBAG website. System fonts (no outside requests), light and dark themes from tokens. */
:root {
  --bg: #f6f4f0; --surface: #ffffff; --ink: #1b2430; --muted: #5d6673; --line: #dcd7cf;
  --brand: #15191f; --brand-ink: #ffffff; --accent: #c4161c; --accent-ink: #ffffff; --ok: #1d7f47; --err: #a3201b;
  --radius: 10px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Semibold", "Helvetica Neue", Arial, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161d; --surface: #19212b; --ink: #e8ecf1; --muted: #9aa5b2; --line: #2b3542; --brand: #0b0d10; --accent: #e5383b; --ok: #5fc78b; --err: #f27a72; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
.narrow { max-width: 720px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(28px, 4vw, 42px); margin: 24px 0 12px; } h2 { font-size: 22px; margin: 28px 0 12px; } h3 { font-size: 17px; margin: 0 0 4px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 21px; font-weight: 700; text-decoration: none; letter-spacing: .01em; }
.brand span { font-weight: 400; opacity: .8; }
.top nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.top nav a { text-decoration: none; font-weight: 600; opacity: .92; } .top nav a:hover { opacity: 1; text-decoration: underline; }
.top .call { background: var(--accent); color: var(--accent-ink); padding: 6px 12px; border-radius: 999px; }
.top button { font: inherit; font-weight: 600; background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
form.inline { display: inline; }

.hero { background: linear-gradient(160deg, var(--brand) 0%, #2a3038 100%); color: var(--brand-ink); padding-block: 40px 48px; }
.hero h1 { max-width: 20ch; } .hero p { max-width: 60ch; font-size: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 13px !important; font-weight: 700; opacity: .85; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 8px; border: 2px solid currentColor; background: transparent; color: inherit; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-width: 1px; }
.btn.wide { display: block; width: 100%; text-align: center; margin-top: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card a { text-decoration: none; display: block; height: 100%; }
.ph { aspect-ratio: 4/3; max-width: 100%; background: linear-gradient(135deg, var(--line), var(--bg)); display: flex; align-items: center; justify-content: center; position: relative; color: var(--muted); font-weight: 700; font-size: 22px; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph em { position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--accent-ink); font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.ph.big { aspect-ratio: 16/10; }
.cb { padding: 12px 14px 16px; } .cb p { margin: 2px 0; }
.price { font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; } .price.big { font-size: 36px; margin: 4px 0; }
.pay { color: var(--accent); }
.disc { font-size: 12px; color: var(--muted); max-width: 90ch; margin-top: 18px; }

.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 13px; } label.check input { width: auto; margin-top: 3px; }

.vgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .vgrid { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: 8px; } .gallery img { border-radius: var(--radius); }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 76px; }
.side h1 { font-size: 26px; margin-top: 0; }
.paybox { border: 2px solid var(--accent); border-radius: 8px; padding: 12px; margin: 12px 0; }
.feats { columns: 2; padding-left: 18px; } @media (max-width: 560px) { .feats { columns: 1; } }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; } .dl div { min-width: 0; } .dl dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.crumbs { font-size: 14px; color: var(--muted); margin-top: 20px; }
.lead { display: grid; gap: 12px; } .lead h2 { margin: 18px 0 0; }
.hp { position: absolute; left: -9999px; }
.notice { background: var(--surface); border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: 6px; }
.ok { color: var(--ok); font-weight: 700; } .err { color: var(--err); font-weight: 700; }

.foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 48px; padding-block: 28px; }
.foot .wrap { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; } @media (max-width: 700px) { .foot .wrap { grid-template-columns: 1fr; } }

/* Staff screens */
.admin .top { background: var(--ink); } @media (prefers-color-scheme: dark) { .admin .top { background: #0a0e13; } }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tbl { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; } tr:last-child td { border-bottom: 0; } .num { text-align: right; white-space: nowrap; }
.form { display: grid; gap: 16px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; display: grid; gap: 12px; }
legend { font-weight: 700; padding: 0 6px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.vinrow { display: flex; gap: 8px; } .vinrow input { flex: 1; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; } .pgrid figure { margin: 0; display: grid; gap: 6px; } .pgrid img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Staff home */
.home .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; }
.tabs a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.tabs a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kpi.alert { border-color: var(--err); } .kpi.alert .v { color: var(--err); }
.kpi .l { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.kpi .v { font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi .n { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid2 > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; min-width: 0; }
.grid2 .panel { margin-bottom: 0; }
.panel h2 { margin: 0 0 12px; font-size: 19px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .panel-head h2 { margin: 0; }
.list { display: flex; flex-direction: column; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; } .li:last-child { border-bottom: 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.good { background: #e1f2e8; color: #1d6b3d; border-color: transparent; } .chip.warn { background: #fbf0dc; color: #8a5a0e; border-color: transparent; }
.chip.bad { background: #fbe6dc; color: #a33c16; border-color: transparent; } .chip.crit { background: #f9dfdd; color: #9a1f1a; border-color: transparent; } .chip.acc { background: #e2ebf8; color: #1d4f9c; border-color: transparent; }
@media (prefers-color-scheme: dark) { .chip.good { background: #16301f; color: #7dd6a2; } .chip.warn { background: #33270f; color: #e9b866; } .chip.bad { background: #3a1f14; color: #f39a72; } .chip.crit { background: #3d1918; color: #f48d86; } .chip.acc { background: #1c2c44; color: #8db8f2; } }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nowrap { white-space: nowrap; }
.banner { background: var(--surface); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tool { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.tool:hover { border-color: var(--accent); } .tool span { font-size: 13px; color: var(--muted); } .tool.off { opacity: .55; }
.board { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; }
.col { background: var(--bg); border-radius: 8px; padding: 10px; min-width: 200px; } .col h3 { font-size: 14px; margin: 0 0 8px; }
.ro { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; display: grid; gap: 4px; font-size: 14px; }
.rof { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; } .rof select { width: auto; flex: 1; padding: 4px; font-size: 13px; }
.li form.inline select { width: auto; padding: 4px; font-size: 13px; }
.clock { border: 2px solid var(--ok); } .btn.big { font-size: 20px; padding: 14px 28px; }
details.add { margin-top: 12px; } details.add summary { cursor: pointer; font-weight: 700; color: var(--accent); }
details.add .cols { margin-top: 10px; align-items: end; }
.receipt { background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; padding: 16px; font-size: 14px; white-space: pre-wrap; }
.top .who { opacity: .75; font-size: 14px; }
.row h1 { margin-bottom: 0; }
.mt { margin-top: 18px; }
input.auto { width: auto; }
.admin .foot { display: none; }
.brand img { height: 46px; width: auto; display: block; }
@media (max-width: 560px) { .brand img { height: 36px; } }

/* Demo copy tag (only when DEMO_MODE=1) */
.demo-tag { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 24px); background: #8a5a0e; color: #fff; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: none; text-align: center; }
@media print { .demo-tag { display: none; } }
.top nav a.pay { color: #fff; border: 1.5px solid rgba(255,255,255,.7); padding: 5px 12px; border-radius: 999px; } .top nav a.pay:hover { border-color: #fff; }

/* Launch pages: doors, reviews, service, trade-in, about, privacy */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 28px; }
.door { display: grid; gap: 4px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; }
.door b { font-family: var(--display); font-size: 19px; } .door span { color: var(--muted); font-size: 15px; } .door:hover b { text-decoration: underline; }
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.review { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.review blockquote { margin: 0; font-size: 16px; overflow-wrap: anywhere; } .review figcaption { font-size: 14px; color: var(--muted); }
.stars { color: #d99a06; letter-spacing: 2px; font-size: 17px; } .stars .off { color: var(--line); }
.avg { display: flex; align-items: center; gap: 8px; font-size: 18px; flex-wrap: wrap; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 24px; } .facts h2 { font-size: 17px; margin-bottom: 4px; } .facts p { margin-top: 0; }
.thanks { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius); padding: 4px 18px; margin-top: 18px; }
.thanks h2 { margin-top: 14px; color: var(--ok); }
.notice.bad { border-left-color: var(--err); } .notice ul { margin: 6px 0 0; padding-left: 20px; }
.lead.form h2 { margin-bottom: 0; }
.flinks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; } .flinks a { font-size: 14px; }
.legal h2 { font-size: 19px; } .legal li { margin-bottom: 6px; }
.ld p { margin: 6px 0 0; } .thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; } .thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
@media (max-width: 760px) { .top nav { gap: 6px 12px; font-size: 15px; } }
a.kpi.link { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.kpi.link:hover, a.kpi.link:focus-visible { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
a.kpi.link .n::after { content: " ›"; color: var(--accent); font-weight: 700; }
/* Vehicle history (CARFAX) */
.historybox { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.historybox h2 { font-size: 18px; margin: 0 0 6px; } .historybox ul.hl { margin: 0 0 10px; padding-left: 20px; } .historybox li { margin: 2px 0; }
.card .hist { font-size: 13px; color: var(--ok); font-weight: 600; margin: 2px 0; }
