/* =========================================================
   Mythras AntiCheat
   Dark Mode (OLED): pure black, white text, red for what matters.
   Flat surfaces, 1px lines, no gradients.
   ========================================================= */

:root {
  --bg: #000;
  --text: #fff;
  --muted: #a3a3a3;          /* 8.3:1 on black */
  --line: #222;
  --line-2: #3a3a3a;
  --hover: #0d0d0d;
  --red: #e10f1f;            /* fills: white text on it is 4.9:1 */
  --red-text: #ff3344;       /* red text on black: 5.8:1 */

  --font-display: "Russo One", "Chakra Petch", system-ui, sans-serif;
  --font-body: "Chakra Petch", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t: 200ms;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; outline: none; }
img { max-width: 100%; display: block; }
a { color: var(--text); text-underline-offset: 3px; }
p { margin: 0 0 var(--s4); }
h1, h2, h3, h4 { margin: 0 0 var(--s3); line-height: 1.12; font-weight: 400; }
h1, h2 { font-family: var(--font-display); letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.15rem; font-weight: 700; }
code, .mono { font-family: var(--font-mono); }
button { font: inherit; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }

.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.red { color: var(--red-text); }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--text); color: var(--bg); padding: var(--s2) var(--s4); font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- icons ---------- */
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo { width: 30px; height: 30px; flex: 0 0 auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5);
  border: 1px solid var(--text); background: transparent; color: var(--text);
  font-family: var(--font-body); font-size: .95rem; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t) ease, color var(--t) ease, border-color var(--t) ease, transform 120ms ease;
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: #fff; border-color: #fff; color: var(--red); }
.btn-outline { border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--text); }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--text); background: transparent; color: var(--text); }
.btn-danger { border-color: var(--red); color: var(--red-text); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-lg { min-height: 52px; padding: 0 var(--s6); font-size: 1rem; }
.btn-sm { min-height: 36px; padding: 0 var(--s4); font-size: .85rem; }
.full { width: 100%; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); min-height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: var(--s5); }
.nav-links > a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: var(--s2) 0; transition: color var(--t); }
.nav-links > a:not(.btn):hover { color: var(--text); }
.nav-sep { width: 1px; height: 24px; background: var(--line-2); }
.nav-account { display: inline-flex; align-items: center; gap: var(--s2); }
.nav-account img, .mini-avatar { width: 28px; height: 28px; border-radius: 50%; }
.mini-avatar { display: inline-grid; place-items: center; background: var(--red); color: #fff; font-weight: 700; font-size: .8rem; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .when-open { display: none; }
.nav-toggle[aria-expanded="true"] .when-open { display: inline-flex; }
.nav-toggle[aria-expanded="true"] .when-closed { display: none; }

/* ---------- flash ---------- */
.flashes { padding-top: var(--s5); display: grid; gap: var(--s2); }
.flash { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line-2); }
.flash-success .ic { color: var(--text); }
.flash-error { border-color: var(--red); }
.flash-error .ic { color: var(--red-text); }

/* ---------- shared text bits ---------- */
.kicker { display: inline-flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s4); color: var(--red-text); font-weight: 700; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; }
.kicker-dot { width: 8px; height: 8px; background: var(--red); }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin-bottom: var(--s6); }
.chip-demo { border: 1px solid var(--line-2); color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px var(--s2); }
.tag-red { background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px var(--s2); }

/* ---------- hero ---------- */
.hero { padding: var(--s9) 0 var(--s8); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s8); align-items: center; }
.hero h1 { margin-bottom: var(--s5); }
.hero-actions { display: flex; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s6); }
.hero-proof { display: flex; flex-wrap: wrap; gap: var(--s5); list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: .9rem; font-weight: 600; }
.hero-proof li { display: inline-flex; align-items: center; gap: var(--s2); }
.hero-proof .ic { color: var(--red-text); width: 18px; height: 18px; }

