:root {
  --ink: #17201c;
  --muted: #66706a;
  --line: #dce3df;
  --panel: #ffffff;
  --page: #f5f6f4;
  --green: #177245;
  --green-dark: #0f5135;
  --green-soft: #e5f3eb;
  --mint: #dff4e8;
  --amber: #d58a00;
  --amber-soft: #fff1cc;
  --blue: #256f92;
  --blue-soft: #e2f1f8;
  --red: #b7383d;
  --red-soft: #fde7e6;
  --roof: #7f948b;
  --wall: #d7dfda;
  --wall-dark: #aebdb5;
  --shadow: 0 20px 60px rgba(24, 34, 29, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
.home-cta {
  font: inherit;
}

button,
.home-cta {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  background: linear-gradient(180deg, #1f8555, var(--green-dark));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 9px 18px rgba(15, 81, 53, 0.16);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover,
.home-cta:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 81, 53, 0.19);
}

button:active,
.home-cta:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(15, 81, 53, 0.14);
}

button:focus-visible,
.home-cta:focus-visible,
input:focus,
select:focus {
  outline: 3px solid rgba(37, 111, 146, 0.24);
  outline-offset: 2px;
}

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

h1 {
  font-size: 22px;
  line-height: 1;
}

h2 {
  font-size: 20px;
  line-height: 1.15;
}

h3 {
  font-size: 15px;
  line-height: 1.25;
}

.is-hidden {
  display: none;
}

.site-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 222, 109, 0.26), transparent 0 18%, rgba(7, 13, 20, 0.96) 46%),
    #07101a;
  pointer-events: none;
  animation: introExit 3200ms ease forwards;
}

.intro-mark {
  display: grid;
  justify-items: center;
  gap: 58px;
  transform: translateY(-32px);
}

.intro-bulb {
  position: relative;
  width: 116px;
  height: 132px;
  border: 10px solid rgba(255, 255, 255, 0.95);
  border-radius: 58px 58px 48px 48px;
  background:
    linear-gradient(90deg, rgba(255, 214, 74, 0.56) 0 50%, rgba(74, 186, 255, 0.28) 50%),
    rgba(255, 224, 130, 0.18);
  box-shadow: 0 0 54px rgba(255, 206, 72, 0.88), inset 0 0 26px rgba(255, 218, 103, 0.55);
  animation: introBulbOff 3200ms ease forwards;
}

.intro-bulb::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 44px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 28px 0 rgba(255, 255, 255, 0.96),
    0 56px 0 rgba(255, 255, 255, 0.96);
}

.intro-bulb::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: -32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 0 rgba(255, 255, 255, 0.95);
}

.intro-word {
  color: #f7fbff;
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 950;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(24px);
  text-shadow: 0 10px 32px rgba(93, 192, 255, 0.28);
  animation: introWordIn 3200ms ease forwards;
}

@keyframes introBulbOff {
  0%, 22% {
    filter: brightness(1);
    box-shadow: 0 0 54px rgba(255, 206, 72, 0.88), inset 0 0 26px rgba(255, 218, 103, 0.55);
    background:
      linear-gradient(90deg, rgba(255, 214, 74, 0.56) 0 50%, rgba(74, 186, 255, 0.28) 50%),
      rgba(255, 224, 130, 0.18);
  }
  30%, 100% {
    filter: brightness(0.76);
    box-shadow: 0 0 0 rgba(255, 206, 72, 0), inset 0 0 18px rgba(255, 255, 255, 0.08);
    background:
      linear-gradient(90deg, rgba(24, 37, 50, 0.66) 0 50%, rgba(22, 48, 68, 0.58) 50%),
      rgba(8, 16, 24, 0.7);
  }
}

@keyframes introWordIn {
  0%, 30% {
    opacity: 0;
    transform: translateY(24px);
  }
  44%, 86% {
    opacity: 1;
    transform: translateY(10px);
  }
  100% {
    opacity: 0;
    transform: translateY(4px);
  }
}

@keyframes introExit {
  0%, 88% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.planner-anchor {
  height: 0;
  scroll-margin-top: 0;
}

.home-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(120deg, rgba(226, 241, 248, 0.9), rgba(229, 243, 235, 0.92)),
    #f7faf8;
}

