/* デザインシステム「橋」準拠。記事ページ（制度とお金）。結論 → 短い版／全文 → 本文 → チェックリスト → 出典。 */
:root {
  --surface: #f6f7f4; --surface-raised: #ffffff; --surface-sunken: #eceee9;
  --ink: #17202a; --ink-muted: #4a5560; --line: #cbd0c6; --line-strong: #6b7480;
  --brand: #213f7a; --brand-soft: #dce4f3; --on-brand: #ffffff;
  --shu: #c0391f; --sign: #ffc93c; --on-sign: #17202a; --focus: #17202a;
  --caution: #9a1b1b; --caution-soft: #fbecea;
  --pillar-money: #1d5bb0; --pillar-video: #00704f; --pillar-story: #6b4597; --pillar-compare: #a44a0a; --on-pillar: #ffffff;
  --font-ud: "BIZ UDPGothic", "BIZ UDPゴシック", "Yu Gothic", "Hiragino Sans", sans-serif;
  --font-voice: "BIZ UDPMincho", "BIZ UDP明朝", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
  --radius-sm: 4px; --radius-md: 10px; --radius-pill: 999px;
  --tap-min: 48px; --tap-gap: 12px; --measure: 36em; --page-max: 1080px;
  color-scheme: light;
  font-size: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #14171c; --surface-raised: #1c2027; --surface-sunken: #101318;
    --ink: #ece7dd; --ink-muted: #a9a497; --line: #2f3540; --line-strong: #7d8796;
    --brand: #9db7ee; --brand-soft: #26324a; --on-brand: #0f1a2e;
    --shu: #f08a6e; --sign: #ffc93c; --on-sign: #14171c; --focus: #ffd25e;
    --caution: #ff9c8f; --caution-soft: #3a1e1c;
    --pillar-money: #86b4f0; --pillar-video: #5bc9a0; --pillar-story: #c3a6ea; --pillar-compare: #f2a066; --on-pillar: #10141a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #14171c; --surface-raised: #1c2027; --surface-sunken: #101318;
  --ink: #ece7dd; --ink-muted: #a9a497; --line: #2f3540; --line-strong: #7d8796;
  --brand: #9db7ee; --brand-soft: #26324a; --on-brand: #0f1a2e;
  --shu: #f08a6e; --sign: #ffc93c; --on-sign: #14171c; --focus: #ffd25e;
  --caution: #ff9c8f; --caution-soft: #3a1e1c;
  --pillar-money: #86b4f0; --pillar-video: #5bc9a0; --pillar-story: #c3a6ea; --pillar-compare: #f2a066; --on-pillar: #10141a;
  color-scheme: dark;
}
:root[data-contrast="hc"] {
  --surface: #ffffff; --surface-raised: #ffffff; --surface-sunken: #ffffff;
  --ink: #000000; --ink-muted: #2b2b2b; --line: #000000; --line-strong: #000000;
  --brand: #0b2a66; --brand-soft: #dfe7f5; --on-brand: #ffffff;
  --shu: #9e2410; --sign: #ffd400; --on-sign: #000000; --focus: #000000;
  --caution: #8b0000; --caution-soft: #ffffff;
  --pillar-money: #0b3f86; --pillar-video: #00503a; --pillar-story: #4b2a78; --pillar-compare: #7a3300; --on-pillar: #ffffff;
  color-scheme: light;
}
:root[data-text="l"] { font-size: 21px; }
:root[data-text="xl"] { font-size: 24px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-ud); font-size: 1rem; line-height: 1.95; }
h1, h2, h3, p, ul, ol, dl, blockquote { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--brand); text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--page-max); margin: 0 auto; padding-inline: var(--space-4); }
[hidden] { display: none !important; }

.skip { position: absolute; left: var(--space-3); top: -80px; z-index: 10; background: var(--sign); color: var(--on-sign); font-weight: 700; padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); }
.skip:focus { top: var(--space-3); }
.proto { background: var(--surface-sunken); color: var(--ink-muted); font-size: .84rem; padding-block: var(--space-1); }

