:root {
  --ink: #172126;
  --muted: #536169;
  --line: #d7dee2;
  --paper: #f7f5ee;
  --panel: #ffffff;
  --teal: #16827a;
  --rust: #b85732;
  --gold: #c0922d;
  --blue: #3265a8;
  --violet: #6d5cae;
  --green: #4f8b3b;
  --shadow: 0 18px 42px rgba(22, 34, 38, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

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

button,
select,
input {
  font: inherit;
}

.deck-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 238, 0.92);
}

.topbar > div {
  min-width: 0;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.slide-nav {
  display: grid;
  grid-template-columns: 42px auto 42px;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--teal);
}

.slide-counter {
  min-width: 74px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  padding: 18px;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
}

.slide {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  min-height: 680px;
  min-width: 0;
  overflow: auto;
}

.control-panel {
  background: #eef2ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  align-self: start;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  min-width: 0;
}

.control-group {
  display: grid;
  gap: 8px;
}

label,
.inline-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inline-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

.check-row input {
  margin-top: 2px;
  accent-color: var(--teal);
}

.role-list {
  display: grid;
  gap: 8px;
}

.role-list .check-row {
  font-size: 13px;
}

.mini-readout {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.slide-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.35fr);
  gap: 28px;
  align-items: start;
  height: 100%;
  min-width: 0;
}

.slide-copy {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.layer-label {
  color: var(--rust);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.04;
  letter-spacing: 0;
  max-width: 760px;
}

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

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

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background: #fbfcfa;
  min-width: 0;
}

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.chart-area {
  min-height: 520px;
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

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

.chart-title h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.chart-title span {
  color: var(--muted);
  font-size: 13px;
}

.chart-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
  min-height: 360px;
}

.chart-frame.compact-chart {
  min-height: 0;
}

svg {
  display: block;
  width: 100%;
  height: auto;
}

.axis-label {
  fill: #65727a;
  font-size: 12px;
}

.bar-label {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.small-label {
  fill: #65727a;
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 13px;
}

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

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.note-box {
  border-left: 4px solid var(--teal);
  padding: 10px 12px;
  background: #edf7f5;
  color: #244a46;
  font-size: 14px;
  line-height: 1.45;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fbfcfa;
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f1f4f2;
}

td:last-child,
th:last-child {
  text-align: right;
}

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

.assumption-list {
  display: grid;
  gap: 10px;
}

.assumption {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

.assumption b {
  color: var(--ink);
}

.assumption span {
  color: var(--muted);
  line-height: 1.4;
}

.source-strip {
  min-height: 44px;
  border-top: 1px solid var(--line);
  padding: 10px 18px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}

.source-strip a {
  color: var(--blue);
  text-decoration: none;
}

.source-strip a:hover {
  text-decoration: underline;
}

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

  .control-panel {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-control {
    grid-column: 1 / -1;
  }

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

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

  .slide {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: start;
    padding: 14px;
  }

  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 28px;
  }

  .workspace {
    padding: 10px;
    width: 100vw;
    max-width: 100vw;
  }

  .slide {
    padding: 18px;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

  .slide-grid,
  .slide-copy,
  .chart-area,
  .metric-grid {
    width: 100%;
    max-width: 100%;
  }

  h2,
  .lead,
  .note-box {
    max-width: 100%;
  }

  .control-panel,
  .metric-grid,
  .role-list {
    grid-template-columns: 1fr;
  }

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