/* GK10 Tyre Compare - site styles. No external fonts, no external anything. */

:root {
  --bg: #10131a;
  --bg-2: #171b25;
  --bg-3: #1e2432;
  --line: #2a3143;
  --text: #e8ecf4;
  --text-dim: #9aa5bb;
  --text-faint: #6b7488;
  --accent: #f0a04b;
  --accent-2: #4bb3f0;
  --good: #52c07a;
  --warn: #e8b13c;
  --bad: #e06a5a;
  --radius: 10px;
  --maxw: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

a { color: var(--accent-2); }
a:hover { color: #7fcbf5; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 3.6vw, 1.6rem); margin-top: 1.8em; }
h3 { font-size: 1.05rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  position: sticky; top: 0; z-index: 40;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 56px; flex-wrap: wrap;
}
.brand {
  font-weight: 700; color: var(--text); text-decoration: none;
  font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap;
}
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-dim); text-decoration: none; font-size: .9rem;
  padding: 8px 10px; border-radius: 8px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--text); background: var(--bg-3);
}

/* ---------- safety notice ---------- */
.safety {
  background: #3a2418; border: 1px solid #6b3f22;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 14px 16px; margin: 20px 0;
}
.safety strong { color: var(--accent); }
.safety p:last-child { margin-bottom: 0; }
.safety-sm { font-size: .88rem; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 12px; }
.hero .lede { font-size: 1.1rem; color: var(--text-dim); max-width: 62ch; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.pill {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: .82rem; color: var(--text-dim);
}

/* ---------- cards / panels ---------- */
.panel {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin: 16px 0;
}
.panel h2 { margin-top: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.card-link {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; transition: border-color .15s;
}
.card-link:hover { border-color: var(--accent); color: inherit; }
.card-link h3 { margin: 0 0 6px; color: var(--text); }
.card-link p { margin: 0; color: var(--text-dim); font-size: .92rem; }

/* ---------- forms ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font-weight: 600; font-size: 1rem; padding: 0; margin-bottom: 10px; }
.hint { color: var(--text-dim); font-size: .88rem; margin: -6px 0 10px; }

.opts { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .opts.two { grid-template-columns: 1fr 1fr; } }

.opt {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  min-height: 44px;
}
.opt:hover { border-color: #3d4761; }
.opt input { margin: 3px 0 0; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.opt input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.opt-body { flex: 1; }
.opt-title { font-weight: 600; font-size: .95rem; }
.opt-note { color: var(--text-dim); font-size: .84rem; }
.opt:has(input:checked) { border-color: var(--accent); background: #241d16; }

select, input[type="text"], input[type="search"] {
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: .95rem;
  min-height: 44px; width: 100%;
}
select:focus, input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; background: var(--accent); color: #1a1206;
  border: 0; border-radius: 8px; padding: 12px 20px;
  font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; min-height: 44px; text-decoration: none;
}
.btn:hover { background: #f5b268; color: #1a1206; }
.btn.secondary {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
}
.btn.secondary:hover { background: #262e40; color: var(--text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- weights ---------- */
.weights { display: grid; gap: 10px; }
.weight-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.weight-row:last-child { border-bottom: 0; }
.weight-row label { font-size: .92rem; }
.weight-row .val { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; min-width: 2.5ch; text-align: right; }
.weight-row input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); height: 28px; }
.cat-group { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-top: 14px; }

