/* ========== Tokens ========== */
:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #fcfcfb;
  --sunken: #ecebe6;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #74736d;
  --line: #e2e1dc;
  --grid-line: #ecebe6;
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-ink: #ffffff;
  --accent-soft: #e3eefc;
  --hero-bg: #0e1726;
  --hero-ink: #ffffff;
  --hero-ink-2: #b9c3d3;
  --hl: #ffcf5c;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-text: #067a06;
  --empty: #e2e1dc;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --surface: #1c1c1b; --surface-2: #1a1a19; --sunken: #262624;
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #95948b; --line: #2f2f2c; --grid-line: #2a2a27;
    --accent: #3987e5; --accent-hover: #5598e7; --accent-soft: #16304f;
    --hero-bg: #0a1220; --good-text: #3fcf3f; --empty: #34342f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --surface: #1c1c1b; --surface-2: #1a1a19; --sunken: #262624;
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #95948b; --line: #2f2f2c; --grid-line: #2a2a27;
  --accent: #3987e5; --accent-hover: #5598e7; --accent-soft: #16304f;
  --hero-bg: #0a1220; --good-text: #3fcf3f; --empty: #34342f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

/* ========== Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
button { font: inherit; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid transparent; border-radius: 999px; padding: .6em 1.2em;
  font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, transform .1s, border-color .15s;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-danger { background: transparent; color: var(--critical); border-color: currentColor; }
.btn-lg { font-size: 1.05rem; padding: .85em 1.5em; }
.btn-sm { font-size: .875rem; padding: .4em .9em; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }

/* ========== Topbar ========== */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark { width: 32px; height: 32px; color: var(--accent); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-family: var(--display); font-size: 1rem; white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: .75rem; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .925rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--sunken); }
.nav a.active { color: var(--ink); background: var(--sunken); }
@media (max-width: 640px) {
  .nav-home, .brand-text small { display: none; }
  .brand-text strong { font-size: .9rem; }
  .nav a { padding: 6px 8px; font-size: .85rem; }
}
@media (max-width: 400px) { .brand-text { display: none; } }