/* ---------- 部品（デザインシステム「橋」） ---------- */
.hs-btn { font: inherit; font-size: .84rem; font-weight: 700; letter-spacing: .04em; min-height: var(--tap-min); min-width: var(--tap-min); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 2px solid var(--brand); background: var(--surface-raised); color: var(--brand); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hs-btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.hs-mark { display: inline-grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: var(--radius-pill); background: var(--pc); color: var(--on-pillar); font-weight: 700; font-size: .84rem; line-height: 1; flex: none; }
.p-money { --pc: var(--pillar-money); } .p-video { --pc: var(--pillar-video); } .p-story { --pc: var(--pillar-story); } .p-compare { --pc: var(--pillar-compare); }

/* ---------- ヘッダー ---------- */
.head { border-bottom: 1px solid var(--line); }
.head-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); padding-block: var(--space-4); }
.logo { display: flex; align-items: center; gap: var(--space-3); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.3rem; line-height: 1.25; }
.logo small { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-muted); }
.logo svg { width: 3.2rem; height: 1.7rem; flex: none; }
.logo .arch { fill: none; stroke: var(--shu); stroke-width: 5; }
.logo .deck { fill: var(--shu); }
.tools { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; }
.ctl { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: .84rem; font-weight: 700; }
.ctl > span { color: var(--ink-muted); margin-right: var(--space-1); }
.gnav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.gnav a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-min); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .92rem; }
.gnav a:hover { text-decoration: underline; }
.gnav a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--pc); }

/* ---------- 記事 ---------- */
main { padding-block: var(--space-6) var(--space-8); }
.col { max-width: 44rem; margin-inline: auto; display: grid; gap: var(--space-7); }
.crumb ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-2); font-size: .84rem; color: var(--ink-muted); }
.crumb li:not(:last-child)::after { content: "→"; margin-left: var(--space-2); }
.crumb a { color: var(--ink); display: inline-flex; align-items: center; min-height: var(--tap-min); }

.art-head { display: grid; gap: var(--space-4); }
.kicker { display: flex; align-items: center; gap: var(--space-2); font-size: .84rem; font-weight: 700; color: var(--pc); }
.art-head h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.5; }
.art-head h1 small { display: block; font-size: .55em; font-weight: 700; color: var(--ink-muted); margin-top: var(--space-1); }
.lead { max-width: var(--measure); }
.meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: .84rem; color: var(--ink-muted); }

.stamp { display: inline-flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); font-size: .84rem; line-height: 1.6; justify-self: start; }
.stamp .seal { width: 4rem; height: 4rem; border-radius: var(--radius-pill); border: 3px solid var(--shu); color: var(--shu); display: grid; place-content: center; text-align: center; font-family: var(--font-voice); font-weight: 700; line-height: 1.15; font-size: .72rem; transform: rotate(-6deg); flex: none; }
.stamp .seal b { font-size: 1rem; display: block; }
.stamp dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--space-3); }
.stamp dt { color: var(--ink-muted); }
.stamp dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.callout { border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-3); border-top: 5px solid var(--cc); background: var(--cb); }
:root[data-contrast="hc"] .callout { border: 2px solid var(--cc); border-top-width: 5px; }
.callout .ttl { display: flex; gap: var(--space-2); align-items: center; font-weight: 700; color: var(--cc); }
.callout .ttl i { font-style: normal; display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: var(--radius-pill); background: var(--cc); color: var(--surface); font-size: .84rem; flex: none; }
.callout ul { padding-left: 1.2em; display: grid; gap: var(--space-2); }
.callout--point { --cc: var(--brand); --cb: var(--brand-soft); }
.callout--caution { --cc: var(--caution); --cb: var(--caution-soft); }

.toggle-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.toggle-row p { font-size: .84rem; color: var(--ink-muted); }
.hs-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); padding: var(--space-1); border: 2px solid var(--brand); border-radius: var(--radius-pill); }
.hs-toggle button { font: inherit; font-size: .84rem; font-weight: 700; min-height: var(--tap-min); padding: 0 var(--space-5); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--brand); cursor: pointer; }
.hs-toggle button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }

.toc { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); }
.toc h2 { font-size: .92rem; color: var(--ink-muted); }
.toc ol { padding-left: 1.6em; }
.toc a { display: inline-flex; align-items: center; min-height: var(--tap-min); font-weight: 700; }