/* detection console */
.console { border: 1px solid var(--line-2); background: var(--bg); }
.console-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.console-title { display: inline-flex; align-items: center; gap: var(--s2); font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.console-title .ic { width: 16px; height: 16px; color: var(--red-text); }
.console-log { list-style: none; margin: 0; padding: var(--s3) var(--s4); height: 316px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; font-family: var(--font-mono); font-size: .8rem; }
.log-line { display: grid; grid-template-columns: 62px 72px 1fr; gap: var(--s2); align-items: baseline; animation: lineIn 300ms var(--ease); }
.log-line .t { color: #6f6f6f; }
.log-line .tag { font-weight: 600; font-size: .72rem; padding: 0 6px; border: 1px solid var(--line-2); text-align: center; }
.log-line .msg { color: var(--text); overflow-wrap: anywhere; }
.log-line.is-veto .tag, .log-line.is-veto .msg { color: var(--muted); }
.log-line.is-veto .msg s { color: #6f6f6f; }
.log-line.is-confirm .tag { background: var(--red); border-color: var(--red); color: #fff; }
.log-line.is-confirm .msg { color: var(--red-text); }
.log-line.is-replay .tag { border-color: var(--text); }
@keyframes lineIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.console-foot { display: flex; gap: var(--s5); flex-wrap: wrap; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.console-foot b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.console-foot b.red { color: var(--red-text); }

/* ---------- sections ---------- */
.section { padding: var(--s9) 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: var(--s7); }
.section-head.center { margin-inline: auto; }
.section-head p:last-child { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feature { padding: var(--s6); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background var(--t); }
.feature:hover { background: var(--hover); }
.feature p { color: var(--muted); margin: 0; }
.feature-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-2); color: var(--text); margin-bottom: var(--s5); transition: border-color var(--t), color var(--t); }
.feature-icon .ic { width: 22px; height: 22px; }
.feature:hover .feature-icon { border-color: var(--red); color: var(--red-text); }
.feature-key .feature-icon { background: var(--red); border-color: var(--red); color: #fff; }
.feature-key:hover .feature-icon { color: #fff; }

/* replay player */
.replay { border: 1px solid var(--line-2); }
.replay-top { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.replay-id { font-family: var(--font-mono); font-size: .85rem; margin-right: auto; }
.replay-body { display: grid; grid-template-columns: 1fr 320px; }
.replay-stage { position: relative; border-right: 1px solid var(--line); }
.replay-stage video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--bg); }
.replay-events { list-style: none; margin: 0; padding: var(--s2); display: flex; flex-direction: column; gap: 2px; }
.replay-events button {
  display: flex; gap: var(--s3); width: 100%; min-height: 44px; align-items: center; text-align: left;
  padding: var(--s2) var(--s3); background: transparent; border: 1px solid transparent; color: #6f6f6f;
  cursor: pointer; font-size: .88rem; transition: color var(--t), border-color var(--t), background var(--t);
}
.replay-events button:hover { border-color: var(--line-2); color: var(--text); }
.replay-events .t { font-family: var(--font-mono); font-size: .78rem; min-width: 36px; }
.replay-events li.is-past button { color: var(--muted); }
.replay-events li.is-current button { color: var(--text); border-color: var(--line-2); background: var(--hover); }
.replay-events li.ev-flag.is-past button { color: var(--red-text); }
.replay-events li.ev-flag.is-current button { border-color: var(--red); }
.replay-controls { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); flex-wrap: wrap; }
.ctrl { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t); }
.ctrl:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.ctrl-play { background: var(--red); border-color: var(--red); color: #fff; }
.ctrl-play:hover { background: #fff; border-color: #fff; color: var(--red); }
.ctrl-play .when-playing { display: none; }
.replay.is-playing .ctrl-play .when-playing { display: inline-flex; }
.replay.is-playing .ctrl-play .when-paused { display: none; }
.timeline { position: relative; flex: 1 1 200px; display: flex; align-items: center; min-height: 44px; }
.timeline input { width: 100%; accent-color: var(--red); cursor: pointer; }
.timeline-flag { position: absolute; top: 6px; width: 2px; height: 8px; background: var(--red); transform: translateX(-1px); pointer-events: none; }
.rp-time { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); min-width: 92px; }
.speed { display: inline-flex; border: 1px solid var(--line-2); }
.speed button { min-width: 48px; min-height: 42px; background: transparent; border: 0; color: var(--muted); cursor: pointer; font-weight: 700; font-size: .85rem; transition: background var(--t), color var(--t); }
.speed button + button { border-left: 1px solid var(--line-2); }
.speed button:hover { color: var(--text); }
.speed button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* AI Learning */
.ai-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: var(--s8); align-items: center; }
.ai-toggle { display: inline-flex; border: 1px solid var(--line-2); margin: var(--s5) 0; }
.ai-toggle button { min-height: 44px; padding: 0 var(--s5); background: transparent; border: 0; color: var(--muted); font-weight: 700; cursor: pointer; transition: background var(--t), color var(--t); }
.ai-toggle button + button { border-left: 1px solid var(--line-2); }
.ai-toggle button:hover { color: var(--text); }
.ai-toggle button[aria-pressed="true"] { background: var(--red); color: #fff; }
.ai-stats { display: flex; gap: var(--s7); margin: 0 0 var(--s3); }
.ai-stats div { border-left: 2px solid var(--red); padding-left: var(--s4); }
.ai-stats dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.ai-stats dd { margin: 0; font-family: var(--font-display); font-size: 2.6rem; line-height: 1.1; }
.ai-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); }
.ai-list li { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); transition: background var(--t); }
.ai-list li:last-child { border-bottom: 0; }
.ai-list .who { font-weight: 700; }
.ai-list .why { color: var(--muted); font-size: .9rem; transition: color var(--t); }
.ai-list .verdict { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px var(--s2); border: 1px solid var(--text); min-width: 96px; text-align: center; transition: background var(--t), color var(--t), border-color var(--t); }
.ai-list[data-mode="ai"] li[data-real="false"] .who, .ai-list[data-mode="ai"] li[data-real="false"] .why { color: #6f6f6f; text-decoration: line-through; }
.ai-list[data-mode="ai"] li[data-real="false"] .verdict { border-color: var(--line-2); color: var(--muted); }
.ai-list[data-mode="ai"] li[data-real="true"] .verdict { background: var(--red); border-color: var(--red); color: #fff; }

/* get started */
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); align-items: center; }
.steps { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s5); }
.steps li { display: flex; gap: var(--s4); align-items: flex-start; }
.steps h3 { margin-bottom: var(--s1); }
.steps p { color: var(--muted); margin: 0; }
.step-n { flex: 0 0 auto; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--red); color: var(--red-text); font-family: var(--font-display); }
.steps-compact { margin: 0; grid-template-columns: repeat(3, 1fr); }

