/* Colors, type and the red/brass chevron stripe match the Frog Level VFD site. */
@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@500;700;800&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --red: #b3261e;
  --red-dark: #8c1b15;
  --navy: #1e242b;
  --gold: #c9a24a; /* brass */
  --gold-dark: #a8842f;
  --ink: #23272c;
  --muted: #5e6873;
  --line: #ddd6c7;
  --bg: #faf8f3;
  --panel: #ffffff;
  --tile: #f0ece3;
  --tile-hover: #e6e0d3;
  --tile-current: #f7eed6;
  --chip: #1e242b;
  --chip-me: #b3261e;
  --font-display: 'Bitter', Georgia, 'Times New Roman', serif;
  --stripe: repeating-linear-gradient(-45deg, var(--red) 0 22px, var(--gold) 22px 44px);
  --ok: #2e7d32;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 2px 8px rgb(0 0 0 / 0.06);
  font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: var(--font-display); font-weight: 700; color: var(--navy); }
h2 { font-size: 1.15rem; }
a { color: var(--red-dark); }
[hidden] { display: none !important; }
hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--navy);
  color: #fff;
  border-bottom: 12px solid;
  border-image: var(--stripe) 12;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.brand-mark {
  display: block;
  height: 48px;
  width: auto;
  margin: -6px 0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.topbar .muted { color: rgb(255 255 255 / 0.75); }
.topbar .spacer { flex: 1; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  padding: 6px 10px;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.topbar nav a:hover { background: rgb(255 255 255 / 0.08); }
.topbar nav a.active { box-shadow: inset 0 -3px 0 var(--gold); }
.toplink { color: #fff; font-weight: 600; font-size: 0.95rem; }
.topbar .timer { background: rgb(255 255 255 / 0.12); color: #fff; }

/* ---- Controls --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--tile); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.gold { background: var(--red); border-color: var(--red); color: #fff; }
.btn.gold:hover { background: var(--red-dark); }
.btn.red { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn.red:hover { background: #6e140f; }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 0.85rem; }
.btn.icon { padding: 3px 8px; min-width: 30px; }

input, select, textarea {
  font: inherit;
  color: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

.error { color: var(--red); font-weight: 600; min-height: 1.2em; margin: 0; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---- Panels / cards --------------------------------------------------- */
.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel { padding: 12px; display: grid; gap: 10px; align-content: start; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head .spacer { flex: 1; }
.card-head {
  padding: 12px 16px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 6px solid;
  border-image: var(--stripe) 6;
}
.card-body { padding: 18px 16px; display: grid; gap: 14px; }

/* ---- Login ------------------------------------------------------------ */
.center { display: grid; place-items: start center; padding: 48px 16px; }
/* Login: the department logo, faded, behind the sign-in card */
.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--dept-logo, none) center 58% / min(84vw, 680px) no-repeat;
  opacity: 0.16;
  pointer-events: none;
}
.login-page main { position: relative; }
.login { width: min(480px, 100%); }
.login .btn { justify-self: center; min-width: 140px; }
/* Cloudflare's robot check box (about 65px tall while it works). */
.login .robot-check { display: flex; justify-content: center; min-height: 65px; }
#unit-slot { display: grid; }
/* The login page: sign-in on the left, the student guide and instructor
   login beside it (under it on a phone). */
.landing { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 340px); gap: 20px; align-items: start; width: min(840px, 100%); }
.landing .login { width: 100%; }
.landing-side { display: grid; gap: 14px; }
.landing-card { display: flex; gap: 14px; padding: 16px; color: var(--ink); text-decoration: none; border-left: 5px solid var(--gold); transition: background 0.15s; }
.landing-card:hover { background: #fffaf0; }
.landing-card.instructor { border-left-color: var(--navy); }
.landing-icon { font-size: 2rem; line-height: 1; }
.landing-text { display: grid; gap: 6px; line-height: 1.45; }
.landing-text strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--navy); }
.landing-go { font-weight: 700; color: var(--red); }
@media (max-width: 760px) { .landing { grid-template-columns: minmax(0, 1fr); } .center { padding-top: 24px; } }

/* ---- Exercise layout -------------------------------------------------- */
.ex-layout {
  display: grid;
  gap: 12px;
  padding: 12px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  grid-template-areas: 'viewer board' 'viewer chat';
  /* The board keeps its height and the chat sits right under it, also when
     the chat is shrunk to its heading. */
  grid-template-rows: auto 1fr;
  align-items: start;
}
.viewer-panel { grid-area: viewer; position: sticky; top: 12px; }
.board-panel { grid-area: board; }
.chat-panel { grid-area: chat; }
@media (max-width: 900px) {
  .ex-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'viewer' 'board' 'chat'; grid-template-rows: none; }
  .viewer-panel { position: static; }
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.35rem;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--tile);
}
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--tile);
  color: var(--muted);
}
.pill.running { background: #dff3e1; color: var(--ok); }
.pill.paused { background: #fff3d1; color: #8a6100; }
.pill.ended { background: #fde2e2; color: var(--red-dark); }
.me-badge { font-weight: 700; padding: 4px 10px; border-radius: 6px; background: var(--chip-me); color: #fff; }

/* ---- Mayday ---- */
/* The unit's hold-to-call button: the fill grows while it is held. */
.mayday-btn { position: relative; overflow: hidden; background: #d32f2f; border-color: #8c1b15; color: #fff; font-weight: 800; touch-action: none; user-select: none; -webkit-user-select: none; }
.mayday-btn:hover:not(:disabled) { background: #b71c1c; }
.mayday-btn:disabled { background: #6b6f74; border-color: #555; color: #e4e4e4; opacity: 1; }
.mayday-btn::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 0; background: rgb(255 255 255 / 0.35); }
.mayday-btn.holding::before { width: 100%; transition: width var(--hold-ms, 2s) linear; }
.mayday-btn.flash { animation: mayday-flash 0.8s steps(2, jump-none) infinite; }
@keyframes mayday-flash { from { box-shadow: 0 0 0 0 #ffeb3b; } to { box-shadow: 0 0 0 4px #ffeb3b; } }
/* Banners across the top of the screen while a mayday is going. */
.mayday-bar { position: sticky; top: 0; z-index: 40; display: grid; gap: 6px; padding: 6px 12px; background: rgb(30 36 43 / 0.92); }
.mayday-bar.in-admin { padding: 6px; border-radius: 8px; }
.mayday-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; border-radius: 6px; color: #fff; background: #b71c1c; font-weight: 600; }
.mayday-line strong { font-size: 1.05rem; letter-spacing: 0.02em; }
.mayday-line.unanswered { animation: mayday-blink 1s steps(2, jump-none) infinite; }
@keyframes mayday-blink { from { background: #e53935; } to { background: #7f0000; } }
.mayday-line.acked { background: #8c1b15; }
.mayday-line.pending { background: #f9a825; color: #1e242b; }
.mayday-line .spacer { flex: 1; }
.mayday-time { font-variant-numeric: tabular-nums; opacity: 0.9; }
.mayday-line .btn { background: #fff; color: #1e242b; border-color: #fff; }
.mayday-line .btn.gold { background: var(--gold); border-color: var(--gold); color: #1e242b; font-weight: 800; }
.lunar { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; font-weight: 600; }
.lunar span { background: rgb(255 255 255 / 0.15); border-radius: 4px; padding: 2px 8px; }
.lunar b { color: #ffeb3b; font-size: 1.1em; }
.modal.mayday-start { width: min(560px, 100%); }
.mayday-start textarea, .mayday-start select { width: 100%; }
@media (prefers-reduced-motion: reduce) { .mayday-line.unanswered, .mayday-btn.flash { animation: none; } }

/* ---- Viewer ----------------------------------------------------------- */
.hold-note {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #fff3d1;
  border: 1px solid var(--gold);
  color: var(--navy);
  font-weight: 700;
}
.stage {
  position: relative;
  background: #111;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: grid;
  place-items: center;
}
/* Pinned to the frame so a tall (portrait) photo shrinks to fit instead of
   spilling out the bottom. */
.stage img, .stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #111; }
.stage .placeholder { color: #ddd; text-align: center; padding: 24px; max-width: 46ch; line-height: 1.5; }
.stage .placeholder strong { display: block; font-size: 1.4rem; margin-bottom: 8px; color: #fff; }
.stage-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 46px;
  height: 64px;
  border: 0;
  border-radius: 6px;
  background: rgb(0 0 0 / 0.45);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}
.stage-nav:hover { background: var(--red); }
.stage-nav { z-index: 2; }
.stage-nav.prev { left: 8px; }
.stage-nav.next { right: 8px; }
/* Parking on the First Due photo: the tap layer over the photo and its controls. */
.park-layer { position: absolute; inset: 0; z-index: 1; cursor: crosshair; touch-action: none; }
/* Zoom on the First Due map (zoom.js) */
.stage.zoomable { touch-action: none; }
/* Zoomed in: the hand shows the map can be grabbed and moved (a tap still
   parks while parking). */
.stage.zoomed, .stage.zoomed .park-layer:not(.laying), .scene-stage.zoomed .scene-handles { cursor: grab; }
.stage.panning, .stage.panning .park-layer:not(.laying), .stage.panning .park-layer.laying, .scene-stage.panning, .scene-stage.panning .scene-handles { cursor: grabbing; }
.zoom-controls {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  display: flex; flex-direction: column; border-radius: 6px; overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.5); background: rgb(0 0 0 / 0.55);
}
.zoom-controls button {
  width: 38px; height: 38px; border: 0; background: transparent; color: #fff;
  font: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer;
}
.zoom-controls button + button { border-top: 1px solid rgb(255 255 255 / 0.3); }
.zoom-controls button:hover:not(:disabled) { background: var(--red); }
.zoom-controls button:disabled { opacity: 0.4; cursor: default; }
.park-layer.laying { cursor: copy; }
.park-panel {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #fff3d1;
  border: 1px solid var(--gold);
  color: var(--navy);
  display: grid;
  gap: 8px;
}
.park-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.park-hint { font-weight: 600; }
.park-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
/* Supply line length while laying in (park.js) */
.hose-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 10px; border-radius: 6px; background: #fff; border: 1px solid var(--gold); }
.hose-label { font-weight: 700; }
.hose-bar { flex: 1 1 120px; height: 10px; border-radius: 999px; background: #eee6cf; overflow: hidden; }
.hose-fill { display: block; height: 100%; width: 0; background: #f2c12e; transition: width 0.12s; }
.hose-feet { font-size: 1.1rem; font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.hose-left { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.hose-meter.full { border-color: var(--red); }
.hose-meter.full .hose-fill { background: var(--red); }
.hose-meter.full .hose-left { color: var(--red); font-weight: 700; }
.park-row .spacer { flex: 1; }
.park-turn { display: inline-flex; gap: 6px; align-items: center; }
.park-row input[type=range] { width: 120px; vertical-align: middle; }
.viewer-foot { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.9rem; }
.notes { margin: 0; white-space: pre-wrap; line-height: 1.5; padding: 10px 12px; background: #f7f8fa; border-left: 4px solid var(--red); border-radius: 4px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links .goto { width: auto; min-width: 160px; border-color: var(--red); color: var(--red); font-weight: 700; }
/* Under a unit's photo: water on the fire, remove a victim */
.scene-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scene-actions .btn { font-weight: 700; }
.scene-actions .action-water-on { background: #1565c0; border-color: #0d47a1; color: #fff; }
.scene-actions .action-water-off { background: #e3f2fd; border-color: #1565c0; color: #0d47a1; }
.scene-actions .action-vent-on { background: #eef6ee; border-color: #3c8a4a; color: #1f5a2a; }
.scene-actions .action-vent-off { background: #3c8a4a; border-color: #2d6b38; color: #fff; }
.scene-actions .action-victim { background: #fff3d1; border-color: #b8860b; color: #4a3500; }
.scene-actions .action-ladder { background: #eceff3; border-color: #5b6573; color: #1f2a37; }
.scene-actions .action-ladder-off { background: #fff; border-color: #5b6573; color: #1f2a37; font-weight: 600; }
/* 🪜 Placing a ladder (ladder-tool.js) */
.ladder-panel { background: #eef1f5; border-color: #5b6573; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 4px 4px 0; }
.seg .btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ladder-info { font-weight: 600; }
.ladder-guide summary { cursor: pointer; font-weight: 600; }
.ladder-guide ul { margin: 4px 0 0; padding-left: 20px; line-height: 1.5; }
.ladder-handle { background: #fff; }
.links .btn { border-color: var(--red); color: var(--red); }
.links .btn:hover { background: var(--red); color: #fff; }

/* Dispatch card: typed notes over the department logo */
.dispatch-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 5%, 48px);
  overflow: auto;
  background: #fff var(--dept-logo, none) center / min(78%, 560px) no-repeat;
}
.dispatch-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(255 255 255 / 0.8); /* fades the logo so the text stays readable */
}
.dispatch-text {
  position: relative;
  margin: 0;
  max-width: 34ch;
  color: #141414;
  font-size: clamp(1.1rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-wrap;
  text-align: left;
}

.dispatch-modal { place-items: center; }
.dispatch-sheet {
  width: min(1200px, 100%);
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: #fff;
  border-top: 6px solid var(--red);
}
.dispatch-sheet:fullscreen { width: 100%; height: 100%; border-radius: 0; grid-template-rows: auto 1fr; }
.dispatch-frame { position: relative; height: min(76vh, 760px); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.dispatch-sheet:fullscreen .dispatch-frame { height: auto; }
.dispatch-modal .dispatch-text { font-size: clamp(1.4rem, 3.2vw, 2.8rem); max-width: 38ch; }

/* ---- Scene effects ------------------------------------------------------ */
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tool-groups { display: grid; gap: 8px; }
.tool-group { border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; }
.tool-title { padding: 6px 10px; font-size: 0.8rem; font-weight: 700; color: var(--navy); cursor: pointer; user-select: none; }
.tool-group[open] > .tool-title { border-bottom: 1px solid var(--line); }
.tool-buttons { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
/* Night operations: the photo goes dark with a cool, moonlit cast and the
   victims dim with it; the fire canvas is untouched, so the fire glows. */
/* 3D photo effect: the WebGL copy of the photo replaces the <img>, which
   stays (hidden) to keep the layout. */
.depth-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.is-3d > img { visibility: hidden; }
.badge-3d { font-size: 0.78rem; font-weight: 700; color: var(--navy); background: #efe7cf; border-radius: 4px; padding: 2px 6px; }
.three-d { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; }
.preview-3d { max-height: 70vh; }
.night > .depth-canvas,
.night > img, .night > video { filter: saturate(0.35) sepia(0.35) hue-rotate(170deg) brightness(0.32) contrast(1.15); }
.night > .figure-layer { filter: brightness(0.5); }
.night > .furniture-layer { filter: saturate(0.35) sepia(0.35) hue-rotate(170deg) brightness(0.32) contrast(1.15); }
/* Thermal imaging camera view (thermal.js): the photo goes gray and dim,
   people glow, flames go white-hot, and the heat layer adds its colors. */
.tic > img, .tic > video, .tic > .depth-canvas { filter: grayscale(1) contrast(0.7) brightness(0.5) blur(0.4px) !important; }
.tic > .figure-layer { filter: grayscale(1) brightness(1.9) contrast(1.1) !important; }
.tic > .furniture-layer { filter: grayscale(1) contrast(0.7) brightness(0.45) blur(0.4px) !important; }
.tic > .particle-layer { filter: grayscale(1) brightness(2.2) contrast(1.2); }
.tic > .tic-layer { mix-blend-mode: screen; }
.tic { cursor: crosshair; }
.tic-toggle {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  padding: 5px 10px; border: 1px solid rgb(255 255 255 / 0.5); border-radius: 6px;
  background: rgb(0 0 0 / 0.55); color: #fff; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.tic-toggle:hover { background: rgb(0 0 0 / 0.75); }
.tic-toggle[aria-pressed="true"] { background: #f2a900; border-color: #f2a900; color: #1e242b; }
/* ☣🔭 Binoculars (viewer.js): the photo zoomed in, seen through two round lenses. */
.binocular-frame { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.binocular-frame svg { width: 100%; height: 100%; display: block; }
.binoculars .zoom-controls { z-index: 3; }

.scene-editor { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
@media (max-width: 900px) { .scene-editor { grid-template-columns: minmax(0, 1fr); } }
.scene-stage {
  /* Stays in view while you scroll down through the effect settings. */
  position: sticky;
  top: 8px;
  z-index: 2;
  height: min(62vh, 640px);
  min-height: 260px;
  background: #111;
  border-radius: 6px;
  overflow: hidden;
  touch-action: none;
  box-shadow: 0 0 0 8px #fff; /* hides settings sliding under it */
}
/* One column: a shorter photo leaves room for the settings below it. */
@media (max-width: 900px) { .scene-stage { height: 42vh; min-height: 200px; } }
.scene-stage img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.scene-handles { position: absolute; }
.scene-handle {
  position: absolute;
  translate: -50% -50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgb(0 0 0 / 0.55);
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.5);
}
.scene-handle.selected { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }
.scene-guide { position: absolute; translate: -50% -50%; height: 0; border-top: 3px dashed var(--gold); filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.8)); pointer-events: none; }
.scene-handle.hidden-effect { opacity: 0.45; border-style: dashed; }
/* 📏 Map scale ruler on the First Due map */
.map-ruler { position: absolute; height: 0; border-top: 3px solid #fff; transform-origin: 0 0; filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.9)); pointer-events: none; }
.map-ruler-label { position: absolute; left: 50%; top: -26px; translate: -50% 0; padding: 1px 8px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.ruler-end { background: #fff; color: var(--navy); font-weight: 800; }
.scene-side input[type='range'] { padding: 0; width: 100%; accent-color: var(--red); }
.quick-bar { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quick-row > strong { min-width: 78px; }
.swatch { border-width: 2px; }
.quick-row .fire-out { background: #1565c0; border-color: #0d47a1; color: #fff; font-weight: 700; }
/* 📈 The fire progression bar (admin.js showProgress): out → fully involved. */
.quick-row .spacer { flex: 1; }
.progress-row .progress-stage { min-width: 0; color: #b23a0e; }
.progress-bar { position: relative; padding: 2px 8px 22px; margin: 2px 0 0; }
.progress-bar input[type=range] { width: 100%; margin: 0; height: 26px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.progress-bar input[type=range]::-webkit-slider-runnable-track { height: 12px; border-radius: 6px; border: 1px solid #8a3a12;
  background: linear-gradient(to right, #8fa3b3 0%, #f6d77a 6%, #f5a623 35%, #e8590c 70%, #c0270f 88%, #6e0d0d 100%); }
.progress-bar input[type=range]::-moz-range-track { height: 12px; border-radius: 6px; border: 1px solid #8a3a12;
  background: linear-gradient(to right, #8fa3b3 0%, #f6d77a 6%, #f5a623 35%, #e8590c 70%, #c0270f 88%, #6e0d0d 100%); }
.progress-bar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid #b23a0e; box-shadow: 0 1px 4px rgb(0 0 0 / 0.35); }
.progress-bar input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #b23a0e; }
.progress-marks { position: absolute; left: 20px; right: 20px; bottom: 0; height: 20px; font-size: 0.7rem; color: var(--muted, #6b6b6b); }
.progress-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; padding-top: 6px; }
.progress-tick::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 5px; background: #8a7f72; }
.progress-tick.no-label { font-size: 0; }
.progress-tick:first-child { transform: none; }
.progress-tick:first-child::before { left: 0; }
.progress-tick:nth-last-child(2) { transform: translateX(-100%); }
.progress-tick:nth-last-child(2)::before { left: 100%; }
.progress-tick.end { display: none; }
.progress-hint { margin: 0 0 4px; font-size: 0.78rem; }
@media (max-width: 560px) { .progress-tick.signs { font-size: 0; } }
.swatch-white { background: #f4f4f1; }
.swatch-steam { background: #fff; border-style: dashed; }
.swatch-gray { background: #9a9a9a; color: #fff; }
.swatch-black { background: #222; color: #fff; }
.swatch-brown { background: #6b5034; color: #fff; }
.swatch-yellow { background: #b8a55e; color: #222; }
/* ☰ Sounds & alerts menu on the exercise screen */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: min(320px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto;
  display: grid; gap: 2px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
}
.menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.menu-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 2px 8px; }
.menu-group { display: grid; gap: 2px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--tile); outline: none; }
.menu-item:disabled { color: #9aa1a8; cursor: not-allowed; }
.menu-item.danger:not(:disabled) { color: var(--red); }
/* Exercise screen: clock, join link and the two menus on one row. */
.control-row { align-items: center; gap: 10px 14px; }
.control-row .join-hint { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.control-row .menus { display: flex; gap: 8px; margin-left: auto; }
.menu-note { padding: 6px 10px; color: var(--muted); font-size: 0.9rem; }
.menu-check { display: flex; gap: 8px; align-items: center; padding: 6px 10px; font-weight: 600; cursor: pointer; }
.slider-head { display: flex; justify-content: space-between; gap: 8px; }
.slider-value { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.effect-list { display: grid; gap: 4px; }
.effect-row { display: flex; align-items: center; gap: 6px; border-radius: 6px; }
.effect-row .name { flex: 1; text-align: left; border: 0; background: none; font: inherit; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: inherit; }
.effect-row.active .name, .effect-row .name:hover { background: var(--tile); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / 0.5); display: grid; place-items: start center; padding: 16px; overflow: auto; }
.modal { width: min(1280px, 100%); background: #fff; border-radius: 10px; padding: 16px; display: grid; gap: 10px; box-shadow: 0 10px 40px rgb(0 0 0 / 0.35); }

/* ---- Board ------------------------------------------------------------ */
.board { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.tile {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 92px;
  padding: 8px;
  border: 1px solid #c8ced6;
  border-radius: 6px;
  background: var(--tile);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.tile:hover { background: var(--tile-hover); }
.tile.current { background: var(--tile-current); border-color: var(--gold-dark); box-shadow: inset 0 0 0 1px var(--gold-dark); }
.tile.viewing { outline: 2px dashed var(--red); outline-offset: -3px; }
.tile.drop-target { background: #fff3d1; }
.tile:disabled { opacity: 0.45; cursor: not-allowed; }
.tile:disabled:hover { background: var(--tile); }
.tile-name { font-weight: 700; font-size: 0.88rem; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--chip);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  border: 0;
  font-family: inherit;
}
.chip.me { background: var(--chip-me); }
.chip.offline { opacity: 0.45; }
.chip.selected { outline: 3px solid var(--gold); }
button.chip { cursor: pointer; }

/* ---- Chat ------------------------------------------------------------- */
/* A panel heading that folds the panel away (common.js foldable). */
.fold { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fold h2 { margin: 0; }
.fold-caret { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--tile); color: var(--navy); transition: rotate 0.15s; }
.fold-caret::before { content: '▾'; font-size: 1.1rem; line-height: 1; }
.fold[aria-expanded="true"] .fold-caret { rotate: 180deg; }
.fold:hover .fold-caret { background: var(--tile-hover); }
.fold:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }
.fold-new { font-size: 0.8rem; font-weight: 700; color: #fff; background: var(--red); border-radius: 999px; padding: 2px 9px; }
.fold-body { display: grid; gap: 10px; }
.chat-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; }
@media (max-width: 520px) {
  .chat-form { grid-template-columns: minmax(0, 1fr) auto; }
  .chat-form select { grid-column: 1 / -1; }
}
.log {
  height: 340px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbfc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}
.log .line { margin: 0; overflow-wrap: anywhere; }
.log .t { color: var(--muted); }
.log .event { color: var(--muted); }
.log .from { font-weight: 700; }
.log .private { background: #fff3d1; }
.log .instructor .from { color: var(--red); }
.log .tone { color: var(--red-dark); font-weight: 700; }
.log .mayday { color: #fff; background: #b71c1c; border-radius: 3px; padding: 0 4px; }
.log .mayday .t { color: #ffd6d6; }
.log .action { color: #0b4f8a; font-weight: 700; background: #e6f1fb; border-radius: 3px; padding: 0 4px; }
.log .note { color: #5b3d00; background: #fff8e1; border-left: 3px solid #e0a800; padding: 0 4px; font-style: italic; }
.log .note .from { font-style: normal; }
.join-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(20 22 26 / 0.82);
}
.join-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: min(420px, 100%);
  padding: 28px 22px;
  border-radius: 12px;
  background: #fff;
  border-top: 6px solid var(--red);
  text-align: center;
}
.join-unit { font-size: 1.4rem; font-weight: 800; }
.join-btn { font-size: 1.15rem; min-height: 54px; padding: 10px 22px; }
.sound-bar {
  position: fixed;
  top: 0;
  left: 50%;
  translate: -50% 0;
  z-index: 50; /* above the mayday banner */
  padding: 8px 16px;
  border: 0;
  border-radius: 0 0 8px 8px;
  background: var(--gold);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  translate: -50% 0;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.chat-form.no-to { grid-template-columns: minmax(0, 1fr) auto auto; }
.chat-form.note-form { grid-template-columns: minmax(0, 1fr) auto; margin-top: 6px; }
.note-form input { background: #fffbea; border-color: #e0c060; }
@media (max-width: 520px) { .chat-form.no-to { grid-template-columns: minmax(0, 1fr) auto; } }
.recipients { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.to-chip {
  padding: 5px 12px;
  border: 1px solid #c8ced6;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.to-chip:hover { background: #f4f5f7; }
.to-chip[aria-pressed='true'] { background: var(--chip); border-color: var(--chip); color: #fff; }
.to-chip:disabled { opacity: 0.5; cursor: not-allowed; }
input:disabled, textarea:disabled, select:disabled { background: #f1f2f4; color: var(--muted); cursor: not-allowed; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.check-col { width: 34px; }
td > input[type='checkbox'], th > input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--red); }
.ended-note p { margin: 0 0 8px; }
.ended-note { margin: 0; padding: 10px 12px; border-radius: 6px; background: #fde2e2; color: var(--red-dark); font-weight: 600; }

/* ---- Instructor message popup ---------------------------------------- */
/* A bar across the top of the screen, so it doesn't hide the scene; the page
   behind stays visible and usable. */
.popup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 8px 12px;
  pointer-events: none;
  animation: popup-drop 0.2s ease-out;
}
.popup {
  pointer-events: auto;
  width: min(760px, 100%);
  max-height: 40vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  border-top: 6px solid var(--red);
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.35);
}
.popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px 4px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.popup-close {
  border: 0;
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.popup-body { display: grid; gap: 10px; padding: 0 14px 12px; }
.popup-msg + .popup-msg { border-top: 1px solid var(--line); padding-top: 12px; }
.popup-meta { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.popup-text { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.popup-timer { height: 5px; background: var(--tile); }
.popup-timer > div { height: 100%; background: var(--red); width: 100%; }
@keyframes popup-countdown { from { width: 100%; } to { width: 0; } }
@keyframes popup-drop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ---- Admin ------------------------------------------------------------ */
/* ---- How to (admin guide) ---- */
.howto { max-width: 980px; width: 100%; margin: 0 auto; padding: 20px 24px 28px; gap: 14px; line-height: 1.55; }
.howto h1 { font-size: 1.6rem; }
.howto p, .howto ul { margin: 0; }
.howto ul { padding-left: 1.3em; display: grid; gap: 4px; }
.howto-toc { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; border-bottom: 1px solid var(--line); }
.howto-toc button { border: 1px solid var(--line); background: var(--tile); color: var(--navy); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.howto-toc button:hover { background: var(--tile-hover); }
.howto-step { display: grid; gap: 10px; padding-top: 18px; scroll-margin-top: 12px; }
.howto-step h2 { font-size: 1.3rem; padding-bottom: 4px; border-bottom: 3px solid var(--gold); justify-self: start; }
.howto-fig { margin: 4px 0; }
.howto-fig img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.howto-fig figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.howto-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.howto-tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--tile); color: var(--navy); font-weight: 700; text-decoration: none; }
.howto-tabs a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.howto-back { max-width: 980px; margin: 16px auto 0; text-align: center; }
a.brand { color: inherit; text-decoration: none; }
/* ---- Instructor welcome (home) ---- */
.welcome { max-width: 1040px; width: 100%; margin: 0 auto; display: grid; gap: 16px; }
.welcome-hero { position: relative; overflow: hidden; padding: 26px 22px 20px; }
.welcome-hero::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: var(--stripe); }
.welcome-hero h1 { font-size: 1.7rem; }
.welcome-hero p { margin: 0; color: var(--muted); }
.welcome-open { display: grid; gap: 8px; }
.welcome-exercise { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tile-current); color: var(--ink); text-decoration: none; }
.welcome-exercise:hover { background: var(--tile-hover); }
.welcome-go { margin-left: auto; font-weight: 700; color: var(--red); }
.welcome-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.welcome-tile { display: flex; gap: 14px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; line-height: 1.45; }
.welcome-tile:first-child { border-left-color: var(--red); }
.welcome-tile:hover { background: #fffaf0; }
.welcome-icon { font-size: 1.8rem; line-height: 1; min-width: 2.2rem; text-align: center; }
.welcome-text { display: grid; gap: 4px; }
.welcome-text strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--navy); }
.welcome-text span { color: var(--muted); font-size: 0.93rem; }
.howto-tip { background: #fff8e1; border-left: 4px solid var(--gold); border-radius: 4px; padding: 8px 12px; }
@media (max-width: 600px) { .howto { padding: 14px; } }

.admin-main { padding: 16px; display: grid; gap: 16px; max-width: 1400px; margin: 0 auto; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
/* A unit's message to the Instructor, shown under the exercise buttons for 10 seconds. */
.incoming { display: grid; gap: 6px; margin-top: 10px; }
.incoming:empty { display: none; }
.incoming-note {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 14px;
  background: #fff3d1;
  border: 1px solid var(--gold);
  border-left-width: 6px;
  border-radius: 6px;
  color: var(--navy);
  cursor: pointer;
  animation: incoming-in 0.25s ease-out;
}
.incoming-note .from { font-weight: 700; white-space: nowrap; }
.incoming-note .when { color: var(--muted); font-family: ui-monospace, monospace; font-size: 0.85rem; }
.incoming-note .text { flex: 1; overflow-wrap: anywhere; }
@keyframes incoming-in { from { opacity: 0; translate: 0 -6px; } }
.form-row > label { flex: 1 1 180px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.code-big { font-size: 2rem; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.loc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.loc-list li { display: flex; align-items: center; gap: 4px; border-radius: 6px; }
.loc-list li button.name {
  flex: 1;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
}
.loc-list li.active button.name, .loc-list li button.name:hover { background: var(--tile); }
.loc-list li.active button.name { font-weight: 700; }
.count { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.media-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.media-card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; display: grid; }
.media-card .thumb { aspect-ratio: 4 / 3; background: #111; }
.media-card .thumb img, .media-card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card .meta { padding: 8px; display: grid; gap: 6px; }
.media-card .actions { display: flex; gap: 4px; }
.media-card .actions .spacer { flex: 1; }
.progress { height: 6px; border-radius: 3px; background: var(--tile); overflow: hidden; }
.progress > div { height: 100%; background: var(--gold-dark); width: 0; transition: width 0.15s; }
.link-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.units-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.units-list li { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #aab; flex: none; }
.dot.on { background: var(--ok); }
.on-scene-box { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ok); cursor: pointer; }
.on-scene-box:disabled { cursor: not-allowed; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 12px; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 6px; }

/* ---- Build from a listing ------------------------------------------------- */
.steps { margin: 0 0 10px; padding-left: 22px; line-height: 1.9; }
.bookmarklet {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: grab;
}
.import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.import-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  outline: 3px solid var(--gold);
  cursor: pointer;
}
.import-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.import-tile input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; }
.import-tile.off { outline-color: transparent; }
.import-tile.off img { opacity: 0.35; }
.import-tile.working { outline-color: var(--navy); }
.import-tile.failed { outline-color: var(--red); }
.import-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 6px;
  background: rgb(0 0 0 / 0.65);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}
.import-status:empty { display: none; }
.media-card .thumb { position: relative; }
.badge-imported {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---- Simulation status: Ready / In progress --------------------------------- */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.status-badge.ready { background: #dff3e4; color: #1d6b34; }
.status-badge.building { background: #fff3d1; color: #7a5a00; }
.sim-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 6px; }
.sim-status.ready { background: #f1faf3; border: 1px solid #b8e0c2; }
.sim-status.building { background: #fff8e6; border: 1px solid var(--gold); }

/* ---- Furniture (furniture.js and the 🛋 Furniture tools) ---- */
.furniture-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.furniture-pick { display: inline-flex; align-items: center; gap: 6px; }
.furniture-pick img { width: 34px; height: 26px; object-fit: contain; }
.modal.furniture-modal { width: min(640px, 100%); max-height: 92vh; overflow-y: auto; }
.furniture-list { display: grid; gap: 6px; max-height: 32vh; overflow-y: auto; }
/* On the 🛋 Furniture page: the whole library, in columns, bigger pictures */
.panel > .furniture-list { max-height: none; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.panel > .furniture-list .furniture-row { grid-template-columns: 110px 1fr auto; }
.panel > .furniture-list .furniture-row img { width: 110px; height: 80px; }
.furniture-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 6px; }
.furniture-row img { width: 64px; height: 48px; object-fit: contain; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 4px; }
/* Checkered = see-through, like photo editors show it. */
.cutout-preview { display: grid; place-items: center; min-height: 160px; max-height: 300px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 16px 16px; overflow: hidden; }
.cutout-preview canvas { max-width: 100%; max-height: 280px; object-fit: contain; }

/* Removing a victim: the countdown on the dispatch screen. */
.remove-count { position: relative; display: inline-block; margin: 16px 0 0; padding: 6px 22px; border: 3px solid var(--red); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); font: 800 clamp(2rem, 5.5vw, 3.2rem) / 1 var(--font-display, inherit); font-variant-numeric: tabular-nums; color: var(--red); }
.props-sub { margin: 10px 0 0; font-size: 0.95rem; }

/* ---- Admin → Counties (counties.js) ---- */
.county-body { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr) minmax(0, 260px); gap: 16px; align-items: start; }
@media (max-width: 960px) { .county-body { grid-template-columns: minmax(0, 1fr); } }
.county-form label { display: grid; gap: 4px; }
.county-picture { display: grid; gap: 6px; }
.county-site { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.county-site .county-preview { width: 300px; }
.county-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.county-preview-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--navy); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; border-bottom: 4px solid; border-image: var(--stripe) 4; }
.county-preview-bar .brand-mark { height: 30px; margin: 0; }
.county-preview-screen { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 12px; background: #fff center / 78% no-repeat; text-align: center; font-weight: 700; color: var(--navy); }
.county-preview-screen::before { content: ''; position: absolute; inset: 0; background: rgb(255 255 255 / 0.55); }
.county-preview-screen span { position: relative; }

/* ---- Logins (admin-login.js, people.js) --------------------------------- */
.county-pick { color: #fff; font-weight: 600; }
.county-pick select { max-width: 260px; padding: 4px 8px; border-radius: 4px; font: inherit; font-weight: 600; color: var(--ink); background: #fff; }
.linklike { justify-self: center; background: none; border: 0; padding: 4px; color: var(--red-dark); text-decoration: underline; cursor: pointer; font: inherit; }
.code-input { font-size: 1.5rem; letter-spacing: 0.15em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.45; }
.qr-box { display: flex; justify-content: center; }
.qr-box svg { border: 1px solid var(--line); border-radius: 6px; }
.mfa-key { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 1.05rem; letter-spacing: 0.06em; word-break: break-all; margin: 6px 0; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0; padding: 12px 16px; list-style: none;
  background: var(--tile); border-radius: 6px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 1.05rem; }
.temp-password { padding: 12px 14px; margin-bottom: 12px; border-left: 5px solid var(--gold); background: #fffaf0; border-radius: 6px; display: grid; gap: 8px; }
.temp-password p { margin: 0; }
.temp-password-text { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.05em; padding: 4px 10px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.panel.narrow { max-width: 640px; }
.muted-row td { color: var(--muted); }
.county-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px 16px; margin-bottom: 12px; }
.county-roles label { display: grid; gap: 4px; }
.edit-login { border-left: 5px solid var(--gold); }
.share-counties { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px 16px; }
.progress.warn > div { background: var(--red); }

/* ---- Looking at a shared simulation (shared-sim.js) ------------------ */
.preview-grid { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
@media (max-width: 860px) { .preview-grid { grid-template-columns: minmax(0, 1fr); } }
.preview-grid .loc-list { display: grid; gap: 4px; }
.preview-grid .loc-list button.name { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--tile); font: inherit; font-weight: 600; cursor: pointer; }
.preview-grid .loc-list button.name.active { background: var(--tile-current); border-color: var(--gold); }
.preview-stage { position: relative; top: auto; }
.preview-stage video { width: 100%; height: 100%; object-fit: contain; background: #111; }
.preview-empty { color: #fff; text-align: center; margin: 0; padding-top: 20%; }
.preview-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.preview-strip button { position: relative; flex: 0 0 auto; width: 120px; aspect-ratio: 4 / 3; padding: 0; border: 3px solid transparent; border-radius: 6px; overflow: hidden; background: #111; cursor: pointer; }
.preview-strip button.on { border-color: var(--gold); }
.preview-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-video { display: grid; place-items: center; height: 100%; font-size: 2rem; }
.preview-count { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; background: rgb(0 0 0 / 0.7); color: #fff; font-size: 0.75rem; font-weight: 600; }
.preview-dispatch { padding: 10px 12px; border-left: 4px solid var(--red); background: var(--tile); border-radius: 4px; white-space: pre-line; }
.preview-notes { white-space: pre-line; margin: 0; }
.hazmat-on { margin: 0; padding: 8px 10px; border-radius: 6px; background: #fff4d6; border: 1px solid #f2b705; font-weight: 600; }
.meter-toggle { top: 52px; }
.scene-stage.meter, .stage.meter { cursor: crosshair; }
.meter-log { position: absolute; top: 96px; right: 8px; z-index: 3; }
.sort-head { all: unset; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; }
.sort-head:hover, .sort-head:focus-visible { color: var(--red-dark); text-decoration: underline; }
.sort-mark { color: var(--muted); }
th.sorted .sort-mark { color: var(--red); }
/* ☣ Setting the hot and warm zones on the First Due map */
.zone-slider { flex-wrap: wrap; }
.zone-slider input[type=range] { width: 160px; max-width: 45vw; }
.zone-feet { min-width: 5ch; display: inline-block; }
.action-zones { background: #fff8d6; border-color: #e0b400; }
/* ☣ The unit's ERG lookup and PPE picker */
.modal.hazmat-modal { width: min(640px, 100%); max-height: 92vh; overflow-y: auto; }
.hazmat-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.1rem; }
.hazmat-modal input[type=search] { width: 100%; font-size: 1rem; padding: 8px 10px; }
.erg-results { display: grid; gap: 4px; }
.erg-hit { text-align: left; background: #fff; border: 1px solid var(--line, #ddd); border-radius: 6px; padding: 8px 10px; cursor: pointer; font: inherit; }
.erg-hit:hover, .erg-hit:focus-visible { border-color: var(--red); background: #fff6f5; }
.erg-page { display: grid; gap: 8px; }
.erg-page:empty { display: none; }
.erg-title { display: flex; gap: 12px; align-items: center; background: #fff3e0; border: 2px solid #f57c00; border-radius: 8px; padding: 10px; }
.erg-title h3 { margin: 2px 0; font-size: 1.05rem; }
.erg-title p { margin: 0; }
.erg-guide { display: inline-block; background: #f57c00; color: #fff; font-weight: 800; padding: 1px 8px; border-radius: 4px; letter-spacing: 0.05em; }
.erg-placard { width: 84px; height: 84px; flex: none; }
.erg-section h4 { margin: 0 0 2px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--red-dark); }
.erg-section p { margin: 0; }
.ppe-list { display: grid; gap: 6px; }
.ppe-choice { display: grid; gap: 2px; text-align: left; background: #fff; border: 2px solid var(--line, #ddd); border-radius: 8px; padding: 10px 12px; cursor: pointer; font: inherit; }
.ppe-choice span { color: var(--muted); font-size: 0.92rem; }
.ppe-choice.current { border-color: var(--red); background: #fff6f5; }
.ppe-choice:hover, .ppe-choice:focus-visible { border-color: var(--red-dark); }
.chip .ppe-tag { font-size: 0.75em; opacity: 0.85; }
.scene-actions .action-erg { background: #fff3e0; border-color: #f57c00; color: #5d2c00; }
.scene-actions .action-ppe { background: #fff; border-color: #f57c00; color: #5d2c00; }
.scene-actions .action-decon, .scene-actions .action-decon-off { background: #e3f2fd; border-color: #1565c0; color: #0d3c78; }
.scene-actions .action-decon-through { background: #1565c0; border-color: #0d47a1; color: #fff; }
.meter-mute { position: absolute; top: 96px; right: 136px; z-index: 3; min-width: 36px; }
/* ☣ Hazmat control on a live exercise: wind and meters */
.hazmat-ctl h3 { margin: 0 0 4px; font-size: 1.05rem; }
.wind-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.wind-grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; }
.wind-grid .wind-dir { width: 40px; height: 40px; padding: 0; font-size: 1.2rem; }
.wind-grid .wind-dir[aria-pressed="true"] { background: var(--red); border-color: var(--red-dark); color: #fff; }
.wind-mid { display: grid; place-items: center; font-size: 1.3rem; }
.meter-overrides { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.meter-overrides li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scene-actions .action-door { background: #fff3e0; border-color: #8d6e63; color: #3e2723; }
/* 🔬 Effects lab (lab.html) */
.lab-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.lab-panel { display: grid; gap: 8px; align-content: start; }
.lab-stage { cursor: crosshair; touch-action: manipulation; }
.lab-fps { font: 600 0.85rem ui-monospace, Consolas, monospace; color: var(--muted); }
.lab-gl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.stage video.lab-clip { position: absolute; inset: auto; height: auto; pointer-events: none; z-index: 2; max-width: none; object-fit: fill; background: transparent; }
.lab-noclip { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; background: rgba(20, 24, 28, 0.8); color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 0.9rem; }
.lab-extra { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lab-fields { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 10px; }
.lab-fields label { display: grid; gap: 2px; }
.lab-fields label.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lab-fields .lab-presets { grid-column: 1 / -1; }

/* 🔥🚗☣️ The type boxes at the top of a scenario's page (admin.js typeBoxes). */
.type-boxes { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0 0 12px; background: #fbfaf7; }
.type-boxes legend { font-size: 0.85rem; font-weight: 700; color: var(--navy); padding: 0 4px; }
.type-box { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer; }
.type-box:has(input:checked) { border-color: var(--navy); background: #eef3fb; }
.type-lock { font-weight: 400; font-size: 0.75rem; color: var(--muted, #6b6b6b); }
.type-lock:empty { display: none; }
/* The photo editor's line naming the sections hidden because their type isn't ticked. */
.tool-hidden-note { margin: 4px 2px 0; font-size: 0.8rem; }
/* 🔥🔊 Mute a relief valve's roar (unit screen, viewer.js). */
.jet-mute { position: absolute; left: 8px; bottom: 8px; z-index: 3; background: rgb(0 0 0 / 0.55); color: #fff; border-color: rgb(255 255 255 / 0.35); }
.jet-mute[aria-pressed="true"] { opacity: 0.75; }
/* 🛋↩ A piece's front and back side by side in the furniture library. */
.furniture-thumbs { display: flex; gap: 2px; }
.furniture-thumbs.two img { width: 50% !important; }
.furniture-thumbs .furniture-back { background: #eef3fb; border-radius: 4px; }
.furniture-back-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.furniture-back-form:empty { display: none; }
.furniture-back-form { flex-basis: 100%; }
/* ☣🔥 Tanks heating toward a BLEVE (hazmat-control.js). */
.tank-row { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; gap: 6px; }
.tank-row.heating { border-color: #e0a100; }
.tank-row.failed { border-color: var(--red); background: #fff3f2; }
.tank-bar { height: 10px; border-radius: 5px; background: #ece8df; overflow: hidden; }
.tank-bar > div { height: 100%; background: linear-gradient(90deg, #f2c94c, #e67e22 60%, #c0392b); }
/* 🗑 The "are you sure?" box before deleting (common.js confirmDelete). */
.modal.confirm-delete { width: min(560px, 100%); margin-top: min(10vh, 60px); border-top: 6px solid var(--red); max-height: calc(100vh - 32px); }
.modal.confirm-delete li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal.confirm-delete h2 { margin: 0; color: var(--red); }
.modal.confirm-delete ul { margin: 0; padding-left: 20px; }
.modal.confirm-delete input { font-size: 1.1rem; letter-spacing: 0.08em; }
/* 🗑 The Trash on the Owner page (people.js). */
.trash-left { white-space: nowrap; }
.modal.confirm-delete { box-sizing: border-box; overflow: hidden; }
.modal.confirm-delete > * { min-width: 0; max-width: 100%; }
.modal.confirm-delete input { box-sizing: border-box; width: 100%; }