.home-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 34px;
  align-items: center;
  width: min(1060px, 100%);
}

.home-copy {
  display: grid;
  gap: 18px;
}

.home-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 950;
}

.home-copy h1 {
  max-width: 720px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.96;
}

.home-description {
  max-width: 620px;
  color: #4f5d56;
  font-size: 18px;
  line-height: 1.55;
}

.home-cta {
  display: inline-grid;
  place-items: center;
  min-width: 154px;
  min-height: 46px;
}

.home-actions {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.home-more-info {
  width: min(560px, 100%);
}

.home-more-info summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #cfded6;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.home-more-info summary::-webkit-details-marker {
  display: none;
}

.home-more-info > div {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.home-more-info article {
  padding: 11px 12px;
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.home-more-info h2 {
  margin-bottom: 5px;
  font-size: 14px;
}

.home-more-info p {
  color: #4f5d56;
  font-size: 13px;
  line-height: 1.45;
}

.training-panel {
  gap: 8px;
}

.training-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.training-upload,
.training-actions button {
  display: inline-grid;
  place-items: center;
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d5ded9;
  border-radius: 6px;
  background: #f4f7f5;
  color: #20352d;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
}

.training-upload input {
  display: none;
}

.home-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(23, 32, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 24px 60px rgba(24, 34, 29, 0.14);
}

.preview-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.preview-topline span {
  width: 74px;
  height: 9px;
  border-radius: 999px;
  background: var(--green-dark);
}

.lightup-room {
  position: relative;
  height: 190px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 28, 0.12);
  border-radius: 8px;
  background: #111820;
  box-shadow: inset 0 -28px 0 rgba(0, 0, 0, 0.16);
  animation: roomBrighten 2800ms ease-out 420ms both;
}

.cartoon-wall,
.cartoon-floor,
.cartoon-glow,
.cartoon-light,
.cartoon-desk,
.cartoon-window,
.cartoon-switch {
  position: absolute;
  display: block;
}

.cartoon-wall {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #151f2a, #10171f);
  background-size: 34px 34px, 34px 34px, auto;
  animation: wallWake 2800ms ease-out 420ms both;
}

.cartoon-floor {
  left: -20px;
  right: -20px;
  bottom: -26px;
  height: 76px;
  border-radius: 50% 50% 0 0;
  background: #1c2b28;
  animation: floorWake 2800ms ease-out 420ms both;
}

.cartoon-light {
  left: 50%;
  top: 16px;
  width: 62px;
  height: 20px;
  border-radius: 0 0 18px 18px;
  background: #4a5560;
  transform: translateX(-50%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  animation: fixtureWake 2800ms ease-out 420ms both;
}

.cartoon-light::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 3px;
  height: 18px;
  background: #5b6873;
  transform: translateX(-50%);
}

.cartoon-glow {
  left: 50%;
  top: 28px;
  width: 190px;
  height: 150px;
  border-radius: 0 0 48% 48%;
  background: radial-gradient(circle at 50% 0, rgba(255, 221, 111, 0.86), rgba(255, 221, 111, 0.22) 48%, transparent 72%);
  opacity: 0;
  transform: translateX(-50%) scaleY(0.45);
  transform-origin: top;
  animation: lightCone 2800ms cubic-bezier(.2, .8, .2, 1) 420ms both;
}

.cartoon-desk {
  left: 58px;
  bottom: 34px;
  width: 128px;
  height: 44px;
  border-radius: 8px 8px 5px 5px;
  background: #30413b;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.12);
  animation: deskWake 2800ms ease-out 420ms both;
}

.cartoon-desk::before,
.cartoon-desk::after {
  content: "";
  position: absolute;
  bottom: -34px;
  width: 10px;
  height: 34px;
  border-radius: 5px;
  background: #25342f;
}

.cartoon-desk::before {
  left: 18px;
}

.cartoon-desk::after {
  right: 18px;
}

.cartoon-window {
  right: 54px;
  top: 56px;
  width: 82px;
  height: 58px;
  border: 5px solid #273644;
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255, 255, 255, 0.45) 47% 53%, transparent 53%),
    linear-gradient(transparent 47%, rgba(255, 255, 255, 0.45) 47% 53%, transparent 53%),
    #1c384e;
  animation: windowWake 2800ms ease-out 420ms both;
}