.license-mock { border: 1px solid var(--line-2); padding: var(--s6); }
.lm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s5); }
.lm-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: var(--s2); }
.lm-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin: var(--s5) 0 var(--s4); }
.lm-meta div { padding: var(--s4) 0 0; }
.lm-meta span { display: block; color: var(--muted); font-size: .78rem; }
.lm-meta b { font-size: 1.05rem; }

/* keys */
.key-row { display: flex; align-items: center; gap: var(--s1); }
.key { font-family: var(--font-mono); font-size: .85rem; border: 1px solid var(--line-2); padding: 6px var(--s3); white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; transition: color var(--t), border-color var(--t); }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn .ic { width: 18px; height: 18px; }
.status-dot { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: .9rem; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
.status-dot.is-bad { color: var(--red-text); }
.status-dot.is-bad::before { background: var(--red); }

/* pricing */
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.plan { position: relative; display: flex; flex-direction: column; padding: var(--s6) var(--s5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; margin-bottom: var(--s2); }
.plan-desc { color: var(--muted); font-size: .92rem; min-height: 3em; }
.plan-price { font-family: var(--font-display); font-size: 2.5rem; line-height: 1; margin: var(--s2) 0 var(--s5); }
.plan-price span { display: block; font-family: var(--font-body); font-size: .85rem; color: var(--muted); margin-top: var(--s2); }
.plan-list { list-style: none; margin: var(--s5) 0 0; padding: var(--s5) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--s3); font-size: .93rem; }
.plan-list li { display: flex; gap: var(--s2); align-items: flex-start; color: var(--muted); }
.plan-list .ic { width: 18px; height: 18px; color: var(--text); margin-top: 2px; }
.plan-featured { outline: 1px solid var(--red); outline-offset: -1px; z-index: 1; }
.plan-featured .plan-price { color: var(--red-text); }
.plan-featured .plan-list .ic { color: var(--red-text); }
.plan-flag { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 4px var(--s3); }

.compare-wrap { margin-top: var(--s7); overflow-x: auto; border: 1px solid var(--line); }
.compare { width: 100%; border-collapse: collapse; min-width: 680px; }
.compare th, .compare td { padding: var(--s4) var(--s5); text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; }
.compare thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.compare thead th.col-pro { color: var(--red-text); }
.compare tbody th { font-weight: 700; }
.compare td { color: var(--muted); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare tbody tr:hover { background: var(--hover); }
.compare .col-pro { border-inline: 1px solid var(--line-2); color: var(--text); }
.compare .ic.yes { color: var(--red-text); }
.compare .ic.no { color: #555; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: var(--s8); align-items: start; }
.faq { border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); min-height: 64px; padding: var(--s3) 0; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--red-text); transition: transform var(--t) ease; }
.faq details[open] summary .ic { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 var(--s5); max-width: 620px; }

/* CTA */
.cta { padding: var(--s9) 0; border-bottom: 1px solid var(--line); }
.cta-inner { text-align: center; }
.cta-inner p { color: var(--muted); font-size: 1.1rem; max-width: 520px; margin: 0 auto var(--s6); }

/* footer */
.footer { padding: var(--s8) 0 var(--s5); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s6); padding-bottom: var(--s7); }
.footer-brand p { color: var(--muted); max-width: 320px; margin-top: var(--s4); }
.footer h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text); margin-bottom: var(--s4); font-weight: 700; }
.footer-grid > div:not(.footer-brand) { display: flex; flex-direction: column; gap: var(--s2); }
.footer-grid a:not(.brand) { color: var(--muted); text-decoration: none; transition: color var(--t); }
.footer-grid a:not(.brand):hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding-top: var(--s5); border-top: 1px solid var(--line); color: #6f6f6f; font-size: .85rem; }

