:root {
  --bg-paper: #f6f1e8;
  --bg-card: rgba(255, 252, 246, 0.94);
  --ink: #203028;
  --muted: #6a675f;
  --line: #d8d1c4;
  --accent: #215f4b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(214, 235, 225, 0.9), transparent 28%),
    linear-gradient(180deg, #fbf8f2 0%, var(--bg-paper) 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1460px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--accent);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent);
}

.hero h1,
.section-heading h2,
.card h3 {
  margin: 0;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.subtitle,
.hero-meta,
.section-heading p,
.card p {
  color: var(--muted);
}

.hero-meta {
  min-width: 180px;
  text-align: right;
  font-size: 14px;
}

.hero-meta strong {
  display: block;
  color: var(--accent);
  font-size: 18px;
  margin-top: 4px;
}

.toolbar,
.section-block {
  margin-top: 26px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(8px);
}

.segmented-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.segmented-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segment {
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.segment.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.section-heading {
  margin-bottom: 14px;
}

.control-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.zoom-help {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.zoom-help-title {
  font-weight: 600;
  color: var(--ink);
}

.zoom-help-items {
  display: flex;
  gap: 10px 18px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.zoom-help kbd {
  display: inline-block;
  min-width: 30px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: center;
}

.zoom-reset-inline {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  cursor: pointer;
}

.control-select {
  min-width: min(100%, 420px);
  padding: 10px 42px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf2;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.section-heading h2 {
  font-size: 28px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  padding: 18px 20px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(36, 41, 35, 0.06);
  overflow: hidden;
}

.card-top {
  margin-bottom: 8px;
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.card h3 {
  font-size: 24px;
}

.card p {
  margin: 8px 0 0;
  font-size: 14px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top-width: 2px;
  border-top-style: solid;
  position: relative;
}

.legend-line::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  border: 1.4px solid #1f4e79;
}

.legend-line-blue {
  border-top-color: #1f4e79;
}

.legend-line-red {
  border-top-color: #c62828;
}

.legend-line-red::after {
  display: none;
}

.legend-line-solid::after {
  display: none;
}

.chart {
  width: 100%;
  height: 420px;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-meta {
    text-align: left;
  }

  .card-header-row {
    flex-direction: column;
    gap: 8px;
  }

  .control-strip {
    align-items: flex-start;
  }

  .zoom-help {
    align-items: flex-start;
  }

  .control-select {
    width: 100%;
  }
}
