:root {
  color-scheme: light;
  --ink: #1d2521;
  --ink-soft: #58615d;
  --ink-faint: #7a837e;
  --paper: #f4f1ea;
  --paper-deep: #ebe7dd;
  --card: #fffdf8;
  --line: #d9d8d0;
  --line-strong: #b9bdb5;
  --accent: #186452;
  --accent-dark: #0e4b3c;
  --accent-soft: #dcece4;
  --warm: #b75e36;
  --shadow: 0 16px 40px rgba(38, 48, 43, 0.07);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

button,
select {
  font: inherit;
}

button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent-dark);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--warm);
}

button:focus-visible,
select:focus-visible,
a:focus-visible,
circle:focus-visible {
  outline: 3px solid rgba(24, 100, 82, 0.32);
  outline-offset: 3px;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 50px 0 34px;
}

.hero {
  max-width: 770px;
  padding: 8px 4px 40px;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 690px;
  margin: 15px 0 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 7vw, 74px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 590px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.meta-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

main {
  display: grid;
  gap: 18px;
}

.panel,
.stat-card {
  border: 1px solid rgba(185, 189, 181, 0.68);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.controls-panel {
  padding-bottom: 21px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}

.compact-head {
  align-items: center;
  margin-top: 7px;
  margin-bottom: 20px;
}

h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.detail-chip,
.table-count {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.field {
  min-width: 0;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.field-help {
  margin: 7px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.45;
}

select {
  width: 100%;
  min-height: 43px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 38px 0 13px;
  color: var(--ink);
  background-color: var(--card);
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  cursor: pointer;
}

select:hover {
  border-color: var(--accent);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 3px;
  background: var(--paper);
}

.segment {
  min-height: 35px;
  border: 0;
  border-radius: 7px;
  padding: 4px 8px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.segment small {
  display: block;
  color: inherit;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.segment:hover:not(:disabled) {
  color: var(--accent-dark);
}

.segment.is-active {
  color: var(--accent-dark);
  background: var(--card);
  box-shadow: 0 2px 8px rgba(25, 48, 39, 0.1);
}

.segment:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
  opacity: 0.58;
}

.control-note {
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--warm);
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
}

.stat-card {
  min-height: 124px;
  padding: 20px;
}

.stat-card-primary {
  border-color: rgba(24, 100, 82, 0.35);
  background: var(--accent-soft);
}

.stat-label {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 4vw, 33px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.stat-card-primary strong {
  color: var(--accent-dark);
}

.stat-card > span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.date-value {
  font-size: clamp(18px, 3vw, 26px) !important;
  letter-spacing: -0.025em !important;
}

.chart-panel {
  padding-right: 8px;
  padding-left: 8px;
  padding-bottom: 18px;
}

.chart-stage {
  position: relative;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 6px 4px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(220, 236, 228, 0.3), rgba(255, 253, 248, 0.18));
}

#chart {
  display: block;
  width: 100%;
  height: min(47vw, 420px);
  min-height: 260px;
  overflow: visible;
}

.grid-line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.axis-label {
  fill: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
}

.series-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.series-area {
  fill: url(#seriesFill);
  opacity: 0.68;
}

.point-hit {
  cursor: pointer;
  fill: var(--card);
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transition: r 120ms ease, fill 120ms ease, stroke-width 120ms ease;
}

.point-hit:hover,
.point-hit:focus,
.point-hit.is-selected {
  fill: var(--accent);
  stroke: var(--card);
  stroke-width: 3;
}

.point-hit:hover,
.point-hit:focus {
  r: 6;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 138px;
  max-width: 205px;
  border: 1px solid rgba(24, 100, 82, 0.36);
  border-radius: 10px;
  padding: 9px 11px;
  pointer-events: none;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.82);
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 26px rgba(38, 48, 43, 0.13);
  font-size: 12px;
}

.tooltip-period {
  display: block;
  color: var(--accent-dark);
  font-weight: 800;
}

.tooltip-value {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 800;
}

.tooltip-date {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  color: var(--ink-soft);
  text-align: center;
}

.chart-empty[hidden],
.chart-tooltip[hidden] {
  display: none;
}

.chart-empty strong {
  color: var(--ink);
}

.chart-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  font-size: 12px;
}

.chart-footer p {
  margin: 0;
}

.chart-footer p:first-child {
  color: var(--ink-soft);
}

.muted-note {
  color: var(--ink-faint);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.detail-panel,
.table-panel {
  min-width: 0;
}

.detail-chip {
  color: var(--accent-dark);
  border-color: rgba(24, 100, 82, 0.3);
  background: var(--accent-soft);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.detail-grid > div {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 12px 12px 0;
}

.detail-grid > div:nth-child(odd) {
  margin-right: 12px;
}

.detail-grid dt {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-grid dd {
  min-height: 21px;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.detail-grid dd a {
  font-weight: 750;
}

.detail-note {
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.table-count {
  background: var(--paper);
}

.table-wrap {
  max-height: 390px;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
  font-variant-numeric: tabular-nums;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--ink-faint);
  background: var(--card);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td {
  color: var(--ink-soft);
  font-size: 12px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.is-selected {
  background: var(--accent-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody td:first-child {
  color: var(--ink);
  font-weight: 800;
}

.missing-cell {
  color: var(--ink-faint);
  font-style: italic;
}

.source-link {
  color: var(--accent-dark);
  font-weight: 750;
}

.policy-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 15px;
  border-color: rgba(183, 94, 54, 0.28);
  background: #fffaf0;
  box-shadow: none;
}

.policy-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(183, 94, 54, 0.42);
  border-radius: 999px;
  color: var(--warm);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
}

.policy-panel h2 {
  font-size: clamp(20px, 3vw, 27px);
}

.policy-panel p {
  max-width: 820px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.policy-footnote {
  color: var(--ink-faint) !important;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 0 4px;
  color: var(--ink-faint);
  font-size: 11px;
}

.no-script {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--ink);
  background: var(--paper);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 22px, 680px);
    padding-top: 31px;
  }

  .hero {
    padding-bottom: 29px;
  }

  .control-grid,
  .summary-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .control-grid {
    gap: 14px;
  }

  .stat-card {
    min-height: 105px;
  }

  .chart-footer {
    display: block;
  }

  .chart-footer p + p {
    margin-top: 5px;
  }
}

@media (max-width: 500px) {
  .app-shell {
    width: calc(100% - 16px);
    padding-top: 22px;
  }

  .panel {
    padding: 17px;
    border-radius: 14px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .hero-meta {
    gap: 7px 14px;
    font-size: 11px;
  }

  .section-head {
    display: block;
  }

  .detail-chip,
  .table-count {
    margin-top: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid > div:nth-child(odd) {
    margin-right: 0;
  }

  .footer {
    display: block;
    line-height: 1.8;
  }
}

/* Multi-metric small multiples */
.fundamentals-picker {
  display: grid;
  grid-template-columns: minmax(154px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}

.picker-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.metric-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 7px;
}

.metric-groups {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.metric-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px;
  background: rgba(244, 241, 234, 0.38);
}

.metric-group-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.metric-group-heading .field-label {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.metric-group-heading p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.group-action,
.select-all-button {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--accent-dark);
  background: var(--card);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.group-action:hover,
.select-all-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.metric-group .metric-picker {
  grid-template-columns: repeat(5, minmax(82px, 1fr));
}

.metric-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.metric-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.metric-option span {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 7px;
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.metric-option:hover span {
  border-color: var(--line-strong);
  color: var(--ink);
}

.metric-option input:checked + span {
  border-color: rgba(24, 100, 82, 0.48);
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(24, 100, 82, 0.08);
}

.metric-option input:focus-visible + span {
  outline: 3px solid rgba(24, 100, 82, 0.32);
  outline-offset: 2px;
}

.metric-picker-note {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.controls-panel .control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
  margin-top: 14px;
}

.range-segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.range-segmented .segment {
  min-width: 0;
}

.chart-stage {
  min-height: 320px;
}

#chart {
  height: 320px;
  min-height: 320px;
  overflow: visible;
}

.panel-frame {
  fill: rgba(255, 253, 248, 0.86);
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.panel-title {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.panel-unit {
  fill: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
}

.panel-grid-line,
.chart-axis-line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.panel-axis-label,
.chart-axis-label {
  fill: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
}

.series-line {
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.small-point {
  pointer-events: none;
  stroke: var(--card);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.small-point.is-selected {
  stroke: var(--ink);
  stroke-width: 2.5;
}

.small-point:focus {
  stroke: var(--ink);
  stroke-width: 3;
  outline: none;
}

.panel-no-data {
  fill: var(--ink-faint);
  font-size: 11px;
  font-style: italic;
}

.chart-overlay {
  fill: transparent;
  cursor: crosshair;
  outline: none;
  pointer-events: all;
  touch-action: none;
}

.chart-overlay:focus-visible {
  outline: 3px solid rgba(24, 100, 82, 0.32);
  outline-offset: 4px;
}

.crosshair-line {
  stroke: var(--ink);
  stroke-dasharray: 5 5;
  stroke-opacity: 0.58;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.crosshair-point {
  stroke: var(--card);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-tooltip {
  width: min(236px, calc(100% - 16px));
  max-height: min(360px, calc(100% - 16px));
  overflow: auto;
}

.chart-tooltips {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.panel-tooltip {
  width: min(190px, calc(100% - 16px));
  max-width: 190px;
  max-height: none;
  overflow: visible;
  border-color: color-mix(in srgb, var(--metric-color) 45%, var(--line));
  border-left: 3px solid var(--metric-color);
  padding: 7px 9px;
}

.panel-tooltip[hidden] {
  display: none;
}

.tooltip-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.tooltip-heading strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-tooltip .tooltip-period {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.15;
}

.panel-tooltip .tooltip-value {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.05;
}

.panel-tooltip .tooltip-unit {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 650;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-tooltip.is-missing .tooltip-value {
  color: var(--ink-faint) !important;
  font-size: 12px;
}

.tooltip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 5px;
  font-size: 11px;
}

.tooltip-row span {
  color: var(--ink-soft);
}

.tooltip-metric-label {
  display: inline-flex;
  min-width: 0;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.2;
}

.tooltip-label-block {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tooltip-label-block strong {
  color: var(--ink) !important;
  font-size: 10px;
  line-height: 1.15;
}

.tooltip-scope {
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.15;
}

.tooltip-metric-label > span:last-child {
  overflow-wrap: anywhere;
}

.tooltip-swatch {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 3px;
  border-radius: 999px;
}

.tooltip-row strong {
  font-size: 12px;
  white-space: nowrap;
}

.tooltip-value-block {
  display: grid;
  min-width: 0;
  justify-items: end;
  gap: 1px;
  text-align: right;
}

.tooltip-value-block strong {
  line-height: 1.15;
}

.tooltip-row .tooltip-unit,
.tooltip-row .tooltip-score,
.tooltip-row .tooltip-scale {
  max-width: 132px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.15;
  white-space: normal;
}

.tooltip-row .tooltip-score {
  color: var(--accent-dark);
  font-weight: 800;
}

.tooltip-row .tooltip-scale {
  color: var(--ink-faint);
  font-size: 8px;
}

.tooltip-row .tooltip-note {
  color: var(--ink-faint);
  font-size: 8px;
}

.tooltip-row .tooltip-basis {
  max-width: 148px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.detail-metric {
  min-width: 0;
  border-left: 3px solid var(--metric-color, var(--accent));
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--paper);
}

.detail-metric-heading,
.detail-metric-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.detail-metric-heading strong {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.detail-metric-value {
  color: var(--metric-color, var(--accent-dark));
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.detail-metric-meta {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 10px;
}

.detail-metric-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-metric-meta a {
  flex-shrink: 0;
  font-weight: 750;
}

.table-detail-button {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 3px 7px;
  color: var(--accent-dark);
  background: var(--card);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.table-detail-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 780px) {
  .fundamentals-picker {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .metric-picker {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }

  .metric-group .metric-picker {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }

  .controls-panel .control-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .detail-metrics {
    grid-template-columns: 1fr;
  }
}

/* Fullscreen chart shell keeps the exit toggle, SVG, axes, crosshair, and tooltips in the viewport. */
.chart-panel:fullscreen,
.chart-panel.is-full-view-fallback {
  position: relative;
  display: block;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--paper);
}

.chart-panel.is-full-view-fallback {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: auto;
  height: auto;
}

.chart-panel:fullscreen > .section-head,
.chart-panel.is-full-view-fallback > .section-head {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: block;
  margin: 0;
  padding: 14px 18px;
  pointer-events: none;
}

.chart-panel:fullscreen > .section-head > div:first-child,
.chart-panel.is-full-view-fallback > .section-head > div:first-child {
  display: none;
}

.chart-panel:fullscreen .chart-header-tools,
.chart-panel.is-full-view-fallback .chart-header-tools {
  position: absolute;
  top: 14px;
  right: 18px;
  left: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: none;
  margin: 0;
  pointer-events: none;
}

.chart-panel:fullscreen .full-view-button,
.chart-panel.is-full-view-fallback .full-view-button {
  pointer-events: auto;
}

.chart-panel:fullscreen > .chart-footer,
.chart-panel.is-full-view-fallback > .chart-footer {
  display: none;
}

.chart-panel:fullscreen > .chart-stage,
.chart-panel.is-full-view-fallback > .chart-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 10px;
  border: 0;
  border-radius: 0;
  overflow: auto;
}

.chart-panel:fullscreen #chart,
.chart-panel.is-full-view-fallback #chart {
  width: 100%;
  height: 100% !important;
  min-height: 0;
}

.chart-panel:fullscreen .chart-tooltip,
.chart-panel.is-full-view-fallback .chart-tooltip {
  z-index: 6;
}

.chart-panel:fullscreen .chart-tooltips,
.chart-panel.is-full-view-fallback .chart-tooltips {
  z-index: 6;
}

@media (max-width: 500px) {
  .chart-panel:fullscreen > .section-head,
  .chart-panel.is-full-view-fallback > .section-head {
    padding: 10px 8px;
  }

  .chart-panel:fullscreen .chart-header-tools,
  .chart-panel.is-full-view-fallback .chart-header-tools {
    top: 10px;
    right: 8px;
    left: 8px;
  }

}

.annual-eps-panel {
  margin-top: 18px;
}

.annual-eps-note {
  max-width: 780px;
  margin: 12px 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
}

.annual-eps-table-wrap {
  max-height: 330px;
}

.annual-eps-table {
  min-width: 560px;
}

@media (max-width: 500px) {
  .range-segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-group .metric-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-group-heading {
    align-items: center;
  }

  .metric-option span {
    min-height: 36px;
  }
}

/* Full-window chart shell */
.chart-header-tools {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.full-view-button {
  flex-shrink: 0;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--accent-dark);
  background: var(--card);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.full-view-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.full-view-button span {
  margin-left: 4px;
  font-size: 14px;
}

.chart-panel:fullscreen,
.chart-panel.is-full-view-fallback {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 22px 28px 18px;
  overflow: hidden;
  background: var(--paper);
}

.chart-panel.is-full-view-fallback {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: auto;
  height: auto;
}

.chart-panel:fullscreen .section-head,
.chart-panel.is-full-view-fallback .section-head {
  min-width: 0;
  margin-bottom: 0;
}

.chart-panel:fullscreen .chart-stage,
.chart-panel.is-full-view-fallback .chart-stage {
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.chart-panel:fullscreen .chart-footer,
.chart-panel.is-full-view-fallback .chart-footer {
  padding-top: 2px;
}

.chart-panel:fullscreen .chart-header-tools,
.chart-panel.is-full-view-fallback .chart-header-tools {
  max-width: 680px;
}

body.full-view-active {
  overflow: hidden;
}

@media (max-width: 780px) {
  .chart-header-tools {
    justify-content: flex-start;
    margin-top: 11px;
  }

  .chart-panel:fullscreen,
  .chart-panel.is-full-view-fallback {
    padding: 16px 15px 13px;
  }
}

@media (max-width: 500px) {
  .chart-header-tools {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
  }

  .chart-panel:fullscreen,
  .chart-panel.is-full-view-fallback {
    padding: 12px 8px 10px;
  }

  .chart-panel:fullscreen .chart-header-tools,
  .chart-panel.is-full-view-fallback .chart-header-tools {
    display: grid;
  }

}

/* Raw-unit small multiples */
.fundamentals-picker {
  grid-template-columns: minmax(154px, 0.34fr) minmax(130px, auto);
}

.metric-picker {
  grid-column: 1 / -1;
}

.select-all-button {
  justify-self: end;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--accent-dark);
  background: var(--card);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.select-all-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.select-all-button[aria-pressed="true"] {
  color: var(--ink-soft);
  background: var(--paper);
}

.metric-picker-warning {
  margin: 5px 0 0;
  color: var(--warm);
  font-size: 11px;
  line-height: 1.45;
}

.small-multiple-panel .panel-frame {
  fill: rgba(255, 253, 248, 0.86);
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.small-multiple-panel .panel-title {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.small-multiple-panel .panel-unit {
  fill: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
}

.small-multiple-panel .panel-grid-line,
.small-multiple-panel .panel-axis-line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.small-multiple-panel .panel-axis-line {
  stroke: var(--line-strong);
}

.small-multiple-panel .panel-axis-label {
  fill: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
}

.small-multiple-panel .series-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.small-multiple-panel .small-point {
  pointer-events: none;
  stroke: var(--card);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.small-multiple-panel .small-point.is-selected {
  stroke: var(--ink);
  stroke-width: 2.5;
}

.small-multiple-panel .small-point:focus {
  stroke: var(--ink);
  stroke-width: 3;
  outline: none;
}

.small-multiple-panel .panel-no-data {
  fill: var(--ink-faint);
  font-size: 11px;
  font-style: italic;
}

.chart-panel:fullscreen #chart,
.chart-panel.is-full-view-fallback #chart {
  height: max(var(--chart-render-height), 100%) !important;
  min-height: 0;
}

@media (max-width: 780px) {
  .fundamentals-picker {
    grid-template-columns: 1fr;
  }

  .select-all-button {
    justify-self: start;
  }
}

/* Mobile charts use the stage as their single horizontal visual boundary. */
@media (max-width: 500px) {
  .app-shell {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .controls-panel,
  .chart-panel {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .chart-panel {
    padding-left: 0;
    padding-right: 0;
  }

  .chart-stage {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .small-multiple-panel .panel-axis-label {
    font-size: 9.5px;
  }
}
