/* Inkwell VIN Lookup — ink/gold system shared with Inkwell Data */
:root {
  --paper: #11141b; --panel: #171b25; --panel-2: #1a1f2b; --ink: #f3ebdd; --ink-2: #4fa3a8; --ink-2-hover: #66b7bc;
  --on-ink: #11141b; --gold: #4fa3a8; --gold-soft: rgba(79,163,168,.13); --brass: #c9a44c; --link: #8cc9cc;
  --text: #e9e2d5; --muted: #b6ac9a; --line: #2a3140; --line-2: #20252f; --hl: rgba(201,164,76,.14);
  --ok: #7bb98a; --ok-bg: rgba(123,185,138,.12); --err: #e8907e; --err-bg: rgba(192,83,59,.16);
  --warn: #e0b45c; --warn-bg: rgba(201,164,76,.14);
  --shadow: 0 12px 30px rgba(0,0,0,.22); --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --surface: rgba(23,27,37,.86); --edge: rgba(243,235,221,.11); --edge-hover: rgba(243,235,221,.25);
  --glow-1: rgba(79,163,168,.10); --glow-2: rgba(192,83,59,.08); --brass-line: rgba(201,164,76,.45);
  --header-bg: color-mix(in srgb, var(--paper) 88%, transparent);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #f6f3ec; --panel: #ffffff; --panel-2: #faf8f3; --ink: #1b1d22; --ink-2: #26787d; --ink-2-hover: #1f6569;
  --on-ink: #ffffff; --gold: #26787d; --gold-soft: rgba(38,120,125,.10); --brass: #8a6720; --link: #1d6a6f;
  --text: #2a2f3a; --muted: #5d584e; --line: #e2dcd0; --line-2: #ece7dd; --hl: rgba(201,164,76,.20);
  --ok: #2c7340; --ok-bg: rgba(44,115,64,.10); --err: #b0402a; --err-bg: rgba(176,64,42,.09);
  --warn: #8a5a10; --warn-bg: rgba(201,164,76,.18);
  --shadow: 0 8px 22px rgba(40,32,18,.08); --surface: #ffffff; --edge: #e2dcd0; --edge-hover: #cfc6b5;
  --glow-1: rgba(38,120,125,.07); --glow-2: rgba(201,164,76,.08); --brass-line: rgba(138,103,32,.45);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background-image: radial-gradient(900px 500px at 85% -10%, var(--glow-1), transparent 60%), radial-gradient(700px 400px at -10% 10%, var(--glow-2), transparent 60%);
  background-repeat: no-repeat;
}
a { color: var(--link); }
a:hover { color: var(--ink-2-hover); }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; color: var(--ink); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--header-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: Fraunces, Georgia, serif; font-size: 20px; font-weight: 600; }
.brand-name em { font-style: normal; color: var(--brass); }
.head-tools { display: flex; align-items: center; gap: 8px; }
.head-link { font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 999px; }
.head-link:hover { color: var(--ink); background: var(--gold-soft); }
.icon-toggle { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--edge); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.icon-toggle:hover { border-color: var(--edge-hover); }

/* hero */
.hero { padding: 56px 0 28px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); margin: 12px 0 14px; max-width: 16ch; }
.lede { font-size: 18px; color: var(--muted); max-width: 62ch; margin: 0 0 26px; }
.lede strong { color: var(--text); font-weight: 600; }

