:root {
  --page: #f6f7f9; --surface: #ffffff; --ink: #191919; --ink-2: #555b66; --ink-3: #868c96;
  --line: #e4e6ea; --line-2: #d0d4da; --accent: #2370cd; --accent-ink: #1757ac; --accent-soft: #e8f1fc;
  --series-1: #257de0; --ref: #191919;
  --good: #0aac23; --good-ink: #006c10; --good-soft: #e6f6e9;
  --warn: #fbb315; --warn-ink: #7a5200; --warn-soft: #fff4dc;
  --serious: #f18a59; --serious-ink: #8f3a12; --serious-soft: #fdece3;
  --crit: #dc3c3d; --crit-ink: #a3201f; --crit-soft: #fde8e8;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color: var(--ink); background: var(--page); font-size: 15px; line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.hidden { display: none !important; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .in { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; padding: .6rem 1.25rem; }
.brand { font-weight: 700; color: var(--ink); display: flex; gap: .5rem; align-items: center; white-space: nowrap; }
.brand .logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.brand small { font-weight: 500; color: var(--ink-2); }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--ink-2); padding: .4rem .55rem; white-space: nowrap; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--page); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.nav .count { background: var(--crit); color: #fff; border-radius: 99px; padding: 0 .45rem; font-size: .72rem; margin-left: .25rem; }
.who { display: flex; gap: .75rem; align-items: center; color: var(--ink-2); font-size: .9rem; white-space: nowrap; }
.who form { margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.card + .card { margin-top: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 .sub { font-weight: 400; color: var(--ink-2); font-size: .85rem; margin-left: .4rem; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; } .topbar .in { flex-wrap: wrap; } }
.section-gap { margin-top: 1rem; }

/* stat tiles */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.stat .label { color: var(--ink-2); font-size: .8rem; font-weight: 500; }
.stat .value { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stat .note { color: var(--ink-3); font-size: .78rem; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: .5rem .9rem; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; text-decoration: none !important; line-height: 1.2; }
.btn:hover { background: var(--page); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--crit-ink); border-color: #f0c4c4; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
label { font-weight: 550; font-size: .88rem; display: block; margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { margin-bottom: .9rem; }
.field .hint { color: var(--ink-3); font-size: .78rem; margin-top: .2rem; }
.inline { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline .field { margin: 0; }
.check { display: flex; gap: .45rem; align-items: center; font-weight: 500; }
.check input { width: auto; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 130px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button, .seg a { border: 0; background: none; padding: .45rem .85rem; font: inherit; font-weight: 550; color: var(--ink-2); cursor: pointer; }
.seg button + button, .seg a + a { border-left: 1px solid var(--line-2); }
.seg .on { background: var(--accent); color: #fff; }

/* tables */
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
  padding: .55rem .75rem; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; }
table.t td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: #fbfcfd; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow: auto; max-height: 560px; }

/* pills & status */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600;
  background: var(--page); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.blue { background: var(--accent-soft); color: var(--accent-ink); border-color: #cfe1f8; }
.pill.good { background: var(--good-soft); color: var(--good-ink); border-color: #bfe6c6; }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: #f5dca0; }
.pill.serious { background: var(--serious-soft); color: var(--serious-ink); border-color: #f6cbb5; }
.pill.crit { background: var(--crit-soft); color: var(--crit-ink); border-color: #f3c2c2; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: var(--good-soft); border-color: #bfe6c6; color: var(--good-ink); }
.flash.warn { background: var(--warn-soft); border-color: #f5dca0; color: var(--warn-ink); }
.flash.err { background: var(--crit-soft); border-color: #f3c2c2; color: var(--crit-ink); }
.empty { padding: 2rem; text-align: center; color: var(--ink-2); }

/* bars in tables */
.bar { position: relative; height: 8px; background: #eef0f3; border-radius: 4px; min-width: 80px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--series-1); }
.bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ref); }

/* charts */
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-bottom: .5rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .tick { width: 14px; height: 2px; background: var(--ref); display: inline-block; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; margin-bottom: 1rem; font-size: 1.1rem; }

/* stems */
.stem p { margin: 0 0 .6rem; }
.stem-table { border-collapse: collapse; margin: .5rem 0 .8rem; font-size: .95rem; }
.stem-table th, .stem-table td { border: 1px solid var(--line-2); padding: .35rem .7rem; text-align: center; }
.stem-table th { background: #f3f5f8; }
.blank { display: inline-block; min-width: 2.5em; border-bottom: 2px solid var(--ink); }
.item-img { max-width: 100%; margin: .25rem 0 .75rem; display: block; }
.item-img.scale { max-width: none; }

/* item cards (bank/preview) */
.qcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: #fff; }
.qcard + .qcard { margin-top: .75rem; }
.qmeta { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .5rem; align-items: center; }
.key { background: var(--good-soft); border-radius: 6px; padding: .35rem .6rem; font-size: .88rem; color: var(--good-ink); margin-top: .5rem; }
.opts-preview { margin: .25rem 0 0; padding-left: 1.4rem; }
.opts-preview li.correct { font-weight: 650; color: var(--good-ink); }

/* coverage heat */
.heat td.c0 { background: var(--crit-soft); color: var(--crit-ink); }
.heat td.c1 { background: var(--warn-soft); }
.heat td.c2 { background: #eef6ff; }
.heat td.c3 { background: var(--good-soft); }
.opts-preview p, .opt p { margin: 0; }
@media (max-width: 1240px) { .brand small { display: none; } .nav a { padding: .4rem .45rem; } }
