/* MulmoClaude のビュー (views/quiz.html, views/answers.html) の見た目をそのまま踏襲する。 */

/* display を指定した要素では hidden 属性が効かなくなるので、明示的に打ち消す。 */
[hidden] {
  display: none !important;
}

body {
  font-family: system-ui, "Hiragino Kaku Gothic ProN", sans-serif;
  margin: 0;
  padding: 16px;
  color: #1e293b;
  background: #f8fafc;
}

h1 {
  font-size: 16px;
  margin: 0 0 12px;
}

/* ---- 試験タイマー(右上に固定) ---- */

.timer {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 50;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.timer input {
  width: 46px;
  font-size: 12px;
  padding: 2px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  text-align: right;
  font-family: inherit;
}

.timer-unit {
  font-size: 11px;
  color: #64748b;
}

.timer-btn {
  font-size: 11px;
  border: none;
  border-radius: 4px;
  padding: 4px 9px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
}

.timer-btn.start {
  background: #16a34a;
}

.timer-btn.start:hover {
  background: #15803d;
}

.timer-btn.stop {
  background: #64748b;
}

.timer-btn.stop:hover {
  background: #475569;
}

.timer-remain {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  min-width: 52px;
  text-align: right;
}

/* 残り5分を切ったら赤く出す。 */
.timer-remain.urgent {
  color: #b91c1c;
}

/* ---- 電卓 ---- */

.calc-toggle {
  font-size: 11px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: inherit;
  margin-left: 6px;
  align-self: center;
}

.calc-toggle:hover {
  background: #f1f5f9;
}

.calc-toggle.open {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* タイマーの真下に出す。position: fixed なのでスクロールしても付いてくる。 */
.calc {
  position: fixed;
  top: 52px; /* 開いたときに calc.js がタイマーの実寸から上書きする */
  right: 8px;
  z-index: 60;
  box-sizing: border-box;
  width: 236px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.calc-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  min-height: 34px;
}

.calc-mem {
  font-size: 10px;
  font-weight: 700;
  color: #b45309;
}

.calc-value {
  margin-left: auto;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  text-align: right;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.calc-key {
  font-size: 15px;
  padding: 9px 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-family: inherit;
}

.calc-key:hover {
  background: #f1f5f9;
}

.calc-key:active {
  background: #e2e8f0;
}

.calc-op {
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}

.calc-eq {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  font-weight: 700;
}

.calc-eq:hover {
  background: #1e40af;
}

.calc-fn {
  font-size: 13px;
  color: #b91c1c;
}

.calc-mem {
  font-size: 12px;
}

.calc-key.calc-mem {
  font-size: 12px;
  color: #64748b;
}

.calc-note {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.5;
  margin-top: 8px;
}

/* ---- 時間切れの通知 ---- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.overlay[hidden] {
  display: none;
}

.overlay-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 30px;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.3);
}

.overlay-title {
  font-size: 30px;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 14px;
}

.overlay-note {
  font-size: 13px;
  line-height: 1.8;
  color: #334155;
  margin: 0 0 20px;
}

.overlay-ok {
  font-size: 16px;
  font-weight: 700;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 40px;
  cursor: pointer;
  font-family: inherit;
}

.overlay-ok:hover {
  background: #15803d;
}

/* ---- ビュー切り替え ---- */

.viewbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  /* 右上のタイマーの下に潜り込まないよう場所を空けておく。 */
  padding-right: 150px;
}

.view-btn {
  font-size: 13px;
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

.view-btn:hover {
  background: #f1f5f9;
}

.view-btn[aria-current="true"] {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* ---- 演習ビュー ---- */

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

select {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.count {
  font-size: 12px;
  color: #64748b;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.qno {
  font-weight: 700;
  font-size: 15px;
  color: #1d4ed8;
}

.tag {
  font-size: 11px;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 2px 8px;
}

.prev-badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
}

.prev-badge.correct {
  background: #dcfce7;
  color: #15803d;
}

.prev-badge.wrong {
  background: #fee2e2;
  color: #b91c1c;
}

/* ---- 復習マーク(問題ごと) ---- */

.review-btn {
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 22px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.review-btn:hover {
  border-color: #f59e0b;
  color: #b45309;
}

.review-btn[aria-pressed="true"] {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  font-weight: 700;
}

/* ---- 選択の一括取り消し(赤枠) ---- */

.clear-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 2px solid #dc2626;
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.clear-btn {
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: #b91c1c;
  border: 2px solid #dc2626;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.clear-btn:hover {
  background: #dc2626;
  color: #fff;
}

.clear-note {
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
}

/* ---- 間違えた問題をまとめて復習に入れる ---- */

.review-add-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  background: #fffbeb;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.review-add-btn {
  font-size: 13px;
  font-weight: 700;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  font-family: inherit;
}

.review-add-btn:hover {
  background: #d97706;
}

.review-add-note {
  font-size: 12px;
  color: #92400e;
}

.review-add-note.done {
  font-weight: 700;
  color: #b45309;
}

.qtext {
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

/* 穴埋めの (ア)(イ)… 。本文に埋もれると探しにくいので枠で囲む。 */
.blank {
  display: inline-block;
  border: 1px solid #64748b;
  border-radius: 3px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.88em;
  line-height: 1.3;
  padding: 0 4px;
  margin: 0 3px;
  vertical-align: 1px;
}

.choices .blank {
  background: #fff;
}

.answer-box .blank {
  border-color: #86a894;
}

/* ---- 数式（mathfmt.js が組み立てる） ---- */

/* line-height を 0 にして、上付き・下付きが行間を押し広げないようにする。 */
.qtext sup,
.choice-body sup,
.exp sup,
.qtext sub,
.choice-body sub,
.exp sub {
  font-size: 0.7em;
  line-height: 0;
  position: relative;
}

.qtext sup,
.choice-body sup,
.exp sup {
  vertical-align: super;
}

.qtext sub,
.choice-body sub,
.exp sub {
  vertical-align: baseline;
  bottom: -0.28em;
}

/* 分数は分子・分母を上下に積む。行の中に混ざるので、行の高さを
   できるだけ押し広げないよう小さめ・行間詰めで組み、中央で揃える。 */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.2em;
  /* 分子・分母に式が入るようになったので、小さすぎると読めない。
     本文15pxに対して約13px。行の高さは少し広がるが、読めるほうを取る。 */
  font-size: 0.86em;
  line-height: 1.12;
}

.frac .num {
  border-bottom: 1px solid currentColor;
  padding: 0 0.35em;
}

.frac .den {
  padding: 0 0.35em;
}

/* 本文を大きくした分だけ図も引き上げる（260 → 300px）。 */
.diagram {
  max-width: 100%;
  max-height: 300px;
  display: block;
  margin: 8px 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.choices {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choices .choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  line-height: 1.7;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}

.choices .choice:has(input:checked) {
  background: #eff6ff;
  border-color: #93c5fd;
}

.choices .choice input {
  cursor: pointer;
  flex: 0 0 auto;
}

/* 選択肢の本文。これで囲まないと <sup>/<sub> が flex アイテムになって崩れる。 */
.choices .choice-body {
  flex: 1;
}

.selected-indicator {
  font-size: 12px;
  color: #475569;
  margin-bottom: 10px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mark-btn {
  font-size: 13px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
}

.mark-btn:hover {
  background: #15803d;
}

.reveal-btn {
  font-size: 13px;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
}

.reveal-btn:hover {
  background: #1e40af;
}

.result {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  display: none;
}

.result.show {
  display: block;
}

.result.correct {
  color: #15803d;
}

.result.wrong {
  color: #b91c1c;
}

.answer-box {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.answer-box.open {
  display: block;
}

.answer-box .correct-label {
  font-weight: 700;
  color: #15803d;
  margin-bottom: 6px;
}

.answer-box .exp {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.exp-img {
  max-width: 100%;
  max-height: 300px;
  display: block;
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.source {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 10px;
}

.grade-all-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 24px;
}

.grade-all-btn {
  font-size: 14px;
  font-weight: 700;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  cursor: pointer;
}

.grade-all-btn:hover {
  background: #1e293b;
}

.score-summary {
  font-size: 13px;
  color: #334155;
}

.err {
  color: #b91c1c;
}

.empty {
  color: #64748b;
  font-size: 13px;
}

/* ---- 年度別結果ビュー ---- */

.group {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.group h2 {
  font-size: 14px;
  margin: 0 0 10px;
  color: #1d4ed8;
}

.score-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.score {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.score .denom {
  font-size: 14px;
  font-weight: 400;
  color: #64748b;
}

.meta {
  font-size: 12px;
  color: #64748b;
}

.bar-wrap {
  background: #f1f5f9;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.bar {
  height: 100%;
  background: #16a34a;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin: 10px 0 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 12px;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.chip.wrong {
  background: #fee2e2;
  color: #b91c1c;
}

.chip.unanswered {
  background: #f1f5f9;
  color: #64748b;
}

.none {
  font-size: 12px;
  color: #94a3b8;
}

.not-started {
  font-size: 13px;
  color: #64748b;
}

/* ---- ページの一番上へ戻る ---- */

.totop-wrap {
  text-align: center;
  margin-bottom: 24px;
}

.totop-btn {
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 28px;
  cursor: pointer;
  font-family: inherit;
}

.totop-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* ---- 画面幅の切り替え(スマホ幅 / パソコン幅) ---- */

/* body に .narrow を付けるだけで幅が変わる。JavaScript の再描画は起きないので
   表示の切り替えにかかる処理はほぼゼロ。 */
.width-btn {
  font-size: 12px;
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  margin-left: auto;
}

.width-btn:hover {
  background: #f1f5f9;
}

body.narrow .view,
body.narrow .viewbar,
body.narrow .crumb,
body.narrow .site-footer {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* スマホ幅では画面が狭いぶん、指で押す部分を大きめにする。 */
body.narrow .choices .choice {
  padding: 11px 12px;
}

body.narrow .mark-btn,
body.narrow .reveal-btn {
  padding: 10px 18px;
  font-size: 14px;
}

body.narrow .review-btn {
  padding: 11px 24px;
}

/* トップページ・使い方ページでも幅を切り替えられるようにする。 */
body.home.narrow {
  max-width: 420px;
}

/* 幅の切り替えボタンは、どのページでも上部の中央に置く。
   画面に貼り付けて追従させると本文やタイマーに重なるので、
   ふつうの要素として置き、スクロールすれば流れて消えるようにする。 */
.width-bar {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

.width-bar .width-btn {
  margin-left: 0;
  min-height: 44px;
  padding: 12px 22px;
  font-size: 13px;
  border-radius: 22px;
  border-color: #94a3b8;
}

body.narrow .diagram,
body.narrow .exp-img {
  max-height: 240px;
}

/* 幅を狭めるとタイマーと重なるので、切り替えボタンは折り返す。 */
body.narrow .viewbar {
  padding-right: 0;
}

/* ---- 実機の画面が狭いとき ---- */

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .viewbar {
    padding-right: 0;
    margin-top: 42px;
  }

  .card {
    padding: 12px 12px;
  }

  .timer {
    top: 6px;
    right: 6px;
  }
}

/* ---- トップページ・説明ページ ---- */

body.home {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.crumb {
  font-size: 12px;
  margin-bottom: 14px;
}

.crumb a {
  color: #1d4ed8;
  text-decoration: none;
}

.crumb a:hover {
  text-decoration: underline;
}

.hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  color: #fff;
  border-radius: 14px;
  padding: 30px 28px 26px;
  margin-bottom: 32px;
}

.hero-eyebrow {
  font-size: 12px;
  color: #bfdbfe;
  margin: 0 0 6px;
  letter-spacing: 0.08em;
}

.hero-title {
  font-size: 29px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
  color: #fff;
}

.hero-lead {
  font-size: 14.5px;
  line-height: 1.9;
  color: #e0e7ff;
  margin: 0 0 16px;
}

.hero-lead strong {
  color: #fff;
}

.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 20px;
  padding: 0;
}

.hero-badges li {
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-stats > div {
  flex: 1 1 110px;
}

.hero-stats dt {
  font-size: 11px;
  color: #bfdbfe;
  margin-bottom: 3px;
}

.hero-stats dd {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ---- 節 ---- */

.section {
  margin-bottom: 34px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px;
  padding-left: 11px;
  border-left: 4px solid #1d4ed8;
  line-height: 1.4;
}

.section-note {
  font-size: 12px;
  color: #64748b;
  margin: 12px 0 0;
}

/* 科目はちょうど4つなので 2×2 に固定する。auto-fit だと幅しだいで
   3個＋1個の不格好な並びになるため、段数を決め打ちにしている。 */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 560px) {
  .subject-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.subject-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.subject-time {
  font-size: 11px;
  color: #94a3b8;
}

.subject-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
}

a.subject-card:hover {
  border-color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.12);
}

.subject-card.is-soon {
  background: #f1f5f9;
  color: #94a3b8;
  border-style: dashed;
}

.subject-name {
  font-size: 20px;
  font-weight: 700;
  color: #1d4ed8;
}

.subject-card.is-soon .subject-name {
  color: #94a3b8;
}

.subject-note {
  font-size: 11px;
  color: #94a3b8;
}

.subject-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.subject-card.is-soon .subject-meta {
  color: #94a3b8;
}

.subject-go {
  font-size: 12px;
  font-weight: 700;
  color: #16a34a;
  margin-top: 8px;
}

.subject-card.is-soon .subject-go {
  color: #94a3b8;
  font-weight: 400;
}

/* ---- できること ---- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.feature {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef2ff;
  font-size: 17px;
  margin-bottom: 9px;
}

.feature h3 {
  font-size: 14.5px;
  margin: 0 0 6px;
  color: #0f172a;
}

.feature p {
  font-size: 12.5px;
  line-height: 1.85;
  color: #475569;
  margin: 0;
}

/* ---- 料金 ---- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.plan {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
}

.plan-current {
  border: 2px solid #16a34a;
}

.plan-soon {
  background: #f8fafc;
  border-style: dashed;
}

.plan-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 11px;
  margin: 0 0 10px;
}

.plan-current .plan-badge {
  background: #dcfce7;
  color: #15803d;
}

.plan-soon .plan-badge {
  background: #e2e8f0;
  color: #64748b;
}

.plan-name {
  font-size: 17px;
  margin: 0 0 4px;
  color: #0f172a;
}

.plan-price {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #0f172a;
}

.plan-soon .plan-price {
  font-size: 20px;
  color: #94a3b8;
}

.plan-price span {
  font-size: 14px;
  font-weight: 400;
  margin-left: 3px;
}

.plan-list {
  margin: 0;
  padding-left: 1.3em;
}

.plan-list li {
  font-size: 12.5px;
  line-height: 1.9;
  color: #334155;
}

.plan-soon .plan-list li {
  color: #64748b;
}

.plan-note {
  font-size: 11.5px;
  line-height: 1.7;
  color: #94a3b8;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.plan-note a {
  color: #64748b;
}

/* ---- 買い切りプラン ---- */

/* 料金は2つだけなので横に並べる。狭いときは縦積みにする。 */
.plan-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 620px) {
  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.plan-paid {
  border: 2px solid #1d4ed8;
}

.plan-badge-accent {
  background: #dbeafe;
  color: #1d4ed8;
}

.plan-price-block {
  margin-bottom: 6px;
}

.plan-paid .plan-price {
  margin-bottom: 2px;
}

.plan-paid .plan-price strong {
  font-size: 34px;
  color: #1d4ed8;
}

/* 変更前の値段。取り消し線で「いまが安い」と伝える。 */
.plan-price-strike {
  font-size: 17px;
  font-weight: 400;
  color: #94a3b8;
  text-decoration: line-through;
  margin-right: 4px;
}

.plan-price-sub {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px;
}

.plan-price-single {
  font-size: 13px;
  color: #334155;
  margin: 0 0 12px;
  padding: 7px 11px;
  background: #f1f5f9;
  border-radius: 6px;
}

.plan-price-single strong {
  color: #0f172a;
}

.plan-cta {
  margin: 14px 0 0;
}

.plan-cta.is-pending {
  font-size: 12.5px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}

/* ---- 今後の予定 ---- */

.roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.roadmap li {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
}

.roadmap-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 3px 11px;
  margin-bottom: 7px;
}

.roadmap strong {
  display: block;
  font-size: 14.5px;
  color: #0f172a;
  margin-bottom: 4px;
}

.roadmap span:not(.roadmap-tag) {
  display: block;
  font-size: 12.5px;
  line-height: 1.8;
  color: #475569;
}

/* ---- 最初の一歩のボタン ---- */

.hero-cta {
  margin: 18px 0 0;
}

.cta-btn {
  display: inline-block;
  background: #1d4ed8;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  padding: 14px 30px;
  min-height: 48px;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.cta-btn:hover {
  background: #1e40af;
}

.cta-btn-buy {
  display: block;
  text-align: center;
}

.cta-note {
  display: block;
  font-size: 12px;
  /* 濃い青のヒーローの上に載るので、灰色だと沈んで読めない。 */
  color: rgba(255, 255, 255, 0.82);
  margin-top: 8px;
}

/* ---- よくある質問 ---- */

.faq details {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 0 18px;
}

.faq summary {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  padding: 14px 0;
  cursor: pointer;
}

.faq summary:hover {
  color: #1d4ed8;
}

.faq p {
  font-size: 12.5px;
  line-height: 1.9;
  color: #475569;
  margin: 0;
  padding: 0 0 14px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

/* ---- 更新履歴 ---- */

.changelog {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.changelog li {
  font-size: 12.5px;
  line-height: 1.8;
  color: #334155;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
}

.changelog li:last-child {
  border-bottom: none;
}

.changelog-date {
  display: inline-block;
  min-width: 68px;
  font-size: 11.5px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* ---- お問い合わせ ---- */

.contact {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 20px 22px;
}

.contact-title {
  font-size: 16px;
  margin: 0 0 10px;
  color: #1e3a8a;
}

.contact p {
  font-size: 12.5px;
  line-height: 1.9;
  color: #334155;
  margin: 0 0 10px;
}

.contact-address {
  font-size: 14px !important;
  font-weight: 700;
}

.contact-address.is-pending {
  color: #94a3b8 !important;
  font-weight: 400;
}

.contact-note {
  font-size: 11.5px !important;
  color: #64748b !important;
  margin-bottom: 0 !important;
}

/* ---- ページへの導線 ---- */

.page-links {
  display: grid;
  gap: 10px;
  margin-bottom: 30px;
}

.page-link {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
}

.page-link:hover {
  border-color: #1d4ed8;
}

.page-link-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-link strong {
  display: block;
  font-size: 14px;
}

.page-link-sub {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.footer-disclaimer {
  margin-top: 8px;
  line-height: 1.7;
}

/* ---- 説明ページ本文 ---- */

/* ページ内の目次。長いページなので、探している項目へ直接飛べるようにする。 */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.toc a {
  font-size: 12.5px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 7px 14px;
  color: #334155;
  text-decoration: none;
}

.toc a:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* 見出しの直下に飛んだとき、目次に隠れないよう余白を作る。 */
.doc-block {
  scroll-margin-top: 12px;
}

.doc-block h3 {
  font-size: 13.5px;
  color: #0f172a;
  margin: 16px 0 7px;
  padding-left: 9px;
  border-left: 3px solid #cbd5e1;
}

.doc-block h3:first-of-type {
  margin-top: 10px;
}

/* 見落とすと困ることを囲む箱。 */
.callout {
  border-radius: 8px;
  padding: 12px 15px;
  margin: 12px 0;
}

.callout-warn {
  background: #fffbeb;
  border: 1px solid #fcd34d;
}

/* 困りごとの解決策を示す箱。注意(黄)と区別できるよう青にする。 */
.callout-tip {
  background: #eff6ff;
  border: 1px solid #93c5fd;
}

.callout-tip .callout-title {
  color: #1d4ed8;
}

/* ---- iOS 向けの「ホーム画面に追加」案内 ---- */

/* iPhone・iPad でしか出ない。閉じたら二度と出ない。 */
.ios-tip {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  padding: 13px 16px;
  margin: 0 0 14px;
}

/* 科目ページでは右上にタイマーが浮いている。狭い画面だと案内と重なるので、
   タイマーの下から始まるように上を空ける。トップページにはタイマーが無いので
   この余白は要らない。 */
body:not(.home) .ios-tip {
  margin-top: 46px;
}

@media (min-width: 620px) {
  body:not(.home) .ios-tip {
    /* 広い画面ではタイマーの左に本文が回り込むので、余白は不要。 */
    margin-top: 0;
    padding-right: 150px;
  }
}

.ios-tip-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  margin: 0 0 6px;
}

.ios-tip p {
  font-size: 12.5px;
  line-height: 1.85;
  color: #1e3a5f;
  margin: 0;
}

/* 共有ボタンを文字で示す小さなラベル。記号だけだと伝わりにくいため。 */
.ios-tip-icon {
  display: inline-block;
  font-size: 11px;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 5px;
  padding: 1px 7px;
  color: #1d4ed8;
}

.ios-tip-close {
  margin-top: 10px;
  font-size: 12px;
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 8px 18px;
  min-height: 36px;
  cursor: pointer;
  font-family: inherit;
}

.ios-tip-close:hover {
  background: #dbeafe;
}

.callout-title {
  font-weight: 700;
  font-size: 13px !important;
  color: #92400e;
  margin: 0 0 7px !important;
}

.callout ul {
  margin: 0 0 8px;
  padding-left: 1.3em;
}

.callout li {
  margin-bottom: 4px;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 4px;
}

.price-table th,
.price-table td {
  font-size: 13.5px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.price-table th {
  width: 40%;
  color: #475569;
  font-weight: 400;
  background: #f8fafc;
}

.price-table td strong {
  color: #1d4ed8;
  font-size: 16px;
}

.doc-block {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 14px;
}

.doc-block h2 {
  font-size: 15px;
  color: #1d4ed8;
  margin: 0 0 10px;
}

.doc-block p,
.doc-block li {
  font-size: 13.5px;
  line-height: 1.9;
  color: #334155;
}

.doc-block p {
  margin: 0 0 10px;
}

.doc-block p:last-child {
  margin-bottom: 0;
}

.doc-steps,
.doc-list {
  margin: 0;
  padding-left: 1.4em;
}

.doc-steps li,
.doc-list li {
  margin-bottom: 7px;
}

.doc-note {
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  padding: 9px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 12.5px !important;
  margin-top: 12px !important;
}

.inline-chip {
  display: inline-block;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  border-radius: 999px;
  padding: 1px 9px;
}

.inline-chip.on {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  font-weight: 700;
}

/* ---- フッター(出典表示。公開版で必須) ---- */

.site-footer {
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
  padding-top: 12px;
  font-size: 11px;
  color: #94a3b8;
}

.site-footer p {
  margin: 0 0 4px;
}

.site-footer a {
  color: #64748b;
}

/* 選択問題(理論・機械の問17/問18)。合計に入れなかった方をうすく見せる。 */
.tag-select { background: #fff4e5; border-color: #f0c48a; color: #8a5a12; }
.card.not-counted { opacity: 0.78; }
.not-counted-note { display: block; margin-top: 4px; font-size: 0.82em; font-weight: normal; opacity: 0.85; }

/* ---- 買い切りのロック画面とコード入力 ---- */

.locked {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 26px 20px;
  text-align: center;
  margin: 10px 0 18px;
}

.locked-icon {
  font-size: 30px;
  margin: 0 0 6px;
  line-height: 1;
}

.locked h2 {
  font-size: 16px;
  color: #0f172a;
  margin: 0 0 12px;
}

.locked p {
  font-size: 13.5px;
  line-height: 1.9;
  color: #334155;
  margin: 0 auto 12px;
  max-width: 34em;
  text-align: left;
}

.locked-price {
  text-align: center !important;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px !important;
}

.locked-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  text-align: center !important;
  margin-bottom: 0 !important;
}

.locked-free-btn {
  border: 0;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 22px;
  padding: 12px 22px;
  min-height: 44px;
  cursor: pointer;
}

.locked-free-btn:hover { background: #1e40af; }

.locked-links a {
  color: #1d4ed8;
  font-size: 13px;
}

.group.is-locked .not-started { color: #94a3b8; }

.code-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 auto 12px;
  max-width: 34em;
  text-align: left;
}

.code-box p { font-size: 13px; line-height: 1.8; margin: 0 0 6px; }
.code-box p:last-child { margin-bottom: 0; }

.code-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.code-row { display: flex; gap: 8px; flex-wrap: wrap; }

.code-input {
  flex: 1 1 12em;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.code-btn {
  border: 0;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 8px;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
}

.code-btn:hover { background: #115e59; }

.code-msg { font-size: 12.5px; margin-top: 8px !important; color: #64748b; }
.code-msg.ok { color: #15803d; font-weight: 700; }
.code-msg.ng { color: #b91c1c; }

.code-box.is-done { background: #f0fdf4; border-color: #86efac; }
.code-status { color: #15803d; font-weight: 700; }
.code-keep { color: #475569; font-size: 12.5px !important; }

.code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.08em;
  background: #fff;
  border: 1px dashed #86efac;
  border-radius: 6px;
  padding: 8px 12px;
  user-select: all;
}

.code-box.is-pending { background: #f8fafc; color: #64748b; }

/* 端末ごとの違いの表。左の見出し列が狭すぎると読みにくいので広めに取る。 */
.plat-table th { width: 42%; }
@media (max-width: 520px) {
  .plat-table th,
  .plat-table td { display: block; width: auto; }
  .plat-table td { padding-top: 0; }
}

/* 「できること」の最後の枠に置く注意書き。都合のよい話だけで終わらせないための枠。 */
.feature-alert {
  border: 2px solid #dc2626;
  background: #fef2f2;
}

.feature-alert h3 { color: #b91c1c; }
.feature-alert p { color: #991b1b; }
.feature-alert strong { color: #b91c1c; }

.feature-alert .feature-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.feature-alert-link a {
  color: #b91c1c;
  font-weight: 700;
}

/* できることは9枠。横3列に並ぶ幅（本文780px = 画面812px以上）ではきれいに3×3に
   収まるが、それより狭いと2列になり、最後の注意書きが1つだけ取り残される。
   その幅のときだけ横いっぱいに広げる。 */
@media (max-width: 811px) {
  .feature-alert {
    grid-column: 1 / -1;
  }
}

/* ヒーローの「無料の1回分を解いてみる」。1つのボタンだと「その科目だけ無料」に
   見えてしまうので、科目のぶんだけ横に並べる。 */
.cta-lead {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 10px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cta-btn-sub {
  flex: 1 1 auto;
  min-width: 96px;
  text-align: center;
  font-size: 14.5px;
  padding: 13px 18px;
  background: #fff;
  color: #1d4ed8;
}

.cta-btn-sub:hover {
  background: #e0e7ff;
  color: #1e40af;
}

.footer-contact a {
  color: #64748b;
  text-decoration: underline;
}

.contact-mail {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.contact-mail a {
  font-size: 15px !important;
  font-weight: 700;
  color: #1d4ed8;
  word-break: break-all;
}

/* ロック画面の購入ボタン。4科目セットを主、単科目を従に見せる。 */
.locked-buy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  text-align: center !important;
  margin-bottom: 10px !important;
}

.locked-buy .cta-btn {
  flex: 1 1 auto;
  min-width: 200px;
  text-align: center;
  font-size: 14px;
}

.cta-btn-outline {
  background: #fff;
  color: #1d4ed8;
  border: 2px solid #1d4ed8;
  box-shadow: none;
}

.cta-btn-outline:hover {
  background: #eef2ff;
  color: #1e40af;
}

.locked-buy-note {
  font-size: 12.5px !important;
  color: #64748b;
  text-align: center !important;
  margin-bottom: 14px !important;
}

.plan-cta-note {
  display: block;
  font-size: 12px;
  color: #64748b;
  line-height: 1.7;
  margin-top: 8px;
}
