/* N3 Tango — comp C: paper, ink and rules. Spec: design-consult-results.md (総合) + comps/c.html.
   Paper #f4efe3 · ink #1d1a16 · rule #d8cfbd. Orange #e8762c is for fills, markers and stamps only;
   orange text uses #c2551a. Review accent: indigo #2f4a7a. No shadows except the study card (2px 2px 0).
   Radius 4–6px (study card 10px). Weights 400 / 500 / 700 only. */
:root {
  --paper: #f4efe3;
  --paper-2: #ece5d4;
  --ink: #1d1a16;
  --ink-90: rgba(29, 26, 22, .9);
  --ink-80: rgba(29, 26, 22, .82);
  --furi: rgba(29, 26, 22, .7);
  --mute: rgba(29, 26, 22, .64);
  --faint: rgba(29, 26, 22, .45);
  --rule: #d8cfbd;
  --rule-2: #e0d7c2;
  --dots: #c9bda0;
  --or: #e8762c;
  --or-t: #c2551a;
  --stamp: #b3401a;
  --ai: #2f4a7a;
  --card: #fffdf7;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --side: 24px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--paper-2); }
body {
  font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.6; font-weight: 400;
  background: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.028 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }
[lang="ja"], .ja { font-family: var(--sans); }
.num, .mono { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.muted { color: var(--mute); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 26px; height: 26px; }

#app { min-height: 100vh; display: flex; flex-direction: column; }
#view { flex: 1; padding: 22px var(--side) 110px; }
#app.nonav #view { padding-bottom: 40px; }

/* ---------- header ---------- */
.hd { display: flex; justify-content: space-between; align-items: center; min-height: 30px; }
.logo { font-weight: 700; font-size: 19px; letter-spacing: .01em; }
.logo span { color: var(--or-t); }
.hd h1 { font-size: 19px; font-weight: 700; }
.hd .right { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--mute); }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--mute); border-radius: 4px; margin-right: -9px; }
.icon-btn.l { margin: 0 4px 0 -10px; }
.hd .ttl { display: flex; align-items: center; }
.date { margin-top: 6px; font-size: 12.5px; color: var(--mute); }
.date b { font-family: var(--mono); font-weight: 500; color: var(--ink-80); }
.lede { margin-top: 10px; font-size: 14px; color: var(--ink-80); }

/* ---------- section heading: short vermilion rule + plain title ---------- */
.sec { margin-top: 34px; }
.sec:first-child { margin-top: 18px; }
.sec .rule { width: 26px; height: 3px; background: var(--or); border-radius: 2px; }
.sec h2 { font-size: 17px; font-weight: 700; margin-top: 8px; display: flex; align-items: baseline; gap: 10px; }
.sec h2 .jp { font-family: var(--mincho); font-weight: 700; font-size: 14px; color: var(--mute); }
.sec h2 .aside { margin-left: auto; font-size: 12.5px; font-weight: 400; color: var(--mute); }
.todayline { margin-top: 8px; font-size: 14.5px; color: var(--ink-80); }
.todayline b, .sess b { font-family: var(--mono); font-weight: 500; }
.sess { margin-top: 14px; font-size: 14.5px; }
hr.div { border: none; border-top: 1px solid var(--rule); margin-top: 30px; }
.fine { margin-top: 26px; font-size: 12px; color: var(--mute); line-height: 1.7; }
.note { margin-top: 12px; font-size: 12.5px; color: var(--mute); line-height: 1.7; }