/* ---------- results ---------- */
.result {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.result.top { border-color: var(--accent); }
.result-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rank {
  font-size: 1.5rem; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.result-name { font-size: 1.15rem; font-weight: 700; }
.result-name a { color: var(--text); text-decoration: none; }
.result-name a:hover { color: var(--accent); }
.score-big {
  margin-left: auto; font-size: 1.4rem; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.score-big small { font-size: .7rem; color: var(--text-dim); font-weight: 500; }

.bars { margin-top: 12px; display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .84rem; }
.bar-label { color: var(--text-dim); }
.bar-track { background: var(--bg); border-radius: 4px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent-2); border-radius: 4px; }
.bar-val { font-variant-numeric: tabular-nums; color: var(--text-dim); min-width: 5ch; text-align: right; }

.reasoning {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: .88rem; color: var(--text-dim);
}
.reasoning table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.reasoning th, .reasoning td { text-align: right; padding: 3px 6px; }
.reasoning th:first-child, .reasoning td:first-child { text-align: left; }
.reasoning thead th { color: var(--text); border-bottom: 1px solid var(--line); }
.reasoning tfoot td { border-top: 1px solid var(--line); font-weight: 700; color: var(--text); }

/* ---------- badges ---------- */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.badge.high { background: #17361f; color: #7fe0a0; border: 1px solid #2c5c3a; }
.badge.medium { background: #3a3216; color: #e8cd7a; border: 1px solid #6b5c26; }
.badge.low { background: #3d1f1b; color: #f0a094; border: 1px solid #6e352c; }
.badge.neutral { background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--line); }
.badge.nodata { background: var(--bg-3); color: var(--text-dim); border: 1px dashed var(--line); }

.nodata-text { color: var(--text-dim); font-style: italic; }

/* ---------- table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { border-collapse: collapse; width: 100%; font-size: .88rem; min-width: 780px; }
table.data th, table.data td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-2); z-index: 1; }
table.data thead th { background: var(--bg-3); color: var(--text); font-weight: 600; position: sticky; top: 0; z-index: 2; }
table.data thead th:first-child { z-index: 3; background: var(--bg-3); }
table.data thead th button {
  background: none; border: 0; color: inherit; font: inherit; font-weight: 600;
  cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center;
}
table.data tbody tr:hover td { background: var(--bg-3); }
table.data tbody tr:hover td:first-child { background: var(--bg-3); }
table.data td.num { font-variant-numeric: tabular-nums; }
.sort-ind { color: var(--accent); font-size: .8em; }

/* ---------- detail ---------- */
.spec-list { display: grid; gap: 0; margin: 0; }
.spec-list > div {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem;
}
.spec-list dt { color: var(--text-dim); }
.spec-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.source-note {
  font-size: .82rem; color: var(--text-dim);
  background: var(--bg-3); border-radius: 8px; padding: 10px 12px; margin-top: 10px;
}
.opinion-block {
  border-left: 3px solid var(--accent-2); background: #14202b;
  padding: 12px 14px; border-radius: 0 8px 8px 0; margin: 12px 0;
}
.opinion-block .label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-2); font-weight: 700; margin-bottom: 4px;
}

/* ---------- ad slots (dormant) ---------- */
.ad-slot {
  margin: 24px 0; min-height: 0;
  border-radius: var(--radius);
  padding: 0; text-align: center; color: var(--text-dim); font-size: .8rem;
}
.ad-slot[hidden] { display: none !important; }
/* Only a slot that actually carries an ad gets a frame. A dashed placeholder
   border around a live ad reads as a broken element. The reserved height keeps
   the ad from shoving content down as it loads. */
.ad-slot[data-ad-filled="yes"] {
  border: 1px solid var(--line); min-height: 120px;
}
.ad-slot .ad-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); padding: 6px;
}

/* ---------- consent banner ---------- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--bg-3); border-top: 1px solid var(--line);
  padding: 16px; box-shadow: 0 -4px 20px rgba(0,0,0,.4);
}
.consent[hidden] { display: none !important; }
.consent .wrap { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.consent p { margin: 0; font-size: .9rem; flex: 1 1 280px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 48px;
  padding: 28px 0 40px; background: var(--bg-2);
  font-size: .86rem; color: var(--text-dim);
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-meta { font-size: .8rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #1a1206; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 0; }

.muted { color: var(--text-dim); }
.small { font-size: .86rem; }
ul.tight { margin: 0 0 1em; padding-left: 1.2em; }
ul.tight li { margin-bottom: .35em; }
