:root {
  color-scheme: light;
  --brand: #c7271e;
  --brand-dark: #a91d16;
  --brand-soft: #fff2f1;
  --ink: #242629;
  --muted: #667085;
  --line: #d8dce1;
  --green: #16794b;
  --green-soft: #edf8f2;
  --teal: #4d7f8a;
  --surface: #ffffff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
}

button, h1, h2, p { letter-spacing: 0; }

button { font: inherit; }

.app-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 26px;
}

.product-header {
  border-bottom: 3px solid var(--brand);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--brand);
}

.brand-icon svg { width: 28px; height: 28px; }

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
}

.product-header p {
  margin: 7px 0 0 40px;
  color: var(--muted);
}

.selector-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1.15fr);
  gap: 18px;
  align-items: end;
}

.selector-group h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
}

.live-group h2 { color: var(--green); }

.example-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.live-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scenario-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.scenario-button:hover { background: #f6f7f8; }

.scenario-button:focus-visible {
  outline: 3px solid rgba(22, 121, 75, 0.22);
  outline-offset: 2px;
}

.scenario-button svg { width: 18px; height: 18px; flex: 0 0 auto; }

.scenario-button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.live-button {
  min-height: 50px;
  border-radius: 0;
}

.live-button:first-child { border-radius: 6px 0 0 6px; }
.live-button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }

.live-button[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}

.live-button[aria-pressed="true"] + .live-button { border-left: 1px solid var(--green); }

.context-line {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.context-line strong { color: #4e5560; font-weight: 500; }
.feed-status { color: var(--green); font-weight: 500; }

.decision-panel {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-left: 5px solid var(--brand);
  background: var(--brand-soft);
  padding: 12px 16px;
  border-radius: 5px;
}

.decision-panel.clear {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.decision-panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.decision-panel p {
  margin: 5px 0 0;
  color: #4b4f56;
}

.peak-summary {
  min-width: 210px;
  text-align: right;
  color: var(--muted);
}

.peak-summary strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
}

.peak-summary span { display: block; margin-top: 4px; }

.forecast-section { margin-top: 13px; }

.chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.chart-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.chart-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 5px 0 12px;
}

.legend-swatch:first-child { margin-left: 0; }
.legend-swatch.high { background: var(--brand); }
.legend-swatch.standard { background: var(--teal); }

.chart-surface {
  display: block;
  width: 100%;
  height: 292px;
  margin-top: 7px;
}

.chart-surface svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid { stroke: #e7eaee; stroke-width: 1; }
.chart-axis { stroke: #cdd1d6; stroke-width: 1; }
.chart-tick { fill: #626a74; font-size: 12px; }
.chart-y-label { fill: #4d535b; font-size: 12px; }
.chart-threshold { stroke: #a05b00; stroke-width: 2; stroke-dasharray: 4 4; }
.chart-label-background { fill: #ffffff; fill-opacity: 0.9; }
.chart-threshold-label { fill: #8b4e00; font-size: 12px; font-weight: 500; }
.chart-peak-label { fill: var(--ink); font-size: 12px; font-weight: 500; }
.chart-peak-line { stroke: var(--ink); stroke-width: 1.4; }
.chart-prep-window { fill: #dceee4; }
.chart-bar-standard { fill: var(--teal); }
.chart-bar-high { fill: var(--brand); }

.plan-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.plan-item {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.plan-number {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #eef0f2;
  color: #3f4349;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.plan-copy strong {
  display: block;
  font-weight: 500;
}

.plan-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

footer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 850px) {
  .selector-layout { grid-template-columns: 1fr; }
  .chart-surface { height: 290px; }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 28px, 560px);
    padding-top: 18px;
  }

  h1 { font-size: 24px; }
  .product-header p { margin-left: 0; line-height: 1.5; }
  .example-buttons { grid-template-columns: 1fr; gap: 9px; }
  .scenario-button { min-height: 46px; }
  .selector-layout { gap: 18px; }

  .decision-panel {
    display: block;
    padding: 13px 14px;
  }

  .decision-panel h2 { font-size: 18px; }
  .decision-panel p { line-height: 1.45; }
  .peak-summary { text-align: left; margin-top: 13px; }
  .peak-summary strong { white-space: normal; }

  .chart-header { display: block; }
  .chart-header p { margin-top: 5px; }
  .chart-surface { height: 260px; }
  .chart-tick, .chart-y-label, .chart-threshold-label, .chart-peak-label { font-size: 11px; }
  .plan-row { grid-template-columns: 1fr; gap: 14px; }
}
