:root {
  --bg: #0E1013; --surface: #171A1F; --surface2: #121418; --border: #2A2F37;
  --text: #F2F4F7; --text2: #C9CED6; --muted: #9AA3AF;
  --red: #D7263D; --yellow: #FFD23F; --blue: #4DA3FF; --orange: #FF9F1C;
  --mono: "JetBrains Mono", Consolas, Menlo, monospace;
  --head: "Space Grotesk", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, -apple-system, Segoe UI, sans-serif; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--yellow); }
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.02em; margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.kerb { display: inline-flex; gap: 2px; vertical-align: middle; }
.kerb i { width: 7px; height: 16px; transform: skewX(-22deg); display: block; }
.kerb i:nth-child(odd) { background: var(--red); } .kerb i:nth-child(2) { background: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 700; font-size: 20px; }

header.top { border-bottom: 1px solid var(--border); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
header.top nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; color: var(--text2); }
header.top nav a { color: var(--text2); }
header.top nav a.on { color: var(--text); font-weight: 600; }
header.top .right { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--text2); font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input:focus, select:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text2); }
label.check { flex-direction: row; align-items: center; gap: 10px; }
label.check input { min-height: 0; width: 20px; height: 20px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.kv span:first-child { color: var(--muted); }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text2); font-size: 13px; cursor: pointer; font-family: var(--mono); }
.chip.on { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: #22262D; color: var(--text2); }
.badge.warn { background: #3a2a10; color: var(--orange); }
.badge.best { background: var(--yellow); color: var(--bg); font-weight: 700; }
.note { font-size: 13px; color: var(--muted); }
.err { color: var(--orange); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 6px; }
td { border-top: 1px solid var(--border); padding: 10px 6px; }
td.num, th.num { text-align: right; font-family: var(--mono); }
tr.me { background: #1F2A3A; }
.scroll { overflow-x: auto; }
main.page { padding: 24px 0 60px; }
main.page > .wrap { display: flex; flex-direction: column; gap: 18px; }

/* lap viewer */
.viewer { display: flex; flex-wrap: wrap; gap: 16px; }
.viewer .map { flex: 999 1 560px; min-width: 0; height: 460px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #1C2619; position: relative; }
.viewer .side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.map canvas.plain { width: 100%; height: 100%; display: block; }
.traces { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; user-select: none; touch-action: pan-y; }
.trace { display: grid; grid-template-columns: 110px 1fr 120px; gap: 12px; align-items: center; padding: 4px 0; border-bottom: 1px solid #22262D; }
.trace canvas { width: 100%; height: 46px; display: block; }
.trace.big canvas { height: 100px; }
.trace .lbl { font-size: 13px; color: var(--text2); }
.trace .val { font-family: var(--mono); font-size: 13px; text-align: right; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.legend i { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* landing */
.hero { display: grid; gap: 48px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: center; padding: 48px 0 24px; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.02; }
.hero p { font-size: 19px; color: var(--text2); max-width: 540px; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--yellow); letter-spacing: 0.08em; }
section.block { padding: 64px 0 16px; }
section.block h2 { font-size: 34px; margin-bottom: 24px; }
.price { font-family: var(--head); font-size: 38px; font-weight: 700; }
.price small { font-size: 16px; color: var(--muted); font-weight: 500; }
.card ul { margin: 0; padding-left: 18px; color: var(--text2); line-height: 1.9; }
footer.foot { border-top: 1px solid var(--border); margin-top: 64px; padding: 28px 0 48px; color: var(--muted); font-size: 14px; }
footer.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer.foot a { color: var(--muted); }
@media (max-width: 640px) { .trace { grid-template-columns: 80px 1fr 70px; } .viewer .map { height: 320px; } }
