:root {
  color-scheme: dark;
  --bg: #0d141e;
  --ink: #eaf0f8;
  --muted: #9aa8ba;
  --line: #2a384b;
  --panel: #151f2e;
  --panel-2: #1d2a3b;
  --soft-bg: #111b28;
  --node-bg: #192536;
  --panel-rgb: 21, 31, 46;
  --node-rgb: 25, 37, 54;
  --topbar-bg: rgba(12, 19, 29, 0.94);
  --nav-bg: rgba(12, 19, 29, 0.95);
  --blue: #7ba9f3;
  --teal: #54c5b0;
  --green: #a7cd78;
  --amber: #d9ad69;
  --red: #e38b8b;
  --purple: #b5a2ff;
  --slate: #a6b4c8;
  --progress-bg: #263447;
  --label-bg: #142135;
  --success-bg: #173326;
  --success-ink: #9de0b7;
  --tag-bg: #182434;
  --code-ink: #a8c7ff;
  --table-head-bg: #202d3f;
  --spline-board-bg: linear-gradient(180deg, #152131 0%, #101a27 100%);
  --dash-line: #526176;
  --decision-ink: #bac6d7;
  --nav-button-border: #34465d;
  --nav-button-bg: linear-gradient(180deg, #233249, #182334);
  --dot-bg: #344255;
  --nav-arrow-ink: #08111f;
  --glow-a: rgba(124, 170, 242, 0.08);
  --glow-b: rgba(85, 195, 173, 0.07);
  --radius: 8px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  --deep-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #dfe7f0;
    --ink: #172333;
    --muted: #5d6b80;
    --line: #c4cfdd;
    --panel: #eef3f8;
    --panel-2: #e2eaf3;
    --soft-bg: #e9eff6;
    --node-bg: #f6f9fc;
    --panel-rgb: 238, 243, 248;
    --node-rgb: 246, 249, 252;
    --topbar-bg: rgba(232, 239, 247, 0.94);
    --nav-bg: rgba(232, 239, 247, 0.95);
    --blue: #285da6;
    --teal: #116d5e;
    --green: #496e2e;
    --amber: #8d5a19;
    --red: #9c4848;
    --purple: #604db0;
    --slate: #516075;
    --progress-bg: #cfdae6;
    --label-bg: #edf3fa;
    --success-bg: #e4f0e8;
    --success-ink: #235739;
    --tag-bg: #edf3f8;
    --code-ink: #213d61;
    --table-head-bg: #e0e8f1;
    --spline-board-bg: linear-gradient(180deg, #edf3f8 0%, #e2ebf4 100%);
    --dash-line: #8d9aae;
    --decision-ink: #435069;
    --nav-button-border: #b9c6d6;
    --nav-button-bg: linear-gradient(180deg, #f8fbff, #e5edf6);
    --dot-bg: #c9d4e2;
    --nav-arrow-ink: #ffffff;
    --glow-a: rgba(47, 102, 183, 0.06);
    --glow-b: rgba(22, 116, 99, 0.06);
    --shadow: 0 16px 40px rgba(22, 31, 49, 0.08);
    --deep-shadow: 0 22px 60px rgba(22, 31, 49, 0.12);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dfe7f0;
  --ink: #172333;
  --muted: #5d6b80;
  --line: #c4cfdd;
  --panel: #eef3f8;
  --panel-2: #e2eaf3;
  --soft-bg: #e9eff6;
  --node-bg: #f6f9fc;
  --panel-rgb: 238, 243, 248;
  --node-rgb: 246, 249, 252;
  --topbar-bg: rgba(232, 239, 247, 0.94);
  --nav-bg: rgba(232, 239, 247, 0.95);
  --blue: #285da6;
  --teal: #116d5e;
  --green: #496e2e;
  --amber: #8d5a19;
  --red: #9c4848;
  --purple: #604db0;
  --slate: #516075;
  --progress-bg: #cfdae6;
  --label-bg: #edf3fa;
  --success-bg: #e4f0e8;
  --success-ink: #235739;
  --tag-bg: #edf3f8;
  --code-ink: #213d61;
  --table-head-bg: #e0e8f1;
  --spline-board-bg: linear-gradient(180deg, #edf3f8 0%, #e2ebf4 100%);
  --dash-line: #8d9aae;
  --decision-ink: #435069;
  --nav-button-border: #b9c6d6;
  --nav-button-bg: linear-gradient(180deg, #f8fbff, #e5edf6);
  --dot-bg: #c9d4e2;
  --nav-arrow-ink: #ffffff;
  --glow-a: rgba(47, 102, 183, 0.06);
  --glow-b: rgba(22, 116, 99, 0.06);
  --shadow: 0 16px 40px rgba(22, 31, 49, 0.08);
  --deep-shadow: 0 22px 60px rgba(22, 31, 49, 0.12);
}

* {
  box-sizing: border-box;
}

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

button {
  font: inherit;
}

.presentation-shell {
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 88px;
  background:
    linear-gradient(135deg, var(--glow-a), transparent 34%),
    linear-gradient(315deg, var(--glow-b), transparent 32%),
    var(--bg);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.topbar-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 700;
}

.topbar strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.theme-toggle {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--node-rgb), 0.86);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.topbar-count {
  min-width: 86px;
  text-align: right;
  color: var(--ink);
  font-weight: 700;
  display: grid;
  gap: 2px;
}

.level-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  font-weight: 900;
}

.topbar-progress {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 7px;
  height: 5px;
  border-radius: 999px;
  background: var(--progress-bg);
  overflow: hidden;
}

.topbar-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transition: width 220ms ease;
}

.deck {
  height: 100%;
  min-height: 0;
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.deck::-webkit-scrollbar {
  display: none;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  transform: none;
  opacity: 1;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: auto;
  padding: 24px;
}

.slide.is-active {
  z-index: 1;
}

.slide-inner {
  min-height: 100%;
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.title-slide {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: 32px;
}

.title-copy {
  max-width: 900px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  background: var(--label-bg);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-top: 14px;
  max-width: 980px;
  font-size: clamp(36px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

.lead {
  margin-top: 22px;
  max-width: 820px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
}

.summary-board {
  display: grid;
  gap: 12px;
}

.summary-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 700;
}

.summary-number {
  color: var(--blue);
  font-weight: 900;
}

.atlas-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--deep-shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.atlas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.segmented-control {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft-bg);
  overflow-x: auto;
}

.segmented-control button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.segmented-control button.is-active {
  background: var(--node-bg);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.zoom-control {
  display: grid;
  grid-template-columns: 42px minmax(58px, auto) 42px;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft-bg);
}

.zoom-control button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(var(--node-rgb), 0.9);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.zoom-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.atlas-map {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--spline-board-bg);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 12px;
  padding: 18px;
  transition: transform 180ms ease;
}

.atlas-map[data-scale="overview"] {
  gap: 8px;
}

.atlas-map[data-scale="focus"] {
  gap: 16px;
}

.map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.map-lines path {
  fill: none;
  stroke: rgba(166, 180, 200, 0.44);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.9;
  vector-effect: non-scaling-stroke;
}

.atlas-card {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 124px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 14px;
  background: var(--node-bg);
  background: rgba(var(--node-rgb), 0.82);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  display: grid;
  gap: 8px;
  align-content: start;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.atlas-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--deep-shadow);
}

.atlas-card b {
  font-size: 16px;
  line-height: 1.18;
}

.atlas-card small {
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.atlas-chip {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--soft-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.layer-ui { border-left-color: var(--blue); }
.layer-state { border-left-color: var(--purple); }
.layer-api { border-left-color: var(--teal); }
.layer-db { border-left-color: var(--amber); }

.atlas-card:nth-of-type(1) { grid-column: 1 / span 3; grid-row: 1 / span 2; }
.atlas-card:nth-of-type(2) { grid-column: 4 / span 3; grid-row: 2 / span 2; }
.atlas-card:nth-of-type(3) { grid-column: 2 / span 3; grid-row: 5 / span 2; }
.atlas-card:nth-of-type(4) { grid-column: 5 / span 3; grid-row: 6 / span 2; }
.atlas-card:nth-of-type(5) { grid-column: 7 / span 3; grid-row: 3 / span 2; }
.atlas-card:nth-of-type(6) { grid-column: 9 / span 3; grid-row: 5 / span 2; }
.atlas-card:nth-of-type(7) { grid-column: 9 / span 3; grid-row: 1 / span 2; }
.atlas-card:nth-of-type(8) { grid-column: 10 / span 3; grid-row: 7 / span 2; }
.atlas-card:nth-of-type(9) { grid-column: 6 / span 3; grid-row: 1 / span 2; }

.atlas-map[data-scale="overview"] .atlas-card {
  min-height: 104px;
  padding: 11px;
}

.atlas-map[data-scale="focus"] .atlas-card {
  min-height: 152px;
  padding: 18px;
}

.atlas-map[data-filter]:not([data-filter="all"]) .atlas-card {
  opacity: 0.22;
  transform: scale(0.96);
}

.atlas-map[data-filter="ui"] .atlas-card[data-layer="ui"],
.atlas-map[data-filter="state"] .atlas-card[data-layer="state"],
.atlas-map[data-filter="api"] .atlas-card[data-layer="api"],
.atlas-map[data-filter="db"] .atlas-card[data-layer="db"] {
  opacity: 1;
  transform: scale(1.02);
  box-shadow: var(--deep-shadow);
}

.world-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--deep-shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.map-slide {
  height: 100%;
  overflow: hidden;
}

.map-slide .slide-inner {
  height: 100%;
  max-width: none;
  min-height: 0;
  gap: 12px;
}

.map-slide .slide-heading {
  max-width: none;
  flex: 0 0 auto;
}

.map-slide .slide-heading p {
  display: none;
}

.map-slide .world-panel {
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 12px;
}

.world-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.world-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 14px;
}

.map-slide .world-layout {
  height: 100%;
}

.world-stage {
  min-height: 560px;
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--spline-board-bg);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.map-slide .world-stage {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.world-map {
  --world-width: 1160px;
  --world-height: 680px;
  --world-node-width: 178px;
  position: relative;
  width: var(--world-width);
  min-width: var(--world-width);
  height: var(--world-height);
  min-height: var(--world-height);
  background:
    linear-gradient(90deg, transparent 0 23%, color-mix(in srgb, var(--blue) 8%, transparent) 23% 24%, transparent 24% 100%),
    linear-gradient(90deg, transparent 0 49%, color-mix(in srgb, var(--purple) 9%, transparent) 49% 50%, transparent 50% 100%),
    linear-gradient(90deg, transparent 0 73%, color-mix(in srgb, var(--teal) 9%, transparent) 73% 74%, transparent 74% 100%),
    radial-gradient(circle at 22% 18%, rgba(var(--node-rgb), 0.56), transparent 28%),
    radial-gradient(circle at 84% 78%, rgba(var(--node-rgb), 0.46), transparent 24%);
}

.world-map[data-zoom="layer"] {
  --world-width: 1370px;
  --world-height: 802px;
  --world-node-width: 190px;
}

.world-map[data-zoom="close"] {
  --world-width: 1648px;
  --world-height: 966px;
  --world-node-width: 216px;
}

.world-lines path {
  stroke: rgba(166, 180, 200, 0.38);
  stroke-width: 4;
  transition: opacity 140ms ease, stroke 140ms ease, stroke-width 140ms ease;
}

.world-lines path.is-linked {
  stroke: var(--blue);
  stroke-width: 6;
  opacity: 1;
}

.world-lane {
  position: absolute;
  top: 12px;
  z-index: 1;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.lane-ui { left: 5%; }
.lane-state { left: 32%; }
.lane-api { left: 63%; }
.lane-db { right: 5%; }

.world-node {
  position: absolute;
  z-index: 2;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--world-node-width);
  min-height: 92px;
  transform: translate(-50%, -50%);
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--ink) 12%);
  border-left-width: 6px;
  border-radius: 14px;
  background: var(--node-bg);
  background:
    linear-gradient(180deg, rgba(var(--node-rgb), 0.9), rgba(var(--node-rgb), 0.68)),
    var(--node-bg);
  backdrop-filter: blur(8px);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: left;
  display: grid;
  gap: 7px;
  cursor: pointer;
  touch-action: none;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.world-node span {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.world-node small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.world-node:hover,
.world-node.is-active {
  transform: translate(-50%, -50%) translateY(-3px);
  box-shadow: var(--deep-shadow);
}

.world-node.is-active {
  border-color: var(--blue);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 18%, rgba(var(--node-rgb), 0.86)), rgba(var(--node-rgb), 0.74)),
    var(--node-bg);
}

.world-node.is-linked {
  opacity: 1;
  box-shadow: var(--deep-shadow);
}

.world-map[data-layer]:not([data-layer="all"]) .world-node,
.world-map.has-active .world-node:not(.is-active):not(.is-linked) {
  opacity: 0.24;
}

.world-map[data-layer="ui"] .world-node[data-world-layer="ui"],
.world-map[data-layer="state"] .world-node[data-world-layer="state"],
.world-map[data-layer="api"] .world-node[data-world-layer="api"],
.world-map[data-layer="db"] .world-node[data-world-layer="db"] {
  opacity: 1;
}

.world-map .world-node.is-active,
.world-map .world-node.is-linked {
  opacity: 1;
}

.world-map[data-layer]:not([data-layer="all"]) .world-lines path {
  opacity: 0.18;
}

.world-map .world-lines path.is-linked {
  opacity: 1;
}

.world-detail {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft-bg);
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.world-detail h3 {
  margin: 0;
  font-size: 22px;
}

.world-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.world-detail-flow {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--node-bg);
  color: var(--code-ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slide-heading {
  display: grid;
  gap: 10px;
  max-width: 1160px;
}

.slide-heading p {
  max-width: 920px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.slide-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: stretch;
}

.slide-grid.wide-notes {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.diagram-panel,
.notes-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.diagram-panel {
  min-height: 500px;
  padding: 18px;
  overflow: auto;
}

.notes-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notes-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.notes-panel li + li {
  margin-top: 9px;
}

.flow-stack {
  display: grid;
  gap: 18px;
  min-width: 860px;
}

.flow-row,
.support-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.flow-row.compact {
  min-width: 800px;
}

.support-row {
  margin-top: 16px;
}

.node,
.pipe-node,
.mini-node,
.route-card,
.detail-box,
.decision {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--node-bg);
}

.node {
  min-width: 190px;
  flex: 1 1 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border-left-width: 5px;
}

.node-title {
  display: block;
  font-weight: 850;
  line-height: 1.15;
}

.node-file {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.node-blue { border-left-color: var(--blue); }
.node-teal { border-left-color: var(--teal); }
.node-green { border-left-color: var(--green); }
.node-amber { border-left-color: var(--amber); }
.node-red { border-left-color: var(--red); }
.node-purple { border-left-color: var(--purple); }
.node-slate { border-left-color: var(--slate); }

.arrow {
  flex: 0 0 30px;
  align-self: center;
  height: 1px;
  background: var(--line);
  position: relative;
}

.arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--line);
  border-right: 2px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}

.route-map {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  min-width: 760px;
}

.route-card {
  padding: 12px;
  display: grid;
  gap: 5px;
}

.route-card b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--blue);
}

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

.lane-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
  color: var(--blue);
  text-transform: uppercase;
}

