/* ============================================================
   中学理科テキスト 共通スタイル
   - 画面用 + 印刷用 (@media print)
   - 4分野: 物理(青) / 化学(赤) / 生物(緑) / 地学(橙)
   - 試作プロト: 化学Unit1「物質の見分け方」
   ============================================================ */

:root {
  --c-bg: #fbfaf6;
  --c-paper: #ffffff;
  --c-ink: #222;
  --c-sub: #555;
  --c-line: #d8d3c4;

  /* 共通アクセント（後で分野色で上書き） */
  --c-accent: #c0392b;
  --c-accent-light: #fdecea;
  --c-accent-dark: #922b21;

  /* 4分野カラー */
  --c-phys: #2c6fbb;   --c-phys-light: #e7f0fa;
  --c-chem: #c0392b;   --c-chem-light: #fdecea;
  --c-bio:  #2a7a3a;   --c-bio-light:  #e7f5ea;
  --c-earth:#d97706;   --c-earth-light:#fdf3e2;

  --c-warn: #b94a48;
  --c-ok:   #2a7a3a;
  --c-note: #e0bb1f;

  --font-jp: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-en: "Georgia", "Times New Roman", serif;
}

/* 化学ページ専用：アクセントを赤に */
body.subject-chem { --c-accent: var(--c-chem); --c-accent-light: var(--c-chem-light); }
body.subject-phys { --c-accent: var(--c-phys); --c-accent-light: var(--c-phys-light); }
body.subject-bio  { --c-accent: var(--c-bio);  --c-accent-light: var(--c-bio-light); }
body.subject-earth{ --c-accent: var(--c-earth);--c-accent-light: var(--c-earth-light); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-jp);
  line-height: 1.8;
  font-size: 16px;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 28px 100px;
  background: var(--c-paper);
  min-height: 100vh;
  box-shadow: 0 0 24px rgba(0,0,0,.05);
}

/* ---------- ナビ ---------- */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--c-line);
  padding-bottom: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}
.top-nav .home-link {
  color: var(--c-accent);
  text-decoration: none;
  font-weight: bold;
}
.top-nav .home-link:hover { text-decoration: underline; }
.subject-badge {
  background: var(--c-accent);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

h1.book-title { font-size: 28px; margin: 0 0 8px; letter-spacing: 1px; }
.book-sub { color: var(--c-sub); margin-top: 0; }

/* ---------- 目次 ---------- */
.toc {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin: 24px 0 40px;
}
.toc li a {
  display: block;
  padding: 14px 18px;
  background: var(--c-accent-light);
  border-left: 4px solid var(--c-accent);
  color: var(--c-ink);
  text-decoration: none;
  border-radius: 4px;
  transition: background .15s;
}
.toc li a:hover { background: #f8d7d3; }
.toc .unit-no {
  display: inline-block;
  font-weight: bold;
  color: var(--c-accent);
  margin-right: 8px;
  font-family: var(--font-en);
  min-width: 60px;
}

/* 4分野カード */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.subject-card {
  display: block;
  padding: 24px 20px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--c-ink);
  border-left: 6px solid;
  transition: transform .15s;
}
.subject-card:hover { transform: translateY(-2px); }
.subject-card .name { font-size: 22px; font-weight: bold; margin-bottom: 6px; }
.subject-card .sub  { font-size: 13px; color: var(--c-sub); }
.subject-card.phys { background: var(--c-phys-light); border-color: var(--c-phys); }
.subject-card.phys .name { color: var(--c-phys); }
.subject-card.chem { background: var(--c-chem-light); border-color: var(--c-chem); }
.subject-card.chem .name { color: var(--c-chem); }
.subject-card.bio  { background: var(--c-bio-light); border-color: var(--c-bio); }
.subject-card.bio  .name { color: var(--c-bio); }
.subject-card.earth{ background: var(--c-earth-light); border-color: var(--c-earth); }
.subject-card.earth .name { color: var(--c-earth); }

/* ---------- 単元本体 ---------- */
.unit {
  border-top: 3px solid var(--c-accent);
  padding-top: 24px;
  margin-top: 60px;
}
.unit h2 {
  font-size: 26px;
  margin: 0 0 8px;
  color: var(--c-accent);
}
.unit .goal {
  background: #fff8df;
  border-left: 4px solid var(--c-note);
  padding: 12px 16px;
  margin: 16px 0 28px;
  border-radius: 4px;
  font-size: 15px;
}
.unit .goal::before { content: "🎯 この単元のゴール: "; font-weight: bold; }

.unit h3 {
  font-size: 21px;
  margin: 40px 0 14px;
  padding: 8px 0 4px;
  border-bottom: 2px solid var(--c-accent);
}
.unit h4 { font-size: 17px; margin: 24px 0 10px; color: var(--c-accent-dark); }

/* ---------- 解説枠 ---------- */
.explain {
  background: #fafafa;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 12px 0;
  border: 1px solid var(--c-line);
}
.explain p { margin: 8px 0; }

.lead { font-size: 16px; color: var(--c-sub); margin: 8px 0 16px; }

.note { font-size: 14px; color: var(--c-sub); margin-top: 8px; }
.note::before { content: "📝 "; }

/* ---------- 図カード（SVG主役） ---------- */
.figure {
  background: white;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
  text-align: center;
}
.figure svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.figure .caption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--c-sub);
  text-align: center;
}
.figure .fig-no {
  display: inline-block;
  background: var(--c-accent);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  font-family: var(--font-en);
  margin-bottom: 8px;
}
.figure.wide { background: var(--c-accent-light); border-color: var(--c-accent); }

/* ---------- コラム（4種＋新規） ---------- */
.column {
  background: #fff8df;
  border-left: 6px solid var(--c-note);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 4px 8px 8px 4px;
}
.column h4 { margin: 0 0 8px; color: #876200; font-size: 17px; }
.column h4::before { content: "💡 "; }
.column p { margin: 6px 0; }

.column.aha { background: #f3e8ff; border-left-color: #9a4ec0; }
.column.aha h4 { color: #6b2d8a; }
.column.aha h4::before { content: "✨ "; }

.column.science { background: #e7f5ea; border-left-color: #2a7a3a; }
.column.science h4 { color: #176a44; }
.column.science h4::before { content: "🔬 "; }

.column.warn { background: #fff0f0; border-left-color: #b94a48; }
.column.warn h4 { color: #8a2a28; }
.column.warn h4::before { content: "⚠️ "; }

.column.video { background: #fff0fa; border-left-color: #c879c8; }
.column.video h4 { color: #8a2a8a; }
.column.video h4::before { content: "📺 "; }
.column.video a { color: #8a2a8a; font-weight: bold; }

/* ---------- 用語ボックス ---------- */
.term-box {
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 16px 0;
  background: #fff;
}
.term-box h4 { margin-top: 0; color: var(--c-accent); }
.term-list { list-style: none; padding: 0; margin: 0; }
.term-list li {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--c-line);
}
.term-list li:last-child { border-bottom: none; }
.term-list .term {
  font-weight: bold;
  color: var(--c-accent);
  min-width: 120px;
}
.term-list .ruby { font-size: 11px; color: var(--c-sub); display: block; }
.term-list .desc { flex: 1; font-size: 14px; }

/* ---------- 練習問題（紙ベース） ---------- */
.drill {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 20px 0;
}
.drill > h4 {
  margin-top: 0;
  color: var(--c-accent);
  border-bottom: 1px solid var(--c-accent-light);
  padding-bottom: 6px;
}
.drill ol { padding-left: 24px; }
.drill li { margin: 16px 0; line-height: 2.0; }
.drill .qid {
  display: inline-block;
  background: var(--c-accent-light);
  color: var(--c-accent);
  padding: 1px 8px;
  border-radius: 4px;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: bold;
  margin-right: 4px;
  cursor: pointer;
}
.drill .qid:hover { background: var(--c-accent); color: white; }

/* インライン ○×❓ ボタン（各問題に自動挿入） */
.qid-actions {
  display: inline-flex;
  gap: 3px;
  margin-right: 8px;
  vertical-align: middle;
}
.qid-actions .qm {
  width: 26px;
  height: 22px;
  border: 1.5px solid;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  line-height: 1;
  transition: all .12s;
}
.qid-actions .qm-o { border-color: var(--c-ok); }
.qid-actions .qm-o:hover { background: var(--c-ok); }
.qid-actions .qm-x { border-color: var(--c-warn); }
.qid-actions .qm-x:hover { background: #fff0f0; }
.qid-actions .qm-q { border-color: #888; }
.qid-actions .qm-q:hover { background: #f5f5f5; }

/* 記録済み問題行のハイライト */
.drill li.rec-o {
  background: linear-gradient(to right, #e7f5ea 0%, #e7f5ea 4px, transparent 4px);
  padding-left: 8px;
  margin-left: -8px;
  border-radius: 3px;
}
.drill li.rec-x {
  background: linear-gradient(to right, #fff0f0 0%, #fff0f0 4px, transparent 4px);
  padding-left: 8px;
  margin-left: -8px;
  border-radius: 3px;
}
.drill li.rec-q {
  background: linear-gradient(to right, #f5f5f5 0%, #f5f5f5 4px, transparent 4px);
  padding-left: 8px;
  margin-left: -8px;
  border-radius: 3px;
}

/* 戻りリンク（詰まりやすい問題に表示） */
.return-link {
  display: inline-block;
  margin: 6px 0 0;
  padding: 4px 12px;
  background: #f3e8ff;
  border-left: 3px solid #9a4ec0;
  border-radius: 0 4px 4px 0;
  color: #6b2d8a;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
}
.return-link:hover { background: #9a4ec0; color: white; }
.return-link::before { content: "💡 "; }

/* 入試頻出マーカー */
.exam-hot {
  display: inline-block;
  background: linear-gradient(135deg, #ffd54f, #ff8800);
  color: white;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
  margin-right: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.exam-hot::before { content: "⭐ "; }

/* 再挑戦リスト（苦手マップ用） */
.retry-group {
  background: white;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
}
.retry-group h4 {
  margin: 0 0 10px;
  color: var(--c-warn);
  font-size: 14px;
  border-bottom: 1px solid #f8d7d3;
  padding-bottom: 6px;
}
.retry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.retry-list li {
  border-radius: 4px;
}
.retry-list li.retry-stuck {
  background: #fff0f0;
  border-left: 3px solid var(--c-warn);
}
.retry-list li.retry-trying {
  background: #fff8df;
  border-left: 3px solid var(--c-note);
}
.retry-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  text-decoration: none;
  color: var(--c-ink);
  font-size: 13px;
}
.retry-list li a:hover { background: rgba(0,0,0,.04); }
.retry-list .retry-qid {
  font-family: var(--font-en);
  font-weight: bold;
  color: var(--c-warn);
}
.retry-list .retry-mark { font-size: 14px; }
.retry-list .retry-state {
  margin-left: auto;
  font-size: 11px;
  color: var(--c-sub);
}

/* 書き込み欄 */
.write-line {
  display: inline-block;
  border-bottom: 1.5px solid #333;
  min-width: 80px;
  height: 1.3em;
  vertical-align: bottom;
  margin: 0 4px;
}
.write-line.wide { display: block; width: 100%; margin: 6px 0; min-width: auto; }
.write-line.tall { height: 2.6em; }

.choice {
  display: inline-block;
  margin: 0 14px 0 0;
}
.choice::before { content: "（  ） "; }

.q-show {
  background: #888;
  color: white;
  border: none;
  padding: 4px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 4px;
}
.q-show:hover { background: #555; }

.answer-row {
  display: none;
  background: #f0f8f0;
  padding: 8px 12px;
  margin-top: 8px;
  border-left: 3px solid var(--c-ok);
  font-size: 14px;
  border-radius: 0 4px 4px 0;
}
.answer-row.show { display: block; }
.answer-row strong { color: var(--c-ok); }

/* ---------- ○×記録ウィジェット（フローティング） ---------- */
.record-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--c-accent);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  z-index: 999;
}
.record-toggle:hover { transform: scale(1.05); }

.record-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 320px;
  background: white;
  border: 2px solid var(--c-accent);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  z-index: 1000;
  display: none;
}
.record-panel.show { display: block; }
.record-panel h4 {
  margin: 0 0 10px;
  color: var(--c-accent);
  font-size: 15px;
}
.record-panel .close-btn {
  position: absolute;
  top: 8px; right: 10px;
  background: none; border: none;
  font-size: 18px; cursor: pointer; color: #999;
}
.record-panel .qid-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--c-line);
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-en);
  margin-bottom: 10px;
  box-sizing: border-box;
}
.record-panel .qid-hint {
  font-size: 11px;
  color: var(--c-sub);
  margin: -6px 0 8px;
}
.record-panel .result-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.record-panel .result-buttons button {
  padding: 10px;
  border: 2px solid;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}
.record-panel .btn-correct { border-color: var(--c-ok); color: var(--c-ok); }
.record-panel .btn-correct:hover { background: #e7f5ea; }
.record-panel .btn-wrong   { border-color: var(--c-warn); color: var(--c-warn); }
.record-panel .btn-wrong:hover { background: #fff0f0; }
.record-panel .btn-unknown { border-color: #888; color: #555; }
.record-panel .btn-unknown:hover { background: #f5f5f5; }

.record-panel .recent {
  border-top: 1px solid var(--c-line);
  padding-top: 8px;
  margin-top: 4px;
}
.record-panel .recent h5 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--c-sub);
}
.record-panel .recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 140px;
  overflow-y: auto;
}
.record-panel .recent-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
  border-bottom: 1px dotted #eee;
}
.record-panel .recent-list .id { font-family: var(--font-en); color: var(--c-sub); }
.record-panel .recent-list .mark { font-weight: bold; }
.record-panel .recent-list .mark.o { color: var(--c-ok); }
.record-panel .recent-list .mark.x { color: var(--c-warn); }
.record-panel .recent-list .mark.q { color: #888; }
.record-panel .toast {
  font-size: 12px;
  color: var(--c-ok);
  text-align: center;
  height: 16px;
  margin-bottom: 4px;
}

.record-panel .panel-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
}
.record-panel .panel-actions a {
  color: var(--c-accent);
  text-decoration: none;
}
.record-panel .panel-actions a:hover { text-decoration: underline; }

/* 単元末の集計 */
.unit-summary {
  background: var(--c-accent-light);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 30px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.unit-summary .label { font-weight: bold; color: var(--c-accent); }
.unit-summary .stat { font-family: var(--font-en); font-size: 17px; }
.unit-summary .stat .num { font-size: 24px; font-weight: bold; color: var(--c-accent); }
.unit-summary .retry-link {
  background: var(--c-accent);
  color: white;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
}
.unit-summary .retry-link:hover { background: var(--c-accent-dark); }

/* ---------- 苦手マップ ---------- */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin: 16px 0;
}
.map-cell {
  border: 1px solid var(--c-line);
  border-radius: 4px;
  padding: 8px 10px;
  background: #fafafa;
  text-align: center;
  font-size: 12px;
}
.map-cell.state-untouched { background: #f0f0f0; color: #999; }
.map-cell.state-trying    { background: #fff8df; border-color: #e0bb1f; }
.map-cell.state-once-ok   { background: #e7f5ea; border-color: var(--c-ok); }
.map-cell.state-mastered  { background: var(--c-ok); color: white; border-color: var(--c-ok); }
.map-cell.state-stuck     { background: #fff0f0; border-color: var(--c-warn); }
.map-cell .qid-label { font-family: var(--font-en); font-weight: bold; display: block; font-size: 11px; }
.map-cell .latest    { font-size: 18px; margin-top: 2px; }

.map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  margin: 16px 0;
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.map-legend .dot {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid #ccc;
}

/* ---------- 印刷モード切替パネル ---------- */
.print-panel-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: #666;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 999;
}
.print-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  border: 2px solid var(--c-accent);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 1000;
  font-size: 13px;
  display: none;
}
.print-panel.show { display: block; }
.print-panel h4 { margin: 0 0 8px; color: var(--c-accent); font-size: 14px; }
.print-panel label { display: block; margin: 4px 0; cursor: pointer; }
.print-panel input[type="radio"] { margin-right: 6px; }
.print-panel .print-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: var(--c-accent);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.print-panel .close-btn {
  position: absolute;
  top: 4px; right: 8px;
  background: none; border: none;
  font-size: 16px; cursor: pointer; color: #999;
}

/* 印刷モード：問題冊子 */
body.mode-questions .answer-row,
body.mode-questions .q-show {
  display: none !important;
}

/* 印刷モード：解答編 */
body.mode-answer-key .hero,
body.mode-answer-key .lead,
body.mode-answer-key .explain,
body.mode-answer-key .figure,
body.mode-answer-key .column,
body.mode-answer-key .term-box,
body.mode-answer-key .toc,
body.mode-answer-key .controls,
body.mode-answer-key .unit-summary,
body.mode-answer-key .unit > .goal,
body.mode-answer-key .unit > p,
body.mode-answer-key .unit > h3,
body.mode-answer-key .unit > h4 {
  display: none !important;
}
body.mode-answer-key .drill .write-line,
body.mode-answer-key .drill .q-show,
body.mode-answer-key .drill .choice,
body.mode-answer-key .qid-actions {
  display: none !important;
}

/* 問題冊子モードでもインラインボタンを隠す */
body.mode-questions .qid-actions {
  display: none !important;
}

/* 記録ハイライトは印刷時には消す（白黒で混乱しないよう） */
@media print {
  .drill li.rec-o, .drill li.rec-x, .drill li.rec-q {
    background: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
}
body.mode-answer-key .drill .answer-row {
  display: inline-block !important;
  background: transparent !important;
  border: none !important;
  border-left: 2px solid var(--c-ok);
  padding: 0 8px !important;
  margin: 0 0 0 8px !important;
  font-weight: bold;
  color: var(--c-ok);
}
body.mode-answer-key .book-title::after {
  content: " — 解答編";
  color: var(--c-warn);
  font-size: 0.7em;
}

/* ---------- @media print ---------- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: white; font-size: 11pt; }
  .page { box-shadow: none; max-width: none; padding: 0; }
  .top-nav, .q-show, .print-hide,
  .print-panel, .print-panel-toggle,
  .record-toggle, .record-panel { display: none !important; }
  .unit { page-break-before: always; }
  .unit:first-of-type { page-break-before: avoid; }
  h2, h3, h4 { page-break-after: avoid; }
  .figure, .drill li, .column { page-break-inside: avoid; }
  a { color: black; text-decoration: none; }
  .write-line { border-bottom: 1px solid black; }
  body:not(.mode-answer-key) .answer-row { display: none !important; }
}

/* ---------- ヒーロー（intro用） ---------- */
.hero {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-dark) 100%);
  color: white;
  padding: 32px 28px;
  border-radius: 8px;
  margin-bottom: 32px;
}
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero p { margin: 4px 0; opacity: .95; }

.big-section {
  margin: 56px 0;
  padding-top: 24px;
  border-top: 3px double var(--c-accent);
}
.big-section > h2 {
  font-size: 26px;
  color: var(--c-accent);
  margin: 0 0 8px;
}

/* 大きな表 */
.big-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.big-table th, .big-table td {
  border: 1px solid var(--c-line);
  padding: 8px 12px;
  vertical-align: top;
  font-size: 14px;
}
.big-table th {
  background: var(--c-accent-light);
  color: var(--c-accent);
  text-align: left;
}

/* 並列カード */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.compare-card {
  background: white;
  border: 2px solid var(--c-accent-light);
  border-radius: 8px;
  padding: 14px 18px;
}
.compare-card h4 { margin-top: 0; color: var(--c-accent); }
.compare-card.alt { border-color: #ffdcc8; }
.compare-card.alt h4 { color: #c46a2e; }

@media (max-width: 600px) {
  .compare-grid { grid-template-columns: 1fr; }
  .record-panel { width: calc(100vw - 40px); right: 20px; }
}
