:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #16191f;
  --muted: #5f6b7a;
  --line: #e3e6ea;
  --brand-blue: #1b4f8f;
  --brand-teal: #1fae82;
  --accent: #1b4f8f;
  --accent-hover: #163f73;
  --accent-text: #ffffff;
  --good: #1d8102;
  --good-bg: #e9f6e4;
  --warn: #8a6100;
  --warn-bg: #fdf3d7;
  --bad: #c7291c;
  --bad-bg: #fdeceb;
  --sel: #eaf2fb;
  --glow: rgba(37, 192, 143, .14);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --card: #19202a;
    --text: #e8ebef;
    --muted: #97a3b2;
    --line: #2a3340;
    --brand-blue: #5b9be6;
    --brand-teal: #34d39e;
    --accent: #34d39e;
    --accent-hover: #5ee0b5;
    --accent-text: #0f1419;
    --good: #6fd36a;
    --good-bg: #17301a;
    --warn: #f2c14e;
    --warn-bg: #352a10;
    --bad: #ff7a6e;
    --bad-bg: #3a1a18;
    --sel: #13302a;
    --glow: rgba(52, 211, 158, .10);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.wrap { max-width: 820px; margin: 0 auto; padding: 16px 16px 96px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.r { text-align: right; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo-mark { width: 34px; height: auto; flex: none; }
.logo-text { display: grid; line-height: 1.1; }
.logo-name { white-space: nowrap; font-weight: 800; letter-spacing: -.01em; color: var(--brand-blue); }
.logo-tag { font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lb { stroke: var(--brand-blue); } .lt { stroke: var(--brand-teal); }
.fb { fill: var(--brand-blue); } .ft { fill: var(--brand-teal); }
.lg-b { stop-color: var(--brand-blue); } .lg-t { stop-color: var(--brand-teal); }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.topbar nav a:hover { color: var(--text); }
.topbar form { margin: 0; }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; font-size: .95rem; cursor: pointer; padding: 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 0 0 14px;
}
.narrow { max-width: 380px; margin: 12vh auto 0; }
.stack { display: grid; gap: 10px; }
input[type=password], input[type=email], input[type=text] {
  font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stack label { font-size: .9rem; font-weight: 600; margin-bottom: -4px; }
.switch { margin: 14px 0 0; text-align: center; }
.who { color: var(--text); font-size: .9rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.small-btn { padding: 6px 14px; font-size: .9rem; color: var(--accent-text); }
.topbar nav a.btn.small-btn:hover { color: var(--accent-text); }

/* flash + notes */
.flash { border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: .95rem; }
.flash.ok { background: var(--good-bg); color: var(--good); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; }
.form-narrow { max-width: 380px; }

/* admin */
.wrap.wide { max-width: 1040px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-head p { margin: 0; }
.table-scroll { overflow-x: auto; }
#users .table-scroll { overflow: visible; }  /* let the Manage dropdown overflow */
.admin-table td { vertical-align: top; }
.actions { display: inline-block; text-align: left; position: relative; }
.actions summary { list-style: none; cursor: pointer; }
.actions summary::-webkit-details-marker { display: none; }
.actions[open] summary { background: var(--sel); }
.actions-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10;
  display: grid; gap: 14px; padding: 14px; width: min(320px, 80vw);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}
.actions-panel form { margin: 0; }
.actions-panel label { font-size: .85rem; font-weight: 600; }
.actions-panel input { font: inherit; font-size: .9rem; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.danger { border-top: 1px solid var(--line); padding-top: 12px; }
.btn.danger-btn { background: var(--bad); color: #fff; }
.btn.danger-btn:hover { filter: brightness(.92); }
.invite-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr auto; gap: 10px; align-items: end; margin: 6px 0 16px; }
.invite-form label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.invite-form input { font: inherit; font-size: .95rem; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bg); padding: 2px 6px; border-radius: 6px; }
tr.dim td { opacity: .55; }
@media (max-width: 820px) {
  .invite-form { grid-template-columns: 1fr 1fr; }
  .invite-form label:first-of-type { grid-column: 1 / -1; }
}

/* admin v2 */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.admin-nav a { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); background: var(--card); font-size: .92rem; }
.admin-nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card.mini { margin: 0; display: grid; gap: 6px; align-content: start; }
.card.mini p { margin: 0; }
.big-num { font-size: 1.8rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; width: max-content; }
.seg button { font: inherit; font-size: .88rem; background: var(--card); color: var(--muted); border: 0; padding: 6px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.linkish.accent { color: var(--accent); font-weight: 600; font-size: .9rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.filters input, .filters select, .invite-form select, textarea {
  font: inherit; font-size: .92rem; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
textarea { width: 100%; resize: vertical; }
.user-link { color: var(--text); text-decoration: none; }
.user-link:hover { color: var(--accent); text-decoration: underline; }
.admin-table .pill { margin-left: 4px; }
.nowrap { white-space: nowrap; }
form.inline { display: inline; margin: 0 0 0 10px; }
details.sub { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
details.sub > summary { cursor: pointer; font-weight: 600; }
details.sub[open] > summary { margin-bottom: 10px; }
.email-invite { grid-template-columns: 2fr 1.4fr 2fr auto; }
.user-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.user-head h1 .pill { font-size: .75rem; vertical-align: middle; }
.user-head p { margin: 2px 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.actions-card { display: grid; gap: 14px; }
.actions-card h2 { margin: 0; }
.actions-card form { margin: 0; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.activity li { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.reports { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.reports li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.reports li.dim { opacity: .6; }
.report-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.report-msg { margin: 6px 0 2px; }
.warn-text { color: var(--warn); }
tr.bad-row td:nth-child(2) { color: var(--bad); }
.qr { background: #fff; display: block; width: max-content; padding: 10px; border-radius: 10px; margin: 10px 0 4px; line-height: 0; }
.secret { word-break: break-all; letter-spacing: .05em; }
.setup-steps { padding-left: 1.2em; display: grid; gap: 12px; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 20px; }
.codes code { font-size: 1.05rem; }
details.report { margin-top: 8px; }
details.report summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
details.report form { margin-top: 8px; }
.verify-note { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.verify-note .linkish { color: inherit; text-decoration: underline; font-weight: 600; }
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
  .email-invite { grid-template-columns: 1fr 1fr; }
}

/* landing */
.landing { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; position: relative; }
.landing::before {
  content: ""; position: absolute; top: 0; left: calc(50% - 50vw); width: 100vw; height: 620px; z-index: -1;
  pointer-events: none;
  background: radial-gradient(600px 320px at 85% 30%, var(--glow), transparent 70%),
              radial-gradient(520px 300px at 10% 10%, rgba(27, 79, 143, .08), transparent 70%);
}
.l-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center; padding: 56px 0 36px; }
.l-hero h1 { font-size: 2.5rem; line-height: 1.12; letter-spacing: -.025em; margin-bottom: 14px; }
.grad {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 22px; max-width: 34em; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.btn.big { padding: 13px 22px; font-size: 1.02rem; }
.l-preview .card { margin: 0; box-shadow: 0 18px 40px rgba(16, 40, 72, .12); border-top: 3px solid var(--brand-teal); }
.pv-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 12px; }
.pv-bars { margin-top: 18px; }
.w-84 { width: 84%; } .w-68 { width: 68%; } .w-77 { width: 77%; } .w-58 { width: 58%; }

.l-proof {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.l-proof > div { display: grid; text-align: center; }
.pnum { font-size: 1.7rem; font-weight: 800; color: var(--brand-blue); font-variant-numeric: tabular-nums; }
.plbl { font-size: .82rem; color: var(--muted); }

.l-section { padding: 28px 0; }
.l-section > h2 { font-size: 1.45rem; margin-bottom: 16px; letter-spacing: -.01em; }
.l-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feat { margin: 0; }
.feat h3 { font-size: 1.02rem; margin: 10px 0 6px; }
.feat p { margin: 0; font-size: .95rem; }
.l-sub { margin: -8px 0 16px; max-width: 40em; }
.pill.soon { background: var(--sel); color: var(--brand-blue); }
.soon-note { font-size: .92rem; margin: 14px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cert h3 { margin-top: 12px; }
.cert:not(.live) { border-style: dashed; }
.cert.live { border-top: 3px solid var(--brand-teal); }
.ficon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--sel); color: var(--brand-teal);
}
.ficon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.steps li { margin: 0; display: grid; gap: 4px; align-content: start; }
.steps .muted { font-size: .95rem; }
.sn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal)); color: #fff; font-weight: 700; font-size: .9rem;
}

.wbar { display: inline-block; width: 90px; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-right: 10px; vertical-align: middle; }
.wfill { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal)); }
.w12 { width: 35%; } .w24 { width: 70%; } .w30 { width: 88%; } .w34 { width: 100%; }

.l-final {
  text-align: center; padding: 40px 20px; margin-top: 24px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #163f73, #1b4f8f 45%, #1c9b7c);
}
.l-final h2 { font-size: 1.6rem; margin: 8px 0 6px; color: #fff; }
.l-final p { margin: 0 0 20px; color: rgba(255, 255, 255, .85); }
.final-mark { width: 84px; height: auto; }
.final-mark .lb, .final-mark .fb { stroke: #fff; fill: #fff; }
.final-mark .lb { fill: none; }
.final-mark .lg-b { stop-color: #fff; }
.final-mark .lt { stroke: #5ff0c0; } .final-mark .ft { fill: #5ff0c0; } .final-mark .lg-t { stop-color: #5ff0c0; }
.btn.inverse { background: #fff; color: #163f73; }
.btn.inverse:hover { background: #eaf2fb; }

.l-foot { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 32px; display: grid; gap: 8px; }
.l-foot .logo-mark { width: 30px; }
.l-foot p { margin: 0; max-width: 60em; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* policy pages */
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.4rem; }
.prose li { margin-bottom: 6px; }
@media (max-width: 820px) {
  .l-hero { grid-template-columns: 1fr; padding-top: 32px; }
  .l-hero h1 { font-size: 1.95rem; }
  .l-proof { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
}


.btn {
  display: inline-block; background: var(--accent); color: var(--accent-text); border: 0;
  border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:hover { background: var(--sel); }
.btn:focus-visible, .opt:focus-within, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hero { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); margin: 0 0 4px; }
.hero-stats { display: flex; gap: 22px; }
.stat { display: grid; text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: .75rem; color: var(--muted); }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid th { font-size: .8rem; color: var(--muted); font-weight: 600; text-align: left; }
.grid th.r { text-align: right; }
.grid tr:last-child td { border-bottom: 0; }

.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

/* review exam */
.review-domains { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.all-clear { display: flex; align-items: center; gap: 16px; }
.all-clear .check { flex: none; color: var(--good); }
.all-clear .check path { stroke: var(--card); }
.all-clear h2 { margin: 0 0 4px; color: var(--good); }
.all-clear p { margin: 0; }

/* test */
.test-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.timer {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.2rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px;
  position: sticky; top: 56px;
}
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.qnum { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stem { margin: 0 0 10px; font-weight: 500; }
.choose { margin: -4px 0 10px; font-size: .85rem; font-weight: 700; color: var(--accent); }
.opts { display: grid; gap: 8px; padding: 0; margin: 0 0 10px; list-style: none; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.opt input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--sel); }
.letter { font-weight: 700; color: var(--muted); flex: none; width: 1.1em; }
.guess { font-size: .85rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.q.answered { border-left: 4px solid var(--accent); }
.save-state { margin: 4px 0 0; min-height: 1.2em; }
.submitbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px max(16px, calc((100vw - 820px) / 2 + 16px));
  background: var(--card); border-top: 1px solid var(--line);
}

/* results */
.result.ok { border-left: 4px solid var(--good); }
.result.ko { border-left: 4px solid var(--bad); }
.review .opt { cursor: default; }
.review .opt.is-answer { border-color: var(--good); background: var(--good-bg); }
.review .opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.tag { margin-left: auto; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.explain { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: .95rem; }
.filter { display: flex; gap: 8px; margin: 4px 0 12px; }
.chip { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.chip.on { border-color: var(--accent); color: var(--accent); }

/* stats */
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 999px; }
.fill.good { background: var(--good); }
.fill.warn { background: var(--warn); }
.fill.bad { background: var(--bad); }
.bar-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend { position: relative; height: 160px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); }
.trend .col { flex: 1; max-width: 28px; border-radius: 4px 4px 0 0; min-height: 4px; }
.trend .col.good { background: var(--good); }
.trend .col.bad { background: var(--bad); }
.passline { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--muted); }
.missed { padding-left: 1.2em; margin: 0; display: grid; gap: 8px; }

@media (max-width: 560px) {
  .hide-sm { display: none; }
  h1 { font-size: 1.3rem; }
  .card { padding: 14px; }
  .topbar nav { gap: 10px; }
  .topbar .logo-text { display: none; }  /* mark only, leaves room for the nav */
}