.lane-title.muted {
  margin-top: 20px;
  color: var(--slate);
}

.dashed-box {
  min-width: 820px;
  padding: 14px;
  border: 1px dashed var(--dash-line);
  border-radius: var(--radius);
  background: var(--soft-bg);
}

.partner-map,
.style-map {
  display: grid;
  gap: 16px;
  align-content: start;
}

.root-node {
  max-width: 620px;
  margin: 0 auto;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
  min-width: 620px;
}

.branch-grid.three {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  min-width: 760px;
}

.branch {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  display: grid;
  gap: 8px;
}

.branch h3 {
  color: var(--ink);
}

.mini-node {
  padding: 10px;
  font-weight: 720;
  color: var(--ink);
  background: var(--node-bg);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(8, minmax(135px, 1fr));
  gap: 8px;
  min-width: 1120px;
  position: relative;
}

.pipe-node {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border-left-width: 5px;
  font-weight: 850;
  line-height: 1.2;
}

.cache-details {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  min-width: 860px;
}

.detail-box {
  padding: 12px;
  display: grid;
  gap: 6px;
}

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

.return-flow {
  margin-top: 18px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--success-bg);
  color: var(--success-ink);
  font-weight: 800;
  text-align: center;
  min-width: 640px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--tag-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--code-ink);
  overflow-wrap: anywhere;
}

