/* AIディレクターコース 共通スタイル
   配色: 紺 #0A1124 / 白地 / ティール #1FC8B9 / 金 #E8B04B
   スマホ最優先 */

:root {
  --navy: #0A1124;
  --teal: #1FC8B9;
  --gold: #E8B04B;
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --text: #1a2233;
  --muted: #6b7280;
  --border: #e3e7f0;
  --danger: #d64545;
  --ok: #1a9e6e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "游ゴシック体", YuGothic, "游ゴシック", "Yu Gothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  font-size: 16px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.site-header .brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.site-header .brand small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--teal);
  letter-spacing: 0.08em;
}
.site-header .student-chip {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.site-header .student-chip button {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 12px;
  margin-left: 6px;
  cursor: pointer;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ---------- コーストップ ---------- */
.course-hero { margin: 8px 0 20px; }
.course-hero h1 {
  color: var(--navy);
  font-size: 22px;
  line-height: 1.5;
}
.course-hero p.lead { color: var(--muted); font-size: 13px; margin-top: 6px; }

.progress-panel {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}
.progress-panel .progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 8px;
}
.progress-bar {
  height: 12px;
  background: #e0e5f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), #17a99c);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.progress-panel .progress-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- タブ ---------- */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab-btn.active { color: var(--navy); border-bottom-color: var(--teal); }

/* ---------- 実演一覧 ---------- */
.demo-lead { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.demo-list { display: flex; flex-direction: column; gap: 8px; }
.demo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}
a.demo-row:hover { box-shadow: 0 3px 12px rgba(10, 17, 36, 0.1); }
.demo-row .demo-num {
  font-weight: 700;
  color: var(--teal);
  font-size: 12px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.demo-row .demo-title { flex: 1; color: var(--navy); font-weight: 700; line-height: 1.5; }
.demo-row .demo-ch { font-size: 12px; color: var(--muted); white-space: nowrap; }
.demo-row.is-pending { background: var(--bg-soft); }
.demo-row.is-pending .demo-title { color: var(--muted); font-weight: 400; }

.chapter-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .chapter-grid { grid-template-columns: 1fr 1fr; } }

.chapter-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.chapter-card:not(.locked):hover {
  box-shadow: 0 4px 16px rgba(10, 17, 36, 0.12);
  transform: translateY(-1px);
}
.chapter-card .ch-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.1em;
}
.chapter-card h3 { color: var(--navy); font-size: 16px; margin: 2px 0 4px; line-height: 1.5; }
.chapter-card p.desc { font-size: 12px; color: var(--muted); line-height: 1.7; }
.chapter-card .status-badge { position: absolute; top: 14px; right: 14px; }
.chapter-card.locked { background: var(--bg-soft); opacity: 0.75; cursor: not-allowed; }
.chapter-card.locked h3 { color: var(--muted); }
.chapter-card .lock-note {
  font-size: 11px;
  color: var(--danger);
  margin-top: 6px;
  display: none;
}
.chapter-card.locked .lock-note { display: block; }

/* ---------- バッジ ---------- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.badge.b-none { background: #eceff5; color: var(--muted); }
.badge.b-doing { background: #fdf3dd; color: #9a7215; }
.badge.b-passed { background: #e0f7f2; color: var(--ok); }
.badge.b-locked { background: #eceff5; color: var(--muted); }

/* ---------- 章ページ ---------- */
.chapter-header {
  border-bottom: 3px solid var(--navy);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.chapter-header .ch-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.chapter-header .ch-num-big {
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.1em;
  font-size: 13px;
}
.chapter-header h1 { color: var(--navy); font-size: 24px; line-height: 1.5; }

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 28px;
  font-size: 14px;
}
.toc .toc-title { font-weight: 700; color: var(--navy); font-size: 13px; margin-bottom: 6px; }
.toc ol { margin-left: 20px; }
.toc a { color: var(--navy); text-decoration: none; }
.toc a:hover { color: var(--teal); }

section.ch-section { margin-bottom: 40px; }
section.ch-section h2 {
  color: var(--navy);
  font-size: 19px;
  line-height: 1.5;
  border-left: 5px solid var(--teal);
  padding-left: 12px;
  margin-bottom: 14px;
}
section.ch-section h3 { color: var(--navy); font-size: 16px; margin: 20px 0 8px; }
section.ch-section p { margin-bottom: 14px; }
section.ch-section ul { margin: 0 0 14px; padding-left: 1.5em; }
section.ch-section ol { margin: 0 0 14px; padding-left: 1.8em; }
section.ch-section li { margin: 0.4em 0; padding-left: 0.1em; }
section.ch-section li::marker { color: var(--navy); font-weight: 700; }
section.ch-section li > ul, section.ch-section li > ol { margin: 0.4em 0 0; }
section.ch-section strong { color: var(--navy); }

.point-line {
  background: var(--bg-soft);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-weight: 700;
  color: var(--navy);
}

/* 図カード（B案・紺 #0A1124）。横スクロールは廃止:
   収まらない図は縮小表示し、タップで全画面モーダル（course.jsが is-zoomable を付与） */
.mermaid-figure {
  position: relative;
  background: #0A1124;
  border: 1px solid #0A1124;
  border-radius: 14px;
  padding: 22px 16px 14px;
  margin: 28px 0;                 /* 本文段落(14px)の2倍 */
}
.mermaid-figure.is-zoomable { cursor: zoom-in; transition: box-shadow .15s, transform .15s; }
.mermaid-figure.is-zoomable:hover { box-shadow: 0 4px 18px rgba(10, 17, 36, .28); }
.mermaid-figure.is-zoomable:active { transform: scale(.997); }
/* 中心ズレ対策:
   mermaidはsvgに width="100%" 属性 ＋ インラインstyle max-width:<実寸>px を書き込む。
   svgはデフォルトで inline 扱いのため、親の text-align に左右され中央に来ない。
   → svgを display:block + margin:0 auto で中央に固定する。
   インラインの max-width（実寸）は上書きしないこと。
   !important で 100% にすると実寸の上限が外れ、
   さらに親をflexにするとsvg既定の300pxへ潰れる（実測で確認済み）。 */
.mermaid-figure .mermaid-canvas { overflow: hidden; }
/* 縮小率0.7で止めた図（figures.jsが is-tall を付与）: カード内スクロール */
.mermaid-figure .mermaid-canvas.is-tall {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
/* 横に広い図は本文カラムより少しはみ出させて、縮小率を稼ぐ */
@media (min-width: 900px) {
  .mermaid-figure { margin-left: -28px; margin-right: -28px; }
}
.mermaid-figure .mermaid { display: block; }
.mermaid-figure .mermaid svg {
  display: block !important;
  margin: 0 auto !important;
  height: auto !important;
}
/* ノードを「面」で見せる。
   mermaidは <style> を #<svgId> 付きで注入するためID詳細度で勝てない。
   !important で上書きする。ただし強調ノード(インラインstyleで3px)は
   :not([style*="stroke-width"]) で除外し、金枠3pxを潰さない。
   モーダル内はsvgを複製して置くだけなので、:is()で同じ指定を効かせる。 */
:is(.mermaid-figure, .fig-modal-svg) svg .node rect:not([style*="stroke-width"]),
:is(.mermaid-figure, .fig-modal-svg) svg .node polygon:not([style*="stroke-width"]),
:is(.mermaid-figure, .fig-modal-svg) svg .node circle:not([style*="stroke-width"]) { stroke-width: 2px !important; }
:is(.mermaid-figure, .fig-modal-svg) svg .node rect { rx: 10px !important; ry: 10px !important; }
:is(.mermaid-figure, .fig-modal-svg) svg .nodeLabel,
:is(.mermaid-figure, .fig-modal-svg) svg .nodeLabel * { font-size: 15px !important; font-weight: 600 !important; }
:is(.mermaid-figure, .fig-modal-svg) svg .edgeLabel,
:is(.mermaid-figure, .fig-modal-svg) svg .edgeLabel * { font-weight: 700 !important; font-size: 14px !important; }
/* スマホ幅は文字も一段小さく（mermaid設定と揃える。600px=2段階設定のブレークポイント） */
@media (max-width: 600px) {
  :is(.mermaid-figure, .fig-modal-svg) svg .nodeLabel,
  :is(.mermaid-figure, .fig-modal-svg) svg .nodeLabel * { font-size: 13px !important; }
  :is(.mermaid-figure, .fig-modal-svg) svg .edgeLabel,
  :is(.mermaid-figure, .fig-modal-svg) svg .edgeLabel * { font-size: 12px !important; }
}
/* 配置専用の不可視リンク（~~~）はインラインで stroke-width:0 が入る。
   2px化の対象から除外しないと線が復活してしまう */
:is(.mermaid-figure, .fig-modal-svg) svg .edgePath path.path:not([style*="stroke-width: 0"]),
:is(.mermaid-figure, .fig-modal-svg) svg .flowchart-link:not([style*="stroke-width: 0"]) { stroke-width: 2px !important; }
:is(.mermaid-figure, .fig-modal-svg) svg .flowchart-link[style*="stroke-width: 0"] { stroke: none !important; }
/* 紺カード上のグルーピング枠は白線・透過に */
.mermaid-figure .mermaid svg .cluster rect,
.fig-modal-svg svg .cluster rect { stroke: rgba(255, 255, 255, .55) !important; stroke-width: 1px !important; fill: transparent !important; rx: 12px !important; ry: 12px !important; }
.mermaid-figure .mermaid svg .cluster text,
.mermaid-figure .mermaid svg .cluster span,
.fig-modal-svg svg .cluster text,
.fig-modal-svg svg .cluster span { fill: #EAF0F8 !important; color: #EAF0F8 !important; }

/* キャプション: 金バッジ＋太字タイトル */
.mermaid-figure .fig-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #EAF0F8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.fig-caption .fig-badge,
.fig-modal-cap .fig-badge {
  flex: none;
  background: var(--gold);
  color: #0A1124;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  border-radius: 999px;
  padding: 3px 10px;
}
.fig-zoom-hint {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 11px;
  letter-spacing: .02em;
  color: #7f8ca6;
  pointer-events: none;
}

/* ---------- 図の全画面モーダル ---------- */
.fig-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px 12px 20px;
}
.fig-modal.open { display: flex; }
.fig-modal-backdrop { position: absolute; inset: 0; background: rgba(6, 10, 22, .88); }
.fig-modal-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 100%;
  overflow: auto;
  border-radius: 14px;
  padding: 20px 16px 14px;
  background: #0A1124;
  touch-action: pinch-zoom;      /* スマホのピンチズームを殺さない */
  -webkit-overflow-scrolling: touch;
}
.fig-modal-inner svg { display: block; margin: 0 auto; width: 100%; height: auto; max-width: none !important; }
.fig-modal-cap {
  margin-top: 14px;
  padding-top: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #EAF0F8;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
/* 閉じるボタンは .fig-modal 直下（スクロール外）で常時表示 */
.fig-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .10);
  color: #fff;
}
.fig-modal-close:hover { background: rgba(255, 255, 255, .20); }
body.fig-modal-open { overflow: hidden; }

