:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --ink: #172026;
  --muted: #5f6b70;
  --line: #d7ddd8;
  --panel: #ffffff;
  --accent: #1f6f8b;
  --accent-strong: #0f536b;
  --warn: #c47f2c;
  --yield: #0b8f4d;
  --price: #d64235;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 42px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: 0;
}

.subhead {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.version {
  display: grid;
  gap: 4px;
  min-width: 172px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 20px;
}

.metric {
  min-height: 104px;
  padding: 18px;
  background: var(--panel);
}

.metric .label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 32px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.metric.highlight strong {
  color: var(--accent-strong);
}

.chart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  margin-bottom: 22px;
}

.chart-wrap {
  position: relative;
  min-height: 360px;
}

#yieldChart {
  display: block;
  width: 100%;
  min-height: 360px;
  touch-action: manipulation;
}

.chart-grid line {
  stroke: #d3d9d8;
  stroke-width: 1;
}

.chart-axis text {
  fill: #566166;
  font-size: 13px;
}

.chart-axis .price-axis {
  fill: var(--price);
}

.chart-legend text {
  fill: #566166;
  font-size: 13px;
  font-weight: 700;
}

.chart-legend line {
  stroke-linecap: round;
  stroke-width: 3;
}

.chart-legend .legend-yield {
  stroke: var(--yield);
}

.chart-legend .legend-price {
  stroke: var(--price);
}

.chart-area {
  fill: rgba(11, 143, 77, 0.12);
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-line-yield {
  stroke: var(--yield);
}

.chart-line-price {
  stroke: var(--price);
  stroke-width: 2.4;
}

.chart-overlay {
  cursor: crosshair;
  fill: transparent;
  pointer-events: all;
}

.hit-layer circle {
  cursor: pointer;
  fill: transparent;
  pointer-events: all;
}

.hit-layer circle:focus {
  outline: none;
  stroke: var(--warn);
  stroke-width: 2;
}

.selected-guide {
  stroke: var(--warn);
  stroke-dasharray: 4 4;
  stroke-width: 1.2;
}

.selected-point {
  fill: var(--yield);
  stroke: #ffffff;
  stroke-width: 2;
}

.selected-price-point {
  fill: var(--price);
  stroke: #ffffff;
  stroke-width: 2;
}

.point-readout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-top: 12px;
}

.point-readout > div {
  min-height: 74px;
  padding: 13px 14px;
  background: #fbfcfa;
}

.point-readout .label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.point-readout strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.chart-panel img {
  display: block;
  width: 100%;
  height: auto;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

.details-wide {
  grid-column: 1 / -1;
}

.details h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.downloads a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #eef7f8;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.downloads a:hover {
  background: #e2f1f4;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0 34px;
  }

  .topbar,
  .details {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 18px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.12;
  }

  .subhead {
    margin-top: 10px;
    font-size: 15px;
  }

  .version {
    min-width: 0;
    text-align: left;
  }

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

  .point-readout {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    min-height: 92px;
    padding: 14px;
  }

  .metric strong {
    font-size: 24px;
  }

  .point-readout strong {
    font-size: 19px;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 30px;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 14px;
  }

  .point-readout {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    min-height: 82px;
    padding: 12px;
  }

  .metric .label {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .metric strong {
    font-size: 22px;
  }

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

  .chart-wrap,
  #yieldChart {
    min-height: 330px;
  }

  .chart-axis text,
  .chart-legend text {
    font-size: 11px;
  }

  .point-readout > div {
    min-height: 66px;
    padding: 11px 12px;
  }

  .point-readout strong {
    font-size: 18px;
  }

  .details h2 {
    font-size: 17px;
  }

  .details p {
    font-size: 15px;
  }

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

  .downloads a {
    min-height: 46px;
    padding: 0 10px;
    font-size: 15px;
    line-height: 1.2;
  }
}

@media (max-width: 350px) {
  .metrics,
  .point-readout,
  .downloads {
    grid-template-columns: 1fr;
  }
}
