/* アクチュアリー 第1次試験（個人用・合格ナビ共通）— 画面の見た目
   色は役割ごとに: --brand は操作と現在地、--ok / --ng は正誤、--warn は期限・注意。科目ごとの色（--sc）は小さな印にだけ使う。
   面は紙（--bg）と板（--surface）の 2 段。影は浮くもの（電卓・ダイアログ・トースト）にだけ付ける。
   画面幅: 〜599px スマホ／600〜1023px タブレット縦（下のタブバー）／1024〜1279px タブレット横（細いメニュー）／1280px〜 パソコン（広いメニュー）。
   色は明るい画面と暗い画面の 2 組（端末の設定に従う。設定画面で固定もできる）。文字の大きさは参考書・問題・解説の 3 段階（--rfs）。 */

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --field: #ffffff;
  --tile: #fcfcfa;
  --head: #faf9f6;
  --hover: #fbfaf8;
  --sunk: #eeece6;
  --ink: #181b20;
  --sub: #5b616b;
  --faint: #80868f;
  --line: #e4e1da;
  --line-strong: #d0ccc2;
  --brand: #1f3d63;
  --brand-hover: #18324f;
  --brand-ink: #ffffff;
  --brand-soft: #e8eef5;
  --brand-line: #c3d2e3;
  --ok: #1d7448;
  --ok-soft: #e5f1ea;
  --ng: #b2402e;
  --ng-soft: #f8e7e3;
  --warn: #9a6200;
  --warn-soft: #f6eedb;
  --warn-line: #e6cf9c;
  --warn-bg: #fffaf0;
  --lock-bg: #f6f8fb;
  --lock-line: #cfd8e3;
  --tabbar: rgba(255,255,255,.96);
  --pdfbg: #dcdad3;
  --calcscr: #eef0ea;
  --shadow: rgba(20,24,30,.18);
  /* 参考書（LaTeX）の配色 */
  --navy: #1f3a5a;
  --teal: #1f6f6b;
  --brick: #a2432f;
  --ochre: #9a6b12;
  --slate: #5a6878;
  --soft: #eef2f6;
  --b-youten: #eef2f7;
  --b-otoshi: #faf0ed;
  --b-kako: #faf5e9;
  --b-hosoku: #f5f4f0;
  --b-koushiki: #9cc3bf;
  --b-teigi: #b9c2cc;
  /* 重要度の札（白い文字が読める濃さ。暗い画面でも同じ） */
  --jS: #a2432f;
  --jA: #8f6310;
  --jB: #5a6878;
  /* 進み具合の濃淡（学習カレンダー・章ごとの正答率）。一つの色相の明→暗 */
  --q0: #ebe9e3;
  --q1: #c9d6e6;
  --q2: #93adcc;
  --q3: #5a80ad;
  --q4: #1f3d63;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side: 236px;
  --rail: 88px;
  --tabh: 60px;
  --rfs: 16px;
  color-scheme: light;
}
:root[data-fs="l"] { --rfs: 18px; }
:root[data-fs="xl"] { --rfs: 20px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171b; --surface: #1e2127; --field: #23272e; --tile: #22262c; --head: #22262c; --hover: #252a31; --sunk: #2a2f37;
    --ink: #e8e9ec; --sub: #a9aeb7; --faint: #8b919a; --line: #31363e; --line-strong: #464c56;
    --brand: #8fb5e3; --brand-hover: #a7c5ea; --brand-ink: #0f1a29; --brand-soft: #22324a; --brand-line: #3a5273;
    --ok: #63c290; --ok-soft: #1b3326; --ng: #f08f7d; --ng-soft: #3b231f; --warn: #e2b75c; --warn-soft: #3a3020;
    --warn-line: #6b5527; --warn-bg: #2a251a; --lock-bg: #1f2530; --lock-line: #37465a;
    --tabbar: rgba(30,33,39,.96); --pdfbg: #0f1114; --calcscr: #2a2f37; --shadow: rgba(0,0,0,.5);
    --navy: #a3c1e6; --teal: #72c7bf; --brick: #ec9c88; --ochre: #ddb562; --slate: #aab6c5; --soft: #232a34;
    --b-youten: #212a36; --b-otoshi: #33231f; --b-kako: #30291b; --b-hosoku: #24272c; --b-koushiki: #3d6b67; --b-teigi: #4a5563;
    --q0: #2a2f37; --q1: #2c4260; --q2: #3f6491; --q3: #6b93c4; --q4: #a7c5ea;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171b; --surface: #1e2127; --field: #23272e; --tile: #22262c; --head: #22262c; --hover: #252a31; --sunk: #2a2f37;
  --ink: #e8e9ec; --sub: #a9aeb7; --faint: #8b919a; --line: #31363e; --line-strong: #464c56;
  --brand: #8fb5e3; --brand-hover: #a7c5ea; --brand-ink: #0f1a29; --brand-soft: #22324a; --brand-line: #3a5273;
  --ok: #63c290; --ok-soft: #1b3326; --ng: #f08f7d; --ng-soft: #3b231f; --warn: #e2b75c; --warn-soft: #3a3020;
  --warn-line: #6b5527; --warn-bg: #2a251a; --lock-bg: #1f2530; --lock-line: #37465a;
  --tabbar: rgba(30,33,39,.96); --pdfbg: #0f1114; --calcscr: #2a2f37; --shadow: rgba(0,0,0,.5);
  --navy: #a3c1e6; --teal: #72c7bf; --brick: #ec9c88; --ochre: #ddb562; --slate: #aab6c5; --soft: #232a34;
  --b-youten: #212a36; --b-otoshi: #33231f; --b-kako: #30291b; --b-hosoku: #24272c; --b-koushiki: #3d6b67; --b-teigi: #4a5563;
  --q0: #2a2f37; --q1: #2c4260; --q2: #3f6491; --q3: #6b93c4; --q4: #a7c5ea;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.7 var(--font); -webkit-font-smoothing: antialiased; text-wrap: pretty;
}
a { color: var(--brand); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0; font-weight: 700; text-wrap: balance; word-break: auto-phrase; }
h1 { font-size: 24px; letter-spacing: .01em; }
h2 { font-size: 16px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
.nw { display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.sub { color: var(--sub); font-size: 14px; }
.note { font-size: 13px; color: var(--sub); }
a.note { color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 32px; min-width: 32px; }
a.note:hover { text-decoration: underline; }
.lead { color: var(--sub); max-width: 62em; }
.loading { color: var(--sub); padding: 32px 0; }
.empty { color: var(--sub); font-size: 14px; padding: 6px 0; margin: 0; }
.big { font-size: 32px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.warn-text { color: var(--warn); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.ic { width: 18px; height: 18px; flex: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sc, var(--faint)); flex: none; }

/* ---------- 骨組み ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
main:focus, main:focus-visible { outline: none; }
main { padding: 20px 16px calc(var(--tabh) + 32px + env(safe-area-inset-bottom)); outline: none; min-width: 0; container: main / inline-size; }
@media (min-width: 600px) { main { padding: 24px 24px calc(var(--tabh) + 36px + env(safe-area-inset-bottom)); } }
main > * + * { margin-top: 16px; }
main > .pagehead + .tabs, main > .subjswitch + .tabs, main > .pagehead + .subjswitch { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--tabh) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--tabbar); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--sub); text-decoration: none; font-size: 12px; background: none; border: 0; cursor: pointer; padding: 0; min-width: 0;
}
.tabbar .ic { width: 22px; height: 22px; }
.tabbar [aria-current="page"] { color: var(--brand); font-weight: 700; }
/* 演習・試験の画面はタブバーを隠して、問題と解答欄を広く使う（戻るは画面の上） */
body.focus .tabbar { display: none; }
body.focus main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* 1024px 以上: 左のメニュー（1279px までは細い列、1280px からは広い列） */
@media (min-width: 1024px) {
  .side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 10;
    padding: 14px 8px 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin;
  }
  .brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; min-width: 44px; padding: 0 0 10px; }
  .brand img { width: 32px; height: 32px; border-radius: 7px; flex: none; }
  .brand span { display: none; }
  .navlist { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .navlist a, .navbtn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border-radius: 10px;
    color: var(--sub); text-decoration: none; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25; border: 0; background: none; cursor: pointer;
  }
  .navlist a .ic, .navbtn .ic { width: 22px; height: 22px; }
  .navlist a:hover, .navbtn:hover { background: var(--sunk); color: var(--ink); }
  .navlist a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
  .navlist .nm { display: none; }
  .navlist .sh { display: block; }
  .navlist .cnt { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
  .navlist a.subj { min-height: 50px; gap: 1px; }
  .navlist a.subj .dot { width: 9px; height: 9px; }
  .navlist .grp { height: 1px; background: var(--line); margin: 8px 10px; font-size: 12px; text-indent: -9999px; overflow: hidden; }
  .navfoot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
  .syncline { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--faint); min-height: 24px; text-align: center; line-height: 1.3; }
  .syncline .stxt { display: none; }
  .syncline .syncdot { margin: 0; }
  .tabbar { display: none; }
  main, body.focus main { margin-left: var(--rail); padding: 28px 32px 56px; }
  #toast { left: calc(50% + var(--rail) / 2) !important; bottom: 28px !important; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .navlist .fullonly { display: none; } }
@media (min-width: 1280px) {
  .navlist .railonly { display: none; }
  .side { width: var(--side); padding: 20px 14px 16px; }
  .brand { justify-content: flex-start; padding: 2px 8px 18px; }
  .brand span { display: flex; flex-direction: column; line-height: 1.3; }
  .brand b { font-size: 15px; letter-spacing: .02em; }
  .brand small { font-size: 12px; color: var(--sub); font-weight: 600; }
  .navlist { gap: 1px; }
  .navlist a, .navbtn { flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 8px; font-size: 14px; font-weight: 500; text-align: left; }
  .navlist a .ic, .navbtn .ic { width: 18px; height: 18px; }
  .navlist a[aria-current="page"] { font-weight: 700; }
  .navlist a.subj { min-height: 38px; gap: 10px; }
  .navlist a .dot { margin: 0 5px; width: 8px; height: 8px; }
  .navlist .nm { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .navlist .sh { display: none; }
  .navlist .grp { height: auto; background: none; margin: 0; text-indent: 0; font-size: 12px; color: var(--faint); padding: 16px 10px 6px; letter-spacing: .06em; font-weight: 600; }
  .navfoot { padding-top: 12px; gap: 6px; }
  .syncline { justify-content: flex-start; padding: 0 10px; }
  .syncline .stxt { display: inline; }
  .syncline .syncdot { margin-right: 8px; }
  main, body.focus main { margin-left: var(--side); padding: 32px 40px 64px; }
  #toast { left: calc(50% + var(--side) / 2) !important; }
}
@media (min-width: 1600px) { main { padding-left: 56px; padding-right: 56px; } }

/* ---------- 見出し ---------- */
.pagehead { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.pagehead .grow { flex: 1; min-width: 220px; }
.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--sub); margin: 0 0 4px; font-weight: 500; }
.eyebrow a { color: var(--sub); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.eyebrow a:hover { color: var(--brand); text-decoration: underline; }
.eyebrow a::before { content: "‹"; font-size: 18px; margin-right: 6px; line-height: 1; }
.eyebrow .left { font-weight: 700; color: var(--ink); }
.left.soon, .cd.soon { color: var(--warn); }
.h1sub { font-weight: 500; color: var(--sub); font-size: .78em; margin-left: .6em; }
.crumb { font-size: 13px; margin: 0; color: var(--sub); }
.crumb a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* 科目の切り替え（メニューの無い幅だけ）と教材のタブ */
.subjswitch { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 0 16px; }
.subjswitch::-webkit-scrollbar { display: none; }
.subjswitch a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 17px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--sub); text-decoration: none; font-size: 13px; font-weight: 600;
}
.subjswitch a[aria-current="page"] { border-color: var(--ink); color: var(--ink); }
@media (min-width: 1024px) { .subjswitch { display: none; } }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-top: 14px !important; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  flex: none; display: flex; align-items: center; min-height: 44px; padding: 0 14px; margin-bottom: -1px;
  color: var(--sub); text-decoration: none; border: 0; background: none; font-size: 14px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs [aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
main > .tabs + * { margin-top: 20px; }

/* ---------- 部品 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
:where(.dash, .split, .stack, .home-main, .tiles, .readmain, .clist, .info-grid, .set-grid, .acol, .qcol) > .panel { margin: 0; }
.panel > h2 { margin-bottom: 12px; }
.panel > h2:last-child { margin-bottom: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .tablewrap { margin: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head.pad { padding: 18px 20px 0; margin-bottom: 8px; }
.panel.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.panel.lock { border-color: var(--lock-line); background: var(--lock-bg); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
details.panel > summary, details > summary { cursor: pointer; min-height: 32px; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.8px solid var(--sub); border-bottom: 1.8px solid var(--sub); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg); }
details[open] > summary { margin-bottom: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.panel > .row:not(:first-child), .panel > p + .row, .panel > .counts + .row { margin-top: 14px; }
.row.tight { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { border-color: var(--sub); }
.btn .ic { width: 16px; height: 16px; }
.btn.small, .btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { border-color: var(--ng); color: var(--ng); background: var(--surface); }
.btn.danger:hover { background: var(--ng-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); padding: 0 10px; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn:disabled { opacity: .4; cursor: default; }
.btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.linkbtn { background: none; border: 0; padding: 0; min-height: 32px; color: var(--brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.chip {
  min-height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--sub); cursor: pointer;
}
.chip:hover { border-color: var(--sub); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 0 7px; border-radius: 4px; background: var(--sunk); color: var(--sub); font-size: 12px; font-weight: 600; vertical-align: 1px; line-height: 1.7; white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; }
.tag.lock { background: var(--brand-soft); color: var(--brand); }
input[type="date"], input[type="number"], input[type="email"], input[type="search"], input:not([type]), select, textarea {
  font-size: 16px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); min-height: 40px; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238a8f97' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  width: auto; max-width: min(100%, 520px); text-overflow: ellipsis;
}
textarea { width: 100%; line-height: 1.6; }
label { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
label.chk { min-height: 32px; cursor: pointer; }
label.chk input { width: 18px; height: 18px; accent-color: var(--brand); }
label select, label input { min-width: 0; max-width: 100%; }
.row > label { max-width: 100%; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.kv dt { color: var(--sub); font-weight: 500; }
.kv dd { margin: 0; }

/* 表 */
.tablewrap { overflow-x: auto; margin: 8px 0 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
thead th { font-size: 12px; color: var(--sub); font-weight: 600; white-space: nowrap; background: var(--head); border-bottom-color: var(--line); letter-spacing: .02em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
table.list { width: 100%; }
table.nowrap td, table.nowrap th { white-space: nowrap; }
td > a { display: inline-flex; align-items: center; min-height: 32px; min-width: 32px; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.panel.flush th:first-child, .panel.flush td:first-child { padding-left: 20px; }
.panel.flush th:last-child, .panel.flush td:last-child { padding-right: 20px; }
.steps { padding-left: 1.4em; margin: 0; display: grid; gap: 4px; }

/* 進み具合のバー */
.bar { position: relative; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 3px; }
.bar > b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .45; }
.bar.score > i { background: var(--warn); }
.bar.ok > i { background: var(--ok); }
.bar.score.pass > i { background: var(--ok); }
.cellbar { display: grid; grid-template-columns: minmax(60px, 1fr) 4.5em; gap: 10px; align-items: center; min-width: 150px; }
.cellbar .num { font-size: 13px; color: var(--sub); text-align: right; }

/* ---------- ホーム・科目の概要 ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container main (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container main (min-width: 1000px) { .kpis { gap: 16px; } }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.kpi .k { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); font-weight: 600; }
.kpi .k .ic { width: 16px; height: 16px; color: var(--faint); }
.kpi .v { font-size: 38px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi .v small { font-size: 15px; font-weight: 600; margin-left: 3px; letter-spacing: 0; color: var(--sub); }
.kpi .bar { margin: 4px 0 2px; }
.kpi .s { font-size: 13px; color: var(--sub); margin: auto 0 0; line-height: 1.55; }
@container main (max-width: 899px) { .kpi { padding: 14px 16px 16px; } .kpi .v { font-size: 32px; } }
@container main (max-width: 599px) { .kpi { padding: 14px; } .kpi .v { font-size: 30px; } .kpi .k, .kpi .s { font-size: 12px; } }

/* ホームの下段：幅が足りれば 2 列。高さの近いパネルを同じ行に置く */
.dash { display: grid; gap: 16px; align-items: stretch; }
.dash > .wide { grid-column: 1 / -1; }
@container main (min-width: 700px) { .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.home-main { display: grid; gap: 16px; align-items: start; }
@container main (min-width: 900px) { .home-main { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.split { display: grid; gap: 16px; }
@container main (min-width: 700px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.split > .panel { display: flex; flex-direction: column; }
.split > .panel > .row:last-child { margin-top: auto; padding-top: 14px; }
.next .what { margin: 0; }
.today .nextline { margin: 8px 0 0; font-size: 14px; color: var(--sub); }
.today .nextline b { color: var(--ink); }
/* 検索と「今日の問題を解く」。見出しの横に収まらないときは 1 行を使い切る（検索欄が伸びる） */
.starter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 27em; justify-content: flex-end; max-width: 100%; }
.searchbox { display: flex; gap: 6px; align-items: center; flex: 1 1 12em; min-width: 0; }
.searchbox input { flex: 1; width: auto; min-width: 0; }
@container main (max-width: 560px) { .starter > .btn { flex: 1 1 100%; } .searchbox { max-width: none; } }
.resume { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.resume .grow { flex: 1; min-width: 12em; }
.resume .what { margin: 0; font-size: 14px; }
.resume .sub { font-size: 13px; }
.phase { border-color: var(--warn-line); background: var(--warn-bg); }
.phase h2 { color: var(--warn); }

/* 科目別の表（幅が狭いときは 1 科目ずつのまとまりに） */
.stable { container-type: inline-size; }
.srow {
  display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(84px, .9fr) minmax(90px, 1.2fr) minmax(90px, 1.2fr) 56px 44px;
  gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 56px;
}
a.srow:hover { background: var(--hover); }
.srow.shead { font-size: 12px; color: var(--sub); font-weight: 600; background: var(--head); min-height: 0; padding-top: 8px; padding-bottom: 8px; }
.srow .r { text-align: right; }
.sname { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.sdate { display: flex; flex-direction: column; line-height: 1.35; font-size: 14px; }
.sdate .left { font-size: 12px; color: var(--sub); font-weight: 600; }
.sprog { display: grid; grid-template-columns: 1fr 3em; gap: 10px; align-items: center; }
.sprog .num { font-size: 13px; text-align: right; color: var(--sub); }
.srow .lbl { display: none; }
.srow b { color: var(--ng); }
@container (max-width: 600px) {
  .srow.shead { display: none; }
  .srow { grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 14px 16px; }
  .sdate { flex-direction: row; justify-content: flex-end; gap: 8px; align-items: baseline; }
  .sprog { grid-template-columns: 3.4em 1fr 2.6em; gap: 8px; }
  .srow .lbl { display: inline; font-size: 12px; color: var(--sub); font-weight: 600; }
  .srow .r { display: flex; justify-content: space-between; gap: 8px; text-align: left; font-size: 14px; }
}

/* 今日やること（1 科目 1 行。狭いときは 2 段） */
.todo { list-style: none; margin: 0; padding: 0; container-type: inline-size; }
.todo li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; padding-top: 0; }
.todo li:last-child { padding-bottom: 0; }
.todo .nm, .sched .nm, .mocks .nm { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; min-height: 32px; }
.todo a.nm:hover, .sched a.nm:hover { color: var(--brand); }
.todo .what { font-size: 14px; color: var(--sub); margin: 0; min-width: 0; }
.todo .what p { margin: 0; }
.todo .what .min { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 4px; background: var(--sunk); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap; }
.todo .why { font-size: 12px; color: var(--faint); margin-top: 2px !important; line-height: 1.5; }
/* 計画の理由（使える時間・後回し・繰り越し） */
.planmsg { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.planmsg li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 12px; border-radius: 8px; background: var(--sunk); font-size: 13px; color: var(--sub); line-height: 1.6; }
.planmsg li.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--ink); }
.planmsg li > span { flex: 1 1 22em; min-width: 0; }
.planmsg b { color: var(--ink); }
label.inline { font-size: 13px; color: var(--sub); font-weight: 600; white-space: nowrap; }
label.inline select { font-size: 14px; min-height: 36px; }
.todo .what b { color: var(--ink); font-weight: 600; }
.todo .row { gap: 6px; justify-content: flex-end; }
@container (max-width: 760px) {
  .todo li { grid-template-columns: minmax(0, 1fr) auto; }
  .todo .what { grid-column: 1 / -1; grid-row: 2; padding-left: 16px; }
  .todo .row { grid-column: 2; grid-row: 1; }
}
@container (max-width: 380px) {
  .todo li { grid-template-columns: 1fr; }
  .todo .row { grid-column: 1; grid-row: 3; justify-content: flex-start; padding-left: 16px; }
}
.sched { list-style: none; margin: 0; padding: 0; }
.sched li { display: grid; grid-template-columns: 8.4em 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.sched li:first-child { border-top: 0; }
.sched .dt { font-size: 13px; display: flex; flex-direction: column; line-height: 1.35; }
.sched .dt small { color: var(--faint); font-size: 12px; }
.sched .nm { font-size: 14px; font-weight: 600; min-height: 32px; }
.sched .cd { font-size: 13px; font-weight: 700; color: var(--sub); }
.mocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mocks li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(80px, 1fr) 5em; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mocks li:first-child { border-top: 0; }
.mocks .nm { flex-wrap: wrap; gap: 0 8px; }
.mocks .nm small { font-weight: 500; color: var(--sub); font-size: 12px; flex-basis: 100%; padding-left: 16px; }
.mocks .pt { text-align: right; font-weight: 700; font-size: 18px; }
.mocks .pt small { font-size: 12px; color: var(--faint); font-weight: 500; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
.counts.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 420px) { .counts.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.counts > div { display: flex; flex-direction: column; min-width: 0; }
.counts b { font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.counts b.num { white-space: nowrap; }
@container (min-width: 860px) { .logwrap.two .counts b { font-size: 23px; } }
.counts b small { font-size: 13px; font-weight: 600; margin-left: 2px; color: var(--sub); }
.counts span { font-size: 12px; color: var(--sub); margin-top: 2px; }
.howto { font-size: 14px; }
.logwrap { display: grid; gap: 16px; container-type: inline-size; }
.logwrap > *, .dash > *, .duo > * { min-width: 0; }
@container (min-width: 860px) { .logwrap.two { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }

/* 得点の見込み */
.pred { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pred li { display: grid; grid-template-columns: minmax(6.5em, .9fr) minmax(80px, 1.6fr) 3.6em; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.pred li:first-child { border-top: 0; }
.pred .nm { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; min-height: 32px; min-width: 0; }
.pred .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pred .pt { text-align: right; font-weight: 700; font-size: 17px; }
.pred .pt small { font-size: 12px; color: var(--faint); font-weight: 500; }
.pred .hint { grid-column: 1 / -1; font-size: 12px; color: var(--sub); margin: -4px 0 0 16px; }
.gains { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.gains li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.gains li:first-child { border-top: 0; }
.gains a { color: var(--ink); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.gains a:hover { color: var(--brand); text-decoration: underline; }
.gains .num { color: var(--sub); font-size: 13px; white-space: nowrap; }
.gains li .note { font-size: 12px; }
/* 復習の見通し（7 日。縦の棒） */
.fcast { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.fcast li { display: grid; grid-template-rows: auto 72px auto; gap: 4px; justify-items: center; font-size: 12px; color: var(--sub); text-align: center; }
.fcast li:first-child { color: var(--ink); font-weight: 600; }
.fcast .num { font-size: 14px; font-weight: 600; color: var(--ink); }
.fcast .vbar { position: relative; width: 100%; max-width: 44px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.fcast .vbar i { position: absolute; inset: auto 0 0 0; background: var(--brand); }
/* 項目の多い一覧は、幅があれば 2 列 */
@container main (min-width: 820px) { .gains.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } .gains.cols li:nth-child(2) { border-top: 0; } }

/* 学習カレンダー（直近の週ごと。濃いほど多く解いた） */
/* 学習カレンダー：幅いっぱいに広げる（狭いときは横に送れて、最新の週を右端に見せる）。ホームで数字と横に並ぶときは 13px の升 */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-auto-columns: minmax(11px, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.heat i { display: block; width: 100%; aspect-ratio: 1; border-radius: 3px; background: var(--q0); }
@container (min-width: 860px) { .logwrap.two .heat { grid-auto-columns: 13px; max-width: calc(20 * 16px); } }
.heat i.l1 { background: var(--q1); } .heat i.l2 { background: var(--q2); } .heat i.l3 { background: var(--q3); } .heat i.l4 { background: var(--q4); }
.heat i.fut { background: transparent; }
.heat i.td { outline: 1.5px solid var(--ink); outline-offset: 0; }
.heatkey { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--sub); margin-top: 6px; }
.heatkey i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; background: var(--q0); }
.heatkey i.l1 { background: var(--q1); } .heatkey i.l2 { background: var(--q2); } .heatkey i.l3 { background: var(--q3); } .heatkey i.l4 { background: var(--q4); }

/* 章ごとの進み具合 */
table.chapters td.ch { min-width: 14em; }
table.chapters td.ch a { font-weight: 600; color: var(--ink); text-decoration: none; }
table.chapters td.ch a:hover { color: var(--brand); text-decoration: underline; }
table.chapters td.prog { width: 22%; }
table.chapters tr.locked td.ch a { color: var(--sub); }

/* ---------- 参考書 ---------- */
.toc { list-style: none; padding: 0; margin: 0; }
.toc li { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); min-height: 44px; padding: 4px 0; }
.toc li:first-child { border-top: 0; }
.toc li > a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.toc li > a:hover { color: var(--brand); text-decoration: underline; }
.toc .cnt { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--faint); white-space: nowrap; }
.toc .cnt .ic { width: 14px; height: 14px; color: var(--ok); }
.toc li.done .cnt { color: var(--ok); }
.toc .sub { margin-left: 8px; }
.tochead { font-size: 13px; color: var(--sub); margin: 18px 0 2px; letter-spacing: .04em; }
.tochead:first-of-type { margin-top: 0; }
.links { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; }
.links a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; text-decoration: none; font-weight: 600; }
.links a:hover { text-decoration: underline; }

.reader { display: grid; gap: 24px; justify-content: center; grid-template-columns: minmax(0, 860px); }
@container main (min-width: 980px) { .reader { grid-template-columns: minmax(0, 820px) 232px; gap: 36px; } }
.readmain { min-width: 0; display: grid; gap: 20px; align-content: start; }
.readside { display: none; }
@container main (min-width: 980px) {
  .readside { display: block; }
  .readbar .tocbtn { display: none; }
}
.readside .sticky { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.sidehead { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--sub); letter-spacing: .04em; margin: 0; }
.sidehead .num { color: var(--faint); font-weight: 600; }
.seclist { list-style: none; margin: 0; padding: 0; counter-reset: sec; }
.seclist li { counter-increment: sec; }
.seclist.static li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.seclist.static li:first-child { border-top: 0; }
.seclist.static li::before { content: counter(sec); flex: none; width: 1.6em; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.seclist.static .juyo { margin-left: auto; }
.upsell { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--lock-bg); border: 1px solid var(--lock-line); font-size: 13px; color: var(--ink); line-height: 1.6; }
.upsell .linkbtn { font-size: 13px; font-weight: 600; margin-left: 4px; }
.seclist a {
  display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; min-height: 32px; border-radius: 6px;
  color: var(--sub); text-decoration: none; font-size: 13px; line-height: 1.5;
}
.seclist a::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.seclist li.read a::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 10px no-repeat; }
.seclist a:hover { background: var(--sunk); color: var(--ink); }
.seclist li.cur a { color: var(--ink); font-weight: 700; background: var(--sunk); }
.seclist .bm { margin-left: auto; color: var(--ochre); flex: none; }
.seclist .bm .ic { width: 14px; height: 14px; }

/* 参考書の上に付いて回る帯：目次・今の節・読んだ位置・しおり・文字の大きさ */
.readbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  margin-left: -16px; margin-right: -16px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
@media (min-width: 600px) { .readbar { margin-left: -24px; margin-right: -24px; padding: 8px 24px; } }
@media (min-width: 1024px) { .readbar { margin-left: -32px; margin-right: -32px; padding: 10px 32px; } }
@media (min-width: 1280px) { .readbar { margin-left: -40px; margin-right: -40px; padding: 10px 40px; } }
.readbar .cur { flex: 1; min-width: 0; font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readbar .cur b { color: var(--ink); }
.readbar .prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.readbar .prog i { display: block; height: 100%; width: 0; background: var(--brand); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; min-height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.iconbtn:hover { border-color: var(--sub); }
.iconbtn[aria-pressed="true"] { color: var(--ochre); border-color: var(--ochre); background: var(--b-kako); }
.iconbtn .ic { width: 18px; height: 18px; }
@media (max-width: 599px) { .iconbtn .lb { display: none; } }

/* 目次の引き出し（狭い幅） */
.drawer-back { position: fixed; inset: 0; z-index: 55; background: rgba(20,24,30,.42); display: flex; justify-content: flex-end; }
.drawer { width: min(360px, 88vw); height: 100%; background: var(--surface); padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; box-shadow: -12px 0 32px var(--shadow); display: grid; gap: 10px; align-content: start; }
.drawer .dhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer .dhead h2 { font-size: 15px; }

.readmark { margin: 16px 0 28px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.readmark .btn { color: var(--sub); }
.readmark .btn[aria-pressed="false"] { border-style: dashed; }
.readmark .btn[aria-pressed="true"] { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.readmark .btn.go { color: var(--brand); border-style: solid; }
.chapq { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chapq h2 { margin: 0; }
.chapq p { margin: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager .pg { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); min-height: 44px; }
.pager .pg:hover { border-color: var(--line-strong); }
.pager .pg .sub { font-size: 12px; }
.pager .pg .t { font-weight: 600; font-size: 14px; }
.pager .pg.next { text-align: right; grid-column: 2; }
.pager .pg.none { visibility: hidden; border: 0; }
.row.pager { display: flex; justify-content: space-between; }

.book, .qbody, .kaitou, .official, .cardback { overflow-wrap: anywhere; }
.book { font-size: var(--rfs); line-height: 1.95; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 36px 28px; }
/* 狭い幅は枠を外して本文を広く（枠の中にさらに余白が入る二重の余白をやめる） */
@container main (max-width: 860px) { .book { border-left: 0; border-right: 0; border-radius: 0; margin-left: -16px; margin-right: -16px; padding: 4px 20px 20px; } }
@media (min-width: 600px) { @container main (max-width: 860px) { .book { margin-left: -24px; margin-right: -24px; padding: 4px 28px 24px; } } }
.book p { margin: 0 0 14px; }
.book h2 { font-size: 1.25em; color: var(--navy); border-bottom: 1.5px solid var(--navy); padding-bottom: 6px; margin: 36px 0 14px; scroll-margin-top: 72px; }
.book h3 { font-size: 1.06em; color: var(--teal); margin: 26px 0 10px; }
.book h4 { font-size: 1em; margin: 18px 0 8px; }
.readmark { margin: 16px 0 28px; display: flex; justify-content: flex-end; }
.readmark .btn { color: var(--sub); }
.readmark .btn[aria-pressed="false"] { border-style: dashed; }
.readmark .btn[aria-pressed="true"] { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.chapintro { color: var(--sub); border-left: 3px solid var(--line); padding-left: 14px; margin: 16px 0; }
.chapdata { background: var(--soft); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.chapdata dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; }
.chapdata dt { color: var(--navy); font-weight: 600; }
.chapdata dd { margin: 0; }
@media (max-width: 520px) { .chapdata dl { grid-template-columns: 1fr; } .chapdata dd { margin-bottom: 6px; } }
.youten, .koushiki, .teigi, .otoshiana, .kakomon, .hosoku, .reidai, .checklist {
  margin: 18px 0; padding: 14px 16px; border-radius: 6px; background: var(--surface);
}
.youten { background: var(--b-youten); border-left: 3px solid var(--navy); }
.koushiki { border: 1px solid var(--b-koushiki); }
.teigi { border: 1px solid var(--b-teigi); }
.otoshiana { background: var(--b-otoshi); border-left: 3px solid var(--brick); }
.kakomon { background: var(--b-kako); border-left: 3px solid var(--ochre); }
.hosoku { background: var(--b-hosoku); }
.reidai { border-top: 1.5px solid var(--teal); border-bottom: 1px solid var(--teal); border-radius: 0; padding-left: 0; padding-right: 0; }
.checklist { background: var(--soft); }
.boxtitle { font-weight: 700; margin: 0 0 6px; }
.youten > .boxtitle { color: var(--navy); }
.koushiki > .boxtitle { color: var(--teal); }
.otoshiana > .boxtitle { color: var(--brick); }
.kakomon > .boxtitle { color: var(--ochre); }
.reidai > .boxtitle { color: var(--teal); }
.kai { font-weight: 700; color: var(--teal); }
.pointline { margin: 10px 0; }
.pointline::before { content: "ここが要点　"; color: var(--teal); font-weight: 700; }
.seikai { font-weight: 700; margin: 0 0 10px; }
.seikai::before { content: "正解　"; color: var(--brick); }
.haiten::before { content: "配点　"; color: var(--slate); font-weight: 700; }
.fukushu::before { content: "復習先　"; color: var(--slate); font-weight: 700; }
.figcap { text-align: center; color: var(--sub); font-size: 14px; margin: 8px 0; }
figure { margin: 18px 0; text-align: center; }
figure > figcaption { color: var(--sub); font-size: 14px; }
img.fig { display: block; margin: 12px auto; max-width: 100%; height: auto; cursor: zoom-in; }
/* 図は黒い線の SVG なので、暗い画面では白い台に載せる */
:root[data-theme="dark"] img.fig { background: #fff; border-radius: 6px; padding: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.fig { background: #fff; border-radius: 6px; padding: 6px; } }
.center { text-align: center; }
.center .tablewrap, .table .tablewrap { display: flex; justify-content: safe center; }
.book table, .qbody table, .kaitou table { font-size: .94em; }
.book thead th, .qbody thead th, .kaitou thead th { background: none; color: var(--ink); font-size: 14px; border-bottom: 1.5px solid var(--ink); }
.book th, .book td, .qbody th, .qbody td, .kaitou th, .kaitou td { padding: 6px 10px; vertical-align: top; }
.book tbody tr:hover td, .qbody tbody tr:hover td, .kaitou tbody tr:hover td { background: none; }
.book tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.ku { display: inline-block; min-width: 3em; padding: 0 6px; border: 1px solid var(--navy); border-radius: 2px; text-align: center; line-height: 1.5; margin: 0 2px; }
.mathd, .katex-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 2px 0; }
.katex { font-size: 1.08em; }
dl { margin: 8px 0; }
dt { font-weight: 600; }
dd { margin-left: 2em; }
.shiwake, .tkanjou { display: flex; justify-content: center; }

/* ---------- 問題集 ---------- */
.filters { display: grid; gap: 10px; }
.filters h2 { margin: 0; }
.frow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.frow > .fl { font-size: 13px; color: var(--sub); font-weight: 600; width: 4em; flex: none; }
.juyo { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 0 6px; border-radius: 4px; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.7; vertical-align: 1px; white-space: nowrap; }
.juyo.jS { background: var(--jS); }
.juyo.jA { background: var(--jA); }
.juyo.jB { background: var(--jB); }
.unithead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.unithead h2 { margin: 0; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.plist li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; min-height: 44px; background: var(--tile); }
.plist li .linkbtn { text-decoration: none; font-weight: 600; color: var(--ink); }
.plist li .linkbtn:hover { color: var(--brand); text-decoration: underline; }
.plist li.dim { opacity: .45; }
.st { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 4px; background: var(--sunk); color: var(--sub); line-height: 1.7; }
.st-wrong { background: var(--ng-soft); color: var(--ng); }
.st-learning { background: var(--brand-soft); color: var(--brand); }
.st-master { background: var(--ok-soft); color: var(--ok); }
.plist .sub { font-size: 12px; }

/* ---------- 演習・模擬試験 ---------- */
body.focus main > * { max-width: 1320px; margin-left: auto; margin-right: auto; }
body.focus main > * + * { margin-top: 16px; }
.solvehead, .examhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.examhead h1 { font-size: 18px; margin: 0; }
.solvehead .crumb { font-size: 14px; }
.qtitle { font-size: 21px; margin: 4px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qmeta { font-size: 13px; color: var(--sub); margin: 0; }
.timer { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 8px; background: var(--sunk); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); font-size: 14px; }
.timer.warn, .timer.over { color: var(--ng); background: var(--ng-soft); }
.problem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; font-size: var(--rfs); line-height: 1.9; }
@media (max-width: 599px) { .problem { padding: 16px; } }
.choices { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 4px 18px; }
.choices.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choices.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.c1 { grid-template-columns: 1fr; }
@media (max-width: 600px) { .choices.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .choices.c2 { grid-template-columns: 1fr; } }
.choices li { display: flex; gap: 4px; min-width: 0; align-items: center; min-height: 34px; padding: 6px 8px; margin: 0 -8px; border-radius: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choices li:hover { background: var(--sunk); }
.choices li.sel { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.choices li.right { box-shadow: inset 0 0 0 2px var(--ok); }
.locked-q .choices li { cursor: default; }
.locked-q .choices li:hover { background: none; }
.locked-q .choices li.sel { background: var(--brand-soft); }
.choices .cl { flex: none; color: var(--slate); }
.choices .ct { min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.sheet { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
/* 問題（左）と解答欄・解説（右）。狭い幅は縦に並べ、解答欄を画面の下に付けておく */
.solve-grid { display: grid; gap: 16px; align-items: start; }
.qcol, .acol { min-width: 0; display: grid; gap: 14px; align-content: start; }
.acol .sheet { border: 0; margin: 0; padding: 0; }
.dock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 12px; }
.dock .row.actions { margin: 0; }
@container main (max-width: 979px) {
  .dock.live { position: sticky; bottom: 0; z-index: 12; max-height: 48vh; overflow-y: auto; box-shadow: 0 -8px 24px var(--shadow); border-radius: var(--radius) var(--radius) 0 0; margin-left: -16px; margin-right: -16px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@media (min-width: 600px) { @container main (max-width: 979px) { .dock.live { margin-left: -8px; margin-right: -8px; } } }
@container main (min-width: 980px) {
  .solve-grid { grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); }
  .acol { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
}
.kbdhint { font-size: 12px; color: var(--faint); margin: 0; }
@media (hover: none) { .kbdhint { display: none; } }
.sheet-h { font-size: 13px; color: var(--sub); letter-spacing: .04em; margin: 0 0 6px; }
.brow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.brow.active { background: var(--brand-soft); }
.brow .bl { cursor: pointer; }
.brow:last-child { border-bottom: 0; }
.bl { min-width: 3.4em; font-weight: 700; }
.bbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.bk { min-width: 40px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); font-size: 15px; cursor: pointer; transition: background-color .1s; }
.bk:hover { border-color: var(--sub); }
.bk[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.sheet.locked .bk { cursor: default; }
.bk.right { box-shadow: 0 0 0 2px var(--ok) inset; }
.brow.ok .bmark { color: var(--ok); font-weight: 700; }
.brow.ng .bmark { color: var(--ng); font-weight: 700; }
.verdict { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-size: 20px; font-weight: 700; padding: 14px 18px; border-radius: var(--radius); }
.verdict .sub { font-weight: 500; }
.verdict.ok { color: var(--ok); background: var(--ok-soft); }
.verdict.ng { color: var(--ng); background: var(--ng-soft); }
.after { display: grid; gap: 12px; }
.after > .row { margin: 0; }
.why .sub { margin-right: 4px; }
.kaitou { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: var(--radius); padding: 18px 24px; font-size: var(--rfs); line-height: 1.9; }
.kaitou > h2 { font-size: 15px; color: var(--navy); margin-bottom: 8px; }
@media (max-width: 599px) { .kaitou { padding: 16px; } }
.memo textarea { min-height: 64px; }
.memo label { width: 100%; font-size: 13px; color: var(--sub); font-weight: 600; }
pre.memo { white-space: pre-wrap; font: inherit; }
details.lead { margin: 0; color: var(--sub); font-size: 14px; }
details.lead > div { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; }
.qnav button { min-height: 36px; min-width: 64px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--sub); }
.qnav .done { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.qnav .flag { box-shadow: 0 0 0 2px var(--ochre) inset; }
.qnav .cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.result-score { display: flex; align-items: baseline; gap: 8px; }
.result-score .big small { font-size: 16px; color: var(--sub); font-weight: 600; }

/* ---------- 過去問の PDF ---------- */
.pdfbox { height: 70vh; overflow: auto; background: var(--pdfbg); border-radius: var(--radius); padding: 10px; --pdfw: 100%; }
.pdfbox.tall { height: calc(100vh - 280px); min-height: 440px; }
.pdfpage { position: relative; width: var(--pdfw); max-width: none; margin: 0 auto 10px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.pdfpage canvas { display: block; width: 100%; height: auto; }
.pdfpage .pno { position: absolute; right: 6px; top: 4px; font-size: 12px; color: var(--sub); background: rgba(255,255,255,.88); padding: 0 6px; border-radius: 4px; }
.pastwrap { display: grid; gap: 16px; }
@media (min-width: 1100px) { .pastwrap { grid-template-columns: 1fr 340px; align-items: start; } .pastwrap .pdfbox { height: calc(100vh - 180px); } }
body.focus main > .pastwrap { max-width: none; }
.jumps { gap: 6px; }
.jumps > .sub { font-size: 12px; font-weight: 700; width: 4em; flex: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar .grow { flex: 1; }
.viewer { display: grid; gap: 12px; }
@media (min-width: 1240px) { .viewer { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } .viewer .pdfbox.tall { height: calc(100vh - 210px); } }
.viewer .jumpcol { display: grid; gap: 14px; align-content: start; }
@media (min-width: 1240px) { .viewer .jumpcol { position: sticky; top: 24px; } .viewer .jumpcol .jumps { flex-direction: row; } }
.jumpcol .panel { padding: 14px 16px; }
.jumpcol h2 { font-size: 13px; color: var(--sub); margin-bottom: 8px; letter-spacing: .04em; }
table.past td { white-space: nowrap; }
.pjump input { width: 5.5em; }

/* ---------- 電卓 ---------- */
.calc {
  position: fixed; z-index: 40; right: 12px; bottom: calc(var(--tabh) + 12px + env(safe-area-inset-bottom));
  width: 272px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 12px 32px var(--shadow); padding: 12px;
}
@media (min-width: 1024px) { .calc { bottom: 20px; right: 20px; } }
body.focus .calc { bottom: calc(12px + env(safe-area-inset-bottom)); }
.calc[hidden] { display: none; }
.chead { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--sub); margin-bottom: 8px; font-weight: 600; }
.cscreen { display: flex; justify-content: space-between; align-items: baseline; background: var(--calcscr); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.cind { font-size: 12px; color: var(--sub); min-width: 2em; }
.cdisp { font: 600 24px/1.3 var(--mono); overflow: hidden; text-overflow: ellipsis; }
.ckeys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ck { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); font-size: 17px; cursor: pointer; }
.ck:hover { border-color: var(--line-strong); }
.ck.op { background: var(--sunk); }

/* ---------- ダイアログ・通知・拡大 ---------- */
.dlg-back, .zoom { position: fixed; inset: 0; z-index: 60; background: rgba(20,24,30,.42); display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--surface); border-radius: 14px; padding: 22px; max-width: 420px; width: 100%; box-shadow: 0 16px 48px var(--shadow); }
.dlg .row { justify-content: flex-end; margin-top: 16px; }
.zoom { background: rgba(20,24,30,.8); }
.zoomin { max-width: 100%; max-height: 100%; overflow: auto; background: #fff; border-radius: 10px; padding: 12px; }
.zoomin img { display: block; width: min(1400px, 200vw); max-width: none; height: auto; }
.zoom .close { position: fixed; top: 12px; right: 12px; min-height: 44px; min-width: 44px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.syncdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #bbb; margin-right: 8px; flex: none; }
.syncdot.ok { background: var(--ok); }
.syncdot.err { background: var(--ng); }
.syncdot.busy { background: var(--ochre); }
.qr-box { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 640px) { .qr-box { grid-template-columns: 200px 1fr; align-items: start; } }
.qr svg { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- 試験情報・設定 ---------- */
.info-grid, .set-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1100px) { .info-grid, .set-grid { grid-template-columns: 1fr 1fr; } }
.info-grid > .wide, .set-grid > .wide { grid-column: 1 / -1; }
.panel ul.facts { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.official { font-size: 15px; line-height: 1.85; }
.official h2 { font-size: 17px; color: var(--navy); margin: 22px 0 8px; }
.official em { font-style: normal; font-weight: 600; }
.official .tablewrap td, .official .tablewrap th { vertical-align: top; }
.subjset { display: grid; gap: 0; }
.subjset .srow2 { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.subjset .srow2:first-child { border-top: 0; }
.subjset .nm { display: flex; align-items: center; gap: 10px; font-weight: 600; }
@media (max-width: 480px) { .subjset .srow2 { grid-template-columns: 1fr auto; } .subjset .srow2 input[type="date"] { grid-column: 1 / -1; } }

/* ---------- 公開版 ---------- */
.code { font: 600 15px/1.4 var(--mono); background: var(--sunk); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.pdfframe { width: 100%; height: 100%; min-height: 70vh; border: 0; background: var(--surface); border-radius: 6px; }
.pdfbox.pdflink { height: auto; min-height: 0; background: var(--surface); border: 1px solid var(--line); }
.pdfout { padding: 10px 8px; }
.seo-intro { max-width: 760px; }
html.pw-bar-on .tabbar { bottom: 0; }
@media (min-width: 1024px) { html .pw-bar { left: calc(var(--rail) + 24px); right: 24px; bottom: 20px; } }
@media (min-width: 1280px) { html .pw-bar { left: calc(var(--side) + 24px); } }
.viewer > .stack:only-child { grid-column: 1 / -1; }
.btn.big { min-height: 48px; padding: 0 24px; font-size: 15px; }
.after { grid-template-columns: minmax(0, 1fr); }
.after > *, .readmain > *, .stack > *, .home-main > *, .split > * { min-width: 0; }
.panel > .row + p, .panel > div + p { margin-top: 10px; }

/* ---------- 過去問の一覧（年度のカード）・左右に並べて読む ---------- */
.years { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.yc { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tile); }
.yc .yh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.yc .yh b { font-size: 18px; }
.yc .yh .sub { font-size: 12px; }
.yc .sc { font-size: 13px; font-weight: 700; color: var(--sub); white-space: nowrap; }
.yc .sc.pass { color: var(--ok); }
.yc .row { gap: 6px; }
.yc .notes { font-size: 12px; margin: 0; }
.yc .notes a { display: inline-flex; min-height: 32px; align-items: center; }
details.more > summary { margin-top: 6px; }
.dualpdf { display: grid; gap: 12px; }
@container main (min-width: 900px) { .dualpdf.on { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dualpdf .pane { display: grid; gap: 6px; min-width: 0; }
.dualpdf .pane > .note { margin: 0; font-weight: 600; }
.viewer.wide { grid-template-columns: minmax(0, 1fr) !important; }
.viewer.wide .jumpcol { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- 学習ツール（入口）・公式カード・弱点ノート・分析・計画・検索・当日の準備 ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; min-height: 92px; }
.tile:hover { border-color: var(--line-strong); background: var(--hover); }
.tile .ic { width: 22px; height: 22px; color: var(--brand); grid-row: span 2; margin-top: 2px; }
.tile b { font-size: 15px; }
.tile span { font-size: 13px; color: var(--sub); line-height: 1.5; }
.tile .badge { justify-self: start; }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ng { background: var(--ng-soft); color: var(--ng); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; border-left: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--sub); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 公式カード */
.fcard { display: grid; gap: 14px; }
.cardface { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; min-height: 220px; display: grid; gap: 12px; align-content: start; }
.cardface .kind { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--sub); }
.cardface h2 { font-size: 20px; }
.cardface .from { font-size: 13px; color: var(--sub); margin: 0; }
.cardback { border-top: 1px dashed var(--line-strong); padding-top: 14px; font-size: var(--rfs); line-height: 1.9; }
.cardback > .boxtitle { display: none; }
.cardrate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cardrate .btn { min-height: 48px; flex-direction: column; gap: 0; white-space: normal; }
.cardrate .btn small { font-size: 12px; font-weight: 500; color: inherit; opacity: .8; }
.cardrate .ng { border-color: var(--ng); color: var(--ng); }
.cardrate .ok { border-color: var(--ok); color: var(--ok); }
.k-koushiki { color: var(--teal); } .k-teigi { color: var(--slate); } .k-youten { color: var(--navy); } .k-otoshiana { color: var(--brick); }
.clist { display: grid; gap: 12px; }
.clist .cbox { margin: 12px 0 0; }
.clist h3 { margin: 10px 0 0; font-size: 14px; color: var(--sub); }

/* 弱点ノート・分析・計画の表 */
.whys { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.whys li { display: grid; grid-template-columns: minmax(8em, 1fr) minmax(60px, 2fr) 2.6em auto; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.whys li:first-child { border-top: 0; }
.whys .num { text-align: right; font-weight: 700; }
.nlist { list-style: none; margin: 0; padding: 0; }
.nlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.nlist li:first-child { border-top: 0; }
.nlist .t { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nlist .m { grid-column: 1 / -1; font-size: 13px; color: var(--sub); margin: 0; }
.heattable { width: 100%; }
.heattable td.hc { padding: 0; min-width: 34px; height: 34px; text-align: center; font-size: 12px; font-weight: 600; border: 2px solid var(--surface); border-radius: 6px; }
.heattable td.hc a { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 32px; color: inherit; text-decoration: none; }
.hc.l0 { background: var(--q0); color: var(--faint); } .hc.l1 { background: var(--q1); color: var(--ink); } .hc.l2 { background: var(--q2); color: var(--ink); }
.hc.l3 { background: var(--q3); color: #fff; } .hc.l4 { background: var(--q4); color: var(--surface); }
.hc.na { background: transparent; }
.spark { width: 100%; height: auto; display: block; }
.spark .base { stroke: var(--line); stroke-width: 1; }
.spark .pass { stroke: var(--ok); stroke-width: 1; stroke-dasharray: 3 3; }
.spark .ln { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .pt { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.sparks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sparks > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; }
.sparks .h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; }
.plan td { vertical-align: top; min-width: 9em; font-size: 13px; }
.plan td.wk { white-space: nowrap; font-weight: 600; min-width: 0; }
.plan tr.now td { background: var(--brand-soft); }
.plan .ex { color: var(--warn); font-weight: 700; }
.plan .fin { color: var(--teal); font-weight: 600; }

/* 検索 */
.sform { display: flex; gap: 8px; flex-wrap: wrap; }
.sform input { flex: 1; min-width: 12em; }
.hits { list-style: none; margin: 0; padding: 0; }
.hits li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.hits li:first-child { border-top: 0; }
.hits a, .hits .linkbtn { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; text-align: left; }
.hits .snip { font-size: 13px; color: var(--sub); margin: 0; }
.hits mark { background: var(--warn-soft); color: var(--ink); border-radius: 2px; padding: 0 1px; }

/* 試験当日の準備 */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; min-height: 44px; cursor: pointer; flex-wrap: nowrap; }
.checks input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--ok); }
.checks .d { display: block; font-size: 13px; color: var(--sub); }
.checks input:checked + span > b { text-decoration: line-through; color: var(--sub); }
/* ホームの 2 列：列ごとに縦に積む（高さの違うパネルを横に並べて、片方に空白ができないように） */
.duo { display: grid; gap: 16px; align-items: start; }
@container main (min-width: 700px) { .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.predbox { display: grid; gap: 16px 32px; }
@container main (min-width: 760px) { .predbox { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } }
