@font-face {
  font-family: "Inter";
  src: url("../vendor/inter-latin.ttf") format("truetype");
  font-display: swap;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #6b7280;
  --accent-primary: #3b82f6;
  --accent-secondary: #6366f1;
  --accent-glow: rgba(59, 130, 246, .12);
  --positive: #10b981;
  --positive-bg: #dcfce7;
  --positive-text: #166534;
  --negative: #dc2626;
  --negative-bg: #fee2e2;
  --negative-text: #991b1b;
  --border: rgba(0, 0, 0, .06);
  --border-soft: rgba(0, 0, 0, .03);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / .06), 0 1px 2px rgb(0 0 0 / .04);
  --shadow-card: 0 4px 12px -2px rgb(0 0 0 / .06), 0 2px 4px -2px rgb(0 0 0 / .04);
  --radius-card: 16px;
  --radius-control: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-pill: 9999px;
  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", Meiryo, "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Aliases keep the existing ECharts code and generated lab CSS in sync. */
  --bg: var(--bg-primary);
  --bg-soft: var(--bg-secondary);
  --card: var(--bg-card);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --faint: var(--text-muted);
  --line: var(--border);
  --line-strong: var(--border);
  --accent: var(--accent-primary);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-primary: #0b1220;
    --bg-secondary: #0f1a2c;
    --bg-card: #131c2e;
    --text-primary: #e7eef8;
    --text-secondary: #a7b4c8;
    --text-muted: #8794a8;
    --accent-primary: #60a5fa;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(96, 165, 250, .16);
    --positive-bg: #123629;
    --positive-text: #86efac;
    --negative-bg: #3b1d27;
    --negative-text: #fca5a5;
    --border: rgba(255, 255, 255, .08);
    --border-soft: rgba(255, 255, 255, .05);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0b1220;
  --bg-secondary: #0f1a2c;
  --bg-card: #131c2e;
  --text-primary: #e7eef8;
  --text-secondary: #a7b4c8;
  --text-muted: #8794a8;
  --accent-primary: #60a5fa;
  --accent-secondary: #818cf8;
  --accent-glow: rgba(96, 165, 250, .16);
  --positive-bg: #123629;
  --positive-text: #86efac;
  --negative-bg: #3b1d27;
  --negative-text: #fca5a5;
  --border: rgba(255, 255, 255, .08);
  --border-soft: rgba(255, 255, 255, .05);
}

:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; }
button, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 3px; }
.numeric, td, .summary-value, .card-meta, .chart-caption, .header-date, .chip, .session-toolbar label, select {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

.content-wide { width: min(1240px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand, .footer-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand strong { color: var(--text-secondary); font-weight: 500; }
.brand-mark { color: var(--accent-primary); font-size: 18px; line-height: 1; }
.header-actions { display: flex; align-items: center; gap: 14px; color: var(--text-secondary); }
.header-date { font-size: 11px; white-space: nowrap; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
}
.theme-toggle:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.theme-icon { font-size: 15px; line-height: 1; }

.summary-bar { background: var(--bg-card); border-bottom: 1px solid var(--border); }
.summary-inner { display: grid; grid-template-columns: repeat(3, 1fr); }
.summary-item {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
}
.summary-item + .summary-item { border-left: 1px solid var(--border-soft); }
.summary-dot, .card-dot, .status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.summary-dot { align-self: flex-start; margin-top: 7px; }
.dot-blue { background: var(--accent-primary); }
.dot-indigo { background: var(--accent-secondary); }
.dot-cyan { background: #0891b2; }
.dot-purple { background: #7c3aed; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: var(--positive); box-shadow: 0 0 0 4px var(--positive-bg); }
.summary-label { display: block; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.summary-value { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 15px; font-weight: 700; line-height: 1.25; }
.summary-value small { color: var(--text-secondary); font-size: 10px; font-weight: 500; }
.summary-note { margin-left: auto; color: var(--text-muted); font-size: 10px; text-align: right; }
.summary-change { font-family: var(--font-sans); font-size: 12px; }

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.chip-up { background: var(--positive-bg); color: var(--positive-text); }
.chip-down { background: var(--negative-bg); color: var(--negative-text); }
.chip-neutral { background: var(--bg-secondary); color: var(--text-secondary); }

.hero-block { padding: 38px 0 28px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--accent-primary); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
h1, h2, h3 { margin: 0; font-family: var(--font-sans); font-weight: 750; letter-spacing: -.035em; line-height: 1.16; }
h1 { max-width: 25ch; font-size: clamp(2rem, 3.4vw, 2.3rem); }
h1 span { color: var(--text-secondary); }
.hero-copy { max-width: 760px; margin: 14px 0 0; color: var(--text-secondary); font-size: 14px; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; color: var(--text-secondary); font-size: 11px; }

.insight-band {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 30px;
  align-items: center;
  padding: 22px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.insight-heading .eyebrow { margin-bottom: 6px; }
.insight-band h2 { font-size: clamp(1.25rem, 2.4vw, 1.65rem); }
.insight-band > p { margin: 0; color: var(--text-secondary); font-size: 13px; }

.dashboard-section { padding-top: 18px; }
.dashboard-card {
  min-width: 0;
  padding: 18px 20px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.card-heading { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.card-dot { margin-top: 7px; }
.card-kicker { margin: 0 0 3px; color: var(--accent-primary); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.card-heading h2 { font-size: 17px; }
.card-meta { color: var(--text-muted); font-size: 10px; text-align: right; white-space: nowrap; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.chart-caption { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 2px; color: var(--text-muted); font-size: 10px; }
.chart-shell { width: 100%; min-width: 0; max-width: 100%; min-height: 25rem; overflow-x: auto; }
.chart { width: 100%; min-width: 42rem; height: 25rem; }
.chart-shell-short { min-height: 22rem; }
.chart-shell-short .chart { min-width: 0; height: 22rem; }
.chart-note { max-width: 90ch; margin: 8px 0 0; color: var(--text-secondary); font-size: 11px; }
.chart-grid-note { display: flex; justify-content: space-between; gap: 12px; }
.reference-callout { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-secondary); }
.reference-callout h3 { font-size: 12px; }
.reference-callout p { margin: 7px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.65; }
.reference-source { padding-top: 10px; border-top: 1px solid var(--border); }

.view-toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-secondary); border-radius: var(--radius-pill); }
.view-button { border: 0; border-radius: var(--radius-pill); padding: 5px 9px; background: transparent; color: var(--text-secondary); font-size: 10px; }
.view-button:hover { color: var(--accent-primary); }
.view-button.is-active { background: var(--accent-primary); color: #fff; box-shadow: var(--shadow-sm); }

.dashboard-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-pair .dashboard-section { min-width: 0; }
.split-card { height: 100%; }
.session-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -2px 0 6px; color: var(--text-secondary); }
.session-toolbar label { color: var(--text-muted); font-size: 10px; font-weight: 700; }
.session-toolbar select {
  min-width: 124px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 9px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 10px;
}
.session-toolbar select:hover { border-color: var(--accent-primary); }
.toolbar-note { margin-left: auto; color: var(--text-muted); font-size: 10px; }

.compact-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 10px; }
.compact-table th, .compact-table td { padding: 8px 7px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.compact-table thead { color: var(--text-muted); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.compact-table tbody tr:hover { background: var(--accent-glow); }
.compact-table td:nth-child(n+3), .compact-table th:nth-child(n+3) { text-align: right; }
.compact-table tbody th { color: var(--text-primary); font-weight: 600; }

.methodology { padding-top: 24px; padding-bottom: 28px; }
.method-card { padding: 18px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.methodology details { margin: 0; }
.methodology summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; padding-bottom: 16px; font-size: 17px; font-weight: 750; }
.methodology summary::-webkit-details-marker { display: none; }
.methodology details[open] summary span { transform: rotate(45deg); }
.methodology summary span { color: var(--accent-primary); font-size: 22px; line-height: 1; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; padding-top: 16px; border-top: 1px solid var(--border); }
.method-grid h3 { color: var(--text-primary); font-size: 11px; letter-spacing: .02em; }
.method-grid p { margin: 6px 0 0; color: var(--text-secondary); font-size: 11px; }
.method-wide { grid-column: 1 / -1; }
.method-source { margin: 18px 0 0; padding-top: 13px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 10px; line-height: 1.7; }
code { padding: 1px 4px; border-radius: var(--radius-xs); background: var(--accent-glow); color: var(--text-primary); font-family: var(--font-mono); font-size: .92em; }

.site-footer { display: grid; grid-template-columns: 1fr 1.7fr 1fr; gap: 24px; padding: 20px 0 30px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 10px; }
.site-footer p { margin: 0; }
.footer-meta { text-align: right; }

.visually-hidden { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.no-js .data-table { position: static !important; left: auto !important; width: 100% !important; height: auto !important; margin: 12px 0 0 !important; overflow: auto !important; clip: auto !important; white-space: normal !important; border-collapse: collapse; font-size: 10px; }
.no-js .data-table th, .no-js .data-table td { padding: 6px; border: 1px solid var(--border); white-space: nowrap; text-align: right; }
.no-js .data-table th:first-child { text-align: left; }

@media (max-width: 900px) {
  .summary-note { display: none; }
  .dashboard-pair { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .content-wide { width: min(100% - 24px, 1240px); }
  .header-inner { min-height: 54px; }
  .header-actions { gap: 8px; }
  .header-date { font-size: 9px; }
  .theme-toggle { padding: 5px 8px; }
  .theme-label { display: none; }
  .summary-inner { grid-template-columns: 1fr; }
  .summary-item { min-height: 62px; padding: 10px 12px; }
  .summary-item + .summary-item { border-top: 1px solid var(--border-soft); border-left: 0; }
  .summary-value { font-size: 14px; }
  .hero-block { padding: 28px 0 22px; }
  h1 { font-size: 28px; }
  .hero-copy { font-size: 13px; }
  .insight-band { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .insight-band h2 { font-size: 20px; }
  .dashboard-card { padding: 15px 14px 16px; }
  .card-header { flex-direction: column; gap: 9px; }
  .header-tools { width: 100%; justify-content: space-between; }
  .card-meta { text-align: left; }
  .chart-shell { min-height: 20rem; }
  .chart { min-width: 34rem; height: 20rem; }
  .chart-shell-short { min-height: 18rem; }
  /* Keep the inline row-count height authoritative; never fix the outer shell on mobile. */
  .chart-shell-short .chart { height: auto; min-height: 18rem; }
  .method-grid { grid-template-columns: 1fr; gap: 15px; }
  .method-wide { grid-column: auto; }
  .site-footer { grid-template-columns: 1fr; gap: 10px; padding-bottom: 22px; }
  .footer-meta { text-align: left; }
}