/* ---------- buttons ---------- */
.btn { display: block; width: 100%; text-align: center; font-weight: 700; font-size: 16px; padding: 13px 12px; border-radius: 6px; border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn.primary { background: var(--or); border-color: var(--or); color: #fff; }
.btn.ai { background: var(--ai); border-color: var(--ai); color: #fff; }
.btn:disabled { opacity: .4; }
.btn + .btn { margin-top: 10px; }
.btns { display: flex; gap: 10px; margin-top: 18px; }
.btns .btn { margin-top: 0; }
.start { margin-top: 14px; }
.txtbtn { font-size: 14px; color: var(--or-t); font-weight: 500; padding: 6px 0; }
.rev { margin-top: 12px; font-size: 13px; color: var(--ink-80); }
.rev .ind { color: var(--ai); font-weight: 700; }

/* ---------- ruled list rows ---------- */
.rows { margin-top: 18px; border-top: 1px solid var(--rule); }
.row { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--rule); font-size: 15px; text-decoration: none; color: var(--ink); }
.row .t { flex: 1; min-width: 0; }
.row .sub { display: block; font-size: 12.5px; color: var(--mute); margin-top: 1px; }
.row .arr { color: var(--or-t); }
.row .k { font-family: var(--mincho); font-weight: 700; font-size: 19px; width: 30px; flex: none; color: var(--ink-80); }
.row .v { font-family: var(--mono); font-size: 13px; color: var(--ink-80); }
.row.dim { color: var(--faint); }
.row.done .t > span:first-child { color: var(--mute); }

/* plan steps */
.plan .row { align-items: flex-start; padding: 13px 2px; }
.plan .row .k { padding-top: 1px; }
.plan .min { font-family: var(--mono); font-size: 13px; color: var(--mute); padding-top: 3px; white-space: nowrap; }
.plan .row.done .k { color: var(--faint); }

/* ---------- 済 stamp (the only rotated element) ---------- */
.stamp { display: inline-block; flex: none; color: var(--stamp); border: 2px solid var(--stamp); border-radius: 50%; width: 27px; height: 27px; line-height: 23px; text-align: center; font-family: var(--mincho); font-weight: 700; font-size: 14px; transform: rotate(-4deg); }
.stamp.sm { width: 23px; height: 23px; line-height: 19px; font-size: 12px; }

/* ---------- dictionary entry (word of the day) ---------- */
.entry { margin-top: 26px; }
.entry .no, .card .no { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.entry .no .pos, .card .no .pos { font-family: var(--sans); margin-left: 8px; }
.word { margin-top: 6px; font-family: var(--mincho); font-weight: 700; font-size: 42px; line-height: 1.3; }
.word rt { font-family: var(--sans); font-size: 12.5px; font-weight: 500; color: var(--furi); }
.mean { margin-top: 8px; font-size: 15.5px; color: var(--or-t); font-weight: 500; }
.ex { margin-top: 14px; font-size: 14.5px; line-height: 1.9; color: var(--ink-90); }
.ex .en { display: block; font-size: 13px; color: var(--mute); margin-top: 2px; line-height: 1.6; }
.hl, mark { background: linear-gradient(transparent 58%, rgba(232, 118, 44, .45) 58%); color: inherit; padding: 0 1px; }
rt { font-size: .55em; color: var(--furi); font-weight: 500; }
.nofuri rt { display: none; }

/* ---------- table of contents (units) ---------- */
.toc { margin-top: 26px; }
.toc .tr { display: flex; width: 100%; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 15px; min-height: 48px; }
.toc .n { font-family: var(--mono); color: var(--or-t); font-weight: 500; width: 34px; flex: none; }
.toc .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 62%; }
.toc .nm small { font-size: 12px; color: var(--mute); margin-left: 6px; }
.toc .stamp { margin-left: 10px; }
.toc .dots { flex: 1; min-width: 16px; border-bottom: 2px dotted var(--dots); margin: 0 10px; transform: translateY(5px); }
.toc .rg { font-family: var(--mono); font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.toc .tr.dim { color: var(--faint); }
.toc .tr.dim .n { color: rgba(29, 26, 22, .35); }
.prem { display: flex; width: 100%; align-items: center; gap: 12px; margin: 22px 0 4px; color: var(--mute); font-size: 12.5px; justify-content: center; }
.prem::before, .prem::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }

/* ---------- tabs (Learn tracks, quiz modes) ---------- */
.tabs { display: flex; margin-top: 18px; border-bottom: 1px solid var(--rule); }
.tabs button { flex: 1; padding: 10px 0 9px; font-size: 15px; color: var(--mute); text-align: center; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button .jp { font-family: var(--mincho); font-weight: 700; margin-right: 6px; }
.tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--or); }

.opts { margin-top: 14px; border-top: 1px solid var(--rule); }
.opt { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--rule); }
.opt .rad { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--faint); flex: none; position: relative; }
.opt.on .rad { border-color: var(--ink); }
.opt.on .rad::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--or); }
.opt .t { flex: 1; }
.opt .t small { display: block; font-size: 12.5px; color: var(--mute); }
.opt:disabled { opacity: .45; }
.seg { display: flex; margin-top: 12px; border: 1px solid var(--ink); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; text-align: center; padding: 9px 0; font-family: var(--mono); font-weight: 500; font-size: 15px; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }

