/* 英検二次 最後の砦 — app.css
   eiken2ji（ぜんぶ攻略くん）の色分けを引き継ぎつつ、「直前」の切迫感：黒×警告イエロー×レッド、カウントダウン、警告テープ。
   横スクロールは作らない。375px とデスクトップで確認。 */
:root {
  --paper: #f6f2ea; --surface: #ffffff; --ink: #121317; --sub: #585e6c; --faint: #8a8f9c;
  --line: #e3ddd0; --soft: #efe9de; --mark: #ffe14a;
  --red: #e5212d; --red2: #ff3b47; --yel: #ffd400; --blk: #111216;
  --g2: #2463eb; --gp: #e2492b; --g1: #7a3bea; --g: var(--g2);
  --pos-bg: #fff2a8; --pos-tx: #5a4300; --r-bg: #e6eeff; --r-tx: #1d47b8; --ex-bg: #dcf4e8; --ex-tx: #0a6e4a;
  --con-bg: #ffe5d8; --con-tx: #a2380f; --end-bg: #eceae4; --end-tx: #4b4f5a;
  --ok: #0d9b68; --ng: #de3b3b;
  --shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 8px 26px rgba(20, 22, 28, .08);
  --r: 16px; --dock-h: 62px;
  --font: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --en: "Outfit", "Noto Sans JP", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0d0e12; --surface: #17191f; --ink: #eef0f4; --sub: #a7adba; --faint: #7c8291;
  --line: #2a2e38; --soft: #1e2129; --mark: #ffd93a;
  --pos-bg: #4a3e0a; --pos-tx: #ffe58a; --r-bg: #16264d; --r-tx: #a9c3ff; --ex-bg: #0f3a2a; --ex-tx: #8fe6bf;
  --con-bg: #45220f; --con-tx: #ffb98f; --end-bg: #2a2d35; --end-tx: #c8ccd6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0e12; --surface: #17191f; --ink: #eef0f4; --sub: #a7adba; --faint: #7c8291;
    --line: #2a2e38; --soft: #1e2129; --mark: #ffd93a;
    --pos-bg: #4a3e0a; --pos-tx: #ffe58a; --r-bg: #16264d; --r-tx: #a9c3ff; --ex-bg: #0f3a2a; --ex-tx: #8fe6bf;
    --con-bg: #45220f; --con-tx: #ffb98f; --end-bg: #2a2d35; --end-tx: #c8ccd6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
[data-grade="2kyu"] { --g: var(--g2); }
[data-grade="pre1"] { --g: var(--gp); }
[data-grade="1kyu"] { --g: var(--g1); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17.5px; line-height: 1.75; overflow-x: hidden; padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 8px); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--g); text-underline-offset: 3px; }
b, strong { font-weight: 800; }
mark { background: linear-gradient(transparent 55%, var(--mark) 55%); color: inherit; padding: 0 .1em; }
:root[data-theme="dark"] mark { background: linear-gradient(transparent 55%, rgba(255, 217, 58, .42) 55%); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--g); outline-offset: 2px; border-radius: 6px; }
main { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.en { font-family: var(--en); }
.loading { text-align: center; padding: 80px 0; color: var(--sub); }

/* ---------- 警告テープ ---------- */
.tape { background: repeating-linear-gradient(-45deg, var(--yel) 0 14px, var(--blk) 14px 28px); padding: 3px 0; overflow: hidden; }
.tape span { display: inline-block; white-space: nowrap; background: var(--blk); color: var(--yel); font-weight: 900; font-size: 11px; letter-spacing: .08em; padding: 1px 10px; animation: tape 38s linear infinite; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape span { animation: none; } html { scroll-behavior: auto; } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 15px; line-height: 1.15; min-width: 0; }
.brand small { display: block; font-size: 10px; font-weight: 700; color: var(--sub); letter-spacing: .04em; }
.brand img { flex: none; }
.gsw { display: flex; gap: 4px; margin-left: auto; background: var(--soft); padding: 3px; border-radius: 999px; }
.gsw button { border: 0; background: none; padding: 6px 11px; border-radius: 999px; font-weight: 900; font-size: 14px; color: var(--sub); white-space: nowrap; }
.gsw button[aria-pressed="true"] { background: var(--g); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--g) 45%, transparent); }
.ico { border: 1px solid var(--line); background: var(--surface); width: 36px; height: 36px; border-radius: 50%; flex: none; }
.prog { position: sticky; top: 53px; z-index: 39; height: 4px; background: var(--soft); }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--yel)); transition: width .3s; }
@media (max-width: 420px) { .brand span { font-size: 13px; } .brand small { font-size: 9px; } .gsw button { padding: 6px 8px; font-size: 13px; } .brand img { width: 30px; height: 30px; } }
@media (max-width: 350px) { .brand span { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; margin: 14px 0 0; padding: 22px 18px 20px; border-radius: 22px; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--red) 55%, transparent) 0%, transparent 55%), linear-gradient(160deg, #17181d, #0b0c0f); color: #fff; overflow: hidden; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%; border: 22px solid color-mix(in srgb, var(--yel) 22%, transparent); }
.kick { display: inline-flex; align-items: center; gap: 6px; background: var(--red); color: #fff; font-weight: 900; font-size: 12px; padding: 3px 10px; border-radius: 999px; letter-spacing: .04em; }
.kick i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.hero h1 { position: relative; z-index: 1; font-size: clamp(28px, 7.4vw, 46px); line-height: 1.22; margin: 12px 0 8px; font-weight: 900; letter-spacing: -.01em; }
.hero h1 .hl { color: var(--yel); }
.hero p.lead { position: relative; z-index: 1; margin: 0 0 14px; color: #d8dbe3; font-size: 16.5px; }
.cd { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.cd-box { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 8px 12px; }
.cd-box small { display: block; font-size: 11.5px; color: #c4c8d2; font-weight: 700; }
.cd-box b { font-family: var(--en); font-size: 28px; color: var(--yel); font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cd-box b small { display: inline; font-size: 13px; color: #fff; margin: 0 3px 0 1px; }
.cd-box.now b { color: var(--red2); }
.hero-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff; font-size: 14.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }

/* 面接 / S-CBT */
.msw { display: flex; gap: 8px; margin: 12px 0 0; }
.msw button { flex: 1; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 9px 8px; font-weight: 900; font-size: 16.5px; line-height: 1.3; }
.msw button small { display: block; font-size: 13.5px; font-weight: 700; color: var(--sub); }
.msw button[aria-pressed="true"] { border-color: var(--g); background: color-mix(in srgb, var(--g) 10%, var(--surface)); color: var(--g); }

/* 目次 */
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 14px 0 6px; padding: 0; list-style: none; counter-reset: toc; }
.toc a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.toc a .n { font-family: var(--en); font-weight: 900; color: var(--g); font-size: 15px; flex: none; }
.toc a.done { opacity: .55; }
.toc a.done .n::after { content: " ✓"; color: var(--ok); }

/* ---------- セクション ---------- */
.sec { margin: 26px 0 0; }
.sec-h { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.sec-h .no { flex: none; font-family: var(--en); font-weight: 900; font-size: 15px; color: #fff; background: var(--blk); width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; box-shadow: 3px 3px 0 var(--g); }
:root[data-theme="dark"] .sec-h .no { background: #2a2d36; }
.sec-h h2 { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 900; flex: 1; min-width: 0; }
.sec-h h2 small { display: block; font-size: 14.5px; font-weight: 700; color: var(--sub); }
.read { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--sub); font-size: 14.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.read[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.note { font-size: 15px; color: var(--sub); margin: 8px 0 0; }
.coach { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--g) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--g) 45%, transparent); font-size: 16.5px; }
.coach img { width: 34px; height: 34px; flex: none; }

/* 絶対これだけ3つ */
.three { display: grid; gap: 10px; counter-reset: th; }
.three li { list-style: none; position: relative; background: var(--surface); border: 2px solid var(--blk); border-radius: 16px; padding: 14px 14px 14px 62px; box-shadow: 4px 4px 0 var(--yel); }
:root[data-theme="dark"] .three li { border-color: #3a3e49; }
.three li::before { counter-increment: th; content: counter(th); position: absolute; left: 14px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--en); font-weight: 900; font-size: 20px; display: grid; place-items: center; }
.three li > b { display: block; font-size: 19px; line-height: 1.4; }
.three li > p { margin: 4px 0 0; font-size: 16.5px; color: var(--sub); }
.three ul { padding: 0; margin: 0; }

/* 流れ・時間 */
.bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin: 6px 0 4px; border: 1px solid var(--line); }
.bar span { display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #fff; white-space: nowrap; overflow: hidden; min-width: 0; }
.bar-l { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14.5px; color: var(--sub); margin: 4px 0 12px; }
.bar-l i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.flow { list-style: none; padding: 0; margin: 0; position: relative; }
.flow li { position: relative; padding: 0 0 12px 30px; }
.flow li::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: -6px; width: 2px; background: var(--line); }
.flow li:last-child::before { display: none; }
.flow li::after { content: ""; position: absolute; left: 3px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--g); }
.flow li.timed::after { background: var(--red); border-color: var(--red); }
.flow .st { font-weight: 900; font-size: 16.5px; }
.flow .sec-t { display: inline-block; margin-left: 6px; font-family: var(--en); font-size: 14.5px; font-weight: 900; color: #fff; background: var(--red); border-radius: 6px; padding: 0 6px; }
.flow .sec-t.mey { background: var(--faint); }
.flow li.timed.soft::after { background: var(--surface); border-color: var(--faint); }
.flow .lines { font-size: 16px; margin-top: 2px; }
.who { display: inline-block; font-size: 13px; font-weight: 900; padding: 0 6px; border-radius: 5px; margin-right: 5px; vertical-align: 1px; }
.who.ex { background: var(--soft); color: var(--sub); }
.who.you { background: var(--g); color: #fff; }
.flow .fn { font-size: 15px; color: var(--sub); }
.flow li.off { display: none; }
.scbt-only, .men-only { display: none; }
[data-mode="scbt"] .scbt-only { display: block; }
[data-mode="men"] .men-only { display: block; }

/* 絶対に出る */
.must { display: grid; gap: 8px; }
.must .m { display: grid; grid-template-columns: 86px 1fr; gap: 10px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.must .tag { font-family: var(--en); font-weight: 900; font-size: 16px; color: #fff; background: var(--g); border-radius: 10px; text-align: center; padding: 6px 4px; line-height: 1.2; }
.must .q { font-family: var(--en); font-weight: 600; font-size: 16.5px; line-height: 1.45; }
.must .a { margin-top: 4px; font-weight: 900; color: var(--red); font-size: 16.5px; }
:root[data-theme="dark"] .must .a { color: var(--red2); }
.must .s { font-size: 15px; color: var(--sub); }
@media (max-width: 420px) { .must .m { grid-template-columns: 1fr; } .must .tag { justify-self: start; padding: 3px 10px; } }

/* 型 */
.tpl { border-left: 5px solid var(--g); }
.tpl .h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpl .part { font-size: 14.5px; font-weight: 900; color: #fff; background: var(--blk); border-radius: 6px; padding: 1px 8px; }
:root[data-theme="dark"] .tpl .part { background: #333743; }
.tpl h3 { margin: 0; font-size: 17.5px; }
.tpl pre { margin: 10px 0 6px; white-space: pre-wrap; word-break: break-word; font-family: var(--en); font-size: 17.5px; line-height: 1.6; font-weight: 600; background: var(--soft); border-radius: 12px; padding: 12px; }
.tpl pre .ph { color: var(--g); background: color-mix(in srgb, var(--g) 12%, transparent); border-radius: 4px; padding: 0 3px; font-family: var(--font); font-size: 15.5px; font-weight: 700; }
.tpl .ja { font-size: 15.5px; color: var(--sub); margin: 0; }

/* テク */
.tech { display: grid; gap: 10px; counter-reset: tc; }
.tech .t { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 12px 50px; }
.tech .t::before { counter-increment: tc; content: counter(tc, decimal-leading-zero); position: absolute; left: 12px; top: 12px; font-family: var(--en); font-weight: 900; color: var(--red); font-size: 20.5px; }
.tech .t > b { display: block; font-size: 17.5px; line-height: 1.45; }
.tech .t p { margin: 4px 0 0; font-size: 16.5px; }
.tech .t .ex { margin-top: 6px; font-family: var(--en); font-weight: 600; font-size: 16.5px; color: var(--g); display: flex; gap: 6px; align-items: center; }

/* NG → OK */
.ng { display: grid; gap: 8px; }
.ng .row { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.ng .x, .ng .o { display: flex; gap: 8px; align-items: flex-start; font-size: 16.5px; line-height: 1.5; }
.ng .x { color: var(--ng); text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .85; }
.ng .o { color: var(--ok); font-weight: 700; margin-top: 4px; }
.ng .x::before { content: "✕"; font-weight: 900; text-decoration: none; display: inline-block; }
.ng .o::before { content: "◯"; font-weight: 900; flex: none; }
.ng .why { font-size: 15px; color: var(--sub); margin: 4px 0 0 22px; }

/* S-CBT */
.scbt { border: 2px solid var(--g); }
.scbt h3 { margin: 0 0 8px; font-size: 17.5px; }
.scbt .d { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.scbt .d div { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 16px; }
.scbt .d > div > b { display: block; font-size: 16.5px; }
.scbt ul { margin: 10px 0 0; padding-left: 20px; font-size: 16.5px; }

/* 予想問題 */
.yoso-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.yoso-tabs button { border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; font-weight: 900; font-size: 16px; }
.yoso-tabs button[aria-pressed="true"] { background: var(--blk); color: var(--yel); border-color: var(--blk); }
.qcard { background: var(--surface); border: 2px solid var(--blk); border-radius: 18px; overflow: hidden; box-shadow: 5px 5px 0 var(--g); }
:root[data-theme="dark"] .qcard { border-color: #3a3e49; }
.qcard .qh { background: var(--blk); color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qcard .qh b { font-family: var(--en); font-size: 18.5px; }
.qcard .qh .lbl { font-size: 13.5px; font-weight: 900; color: var(--blk); background: var(--yel); border-radius: 5px; padding: 1px 7px; }
.qcard .qb { padding: 14px; }
.passage { font-family: var(--en); font-size: 18px; line-height: 1.75; background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.passage h4 { margin: 0 0 4px; text-align: center; font-size: 18px; }
.passage .hit { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--g) 30%, transparent) 60%); }
.panels { display: grid; gap: 8px; margin: 12px 0 4px; }
.panels.n3 { grid-template-columns: repeat(3, 1fr); }
.panels.n4 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 520px) { .panels.n3 { grid-template-columns: 1fr 1fr; } .panels.n4 { grid-template-columns: repeat(3, 1fr); } .panels figure.hasay { grid-column: 1 / -1; } } /* スマホは吹き出しのある絵を大きく（中の英文が読めるように） */
.panel { position: relative; border: 2px solid var(--blk); border-radius: 6px; background: #fff; aspect-ratio: 4 / 3; overflow: hidden; }
.panel img { width: 100%; height: 100%; object-fit: cover; }
.panel .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; font-size: 14.5px; color: #555; text-align: center; background: repeating-linear-gradient(45deg, #f4f4f4 0 10px, #fafafa 10px 20px); }
.panel .tm { position: absolute; left: 4px; top: 4px; background: #fff; border: 1.5px solid #111; border-radius: 4px; font-family: var(--en); font-weight: 800; font-size: 14px; color: #111; padding: 0 5px; line-height: 1.5; }
.cap { font-family: var(--en); font-weight: 700; font-size: 14.5px; line-height: 1.35; margin: 3px 0 0; color: var(--ink); }
.cap::before { content: "💬 "; }
/* 絵の中の空の吹き出しにセリフを重ねる（位置は cards.json の bub: 左・上・幅・高さ％） */
.panel .say { position: absolute; container-type: size; display: flex; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.panel .say > span { max-width: 80%; font-family: var(--en); font-weight: 800; font-size: 12cqw; line-height: 1.15; color: #111; }
.panel .pn { position: absolute; right: 4px; top: 4px; background: rgba(0, 0, 0, .65); color: #fff; font-family: var(--en); font-size: 11px; font-weight: 800; border-radius: 4px; padding: 0 5px; }
.first { font-family: var(--en); font-weight: 700; font-size: 16.5px; border: 2px dashed var(--g); border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; }
.qq { margin: 14px 0 0; border-top: 1px dashed var(--line); padding-top: 12px; }
.qq .qn { display: inline-block; font-family: var(--en); font-weight: 900; color: #fff; background: var(--g); border-radius: 7px; padding: 0 8px; font-size: 15px; margin-right: 6px; }
.qq .qt { font-family: var(--en); font-weight: 600; font-size: 17px; line-height: 1.5; }
.qq .lead { font-family: var(--en); font-size: 16.5px; color: var(--sub); font-style: italic; }
.qq .qja { font-size: 15px; color: var(--sub); margin: 2px 0 0; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 15.5px; font-weight: 700; text-decoration: none; color: var(--ink); line-height: 1.3; }
.btn.pri { background: var(--g); border-color: var(--g); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.blk { background: var(--blk); border-color: var(--blk); color: var(--yel); }
.btn:disabled { opacity: .5; cursor: default; }
.ans { margin: 8px 0 0; background: color-mix(in srgb, var(--g) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--g) 30%, var(--line)); border-radius: 12px; padding: 10px 12px; }
.ans[hidden] { display: none; }
.ans .en { font-size: 17px; line-height: 1.65; font-weight: 600; }
.ans .ja { font-size: 15px; color: var(--sub); margin: 6px 0 0; }
.ans .how { font-size: 15.5px; margin: 6px 0 0; }
.ans .lbl2 { display: inline-block; font-size: 13.5px; font-weight: 900; padding: 0 7px; border-radius: 5px; margin-right: 5px; background: var(--g); color: #fff; vertical-align: 2px; }
.ans .alt + .alt { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.seg { border-radius: 4px; padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.seg.intro, .seg.end { background: var(--pos-bg); color: var(--pos-tx); }
.seg.r1, .seg.r2 { background: var(--r-bg); color: var(--r-tx); }
.seg.concede { background: var(--con-bg); color: var(--con-tx); }

/* テーマ集 */
.th-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.th-filter button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 15px; font-weight: 700; }
.th-filter button[aria-pressed="true"] { background: var(--g); color: #fff; border-color: var(--g); }
.th { display: grid; gap: 8px; }
.th details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.th summary { list-style: none; cursor: pointer; padding: 11px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; }
.th summary::-webkit-details-marker { display: none; }
.th summary .cat { font-size: 13.5px; font-weight: 900; color: var(--g); border: 1.5px solid var(--g); border-radius: 6px; padding: 0 6px; margin-top: 3px; white-space: nowrap; }
.th summary .q { font-family: var(--en); font-weight: 600; font-size: 16.5px; line-height: 1.45; }
.th summary .q small { display: block; font-family: var(--font); font-weight: 400; font-size: 14.5px; color: var(--sub); }
.th summary::after { content: "＋"; font-weight: 900; color: var(--sub); }
.th details[open] summary::after { content: "－"; }
.th .body { padding: 0 14px 12px; }
.th .other { font-size: 15px; color: var(--sub); margin: 8px 0 0; }
.th .rs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 0; }
.th .rs div { background: var(--soft); border-radius: 10px; padding: 8px 10px; font-family: var(--en); font-size: 16px; line-height: 1.45; }
.th .rs b { display: block; font-family: var(--font); font-size: 14.5px; }
@media (max-width: 520px) { .th .rs { grid-template-columns: 1fr; } }

/* 救急・当日 */
.ph-list { display: grid; gap: 6px; }
.ph-list .p { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.ph-list .p div { flex: 1; min-width: 0; }
.ph-list .p .e { font-family: var(--en); font-weight: 700; font-size: 17px; line-height: 1.4; }
.ph-list .p .j { font-size: 14.5px; color: var(--sub); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.chk { list-style: none; padding: 0; margin: 0; }
.chk li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 16.5px; border-bottom: 1px dashed var(--line); }
.chk li:last-child { border-bottom: 0; }
.chk input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ok); flex: none; }
.card h3 { margin: 0 0 6px; font-size: 17.5px; }

/* 音声ボタン */
.au { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--g); color: #fff; display: inline-grid; place-items: center; font-size: 14.5px; padding: 0 0 0 2px; vertical-align: middle; }
.au.on { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }
.au.sm { width: 26px; height: 26px; font-size: 12.5px; }

/* AI */
.ai { background: linear-gradient(160deg, #15161b, #0c0d10); color: #fff; border-radius: 20px; padding: 16px; box-shadow: var(--shadow); }
.ai .ai-h { display: flex; gap: 10px; align-items: center; }
.ai .ai-h img { width: 44px; height: 44px; }
.ai .ai-h b { font-size: 19.5px; }
.ai .ai-h small { display: block; color: #c4c8d2; font-size: 14.5px; }
.ai .q-left { margin-left: auto; text-align: right; font-size: 14.5px; color: #c4c8d2; }
.ai .q-left b { display: block; font-family: var(--en); font-size: 24px; color: var(--yel); line-height: 1.1; }
.ai-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.ai-tabs button { border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; border-radius: 12px; padding: 8px 4px; font-weight: 900; font-size: 15.5px; line-height: 1.3; }
.ai-tabs button small { display: block; font-size: 13px; font-weight: 700; color: #c4c8d2; }
.ai-tabs button[aria-pressed="true"] { background: var(--yel); color: #111; border-color: var(--yel); }
.ai-tabs button[aria-pressed="true"] small { color: #333; }
.ai textarea, .ai select { width: 100%; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; padding: 10px 12px; font-size: 16.5px; }
.ai select option { color: #111; }
.ai textarea { min-height: 92px; resize: vertical; }
.ai .hint { font-size: 14.5px; color: #c4c8d2; margin: 6px 0 0; }
.ai .ex-q { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.ai .ex-q button { border: 1px solid rgba(255, 255, 255, .22); background: none; color: #e6e8ee; border-radius: 999px; padding: 3px 10px; font-size: 14.5px; }
.ai .target { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 10px 12px; font-family: var(--en); font-size: 16.5px; line-height: 1.6; margin: 8px 0 0; max-height: 240px; overflow: auto; }
.ai .row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.ai .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }
.ai .btn.red { background: var(--red); border-color: var(--red); }
.ai .btn.yel { background: var(--yel); border-color: var(--yel); color: #111; }
.ai-out { margin: 12px 0 0; }

/* 結果 */
.res { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 14px; }
.res .sc { display: flex; align-items: baseline; gap: 6px; }
.res .sc b { font-family: var(--en); font-size: 40px; font-weight: 900; color: var(--g); line-height: 1; }
.res .sc span { font-family: var(--en); font-size: 19.5px; color: var(--sub); font-weight: 800; }
.res .sum { font-weight: 900; font-size: 17.5px; margin: 6px 0; }
.res h4 { margin: 10px 0 4px; font-size: 15.5px; color: var(--sub); }
.res ul { margin: 0; padding-left: 20px; font-size: 16.5px; }
.res .fx { font-size: 16.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.res .fx .b { color: var(--ng); text-decoration: line-through; font-family: var(--en); }
.res .fx .a { color: var(--ok); font-weight: 700; font-family: var(--en); }
.res .fx small { display: block; color: var(--sub); font-size: 14.5px; }
.res .better { font-family: var(--en); background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 16.5px; line-height: 1.6; }
.res .nx { margin: 10px 0 0; background: color-mix(in srgb, var(--red) 10%, var(--surface)); border-left: 4px solid var(--red); padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: 16.5px; }
.res .via { font-size: 14px; color: var(--faint); margin: 8px 0 0; }
.res .md p { margin: 0 0 6px; }
.diff { font-family: var(--en); font-size: 16.5px; line-height: 1.8; background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.diff .miss { color: var(--ng); text-decoration: underline wavy; font-weight: 700; }
.diff .hit { color: var(--ink); }
.meter-pct { font-family: var(--en); font-weight: 900; font-size: 30px; color: var(--g); }

/* モーダル（録音） */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(8, 9, 12, .72); display: grid; place-items: end center; padding: 0; }
@media (min-width: 640px) { .modal-back { place-items: center; padding: 16px; } }
.modal { width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; background: var(--paper); color: var(--ink); border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal { border-radius: 20px; } }
.modal-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.modal-h b { flex: 1; font-size: 17.5px; }
.modal-x { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 50%; font-size: 19.5px; }
.rec-stage { text-align: center; padding: 8px 0; }
.rec-tm { font-family: var(--en); font-size: 54px; font-weight: 900; color: var(--g); line-height: 1; font-variant-numeric: tabular-nums; }
.rec-btn { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 30px; margin: 12px auto; display: grid; place-items: center; box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 50%, transparent); }
.rec-btn.on { animation: ring 1.4s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
.rec-meter { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; max-width: 260px; margin: 0 auto; }
.rec-meter i { display: block; height: 100%; width: 0; background: var(--ok); }
.rec-l { font-size: 15.5px; color: var(--sub); margin: 8px 0 0; }
.rec-l.warn { color: var(--red); font-weight: 900; }
.modal textarea { width: 100%; min-height: 110px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 10px 12px; font-family: var(--en); font-size: 16.5px; }
.modal .qbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-family: var(--en); font-size: 16.5px; margin: 0 0 10px; }
.big-timer { position: fixed; inset: 0; z-index: 90; background: rgba(8, 9, 12, .92); color: #fff; display: grid; place-items: center; text-align: center; }
.big-timer b { display: block; font-family: var(--en); font-size: 26vw; line-height: 1; color: var(--yel); font-variant-numeric: tabular-nums; }
.big-timer.end b { color: var(--red2); }
.big-timer p { margin: 8px 0 18px; font-size: 17.5px; }

/* 80期 */
.k80-btn { position: fixed; left: 10px; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 10px); z-index: 45; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 900; box-shadow: var(--shadow); }
.k80-btn.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.k80-form input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 17.5px; background: var(--surface); }
.k80-msg { color: var(--ng); font-size: 15.5px; min-height: 1.4em; }

/* PDF */
.pdfs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.pdf { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 2px solid var(--blk); border-radius: 16px; padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: 4px 4px 0 var(--yel); }
:root[data-theme="dark"] .pdf { border-color: #3a3e49; }
.pdf .pi { flex: none; width: 46px; height: 58px; border-radius: 6px; background: var(--red); color: #fff; font-family: var(--en); font-weight: 900; font-size: 15px; display: grid; place-items: center; position: relative; }
.pdf .pi::after { content: ""; position: absolute; right: 0; top: 0; border: 7px solid transparent; border-right-color: var(--paper); border-top-color: var(--paper); }
.pdf b { display: block; font-size: 16.5px; line-height: 1.35; }
.pdf small { display: block; color: var(--sub); font-size: 14.5px; }
.pdf.main { border-color: var(--red); }

/* 下のドック */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); height: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
.dock a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-decoration: none; color: var(--sub); font-size: 11px; font-weight: 700; }
.dock a span { font-size: 19px; line-height: 1.1; }
.dock a.dock-ai { color: var(--red); }
@media (min-width: 900px) { .dock { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: 12px; border: 1px solid var(--line); border-radius: 18px; height: var(--dock-h); padding: 0; box-shadow: var(--shadow); } body { padding-bottom: 90px; } }

/* footer */
.foot { max-width: 860px; margin: 40px auto 0; padding: 20px 16px; border-top: 1px solid var(--line); font-size: 15.5px; color: var(--sub); }
.foot .credit { color: var(--ink); }
.foot .fine { font-size: 14.5px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 22px); transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 95; background: var(--blk); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 16px; font-weight: 700; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.link-big { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 26px 0 0; box-shadow: var(--shadow); }
.link-big img { width: 44px; height: 44px; flex: none; }
.link-big b { display: block; }
.link-big small { color: var(--sub); }

/* ---------- いちばん上：級を大きく選ぶ ---------- */
.gpick { margin: 14px 0 0; }
.gpick-q { margin: 0 0 8px; font-weight: 900; font-size: 18px; }
.gpick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gpick button { --c: var(--g2); display: grid; gap: 2px; justify-items: center; border: 3px solid color-mix(in srgb, var(--c) 35%, var(--line)); background: var(--surface); color: var(--c); border-radius: 18px; padding: 14px 4px 12px; line-height: 1.2; box-shadow: var(--shadow); transition: transform .12s; }
.gpick button b { font-size: clamp(24px, 7vw, 34px); font-weight: 900; }
.gpick button small { font-size: 13px; font-weight: 700; color: var(--sub); }
.gpick .gp-pre1 { --c: var(--gp); }
.gpick .gp-1kyu { --c: var(--g1); }
.gpick button[aria-pressed="true"] { background: var(--c); color: #fff; border-color: var(--c); transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 40%, transparent); }
.gpick button[aria-pressed="true"] small { color: rgba(255, 255, 255, .9); }
.gpick button[aria-pressed="true"]::after { content: "✓ 選択中"; font-size: 12px; font-weight: 900; margin-top: 2px; }

/* ---------- 章：見出しをタップで開く（1つずつ） ---------- */
.secs-hint { margin: 18px 0 8px; font-weight: 900; font-size: 16px; color: var(--sub); text-align: center; }
.secs { display: grid; gap: 10px; }
.sec { margin: 0; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.sec.open { border-color: var(--g); }
.sec-h { margin: 0; padding: 0 10px 0 0; gap: 6px; }
.sec-h h2 { margin: 0; flex: 1; min-width: 0; font-size: inherit; }
.sec-open { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: var(--ink); padding: 14px 6px 14px 14px; font: inherit; cursor: pointer; }
.sec-open .tt { flex: 1; min-width: 0; font-size: 20px; font-weight: 900; line-height: 1.3; }
.sec-open .tt small { display: block; font-size: 14px; font-weight: 700; color: var(--sub); }
.sec-open .chev { flex: none; width: 12px; height: 12px; border-right: 3px solid var(--sub); border-bottom: 3px solid var(--sub); transform: rotate(45deg); margin: -6px 6px 0 0; transition: transform .2s; }
.sec.open .sec-open .chev { transform: rotate(-135deg); margin-top: 6px; border-color: var(--g); }
.sec.open .sec-open { background: color-mix(in srgb, var(--g) 8%, transparent); }
.sec-b { padding: 4px 14px 16px; border-top: 1px solid var(--line); }
.sec-b[hidden] { display: none; }
.sec-c > :first-child { margin-top: 12px; }
.next-sec { display: block; width: 100%; margin: 18px 0 0; border: 0; border-radius: 14px; background: var(--g); color: #fff; font-weight: 900; font-size: 17px; padding: 14px 12px; line-height: 1.35; box-shadow: 0 4px 12px color-mix(in srgb, var(--g) 35%, transparent); }
@media (max-width: 420px) { .sec-b { padding: 4px 10px 14px; } .sec-open { gap: 10px; padding-left: 10px; } .sec-open .tt { font-size: 18.5px; } }
.sec-b .card { box-shadow: none; }
.sec-h .read { font-size: 12.5px; padding: 4px 8px; line-height: 1.2; white-space: nowrap; }
.sec-h .read[aria-pressed="true"] { color: var(--ok); border-color: var(--ok); }

/* ---------- AIの回数のルール ---------- */
.qstrip { position: relative; z-index: 1; display: grid; gap: 2px; margin-top: 14px; text-decoration: none; color: #111; background: var(--yel); border-radius: 14px; padding: 10px 14px; line-height: 1.35; }
.qstrip span { font-weight: 900; font-size: 16px; }
.qstrip b { font-size: 22px; color: var(--red); margin: 0 2px; }
.qstrip small { font-size: 13.5px; font-weight: 700; color: #333; }
.qrule { background: var(--surface); border: 3px solid var(--g); border-radius: 18px; padding: 14px 16px; margin: 12px 0 14px; }
.qr-now { margin: 0 0 10px; font-weight: 900; font-size: 18px; line-height: 1.4; }
.qr-now b { font-size: 30px; color: var(--red); margin: 0 3px; }
.qr-now small { display: block; font-size: 14.5px; color: var(--sub); }
.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr-i { display: grid; justify-items: center; gap: 2px; background: var(--soft); border-radius: 14px; padding: 10px 6px; }
.qr-i span { font-size: 15px; font-weight: 800; color: var(--sub); }
.qr-i b { font-size: 26px; font-weight: 900; line-height: 1.2; }
.qr-i.k8 { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.qr-i.k8 b { color: var(--ok); }
.qrule ul { margin: 12px 0 0; padding-left: 1.2em; font-size: 16px; line-height: 1.65; }
.qrule ul li + li { margin-top: 4px; }
.k8btn { display: block; width: 100%; margin-top: 12px; background: var(--ok); color: #fff; border: 0; font-size: 17px; font-weight: 900; padding: 13px 10px; border-radius: 14px; }
.qr-sp { margin: 0; background: var(--yel); color: #111; border-radius: 14px; padding: 10px 12px; font-size: 17px; font-weight: 800; text-align: center; }
.qr-sp b { font-size: 22px; color: var(--red); margin: 0 2px; }
.qr-ok { margin: 12px 0 0; font-weight: 900; color: var(--ok); font-size: 16px; }
.qr-ok[hidden], .k8btn[hidden] { display: none; }
.k80-btn { display: grid; justify-items: center; line-height: 1.2; font-size: 14.5px; padding: 7px 13px; border: 2px solid var(--ok); color: var(--ok); }
.k80-btn small { font-size: 11px; font-weight: 700; color: var(--sub); }
.k80-btn.on small { color: rgba(255, 255, 255, .9); }
