/* Kioku N1 — styles */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f5f2ec;
  --surface: #fffdf8;
  --surface-2: #efe9df;
  --ink: #1f1c19;
  --muted: #6f675e;
  --line: #e2dacd;
  --accent: #b23a2e;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3df;
  --again: #c0392b;
  --hard: #a86400;
  --good: #2e7d4f;
  --easy: #2a64a8;
  --c-new: #2a64a8;
  --c-learn: #c0392b;
  --c-due: #2e7d4f;
  --mark: #fbe39a;
  --ok-bg: #e4f3ea;
  --ng-bg: #fbe5e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 6px 20px rgb(0 0 0 / .06);
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-jp: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "BIZ UDPMincho", "MS PMincho", serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #141518;
  --surface: #1c1e22;
  --surface-2: #262930;
  --ink: #ebe6de;
  --muted: #a39b91;
  --line: #31343b;
  --accent: #e2675a;
  --accent-ink: #1a0f0d;
  --accent-soft: #3a2522;
  --again: #ec6f62;
  --hard: #e0a43a;
  --good: #5cbf86;
  --easy: #6fa6e8;
  --c-new: #6fa6e8;
  --c-learn: #ec6f62;
  --c-due: #5cbf86;
  --mark: #5c4a12;
  --ok-bg: #1d3327;
  --ng-bg: #3a2220;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font-ui);
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
code, kbd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
kbd {
  display: inline-block; font-size: .7rem; line-height: 1; padding: 3px 5px; border-radius: 5px;
  border: 1px solid currentColor; opacity: .55; margin-left: 6px; vertical-align: middle;
}
.jp { font-family: var(--font-jp); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: var(--again); }
mark { background: var(--mark); color: inherit; padding: 0 .12em; border-radius: 3px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font: 700 19px/1 var(--font-serif);
}
.brand-name { font-weight: 600; letter-spacing: .01em; }
.brand-name b { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .93rem;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); background: var(--surface-2); font-weight: 600; }

.tabbar { display: none; }