/* ---------- study card (white paper on paper, ring holes, hard offset shadow) ---------- */
.card { margin-top: 18px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); padding: 20px 20px 22px 36px; position: relative; }
.card .hole { position: absolute; left: 11px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 1.5px solid #b9ad93; }
.card .h1 { top: 26px; } .card .h2 { top: 64px; }
.card .tag { display: flex; align-items: center; gap: 8px; }
.tagl { font-family: var(--sans); font-size: 11.5px; font-weight: 700; padding: 0 6px; border-radius: 3px; line-height: 19px; }
.tagl.new { background: var(--or); color: #fff; }
.tagl.rev { background: var(--ai); color: #fff; }
.tagl.again { border: 1px solid var(--ink); line-height: 17px; }
.card .word { font-size: 40px; margin-top: 4px; }
.card .pat { font-family: var(--mincho); font-weight: 700; font-size: 30px; line-height: 1.35; margin-top: 6px; }
.card .form { margin-top: 8px; font-size: 13px; color: var(--ink-80); font-family: var(--sans); line-height: 1.6; }
.card .form b { font-weight: 500; color: var(--mute); margin-right: 6px; }
.card .ex { font-size: 15px; }
.card .exs { margin-top: 6px; }
.card .exs > div { padding: 10px 0; border-top: 1px dashed var(--rule); display: flex; gap: 10px; align-items: flex-start; }
.card .exs > div:first-child { border-top: 0; }
.card .exs .ex { margin-top: 0; flex: 1; }
.hint { margin-top: 14px; font-size: 12px; color: var(--mute); }

/* 赤シート: answers in orange ink; ink under the sheet is clipped away (see js/sheet.js). */
.zone { position: relative; margin-top: 10px; padding: 2px 0; --sx: 0px; touch-action: pan-y; }
.ink { color: transparent; -webkit-background-clip: text; background-clip: text; background-image: linear-gradient(90deg, var(--or-t) var(--edge, 0px), transparent var(--edge, 0px)); }
.zone .ink, .zone .ex .en.ink { color: transparent; }
.zone .reading { font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.zone .gm { font-size: 15.5px; font-weight: 500; }
.zone .ex .en.ink { margin-top: 2px; }
/* At rest the sheet's left 12px lie in the card margin (between the punch holes and the text column); the
   white grip sits inside that strip, so it never covers a character. */
.sheet { position: absolute; top: -4px; bottom: -4px; left: calc(var(--sx) - 12px); right: -10px; background: rgba(232, 118, 44, .55); border-radius: 3px; cursor: grab; touch-action: none; z-index: 2; }
.sheet::after { content: ""; position: absolute; left: 3px; top: 50%; width: 4px; height: 26px; margin-top: -13px; border-radius: 2px; background: rgba(255, 255, 255, .75); }
.zone.drag .sheet { cursor: grabbing; }
.zone.open .sheet { opacity: 0; pointer-events: none; transition: opacity .2s .1s; }
.zone.open .ink, .zone.open .ex .en.ink { background-image: none; color: var(--or-t); }

.grade { display: flex; gap: 10px; margin-top: 18px; }
.grade .btn { margin: 0; }

/* audio button */
.play { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 17px; color: var(--ink-80); font-size: 13px; flex: none; background: var(--card); }
.play .ic { width: 17px; height: 17px; }
.play.on { border-color: var(--or); color: var(--or-t); }
.play.big { height: 52px; padding: 0 22px; border-radius: 26px; font-size: 15px; font-weight: 500; border-color: var(--ink); background: transparent; }
.play.big .ic { width: 22px; height: 22px; }
.play:disabled { opacity: .45; }

/* ---------- run screens (session / quiz / practice / mock) ---------- */
.runtop { display: flex; align-items: center; gap: 12px; min-height: 38px; }
.runtop .icon-btn { margin: 0 0 0 -10px; color: var(--ink-80); }
.runtop .track { flex: 1; height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.runtop .track i { display: block; height: 100%; background: var(--ink); }
.runtop .n { font-family: var(--mono); font-size: 13px; color: var(--mute); min-width: 52px; text-align: right; }
.part { margin-top: 18px; font-size: 12.5px; color: var(--mute); display: flex; gap: 8px; align-items: baseline; }
.part b { font-family: var(--mono); font-weight: 500; color: var(--ink-80); }
.ins { margin-top: 14px; font-size: 13.5px; line-height: 1.75; }
.ins .en { display: block; font-size: 12.5px; color: var(--mute); }
.q { margin-top: 16px; }
.prompt { font-family: var(--mincho); font-weight: 700; font-size: 38px; line-height: 1.35; margin-top: 10px; }
.sent { font-size: 18px; line-height: 2; margin-top: 12px; }
.sent u { text-decoration: none; border-bottom: 1.5px solid var(--ink); }
.blank { display: inline-block; min-width: 4.5em; text-align: center; border-bottom: 1.5px solid var(--ink); margin: 0 2px; line-height: 1.5; }
.blank.filled { color: var(--ai); font-weight: 700; }
.slot { display: inline-block; min-width: 3.6em; border-bottom: 1.5px solid var(--ink); text-align: center; margin: 0 3px; line-height: 1.5; color: var(--ai); font-weight: 500; }
.slot.fill { font: inherit; color: var(--ai); border-bottom-color: var(--ai); padding: 0 2px; }
.sent.ok .slot.fill { background: rgba(47, 74, 122, .08); }
.sent.ng .slot.fill { color: var(--or-t); border-bottom-color: var(--or-t); }
.slot.star { position: relative; }
.slot.star::before { content: "★"; position: absolute; left: 50%; top: -1.05em; transform: translateX(-50%); font-size: 12px; color: var(--or-t); }
.qen { margin-top: 6px; font-size: 13px; color: var(--mute); }
.qtext { margin-top: 14px; font-size: 16px; font-weight: 500; }

.choices { margin-top: 18px; border-top: 1px solid var(--rule); }
.choice { display: flex; width: 100%; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--rule); font-size: 16px; min-height: 52px; }
.choice .ck { font-family: var(--mono); font-size: 13px; width: 24px; height: 24px; border: 1px solid var(--faint); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--mute); }
.choice .ct { flex: 1; }
.choice .ct small { display: block; font-size: 12.5px; color: var(--mute); }
.choice.sel { background: rgba(29, 26, 22, .05); }
.choice.sel .ck { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice.ok { background: rgba(47, 74, 122, .08); }
.choice.ok .ck { background: var(--ai); color: #fff; border-color: var(--ai); }
.choice.ng { background: rgba(232, 118, 44, .12); }
.choice.ng .ck { background: var(--or-t); color: #fff; border-color: var(--or-t); }
.choice .mk { flex: none; }
.choice.ok .mk { color: var(--ai); }
.choice.ng .mk { color: var(--or-t); }

/* sentence ordering */
.build { margin-top: 18px; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.build .ph { font-size: 13px; color: var(--faint); }
.tiles { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tile { padding: 8px 12px; border: 1px solid var(--ink); border-radius: 4px; font-size: 16px; background: var(--card); }
.tile .tn { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-right: 6px; }
.tile.used { visibility: hidden; }
.build .tile { border-color: var(--ai); color: var(--ai); }
.build.ok .tile { background: rgba(47, 74, 122, .08); }
.build.ng .tile { border-color: var(--or-t); color: var(--or-t); }

.fb { margin-top: 18px; padding: 12px 0 2px; border-top: 2px solid var(--ink); }
.fb .h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.fb.ok .h { color: var(--ai); }
.fb.ng .h { color: var(--or-t); }
.fb .w { font-family: var(--mincho); font-weight: 700; font-size: 22px; margin-top: 6px; }
.fb .w small { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--mute); margin-left: 8px; }
.fb .d { font-size: 14px; margin-top: 4px; color: var(--ink-80); line-height: 1.7; }
.fb .d .en { display: block; color: var(--mute); font-size: 13px; }

/* listening: player + transcript */
.player { margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.player .pl { font-size: 12.5px; color: var(--mute); }
.script { margin-top: 12px; }
.script .ln { display: flex; gap: 10px; padding: 5px 0; font-size: 15px; line-height: 2; }
.script .sp { font-family: var(--mono); font-size: 12px; color: var(--mute); width: 16px; flex: none; padding-top: 3px; }
details.tx { margin-top: 16px; border-top: 1px solid var(--rule); }
details.tx summary { padding: 12px 0; font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.tx summary::-webkit-details-marker { display: none; }

/* reading passage */
.passage { margin-top: 16px; padding: 16px 0 8px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.passage .ttl { font-size: 12.5px; color: var(--mute); }
.passage p { font-size: 16px; line-height: 2.05; margin-top: 10px; text-indent: 1em; }
.passage p.ni { text-indent: 0; }
.furi-t { font-size: 13px; color: var(--or-t); }
.rq { margin-top: 26px; }
.rq .qn { font-family: var(--mono); font-size: 12.5px; color: var(--mute); }

/* ---------- results / scores ---------- */
.score { margin-top: 22px; display: flex; align-items: baseline; gap: 10px; }
.score .big { font-family: var(--mono); font-weight: 500; font-size: 46px; line-height: 1; }
.score .big small { font-size: 20px; color: var(--mute); }
.score .lbl { font-size: 13px; color: var(--mute); }
.verdict { margin-top: 12px; font-size: 15px; font-weight: 700; }
.verdict.pass { color: var(--ai); }
.verdict.fail { color: var(--or-t); }
.secs { margin-top: 20px; border-top: 1px solid var(--rule); }
.secr { padding: 14px 2px 14px; border-bottom: 1px solid var(--rule); }
.secr .top { display: flex; align-items: baseline; gap: 10px; }
.secr .nm { flex: 1; font-size: 15px; font-weight: 500; }
.secr .nm small { display: block; font-family: var(--mincho); font-weight: 700; font-size: 12.5px; color: var(--mute); }
.secr .sc { font-family: var(--mono); font-weight: 500; font-size: 20px; }
.secr .sc small { font-size: 13px; color: var(--mute); }
.secr .meta { margin-top: 20px; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mute); }
.secr .meta .risk { color: var(--or-t); font-weight: 700; }
.secr .meta .safe { color: var(--ai); font-weight: 500; }
.meter { position: relative; height: 8px; margin-top: 10px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ai); border-radius: 1px; }
.meter.low i { background: var(--or); }
.meter .cut { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 1.5px solid var(--ink); }
.meter .cut span { position: absolute; top: 15px; left: -10px; width: 20px; text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--ink-80); }
.meter.total { height: 10px; }
.secr.tot .meta { margin-top: 22px; }

.rlist { margin-top: 14px; border-top: 1px solid var(--rule); }
.rlist .r { display: flex; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 1.6; }
.rlist .r .mk { padding-top: 2px; }
.rlist .r .mk.ok { color: var(--ai); }
.rlist .r .mk.ng { color: var(--or-t); }
.rlist .r .d { flex: 1; min-width: 0; }
.rlist .r .s { font-size: 12.5px; color: var(--mute); }
.rlist .ph { padding: 14px 2px 6px; font-size: 12.5px; color: var(--mute); border-bottom: 1px solid var(--rule); }

.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.kv b { font-family: var(--mono); font-weight: 500; font-size: 14px; text-align: right; white-space: nowrap; }
.kv b.t { white-space: normal; }
.kv b.t { font-family: var(--sans); font-weight: 500; }
.kv b .kv-sub { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--mute); }
.kvs { margin-top: 14px; border-top: 1px solid var(--rule); }

/* ---------- settings / account ---------- */
.acct-form { margin-top: 12px; }
.acct-form label { display: block; margin-top: 10px; font-size: 12.5px; color: var(--mute); }
.acct-form input { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 4px; }
.acct-form input:focus { outline: none; border-color: var(--ink); }
.acct-msg { margin-top: 10px; font-size: 13px; color: var(--ink-80); }
.acct-msg.err { color: var(--or-t); }
.acct-email { font-family: var(--sans) !important; word-break: break-all; }
.sync { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--mute); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.sync.s-synced i { background: var(--ai); }
.sync.s-pending i, .sync.s-syncing i { background: var(--or); }
.sync.s-error i, .sync.s-expired i { background: var(--or-t); }
.sync.under-hdr { margin-top: 6px; }
/* early account prompt (guests): end-screen card + slim Home reminder */
.ap { margin-top: 18px; padding: 16px 16px 16px; border: 1px solid var(--ink); border-radius: 6px; background: var(--card); }
.ap .h { font-family: var(--mincho); font-weight: 700; font-size: 18px; line-height: 1.4; }
.ap p { margin-top: 6px; font-size: 14px; color: var(--ink-80); line-height: 1.65; }
.ap .btns { margin-top: 14px; }
.ap-bar { margin-top: 12px; padding: 8px 12px; border: 1px solid var(--rule); border-left: 3px solid var(--or); border-radius: 4px; font-size: 12.5px; color: var(--ink-80); line-height: 1.6; }
.ap-bar .txtbtn { font-size: 12.5px; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.danger { display: block; width: 100%; text-align: left; color: var(--or-t); font-weight: 500; padding: 14px 2px; border-bottom: 1px solid var(--rule); }
.danger.acct-del { margin-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; }
.danger:disabled { opacity: .4; }
/* account deletion: inline confirmation (step 2) */
.del-confirm { margin-top: 16px; padding: 16px; border: 1px solid var(--or-t); border-radius: 6px; background: var(--card); }
.del-confirm .h { font-family: var(--mincho); font-weight: 700; font-size: 18px; line-height: 1.4; color: var(--or-t); }
.del-confirm p { margin-top: 6px; font-size: 14px; color: var(--ink-80); line-height: 1.65; }
.del-confirm .btns { margin-top: 14px; }
.btn.danger-btn { background: var(--or-t); border-color: var(--or-t); color: #fff; }

/* paywall */
.pw { margin-top: 20px; }
.pw h1 { font-family: var(--mincho); font-weight: 700; font-size: 28px; line-height: 1.4; }
.pw p { margin-top: 8px; font-size: 14.5px; color: var(--ink-80); }
.feats { margin-top: 20px; border-top: 1px solid var(--rule); }
.feats div { padding: 11px 2px; border-bottom: 1px solid var(--rule); font-size: 14.5px; display: flex; gap: 10px; align-items: center; }
.feats .ic { color: var(--ai); }
.plans { margin-top: 20px; }
.plan-o { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 14px; border: 1px solid var(--rule); border-radius: 6px; margin-top: 10px; }
.plan-o.on { border-color: var(--ink); }
.plan-o .rad { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--faint); flex: none; position: relative; }
.plan-o.on .rad::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--or); }
.plan-o .t { flex: 1; }
.plan-o .t small { display: block; font-size: 12.5px; color: var(--mute); }
.plan-o .pr { font-family: var(--mono); font-weight: 500; text-align: right; }
.plan-o .pr small { display: block; font-family: var(--sans); font-weight: 400; font-size: 11.5px; color: var(--mute); }
.plan-o .save { display: inline-block; vertical-align: 2px; margin-left: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--ai); padding: 0 6px; border-radius: 3px; line-height: 18px; }
a.btn { text-decoration: none; }
.pw-soon { text-align: center; margin-top: 18px; }
.pw-on { margin-top: 22px; padding: 14px; border: 1px solid var(--ink); border-radius: 6px; display: flex; align-items: baseline; gap: 10px; }
.pw-on b { font-size: 16px; }
.pw-on span { margin-left: auto; font-size: 13px; color: var(--mute); }

.empty { padding: 60px 0; text-align: center; color: var(--mute); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* ---------- bottom nav: one kanji + small English label ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; display: flex; border-top: 1px solid var(--rule); background: var(--paper); padding: 9px 0 calc(12px + env(safe-area-inset-bottom)); z-index: 10; }
.nav button { flex: 1; text-align: center; color: var(--mute); }
.nav .k { display: block; font-family: var(--mincho); font-size: 21px; font-weight: 700; line-height: 1.15; }
.nav .l { display: block; font-size: 10px; margin-top: 2px; letter-spacing: .03em; }
.nav .on { color: var(--or-t); }
#app.nonav .nav { display: none; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px); background: var(--ink); color: var(--paper); font-size: 13.5px; padding: 9px 14px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 86%; text-align: center; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast, .zone.open .sheet { transition: none; } }
