/* ==========================================================================
   学習会カリキュラム HTML 版 — 共通スタイル（デザインの正本）
   生成物（curriculum/html/**.html）はこのファイルを参照する。色・余白・部品はここで一括管理。
   デザインの叩き台は Claude Design のキャンバス（学習会カリキュラム デザイン）。2026-11-06 の改訂を反映。

   配色の方針: 暖色の生成りの地 + 深い青緑の主色。レベル色は色覚の型を問わず見分けられる 4 色
   （全員=無彩色 / 初心者=青 / 中級=橙 / 上級=赤紫。テンプレートは色を持たず文字で示す）。
   根拠と計算: docs/05_html-curriculum-ux-redesign.md §3（CIEDE2000・Machado 2009 で最小色差 ライト 11.9 / ダーク 11.8、
   どの色も背景・文字に対して 4.5:1 以上）。色の上に置く文字は --on-accent（ライトは白、ダークは #0F1412）。
   文字サイズは 12 / 14 / 15 / 16 / 20 / 24 / 36〜40 px に限定。影は使わず 1px の線で面を分ける。
   枠線は 1 階層まで（枠の中に枠を作らない）。
   ========================================================================== */

:root {
  --bg: #F6F4EE;
  --surface: #FFFFFF;
  --surface-2: #EEF0EA;
  --ink: #1B2420;
  --muted: #4A4E52;
  --line: #E2E4DD;
  --line-strong: #CBD0C7;
  --code-bg: #F0F2EE;
  --accent: #00785F;
  --accent-ink: #005C49;
  --accent-soft: #E8F3EE;
  --accent-2: #A64B00;
  --accent-2-soft: #FBF1E1;
  --good: #2E7D32;
  --warn: #A64B00;
  --warn-soft: #FBF1E1;
  --critical: #B3261E;
  --critical-soft: #FBEAE8;
  --lv-common: #383C40;
  --lv-beginner: #1F5BD6;
  --lv-intermediate: #A64B00;
  --lv-intermediate-ink: #A64B00;
  --lv-advanced: #8A1F6E;
  --lv-templates: #383C40;
  --on-badge: #FFFFFF;
  --on-accent: #FFFFFF;
  --track-empty: #7C8781;
  --radius: 14px;
  --radius-sm: 10px;
  --content: 70rem;
  --font-sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-head: "Zen Kaku Gothic New", var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Noto Sans Mono CJK JP", monospace;
  /* 文字サイズの段階 */
  --fs-12: .75rem;
  --fs-14: .875rem;
  --fs-15: .9375rem;
  --fs-16: 1rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1412; --surface: #171D1A; --surface-2: #1C241F; --ink: #E9EDE9; --muted: #B5BBC0;
    --line: #263029; --line-strong: #35423B; --code-bg: #1A211E;
    --accent: #3FBF96; --accent-ink: #6FD6B4; --accent-soft: #16332A;
    --accent-2: #F5B060; --accent-2-soft: #3A2E14;
    --good: #66BB6A; --warn: #F5B060; --warn-soft: #3A2E14; --critical: #E57373; --critical-soft: #3A1F1D;
    --lv-common: #B8BEC4; --lv-beginner: #8DB4FF; --lv-intermediate: #F5B060; --lv-intermediate-ink: #F5B060;
    --lv-advanced: #D77BC0; --lv-templates: #B8BEC4; --on-badge: #0F1412; --on-accent: #0F1412; --track-empty: #7C8781;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1412; --surface: #171D1A; --surface-2: #1C241F; --ink: #E9EDE9; --muted: #B5BBC0;
  --line: #263029; --line-strong: #35423B; --code-bg: #1A211E;
  --accent: #3FBF96; --accent-ink: #6FD6B4; --accent-soft: #16332A;
  --accent-2: #F5B060; --accent-2-soft: #3A2E14;
  --good: #66BB6A; --warn: #F5B060; --warn-soft: #3A2E14; --critical: #E57373; --critical-soft: #3A1F1D;
  --lv-common: #B8BEC4; --lv-beginner: #8DB4FF; --lv-intermediate: #F5B060; --lv-intermediate-ink: #F5B060;
  --lv-advanced: #D77BC0; --lv-templates: #B8BEC4; --on-badge: #0F1412; --on-accent: #0F1412; --track-empty: #7C8781;
}

/* 資料ページのレベル色（html[data-level] から下へ伝える） */
html[data-level="common"] { --level-color: var(--lv-common); --level-ink: var(--lv-common); }
html[data-level="beginner"] { --level-color: var(--lv-beginner); --level-ink: var(--lv-beginner); }
html[data-level="intermediate"] { --level-color: var(--lv-intermediate); --level-ink: var(--lv-intermediate-ink); }
html[data-level="advanced"] { --level-color: var(--lv-advanced); --level-ink: var(--lv-advanced); }
html[data-level="templates"] { --level-color: var(--lv-templates); --level-ink: var(--lv-templates); }