/* ========== Hero ========== */
.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 56px 0 64px; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; inset: auto -20% -60% 30%; height: 120%; background: radial-gradient(closest-side, rgba(57,135,229,.35), transparent); pointer-events: none; }
.hero-in { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
.hero .hl { color: var(--hl); }
.hero .lead { color: var(--hero-ink-2); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 60ch; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.hero .btn-ghost:hover { border-color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .75em; }
.hero .eyebrow { color: var(--hl); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.today-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--hero-ink-2); font-size: .9rem; }
.today-chip b { color: #fff; }

.demo-card { background: #fff; color: #0b0b0b; border-radius: 20px; padding: 18px; box-shadow: 0 30px 60px rgba(0,0,0,.4); transform: rotate(2deg); max-width: 340px; margin-left: auto; }
.demo-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: #52514e; margin-bottom: 12px; }
.demo-head b { font: 700 1.6rem var(--display); color: #2a78d6; }
.demo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.demo-grid span { aspect-ratio: 1; display: grid; place-items: center; background: #f4f4f1; border-radius: 8px; font: 700 1.2rem var(--display); transition: background .2s, color .2s; }
.demo-grid span.on { background: #2a78d6; color: #fff; }
.demo-grid span.done { color: #b9b8b2; }
@media (max-width: 820px) {
  .hero { padding: 40px 0 48px; }
  .hero-in { grid-template-columns: 1fr; gap: 32px; }
  .demo-card { margin: 0 auto; max-width: 280px; }
}

/* ========== Sections ========== */
.section { padding: 64px 0; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section-sub { color: var(--ink-2); margin-bottom: 28px; max-width: 62ch; }
@media (max-width: 640px) { .section { padding: 44px 0; } }

.pain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pain { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; }
.pain input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--critical); flex: none; }
.pain:has(input:checked) { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 7%, var(--surface)); }
.pain-verdict { margin-top: 20px; padding: 20px; border-radius: var(--radius); background: var(--sunken); }
.pain-verdict p { margin: 0; }
.pain-verdict.hot { background: color-mix(in srgb, var(--critical) 12%, var(--surface)); }
.pain-verdict .btn { margin-top: 14px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps h3 { font-size: 1.15rem; }
.steps p { color: var(--ink-2); margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 1rem var(--display); margin-bottom: 12px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.level-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.level-strip .lv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.lv-num { font: 700 .75rem var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.lv h3 { font-size: 1.15rem; margin: 4px 0 6px; }
.lv p { color: var(--ink-2); font-size: .9rem; margin: 0; }
.bars { display: inline-flex; gap: 3px; margin-top: 10px; }
.bars i { width: 6px; height: 14px; border-radius: 2px; background: var(--empty); }
.bars i.on { background: var(--accent); }
@media (max-width: 900px) { .level-strip { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }

.prose { max-width: 760px; }
.prose p { color: var(--ink-2); }
.prose h3 { margin-top: 32px; font-size: 1.25rem; }
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; }

.final-cta { text-align: center; }
.final-cta h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.final-cta p { color: var(--ink-2); }

/* ========== Test setup ========== */
.view[data-view="test"] { padding: 32px 0 56px; }
.pain-banner { background: var(--hero-bg); color: var(--hero-ink); border-radius: 20px; padding: 32px; margin-bottom: 32px; }
.pain-banner h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.pain-banner .lead { color: var(--hero-ink-2); max-width: 64ch; }
.pain-banner .eyebrow { color: var(--hl); }
.urgency { margin: 0; padding: 12px 16px; border-radius: 12px; background: rgba(255,255,255,.08); border-left: 4px solid var(--hl); font-weight: 600; }
.urgency:empty { display: none; }
@media (max-width: 640px) { .pain-banner { padding: 22px 18px; border-radius: 16px; } }

.block-title { font-size: 1.25rem; margin-bottom: 14px; }
.level-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 24px; }
.level-pick .lv { position: relative; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.level-pick .lv:hover { border-color: var(--ink-2); }
.level-pick .lv[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lv-best { display: block; margin-top: 10px; font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) { .level-pick { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
@media (max-width: 420px) { .level-pick { grid-template-columns: 1fr 1fr; } .level-pick .lv { padding: 12px; } .level-pick .lv p { display: none; } }

.howto { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px 24px; }
.howto ul { margin: 0 0 20px; padding-left: 1.2em; color: var(--ink-2); }
.howto li { margin: 4px 0; }

/* ========== Play ========== */
.hud { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hud-item { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; min-width: 76px; }
.hud-item span { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.hud-item b { font: 700 1.35rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.hud-next b { color: var(--accent); }
.hud .btn { margin-left: auto; }
.progress { height: 4px; background: var(--sunken); border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

.board-wrap { position: relative; container-type: inline-size; width: min(100%, 640px, calc(100svh - 250px)); min-width: 260px; margin: 0 auto; }
.board {
  --n: 5; container-type: inline-size;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px;
  aspect-ratio: 1; padding: 6px; border-radius: 18px; background: var(--sunken);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.cell {
  display: grid; place-items: center; background: var(--surface); border: 0; border-radius: 10px;
  color: var(--ink); font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: calc(100cqi / var(--n) * .4); cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent; transition: background .12s, color .12s;
}
@media (hover: hover) { .cell:hover { background: var(--accent-soft); } }
.cell.done { color: var(--muted); opacity: .35; }
.cell.ok { background: var(--accent); color: #fff; }
.cell.bad { background: var(--critical); color: #fff; animation: shake .28s; }
.board.blur .cell { filter: blur(10px); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; }
.countdown span { font: 700 min(30cqi, 9rem) var(--display); color: var(--accent); animation: pop .9s ease-out; }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
.play-hint { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 12px; }
.view[data-view="test"].playing { padding-top: 16px; }
body.playing .footer { display: none; }
@media (max-width: 480px) {
  .hud { gap: 6px; }
  .hud-item { padding: 4px 10px; min-width: 0; flex: 1; }
  .hud-item b { font-size: 1.15rem; }
  .hud-item span { font-size: .62rem; letter-spacing: .03em; }
  .board { gap: 4px; padding: 4px; border-radius: 14px; }
  .cell { border-radius: 8px; }
  .board-wrap { width: min(100%, calc(100svh - 230px)); }
}

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50; font-weight: 500; }

/* ========== Result ========== */
.view[data-view="result"] { padding: 32px 0 56px; }
.res-hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.ring { width: 170px; height: 170px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-val b { font: 700 3rem/1 var(--display); display: block; }
.ring-val small { color: var(--muted); font-size: .8rem; }
.res-q { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 6px; }
.res-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.res-hero p { color: var(--ink-2); margin: 0; }
@media (max-width: 640px) { .res-hero { grid-template-columns: 1fr; text-align: center; padding: 22px; } .ring { margin: 0 auto; width: 150px; height: 150px; } }

.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--sunken); color: var(--ink); white-space: nowrap; }
.badge i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-style: normal; font-size: .7rem; font-weight: 800; }
.badge.good i { background: var(--good); }
.badge.warning i { background: var(--warning); color: #0b0b0b; }
.badge.serious i { background: var(--serious); color: #0b0b0b; }
.badge.critical i { background: var(--critical); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat b { display: block; font: 700 1.7rem/1.2 var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat small { display: block; color: var(--ink-2); font-size: .8rem; margin-top: 2px; }
.delta-up { color: var(--good-text); }
.delta-down { color: var(--critical); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat b { font-size: 1.4rem; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; }
.card h2 { font-size: 1.1rem; margin-bottom: 4px; }
.card-sub { color: var(--muted); font-size: .875rem; margin-bottom: 16px; }

.bench { position: relative; margin: 34px 0 8px; }
.bench-track { display: flex; height: 14px; gap: 2px; }
.bench-track i { height: 100%; }
.bench-track i:first-child { border-radius: 7px 0 0 7px; }
.bench-track i:last-child { border-radius: 0 7px 7px 0; }
.bench-marker { position: absolute; top: -30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.bench-marker::after { content: ""; width: 3px; height: 26px; background: var(--ink); border-radius: 2px; margin-top: 2px; }
.bench-labels { display: flex; gap: 2px; font-size: .75rem; color: var(--ink-2); margin-top: 6px; }
.bench-labels span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.reco { display: flex; gap: 14px; align-items: flex-start; }
.reco-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.2rem; }
.reco p { margin: 0; color: var(--ink-2); }
.reco ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ========== Dashboard ========== */
.view[data-view="dashboard"] { padding: 32px 0 56px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dash-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0; }
.dash-head p { margin: 4px 0 0; color: var(--ink-2); }

.today { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; border-radius: 20px; padding: 22px 24px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-left-width: 6px; }
.today.good { border-left-color: var(--good); }
.today.warning { border-left-color: var(--warning); }
.today.serious { border-left-color: var(--serious); }
.today.critical { border-left-color: var(--critical); }
.today.none { border-left-color: var(--muted); }
.today-score { font: 700 2.8rem/1 var(--display); font-variant-numeric: tabular-nums; min-width: 72px; text-align: center; }
.today-score small { display: block; font: 500 .75rem var(--font); color: var(--muted); margin-top: 4px; }
.today h2 { font-size: 1.3rem; margin: 6px 0 2px; }
.today p { margin: 0; color: var(--ink-2); }
@media (max-width: 640px) { .today { grid-template-columns: auto 1fr; } .today .btn { grid-column: 1 / -1; } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two .card { margin-bottom: 0; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; margin-bottom: 16px; }

.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.chart .grid-l { stroke: var(--grid-line); stroke-width: 1; }
.chart .base-l { stroke: var(--line); stroke-width: 1; }
.chart .thr-l { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .thr-t { fill: var(--ink-2); font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hover { opacity: .8; }
.chart .hover-band { fill: var(--sunken); opacity: 0; }
.chart .hover-band.on { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .8rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-good { background: var(--good); } .sw-warning { background: var(--warning); } .sw-serious { background: var(--serious); } .sw-critical { background: var(--critical); } .sw-empty { background: var(--empty); }
.legend i.sw-line { height: 0; width: 18px; border-radius: 0; border-top: 2px dashed var(--ink-2); }

.heat-wrap { overflow-x: auto; }

.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }

.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.insights li { display: flex; gap: 12px; align-items: flex-start; }
.insights .reco-ico { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
.insights p { margin: 0; color: var(--ink-2); font-size: .925rem; }
.insights b { color: var(--ink); }

.data-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: 20px; }
.empty h2 { font-size: 1.5rem; }
.empty p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 20px; }

/* ========== Tooltip ========== */
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: .8rem; line-height: 1.4; box-shadow: var(--shadow); max-width: 220px; }
.tip b { display: block; }

/* ========== Footer ========== */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .875rem; }
.footer p { margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ========== Segurize360 brand ========== */
.partner { display: flex; align-items: center; margin-right: auto; padding-left: 12px; border-left: 1px solid var(--line); }
.partner img { width: 38px; height: 38px; border-radius: 50%; display: block; }
.by-line { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--hero-ink-2); font-size: .9rem; }
.by-line img { border-radius: 50%; }
.by-line strong { color: #fff; }
.footer-in { display: flex; gap: 18px; align-items: flex-start; }
.footer-logo img { display: block; width: 64px; height: 64px; border-radius: 50%; }
@media (max-width: 400px) { .partner { padding-left: 0; border-left: 0; } }

/* ========== Share modal ========== */
.modal { width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; border: 0; border-radius: 20px; padding: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(8, 12, 20, .6); backdrop-filter: blur(2px); }
.modal h2 { font-size: 1.4rem; margin: 0 40px 4px 0; }
.modal-sub { color: var(--ink-2); font-size: .9rem; }
.modal-close-form { position: absolute; top: 16px; right: 16px; margin: 0; }
.modal { position: fixed; }
.share-preview { border-radius: 14px; overflow: hidden; background: var(--sunken); aspect-ratio: 1; width: min(100%, 300px); margin: 0 auto 16px; }
.share-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.field { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 16px; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; font-weight: 400; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.field input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.share-actions { display: grid; gap: 10px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-row .btn { flex: 1 1 auto; font-size: .9rem; }
.btn-whats { background: #25d366; color: #0b2e17; }
.btn-whats:hover { background: #1fbe5b; }
@media (max-width: 480px) { .modal { padding: 18px; } .share-preview { aspect-ratio: 4 / 3; } .share-preview img { object-fit: contain; background: #0e1726; } }

/* ========== Challenge ========== */
.challenge { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 207, 92, .14); border: 1px solid rgba(255, 207, 92, .5); }
.challenge-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--hl); color: #0e1726; font-size: 1.3rem; }
.challenge p { margin: 0; }
.challenge small { display: block; color: var(--hero-ink-2); margin-top: 2px; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; text-align: center; margin: 8px 0 4px; }
.duel b { display: block; font: 700 2.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.duel small { color: var(--muted); font-size: .8rem; }
.duel .vs { font: 700 .9rem var(--display); color: var(--muted); }
.duel-win { border-left: 6px solid var(--good); }
.duel-lose { border-left: 6px solid var(--serious); }
