:root {
  --ink: #faf7f1;
  --surface: #ffffff;
  --surface-raised: #f2ece0;
  --text: #2a2a24;
  --text-dim: #5c594e;
  --dawn: #b08d57;
  --dawn-soft: rgba(176, 141, 87, 0.1);
  --dawn-soft-strong: rgba(176, 141, 87, 0.2);
  --line: #e3dac7;
  --link: #8c6d3e;
  --night: #1f3b33;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #10201b;
    --surface: #17281f;
    --surface-raised: #1e3129;
    --text: #f0ece0;
    --text-dim: #a9b5ab;
    --dawn: #d8c39b;
    --dawn-soft: rgba(216, 195, 155, 0.12);
    --dawn-soft-strong: rgba(216, 195, 155, 0.2);
    --line: #2c4239;
    --link: #e3d4ab;
    --night: #0d1a15;
  }
}

:root[data-theme="dark"] {
  --ink: #10201b;
  --surface: #17281f;
  --surface-raised: #1e3129;
  --text: #f0ece0;
  --text-dim: #a9b5ab;
  --dawn: #d8c39b;
  --dawn-soft: rgba(216, 195, 155, 0.12);
  --dawn-soft-strong: rgba(216, 195, 155, 0.2);
  --line: #2c4239;
  --link: #e3d4ab;
  --night: #0d1a15;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.9;
}

h1, h2, .display {
  font-family: "Zen Old Mincho", "Noto Serif JP", serif;
  text-wrap: balance;
}

a { color: var(--link); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--night);
  color: #f2ede2;
  overflow: hidden;
  padding: 76px 24px 46px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, #8c6d3e 0%, #b08d57 55%, #d8c39b 100%);
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.back-to-clinic {
  display: inline-block;
  font-size: 13px;
  color: #d8c39b;
  text-decoration: none;
  opacity: 0.85;
  margin-bottom: 18px;
}

.back-to-clinic:hover {
  opacity: 1;
  text-decoration: underline;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #d8c39b;
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: #d8c39b;
  display: inline-block;
}

.hero h1 {
  font-size: clamp(30px, 5.4vw, 46px);
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}

.hero p.lead {
  max-width: 32em;
  color: #e7e0cf;
  font-size: 15.5px;
  margin: 0;
}

/* ---------- Main ---------- */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 52px 24px 90px;
}

.section-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--dawn);
  margin: 0 0 8px;
}

.section-title {
  font-size: 21px;
  margin: 0 0 6px;
}

.section-sub {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 0 0 30px;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--dawn-soft-strong) transparent;
}

.article-list::-webkit-scrollbar { width: 8px; }
.article-list::-webkit-scrollbar-track { background: transparent; }
.article-list::-webkit-scrollbar-thumb {
  background: var(--dawn-soft-strong);
  border-radius: 999px;
}
.article-list::-webkit-scrollbar-thumb:hover { background: var(--dawn); }

.article-item {
  border-bottom: 1px solid var(--line);
}

.article-toggle {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 16px;
  background: none;
  border: none;
  text-align: left;
  padding: 20px 4px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}

.article-toggle:hover .article-title { color: var(--dawn); }
.article-toggle:focus-visible { outline: 2px solid var(--dawn); outline-offset: 4px; }

.num {
  font-family: "Zen Old Mincho", serif;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--dawn);
  flex-shrink: 0;
  padding-top: 2px;
}

.article-title-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-title {
  font-size: 16px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.article-date {
  font-size: 11.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.chev {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  transition: transform 0.25s ease;
  margin-top: 3px;
}

.article-item[data-open="true"] .chev { transform: rotate(45deg); color: var(--dawn); }

.article-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.article-panel-inner {
  padding: 0 4px 26px 40px;
}

.article-panel-inner p {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--text);
  max-width: 34em;
}

.article-lead {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 34em;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--dawn);
  background: var(--dawn-soft);
  border-radius: 0 6px 6px 0;
}

.article-lead .lead-tag {
  flex-shrink: 0;
  font-family: "Zen Old Mincho", serif;
  font-size: 12px;
  color: var(--dawn);
  letter-spacing: 0.06em;
  padding-top: 1px;
}

.article-lead p {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  max-width: none;
}

.sources {
  background: var(--dawn-soft);
  border: 1px solid var(--dawn-soft-strong);
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 12.5px;
  max-width: 34em;
}

.sources-label {
  font-family: "Zen Old Mincho", serif;
  color: var(--dawn);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-size: 12px;
}

.sources ol {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dim);
}

.sources a { text-decoration: none; }
.sources a:hover { text-decoration: underline; }

/* ---------- Article visuals: tables, bar charts, stat tiles ---------- */
.viz {
  max-width: 34em;
  margin: 0 0 22px;
}

.viz-title {
  font-family: "Zen Old Mincho", serif;
  font-size: 13px;
  color: var(--dawn);
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.viz-note {
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 8px 0 0;
}

/* tables */
.viz-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.viz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.viz-table th,
.viz-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.viz-table thead th {
  background: var(--surface-raised);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
}

.viz-table tbody tr:last-child td { border-bottom: none; }
.viz-table td.num { font-variant-numeric: tabular-nums; color: var(--dawn); }

/* bar charts */
.viz-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-group-label {
  font-size: 12px;
  color: var(--text-dim);
  margin: 10px 0 2px;
  letter-spacing: 0.04em;
}

.bar-group-label:first-child { margin-top: 0; }

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 64px;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.3;
}

.bar-sub {
  font-size: 10.5px;
  opacity: 0.85;
}

.bar-track {
  position: relative;
  height: 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: visible;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--dawn);
}

.bar-fill.fill-warn { background: #a2483b; }
.bar-fill.fill-calm { background: #3e6b52; }

.bar-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  background: var(--text);
  opacity: 0.6;
}

.bar-value {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
}

/* stat tiles */
.viz-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-tile {
  background: var(--dawn-soft);
  border: 1px solid var(--dawn-soft-strong);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-family: "Zen Old Mincho", serif;
  font-size: 26px;
  color: var(--dawn);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

@media (max-width: 480px) {
  .viz-stats { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 84px 1fr 54px; }
}

/* ---------- CTA ---------- */
.cta {
  margin-top: 48px;
  padding: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--dawn-soft), transparent);
  border: 1px solid var(--dawn-soft-strong);
}

.cta .section-label { margin-bottom: 10px; }

.cta p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text);
  max-width: 34em;
}

.cta strong { color: var(--dawn); }

footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 60px;
  color: var(--text-dim);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .chev, .article-panel { transition: none; }
}