/* ---------- dashboard / admin ---------- */
.app { padding: var(--s7) 0 var(--s8); }
.app-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s6); }
.app-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0; }
.app-head p { margin: 0; }
.user-card { display: flex; align-items: center; gap: var(--s4); }
.user-card img { border-radius: 50%; border: 2px solid var(--red); }
.avatar-fallback { width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--red); color: #fff; font-family: var(--font-display); font-size: 1.4rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-bottom: var(--s6); }
.stat { padding: var(--s5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: var(--s2); }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 2rem; }

.panel { border: 1px solid var(--line); margin-bottom: var(--s6); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.panel-head h2 { display: inline-flex; align-items: center; gap: var(--s3); font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; margin: 0; }
.panel-head h2 .ic { color: var(--red-text); }
.panel-head p { margin: 0; }
.panel > .grid-form, .panel > .tier-grid, .panel > .steps, .panel > .empty { padding: var(--s5); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table tr[hidden] { display: none; }

.badge { display: inline-block; padding: 3px var(--s2); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line-2); }
.badge-free { color: var(--muted); }
.badge-base { color: var(--text); border-color: var(--text); }
.badge-pro { background: var(--red); border-color: var(--red); color: #fff; }
.badge-enterprise { background: var(--text); border-color: var(--text); color: var(--bg); }

.empty { text-align: center; padding: var(--s7) var(--s5) !important; }
.empty .empty-icon { width: 40px; height: 40px; color: var(--red-text); margin-bottom: var(--s3); }
.empty p { max-width: 380px; margin-inline: auto; }

.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.tier-card { border: 1px solid var(--line-2); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.tier-card p { margin: 0; flex: 1; }
.tier-card.is-owned { border-color: var(--red); }
.tier-card-top { display: flex; justify-content: space-between; align-items: center; }
.tier-card-top b { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; }
.owned { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; flex: 0 !important; }
.owned .ic { color: var(--red-text); }

.grid-form { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: var(--s4); align-items: end; }
label { display: flex; flex-direction: column; gap: var(--s2); font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
input, select {
  min-height: 44px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); padding: 0 var(--s3);
  font: inherit; font-size: .95rem; text-transform: none; letter-spacing: 0; font-weight: 500; transition: border-color var(--t);
}
input::placeholder { color: #6f6f6f; }
input:hover, select:hover { border-color: #555; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--text); outline-offset: 0; border-color: var(--text); }
input:user-invalid { border-color: var(--red); }
.search { flex-direction: row; }
.search input { width: 260px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--text); color: var(--bg); padding: var(--s3) var(--s5); font-weight: 700;
  transition: opacity var(--t), transform var(--t) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- license server pages (admin + customer) ---------- */
.subnav { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: calc(var(--s3) * -1) 0 var(--s6); overflow-x: auto; overflow-y: hidden; }
.stat b .mono { font-family: var(--font-display); font-size: inherit; }
.subnav a { padding: var(--s3) var(--s5); min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--t), border-color var(--t); }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--red); }

.api-error { display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid var(--red); padding: var(--s4) var(--s5); margin-bottom: var(--s6); }
.api-error .ic { color: var(--red-text); margin-top: 2px; }
.api-error b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--red-text); }
.api-error p { margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.filters label { min-width: 160px; }
.grow { flex: 1 1 260px; }
.table-foot { padding: var(--s3) var(--s5); margin: 0; border-top: 1px solid var(--line); }
.pad { padding: var(--s5); margin: 0; }
.nowrap { white-space: nowrap; }
.clamp { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-link { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.key-link:hover { color: var(--red-text); border-color: var(--red); }

.ev { font-weight: 700; font-size: .88rem; }
.ev-revoke, .ev-refused, .ev-expires { color: var(--red-text); }
.ev-activate, .ev-claim, .ev-create { color: var(--text); }
.ev-reset, .ev-note, .ev-owner, .ev-servers, .ev-plan, .ev-unrevoke { color: var(--muted); }

.plan-bars { padding: var(--s5); display: grid; gap: var(--s4); }
.plan-bar { display: grid; grid-template-columns: 120px 1fr 48px; gap: var(--s4); align-items: center; }
.plan-bar b { text-align: right; }
.plan-bar-track { height: 10px; border: 1px solid var(--line-2); }
.plan-bar-fill { display: block; height: 100%; background: var(--text); }
.plan-bar-fill.is-red { background: var(--red); }

.back-link { color: var(--red-text); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.key-title .key { font-size: 1.1rem; padding: var(--s2) var(--s4); }
.head-badges { display: flex; gap: var(--s3); align-items: center; }
.stat-sm { font-family: var(--font-body) !important; font-weight: 700 !important; font-size: 1.05rem !important; }
.note-line { display: flex; gap: var(--s3); align-items: center; border-left: 2px solid var(--red); padding: var(--s2) var(--s4); color: var(--muted); margin: calc(var(--s3) * -1) 0 var(--s6); }

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.action { padding: var(--s5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s2); }
.action:nth-child(3n) { border-right: 0; }
.action h3 { margin: 0; font-size: 1rem; }
.action p { margin: 0 0 var(--s2); flex: 1; }
.action-wide { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
.inline-form { display: flex; gap: var(--s2); }
.inline-form input, .inline-form select { flex: 1; min-width: 0; }

.status-dot.is-off { color: var(--muted); }
.status-dot.is-off::before { background: #555; }

.grid-form-wide { grid-template-columns: repeat(4, 1fr); }
.grid-form-wide .span-2 { grid-column: span 3; }

.claim-form { display: flex; gap: var(--s3); align-items: flex-end; padding: var(--s5); flex-wrap: wrap; }
.list-title { font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; margin: var(--s7) 0 var(--s4); }
.license-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.license-meta { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-bottom: 1px solid var(--line); }
.license-meta div { padding: var(--s4) var(--s5); border-right: 1px solid var(--line); }
.license-meta div:last-child { border-right: 0; }
.license-meta dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.license-meta dd { margin: var(--s1) 0 0; font-weight: 700; }
.license-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; padding: var(--s4) var(--s5); border-top: 1px solid var(--line); }
.license-foot p { margin: 0; max-width: 560px; }
.license-foot form { display: flex; align-items: center; gap: var(--s3); }
.wait { color: var(--red-text); font-weight: 700; font-size: .85rem; }
.tier-grid-3 { grid-template-columns: repeat(3, 1fr); }
.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--text); }

@media (max-width: 1024px) {
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .action:nth-child(3n) { border-right: 1px solid var(--line); }
  .action:nth-child(2n) { border-right: 0; }
  .grid-form-wide { grid-template-columns: repeat(2, 1fr); }
  .grid-form-wide .span-2 { grid-column: 1 / -1; }
  .tier-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .action-grid, .license-meta, .grid-form-wide { grid-template-columns: 1fr; }
  .action { border-right: 0 !important; }
  .license-meta div { border-right: 0; border-bottom: 1px solid var(--line); }
  .plan-bar { grid-template-columns: 96px 1fr 40px; }
  .filters label { min-width: 0; flex: 1 1 100%; }
}

/* ---------- admin 2FA + create license ---------- */
.auth-wrap { padding: var(--s8) 0; display: flex; justify-content: center; }
.auth-card { width: min(720px, 100%); border: 1px solid var(--line-2); padding: var(--s7) var(--s6); }
.auth-card-sm { width: min(480px, 100%); }
.auth-card h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.auth-card .kicker .ic, .created .kicker .ic { width: 16px; height: 16px; }
.auth-steps { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; grid-template-columns: auto 1fr; gap: var(--s7); }
.auth-steps h2 { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; margin-bottom: var(--s4); }
.qr { width: 220px; background: #fff; padding: var(--s3); margin-bottom: var(--s4); }
.qr svg { display: block; width: 100%; height: auto; }
.secret-code { white-space: normal; word-break: break-all; letter-spacing: .06em; }
.code-form { display: grid; gap: var(--s4); margin: var(--s4) 0; }
.code-input { font-family: var(--font-mono); font-size: 1.6rem; letter-spacing: .3em; text-align: center; min-height: 60px; }
.form-error { border-left: 3px solid var(--red); padding: var(--s2) var(--s4); color: var(--text); margin: var(--s4) 0; }
.recovery-grid { list-style: none; margin: var(--s5) 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.recovery-grid li { padding: var(--s3) var(--s4); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 1.05rem; }
.recovery-actions { gap: var(--s3); flex-wrap: wrap; }
.created { border: 1px solid var(--red); padding: var(--s5); margin-bottom: var(--s6); }
.created .license-meta { border: 1px solid var(--line); margin: var(--s4) 0; }
.created-key { gap: var(--s3); flex-wrap: wrap; }
.created-key .key { font-size: 1.25rem; padding: var(--s3) var(--s4); }
@media (max-width: 640px) {
  .auth-card { padding: var(--s6) var(--s4); }
  .auth-steps { grid-template-columns: 1fr; gap: var(--s5); }
  .recovery-grid { grid-template-columns: 1fr; }
}

/* error page */
.error-page { padding: var(--s9) 0; }
.error-code { font-family: var(--font-display); font-size: clamp(5rem, 16vw, 9rem); line-height: 1; color: var(--red-text); margin: 0 0 var(--s4); }

/* ---------- scroll reveal (enabled by JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 450ms ease, transform 450ms var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid, .ai-grid, .start-grid, .faq-grid { grid-template-columns: 1fr; gap: var(--s7); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing, .tier-grid { grid-template-columns: repeat(2, 1fr); }
  .replay-body { grid-template-columns: 1fr; }
  .replay-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .replay-events { display: grid; grid-template-columns: repeat(2, 1fr); }
  .grid-form { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--s3) 20px var(--s5);
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav-links.is-open { display: flex; }
  .nav-links > a:not(.btn) { padding: var(--s3) 0; min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
  .nav-sep { display: none; }
  .nav-links .btn, .nav-links form { margin-top: var(--s4); }
  .nav-links form .btn { width: 100%; }
}
@media (max-width: 640px) {
  .hero { padding: var(--s7) 0 var(--s7); }
  .hero-actions .btn, .cta-inner .btn { width: 100%; }
  .section, .cta { padding: var(--s8) 0; }
  .feature-grid, .pricing, .tier-grid, .stat-row, .steps-compact { grid-template-columns: 1fr; }
  .feature, .plan { padding: var(--s5); }
  .console-log { height: 280px; font-size: .74rem; }
  .log-line { grid-template-columns: 52px 64px 1fr; }
  .replay-events { grid-template-columns: 1fr; }
  .rp-time { order: 5; }
  .ai-list li { grid-template-columns: 1fr auto; }
  .ai-list .why { grid-column: 1 / -1; grid-row: 2; }
  .ai-stats { gap: var(--s5); }
  .grid-form { grid-template-columns: 1fr; }
  .search input { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .lm-meta { grid-template-columns: 1fr 1fr; }
  .table th, .table td { padding: var(--s3); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