.relation-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--node-bg);
  font-size: 13px;
  line-height: 1.35;
}

.relation-table th,
.relation-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.relation-table th:last-child,
.relation-table td:last-child {
  border-right: 0;
}

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

.relation-table th {
  background: var(--table-head-bg);
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.compact-table {
  margin-top: 0;
  min-width: 420px;
}

.spline-board {
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 900px;
  min-height: 430px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--spline-board-bg);
  overflow: hidden;
}

.route-contract-board,
.partner-contract-board {
  grid-template-columns: repeat(3, minmax(230px, 1fr));
}

.spline-layer,
.er-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}

.spline {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  opacity: 0.68;
}

.spline-blue { stroke: var(--blue); }
.spline-green { stroke: var(--green); }
.spline-purple { stroke: var(--purple); }

.spline-col {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.object-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--node-bg);
  box-shadow: var(--shadow);
}

.compact-card {
  min-height: 92px;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.compact-card b,
.object-spec b,
.db-table b,
.matrix-step b {
  color: var(--ink);
  line-height: 1.2;
}

.compact-card span,
.compact-card small,
.object-spec span,
.db-table span,
.matrix-step span,
.matrix-step small {
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: anywhere;
  min-width: 0;
}

.compact-card small,
.matrix-step small {
  font-size: 12px;
}

.event-object-board {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  grid-auto-rows: minmax(150px, auto);
  align-items: stretch;
  min-height: 430px;
}

.object-spec {
  position: relative;
  z-index: 2;
  padding: 14px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.flow-matrix {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
  min-width: 1020px;
}

.matrix-step {
  position: relative;
  min-width: 0;
  min-height: 124px;
  padding: 13px 24px 13px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--node-bg);
  display: grid;
  gap: 8px;
  align-content: start;
}

.matrix-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 7px;
  width: 10px;
  height: 2px;
  background: var(--line);
}

