
/* Layout: one narrow column for a phone held in one hand; choices are big thumb targets; a VVF wire stripe (black/white/red) tops the page. */
:root {
  --bg: #EEF1F3;
  --surface: #FFFFFF;
  --fg: #16212A;
  --muted: #5E6B76;
  --line: #D5DCE1;
  --accent: #0B5C78;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEBF1;
  --ok: #1B7A45;
  --ok-soft: #E1F2E7;
  --ng: #B3261E;
  --ng-soft: #FBE6E4;
  --unk: #94580A;
  --unk-soft: #FBEFD9;
  --wire-k: #1D1D1F;
  --wire-w: #F7F7F5;
  --wire-r: #C8312B;
  --font-display: "Dela Gothic One", "Hiragino Sans", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F161B; --surface: #18222A; --fg: #E6ECF0; --muted: #94A3AE; --line: #2A3842;
    --accent: #5FB7D6; --accent-ink: #062330; --accent-soft: #163543;
    --ok: #5CC98A; --ok-soft: #133524; --ng: #F08A80; --ng-soft: #3D1A17; --unk: #F2B45C; --unk-soft: #3A2A12;
    --wire-k: #000000; --wire-w: #D9DDE0; --wire-r: #D9473F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F161B; --surface: #18222A; --fg: #E6ECF0; --muted: #94A3AE; --line: #2A3842;
  --accent: #5FB7D6; --accent-ink: #062330; --accent-soft: #163543;
  --ok: #5CC98A; --ok-soft: #133524; --ng: #F08A80; --ng-soft: #3D1A17; --unk: #F2B45C; --unk-soft: #3A2A12;
  --wire-k: #000000; --wire-w: #D9DDE0; --wire-r: #D9473F;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 16px; line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
.wire { height: 6px; display: grid; grid-template-columns: 1fr 1fr 1fr; }
.wire span:nth-child(1) { background: var(--wire-k); }
.wire span:nth-child(2) { background: var(--wire-w); border-block: 1px solid var(--line); }
.wire span:nth-child(3) { background: var(--wire-r); }
.wrap { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2 { text-wrap: balance; margin: 0; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* home */
.brand { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand h1 { font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; letter-spacing: .02em; line-height: 1.3; }
.brand small { color: var(--muted); font-size: .8rem; letter-spacing: .08em; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-family: var(--font-mono); font-size: 1.35rem; line-height: 1.2; }
.stat span { font-size: .75rem; color: var(--muted); letter-spacing: .04em; }
.modes { display: grid; gap: 10px; margin-top: 18px; }
.btn-main {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; border: 0; border-radius: 12px; padding: 16px 18px; text-align: left;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.05rem;
}
.btn-main small { font-weight: 500; opacity: .85; font-size: .8rem; }
.btn-sub {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; border: 1.5px solid var(--accent); border-radius: 12px; padding: 14px 18px; text-align: left;
  background: transparent; color: var(--accent); font-weight: 700;
}
.btn-sub:disabled { border-color: var(--line); color: var(--muted); cursor: default; }
.sec-label { margin-top: 28px; margin-bottom: 8px; font-size: .78rem; color: var(--muted); letter-spacing: .12em; }
.cats { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cat {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  width: 100%; border: 0; background: transparent; padding: 14px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.cat:last-child { border-bottom: 0; }
.cat:active { background: var(--accent-soft); }
.cat .name { font-weight: 700; }
.cat .meta { font-size: .8rem; color: var(--muted); }
.cat .bar { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.cat .bar i { display: block; height: 100%; background: var(--ok); }
.cat { grid-template-columns: 1.6rem 1fr auto; }
.cat .chk {
  grid-row: 1; width: 1.4rem; height: 1.4rem; border: 1.5px solid var(--line); border-radius: 6px;
  display: grid; place-items: center; font-size: .9rem; font-weight: 700; color: var(--accent-ink);
}
.cat[aria-pressed="true"] .chk { background: var(--accent); border-color: var(--accent); }
.cat .chno { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .08em; font-weight: 500; }
.cat .bar { grid-column: 2 / -1; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.picker .lbl { font-size: .8rem; color: var(--muted); margin-right: 4px; }
.seg { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 14px; font-size: .9rem; }
.seg[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.selall { margin-left: auto; border: 0; background: transparent; color: var(--accent); font-size: .85rem; padding: 4px 0; }
#go-chap { margin-top: 12px; }
.foot { margin-top: 28px; font-size: .8rem; color: var(--muted); line-height: 1.8; }
.foot a { color: var(--accent); }
.reset { margin-top: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px; font-size: .8rem; color: var(--muted); }
.reset.armed { border-color: var(--ng); color: var(--ng); }

/* quiz */
.qhead { display: flex; align-items: center; gap: 12px; }
.back { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 12px; font-size: .85rem; }
.prog { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.count { font-size: .85rem; color: var(--muted); }
.tag { display: inline-block; margin-top: 18px; font-size: .75rem; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.qtext { margin-top: 10px; font-size: 1.08rem; font-weight: 500; line-height: 1.8; }
.qtext .no { font-family: var(--font-display); font-weight: 400; margin-right: .3em; }
.choices { display: grid; gap: 10px; margin-top: 18px; }
.choice {
  display: grid; grid-template-columns: 2.2rem 1fr; align-items: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 10px 14px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; line-height: 1.5;
}
.choice .k {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1.5px solid var(--line); font-weight: 700; font-size: .95rem;
}
.choice span:last-child { min-width: 0; overflow-wrap: anywhere; }
.choice:not(:disabled):active { background: var(--accent-soft); border-color: var(--accent); }
.choice.ok { border-color: var(--ok); background: var(--ok-soft); }
.choice.ok .k { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.choice.ng { border-color: var(--ng); background: var(--ng-soft); }
.choice.ng .k { background: var(--ng); border-color: var(--ng); color: var(--surface); }
.choice:disabled { cursor: default; color: var(--fg); }
.choice.dim { opacity: .55; }
.verdict { margin-top: 18px; font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; }
.verdict.ok { color: var(--ok); }
.verdict.ng { color: var(--ng); }
.explain { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.explain h2 { font-size: .78rem; color: var(--muted); letter-spacing: .12em; font-weight: 700; }
.explain p { margin: 4px 0 0; }
.tip { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.tip h2 { color: var(--accent); }
.next { margin-top: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags .tag { margin-top: 0; }
.tag-sub { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.qimg { margin: 12px 0 0; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.qimg img { display: block; width: 100%; height: auto; }
.kana4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.choice.k4 { grid-template-columns: 1fr; justify-items: center; min-height: 64px; padding: 8px; }
.choice.k4 .k { width: 2.6rem; height: 2.6rem; font-size: 1.15rem; }
.plan-btn { margin-top: 12px; }
.muted { color: var(--muted); }
.src { margin-top: 10px !important; font-size: .75rem; color: var(--muted); }
.paper { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.paper:last-child { border-bottom: 0; }
.paper:active { background: var(--accent-soft); }
.paper .name { font-weight: 700; }
.paper .meta { font-size: .8rem; color: var(--muted); }
.paper .meta.pass { color: var(--ok); font-weight: 700; }
.plan { position: fixed; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.plan-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.plan-bar span { flex: 1; font-weight: 700; font-size: .9rem; min-width: 0; }
.plan-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px; background: #FFFFFF; }
.plan-body img { display: block; width: 100%; height: auto; }
.plan-intro { margin-bottom: 16px; }
.plan-body.zoom .plan-img { width: 260%; max-width: none; }

.optnotes { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.optnotes li { display: grid; grid-template-columns: 1.9rem 1fr; gap: 8px; align-items: start; font-size: .92rem; line-height: 1.65; }
.optnotes li > span:last-child { min-width: 0; }
.optnotes .mk { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1.5px solid var(--line); font-weight: 700; font-size: .85rem; }
.optnotes li.ok .mk { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.optnotes li.ok b { color: var(--ok); }
.optnotes li.ng b { color: var(--ng); }
.optnotes li.mine.ng .mk { border-color: var(--ng); color: var(--ng); }
.askbox { margin-top: 16px; }
.ask-toggle { justify-content: center; }
.ask-panel { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.ask-log { display: grid; gap: 8px; }
.bub { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 12px; padding: 10px 12px; font-size: .95rem; line-height: 1.7; }
.bub.me { background: var(--accent-soft); justify-self: end; max-width: 90%; }
.bub.ai { background: var(--bg); border: 1px solid var(--line); }
.ask-lbl { font-size: .78rem; color: var(--muted); letter-spacing: .08em; }
#ask-input { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; resize: vertical; }
#ask-input:focus { outline: none; border-color: var(--accent); }
.ask-hint, .ask-note { margin: 0; font-size: .8rem; color: var(--muted); }
.ask-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-actions .btn-main, .ask-actions .btn-sub { width: auto; padding: 10px 16px; font-size: .95rem; }
.notes { display: grid; gap: 10px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.nhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.nhead small { color: var(--muted); font-size: .75rem; }
.nqa { border-top: 1px dashed var(--line); padding-top: 6px; }
.nq { margin: 0; font-weight: 500; }
.na { margin: 6px 0 0; white-space: pre-wrap; font-size: .92rem; }
.npend { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.note details summary { cursor: pointer; color: var(--accent); font-size: .85rem; margin-top: 4px; }
.nbtns { display: flex; gap: 8px; }
.mini { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 4px 10px; font-size: .8rem; color: var(--fg); }
.mini.del.armed { border-color: var(--ng); color: var(--ng); }
.note-empty { font-size: .85rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; }
.ask-tier { margin-top: 0; }
.tier-tag { color: var(--muted); font-size: .72rem; }

.choice.unk { grid-template-columns: 1fr; justify-items: center; min-height: 48px; margin-top: 8px; color: var(--muted); border-style: dashed; font-weight: 700; }
.choice.unk.picked { border-style: solid; border-color: var(--unk); background: var(--unk-soft); color: var(--unk); }
.verdict.unk { color: var(--unk); }
.guess { margin-top: 8px; }
.mini.hi { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.an-stats { grid-template-columns: repeat(2, 1fr); }
.tp-list { display: grid; gap: 10px; }
.tp { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.tp .row, .chrow .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tp .nm { font-weight: 700; }
.tp small, .chrow small { color: var(--muted); font-size: .78rem; }
.tp .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.tp .btns .mini { padding: 6px 12px; font-size: .85rem; }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter.mid i { background: var(--unk); }
.meter.low i { background: var(--ng); }
.chs { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chrow { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.chrow:last-child { border-bottom: 0; }
.chrow .chno { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .08em; }
.artrow .name { min-width: 0; overflow-wrap: anywhere; }
.art { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.art h2 { font-size: 1.2rem; line-height: 1.5; }
.art h3 { margin: 20px 0 4px; font-size: .95rem; color: var(--accent); letter-spacing: .04em; }
.art p { margin: 4px 0; overflow-wrap: anywhere; }
.art p.li { padding-left: 1em; text-indent: -1em; }
.rv.unk { border-left-color: var(--unk); }

/* 教科書 */
.bk-lead { margin: 14px 0 0; color: var(--muted); font-size: .9rem; }
.fx { margin: 10px 0; padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; font-weight: 700; overflow-wrap: anywhere; }
.ex { margin: 14px 0; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; }
.ex > b { color: var(--accent); font-size: .8rem; letter-spacing: .08em; }
.ex p { margin: 2px 0 6px; }
.steps { font-size: .95rem; line-height: 1.9; overflow-wrap: anywhere; }
details.try { margin: 14px 0; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; }
details.try summary { cursor: pointer; color: var(--accent); font-weight: 700; }
details.try div { margin-top: 6px; }
.pt, .warn { margin: 14px 0; border-radius: 8px; padding: 10px 12px; }
.pt { background: var(--ok-soft); }
.warn { background: var(--ng-soft); }
.pt b, .warn b { display: block; font-size: .78rem; letter-spacing: .08em; }
.pt b { color: var(--ok); }
.warn b { color: var(--ng); }
.tb { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .88rem; line-height: 1.55; }
.tb th, .tb td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.tb thead th { background: var(--bg); }
.tb tbody th { font-weight: 700; }
.fig { display: block; width: 100%; max-width: 360px; height: auto; margin: 12px auto; color: var(--fg); }
.fig text, .sym text { font-family: var(--font-body); }
.symgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.symc { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 2px; justify-items: center; align-content: start; text-align: center; }
.symc .sym { width: 72px; height: 48px; color: var(--fg); }
.symc b { font-size: .85rem; line-height: 1.4; }
.symc small { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; }
.cardbtns { display: grid; gap: 8px; }
.pgnav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pgnav .btn-sub { flex-direction: column; align-items: flex-start; gap: 2px; font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.pgnav small { font-weight: 500; font-size: .75rem; }
.fcard { display: grid; place-items: center; gap: 14px; width: 100%; min-height: 260px; margin-top: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 24px 16px; text-align: center; }
.fcard .sym { width: 150px; height: 100px; color: var(--fg); }
.cbig { display: block; font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.cg { display: block; font-size: .8rem; color: var(--muted); }
.cq { font-size: 1.1rem; font-weight: 700; line-height: 1.6; }
.fb b { display: block; font-size: 1.2rem; color: var(--accent); line-height: 1.5; }
.fb small { display: block; color: var(--muted); margin-top: 4px; }
.fhint { color: var(--muted); font-size: .85rem; }
.cdbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.cdbtns button { justify-content: center; }

.cat .sdesc { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; line-height: 1.5; margin-top: 2px; }
.cat .meta small { font-size: .7rem; }
.nextb { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .68rem; font-weight: 700; letter-spacing: .04em; }
.tag.star1 { color: var(--ok); border-color: var(--ok); }
.tag.star3 { color: var(--muted); }

/* 黒板 */
.bd-title { margin-top: 14px; font-size: 1.1rem; line-height: 1.5; }
.board { margin-top: 10px; background: #1F3B2D; border: 7px solid #7A5734; border-radius: 10px; box-shadow: inset 0 0 40px rgba(0,0,0,.35); padding: 4px; }
.board svg { display: block; width: 100%; height: auto; }
.bbt { font-family: "Klee One", var(--font-body); font-weight: 600; }
.bb-new .dr { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bbdraw .9s ease forwards; }
.bb-new circle, .bb-new text, .bb-new rect { animation: bbfade .6s ease .3s both; }
@keyframes bbdraw { to { stroke-dashoffset: 0; } }
@keyframes bbfade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bb-new .dr, .bb-new circle, .bb-new text, .bb-new rect { animation: none; stroke-dashoffset: 0; } }
.bd-say { margin: 12px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 5.5em; line-height: 1.8; }
.bd-q { margin-top: 8px; }
.bd-q summary { cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 700; }
.bd-q .qimg { margin-top: 6px; }
.bd-q .mini { margin-top: 6px; }
#plan { z-index: 12; }
.bd-links { display: grid; gap: 8px; margin-top: 14px; }
.bdov { overflow: auto; -webkit-overflow-scrolling: touch; }
.bdov-in { max-width: 560px; width: 100%; margin: 0 auto; padding: 14px 16px 32px; }
.cdbtns button:disabled { opacity: .45; cursor: default; }

/* 公開サイト版 */
.wrap.site { max-width: 680px; }
.wrap.wide { max-width: 1180px; }
.site-stats { grid-template-columns: repeat(4, 1fr); }
.site-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.site-tools .btn-sub { padding: 12px 14px; }
.site-opts { margin-top: 14px; }
.site-reset { margin: 0 0 0 auto; }
.site-links { margin-top: 8px; }
.site-reset:disabled { opacity: .45; }
.site-cols { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 16px; margin-top: 18px; align-items: start; }
.site-col { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.site-col h2 { font-size: 1.1rem; }
.site-col p.muted { font-size: .85rem; margin: 6px 0 12px; }
.site-col .cats { border-radius: 10px; }
.qsplit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.qplan { position: sticky; top: 10px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 18px; }
.qplan-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: .9rem; }
.qplan-body { max-height: calc(100vh - 80px); overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px; }
.qplan-body img { display: block; width: 100%; height: auto; }
.qplan-body .qp-intro { margin-top: 12px; border-top: 1px solid #D5DCE1; padding-top: 8px; }
.qplan-body.zoom .qp-plan { width: 220%; max-width: none; }
@media (max-width: 900px) {
  .qsplit { grid-template-columns: 1fr; }
  .qplan { position: static; }
  .qplan-body { max-height: 75vh; }
  .site-cols { grid-template-columns: 1fr; }
  .site-tools { grid-template-columns: 1fr; }
  .site-stats { grid-template-columns: repeat(2, 1fr); }
}

/* result */
.score { margin-top: 24px; text-align: left; }
.score b { font-family: var(--font-display); font-weight: 400; font-size: 3.2rem; line-height: 1; }
.score span { color: var(--muted); }
.score p { margin: 8px 0 0; }
.review { margin-top: 18px; display: grid; gap: 8px; }
.rv { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: 10px 12px; font-size: .9rem; line-height: 1.6; }
.rv.ng { border-left-color: var(--ng); }
.rv small { display: block; color: var(--muted); margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .prog i { transition: none; } }

/* 教科書の静的ページ(/kyokasho/) */
.kbook .crumb { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.kbook .crumb a, .kbook .kpn a, .kbook .kq a, .kbook .ktoc a, .kbook .kfoot a { color: var(--accent); }
.kh1 { font-size: 1.35rem; line-height: 1.5; margin: 6px 0 0; }
.kstep { color: var(--accent); font-weight: 700; font-size: .9rem; margin: 18px 0 0; }
h2.kstep { font-size: 1rem; }
.kbtns { display: grid; gap: 10px; margin-top: 14px; }
.kbtns a { text-decoration: none; }
.kq { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kq h2 { font-size: 1rem; margin: 0 0 6px; }
@media (max-width: 520px) { .kq ul { columns: 1 !important; } }
.kq ul { margin: 0; padding-left: 1.2em; columns: 2; font-size: .9rem; line-height: 1.9; }
.kpn { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: .9rem; }
.ktoc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 16px 6px 2em; margin: 6px 0 0; line-height: 2; }
.kfoot { margin-top: 32px; font-size: .8rem; color: var(--muted); }
a.mini, a.link { display: inline-block; text-decoration: none; }
a.link { text-decoration: underline; }
