/* 宅建学習ルート診断（試作）共通スタイル。外部フォント・外部読み込みなし */
:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --line: #d8dbd6;
  --accent: #1f6f5c;
  --accent-weak: #e3f1ec;
  --warn: #8a5a00;
  --warn-weak: #fff4dc;
  --bad: #9b2c2c;
  --bad-weak: #fdeaea;
  --info-weak: #eaf1fb;
  --radius: 10px;
  --maxw: 880px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b;
    --surface: #1e2226;
    --text: #e6e8ea;
    --muted: #a3acb5;
    --line: #353b41;
    --accent: #6cc4a9;
    --accent-weak: #1e3a32;
    --warn: #f0c060;
    --warn-weak: #3a3020;
    --bad: #f08a8a;
    --bad-weak: #3d2424;
    --info-weak: #1f2a3a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* 上部の表示 */
.notice-bar {
  background: var(--warn-weak);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  padding: 6px 0;
}
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.site-title { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); }
.site-title small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }

main { padding: 24px 0 48px; }
h1 { font-size: 26px; line-height: 1.4; margin: 8px 0 16px; }
h2 { font-size: 21px; line-height: 1.4; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
h3 { font-size: 18px; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
.lead { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}
.card h3 { margin-top: 0; }
.callout { border-left: 4px solid var(--accent); background: var(--accent-weak); padding: 12px 14px; border-radius: 6px; margin: 0 0 16px; }
.callout.warn { border-color: var(--warn); background: var(--warn-weak); }
.callout.bad { border-color: var(--bad); background: var(--bad-weak); }
.callout.info { border-color: var(--muted); background: var(--info-weak); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
@media (prefers-color-scheme: dark) { .btn { color: #0f1a17; } }
.btn.secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

/* 診断フォーム */
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.step { display: none; }
.step.active { display: block; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-size: 19px; font-weight: 700; margin-bottom: 10px; line-height: 1.5; }
.choice { display: block; position: relative; margin: 0 0 8px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: block;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  min-height: 44px;
}
.choice input:checked + span { border-color: var(--accent); background: var(--accent-weak); font-weight: 700; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.grid-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.grid-choices .choice { margin: 0; }
.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; }
.field input[type="date"], .field input[type="number"], .field select {
  font-size: 16px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  max-width: 100%;
}
.format-table { width: 100%; border-collapse: collapse; }
.format-table th, .format-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.format-table th:first-child, .format-table td:first-child { text-align: left; }
.format-table input { width: 22px; height: 22px; }
.error-msg { color: var(--bad); font-weight: 700; min-height: 1.5em; }

/* 結果 */
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); margin-right: 4px; vertical-align: middle; }
.badge.ok { background: var(--accent-weak); border-color: var(--accent); }
.badge.warn { background: var(--warn-weak); border-color: var(--warn); }
.badge.bad { background: var(--bad-weak); border-color: var(--bad); }
.reason-list { padding-left: 0; list-style: none; margin: 6px 0 10px; }
.reason-list li { padding-left: 1.5em; position: relative; margin-bottom: 4px; }
.reason-list.good li::before { content: "○"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.reason-list.notgood li::before { content: "△"; position: absolute; left: 0; color: var(--warn); font-weight: 700; }
.reason-list.unmet li::before { content: "×"; position: absolute; left: 0; color: var(--bad); font-weight: 700; }
.reason-list.note li::before { content: "※"; position: absolute; left: 0; color: var(--muted); }
.course-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.course-head .cost { font-weight: 700; font-size: 18px; }
.meta { font-size: 13px; color: var(--muted); }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
details summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 20px; }

/* 比較表 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.compare { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
table.compare th, table.compare td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; text-align: left; }
table.compare thead th { background: var(--bg); position: sticky; top: 0; }
table.compare tr.self-study { background: var(--accent-weak); }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 12px; }
.filters label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.filters input[type="checkbox"] { width: 24px; height: 24px; }
/* F4（L4、2026-10-29）：予算の選択欄もタップしやすい高さにする */
.filters select { min-height: 44px; font-size: 16px; padding: 0 8px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0 32px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  h2 { font-size: 19px; }
  .btn { width: 100%; text-align: center; }
  .btn-row .btn { width: 100%; }
}
@media print {
  .site-header, .site-footer, .notice-bar, .btn-row { display: none; }
}

/* 比較表は列が多いため、PCでは横幅を広げる。短い表示は改行しない */
body[data-page="hikaku"] .wrap { max-width: 1160px; }
/* 文字を大きくしても横にはみ出さないよう、バッジは折り返せる。比較表の中（横スクロールの囲いあり）だけ折り返さない（Codex監査 P07） */
.badge { white-space: normal; overflow-wrap: anywhere; }
body[data-page="hikaku"] table.compare .badge { white-space: nowrap; }
body[data-page="hikaku"] table.compare td.date { white-space: nowrap; }
body[data-page="hikaku"] table.compare td.price { min-width: 13em; }
body[data-page="hikaku"] table.compare td.extra { min-width: 9em; }
body[data-page="hikaku"] table.compare td.question, body[data-page="hikaku"] table.compare td.target { min-width: 8.5em; }
body[data-page="hikaku"] table.compare th[scope="row"] { min-width: 150px; }
/* F4（L3、2026-10-29）：1280px で比較表が枠に収まるよう、列の最小幅を詰めた（旧：価格15em・補足11em・質問/期限10em・講座名200px。新：価格13em・補足9em・質問/期限8.5em・講座名150px） */
main { overflow-wrap: anywhere; }
[aria-invalid="true"] { border-color: var(--bad) !important; }

/* 診断結果（2026-10-24 改善）：冒頭に方針と次の行動。詳細は折りたたみ */
.summary-line { color: var(--muted); margin: -6px 0 12px; }
.plan { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px; margin: 0 0 20px; }
.plan h2 { margin: 0 0 8px; border: 0; padding: 0; font-size: 18px; color: var(--accent); }
.plan-head { font-size: 18px; font-weight: 700; line-height: 1.6; margin: 0 0 10px; }
.plan-points { padding-left: 1.2em; margin: 0 0 8px; }
.plan-points li { margin-bottom: 6px; }
ol.steps { padding-left: 0; list-style: none; counter-reset: step; margin: 0 0 8px; }
ol.steps li { counter-increment: step; position: relative; padding: 12px 12px 12px 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
ol.steps li::before { content: counter(step); position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--surface); font-weight: 700; text-align: center; line-height: 26px; }
ol.steps li a { font-weight: 700; display: block; }
ol.steps li span { display: block; margin-top: 2px; }
.option h3 { margin: 0; }
.option-lead { font-weight: 700; margin: 4px 0 8px; }
.course-item { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.course-item h4 { margin: 0; font-size: 16px; }
.route-label { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
details.plain { background: transparent; border: 0; padding: 0; margin: 8px 0; }
details.plain > summary { color: var(--accent); padding: 10px 0; }
details.card { padding: 10px 14px; }
.pending-list { padding-left: 1.2em; }
.pending-list > li { margin-bottom: 12px; }

/* 結果ページ最終調整（2026-10-24）：公式日程リンク、4件目以降の展開 */
.schedule-link { margin: 4px 0 8px; padding: 10px 12px; border-left: 4px solid var(--line); }
.schedule-link a { font-weight: 700; display: block; }
.schedule-link span { display: block; }
.more-courses > summary { font-weight: 700; }

/* 料金表示の改善（2026-10-24）：通常価格とキャンペーン価格の違いを見やすく。総支払額は確定／未確認を分ける */
.price-box { margin: 6px 0 8px; }
.price-box p { margin: 2px 0; }
.price-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.price-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.price-now .yen { font-size: 20px; }
s.regular { color: var(--muted); }
.price-until { font-weight: 700; color: var(--warn); }
.price-total { border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 4px !important; }
.candidates { margin-top: 8px; }
.course-item.candidate h4 { font-size: 16px; }

/* スマホ（720px以下）の比較ページ：横スクロールの表をやめ、1講座1枚のカードにする */
@media (max-width: 720px) {
  body[data-page="hikaku"] .table-scroll { overflow-x: visible; border: 0; background: transparent; }
  body[data-page="hikaku"] table.compare { min-width: 0; display: block; }
  body[data-page="hikaku"] table.compare thead { display: none; }
  body[data-page="hikaku"] table.compare tbody { display: block; }
  body[data-page="hikaku"] table.compare tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; padding: 4px 0; }
  body[data-page="hikaku"] table.compare tr.self-study { background: var(--accent-weak); }
  body[data-page="hikaku"] table.compare th[scope="row"] { display: block; min-width: 0; font-size: 16px; border-bottom: 1px solid var(--line); }
  body[data-page="hikaku"] table.compare td { display: block; min-width: 0 !important; border-bottom: 0; padding: 4px 12px; white-space: normal !important; }
  body[data-page="hikaku"] table.compare td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
  body[data-page="hikaku"] table.compare td.feat { display: inline-block; min-width: 5.5em; vertical-align: top; }
  body[data-page="hikaku"] table.compare .badge { white-space: normal; }
  body[data-page="hikaku"] table.compare td.feat .badge { white-space: nowrap; }
}
