:root {
  --viewport-w: 100vw;
  --viewport-h: 100svh;
  --deck-scale: 1;
  --stage-w: 1920px;
  --stage-h: 1080px;
  --deck-edge-gap: 0px;
  --deck-controls-space: 0px;
  --ink: #171413;
  --muted: #6d6d6d;
  --soft: #969696;
  --line: #e8e7e7;
  --paper: #f7f6f3;
  --card: #ffffff;
  --green: #437c5d;
  --green-soft: #e8f0ea;
  --green-2: #549a74;
  --signal: #ff5b45;
  --dark-2: #383737;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  display: grid;
  place-items: center;
  margin: 0;
  width: var(--viewport-w);
  min-height: var(--viewport-h);
  height: var(--viewport-h);
  padding:
    calc(var(--deck-edge-gap) + env(safe-area-inset-top, 0px))
    calc(var(--deck-edge-gap) + env(safe-area-inset-right, 0px))
    calc(var(--deck-edge-gap) + var(--deck-controls-space) + env(safe-area-inset-bottom, 0px))
    calc(var(--deck-edge-gap) + env(safe-area-inset-left, 0px));
  overflow: hidden;
  background: #dfddd8;
  color: var(--ink);
  font-family: "Suisse Intl", Arial, sans-serif;
}

.stage {
  position: relative;
  width: var(--stage-w);
  height: var(--stage-h);
}

.deck {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  transform: scale(var(--deck-scale));
  transform-origin: 0 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0) 0 14.5%, rgba(255,255,255,0.28) 14.5% 14.56%, transparent 14.56%),
    linear-gradient(180deg, #ffffff 0 96px, transparent 96px),
    var(--paper);
  border: 1px solid rgba(23, 20, 19, 0.14);
}

.deck::before {
  content: "";
  position: absolute;
  left: 278px;
  right: 0;
  top: 96px;
  bottom: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 238px / 100% 292px no-repeat,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 820px 0 / 1px 100% no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

.deck.is-title-active {
  background: var(--ink);
}

.deck.is-title-active::before {
  opacity: 0;
}

.deck.is-title-active .sidebar,
.deck.is-title-active .topbar {
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 278px;
  background: var(--ink);
  color: #fff;
  padding: 28px 22px;
  z-index: 10;
}

.brand-logo {
  display: block;
  width: 72px;
  height: 72px;
  color: #fff;
  filter: invert(1);
  margin-bottom: 28px;
}

.sidebar-kicker {
  color: var(--soft);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sidebar-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 28px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 43px;
  padding: 0 16px;
  border-radius: 6px;
  color: #f0f0f0;
  font-size: 17px;
  font-weight: 600;
}

.nav-item.is-current {
  background: var(--green);
  color: #fff;
}

.sidebar-footer {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--dark-2);
}

.sidebar-footer span {
  display: block;
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.4px;
  margin-bottom: 10px;
}

.sidebar-footer strong {
  display: block;
  color: var(--soft);
  font-size: 16px;
  font-weight: 500;
}

.topbar {
  position: absolute;
  left: 278px;
  right: 0;
  top: 0;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 9;
}

.topbar-kicker {
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 7px;
}

.topbar-title {
  font-size: 33px;
  font-weight: 800;
  line-height: 1;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
}

.status-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.slide {
  position: absolute;
  left: 278px;
  top: 96px;
  right: 0;
  bottom: 0;
  padding: 54px 52px 82px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(28px);
  transition: opacity 360ms ease, transform 440ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  z-index: 2;
}

.title-slide {
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  padding: 86px 96px;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}

.title-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 278px 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 100% 216px;
  opacity: 0.34;
  pointer-events: none;
}

.title-content {
  position: relative;
  z-index: 2;
  width: 1060px;
}

.title-bg-wordmark {
  position: absolute;
  right: -760px;
  top: -96px;
  z-index: 0;
  color: rgba(255, 255, 255, 0.058);
  font-size: 516px;
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: 0;
  text-transform: lowercase;
  user-select: none;
  pointer-events: none;
}

.title-bg-wordmark span {
  display: block;
}

.title-logo {
  width: 104px;
  height: 104px;
  margin-bottom: 104px;
  filter: invert(1);
}