.sec { display: grid; gap: var(--space-4); scroll-margin-top: var(--space-4); }
.sec > h2 { font-size: 1.44rem; line-height: 1.5; padding-top: var(--space-4); border-top: 2px solid var(--ink); }
.sec h3 { font-size: 1.17rem; line-height: 1.55; margin-top: var(--space-3); }
.sec p, .sec > ul, .sec > ol { max-width: var(--measure); }
.sec > ul, .sec > ol { padding-left: 1.4em; display: grid; gap: var(--space-2); }
.small { font-size: .84rem; color: var(--ink-muted); }
ul.small { padding-left: 1.4em; display: grid; gap: var(--space-1); }
strong { font-weight: 700; }
blockquote.quote { border-left: 0; background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); max-width: var(--measure); }
blockquote.quote ul { padding-left: 1.2em; display: grid; gap: var(--space-1); }
blockquote.quote cite { display: block; font-style: normal; font-size: .78rem; color: var(--ink-muted); margin-top: var(--space-2); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); }
.table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .84rem; font-variant-numeric: tabular-nums; line-height: 1.6; }
.table caption { text-align: left; font-weight: 700; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.table th, .table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { border-bottom: 2px solid var(--ink); white-space: nowrap; }
.table tbody th { white-space: nowrap; }
.table .num { white-space: nowrap; text-align: right; }
.table .key { background: var(--brand-soft); font-weight: 700; color: var(--ink); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }
.fact { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); display: grid; gap: 2px; }
.fact .num { font-size: 1.4rem; line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pc); }
.fact .what { font-size: .84rem; font-weight: 700; line-height: 1.5; }
.fact .src { font-size: .78rem; color: var(--ink-muted); line-height: 1.5; }

/* 本人加筆の枠（試作のみ） */
.voice-slot { border: 2px dashed var(--line-strong); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-2); }
.voice-slot .lbl { font-size: .84rem; font-weight: 700; color: var(--pillar-story); display: flex; align-items: center; gap: var(--space-2); }
.voice-slot blockquote { font-family: var(--font-voice); font-size: 1.1rem; line-height: 1.8; color: var(--ink-muted); }

.hs-check { list-style: none; padding: 0; display: grid; gap: var(--tap-gap); }
.hs-check label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: start; min-height: var(--tap-min); padding: var(--space-3) var(--space-4); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-md); cursor: pointer; }
.hs-check input { appearance: none; -webkit-appearance: none; margin: 2px 0 0; width: 1.6rem; height: 1.6rem; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); display: grid; place-items: center; cursor: pointer; }
.hs-check input:checked { background: var(--brand); border-color: var(--brand); }
.hs-check input:checked::after { content: "✓"; color: var(--on-brand); font-weight: 700; font-size: 1rem; line-height: 1; }
.hs-check .who { display: block; font-size: .84rem; color: var(--ink-muted); }
.check-tools { display: flex; flex-wrap: wrap; gap: var(--tap-gap); }

.sources { padding-left: 1.4em; display: grid; gap: var(--space-3); font-size: .84rem; line-height: 1.7; }
.sources a { overflow-wrap: anywhere; }

.next { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.next li { border-bottom: 1px solid var(--line); }
.next a, .next span.soon { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); min-height: var(--tap-min); padding: var(--space-2) 0; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .92rem; line-height: 1.6; }
.next a::after { content: "→"; color: var(--pc); flex: none; }
.next a:hover { color: var(--pc); text-decoration: underline; }
.next .soon { color: var(--ink-muted); }
.next .soon em { font-style: normal; font-weight: 400; font-size: .78rem; }

.foot { border-top: 1px solid var(--line); padding-block: var(--space-6) var(--space-7); font-size: .84rem; color: var(--ink-muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-3); }
.foot nav a { color: var(--ink); display: inline-flex; align-items: center; min-height: var(--tap-min); }

@media print {
  .head .tools, .gnav, .toggle-row, .toc, .check-tools, .skip, .proto { display: none !important; }
  [data-full] { display: grid !important; }
}
