@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("font-regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("font-bold.ttf") format("truetype");
  font-weight: 700;
}
:root {
  --bg: #ffffff; --surface: #ffffff; --surface2: #f1f3f2;
  --ink: #1b1f24; --muted: #65707b; --line: #e1e4e8;
  --accent: #2e7d62; --accent-soft: #e3f1eb; --on-accent: #ffffff;
  --bad: #b4414b; --bad-soft: #fbeaec; --warn: #8f5b00; --warn-soft: #fbf0dc;
  --heat0: #f1f3f2; --heat1: #c6e3d6; --heat2: #8cc6ad; --heat3: #4f9f80; --heat4: #2e7d62;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b; --surface: #15181b; --surface2: #24282d;
    --ink: #e8eaed; --muted: #9aa3ad; --line: #2e3338;
    --accent: #6cc4a1; --accent-soft: #1b3229; --on-accent: #0c1611;
    --bad: #f08a92; --bad-soft: #3a1c20; --warn: #e6a750; --warn-soft: #352812;
    --heat0: #24282d; --heat1: #1f4235; --heat2: #2e6a53; --heat3: #4b9a7a; --heat4: #6cc4a1;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; text-wrap: balance; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

nav.top {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
nav.top .brand { font-weight: 700; color: var(--ink); font-size: 17px; }
nav.top .spacer { flex: 1; }
nav.top form { margin: 0; }
.back { font-size: 14px; }

.section { display: grid; gap: 10px; }
.section > header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section > header .spacer { flex: 1; }
.label {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}

.box { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pad { padding: 14px 16px; }
.list > * + * { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 6px; padding: 14px 16px; color: inherit; }
a.tile:hover { text-decoration: none; border-color: var(--accent); }

.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.fact { display: grid; }
.fact b { font-size: 18px; font-variant-numeric: tabular-nums; }
.fact span { font-size: 13px; color: var(--muted); }

.until { display: grid; gap: 2px; }
.until .word { font-size: 18px; font-weight: 700; }
.until .word .tr { font-weight: 400; color: var(--muted); }

.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface2); }
.bar i { display: block; height: 100%; }
.bar .secure { background: var(--accent); }
.bar .learning { background: var(--heat2); }
.bar .new { background: var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend .secure { background: var(--accent); }
.legend .learning { background: var(--heat2); }
.legend .new { background: var(--line); }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; border-top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.locked td { color: var(--muted); }
tr.chapter td { background: var(--surface2); font-weight: 700; font-size: 13px; }
tr.marker td { border-top: 2px solid var(--accent); padding: 4px 12px; font-size: 12px; color: var(--accent); font-weight: 700; }
.status { font-size: 13px; white-space: nowrap; }
.status.secure { color: var(--accent); }
.status.learning { color: var(--ink); }
.status.new, .status.locked { color: var(--muted); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }

.heat { display: block; max-width: 100%; height: auto; }
.heat .d0 { fill: var(--heat0); } .heat .d1 { fill: var(--heat1); } .heat .d2 { fill: var(--heat2); }
.heat .d3 { fill: var(--heat3); } .heat .d4 { fill: var(--heat4); }
.heat text, .chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart .b { fill: var(--accent); } .chart .b.today { fill: var(--warn); }

form { margin: 0; }
.stack { display: grid; gap: 12px; max-width: 420px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label { display: grid; gap: 4px; font-size: 14px; }
input[type=text], input[type=password] {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); min-width: 0;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
button {
  font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--bad); border-color: var(--line); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 400; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); }
.notice.error { background: var(--bad-soft); color: var(--bad); }

.code { font-size: 30px; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.qr { width: 220px; max-width: 100%; height: auto; background: #fff; padding: 12px; border-radius: 8px; border: 1px solid var(--line); }
.qr rect { fill: #000; }
.copy { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; background: var(--surface2); padding: 8px 10px; border-radius: 6px; user-select: all; }

.login { max-width: 380px; margin: 8vh auto 0; }