.search { background: var(--surface); border: 1px solid var(--edge); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); max-width: 760px; }
.search-row { display: flex; gap: 10px; }
.vin-field { position: relative; flex: 1; min-width: 0; }
.vin-input {
  width: 100%; height: 58px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font: 600 clamp(16px, 3.6vw, 22px)/1 var(--mono); letter-spacing: .12em; padding: 0 74px 0 18px; text-transform: uppercase;
}
.vin-input::placeholder { color: var(--muted); letter-spacing: .04em; font-weight: 400; font-family: Inter, system-ui, sans-serif; text-transform: none; font-size: 16px; }
.vin-input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--gold-soft); }
.vin-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 600 13px var(--mono); color: var(--muted); }
.vin-count.full { color: var(--ok); }
.search-hint { margin: 10px 4px 0; font-size: 14px; color: var(--muted); min-height: 1.5em; }
.search-hint.err { color: var(--err); }
.search-hint button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--ink-2); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-2-hover); color: var(--on-ink); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--edge); }
.btn-ghost:hover { border-color: var(--edge-hover); color: var(--ink); }
.btn-lg { height: 58px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn svg { width: 17px; height: 17px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }

.where { margin-top: 14px; font-size: 14px; color: var(--muted); }
.where summary { cursor: pointer; color: var(--link); width: fit-content; }
.where ul { margin: 8px 0 0; padding-left: 20px; }

/* coverage */
.section { padding: 26px 0; }
.section > h2, .section-head h2 { font-size: 28px; margin: 0 0 6px; }
.section-sub { color: var(--muted); margin: 0 0 18px; max-width: 70ch; }
.coverage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cov-card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 22px; }
.cov-card h3 { font-size: 20px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.cov-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cov-card li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 14.5px; line-height: 1.5; }
.cov-card li b { color: var(--ink); font-weight: 600; }
.cov-card li span { color: var(--muted); }
.mark { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.mark.yes { background: var(--ok-bg); color: var(--ok); }
.mark.no { background: var(--err-bg); color: var(--err); }
.cov-card.not { border-color: var(--brass-line); }
.coverage-note { margin-top: 14px; font-size: 14px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; padding: 16px; font-size: 14px; color: var(--muted); }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--gold-soft); color: var(--ink-2); font-weight: 700; margin-bottom: 10px; }
.steps b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 15px; }

/* results */
#results[hidden] { display: none; }
.result-head { background: var(--surface); border: 1px solid var(--edge); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); margin-top: 8px; }
.result-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.result-title h2 { font-size: clamp(28px, 4.5vw, 40px); margin: 6px 0 6px; }
.result-meta { color: var(--muted); font-size: 15px; }
.vin-chip { font: 600 15px var(--mono); letter-spacing: .08em; padding: 6px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); display: inline-block; margin-top: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.not-a-history { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--text); font-size: 14px; border: 1px solid var(--brass-line); }
.not-a-history a { font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 18px; }
.tile { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; }
.tile .k { font-size: 12.5px; color: var(--muted); }
.tile .v { font: 600 24px/1.2 Fraunces, Georgia, serif; color: var(--ink); margin-top: 4px; }
.tile .s { font-size: 12.5px; color: var(--muted); }

.emailer { margin-top: 18px; padding: 18px; border-radius: 16px; border: 1px solid var(--edge); background: var(--panel-2); }
.emailer[hidden] { display: none; }
.emailer h3 { margin: 0 0 4px; font-size: 19px; }
.emailer p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.emailer textarea { width: 100%; min-height: 84px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; padding: 10px 12px; resize: vertical; }
.emailer textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--gold-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; min-height: 4px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--ink-2); }
.chip.bad { background: var(--err-bg); color: var(--err); }
.emailer-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.status { font-size: 14px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 22px; margin-top: 16px; }
.card > h2 { font-size: 24px; margin: 0 0 4px; }
.card > .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.card h3 { font-size: 17px; margin: 18px 0 8px; font-family: Inter, system-ui, sans-serif; font-weight: 650; }
.src { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.err-box { padding: 12px 14px; border-radius: 12px; background: var(--err-bg); color: var(--err); font-size: 14.5px; }
.empty { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); color: var(--muted); font-size: 14.5px; }

dl.kv { display: grid; grid-template-columns: minmax(150px, 42%) 1fr; margin: 0; }
dl.kv dt, dl.kv dd { padding: 8px 0; border-bottom: 1px solid var(--line-2); margin: 0; font-size: 14.5px; }
dl.kv dt { color: var(--muted); padding-right: 12px; }
dl.kv dd { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
details.group { border-top: 1px solid var(--line-2); }
details.group:first-of-type { border-top: 0; }
details.group > summary { list-style: none; cursor: pointer; padding: 14px 0; display: flex; justify-content: space-between; align-items: center; font-weight: 650; color: var(--ink); }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: '+'; font: 400 22px/1 Inter, sans-serif; color: var(--muted); }
details.group[open] > summary::after { content: '\2212'; }
details.group > summary .n { font-weight: 400; color: var(--muted); font-size: 13.5px; margin-left: 8px; }
details.group > dl { margin-bottom: 14px; }