.title-kicker {
  margin-bottom: 26px;
  color: var(--green-2);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.title-slide h1 {
  max-width: 1000px;
  margin-bottom: 32px;
  color: #fff;
  font-size: 92px;
  line-height: 0.98;
}

.title-slide p {
  max-width: 920px;
  color: #d6d5d2;
  font-size: 31px;
  line-height: 1.34;
}

.title-meta {
  position: absolute;
  left: 96px;
  bottom: 72px;
  z-index: 2;
  display: grid;
  gap: 8px;
}

.title-meta span {
  color: #9d9b96;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.6px;
}

.title-meta strong {
  color: #fff;
  font-size: 22px;
}

.title-linework {
  position: absolute;
  right: -250px;
  bottom: 8px;
  z-index: 1;
  width: 1220px;
  height: 642px;
  overflow: visible;
}

.title-linework path,
.title-linework circle {
  fill: none;
  stroke: var(--green);
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.city-profile-main {
  stroke-width: 2.2;
  opacity: 0.92;
}

.city-markers path {
  stroke-width: 2;
  opacity: 0.9;
}

.city-markers circle {
  fill: var(--ink);
  stroke-width: 2.2;
}

.slide-count {
  position: absolute;
  right: 54px;
  bottom: 34px;
  color: var(--soft);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 28px;
  font-size: 72px;
  line-height: 0.97;
  letter-spacing: 0;
}

h2 {
  max-width: 1180px;
  margin-bottom: 38px;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 16px;
  font-size: 27px;
  line-height: 1.14;
}

code {
  padding: 0.04em 0.22em;
  border-radius: 4px;
  background: #f0f0f0;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 0.92em;
  font-weight: 800;
}

.lead {
  max-width: 900px;
  color: var(--muted);
  font-size: 27px;
  line-height: 1.36;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 52px;
  align-items: center;
  min-height: 640px;
}

.hero-card,
.source-card,
.logic-panel,
.mock-table,
.compact-table,
.tree-card,
.detail-card,
.metric-source,
.metric-hub,
.value-grid > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.hero-card {
  padding: 38px;
}

.mini-flow {
  display: grid;
  gap: 17px;
}

.mini-flow div {
  min-height: 74px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  border-radius: 6px;
  background: #f4f3ef;
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
}

.mini-flow span {
  width: 2px;
  height: 22px;
  margin-left: 35px;
  background: var(--green);
}

.bottom-note,
.callout {
  position: absolute;
  left: 52px;
  right: 52px;
  bottom: 34px;
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-left: 4px solid var(--green);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 20px;
  line-height: 1.32;
}

.source-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.source-card {
  min-height: 438px;
  padding: 34px 34px 28px;
}

.source-card.accent {
  border-color: rgba(67, 124, 93, 0.48);
}

.source-label {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: #f0f0f0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 28px;
}

.source-card.accent .source-label {
  background: var(--green-soft);
  color: var(--green);
}

.clean-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 20px;
}

.clean-list li {
  padding-left: 20px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  font-size: 23px;
  line-height: 1.32;
}

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

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.fact-strip div {
  min-height: 92px;
  padding: 17px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}

.fact-strip span {
  display: block;
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 7px;
}

.process-map {
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px 1fr 42px 1fr 42px 1fr;
  gap: 0;
  align-items: center;
  min-height: 398px;
}

.process-node {
  height: 346px;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.process-node span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 24px;
  border-radius: 6px;
  background: #f0f0f0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
}

.process-node.output span,
.process-node.input span {
  background: var(--green-soft);
  color: var(--green);
}

.process-node h3 {
  font-size: 25px;
}

.process-node p {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.34;
}

.process-arrow {
  height: 2px;
  background: var(--green);
  position: relative;
}

.process-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--green);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.wide-left {
  grid-template-columns: 1.15fr 0.85fr;
}

.mock-table,
.compact-table {
  overflow: hidden;
}