/* ---------- 配布テンプレのカード ---------- */
.tpl-grid { display: grid; gap: 12px; margin: 16px 0 20px; }
.tpl-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 14px;
}
.tpl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tpl-num {
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 8px;
  flex: none;
  letter-spacing: .04em;
}
.tpl-name {
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  flex: 1 1 auto;
  min-width: 0;
}
.tpl-copy {
  flex: none;
  min-height: 44px;
  min-width: 84px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  color: #0d8a80;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.tpl-copy:hover { background: #e6faf7; }
.tpl-copy.copied { background: var(--teal); color: #fff; border-color: var(--teal); }
.tpl-copy.copy-fallback { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.tpl-body {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 12px 13px;
  font-family: "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 480px) {
  .tpl-head { flex-wrap: wrap; }
  .tpl-name { flex: 1 1 100%; order: 3; }
  .tpl-copy { margin-left: auto; }
  .tpl-body { font-size: 12.5px; }
}

/* ---------- テーブル・引用 ---------- */
.table-scroll { overflow-x: auto; margin: 16px 0; }
.table-scroll table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table-scroll th {
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}
.table-scroll td { border: 1px solid var(--border); padding: 8px 12px; }
.table-scroll tr:nth-child(even) td { background: var(--bg-soft); }
blockquote {
  border-left: 4px solid var(--border);
  padding: 4px 16px;
  color: var(--muted);
  margin: 16px 0;
}

/* ---------- 動画 ---------- */
.video-block { margin: 20px 0; }
.video-block .video-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.video-block video {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  background: #000;
  display: block;
}
.video-placeholder {
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 36px 16px;
  text-align: center;
}
.video-placeholder .vp-icon { font-size: 28px; margin-bottom: 8px; }
.video-placeholder .vp-title { font-weight: 700; font-size: 15px; }
.video-placeholder .vp-note { font-size: 12px; color: var(--teal); margin-top: 4px; }

/* ---------- ワーク ---------- */
.work-block {
  border: 2px solid var(--teal);
  border-radius: 12px;
  padding: 18px 16px;
  margin: 24px 0;
}
.work-block h2 {
  border: none;
  padding-left: 0;
  color: var(--navy);
  font-size: 18px;
  margin-bottom: 10px;
}
.work-block h2::before { content: "✍️ "; }
.work-submit {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}
.work-submit .ws-label { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.work-submit textarea {
  width: 100%;
  min-height: 130px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
}
.work-submit .ws-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.work-submit .ws-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 確認テスト ---------- */
.quiz-block {
  border: 2px solid var(--navy);
  border-radius: 12px;
  padding: 18px 16px;
  margin: 28px 0;
}
.quiz-block > h2 {
  border: none;
  padding-left: 0;
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 4px;
}
.quiz-block > h2::before { content: "📝 "; }
.quiz-block .quiz-rule { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.quiz-q {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.quiz-q .q-text { font-weight: 700; color: var(--navy); margin-bottom: 10px; font-size: 15px; }
.quiz-q .q-multi-note { font-size: 12px; color: var(--teal); font-weight: 700; }
.quiz-q label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.7;
}
.quiz-q label:has(input:checked) { border-color: var(--teal); background: #f0fbf9; }
.quiz-q input { margin-top: 5px; flex-shrink: 0; }
.quiz-q.q-correct label:has(input:checked) { border-color: var(--ok); background: #e0f7f2; }
.quiz-q.q-wrong label:has(input:checked) { border-color: var(--danger); background: #fdeeee; }
.quiz-q .q-feedback { font-size: 13px; font-weight: 700; margin-top: 4px; display: none; }
.quiz-q.q-correct .q-feedback.fb-ok { display: block; color: var(--ok); }
.quiz-q.q-wrong .q-feedback.fb-ng { display: block; color: var(--danger); }

.quiz-result {
  display: none;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
  text-align: center;
}
.quiz-result.show { display: block; }
.quiz-result.pass { background: #e0f7f2; border: 2px solid var(--ok); }
.quiz-result.fail { background: #fdeeee; border: 2px solid var(--danger); }
.quiz-result .qr-score { font-size: 22px; font-weight: 700; color: var(--navy); }
.quiz-result .qr-msg { font-size: 14px; margin-top: 6px; }
.quiz-result .qr-unlock {
  margin-top: 10px;
  font-weight: 700;
  color: var(--ok);
  font-size: 16px;
}
.quiz-actions { margin-top: 16px; text-align: center; }

/* ---------- ログインモーダル ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 36, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.login-overlay.show { display: flex; }
.login-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 22px;
  width: 100%;
  max-width: 380px;
}
.login-modal h2 { color: var(--navy); font-size: 18px; margin-bottom: 4px; }
.login-modal p.lm-lead { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.login-modal label { display: block; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.login-modal input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 14px;
}
.login-modal input:focus { outline: 2px solid var(--teal); border-color: transparent; }
.login-modal .lm-note {
  font-size: 12px;
  color: var(--muted);
  margin: -8px 0 14px;
  line-height: 1.6;
}
.login-modal .login-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: none;
}
.login-modal .login-error.show { display: block; }
.login-modal .btn { width: 100%; }

/* ---------- ロックガード（章直アクセス） ---------- */
.lock-guard {
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 36, 0.96);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 24px;
  text-align: center;
}
.lock-guard.show { display: flex; }
.lock-guard .lg-inner { max-width: 420px; }
.lock-guard .lg-icon { font-size: 40px; margin-bottom: 12px; }
.lock-guard h2 { font-size: 19px; margin-bottom: 10px; }
.lock-guard p { font-size: 14px; color: #c8cfdd; margin-bottom: 20px; }

/* ---------- フッターナビ ---------- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: #fff;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  z-index: 1100;
  transition: transform 0.3s ease;
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
