:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #ffffff;
  --muted: #b9b9b9;
  --line: rgba(255, 255, 255, 0.18);
  --glass: rgba(0, 0, 0, 0.74);
  --jrm-red: #d2232a;
  --jrm-red-dark: #8f1116;
  --electrical: #37a0ff;
  --mechanical: #17b386;
  --plumbing: #d77846;
  --itav: #8b7cff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 46%, #4a4a4a 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.deck {
  min-height: 100%;
}

.stage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.logistics-mode .stage,
.logistics-mode .riser-board,
.elevation-mode .stage,
.elevation-mode .riser-board,
.elevation-mode .logistics-board,
.logistics-board {
  display: none;
}

.logistics-mode .logistics-board {
  display: grid;
}

.elevation-board {
  display: none;
}

.elevation-mode .elevation-board {
  display: block;
}

.stage::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
  z-index: 1;
  pointer-events: none;
}

.hud {
  position: absolute;
  z-index: 3;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.hud::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--jrm-red), rgba(210, 35, 42, 0));
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}

.hud-top {
  left: clamp(18px, 3vw, 44px);
  right: clamp(18px, 3vw, 44px);
  top: clamp(16px, 3vh, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 18px;
  border-radius: 8px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  color: var(--jrm-red);
  font-size: 0.74rem;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
}

.headline-lockup {
  display: grid;
  gap: 4px;
}

.bloomberg-logo {
  width: fit-content;
  color: #ffffff;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.32);
  padding: 3px 8px 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.slide-tabs,
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.tab,
.segment {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  padding: 0 8px;
  cursor: pointer;
  white-space: nowrap;
}

.segment {
  flex: 1;
}

.tab.active,
.segment.active {
  color: #ffffff;
  background: var(--jrm-red);
}

.scene-shell {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#xray-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

#xray-canvas:active {
  cursor: zoom-in;
}

.floor-callouts {
  position: absolute;
  top: 18%;
  right: min(31vw, 420px);
  display: grid;
  gap: min(4.8vh, 50px);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  pointer-events: auto;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.58);
}

.floor-callouts button {
  appearance: none;
  width: max-content;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-shadow: inherit;
  cursor: pointer;
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.floor-callouts button:hover,
.floor-callouts button:focus-visible {
  color: #ffffff;
  opacity: 1;
  outline: 0;
  transform: translateX(-4px);
}

.floor-callouts button.active {
  color: #ffffff;
  border-left: 2px solid var(--jrm-red);
  padding-left: 6px;
  transform: translateX(-8px);
}

.shaft-mini-key {
  --min-floor: 22;
  --max-floor: 45;
  position: absolute;
  z-index: 3;
  top: clamp(132px, 17vh, 170px);
  right: clamp(18px, 3vw, 44px);
  width: 176px;
  height: 250px;
  padding: 12px 12px 12px 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.shaft-mini-key p {
  position: absolute;
  top: 10px;
  left: 12px;
  margin: 0;
  color: var(--jrm-red);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0;
}

.mini-floor-rail,
.mini-shaft-field {
  position: absolute;
  inset: 34px 12px 12px 34px;
}

.mini-floor-rail {
  left: 10px;
}

.mini-floor-rail span {
  position: absolute;
  top: calc((var(--max-floor) - var(--floor)) / (var(--max-floor) - var(--min-floor)) * 100%);
  left: -24px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.58rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.mini-floor-rail span::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 130px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.mini-shaft {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc((var(--max-floor) - var(--end)) / (var(--max-floor) - var(--min-floor)) * 100%);
  width: 18px;
  height: max(16px, calc((var(--end) - var(--start)) / (var(--max-floor) - var(--min-floor)) * 100%));
  display: grid;
  place-items: center;
  color: #000000;
  background: #f4f000;
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 900;
}

.mini-shaft.s5e {
  background: #f4f000;
}

.mini-shaft.s5d {
  background: #ffa630;
}

.mini-shaft.s8e {
  background: #37a0ff;
}

.mini-shaft.s7d {
  background: #17b386;
}

.mini-shaft.s9e {
  background: #8b7cff;
}

.sequence-mode .shaft-mini-key {
  top: clamp(126px, 15vh, 150px);
  right: clamp(18px, 3vw, 44px);
}

.logistics-mini-key {
  z-index: 4;
}

.controls-hidden .shaft-mini-key {
  opacity: 0.82;
}

.side-panel {
  right: clamp(18px, 3vw, 44px);
  top: auto;
  bottom: clamp(18px, 4vh, 46px);
  width: min(350px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 16px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.controls-hidden .side-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
}

.panel-section + .panel-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

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

.layer-toggle {
  display: grid;
  grid-template-columns: 18px 14px 1fr;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.92rem;
}

.layer-toggle input {
  accent-color: var(--jrm-red);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 22px currentColor;
}

.electrical .swatch,
.electrical .card-head span {
  color: var(--electrical);
  background: var(--electrical);
}

.mechanical .swatch,
.mechanical .card-head span {
  color: var(--mechanical);
  background: var(--mechanical);
}

.plumbing .swatch,
.plumbing .card-head span {
  color: var(--plumbing);
  background: var(--plumbing);
}

.itav .swatch,
.itav .card-head span {
  color: var(--itav);
  background: var(--itav);
}

.range-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 0.9rem;
}

.range-label output {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.floor-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.floor-picker button {
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.36);
  cursor: pointer;
  font-size: 0.76rem;
}

.floor-picker button.active {
  color: #ffffff;
  border-color: var(--jrm-red);
  background: var(--jrm-red);
}

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

.metrics div {
  min-width: 0;
}

.metrics strong {
  display: block;
  font-size: 1.45rem;
  color: #ffffff;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.sequence-progress {
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.sequence-progress span {
  display: block;
  width: var(--sequence-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--jrm-red), #ffffff);
  transition: width 120ms linear;
}

.sequence-timeline {
  left: clamp(18px, 3vw, 44px);
  right: clamp(18px, 3vw, 44px);
  bottom: clamp(16px, 3vh, 30px);
  display: grid;
  gap: 10px;
  padding: 14px 16px 15px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.sequence-mode .sequence-timeline {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sequence-mode .narrative {
  top: clamp(230px, 39vh, 390px);
  bottom: auto;
  width: min(320px, calc(100vw - 36px));
  min-height: 410px;
  padding: 18px 16px;
}

.controls-hidden.sequence-mode .narrative {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
}

.sequence-mode .narrative h2 {
  font-size: clamp(1.15rem, 1.45vw, 1.45rem);
  line-height: 1.16;
}

.sequence-mode .narrative p:last-child {
  line-height: 1.52;
}

.sequence-mode .side-panel {
  bottom: clamp(190px, 25vh, 240px);
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.timeline-head .panel-kicker {
  margin: 0;
}

#sequence-time {
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
}

.timeline-body {
  --timeline-label-width: clamp(190px, 23%, 270px);
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-label-width) minmax(0, 1fr);
  gap: 8px 12px;
  padding-top: 58px;
}

.milestone-strip {
  position: absolute;
  top: 2px;
  left: calc(var(--timeline-label-width) + 12px);
  right: 0;
  height: 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.milestone {
  position: absolute;
  left: var(--pos);
  top: 0;
  display: grid;
  gap: 2px;
  min-width: 76px;
  color: #ffffff;
  line-height: 1.05;
  transform: translateX(-50%);
}

.milestone::before {
  content: "";
  width: 2px;
  height: 10px;
  margin-left: 50%;
  background: var(--jrm-red);
  box-shadow: 0 0 12px rgba(210, 35, 42, 0.75);
}

.milestone strong {
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.milestone small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

#sequence-scrub {
  position: absolute;
  left: calc(var(--timeline-label-width) + 12px);
  right: 0;
  top: 42px;
  width: calc(100% - var(--timeline-label-width) - 12px);
  z-index: 2;
}

.timeline-playhead {
  position: absolute;
  top: 60px;
  bottom: 0;
  left: calc(var(--timeline-label-width) + 12px);
  right: 0;
  pointer-events: none;
}

.timeline-playhead::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--sequence-progress, 0%);
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.8);
  transform: translateX(-1px);
}

.gantt-row {
  display: contents;
}

.gantt-label {
  display: grid;
  gap: 1px;
  min-width: 0;
  color: #d7d7d7;
  line-height: 1.1;
}

.gantt-label strong {
  min-width: 0;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.gantt-label small {
  min-width: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
}

.bar {
  position: relative;
  height: 16px;
  margin-left: var(--start);
  width: calc(var(--end) - var(--start));
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--bar-fill, 0%);
  border-radius: inherit;
  background: currentColor;
}

.bar.verify {
  color: var(--jrm-red);
}

.bar.mechanical {
  color: var(--mechanical);
}

.bar.plumbing {
  color: var(--plumbing);
}

.bar.electrical {
  color: var(--electrical);
}

.bar.itav {
  color: var(--itav);
}

.narrative {
  left: clamp(18px, 3vw, 44px);
  bottom: clamp(18px, 4vh, 46px);
  width: min(500px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 18px;
}

.narrative h2 {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1.12;
  letter-spacing: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
}

.narrative p:last-child {
  margin: 0;
  color: #d8d8d8;
  line-height: 1.48;
}

.riser-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  padding: 18px;
  background: #f4f3ef;
}

.riser-card {
  overflow: hidden;
  border: 1px solid rgba(25, 34, 38, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: #172126;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(25, 34, 38, 0.1);
}

.card-head span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.card-head h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.riser-card img {
  display: block;
  width: 100%;
  height: auto;
}

.logistics-board {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  padding: 0;
  background: #ffffff;
  isolation: isolate;
}

.logistics-top {
  position: absolute;
  z-index: 4;
  left: clamp(18px, 3vw, 44px);
  right: clamp(18px, 3vw, 44px);
  top: clamp(16px, 3vh, 34px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.logistics-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.logistics-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.logistics-tabs button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 10px;
  cursor: pointer;
}

.logistics-tabs button.active {
  color: #ffffff;
  border-color: var(--jrm-red);
  background: var(--jrm-red);
}

.logistics-shell {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.logistics-plan-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.logistics-plan-panel {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #ffffff;
  box-shadow: none;
}

.logistics-plan-stack {
  --logistics-pan-x: 0px;
  --logistics-pan-y: 0px;
  --logistics-zoom: 1;
  --logistics-layer-x: 0px;
  --logistics-layer-y: 0px;
  --logistics-layer-zoom: 1;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100vw;
  height: 100svh;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.logistics-plan-stack.is-panning {
  cursor: grabbing;
}

.logistics-plan-stack.align-mode {
  cursor: crosshair;
}

.logistics-layer {
  position: relative;
  grid-area: 1 / 1;
  width: min(100vw, calc(100svh * 3619 / 2507));
  height: auto;
  max-width: 100vw;
  max-height: 100svh;
  object-fit: contain;
  object-position: center center;
  opacity: 0;
  mix-blend-mode: normal;
  filter: none;
  pointer-events: none;
  transform: translate(calc(-96px + var(--logistics-pan-x)), var(--logistics-pan-y)) scale(var(--logistics-zoom));
  transform-origin: center center;
  transition: opacity 160ms ease;
}

.logistics-layer.logistics {
  z-index: 10;
  transform: translate(calc(-96px + var(--logistics-pan-x) + var(--logistics-layer-x)), calc(var(--logistics-pan-y) + var(--logistics-layer-y))) scale(var(--logistics-layer-zoom));
}

.logistics-white-underlay {
  position: relative;
  z-index: 9;
  grid-area: 1 / 1;
  width: min(100vw, calc(100svh * 3619 / 2507));
  aspect-ratio: 3619 / 2507;
  max-width: 100vw;
  max-height: 100svh;
  background: rgba(255, 255, 255, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-96px + var(--logistics-pan-x)), var(--logistics-pan-y)) scale(var(--logistics-zoom));
  transform-origin: center center;
  transition: opacity 160ms ease;
}

.logistics-white-underlay.active {
  opacity: 1;
}

.logistics-layer.active {
  opacity: 1;
  mix-blend-mode: multiply;
}

.logistics-layer.active.electrical {
  opacity: 0.94;
}

.logistics-layer.active.mechanical,
.logistics-layer.active.it,
.logistics-layer.active.fire-alarm,
.logistics-layer.active.fire-protection {
  opacity: 0.9;
}

.logistics-layer.active.structural {
  opacity: 0.76;
}

.logistics-layer.active.logistics {
  opacity: 0.95;
}

.logistics-shaft-overlay {
  position: relative;
  z-index: 12;
  grid-area: 1 / 1;
  width: min(100vw, calc(100svh * 3619 / 2507));
  aspect-ratio: 3619 / 2507;
  max-width: 100vw;
  max-height: 100svh;
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-96px + var(--logistics-pan-x)), var(--logistics-pan-y)) scale(var(--logistics-zoom));
  transform-origin: center center;
  transition: opacity 160ms ease;
}

.logistics-shaft-overlay.active {
  opacity: 1;
}

.logistics-shaft-marker {
  --shaft-color: #f4f000;
  --shaft-rgb: 244, 240, 0;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  border: 3px solid var(--shaft-color);
  background: rgba(var(--shaft-rgb), 0.3);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.72), 0 10px 28px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
}

.logistics-shaft-marker::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 22px;
  padding: 2px 5px;
  color: #000000;
  background: var(--shaft-color);
  font-size: 0.78rem;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.logistics-shaft-callout {
  --shaft-color: #f4f000;
  position: absolute;
  left: calc(var(--x) + var(--callout-x, 3.2%));
  top: calc(var(--y) + var(--callout-y, -4.2%));
  max-width: 154px;
  padding: 7px 9px;
  border: 1px solid var(--shaft-color);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.logistics-shaft-callout::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 18px;
  width: 22px;
  border-top: 2px solid var(--shaft-color);
}

.logistics-shaft-callout strong {
  display: block;
  color: var(--shaft-color);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.logistics-shaft-callout span {
  display: block;
  margin-top: 3px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.25;
}

.logistics-layer-toolbar {
  position: absolute;
  z-index: 30;
  left: clamp(18px, 3vw, 44px);
  bottom: clamp(18px, 3vh, 34px);
  display: grid;
  gap: 10px;
  width: min(260px, calc(100vw - 36px));
  max-height: calc(100svh - 180px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.logistics-layer-toolbar .panel-kicker {
  margin-bottom: 0;
}

.logistics-layer-toggle {
  display: grid;
  grid-template-columns: 18px 12px 1fr;
  align-items: center;
  gap: 9px;
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
}

.logistics-layer-toggle input {
  accent-color: var(--jrm-red);
}

.adjust-panel-toggle {
  min-height: 30px;
  margin-top: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.adjust-panel-toggle:hover,
.adjust-panel-toggle[aria-expanded="true"] {
  border-color: rgba(210, 35, 42, 0.72);
  background: rgba(210, 35, 42, 0.75);
}

.logistics-align-controls {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.logistics-align-controls.is-collapsed {
  display: none;
}

.logistics-align-controls .panel-kicker {
  margin: 0;
}

.align-pad {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  grid-template-rows: repeat(2, 30px);
  gap: 5px;
  justify-content: center;
}

.align-pad button,
.scale-pad button,
.reset-align-button,
.lock-align-button,
.align-mode-toggle {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.align-pad button:hover,
.scale-pad button:hover,
.reset-align-button:hover,
.lock-align-button:hover,
.align-mode-toggle:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
}

.align-mode-toggle[aria-pressed="true"],
.lock-align-button.locked {
  border-color: rgba(210, 35, 42, 0.72);
  background: rgba(210, 35, 42, 0.75);
}

.align-layer-select {
  display: grid;
  gap: 5px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.align-layer-select select {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.74);
  font: inherit;
  text-transform: none;
}

.align-pad [data-logistics-align="up"] {
  grid-column: 2;
}

.align-pad [data-logistics-align="left"] {
  grid-column: 1;
}

.align-pad [data-logistics-align="right"] {
  grid-column: 3;
}

.align-pad [data-logistics-align="down"] {
  grid-column: 2;
}

.scale-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.scale-pad button,
.reset-align-button,
.lock-align-button,
.align-mode-toggle {
  min-height: 30px;
}

.export-jpg-button {
  min-height: 34px;
  margin-top: 6px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--jrm-red);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.export-jpg-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.export-status {
  min-height: 1rem;
  margin: -2px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  line-height: 1.25;
}

.trade-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 16px currentColor;
}

.trade-swatch.mechanical {
  color: #17b386;
  background: #17b386;
}

.trade-swatch.electrical {
  color: #37a0ff;
  background: #37a0ff;
}

.trade-swatch.it {
  color: #8b7cff;
  background: #8b7cff;
}

.trade-swatch.fire-alarm {
  color: #d2232a;
  background: #d2232a;
}

.trade-swatch.fire-protection {
  color: #d67646;
  background: #d67646;
}

.trade-swatch.structural {
  color: #3c464e;
  background: #3c464e;
}

.trade-swatch.logistics {
  color: #f2c94c;
  background: #f2c94c;
}

.trade-swatch.shafts {
  color: #f4f000;
  background: #f4f000;
}

.elevation-board {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
  isolation: isolate;
}

.elevation-top {
  position: absolute;
  z-index: 4;
  left: clamp(18px, 3vw, 44px);
  right: clamp(18px, 3vw, 44px);
  top: clamp(16px, 3vh, 34px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.elevation-shell {
  --min-floor: 22;
  --max-floor: 45;
  position: absolute;
  inset: clamp(120px, 17vh, 170px) clamp(24px, 4vw, 64px) 24px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: minmax(420px, 1fr);
  gap: 18px 24px;
}

.floor-rail {
  position: relative;
  grid-row: 1;
  color: rgba(255, 255, 255, 0.2);
  font-weight: 900;
}

.floor-rail span {
  position: absolute;
  top: calc((var(--max-floor) - var(--floor)) / (var(--max-floor) - var(--min-floor)) * 100%);
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transform: translateY(-50%);
}

.shaft-elevation {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
}

.floor-lines i {
  position: absolute;
  left: 14%;
  right: 16%;
  top: calc((var(--max-floor) - var(--floor)) / (var(--max-floor) - var(--min-floor)) * 100%);
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

.shaft-bar {
  --width: 34px;
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc((var(--max-floor) - var(--end)) / (var(--max-floor) - var(--min-floor)) * 100%);
  width: var(--width);
  height: calc((var(--end) - var(--start)) / (var(--max-floor) - var(--min-floor)) * 100%);
  min-height: 44px;
  display: grid;
  align-content: center;
  justify-items: center;
  color: #000000;
  background: #f4f000;
  box-shadow: 0 0 18px rgba(244, 240, 0, 0.28);
}

.shaft-bar::before,
.shaft-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.9);
}

.shaft-bar::before {
  top: 20%;
}

.shaft-bar::after {
  bottom: 20%;
}

.shaft-bar strong {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 900;
}

.shaft-bar small {
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 900;
}

.shaft-5e {
  --width: 28px;
  background: #f4f000;
  box-shadow: 0 0 18px rgba(244, 240, 0, 0.28);
}

.shaft-5e::after {
  bottom: 43%;
}

.shaft-5e strong {
  margin-top: 34%;
}

.shaft-5d,
.shaft-7d,
.shaft-9e {
  --width: 24px;
}

.shaft-5d {
  background: #ffa630;
  box-shadow: 0 0 18px rgba(255, 166, 48, 0.28);
}

.shaft-8e {
  --width: 28px;
  background: #37a0ff;
  box-shadow: 0 0 18px rgba(55, 160, 255, 0.28);
}

.shaft-7d {
  background: #17b386;
  box-shadow: 0 0 18px rgba(23, 179, 134, 0.28);
}

.shaft-9e {
  background: #8b7cff;
  box-shadow: 0 0 18px rgba(139, 124, 255, 0.28);
}

@media (max-width: 980px) {
  .hud-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .side-panel {
    top: auto;
    bottom: 18px;
  }

  .sequence-mode .side-panel {
    bottom: 180px;
  }

  .narrative {
    bottom: 18px;
    right: auto;
    width: min(450px, calc(100vw - 390px));
  }

  .sequence-mode .narrative {
    top: 250px;
    bottom: auto;
    width: min(300px, calc(100vw - 36px));
    min-height: 380px;
  }

  .floor-callouts {
    right: 18px;
  }

  .riser-board {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .logistics-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .logistics-actions {
    justify-items: start;
  }

  .logistics-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .slide-tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    padding: 0 8px;
  }

  .narrative {
    display: none;
  }

  .side-panel {
    padding: 12px;
  }

  .sequence-mode .side-panel {
    display: none;
  }

  .timeline-body {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  #sequence-scrub {
    left: 84px;
    width: calc(100% - 84px);
  }

  .timeline-playhead {
    left: 84px;
  }

  .riser-board {
    grid-template-columns: 1fr;
  }

  .logistics-board {
    padding: 0;
  }

  .logistics-tabs {
    justify-content: flex-start;
  }
}