.matrix-step:last-child::after {
  display: none;
}

.split-tables {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  gap: 14px;
  min-width: 880px;
}

.er-board {
  position: relative;
  min-width: 1060px;
  height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.er-line {
  fill: none;
  stroke: var(--slate);
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0.66;
}

.er-line.dashed {
  stroke-dasharray: 7 7;
}

.db-table {
  position: absolute;
  z-index: 2;
  width: 190px;
  min-height: 108px;
  padding: 12px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: var(--radius);
  background: var(--node-bg);
  box-shadow: var(--shadow);
}

.db-table span {
  font-size: 12px;
}

.db-users { left: 34px; top: 36px; border-left-color: var(--blue); }
.db-events { left: 420px; top: 74px; border-left-color: var(--teal); }
.db-partners { left: 420px; top: 258px; border-left-color: var(--purple); }
.db-tags { left: 420px; top: 374px; border-left-color: var(--amber); }
.db-ticket-types { left: 842px; top: 74px; border-left-color: var(--green); }
.db-tickets { left: 842px; top: 250px; border-left-color: var(--red); }
.db-payments { left: 842px; top: 374px; border-left-color: var(--amber); }
.db-ref { left: 34px; top: 250px; border-left-color: var(--green); }
.db-opened { left: 34px; top: 374px; border-left-color: var(--slate); }

.legend-grid {
  margin-bottom: 16px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.decision {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.decision p {
  color: var(--muted);
  line-height: 1.45;
}

.decision span {
  display: block;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--decision-ink);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.deck-nav {
  display: grid;
  grid-template-columns: minmax(132px, 180px) minmax(0, 1fr) minmax(132px, 180px);
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
}

.nav-button {
  min-height: 58px;
  border: 1px solid var(--nav-button-border);
  border-radius: 16px;
  background: var(--nav-button-bg);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  touch-action: manipulation;
}

.nav-button:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.nav-arrow {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--nav-arrow-ink);
  font-size: 21px;
  line-height: 1;
}

.dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dots::-webkit-scrollbar {
  display: none;
}

.dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--dot-bg);
  padding: 0;
  cursor: pointer;
}

