:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --neg: #be123c;
  --pos: #047857;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111827; --ink: #e5e7eb; --ink-2: #cbd5e1; --muted: #94a3b8;
    --line: #1f2937; --accent: #60a5fa; --accent-soft: #172554; --warn: #fbbf24; --warn-soft: #292112;
    --neg: #fb7185; --pos: #34d399; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111827; --ink: #e5e7eb; --ink-2: #cbd5e1; --muted: #94a3b8;
  --line: #1f2937; --accent: #60a5fa; --accent-soft: #172554; --warn: #fbbf24; --warn-soft: #292112;
  --neg: #fb7185; --pos: #34d399; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.75; font-size: 16px; overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .inner, main, .site-footer .inner { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.site-header .inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; color: var(--ink); font-size: 17px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }

main { padding-top: 12px; padding-bottom: 48px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 8px 0 16px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "＞"; margin-right: 4px; color: var(--muted); }

h1 { font-size: clamp(22px, 5vw, 30px); line-height: 1.35; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
h3 { font-size: 16px; margin: 24px 0 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); }
.badge.plain { background: var(--surface); color: var(--ink-2); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.card .label { font-size: 13px; color: var(--muted); }
.card .value { font-size: clamp(20px, 5.6vw, 26px); font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.card .value .unit { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.card .sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.card .nodata { font-size: 16px; font-weight: 400; color: var(--muted); }
.band { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 6px; }
.band i { display: inline-block; width: 22px; height: 6px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .25); }
.neg { color: var(--neg); }
.pos { color: var(--pos); }

.summary p { margin: 0 0 12px; }
.note { background: var(--warn-soft); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 12px 0; }
.muted { color: var(--muted); font-size: 13px; }

.map { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 16px 0; }
.map img { width: 100%; }
.map figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.btn { display: inline-block; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.btn:hover { text-decoration: none; opacity: .9; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th { background: var(--bg); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.kv th { width: 45%; font-weight: 400; color: var(--ink-2); }
table.kv td { text-align: right; font-variant-numeric: tabular-nums; }
.scope { font-size: 12px; color: var(--muted); font-weight: 400; }

.ad-slot { margin: 28px 0; min-height: 0; }
.ad-slot:empty { display: none; }

.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.related li span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.sources { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-size: 13px; color: var(--ink-2); margin-top: 40px; }
.sources ul { margin: 4px 0 8px; padding-left: 1.2em; }
.sources p { margin: 4px 0; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.site-footer .inner { padding-top: 20px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 4px 16px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; box-shadow: 0 0 0 1px rgba(15, 23, 42, .25); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 8px 0; }

/* 33msec Works 共通ヘッダー・フッター（shared/common.css）を置く枠 */
.w33-wrap { max-width: 960px; margin: 0 auto; padding: 12px 16px 0; }
.w33-wrap .w33-header { margin-bottom: 0; }
.w33-wrap-bottom { padding-bottom: 16px; }
.w33-wrap-bottom .w33-related { margin-top: 16px; }

.notes { margin: 8px 0 16px; font-size: 14px; }
.notes dt { font-weight: 700; margin-top: 8px; }
.notes dd { margin: 2px 0 0; color: var(--ink-2); }
.maplink { display: inline-block; margin-left: 6px; padding: 0 7px; font-size: 11px; line-height: 18px; border: 1px solid var(--line, #cbd5e1); border-radius: 9px; color: inherit; text-decoration: none; white-space: nowrap; vertical-align: 1px; }
.maplink:hover { background: rgba(37, 99, 235, .08); }