.app { max-width: 960px; margin: 0 auto; padding: 24px 16px 110px; outline: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-lg { padding: 12px 22px; font-size: 1.02rem; }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-danger { color: var(--again); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-ghost {
  background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px 4px; text-decoration: none;
}
.btn-ghost:hover { color: var(--ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; vertical-align: middle;
  flex: none;
}
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.section-title { margin: 28px 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- home ---------- */
.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: "日本語"; position: absolute; right: -10px; bottom: -34px; font: 700 120px/1 var(--font-serif);
  color: var(--ink); opacity: .035; pointer-events: none; writing-mode: horizontal-tb;
}
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .4em; }
.hero h1 { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; }
.hero-sub { color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero-stats { display: flex; gap: 12px; position: relative; z-index: 1; }
.stat {
  min-width: 96px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); text-align: center;
}
.stat-num { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: .78rem; color: var(--muted); }

.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.deck {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.deck.off { opacity: .55; }
.deck.focus { border-top: 3px solid var(--accent); }
.deck-head { display: flex; gap: 12px; align-items: flex-start; }
.deck-title { flex: 1; min-width: 0; }
.deck-title h3 { margin: 0; }
.deck-title h3 .jp { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: 4px; }
.deck-title p { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.lvl {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  font-weight: 800; font-size: .92rem; color: #fff;
}
.lvl-n1 { background: var(--accent); }
.lvl-n2 { background: #6b5b95; }
.lvl-n3 { background: #3d7a74; }
[data-theme="dark"] .lvl { color: #111; }
[data-theme="dark"] .lvl-n2 { background: #a99bd0; }
[data-theme="dark"] .lvl-n3 { background: #7cc2ba; }
.role-tag {
  flex: none; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.focus .role-tag { background: var(--accent-soft); color: var(--accent); }
.deck-counts { display: flex; gap: 14px; font-size: .88rem; color: var(--muted); }
.cnt b { font-size: 1.15rem; font-variant-numeric: tabular-nums; margin-right: 3px; }
.c-new b, .c-new { color: var(--c-new); }
.c-learn b, .c-learn { color: var(--c-learn); }
.c-due b, .c-due { color: var(--c-due); }
.deck-counts .cnt { color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.deck-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .85rem; }
.pace ul { margin: 0; padding-left: 1.1em; }
.pace li { margin-bottom: 4px; }

/* ---------- study ---------- */
.study { max-width: 720px; margin: 0 auto; }
.study-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.study-deck { font-weight: 600; }
.study-counts { display: flex; gap: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.study-counts span { padding-bottom: 1px; border-bottom: 2px solid transparent; }
.study-counts span.cur { border-bottom-color: currentColor; }
.flash {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px 26px 26px; min-height: 300px;
}
.flash-meta { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.pill-new { color: var(--c-new); }
.pill-learn { color: var(--c-learn); }
.pill-due, .pill-review { color: var(--c-due); }
.pill-susp { color: var(--hard); }
.front { text-align: center; padding: 26px 0 12px; }
.g-pattern, .v-word {
  font-family: var(--font-serif); font-weight: 700; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.25; word-break: keep-all;
}
.prompt { color: var(--muted); font-size: .88rem; margin-top: 10px; }
.back { border-top: 1px dashed var(--line); padding-top: 18px; margin-top: 6px; }
.g-meaning, .v-meaning { font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; }
.v-reading { font-family: var(--font-jp); font-size: 1.6rem; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 14px; margin: 12px 0; }
.kv dt { color: var(--muted); font-size: .82rem; font-weight: 600; padding-top: 2px; }
.kv dd { margin: 0; }
code.form {
  font-family: var(--font-jp); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: .95rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: .82rem; font-family: var(--font-jp); background: var(--surface);
}
.chip-q { border-color: var(--accent); color: var(--accent); }
.examples { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.examples li { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.ex-jp { font-family: var(--font-jp); font-size: 1.08rem; line-height: 1.8; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.ex-en { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.ex-en.blur { filter: blur(5px); cursor: pointer; user-select: none; }

.answer-bar { position: sticky; bottom: 0; padding: 14px 0 8px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.btn-show { width: 100%; padding: 15px; font-size: 1.05rem; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink);
}
.grade:hover { border-color: currentColor; }
.g-ivl { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.g-name { font-weight: 700; }
.grade kbd { margin: 2px 0 0; }
.g-again .g-name { color: var(--again); }
.g-hard .g-name { color: var(--hard); }
.g-good .g-name { color: var(--good); }
.g-easy .g-name { color: var(--easy); }
.study-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.study-foot .btns { display: flex; gap: 4px; }
.done { text-align: center; padding: 40px 10px; }
.done-mark {
  width: 84px; height: 84px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%;
  border: 3px solid var(--accent); color: var(--accent); font: 700 40px/1 var(--font-serif); transform: rotate(-8deg);
}
.done .hero-actions { justify-content: center; }

/* ---------- browse ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; margin-bottom: 12px; }
.field, select, input[type="search"], input[type="number"], input[type="date"] {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit;
}
.browse-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.browse-list > li + li { border-top: 1px solid var(--line); }
.row {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 11px 16px; text-align: left;
  border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.row:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-family: var(--font-jp); font-weight: 600; font-size: 1.05rem; }
.row-title small { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: .85rem; }
.row-sub { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-lvl { font-size: .72rem; font-weight: 800; color: var(--muted); width: 22px; flex: none; }
.detail { padding: 4px 18px 18px; background: var(--surface); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- practice ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.mode {
  text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow);
}
.mode:hover { border-color: var(--accent); }
.mode-jp { font: 700 1.3rem/1.2 var(--font-serif); color: var(--accent); }
.mode span:last-child { color: var(--muted); font-size: .86rem; }
.opts-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.quiz { max-width: 720px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-card { margin-top: 14px; }
.q-ask { font-size: .85rem; color: var(--muted); font-weight: 600; }
.q-prompt { font-size: 1.25rem; line-height: 1.9; margin-bottom: 18px; }
.q-prompt mark { background: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; font-weight: 700; }
.blank { display: inline-block; min-width: 4em; border-bottom: 2px solid var(--ink); color: transparent; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: inherit; font: inherit; font-size: 1.05rem; cursor: pointer; text-align: left;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { cursor: default; }
.opt-n {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted);
}
.opt.correct { background: var(--ok-bg); border-color: var(--good); }
.opt.wrong { background: var(--ng-bg); border-color: var(--again); }
.q-explain { margin: 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.q-explain b.ok { color: var(--good); }
.q-explain b.ng { color: var(--again); }
.missed { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.missed li { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

/* ---------- stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile span { color: var(--muted); font-size: .82rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bar.zero { background: var(--line); }
.bar.today { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.table-wrap { overflow-x: auto; }

/* ---------- guide ---------- */
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.2em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.prose .tbl td, .prose .tbl th { text-align: left; vertical-align: top; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 12px 0; }

/* ---------- settings ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row label { font-weight: 600; }
.set-row .help { display: block; font-weight: 400; color: var(--muted); font-size: .84rem; }
.set-row .ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.set-row input[type="number"] { width: 84px; }
.set-row input[type="date"] { width: 170px; }
.set-row select { width: auto; }
.switch { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- sync & reminders ---------- */
.sync-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid var(--line); background: var(--surface);
  white-space: nowrap;
}
.sync-badge[hidden] { display: none; }
.sync-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.sync-badge.busy .dot { background: var(--easy); animation: pulse 1s ease-in-out infinite; }
.sync-badge.pending .dot { background: var(--hard); }
.sync-badge.off .dot { background: var(--muted); }
.sync-badge.err .dot { background: var(--again); }
.sync-badge.err { color: var(--again); }
@keyframes pulse { 50% { opacity: .3; } }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); margin: 4px 0 14px; }
.seg button {
  border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.auth-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .88rem; }
.auth-form input {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 400;
}
.auth-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-msg { color: var(--again); }
input[type="time"] { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem;
  transition: opacity .2s, transform .2s; z-index: 50; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .nav { display: none; }
  .sync-badge { margin-left: auto; }
  .auth-form { grid-template-columns: 1fr; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .66rem; padding: 4px 0; }
  .tabbar a.active { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .app { padding: 16px 12px 110px; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats .stat { flex: 1; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input[type="search"] { grid-column: 1 / -1; }
  .flash { padding: 18px 16px 22px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .options { grid-template-columns: 1fr; }
  .answer-bar { bottom: 64px; }
  .study-foot .hint-keys { display: none; }
  .toast { bottom: 140px; }
}
@media (hover: none) { kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