/* ---------- base ---------- */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
* { box-sizing: border-box; }
/* until-found はページ内検索で見つかるよう、display ではなくブラウザ既定の content-visibility で隠す */
[hidden]:not([hidden="until-found"]) { display: none !important; }
.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; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
/* 資料ページは固定ヘッダーが 2 段（目次ボタンと章の帯）なので、フォーカスやリンク先が隠れないよう広めに取る（WCAG 2.4.11） */
html[data-lesson] { scroll-padding-top: 136px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-15);
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { line-height: 1.35; text-wrap: balance; letter-spacing: -.005em; font-family: var(--font-head); }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); margin: 0; font-weight: 900; line-height: 1.3; }
h2 { font-size: var(--fs-24); font-weight: 700; margin: 0 0 .6em; }
h3 { font-size: var(--fs-16); font-weight: 800; margin: 1.9em 0 .6em; }
h4 { font-size: var(--fs-15); font-weight: 700; margin: 1.5em 0 .5em; color: var(--muted); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.5em; }
li { margin: .25em 0; }
li > ul, li > ol { margin: .3em 0 .3em; }
code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: .08em .4em;
}
pre { margin: 0; }
pre code { display: block; background: none; border: 0; padding: 0; font-size: .86rem; line-height: 1.7; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.muted { color: var(--muted); }
.wrap { max-width: var(--content); margin: 0 auto; padding: 0 1.5rem; }
.ico { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; flex-shrink: 0; }
.linklike {
  font: inherit; font-size: var(--fs-14); color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; text-align: left;
}
.linklike:hover { color: var(--accent); }

.skip-link {
  position: absolute; left: 0; top: 0; transform: translateY(-120%);
  background: var(--accent); color: var(--on-accent); padding: .6em 1em; z-index: 100; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; min-height: 60px; padding-top: .4rem; padding-bottom: .4rem; }
.site-header__inner > .topnav { margin-left: auto; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 700; white-space: nowrap; min-height: 44px; }
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-family: var(--font-head); font-weight: 900; font-size: var(--fs-15); letter-spacing: .02em;
}
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: var(--fs-14); color: var(--muted); min-width: 0; min-height: 44px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .brand { font-size: var(--fs-14); }
.crumb-level { color: var(--level-ink, var(--accent)); font-weight: 700; }
.breadcrumb a.crumb-level { color: var(--level-ink, var(--accent)); }
.crumb-sep { color: var(--line-strong); }
.crumb-current { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26rem; }
.site-header__actions { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.topnav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border-radius: 10px;
  font-size: var(--fs-14); font-weight: 500; text-decoration: none; color: var(--ink);
}
.topnav a:hover { background: var(--bg); color: var(--accent); }
.theme-toggle {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  width: 44px; height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-left: .5rem;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle__icon { width: 16px; height: 16px; border-radius: 50%; background: var(--ink); box-shadow: inset -5px -5px 0 0 var(--surface); }
:root[data-theme="dark"] .theme-toggle__icon { box-shadow: none; background: var(--accent-2); }

/* ---------- hero（資料ページ・ポータル共通の枠） ---------- */
.hero { border-bottom: 1px solid var(--line); background: var(--surface); }
.hero--lesson { background: color-mix(in srgb, var(--level-color, var(--accent)) 7%, var(--surface)); }
.hero__grid { display: flex; flex-wrap: wrap; gap: 2rem; padding-top: 2.4rem; padding-bottom: 2.2rem; align-items: flex-start; }
.hero__main { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: .8rem; }
.hero__meta { margin: 0; font-size: var(--fs-14); color: var(--muted); }
.hero__meta a { color: var(--muted); }
.hero__meta a:hover { color: var(--accent); }
.hero__lead { font-size: var(--fs-16); color: var(--muted); margin: 0; max-width: 32em; }
.eyebrow { margin: 0; font-size: var(--fs-12); font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.hero--index .hero__main { justify-content: center; align-self: stretch; }
.hero--index .hero__lead { max-width: 30em; }

.hero-side {
  flex: 1 1 320px; max-width: 420px; min-width: 0;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.summary__label { font-size: var(--fs-12); font-weight: 700; color: var(--level-ink, var(--accent)); }
.summary ol, .summary ul { margin: 0; padding-left: 1.3em; font-size: var(--fs-14); line-height: 1.6; display: flex; flex-direction: column; gap: .4em; }
.summary li { margin: 0; }
.summary .checklist { padding-left: 0; gap: .35em; }
.summary .check__text { font-size: var(--fs-14); }

/* この資料で分かること（3 行要約がある資料は折りたたみ） */
.objectives { margin: .2rem 0 0; }
.objectives > summary { cursor: pointer; font-size: var(--fs-14); font-weight: 700; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; gap: .4em; list-style: none; }
.objectives > summary::-webkit-details-marker { display: none; }
.objectives > summary::before { content: ""; width: .5em; height: .5em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; margin-right: .2em; }
.objectives[open] > summary::before { transform: rotate(45deg); }
.objectives > summary:hover { color: var(--accent); }
.objectives .checklist { margin: .2rem 0 0; max-width: 40em; }
.objectives .check__text { font-size: var(--fs-14); }

/* ---------- pills / buttons ---------- */
.badge, .tag {
  display: inline-flex; align-items: center; gap: .35em; font-size: var(--fs-12); font-weight: 700; line-height: 1;
  border-radius: 999px; padding: .42em .8em; white-space: nowrap;
}
.badge { color: var(--on-badge); background: var(--accent); }
.badge--common { background: var(--lv-common); }
.badge--beginner { background: var(--lv-beginner); }
.badge--intermediate { background: var(--lv-intermediate); }
.badge--advanced { background: var(--lv-advanced); }
.badge--templates { background: var(--lv-templates); }
.tag { color: var(--muted); border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
.tag--accent { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.tag--accent2 { color: var(--accent-2); border-color: var(--accent-2); background: var(--accent-2-soft); }
.tag--widget { color: var(--accent-2); border-color: var(--accent-2); background: transparent; font-weight: 700; }
.tag--sm { font-size: var(--fs-12); padding: .3em .6em; }

.btn {
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border-radius: 12px; padding: .7em 1.2em; min-height: 44px; border: 1px solid transparent; line-height: 1.2;
}
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg { padding: .85em 1.4em; font-size: var(--fs-16); }
.btn__sub { font-size: .78em; font-weight: 500; }
.btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* ---------- 開閉できる見出し（ポータルのレベル・進み方で共用） ---------- */
.disclosure { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.disclosure__head { margin: 0; font-size: inherit; }
.disclosure__toggle {
  font: inherit; width: 100%; display: flex; align-items: center; gap: .9rem; padding: .75rem 1.1rem; min-height: 64px;
  border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left;
}
.disclosure__toggle:hover { background: var(--bg); }
.disclosure__toggle:focus-visible { outline-offset: -2px; border-radius: var(--radius); }
.disclosure__chev { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; flex-shrink: 0; margin-left: auto; }
.disclosure__toggle[aria-expanded="true"] .disclosure__chev { transform: rotate(90deg); }
.disclosure__title { font-family: var(--font-head); font-size: var(--fs-16); font-weight: 700; line-height: 1.4; min-width: 0; }
.disclosure__meta { font-size: var(--fs-14); color: var(--muted); white-space: nowrap; font-weight: 400; }

/* ---------- lesson layout ---------- */
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 2.5rem; padding-top: 2.4rem; padding-bottom: 4.5rem; align-items: start; }
.lesson__body { min-width: 0; }
.lesson__rail { position: sticky; top: 76px; display: flex; flex-direction: column; gap: .9rem; max-height: calc(100vh - 90px); overflow: auto; padding-right: 2px; }
.sec { margin: 0 0 3rem; }
/* 移動先の余白は html の scroll-padding-top だけで取る（scroll-margin と足し算になるため重ねない） */
.sec h2 { margin-bottom: .6em; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .8rem; }
.sec-head h2 { margin: 0; }
.sec-head .muted { font-size: var(--fs-14); }
.h-widget { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem .8rem; }

.rail-card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .9rem .9rem; }
.rail-card__title { margin: 0 0 .4em; padding: 0 .6rem; font-size: var(--fs-12); font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.toc li { margin: 0; }
.toc a {
  display: flex; align-items: center; min-height: 36px; text-decoration: none; color: var(--ink); font-size: var(--fs-14); line-height: 1.5;
  padding: .45em .6rem; border-radius: 8px;
}
.toc a:hover { color: var(--accent); background: var(--bg); }
.toc a.is-active { color: var(--accent-ink); background: var(--accent-soft); font-weight: 700; }

/* ---------- content blocks ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-14); line-height: 1.6; }
th, td { text-align: left; vertical-align: top; padding: .6em .8em; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.code-scroll { position: relative; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--code-bg); overflow: hidden; }
.code-scroll pre { overflow-x: auto; padding: .9em 1em; }
.code-scroll.has-copy pre { padding-top: 2.1em; }
.code-copy {
  position: absolute; top: .45rem; right: .45rem; font: inherit; font-size: var(--fs-12); font-weight: 600;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .25em .6em; cursor: pointer;
}
.code-copy:hover { color: var(--accent); border-color: var(--accent); }
.code-copy.is-done { color: var(--good); border-color: var(--good); }
blockquote { margin: 0 0 1.3em; padding: .2em 1.1em; border-left: 3px solid var(--line-strong); color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }
.callout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1rem; align-items: start; margin: 0 0 1.3em; padding: .9em 1.1em; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
/* 見出しは折り返す（nowrap だと 320px で 19 ページが横にはみ出した。WCAG 1.4.10） */
.callout__label { font-size: var(--fs-12); font-weight: 700; border-radius: 999px; padding: .3em .75em; margin-top: .15em; justify-self: start; }
.callout__body { min-width: 0; font-size: var(--fs-15); }
.callout__body p { margin: 0 0 .5em; }
.callout__body p:last-child, .callout__body ul:last-child { margin-bottom: 0; }
.callout--tip { background: var(--accent-soft); border-color: transparent; }
.callout--tip .callout__label { background: var(--accent); color: var(--on-accent); }
.callout--warn { background: var(--warn-soft); border-color: transparent; }
.callout--warn .callout__label { background: var(--warn); color: var(--on-accent); }
/* 注意見出しの中のコードは、地の色を外して見出しの文字色にそろえる（白地のコード枠のままだと 1.12:1） */
.callout__label code { background: transparent; border-color: currentColor; color: inherit; }

/* checklist (objectives / exercise) */
.checklist { list-style: none; padding: 0; }
.checklist li { margin: .4em 0; }
.check { display: flex; align-items: flex-start; gap: .75em; cursor: pointer; min-height: 28px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.check__box {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: .3em; border-radius: 6px;
  border: 2px solid var(--line-strong); background: var(--surface); position: relative; transition: background .12s, border-color .12s;
}
.check__box::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .12s;
}
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check input:checked ~ .check__text { color: var(--muted); }
.check__text { min-width: 0; }
.check__text ul { margin: .3em 0 0; padding-left: 1.2em; }
.check input:disabled + .check__box { opacity: .6; }

.exercise { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .9rem 1.3rem; }
.exercise > ol, .exercise > ul { margin: 0; }
.exercise .checklist li { margin: 0; }
.exercise .check { min-height: 44px; align-items: flex-start; padding: .35em 0; }
.exercise p:last-child { margin-bottom: 0; }
.exercise__note { margin: .4rem 0 0; padding-left: 2.1rem; font-size: var(--fs-12); color: var(--muted); }

/* quiz（1 問ずつ出す） */
.quiz-set { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.quiz-set__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; }
.quiz-set__label { font-size: var(--fs-12); font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.quiz-set__step { font-size: var(--fs-14); font-weight: 700; color: var(--muted); }
.quiz { display: flex; flex-direction: column; gap: .7rem; }
.quiz__question { margin: 0; font-weight: 700; }
.quiz__no { display: inline-block; font-size: var(--fs-12); color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: .2em .7em; margin-right: .4em; vertical-align: .12em; }
.quiz__options { display: flex; flex-direction: column; gap: .5rem; }
.quiz__opt {
  font: inherit; text-align: left; cursor: pointer; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: .65em .9em; min-height: 44px; line-height: 1.6;
}
.quiz__opt:hover { border-color: var(--accent); }
.quiz__opt.is-correct { border-color: var(--good); background: var(--accent-soft); }
.quiz__opt.is-wrong { border-color: var(--critical); background: var(--critical-soft); }
.quiz.is-answered .quiz__opt { cursor: default; }
.quiz.is-answered .quiz__opt[data-correct="1"] { border-color: var(--good); }
.quiz__feedback { padding: .75em .95em; border-radius: 10px; font-size: var(--fs-14); border: 1px solid var(--line); background: var(--bg); }
.quiz__feedback.is-correct { border-color: var(--good); background: var(--accent-soft); }
.quiz__feedback.is-wrong { border-color: var(--critical); background: var(--critical-soft); }
.quiz-set__nav { display: flex; justify-content: flex-end; }
.quiz-set__result { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; }
.quiz-set__result > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.quiz-set__final { font-family: var(--font-head); font-size: var(--fs-20); font-weight: 700; }
.quiz-set__result .muted { font-size: var(--fs-14); }

/* widget */
.widget { margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.25rem; }
.widget__fallback { color: var(--muted); font-size: var(--fs-14); }
.widget.is-mounted .widget__fallback { display: none; }
.widget__head { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; flex-wrap: wrap; }
.widget__icon { display: inline-flex; width: 28px; height: 28px; border-radius: 8px; align-items: center; justify-content: center; background: var(--accent-2); color: var(--on-accent); flex-shrink: 0; }
.widget__icon .ico { width: 16px; height: 16px; }
.widget__title { font-family: var(--font-head); font-weight: 700; font-size: var(--fs-16); }
.widget__hint { font-size: var(--fs-12); color: var(--muted); }
.widget__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.widget .btn { min-height: 44px; padding: .5em 1em; font-size: var(--fs-14); }
.widget textarea, .widget input[type="text"], .widget input[type="search"], .widget input:not([type]), .widget input[type="number"], .widget select {
  font: inherit; font-size: var(--fs-14); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .55em .75em; width: 100%; min-height: 44px;
}
.widget textarea { resize: vertical; line-height: 1.6; min-height: 0; }
.widget input[type="range"] { width: 100%; accent-color: var(--accent); }
.widget label { font-size: var(--fs-12); font-weight: 700; }

/* done card */
.done-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1rem 1.3rem; }
.done-card.is-done { border-color: var(--accent); background: var(--accent-soft); }
.done-card__text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.done-card__text strong { font-size: var(--fs-16); }
.done-card__text span { font-size: var(--fs-14); color: var(--muted); }
.done-card.is-done .btn--primary { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* next list（次に読む） */
.sec--next h2 { font-size: var(--fs-16); color: var(--muted); margin-bottom: .3em; }
.next-list ul, .next-list ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.next-list li { margin: 0; font-size: var(--fs-14); min-height: 36px; display: flex; align-items: center; }
.next-list p { margin: 0 0 .4em; font-size: var(--fs-14); }

/* pager */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; align-items: stretch; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; color: var(--ink); }
.pager__prev, .pager__next { display: flex; flex-direction: column; gap: .1rem; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: .85em 1.1em; min-height: 44px; }
.pager__next { text-align: right; align-items: flex-end; border-color: var(--level-color, var(--accent)); }
.pager__prev:hover, .pager__next:hover { border-color: var(--accent); }
.pager__label { font-size: var(--fs-12); color: var(--muted); }
.pager__next .pager__label { color: var(--level-ink, var(--accent)); font-weight: 700; }
.pager strong { font-size: var(--fs-14); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding-top: 1.3rem; padding-bottom: 2.5rem; font-size: var(--fs-12); color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .linklike { min-height: 0; font-size: inherit; }

/* ==========================================================================
   ポータル
   ========================================================================== */
.page-sections { display: flex; flex-direction: column; gap: 3rem; padding-top: 2.6rem; padding-bottom: 4rem; }

/* ヒーロー右のカード: 進み具合 or 診断（html[data-hero] で切り替え。JS 無しは進み具合） */
.hero-card {
  flex: 1 1 380px; max-width: 460px; min-width: 0;
  border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
html[data-hero="diag"] [data-progress-card] { display: none; }
html:not([data-hero="diag"]) [data-diag-card] { display: none; }
.hero-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.hero-card__head h2 { margin: 0; font-size: var(--fs-16); font-family: var(--font-sans); }
.hero-card__head .muted { font-size: var(--fs-12); }
.hero-card__step { font-size: var(--fs-12); font-weight: 700; color: var(--muted); }
.progress-card__body { display: flex; align-items: center; gap: 1.25rem; }
.progress-card__text { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.progress-card__text strong { font-size: var(--fs-15); line-height: 1.5; }
.progress-card__text .muted { font-size: var(--fs-14); }
.ring { width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) var(--pct, 0%), var(--line) 0); }
.ring__inner { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring__inner strong { font-family: var(--font-head); font-size: var(--fs-20); }
.ring__inner span { font-size: var(--fs-12); color: var(--muted); }
.next-card { display: flex; align-items: center; justify-content: space-between; gap: .8rem; text-decoration: none; color: var(--on-accent);
  background: var(--accent); border-radius: 12px; padding: .75rem 1.1rem; min-height: 56px; }
.next-card:hover { background: var(--accent-ink); color: var(--on-accent); }
.next-card__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.next-card__label { font-size: var(--fs-12); }
.next-card strong { font-size: var(--fs-16); }
.next-card .ico { width: 20px; height: 20px; }

/* diagnosis（1 問ずつ） */
.diag__q { display: flex; flex-direction: column; gap: .75rem; }
.diag__q p { margin: 0; font-weight: 500; line-height: 1.6; }
.diag__opts { display: flex; flex-direction: column; gap: .5rem; }
.diag__opt { font: inherit; text-align: left; cursor: pointer; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .65em 1em; min-height: 48px; }
.diag__opt:hover { border-color: var(--accent); }
.diag__opt.is-selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.diag__result { display: flex; flex-direction: column; gap: .75rem; }
.diag__result-box { display: flex; flex-direction: column; gap: .1rem; padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid var(--diag-color, var(--accent)); background: color-mix(in srgb, var(--diag-color, var(--accent)) 9%, var(--surface)); }
.diag__result-label { font-size: var(--fs-12); font-weight: 700; color: var(--diag-color, var(--accent)); }
.diag__result-box strong { font-family: var(--font-head); font-size: var(--fs-20); line-height: 1.4; }
.diag__result-box .muted { font-size: var(--fs-14); }
.diag__result .btn { background: var(--diag-color, var(--accent)); border-color: var(--diag-color, var(--accent)); }
.diag__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.diag__skip { font-size: var(--fs-14); color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }

/* map */
.map .sec-head { margin-bottom: 1rem; }
.map__note { margin: -.4rem 0 1rem; font-size: var(--fs-14); color: var(--muted); }
.levels { display: flex; flex-direction: column; gap: .75rem; }
.level--common { --level-color: var(--lv-common); --level-ink: var(--lv-common); }
.level--beginner { --level-color: var(--lv-beginner); --level-ink: var(--lv-beginner); }
.level--intermediate { --level-color: var(--lv-intermediate); --level-ink: var(--lv-intermediate-ink); }
.level--advanced { --level-color: var(--lv-advanced); --level-ink: var(--lv-advanced); }
.level--templates { --level-color: var(--lv-templates); --level-ink: var(--lv-templates); }
.level__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--level-color); flex-shrink: 0; }
.level__no { width: 104px; flex-shrink: 0; font-size: var(--fs-12); font-weight: 700; color: var(--level-ink); }
.level__title { flex: 1 1 auto; }
.level__badge { min-width: 84px; text-align: right; font-size: var(--fs-14); font-weight: 700; color: var(--level-ink); white-space: nowrap; }
.level__badge.is-done { color: var(--accent-ink); }
.level__body { display: flex; flex-direction: column; }
.level__intro { margin: 0; padding: 0 1.1rem .6rem 2.75rem; font-size: var(--fs-14); color: var(--muted); }
.row { display: flex; align-items: center; gap: .9rem; min-height: 48px; padding: .4rem 1.1rem .4rem 2.75rem; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.row:hover { background: var(--bg); }
.row__no { width: 52px; flex-shrink: 0; font-size: var(--fs-12); color: var(--muted); }
.row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row__title { font-size: var(--fs-15); font-weight: 500; line-height: 1.5; }
.row__desc { display: none; font-size: var(--fs-12); color: var(--muted); line-height: 1.5; }
.row__time { font-size: var(--fs-12); color: var(--muted); white-space: nowrap; }
.row__state { min-width: 84px; display: flex; justify-content: flex-end; }
.row__state .row__badge { font-size: var(--fs-12); font-weight: 700; color: var(--muted); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.row.is-done .row__state .row__badge { color: var(--accent-ink); }
.row.is-done .row__title { color: var(--muted); }
.row.is-next { background: var(--accent-soft); }
.row.is-next .row__desc { display: block; }
.row.is-next .row__state .row__badge { background: var(--level-color); color: var(--on-badge); }
.row.is-next .row__title { font-weight: 700; }

/* 学習会の進み方・スライドとガイド */
.acc__body { display: flex; flex-direction: column; gap: .9rem; padding: 0 1.1rem 1.1rem; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.phase { display: flex; flex-direction: column; gap: .1rem; padding: .9rem 1rem; border-radius: 12px; background: var(--bg); --phase-color: var(--accent); }
.phase--intermediate { --phase-color: var(--lv-intermediate-ink); }
.phase--advanced { --phase-color: var(--lv-advanced); }
.phase--common { --phase-color: var(--lv-common); }
.phase__label { font-size: var(--fs-12); font-weight: 700; color: var(--phase-color); }
.phase strong { font-size: var(--fs-15); line-height: 1.5; }
.sessions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.session { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: .15rem 1.2rem; padding: .75rem 0; border-top: 1px solid var(--line); --session-color: var(--accent); }
.session--intermediate { --session-color: var(--lv-intermediate-ink); }
.session--advanced { --session-color: var(--lv-advanced); }
.session--common { --session-color: var(--lv-common); }
.session__label { font-size: var(--fs-12); font-weight: 700; color: var(--session-color); padding-top: .2em; }
.session__main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.session__title { font-size: var(--fs-15); }
.session__desc { font-size: var(--fs-14); color: var(--muted); }
.session__links { font-size: var(--fs-14); line-height: 1.8; }
.session__slide { font-weight: 700; }
.acc-note { margin: 0; font-size: var(--fs-14); color: var(--muted); }
.reslist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.reslist li { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: var(--fs-14); min-height: 44px; }
.reslist li:first-child { border-top: 0; }
.reslist .muted { font-size: var(--fs-12); }
.reslist__kind { font-size: var(--fs-12); font-weight: 700; color: var(--muted); min-width: 4.5em; }
.acc-sub { margin: .4rem 0 0; font-size: var(--fs-12); font-weight: 700; color: var(--muted); letter-spacing: .04em; }

/* ==========================================================================
   章の区切り（docs/05 §2 #2）・読み終えたとき（#4）・07 の絞り込み（#5）・保存（§4）
   ========================================================================== */
/* 固定ヘッダーの 2 段目: 目次ボタン + 章の帯 */
.chapbar { display: flex; align-items: center; gap: .9rem; padding-top: .1rem; padding-bottom: .5rem; }
.chap-btn {
  font: inherit; font-size: var(--fs-14); font-weight: 700; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; min-height: 44px; padding: 0 .9rem; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.chap-btn:hover, .chap-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); }
.chaptrack { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; }
/* 未読は白地に #7C8781 の枠（白地 3.72:1、WCAG 1.4.11）。読んだ章は塗る */
.chaptrack__seg { flex: 1 1 0; height: 10px; border-radius: 3px; background: var(--surface); border: 1px solid var(--track-empty); min-width: 0; }
.chaptrack__seg.is-read { background: var(--level-color, var(--accent)); border-color: var(--level-color, var(--accent)); }
.chaptrack__seg.is-current { border: 2px solid var(--level-color, var(--accent)); background: color-mix(in srgb, var(--level-color, var(--accent)) 35%, var(--surface)); }
.chap-panel { border-top: 1px solid var(--line); background: var(--surface); max-height: min(70vh, 34rem); overflow: auto; }
.chap-panel ol { list-style: none; margin: 0; padding: .5rem 0 .8rem; display: flex; flex-direction: column; gap: 2px; }
.chap-panel li { margin: 0; }
.chap-panel a {
  display: grid; grid-template-columns: 4.2em minmax(0, 1fr) auto; gap: .1rem .8rem; align-items: baseline;
  min-height: 44px; padding: .5em .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: var(--fs-14); line-height: 1.5;
}
.chap-panel a:hover { background: var(--bg); color: var(--accent-ink); }
.chap-panel a[aria-current] { background: var(--accent-soft); font-weight: 700; }
.chap-panel__no { color: var(--muted); font-size: var(--fs-12); font-weight: 700; }
.chap-panel__min { color: var(--muted); font-size: var(--fs-12); white-space: nowrap; }
.chap-panel__state { grid-column: 2 / -1; font-size: var(--fs-12); color: var(--accent-ink); font-weight: 700; }
.chap-panel__state:empty { display: none; }
.chap-panel a.is-read .chap-panel__no::before { content: "✓ "; color: var(--accent-ink); }

.chap-label { margin: 0 0 .5rem; font-size: var(--fs-12); font-weight: 700; color: var(--muted); }
.chap-label__no { color: var(--level-ink, var(--accent)); }
h3 + .chap-label, .chap-label + h3 { margin-top: 0; }
.chap-end {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  margin: 2rem 0 2.4rem; padding: .7rem 0 0; border-top: 2px dashed var(--line-strong);
}
.chap-end__text { font-size: var(--fs-14); font-weight: 700; color: var(--muted); }
.chap-end__note { flex-basis: 100%; margin: 0; font-size: var(--fs-14); }
.btn--sm { padding: .45em .9em; font-size: var(--fs-14); }

/* 本文の 1 行を読みやすい長さに（表・コード・部品は幅いっぱいのまま） */
.lesson__body .sec > :is(p, ul, ol, blockquote, h2, h3, h4, .callout, .chap-label) { max-width: 40em; }

/* 07: 使うサービスで絞る */
.svc-filter { margin: 0 0 2.4rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: .6rem; }
.svc-filter__label { margin: 0; font-weight: 700; font-size: var(--fs-15); }
.svc-filter__chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font: inherit; font-size: var(--fs-14); font-weight: 600; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 999px; min-height: 44px; padding: 0 1rem; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.svc-filter__note { margin: 0; font-size: var(--fs-14); color: var(--muted); }
.svc-filter__note:empty { display: none; }
tr.is-picked td { background: var(--accent-soft); font-weight: 700; }

/* 読み終えたら */
.sec--finish { display: flex; flex-direction: column; gap: 1.1rem; }
.sec--finish h2 { margin-bottom: 0; }
.recall { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.recall__q { margin: 0; }
.recall__label { font-size: var(--fs-12); font-weight: 700; color: var(--muted); }
.recall__text, .plan select, .plan input[type="text"] {
  font: inherit; font-size: var(--fs-15); color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: .55em .75em; min-height: 44px; max-width: 100%;
}
.recall__text { width: 100%; resize: vertical; line-height: 1.6; }
.recall__answer > summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); min-height: 44px; display: inline-flex; align-items: center; }
.recall__answer-label { margin: .2rem 0 .3rem; font-size: var(--fs-12); font-weight: 700; color: var(--muted); }
.recall__answer ol { margin: 0; font-size: var(--fs-14); }
.finish__next { align-self: flex-start; flex-direction: column; align-items: flex-start; text-align: left; }
.level-done { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent-soft); font-size: var(--fs-14); }
.level-done strong { font-size: var(--fs-16); }
.plan { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.plan__title { margin: 0; font-size: var(--fs-12); font-weight: 700; color: var(--muted); }
.plan__sentence { margin: 0; line-height: 2.2; }
.plan__custom { margin: 0; display: flex; flex-direction: column; gap: .3rem; font-size: var(--fs-14); }
.plan__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.plan__status { margin: 0; font-size: var(--fs-14); font-weight: 700; color: var(--accent-ink); }
.plan__status:empty { display: none; }
.plan__note { margin: 0; font-size: var(--fs-12); color: var(--muted); }
.finish__map { margin: 0; font-size: var(--fs-14); }

/* 通知（保存の失敗・コピー完了など） */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); z-index: 90; max-width: min(36rem, calc(100vw - 2rem));
  background: var(--ink); color: var(--bg); border-radius: 12px; padding: .75rem 1.1rem; font-size: var(--fs-14); line-height: 1.6;
  opacity: 0; transition: transform .2s, opacity .2s; pointer-events: none;
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; }
.toast:empty { display: none; }
.sr-status:empty { display: none; }
.sr-status { margin: 0; font-size: var(--fs-14); color: var(--accent-ink); font-weight: 700; overflow-wrap: anywhere; }

/* 部品が動かないとき */
.widget__error { color: var(--ink); border-left: 3px solid var(--warn); padding-left: .9rem; }
.widget__error p { margin: 0 0 .5em; }
.widget__error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }

/* ポータル: 次の一歩・再開・予定・印のつけ直し */
.next-card__action { font-size: var(--fs-14); font-weight: 700; margin-top: .15rem; }
.next-note, .plan-show { margin: -.4rem 0 0; font-size: var(--fs-14); color: var(--muted); }
.next-note:empty { display: none; }
.plan-show { color: var(--ink); padding: .55rem .8rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; margin: 0; }
.progress-card__links { display: flex; flex-wrap: wrap; gap: 0 1.2rem; margin-top: -.4rem; }
.resume { display: flex; flex-direction: column; gap: .3rem; padding: .8rem 1rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.resume p { margin: 0; font-size: var(--fs-14); }
.resume__when { font-weight: 700; }
.restore-entry { margin: 0; font-size: var(--fs-14); }
.restore__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.remark { display: flex; flex-direction: column; gap: .7rem; }
.remark__group { border: 0; margin: 0; padding: 0; }
.remark__group legend { font-size: var(--fs-14); font-weight: 700; padding: 0; margin-bottom: .2rem; }
.remark .checklist { margin: 0; }
.remark .check { min-height: 44px; align-items: center; }
.remark .check__box { margin-top: 0; }
.remark__status { margin: 0; font-size: var(--fs-14); font-weight: 700; color: var(--accent-ink); }
.remark__status:empty { display: none; }

/* 地図の印: ✓ 読了・半円 途中・丸 未読（形で区別し、色だけに頼らない） */
.state-ico { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--track-empty); background: var(--surface); flex-shrink: 0; position: relative; display: inline-block; }
.row.is-part .state-ico { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, var(--surface) 50%); }
.row.is-done .state-ico { border-color: var(--accent); background: var(--accent); }
.row.is-done .state-ico::after { content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.row__state { gap: .5rem; align-items: center; }
.row__badge:empty { display: none; }

/* 困ったとき・進み具合（全ページのフッター、同じ位置） */
.site-footer__inner { align-items: flex-start; }
.help, .progress-tools { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.help__title { margin: 0; font-size: var(--fs-14); font-weight: 700; color: var(--ink); font-family: var(--font-sans); }
.help__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.2rem; font-size: var(--fs-14); }
.help__list li { margin: 0; min-height: 44px; display: flex; align-items: center; }
.site-footer .help__list .linklike { min-height: 44px; font-size: var(--fs-14); }
.site-footer__meta { flex-basis: 100%; margin: .4rem 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .lesson { grid-template-columns: 1fr; gap: 1.5rem; }
  .lesson__rail { display: none; }
  .crumb-current { max-width: 14rem; }
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 1rem; }
  .site-header__inner { gap: 0 .5rem; }
  .site-header__inner > .topnav { order: 3; flex-basis: 100%; margin-left: -.6rem; }
  .topnav a { padding: 0 .6rem; }
  .theme-toggle { margin-left: 0; }
  .level__badge { font-size: var(--fs-12); }
  .crumb-current, .breadcrumb .crumb-sep:last-of-type { display: none; }
  .hero__grid { padding-top: 1.6rem; padding-bottom: 1.6rem; gap: 1.25rem; }
  .hero-card { padding: 1.1rem; }
  .pager { grid-template-columns: 1fr; }
  .pager__next { align-items: flex-start; text-align: left; }
  .callout { grid-template-columns: 1fr; gap: .4rem; }
  .disclosure__toggle { gap: .6rem; padding: .6rem .9rem; min-height: 56px; }
  .disclosure__meta, .level__badge:empty { display: none; }
  .level__no { width: auto; }
  .level__badge { min-width: 0; }
  .level__intro { padding: 0 .9rem .6rem .9rem; }
  .row { padding: .4rem .9rem; gap: .6rem; }
  .row__no { width: 28px; }
  .row__time { display: none; }
  .row__state { min-width: 0; }
  .phases { grid-template-columns: 1fr; }
  .session { grid-template-columns: 1fr; gap: .1rem; }
  .ring { width: 72px; height: 72px; }
  .ring__inner { width: 54px; height: 54px; }
  /* 表はカードにせず、先頭列（項目名）を固定して横にスクロールする */
  .table-scroll th:first-child, .table-scroll td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); max-width: 9em; box-shadow: 1px 0 0 var(--line); }
  .table-scroll th:first-child { background: var(--surface-2); }
  .table-scroll tr.is-picked td:first-child { background: var(--accent-soft); }
  .chapbar { gap: .6rem; }
  .chap-panel a { grid-template-columns: minmax(0, 1fr) auto; }
  .chap-panel__no { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .lesson__rail, .pager, .done-card, .topnav, .theme-toggle,
  .chap-end, .svc-filter, .sec--finish, .toast { display: none !important; }
  /* 07 で隠した章も印刷には出す */
  [hidden="until-found"] { display: block !important; content-visibility: visible !important; }
  .lesson { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; }
}
