/* 電化ウォッチ：工業と銅。コンクリートの灰色の地、鋼の黒いヘッダー、銅の差し色、見出しはゴシックの太字、ヘッダーの下に送電線の線。
   スーパーサイクル検証（紙の地・明朝）とは違う、設備の現場の雰囲気にする。
   データの色は dataviz の検証済みパレットの先頭5色（青・オレンジ・緑青・黄・マゼンタ）。このサイトの面の色
   （ライト #fbfcfc・ダーク #171b1e）で検証スクリプトを通した（ライトは3色が3:1未満なので、グラフには線の端のラベルと「数値で見る」を付ける）。
   銅の色は飾りと文字だけに使い、データには使わない */
:root {
  color-scheme: light;
  --page: #eceff0; --surface: #fbfcfc; --surface-2: #f2f4f5;
  --ink: #111719; --ink-2: #3b474d; --muted: #5d696f;
  --grid: #e0e5e7; --axis: #bdc7cb; --border: rgba(20,35,45,0.14);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --accent: #9a4513; --copper: #c0632a; --steel: #34434a; --steel-ink: #fff; --badge-ink: #fff;
  --band: rgba(192,99,42,0.10);
  --good: #1f7a4d; --watch: #9a6a00; --bad: #b3372f;
  --bar: #14191c; --bar-ink: #e6ecee; --bar-dim: #9fb0b7;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0e1113; --surface: #171b1e; --surface-2: #1d2226;
    --ink: #e9eef0; --ink-2: #bcc7cc; --muted: #8e9ba1;
    --grid: #262c30; --axis: #39434a; --border: rgba(200,225,235,0.11);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --accent: #e8955e; --copper: #d8783c; --steel: #9fb0b7; --steel-ink: #0e1113; --badge-ink: #0e1113;
    --band: rgba(216,120,60,0.13);
    --good: #4cc08a; --watch: #e0b040; --bad: #ee7b72;
    --bar: #090b0c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1113; --surface: #171b1e; --surface-2: #1d2226;
  --ink: #e9eef0; --ink-2: #bcc7cc; --muted: #8e9ba1;
  --grid: #262c30; --axis: #39434a; --border: rgba(200,225,235,0.11);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --accent: #e8955e; --copper: #d8783c; --steel: #9fb0b7; --steel-ink: #0e1113; --badge-ink: #0e1113;
  --band: rgba(216,120,60,0.13);
  --good: #4cc08a; --watch: #e0b040; --bad: #ee7b72;
  --bar: #090b0c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--page);
  font: 15.5px/1.8 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: rgba(192,99,42,0.25); }
h1, h2, h3 { font-weight: 800; letter-spacing: 0.01em; word-break: auto-phrase; text-wrap: balance; }