.cartoon-switch {
  right: 34px;
  bottom: 58px;
  width: 28px;
  height: 44px;
  border: 3px solid #5d6871;
  border-radius: 8px;
  background: #1a222b;
  animation: switchPlateWake 2800ms ease-out 420ms both;
}

.cartoon-switch i {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: #8b949b;
  transform: translateX(-50%) rotate(15deg);
  transform-origin: 50% 85%;
  animation: switchFlip 2800ms cubic-bezier(.18, .9, .18, 1) 420ms both;
}

@keyframes roomBrighten {
  0%, 42% { background-color: #101820; }
  58% { background-color: #263b42; }
  100% { background-color: #eaf5ef; }
}

@keyframes wallWake {
  0%, 42% { filter: brightness(0.55) saturate(0.8); }
  60% { filter: brightness(1.2) saturate(1.15); }
  100% { filter: brightness(1) saturate(1); }
}

@keyframes floorWake {
  0%, 42% { background: #14201e; }
  100% { background: #bddfd0; }
}

@keyframes fixtureWake {
  0%, 42% {
    background: #4a5560;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  }
  54%, 100% {
    background: #ffe08a;
    box-shadow: 0 0 22px rgba(255, 208, 84, 0.72), inset 0 -4px 0 rgba(165, 118, 23, 0.14);
  }
}

@keyframes lightCone {
  0%, 42% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.35);
  }
  56% {
    opacity: 1;
    transform: translateX(-50%) scaleY(1.06);
  }
  100% {
    opacity: 0.82;
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes deskWake {
  0%, 42% { background: #30413b; transform: translateY(10px); }
  100% { background: #6da886; transform: translateY(0); }
}

@keyframes windowWake {
  0%, 42% {
    border-color: #273644;
    background-color: #1c384e;
  }
  100% {
    border-color: #ffffff;
    background-color: #8fd4ff;
  }
}

@keyframes switchPlateWake {
  0%, 42% {
    border-color: #5d6871;
    background: #1a222b;
  }
  100% {
    border-color: #ffffff;
    background: #f8fbf9;
  }
}

@keyframes switchFlip {
  0%, 38% {
    background: #8b949b;
    transform: translateX(-50%) rotate(15deg);
  }
  48%, 100% {
    background: #1f8555;
    transform: translateX(-50%) rotate(-15deg);
  }
}

.preview-map {
  position: relative;
  height: 270px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.075) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1px),
    #091017;
  background-size: 38px 38px;
}

.preview-map::before {
  content: "";
  position: absolute;
  inset: 52px 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  transform: rotate(-18deg) skewX(-15deg);
  background: rgba(255, 255, 255, 0.055);
}

.preview-room {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  transform: rotate(-18deg) skewX(-15deg);
}

.room-a {
  width: 84px;
  height: 52px;
  left: 66px;
  top: 78px;
  border-color: rgba(255, 203, 92, 0.95);
  box-shadow: 0 0 24px rgba(245, 166, 35, 0.55);
}

.room-b {
  width: 96px;
  height: 62px;
  left: 194px;
  top: 60px;
  border-color: rgba(119, 205, 238, 0.9);
  box-shadow: 0 0 24px rgba(37, 111, 146, 0.48);
}

.room-c {
  width: 120px;
  height: 56px;
  left: 132px;
  top: 162px;
}

.room-d {
  width: 72px;
  height: 76px;
  left: 282px;
  top: 150px;
}

.preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-stats span {
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.preview-stats strong {
  color: var(--ink);
  font-size: 20px;
}

.topbar,
.brand,
.topbar-actions,
.campus-header,
.section-heading,
.form-actions,
.kpi-strip,
.systems,
.legend,
.focus-meta,
.scene-toolbar {
  display: flex;
  align-items: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: url("assets/lightsout-logo.png") center / cover no-repeat;
  box-shadow: 0 9px 18px rgba(8, 16, 13, 0.16);
}

.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
}

.logo-mark::before {
  display: none;
}

.logo-mark::after {
  display: none;
}

.brand p,
.eyebrow,
.date-control span,
label,
.schedule-card p,
.action-card p,
.assumption-box p,
.focus-strip p,
.empty-state p,
.room-note {
  color: var(--muted);
}

.topbar-actions {
  gap: 10px;
}

.date-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.ghost-button,
.small-button {
  border-color: #d5ded9;
  background: #f4f7f5;
  color: #20352d;
  box-shadow: 0 5px 12px rgba(24, 34, 29, 0.06);
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 850;
}

#resetDemo {
  border-color: #ead5d2;
  background: #fff3f1;
  color: #9c3034;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  max-width: 1540px;
  margin: 0 auto;
  padding: 18px;
}

.workspace.side-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.panel-toggle {
  white-space: nowrap;
}

.campus-panel,
.side-section,
.assumption-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.campus-panel {
  min-width: 0;
  overflow: hidden;
  align-self: start;
}

.campus-header,
.section-heading {
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.time-control {
  width: min(360px, 42%);
}

.time-control label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cdd7d1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

input[type="range"] {
  min-height: 26px;
  padding: 0;
  accent-color: var(--green);
}

.layer-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.layer-control legend {
  margin-right: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.layer-toggle {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.layer-toggle input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--green);
}

.lights-layer input {
  accent-color: #d58a00;
}

.hvac-layer input {
  accent-color: #256f92;
}

.campus-stage {
  position: relative;
  min-height: calc(100vh - 238px);
  overflow: hidden;
  contain: layout paint;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    #070b10;
  background-size: 56px 56px, 56px 56px, auto;
}

.scene-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 8;
  gap: 8px;
  flex-wrap: wrap;
}

.scene-toolbar .small-button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: #101a17;
}

.campus-viewport {
  position: absolute;
  inset: 18px 18px 70px;
  display: grid;
  place-items: center;
  perspective: 1100px;
  user-select: none;
  cursor: grab;
}

.campus-viewport:active {
  cursor: grabbing;
}

.school-model {
  position: relative;
  width: 680px;
  height: 440px;
  transform-style: preserve-3d;
  transform: rotateX(var(--pitch, 60deg)) rotateZ(var(--rotation, -36deg));
  transition: transform 120ms ease-out;
  will-change: transform;
}

.school-model.is-dragging {
  transition: none;
}

.school-model::before {
  content: "";
  position: absolute;
  inset: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.42);
  transform: translateZ(-12px);
}

.floor-plate {
  position: absolute;
  width: 610px;
  height: 370px;
  left: 42px;
  top: 42px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.floor-wing {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.03), 0 8px 14px rgba(0, 0, 0, 0.18);
}

.top-wing {
  left: 114px;
  top: 36px;
  width: 432px;
  height: 84px;
}

.left-wing {
  left: 56px;
  top: 72px;
  width: 106px;
  height: 246px;
}

.bottom-wing {
  left: 114px;
  top: 280px;
  width: 432px;
  height: 78px;
}

.floor-label {
  position: absolute;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 900;
  transform: translateZ(28px) rotateZ(calc(var(--rotation, -36deg) * -1)) rotateX(calc(var(--pitch, 60deg) * -1));
}

.floor-label {
  left: 58px;
  top: 322px;
}

.floor-one {
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.32), inset 0 0 18px rgba(255, 255, 255, 0.025);
  transform: translateZ(-2px);
}

.floor-two {
  box-shadow: 0 0 0 1px rgba(115, 193, 220, 0.22), 0 0 18px rgba(115, 193, 220, 0.12);
  transform: translateZ(58px);
}

.floor-two .floor-wing {
  background: rgba(120, 190, 220, 0.065);
  border-color: rgba(120, 190, 220, 0.22);
}

.floor-two .floor-label {
  left: 58px;
  top: 322px;
}

.room-block {
  position: absolute;
  width: var(--w);
  height: var(--d);
  left: var(--x);
  top: var(--z);
  transform-style: preserve-3d;
  transform: translateZ(var(--floor-z, 0));
}

.room-top,
.room-front,
.room-back,
.room-left,
.room-side {
  position: absolute;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.54);
  pointer-events: none;
}

.room-top {
  inset: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.24);
  transform: translateZ(calc(var(--h) - 1px));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.room-front {
  left: 0;
  right: 0;
  top: 100%;
  height: var(--h);
  background: rgba(255, 255, 255, 0.16);
  transform-origin: top center;
  transform: rotateX(90deg);
}

.room-back {
  left: 0;
  right: 0;
  top: 0;
  height: var(--h);
  background: rgba(255, 255, 255, 0.11);
  transform-origin: top center;
  transform: rotateX(90deg);
}

.room-left {
  top: 0;
  left: 0;
  width: var(--h);
  height: 100%;
  background: rgba(255, 255, 255, 0.12);
  transform-origin: left center;
  transform: rotateY(-90deg);
}

.room-side {
  top: 0;
  left: 100%;
  width: var(--h);
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transform-origin: left center;
  transform: rotateY(-90deg);
}

.room-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  width: max-content;
  max-width: 118px;
  min-height: 0;
  padding: 4px 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0d1218;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -50%) translateZ(calc(var(--h) + 8px)) rotateZ(calc(var(--rotation, -36deg) * -1)) rotateX(calc(var(--pitch, 60deg) * -1));
  box-shadow: 0 3px 7px rgba(25, 35, 31, 0.1);
  pointer-events: auto;
  cursor: pointer;
}