.table-title {
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.row {
  display: grid;
  align-items: center;
  min-height: 66px;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 20px;
}

.mock-table .row {
  grid-template-columns: 1.5fr 0.8fr 0.45fr;
}

.row.head {
  min-height: 48px;
  background: #f4f3ef;
  color: var(--soft);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.row b,
.row strong {
  color: var(--ink);
  font-style: normal;
}

.row em {
  justify-self: start;
  min-width: 42px;
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 15px;
  font-style: normal;
  font-weight: 800;
}

.logic-panel {
  padding: 32px;
}

.logic-panel p {
  color: var(--muted);
  font-size: 22px;
  line-height: 1.36;
}

.rule-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
  align-items: start;
  margin: 22px 0;
}

.rule-card span {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.rule-card p {
  margin: 0;
}

.muted-box {
  margin-top: 28px;
  padding: 22px;
  background: #f4f3ef;
  border-radius: 6px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.35;
}

.formula-pipeline,
.method-flow,
.wbs-equation {
  display: grid;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 34px;
}

.formula-pipeline {
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
}

.formula-pipeline > div,
.method-flow > div,
.wbs-equation > div {
  min-height: 118px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.formula-pipeline > div.active,
.wbs-equation > div.total {
  border-color: rgba(67, 124, 93, 0.55);
  background: var(--green-soft);
}

.formula-pipeline small,
.method-flow small,
.wbs-equation small {
  display: block;
  margin-bottom: 12px;
  color: var(--soft);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.formula-pipeline strong,
.method-flow strong,
.wbs-equation strong {
  color: var(--ink);
  font-size: 29px;
  line-height: 1.1;
}

.formula-pipeline > span,
.method-flow > span {
  align-self: center;
  height: 2px;
  background: var(--green);
  position: relative;
}

.formula-pipeline > span::after,
.method-flow > span::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--green);
}

.compact-table .row {
  grid-template-columns: 1.3fr 0.45fr 0.55fr 0.45fr;
}

.compact-table .row i {
  color: var(--signal);
  font-style: normal;
  font-weight: 900;
}

.metric-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 184px 260px;
  gap: 22px;
}

.metric-source {
  padding: 26px;
}

.metric-source h3 {
  margin-bottom: 14px;
}

.metric-source p,
.metric-hub p {
  color: var(--muted);
  font-size: 21px;
  line-height: 1.34;
}

.metric-hub {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--ink);
  color: #fff;
}

.metric-hub span {
  color: var(--soft);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
}

.metric-hub strong {
  font-size: 48px;
}

.metric-hub p {
  color: #d8d8d8;
  margin: 14px 0 0;
}

.method-flow {
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
}

.method-flow p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.32;
}

.methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.methods-grid div {
  min-height: 124px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.methods-grid b {
  display: block;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 28px;
}

.methods-grid span {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.28;
}

.wbs-equation {
  grid-template-columns: 1fr 38px 1fr 38px 1fr 38px 1fr;
}

.wbs-equation b {
  align-self: center;
  justify-self: center;
  color: var(--green);
  font-size: 42px;
}

.override-row {
  display: grid;
  grid-template-columns: 0.6fr 1.2fr 1.1fr 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.override-row div {
  min-height: 118px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.override-row span {
  display: block;
  margin-bottom: 12px;
  color: var(--soft);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.override-row b {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
}

.hierarchy-layout,
.totals-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 30px;
}

.tree-card {
  padding: 32px;
}

.tree-row {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
}

.tree-row span {
  padding: 7px 11px;
  border-radius: 5px;
  background: #f4f3ef;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.tree-row.child {
  padding-left: 48px;
}

.tree-row.leaf {
  padding-left: 94px;
}

.tree-row.parent span {
  background: var(--green-soft);
  color: var(--green);
}

.equation-line {
  margin: 0 0 18px;
  padding: 18px;
  background: #f4f3ef;
  border-radius: 6px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
}

.kpi-stack {
  display: grid;
  gap: 18px;
}

.kpi-stack div {
  min-height: 136px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.kpi-stack span {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.kpi-stack b {
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
}

.detail-card {
  padding: 28px;
}

.detail-row {
  display: grid;
  grid-template-columns: 0.72fr 1.25fr 1fr;
  gap: 14px;
  min-height: 56px;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 19px;
}

.detail-row.head {
  min-height: 42px;
  border-top: none;
  color: var(--soft);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.detail-row span:first-child {
  color: var(--ink);
  font-weight: 900;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.value-grid > div {
  min-height: 184px;
  padding: 30px;
  border-top: 5px solid var(--green);
}

.value-grid h3 {
  font-size: 30px;
}

.value-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 23px;
  line-height: 1.34;
}

.closing-line {
  margin-top: 32px;
  padding: 30px 34px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
}

.controls {
  position: fixed;
  right: 14px;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(23, 20, 19, 0.16);
  border-radius: 8px;
}

.controls button {
  width: 38px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.progress {
  width: 88px;
  height: 3px;
  background: #d8d8d8;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
}

.is-exporting .controls {
  display: none;
}

.is-exporting body {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
}

.is-exporting .stage,
.is-exporting .deck {
  width: 1920px;
  height: 1080px;
}

.is-exporting .deck {
  transform: none;
}

@media (hover: none) and (pointer: coarse) {
  :root {
    --deck-edge-gap: 10px;
    --deck-controls-space: 70px;
  }

  .controls {
    top: auto;
    right: auto;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
  }
}

@media (max-width: 900px), (max-height: 520px) {
  :root {
    --deck-edge-gap: 10px;
    --deck-controls-space: 70px;
  }

  .controls {
    top: auto;
    right: auto;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
  }
}