/* ヘッダー */
.bar { position: sticky; top: 0; z-index: 10; background: var(--bar); color: var(--bar-ink); border-top: 3px solid var(--copper); }
.bar-in { max-width: 1080px; margin: 0 auto; padding: 10px 20px 2px; display: flex; align-items: center; gap: 16px; }
.logo { display: flex; flex-direction: column; text-decoration: none; color: inherit; line-height: 1.3; }
.logo .mark { font: 600 11.5px/1.4 var(--mono); letter-spacing: 0.22em; color: #e0915a; }
.logo .name { font-weight: 800; font-size: 21px; letter-spacing: 0.04em; color: #fff; }
.tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lang, .theme { white-space: nowrap; font: 500 12px system-ui, sans-serif; color: var(--bar-ink); background: transparent;
  border: 1px solid #3c4a51; border-radius: 4px; padding: 4px 10px; text-decoration: none; cursor: pointer; }
.lang:hover, .theme:hover { border-color: #e0915a; color: #fff; }
.tabs { max-width: 1080px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; color: var(--bar-dim); text-decoration: none; padding: 8px 10px 9px; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current] { color: #fff; font-weight: 700; }
.tabs a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: #e0915a; }
.lines { display: block; width: 100%; height: 20px; background: var(--bar); }
.lines path { fill: none; stroke: #c0632a; stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0.9; }
.lines line { stroke: #56666e; stroke-width: 2; vector-effect: non-scaling-stroke; }

main { max-width: 1080px; margin: 0 auto; padding: 8px 20px 24px; }
.alert { background: rgba(179,55,47,0.10); border: 1px solid rgba(179,55,47,0.35); border-radius: 6px; padding: 10px 14px; margin: 16px 0; }

/* 冒頭 */
.hero { padding: 40px 0 8px; }
.kicker { font: 600 12px/1.6 var(--mono); letter-spacing: 0.16em; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-size: clamp(27px, 4.4vw, 42px); line-height: 1.35; margin: 0 0 16px; }
.hero h1 em { font-style: normal; color: var(--accent); box-shadow: inset 0 -0.28em 0 var(--band); }
.hero-sm { padding: 34px 0 0; }
.hero-sm h1 { font-size: clamp(25px, 3.8vw, 34px); margin-bottom: 4px; }
.lead { color: var(--ink-2); font-size: 16px; margin: 0 0 16px; max-width: 46em; }

/* 節 */
.block { margin: 46px 0; }
.block > h2 { font-size: 22px; margin: 0 0 12px; padding: 0 0 8px 14px; border-left: 5px solid var(--copper); border-bottom: 1px solid var(--grid); line-height: 1.45; }
.sec-kicker { font: 700 12px/1.4 var(--mono); letter-spacing: 0.16em; color: var(--accent); margin: 0 0 4px; }
.block h3 { font-size: 16.5px; margin: 0 0 6px; }
.block p { max-width: 50em; }
.more { margin: 8px 0 0; }
.more a { text-decoration: none; font-weight: 700; font-size: 14px; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.src { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.src a { color: var(--muted); }
.updated { color: var(--muted); font-size: 12.5px; margin: 32px 0 0; }
.disclaimer { color: var(--muted); font-size: 12.5px; border-top: 1px dashed var(--axis); padding-top: 10px; margin-top: 36px; }

/* 要点・3行のまとめ */
.summary { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--copper); border-radius: 6px; padding: 14px 18px 12px; margin: 24px 0 8px; }
.s-head { font: 700 12.5px/1.5 var(--mono); letter-spacing: 0.12em; color: var(--accent); margin: 0 0 4px; }
.summary ol { margin: 0; padding-left: 1.4em; }
.summary li { font-size: 16px; line-height: 1.8; margin: 4px 0; }

/* 前提の判定 */
.premise { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px 18px; margin: 14px 0; }
.badge { flex: none; font: 800 13px/1 system-ui, sans-serif; padding: 7px 10px; border-radius: 4px; color: var(--badge-ink); white-space: nowrap; }
.badge.intact { background: var(--good); } .badge.watch { background: var(--watch); } .badge.broken { background: var(--bad); }
.premise p { margin: 0; }
.premise .p-text { font-weight: 800; font-size: 17px; }
.premise ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 14px; color: var(--ink-2); }

/* 段の流れ（需要 → 発電 → 送電網 → 電線 → 銅） */
.chain { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: st; }
.chain li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px 12px; margin-right: 14px; display: flex; flex-direction: column; gap: 4px; }
.chain li:not(:last-child)::after { content: ""; position: absolute; right: -13px; top: 50%; width: 12px; height: 2px; background: var(--copper); }
.chain li.top { border-color: var(--copper); box-shadow: 0 0 0 2px var(--band); }
.chain .c-stage { font: 700 11.5px/1.3 var(--mono); letter-spacing: 0.1em; color: var(--muted); }
.chain .c-title { font-weight: 800; font-size: 16px; line-height: 1.35; }
.chain .c-num { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.chain .c-line { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.chain .c-flag { font-size: 12px; font-weight: 700; }
.chain .c-flag.on { color: var(--bad); } .chain .c-flag.off { color: var(--muted); }
.chain a { margin-top: auto; font-size: 13px; font-weight: 700; text-decoration: none; }

/* 概要の物語：需要 → 発電 → 送電網 → 電線 → 銅を、縦の線でつないだ段 */
.story { list-style: none; margin: 16px 0 0; padding: 0; counter-reset: sn; }
.story li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 0 14px; padding-bottom: 18px; counter-increment: sn; }
.story li:not(:last-child)::before { content: ""; position: absolute; left: 21px; top: 40px; bottom: 0; width: 2px; background: var(--copper); opacity: 0.55; }
.story .s-no { width: 44px; height: 44px; border-radius: 50%; background: var(--bar); border: 2px solid var(--copper); display: flex; align-items: center; justify-content: center; }
.story .s-no::after { content: counter(sn, decimal); font: 800 17px/1 var(--mono); color: #e0915a; }
.story .s-body { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px 18px 12px; }
.story li.top .s-body { border-color: var(--copper); box-shadow: 0 0 0 2px var(--band); }
.story h3 { font-size: 18px; margin: 2px 0 8px; line-height: 1.45; }
.story .c-stage { font: 700 11.5px/1.3 var(--mono); letter-spacing: 0.1em; color: var(--muted); }
.s-fig { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.s-fig .c-num { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--accent); }
.s-fig .c-cap { font-size: 13px; color: var(--muted); }
.story p { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 46em; }
.s-foot { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-top: 6px; }
.s-foot a { font-size: 13.5px; font-weight: 700; text-decoration: none; }
.c-flag { font-size: 12.5px; font-weight: 700; }
.c-flag.on { color: var(--bad); } .c-flag.off { color: var(--muted); }

/* 数字のタイル */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.tiles3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--steel); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-label { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.t-value { font-size: 26px; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; }
.t-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* カード（供給の話・受注残・主張） */
.facts { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.facts li { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; }
.facts h3 { font-size: 15.5px; margin: 0 0 4px; }
.facts p { margin: 0; font-size: 14px; color: var(--ink-2); }
.views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.view { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px 18px; display: flex; flex-direction: column; }
.v-when { margin: 0 0 4px; font: 700 12.5px/1.5 var(--mono); color: var(--accent); }
.view h3 { font-size: 16px; line-height: 1.55; }
.view p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.v-check { background: var(--surface-2); border-left: 3px solid var(--steel); border-radius: 4px; padding: 8px 10px; margin-top: 10px !important; color: var(--ink) !important; }
.v-check span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.view .src { margin-top: auto !important; padding-top: 8px; }

/* 銅の使い道の横帯 */
.uses { display: flex; height: 30px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 12px 0 6px; }
.uses span { display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: #fff; min-width: 0; overflow: hidden; white-space: nowrap; }
.uses span.o { color: var(--steel-ink); }
.uses-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; }
.uses-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* グラフ */
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px 18px 12px; margin: 14px 0; }
.chart figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.chart figcaption strong { font-size: 14.5px; }
.chart figcaption span { font-size: 13px; color: var(--ink-2); }
.canvas { position: relative; }
.data summary { cursor: pointer; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.data .tbl-wrap { max-height: 360px; overflow: auto; margin-top: 6px; }

/* 表 */
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; }
thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); line-height: 1.4; vertical-align: bottom; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 700; }
table.num td { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.txt { white-space: normal !important; min-width: 10em; }
td.pos { color: var(--accent); font-weight: 700; }
td.neg { color: var(--s1); font-weight: 700; }
tr.hl th, tr.hl td { background: var(--band); }
th small, td small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.tie { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 3px; padding: 0 7px; border: 1px solid var(--axis); white-space: nowrap; }
.tie.copper { border-color: var(--copper); color: var(--accent); }
.tie.power { border-color: var(--steel); }
.corr { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.corr b { color: var(--ink); }
.sources, .methods { padding-left: 1.2em; font-size: 14px; }
.sources li, .methods li { margin-bottom: 6px; }

footer.site-foot { max-width: 1080px; margin: 0 auto; padding: 18px 20px 40px; border-top: 1px solid var(--grid);
  display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
footer.site-foot a { color: var(--ink); }

@media (max-width: 900px) {
  .chain { grid-template-columns: 1fr; gap: 12px; }
  .chain li { margin-right: 0; }
  .chain li:not(:last-child)::after { right: auto; left: 28px; top: auto; bottom: -13px; width: 2px; height: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .story li { grid-template-columns: 34px 1fr; gap: 0 10px; }
  .story .s-no { width: 34px; height: 34px; }
  .story li:not(:last-child)::before { left: 16px; top: 34px; }
  .story .s-body { padding: 10px 14px; }
  .s-fig .c-num { font-size: 26px; }
  .bar-in { padding: 8px 14px 2px; }
  .logo .name { font-size: 18px; }
  .logo .mark { font-size: 10.5px; letter-spacing: 0.1em; white-space: nowrap; }
  .tabs { padding-right: 32px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .tabs a { font-size: 13.5px; }
  main { padding: 4px 14px 20px; }
  .hero { padding: 26px 0 6px; }
  .lead { font-size: 15px; }
  .summary li { font-size: 15px; }
  .block { margin: 34px 0; }
  .block > h2 { font-size: 19px; }
  .chart { padding: 12px 10px 8px; }
  .t-value { font-size: 22px; }
  .tiles3 { grid-template-columns: 1fr; }
  .facts, .views { grid-template-columns: 1fr; }
  .premise { flex-direction: column; gap: 8px; }

  /* 表はスマホ幅では1行を1枚のカードにする（列の見出しをセルの前に出す） */
  .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: 6px; 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 thead th { font-size: 12px; }
  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: 6px; padding: 10px 14px; margin-bottom: 8px; }
  table.stack th[scope="row"] { display: block; padding: 0 0 6px; border: 0; font-size: 15px; }
  /* 値と単位（small）を1つのかたまりのまま右に寄せ、列の見出しは左に浮かせる */
  table.stack td { display: block; padding: 3px 0; border: 0; text-align: right; white-space: normal; min-width: 0; 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 { text-align: left; }
  table.stack td.txt::before { float: none; display: block; margin-bottom: 1px; }
  table.stack td small { display: inline; margin-left: 4px; }
}
@media (forced-colors: active) {
  .badge, .uses span { forced-color-adjust: none; }
}