.room-label:hover,
.room-label:active {
  filter: none;
  background: #fff;
  color: #0d1218;
  transform: translate(-50%, -50%) translateZ(calc(var(--h) + 8px)) rotateZ(calc(var(--rotation, -36deg) * -1)) rotateX(calc(var(--pitch, 60deg) * -1));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.room-block.status-on.layers-lights .room-top {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 203, 92, 0.95);
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.5), inset 0 0 12px rgba(245, 166, 35, 0.18), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.room-block.status-on.layers-lights .room-front,
.room-block.status-on.layers-lights .room-back,
.room-block.status-on.layers-lights .room-left,
.room-block.status-on.layers-lights .room-side {
  background: rgba(245, 166, 35, 0.2);
  border-color: rgba(255, 203, 92, 0.8);
}

.room-block.status-on.layers-hvac .room-top {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(119, 205, 238, 0.95);
  box-shadow: 0 0 14px rgba(37, 111, 146, 0.46), inset 0 0 12px rgba(37, 111, 146, 0.24), inset 0 0 0 2px rgba(255, 255, 255, 0.26);
}

.room-block.status-on.layers-hvac .room-front,
.room-block.status-on.layers-hvac .room-back,
.room-block.status-on.layers-hvac .room-left,
.room-block.status-on.layers-hvac .room-side {
  background: rgba(37, 111, 146, 0.24);
  border-color: rgba(119, 205, 238, 0.8);
}