.dot.is-active {
  width: 38px;
  background: var(--blue);
  border-color: var(--blue);
}

@media (max-width: 1120px) {
  .presentation-shell {
    grid-template-rows: 68px minmax(0, 1fr) 84px;
  }

  .slide {
    padding: 18px;
  }

  .title-slide,
  .slide-grid,
  .slide-grid.wide-notes {
    grid-template-columns: 1fr;
  }

  .notes-panel {
    min-height: auto;
  }

  .decision-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .flow-stack,
  .flow-row.compact,
  .dashed-box,
  .route-map,
  .branch-grid,
  .branch-grid.three,
  .pipeline,
  .cache-details,
  .return-flow,
  .spline-board,
  .split-tables,
  .er-board {
    min-width: 0;
  }

  .route-contract-board,
  .partner-contract-board,
  .event-object-board,
  .split-tables {
    grid-template-columns: 1fr;
  }

  .spline-layer,
  .er-layer {
    display: none;
  }

  .spline-board {
    min-height: auto;
    padding: 12px;
  }

  .pipeline,
  .cache-details,
  .flow-matrix {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .matrix-step::after {
    display: none;
  }

  .er-board {
    height: auto;
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .atlas-map {
    min-height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    overflow: visible;
  }

  .atlas-lines {
    display: block;
  }

  .atlas-card:nth-of-type(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .world-layout {
    grid-template-columns: 1fr;
  }

  .map-slide .world-layout {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .map-slide .world-stage {
    min-height: 0;
    max-height: none;
  }

  .world-map {
    --world-width: 980px;
    --world-height: 660px;
    --world-node-width: 166px;
  }

  .world-map[data-zoom="layer"] {
    --world-width: 1156px;
    --world-height: 779px;
  }

  .world-map[data-zoom="close"] {
    --world-width: 1392px;
    --world-height: 937px;
  }

  .world-detail {
    min-height: auto;
    max-height: 160px;
    overflow: auto;
  }

  .db-table {
    position: static;
    width: auto;
    min-height: auto;
  }
}

@media (max-width: 680px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .presentation-shell {
    height: 100dvh;
    min-height: 100dvh;
    grid-template-rows: 64px minmax(0, 1fr) 82px;
  }

  .topbar {
    padding: 9px 14px 15px;
    gap: 10px;
  }

  .theme-toggle {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .topbar strong {
    font-size: 15px;
  }

  .topbar-kicker,
  .level-label {
    font-size: 10px;
  }

  .topbar-count {
    min-width: 58px;
    font-size: 14px;
  }

  .topbar-progress {
    left: 14px;
    right: 14px;
    bottom: 6px;
  }

  .slide {
    padding: 12px;
  }

  h1 {
    font-size: 32px;
    line-height: 1.04;
  }

  h2 {
    font-size: 24px;
    line-height: 1.12;
  }

  h3 {
    font-size: 16px;
  }

  .lead,
  .slide-heading p {
    font-size: 15px;
    line-height: 1.38;
  }

  .diagram-panel {
    min-height: 0;
    padding: 10px;
    overflow: visible;
    box-shadow: var(--shadow);
  }

  .summary-item {
    grid-template-columns: 44px 1fr;
    font-size: 15px;
    padding: 13px;
  }

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

  .flow-row,
  .support-row {
    flex-direction: column;
  }

  .matrix-step::after {
    display: none;
  }

  .arrow {
    display: none;
  }

  .node,
  .pipe-node,
  .route-card,
  .detail-box,
  .compact-card,
  .object-spec,
  .decision {
    min-width: 0;
  }

  .route-map,
  .branch-grid,
  .branch-grid.three {
    grid-template-columns: 1fr;
  }

  .relation-table {
    border: 0;
    background: transparent;
  }

  .relation-table thead {
    display: none;
  }

  .relation-table,
  .relation-table tbody,
  .relation-table tr,
  .relation-table td {
    display: block;
    width: 100%;
  }

  .relation-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--node-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .relation-table td {
    border-right: 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px;
  }

  .relation-table td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .relation-table td:nth-child(1)::before { content: "Пункт"; }
  .relation-table td:nth-child(2)::before { content: "Вход"; }
  .relation-table td:nth-child(3)::before { content: "Связь"; }
  .relation-table td:nth-child(4)::before { content: "Выход"; }

  .atlas-panel {
    padding: 10px;
    border-radius: 14px;
  }

  .atlas-toolbar {
    align-items: stretch;
  }

  .segmented-control {
    width: 100%;
  }

  .atlas-map {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .atlas-card,
  .atlas-map[data-scale="focus"] .atlas-card,
  .atlas-map[data-scale="overview"] .atlas-card {
    min-height: 104px;
    padding: 12px;
  }

  .world-panel {
    padding: 10px;
    border-radius: 14px;
  }

  .world-toolbar {
    align-items: stretch;
  }

  .world-toolbar .segmented-control:nth-of-type(2) {
    display: none;
  }

  .map-slide .slide-heading p {
    display: none;
  }

  .map-slide .slide-heading {
    display: none;
  }

  .map-slide .world-panel {
    padding: 8px;
    gap: 8px;
  }

  .map-slide .world-stage {
    min-height: 0;
    max-height: none;
    border-radius: 14px;
  }

  .world-map {
    --world-width: 760px;
    --world-height: 680px;
    --world-node-width: 142px;
  }

  .world-map[data-zoom="layer"] {
    --world-width: 897px;
    --world-height: 802px;
    --world-node-width: 154px;
  }

  .world-map[data-zoom="close"] {
    --world-width: 1080px;
    --world-height: 966px;
    --world-node-width: 166px;
  }

  .world-node {
    min-height: 78px;
    padding: 10px;
  }

  .world-node span {
    font-size: 13px;
  }

  .world-node small {
    font-size: 11px;
  }

  .world-lane {
    top: 8px;
    font-size: 10px;
  }

  .world-detail {
    padding: 12px;
    border-radius: 14px;
    max-height: 104px;
  }

  .world-detail h3 {
    font-size: 18px;
  }

  .world-detail p {
    font-size: 14px;
  }

  .world-detail-flow {
    font-size: 12px;
    padding: 10px;
  }

  .deck-nav {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    gap: 10px;
    padding: 10px 12px;
  }

  .nav-button {
    min-height: 58px;
    padding: 0;
    border-radius: 18px;
    font-size: 0;
  }

  .nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .dots {
    justify-content: flex-start;
    padding: 0 4px;
  }

  .dot {
    width: 16px;
    height: 16px;
  }

  .dot.is-active {
    width: 42px;
  }
}
