/* 円と金利ウォッチ：藍の地に朱の差し色。紙幣や日銀の資料のような、かっちりした数字の読み物。
   グラフの色（--s1〜--s4）は dataviz スキルの検証済みパレットの先頭4色で、このサイトの面（ライト #ffffff・ダーク #151c27）に対して検証した。
   ライトでは --s3・--s4 が面に対して3:1未満なので、全部のグラフに「数値で見る」の表を付ける。 */
:root {
  color-scheme: light;
  --page: #f3f5f8; --surface: #ffffff; --surface-2: #eef1f6;
  --ink: #111827; --ink-2: #3d4757; --muted: #6b7482; --border: rgba(17, 24, 39, 0.12);
  --grid: #e3e7ee; --axis: #b8c0cc;
  --indigo: #1b2b4b; --indigo-2: #26395f; --vermilion: #c8442f; --link: #2446a0;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #8a93a3;
  --good: #0f7a3a; --warn: #9a6a00; --bad: #b3261e;
  --good-bg: #e6f4ec; --warn-bg: #fdf3dc; --bad-bg: #fbe7e5;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d121a; --surface: #151c27; --surface-2: #1b2432;
    --ink: #eef2f8; --ink-2: #c3cad6; --muted: #8d97a7; --border: rgba(255, 255, 255, 0.11);
    --grid: #232d3c; --axis: #3a4557;
    --indigo: #0a1222; --indigo-2: #16223a; --vermilion: #e0674f; --link: #8fb0ff;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #6f7888;
    --good: #5ccf8a; --warn: #e8b64a; --bad: #f08a80;
    --good-bg: #13301f; --warn-bg: #33290f; --bad-bg: #3a1a17;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d121a; --surface: #151c27; --surface-2: #1b2432;
  --ink: #eef2f8; --ink-2: #c3cad6; --muted: #8d97a7; --border: rgba(255, 255, 255, 0.11);
  --grid: #232d3c; --axis: #3a4557;
  --indigo: #0a1222; --indigo-2: #16223a; --vermilion: #e0674f; --link: #8fb0ff;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #6f7888;
  --good: #5ccf8a; --warn: #e8b64a; --bad: #f08a80;
  --good-bg: #13301f; --warn-bg: #33290f; --bad-bg: #3a1a17;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink);
  font: 15.5px/1.8 "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "palt" 1; }
a { color: var(--link); text-underline-offset: 3px; }
.num, table td, .tile .v { font-variant-numeric: tabular-nums; }

/* ---------- ヘッダー：藍の帯、下に朱の細い線と「円の高さメーター」 */
.bar { background: var(--indigo); color: #fff; border-bottom: 3px solid var(--vermilion); }
.bar-in { max-width: 1080px; margin: 0 auto; padding: 14px 20px 6px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo .seal { flex: none; width: 38px; height: 38px; border-radius: 6px; background: var(--vermilion); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 20px; letter-spacing: 0; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.logo .txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.logo .mark { font-size: 11px; letter-spacing: 0.18em; color: #9fb0d0; font-weight: 600; }
.logo .name { font-size: 21px; font-weight: 800; letter-spacing: 0.02em; }
.tools { display: flex; gap: 8px; align-items: center; flex: none; }
.tools a, .tools button { color: #dbe3f3; background: transparent; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px;
  padding: 4px 12px; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.tools a:hover, .tools button:hover { background: rgba(255, 255, 255, 0.1); }
.tabs { max-width: 1080px; margin: 0 auto; padding: 4px 14px 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: #c4cfe4; text-decoration: none; padding: 8px 10px 9px; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { color: #fff; font-weight: 700; border-bottom-color: #fff; }
.meter { background: var(--indigo-2); }
.meter-in { max-width: 1080px; margin: 0 auto; padding: 24px 20px 10px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: #aebbd6; }
.meter-scale { position: relative; flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #c8442f 0%, #4a5a7c 50%, #7fa4e8 100%); }
.meter-scale i { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px var(--indigo-2); }
.meter-scale b { position: absolute; top: -21px; transform: translateX(-50%); font-weight: 700; color: #fff; white-space: nowrap; font-size: 11.5px; }
.meter .end { white-space: nowrap; }
.meter .cap { white-space: nowrap; color: #dbe3f3; font-weight: 600; }

/* ---------- 本文 */
main { max-width: 1080px; margin: 0 auto; padding: 26px 20px 40px; }
h1 { font-size: 28px; line-height: 1.4; margin: 6px 0 14px; letter-spacing: 0.01em; }
h2 { font-size: 21px; line-height: 1.45; margin: 0 0 10px; padding-left: 12px; border-left: 4px solid var(--vermilion); }
h3 { font-size: 16.5px; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.lead { color: var(--ink-2); }
.block { margin: 34px 0; }
.sec-kicker { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.14em; color: var(--vermilion); font-weight: 700; text-transform: uppercase; }
.note { color: var(--muted); font-size: 13.5px; }
.alert { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; }

.summary { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--indigo); border-radius: 10px; padding: 16px 22px 8px; margin: 0 0 26px; }
.summary .s-head { font-weight: 800; margin: 0 0 6px; color: var(--ink); }
.summary ol { margin: 0; padding-left: 1.4em; }
.summary li { margin-bottom: 8px; }

/* 数字のタイル */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; min-width: 0; }
.tile .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tile .v { font-size: 30px; font-weight: 800; line-height: 1.25; margin: 2px 0; letter-spacing: -0.01em; }
.tile .v small { font-size: 15px; font-weight: 700; margin-left: 2px; }
.tile .d { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* 前提の点検 */
.premise { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; border-radius: 999px; padding: 3px 12px 3px 8px; font-size: 14px; }
.chip::before { content: ""; width: 16px; height: 16px; border-radius: 50%; display: inline-block; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.chip.intact { color: var(--good); background: var(--good-bg); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 11.2 3.3 8l1.1-1.1 2.1 2.1 5.1-5.1L12.7 5z'/%3E%3C/svg%3E"); }
.chip.watch { color: var(--warn); background: var(--warn-bg); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7 3h2v6H7zm0 8h2v2H7z'/%3E%3C/svg%3E"); }
.chip.broken { color: var(--bad); background: var(--bad-bg); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.4 3.3 3.6 3.6 3.6-3.6 1.1 1.1L9.1 8l3.6 3.6-1.1 1.1L8 9.1l-3.6 3.6-1.1-1.1L6.9 8 3.3 4.4z'/%3E%3C/svg%3E"); }
.premise .claim { font-size: 17px; font-weight: 700; margin: 10px 0 8px; }
.checks { list-style: none; padding: 0; margin: 10px 0 6px; }
.checks li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--border); }
.checks .tag { flex: none; font-size: 12px; font-weight: 700; border-radius: 4px; padding: 1px 7px; }
.checks .tag.yes { color: var(--warn); background: var(--warn-bg); }
.checks .tag.no { color: var(--muted); background: var(--surface-2); }
.rule { font-size: 13px; color: var(--muted); }

/* ページ案内 */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--link); }
.card b { display: block; font-size: 15.5px; margin-bottom: 4px; color: var(--link); }
.card span { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; display: block; }

/* グラフ */
figure.chart { margin: 16px 0 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 10px; }
figure.chart figcaption { margin-bottom: 8px; }
figure.chart figcaption strong { display: block; font-size: 15px; }
figure.chart figcaption span { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.canvas { position: relative; width: 100%; }
details.data { margin-top: 8px; }
details.data summary { cursor: pointer; font-size: 13px; color: var(--link); }
.data .tbl-wrap { max-height: 360px; overflow: auto; margin-top: 6px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two > figure.chart { margin: 0; }

/* 表 */
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
thead th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
th:first-child, td:first-child { text-align: left; }
th[scope="row"] { font-weight: 700; }
td.txt { text-align: left; white-space: normal; min-width: 220px; }
td.pos { color: var(--good); } td.neg { color: var(--bad); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* 主張とデータ */
.claim-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin: 0 0 14px; }
.claim-card h3 { margin: 0 0 6px; font-size: 17px; }
.claim-card .who { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.claim-card .verdict { display: inline-block; font-weight: 800; font-size: 13.5px; border-radius: 4px; padding: 2px 8px; margin: 4px 0 8px; }
.verdict.yes { color: var(--good); background: var(--good-bg); }
.verdict.part { color: var(--warn); background: var(--warn-bg); }
.verdict.no { color: var(--bad); background: var(--bad-bg); }
.claim-card ul { margin: 0; padding-left: 1.2em; }
.claim-card li { margin-bottom: 4px; }
.claim-card .said { margin: 0 0 6px; font-size: 14.5px; color: var(--ink-2, inherit); }
.claim-card .src { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.claim-card .src a { color: var(--muted); }

ul.methods li, ul.sources li { margin-bottom: 8px; }
.updated { color: var(--muted); font-size: 12.5px; margin-top: 34px; }
.site-foot { max-width: 1080px; margin: 0 auto; padding: 18px 20px 40px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.site-foot a { color: var(--ink-2); }

/* 読みやすさ：本文の1行を短くする（全角で40字前後）。表・グラフ・カードは広いまま */
.block > p, .block > .lead, .prose, ul.points, .summary ol { max-width: 44em; }
.summary li { line-height: 1.85; }
.more { margin-top: 6px; }
.more a { font-weight: 600; text-decoration: none; }
.more a:hover { text-decoration: underline; }
p.aside { color: var(--ink-2); border-left: 3px solid var(--border); padding-left: 12px; }

/* 年表 */
.timeline { list-style: none; margin: 14px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; position: relative; }
.timeline li { position: relative; padding: 18px 16px 4px 0; border-top: 3px solid var(--indigo); }
.timeline li:last-child { border-top-color: var(--vermilion); }
.timeline li::before { content: ""; position: absolute; top: -8px; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 3px solid var(--indigo); }
.timeline li:last-child::before { border-color: var(--vermilion); }
.timeline .t { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.timeline strong { display: block; font-size: 24px; line-height: 1.3; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.timeline .d { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.65; }

/* 理由のカード */
.reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0 6px; }
.reason { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--vermilion); border-radius: 10px; padding: 14px 18px 8px; }
.reason .h { font-weight: 800; margin: 0 0 2px; }
.reason .v { font-size: 26px; font-weight: 800; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.reason p { font-size: 14.5px; line-height: 1.75; }

/* 箇条書き */
ul.points { margin: 10px 0 16px; padding-left: 1.3em; }
ul.points li { margin-bottom: 8px; line-height: 1.8; }

/* 例の箱（ハンバーガー） */
.example { background: var(--surface-2); border-radius: 12px; padding: 16px 18px 6px; margin: 16px 0; }
.example .ex-head { font-weight: 800; margin: 0 0 10px; }
.ex-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ex-col { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 4px; }
.ex-col .h { font-weight: 700; font-size: 14px; color: var(--indigo); margin: 0 0 4px; }
:root[data-theme="dark"] .ex-col .h { color: var(--link); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .ex-col .h { color: var(--link); } }
.ex-col p { font-size: 14px; line-height: 1.7; margin-bottom: 8px; }
.ex-col .res { font-weight: 700; color: var(--ink); }
.example .ex-note { font-size: 13.5px; color: var(--ink-2); margin: 10px 0 8px; }

/* 100万円の例の表 */
table.examples th small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
table.examples td { font-size: 16px; }
table.examples td.win { font-weight: 800; color: var(--ink); }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .timeline { grid-template-columns: minmax(0, 1fr); border-left: 3px solid var(--indigo); margin-left: 6px; }
  .timeline li { border-top: 0; padding: 0 0 14px 18px; }
  .timeline li::before { top: 4px; left: -8px; }
  .timeline strong { font-size: 21px; }
  .reasons, .ex-cols { grid-template-columns: minmax(0, 1fr); }
  .example { padding: 14px 12px 4px; }
  body { font-size: 15px; }
  main { padding: 18px 14px 32px; }
  .bar-in { padding: 12px 14px 4px; }
  .logo .seal { width: 32px; height: 32px; font-size: 17px; }
  .logo .name { font-size: 17px; }
  .logo .mark { font-size: 9.5px; letter-spacing: 0.12em; }
  .tools a, .tools button { padding: 3px 9px; font-size: 12px; }
  .meter-in { padding: 22px 14px 9px; gap: 8px; font-size: 11px; }
  .meter .cap { display: none; }
  h1 { font-size: 23px; }
  h2 { font-size: 18.5px; }
  .summary { padding: 14px 16px 6px; }
  .tile { padding: 10px 12px; }
  .tile .v { font-size: 24px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  figure.chart { padding: 12px 10px 8px; }
  .premise { padding: 14px 16px; }
  .claim-card { padding: 14px 16px; }
  .tbl-wrap { overflow: visible; background: transparent; border: 0; border-radius: 0; }
  .data .tbl-wrap { overflow: auto; background: var(--surface); }
  .tbl-wrap:has(table.nostack) { overflow-x: auto; }
  table.nostack { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; border-collapse: separate; border-spacing: 0;
    table-layout: fixed; width: 100%; font-size: 13px; }
  table.nostack th, table.nostack td { padding: 7px 5px; white-space: normal; overflow-wrap: anywhere; }
  table.nostack th:first-child { width: 30%; padding-left: 8px; }
  /* 列の多い表（年ごとの国際収支、数値で見る）は折り返さず、表の中だけ横に動かす。先頭の列は固定 */
  table.nostack.flows, .data table.nostack { table-layout: auto; width: max-content; min-width: 100%; }
  table.nostack.flows td, .data table.nostack td { white-space: nowrap; overflow-wrap: normal; }
  table.nostack.flows th, .data table.nostack th { overflow-wrap: normal; word-break: keep-all; min-width: 4.2em; }
  table.nostack.flows th:first-child, .data table.nostack th:first-child { width: auto; position: sticky; left: 0; background: var(--surface); z-index: 1; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr { display: block; width: 100%; }
  table.stack tr { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
  table.stack th[scope="row"] { display: block; padding: 0 0 6px; border: 0; font-size: 15px; text-align: left; white-space: normal; }
  /* 値と単位を1つのかたまりのまま右に寄せ、列の見出しは左に浮かせる */
  table.stack td { display: block; padding: 3px 0; border: 0; text-align: right; white-space: normal; overflow: hidden; }
  table.stack td::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 12.5px; text-align: left; }
  table.stack td.txt { display: block; text-align: left; min-width: 0; }
  table.stack td.txt::before { float: none; display: block; margin-bottom: 1px; }
}
@media (forced-colors: active) {
  .chip::before { forced-color-adjust: none; background: CanvasText; }
  .meter-scale { background: CanvasText; }
}

.tbl-wrap:has(table.examples) { max-width: 680px; }
table.compact th small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tbl-wrap:has(table.compact) { max-width: 680px; }
@media (max-width: 720px) { table.nostack.compact th:first-child { width: 40%; } }