.room-block.status-on.layers-both .room-top {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0 44%, rgba(245, 166, 35, 0.32) 44% 52%, rgba(37, 111, 146, 0.36) 52% 100%);
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.34), 0 0 14px rgba(37, 111, 146, 0.32), inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.room-block.status-on.layers-both .room-front {
  background: rgba(245, 166, 35, 0.18);
  border-color: rgba(255, 203, 92, 0.72);
}

.room-block.status-on.layers-both .room-back,
.room-block.status-on.layers-both .room-left,
.room-block.status-on.layers-both .room-side {
  background: rgba(37, 111, 146, 0.22);
  border-color: rgba(119, 205, 238, 0.72);
}

.room-block.status-soon.layers-lights .room-top {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 203, 92, 0.78);
  box-shadow: 0 0 10px rgba(213, 138, 0, 0.3), inset 0 0 8px rgba(213, 138, 0, 0.14), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.room-block.status-soon.layers-hvac .room-top {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(119, 205, 238, 0.78);
  box-shadow: 0 0 10px rgba(37, 111, 146, 0.34), inset 0 0 8px rgba(37, 111, 146, 0.18), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.room-block.status-soon.layers-both .room-top {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 50%, rgba(119, 205, 238, 0.22) 50% 100%);
  box-shadow: 0 0 10px rgba(37, 111, 146, 0.28), 0 0 10px rgba(213, 138, 0, 0.24), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.room-block.status-soon .room-front,
.room-block.status-soon .room-back,
.room-block.status-soon .room-left,
.room-block.status-soon .room-side {
  background: rgba(255, 255, 255, 0.13);
}

.room-block.status-off .room-top {
  background: rgba(255, 255, 255, 0.14);
}

.room-block.hovered .room-top {
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(255, 255, 255, 0.95);
}

.room-block.hovered .room-front,
.room-block.hovered .room-back,
.room-block.hovered .room-left,
.room-block.hovered .room-side {
  border-color: rgba(255, 255, 255, 0.8);
}

.room-block.selected .room-top {
  outline: 4px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.legend {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 8;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.86);
  color: rgba(255, 255, 255, 0.9);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 850;
}

.legend i {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.legend-on {
  background: linear-gradient(135deg, #f5a623 0 50%, #256f92 50% 100%);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.65);
}

.legend-soon {
  background: #2f82a8;
}

.legend-off {
  background: #8d9b94;
}

.focus-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.focus-strip h3 {
  margin-bottom: 4px;
}

.focus-strip p {
  font-size: 13px;
  line-height: 1.45;
}

.focus-meta {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.side-panel[hidden] {
  display: none;
}

.tab-shell {
  overflow: hidden;
}

.side-section,
.assumption-box {
  box-shadow: 0 12px 30px rgba(24, 34, 29, 0.08);
}

.side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid #e8eee9;
  background: #eef4f0;
}

.side-tab {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #526059;
  font-weight: 900;
  box-shadow: none;
}

.side-tab.active {
  border-color: rgba(15, 81, 53, 0.12);
  background: #173a2d;
  color: #fff;
  box-shadow: 0 7px 16px rgba(15, 81, 53, 0.18);
}

.side-tab:hover {
  filter: none;
  transform: none;
  box-shadow: none;
}

.side-tab.active:hover {
  box-shadow: 0 7px 16px rgba(15, 81, 53, 0.18);
}

.panel-header {
  display: grid;
  gap: 3px;
  padding: 14px 14px 6px;
}

.panel-header h2 {
  font-size: 18px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.event-form {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.room-picker {
  position: relative;
  display: grid;
  gap: 7px;
}

.room-picker input[type="search"] {
  padding-left: 34px;
  background:
    linear-gradient(90deg, transparent 0 27px, #dfe8e2 27px 28px, transparent 28px),
    radial-gradient(circle at 15px 17px, transparent 0 5px, #66706a 5px 6px, transparent 6px),
    linear-gradient(45deg, transparent 0 20px, #66706a 20px 22px, transparent 22px),
    #fff;
}

.room-results {
  display: grid;
  gap: 5px;
  max-height: 178px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #d8e4dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(24, 34, 29, 0.12);
}

.room-results[hidden] {
  display: none;
}

.room-results button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f7faf8;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.room-results button:hover,
.room-results button:focus-visible {
  border-color: #c6ded1;
  background: var(--green-soft);
  transform: none;
  box-shadow: none;
}

.room-results strong {
  font-size: 13px;
  line-height: 1;
}

.room-results span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.field-hint {
  min-height: 17px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.field-hint.is-error {
  color: var(--red);
}

.needs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dde7e1;
  border-radius: 8px;
  background: #fbfcfb;
}

.needs legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.needs label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.needs input {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.form-actions {
  gap: 10px;
  padding-top: 2px;
}

.form-actions button {
  flex: 1;
}

.form-actions .ghost-button {
  background: #eef3f0;
}

.kpi-strip {
  gap: 8px;
  padding: 8px 12px 10px;
}

.weather-panel {
  padding: 0 12px 10px;
}

.weather-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d2e6ee;
  border-radius: 8px;
  background: linear-gradient(180deg, #f6fbfd, #edf7fb);
}

.weather-card.offline {
  border-color: #f3d99b;
  background: #fff8e8;
}

.weather-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.weather-card strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  line-height: 1;
}

.weather-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.kpi {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e0e8e3;
  border-radius: 8px;
  background: #f8faf8;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.05;
}

.kpi-saved {
  border-color: #cfe7d9;
  background: #f2fbf5;
}

.kpi-saved strong {
  color: var(--green-dark);
}

.action-list,
.schedule-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  max-height: 320px;
  overflow: auto;
}

.model-insights {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.action-card,
.schedule-card,
.model-card,
.assumption-box,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.action-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-color: #e2e9e5;
  background: #fffdf8;
}

.time-chip {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 7px;
  background: #e9f4f8;
  color: #1d6382;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.action-card h3,
.schedule-card strong {
  display: block;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.action-card p,
.schedule-card p {
  font-size: 12px;
  line-height: 1.38;
}

.schedule-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-color: #e2e9e5;
  background: #fbfcfb;
}

.model-card {
  padding: 10px;
  border-color: #e1e9e5;
}

.model-card h3 {
  margin-bottom: 5px;
}

.model-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.model-card.blue {
  border-color: #d2e6ee;
  background: #f5fbfd;
}

.model-card.green {
  border-color: #d7eadf;
  background: #f6fbf8;
}

.model-card.amber {
  border-color: #f3d99b;
  background: #fff8e8;
}

.model-card.yellow {
  border-color: #f1c232;
  background: #fff3b8;
}

.schedule-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.card-actions {
  display: flex;
  gap: 7px;
}

.card-actions button {
  min-height: 31px;
  padding: 0 10px;
  border-color: #d9e3dd;
  background: #f1f6f3;
  color: #20352d;
  font-size: 12px;
  box-shadow: none;
}

.card-actions button:hover {
  transform: none;
  box-shadow: none;
}

.card-actions button.delete {
  border-color: #f0cfcc;
  background: #fff0ee;
  color: var(--red);
}

.systems {
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.pill.amber {
  background: var(--amber-soft);
  color: #8b5600;
}

.pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.red {
  background: var(--red-soft);
  color: var(--red);
}

.assumption-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fbfcfb;
  box-shadow: none;
}

.visual-assumption {
  grid-template-columns: 180px repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 14px 18px;
  border-width: 1px 0 0;
  border-radius: 0;
  background: #f8faf8;
}

.visual-assumption h3 {
  color: var(--green-dark);
}

.assumption-box p {
  font-size: 12px;
  line-height: 1.38;
}

.empty-state {
  padding: 20px;
  text-align: center;
}

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

  .home-preview {
    max-width: 560px;
  }

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

  .campus-stage {
    min-height: 620px;
  }

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

  .assumption-box {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  .home-screen {
    padding: 18px;
    place-items: start;
  }

  .home-content {
    gap: 22px;
  }

  .home-copy h1 {
    font-size: 42px;
  }

  .home-description {
    font-size: 16px;
  }

  .preview-map {
    height: 220px;
  }

  .lightup-room {
    height: 168px;
  }

  .cartoon-desk {
    left: 36px;
  }

  .cartoon-window {
    right: 38px;
  }

  .preview-stats {
    grid-template-columns: 1fr;
  }

  .topbar,
  .campus-header,
  .section-heading,
  .focus-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar,
  .workspace {
    padding: 12px;
  }

  .topbar-actions,
  .date-control,
  .time-control,
  .side-panel {
    width: 100%;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .campus-stage {
    min-height: 560px;
  }

  .school-model {
    width: 520px;
    height: 360px;
    transform: scale(0.78) rotateX(var(--pitch, 60deg)) rotateZ(var(--rotation, -36deg));
  }

  .kpi-strip,
  .form-grid,
  .action-card {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightup-room,
  .site-intro,
  .intro-bulb,
  .intro-word,
  .cartoon-wall,
  .cartoon-floor,
  .cartoon-glow,
  .cartoon-light,
  .cartoon-desk,
  .cartoon-window,
  .cartoon-switch,
  .cartoon-switch i {
    animation-duration: 1ms;
    animation-delay: 0ms;
  }
}