.recall { border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; margin-top: 12px; background: var(--panel-2); }
.recall-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.recall-top b { font-family: var(--mono); color: var(--ink); }
.recall .comp { font-weight: 650; color: var(--ink); margin: 6px 0; }
.recall p { margin: 6px 0 0; font-size: 14.5px; }
.recall p span { color: var(--muted); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 40px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar .lbl { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar .fill { height: 100%; background: var(--ink-2); border-radius: 99px; }
.bar .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.complaint { border-top: 1px solid var(--line-2); padding: 12px 0; font-size: 14.5px; }
.complaint .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }

.variant { border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; margin-top: 12px; background: var(--panel-2); }
.variant .vt { font-weight: 650; color: var(--ink); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stars { color: var(--brass); letter-spacing: 2px; font-size: 16px; }
.stars .off { color: var(--line); }

.fuel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }

.links-group { margin-top: 14px; }
.link-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line-2); }
.link-row a { font-weight: 650; }
.link-row p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.link-row .btn { flex: none; }

.disclaimer { font-size: 13px; color: var(--muted); margin-top: 18px; }

.loading { display: flex; align-items: center; gap: 12px; padding: 22px; color: var(--muted); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* footer */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line-2); padding: 34px 0 40px; font-size: 14px; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.site-footer h4 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--ink-2); }
.copy { margin-top: 26px; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (max-width: 860px) {
  .coverage, .grid2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .fuel { grid-template-columns: 1fr 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .search-row { flex-direction: column; }
  .btn-lg { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { border-bottom: 0; padding-bottom: 0; }
  .link-row { flex-direction: column; }
  .head-link { display: none; }
  .fuel { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .search, .actions, .emailer, .site-footer, #coverage, #how { display: none !important; }
  body { background: #fff; }
}

.narrow { max-width: 760px; }
.page-h1 { font-size: 40px; }
.narrow .section h2 { font-size: 22px; margin-top: 26px; }

/* ---------- bulk lookup ---------- */
.hero-tight { padding-bottom: 12px; }
.bulk-form { max-width: none; display: grid; gap: 12px; }
.bulk-label { font-weight: 600; color: var(--ink); font-size: 15px; }
.bulk-input { width: 100%; min-height: 320px; max-height: 70vh; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font: 500 15px/1.6 var(--mono); letter-spacing: .06em; padding: 12px 14px; resize: vertical; text-transform: uppercase; }
.bulk-input::placeholder { color: var(--muted); text-transform: none; letter-spacing: .02em; }
.bulk-input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--gold-soft); }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bulk-bar .search-hint { margin: 0; }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.opts { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14.5px; }
.opts label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.opts input { accent-color: var(--ink-2); width: 16px; height: 16px; }
.progress-top { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 10px; }
.progress { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--ink-2); border-radius: 99px; transition: width .25s; }
.bulk-card { padding: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filter { font: 600 13px Inter, system-ui, sans-serif; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--edge); background: var(--panel-2); color: var(--text); cursor: pointer; }
.filter.on { background: var(--ink-2); color: var(--on-ink); border-color: var(--ink-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; max-height: 70vh; }
.bulk-table { border-collapse: collapse; width: 100%; font-size: 13.5px; white-space: nowrap; }
.bulk-table th { position: sticky; top: 0; background: var(--panel-2); text-align: left; font-weight: 650; color: var(--ink); padding: 9px 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.bulk-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); color: var(--text); }
.bulk-table tr:hover td { background: var(--hl); }
.bulk-table td.note { white-space: normal; min-width: 220px; color: var(--muted); font-size: 12.5px; }
.bulk-table .badge { font-size: 12px; padding: 2px 8px; }
.bulk-cta { margin-top: 12px; font-size: 14.5px; }
.how { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); display: grid; gap: 3px; }
.how b { color: var(--text); font-weight: 600; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--ink-2); }
.file-chip[hidden] { display: none; }
.file-chip button { border: 0; background: transparent; color: inherit; font-size: 17px; line-height: 1; cursor: pointer; width: 24px; height: 24px; border-radius: 999px; }
.file-chip button:hover { background: var(--gold-soft); }
@media (max-width: 560px) { .bulk-input { min-height: 240px; } }
