:root {
  color-scheme: dark;
  --ink: #f0f5f7;
  --muted: #9baab3;
  --line: #293841;
  --canvas: #11181d;
  --surface: #172128;
  --surface-hover: #1d2a32;
  --cyan: #35c6ee;
  --cyan-soft: #173c49;
  --green: #48d39d;
  --amber: #ffc467;
  --red: #ff8585;
}

* { box-sizing: border-box; }

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

button, input { font: inherit; }

.shell { max-width: 1440px; margin: 0 auto; padding: 0 32px 48px; }

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { width: 230px; height: auto; }
.topbar__meta { text-align: right; display: grid; gap: 4px; font-size: 14px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }

.control-band {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 0 32px;
  border-bottom: 1px solid var(--line);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 28px; font-weight: 650; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: 0; }
.subtle { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.return-control { width: min(360px, 100%); display: grid; gap: 9px; align-content: start; }
.return-control label { font-size: 13px; font-weight: 700; }
.return-control__input { display: flex; align-items: center; width: 160px; border-bottom: 2px solid var(--cyan); }
.return-control__input input { width: 128px; border: 0; background: transparent; padding: 5px 0; font-size: 28px; font-weight: 650; outline: none; }
.return-control__input span { color: var(--muted); font-size: 18px; font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--cyan); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.kpi { min-height: 118px; display: grid; align-content: center; gap: 8px; padding: 22px 24px; border-right: 1px solid var(--line); }
.kpi:first-child { padding-left: 0; }
.kpi:last-child { border-right: 0; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 650; }
.kpi strong { font-size: 24px; font-weight: 650; letter-spacing: 0; }
.kpi--accent strong { color: var(--green); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 28px 0 8px; }
.chart-panel { min-height: 330px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.panel-heading h2 { font-size: 18px; }
.panel-note { max-width: 150px; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: right; }
.donut-layout { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; gap: 24px; }
.donut { position: relative; display: grid; width: 168px; height: 168px; place-items: center; border-radius: 50%; }
.donut::before { position: absolute; width: 102px; height: 102px; border-radius: 50%; background: var(--surface); content: ""; }
.donut > div { z-index: 1; display: grid; gap: 4px; max-width: 130px; text-align: center; }
.donut span { color: var(--muted); font-size: 11px; font-weight: 700; }
.donut strong { font-size: 15px; line-height: 1.1; }
.donut--empty { background: #2a353c; }
.chart-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; max-height: 214px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.chart-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 6px; align-items: center; color: #c6d0d5; font-size: 11px; }
.chart-legend li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-empty { display: block !important; color: var(--muted) !important; }
.bar-chart { display: grid; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 5px; }
.bar-row { display: grid; grid-template-columns: 132px minmax(90px, 1fr) 95px; gap: 10px; align-items: center; min-height: 15px; }
.bar-row > span { overflow: hidden; color: #c6d0d5; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bar-row strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: #26353d; }
.bar-fill { height: 100%; min-width: 3px; border-radius: inherit; }

.workbench { padding: 34px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.actions { display: flex; gap: 8px; }
.button { border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 700; }
.button--secondary { background: var(--surface); color: var(--ink); }
.button--secondary:hover { border-color: var(--cyan); color: var(--cyan); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; min-width: 1010px; border-collapse: collapse; }
th { background: #202c33; color: #b6c4cb; font-size: 12px; font-weight: 750; text-align: left; text-transform: uppercase; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-hover); }
td { font-size: 14px; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.notional-input { width: 148px; padding: 7px 8px; border: 1px solid #4a5c66; border-radius: 4px; background: #10171c; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; outline-color: var(--cyan); }
.model-badge { display: inline-block; padding: 4px 7px; border-radius: 3px; background: var(--cyan-soft); color: #7bdaf2; font-size: 12px; font-weight: 700; }
.revenue { color: var(--green); font-weight: 750; }
.negative { color: var(--red); }

.methodology { display: grid; grid-template-columns: minmax(220px, .7fr) 2fr; gap: 48px; padding: 30px 0; border-top: 1px solid var(--line); }
.methodology__rules { display: grid; gap: 12px; color: #c0cbd1; font-size: 14px; line-height: 1.55; }
.methodology__rules p { margin: 0; }
.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: 900px) {
  .shell { padding: 0 18px 32px; }
  .topbar { min-height: 80px; }
  .brand { width: 185px; }
  .topbar__meta { display: none; }
  .control-band, .section-heading { align-items: start; flex-direction: column; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .kpi:first-child { padding-left: 24px; }
  .methodology { grid-template-columns: 1fr; gap: 18px; }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  h1 { font-size: 24px; }
  .kpi strong { font-size: 19px; }
  .kpi { min-height: 100px; padding: 16px; }
}

@media (max-width: 700px) {
  .chart-panel { min-height: 0; padding: 18px; }
  .panel-heading { display: grid; gap: 6px; }
  .panel-note { max-width: none; text-align: left; }
  .donut-layout { grid-template-columns: 130px minmax(0, 1fr); gap: 14px; }
  .donut { width: 130px; height: 130px; }
  .donut::before { width: 78px; height: 78px; }
  .donut strong { font-size: 12px; }
  .chart-legend { grid-template-columns: 1fr; max-height: 190px; }
  .bar-row { grid-template-columns: 96px minmax(64px, 1fr) 76px; gap: 7px; }
  .bar-row strong { font-size: 10px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  table, tbody, tr, td { display: block; min-width: 0; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--surface); }
  tbody tr:hover { background: var(--surface); }
  tbody td { min-height: 68px; display: flex; align-items: flex-start; justify-content: center; flex-direction: column; padding: 11px 14px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; white-space: normal; }
  tbody td:nth-child(odd) { border-right: 0; }
  tbody td:nth-last-child(-n + 2) { border-bottom: 0; }
  tbody td:first-child { grid-column: 1 / -1; min-height: 52px; border-right: 0; }
  tbody td::before { content: attr(data-label); margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
  tbody td:first-child::before { display: none; }
  .notional-input { width: 100%; }
}
