/* style.css — distributed-mode LAYOUT + components.
   Shared skin (accent/theme tokens + the .toggle segmented control) lives in
   css/design-system.css, linked BEFORE this file in index.html. */

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #0a0e14; color: #cdd6e0;
  font-family: -apple-system, system-ui, sans-serif; font-size: 14px;
}

#app { display: flex; height: 100vh; }

/* --- Left: the plotter / 3D pane --- */
#stage { flex: 1; position: relative; min-width: 0; }
#pane2d, #pane3d { position: absolute; inset: 0; }
.hidden { display: none !important; }
/* Mode-exclusive #viewbar controls (data-mode) hidden when not the active mode. */
.vb-mode-off { display: none !important; }
#plot { width: 100%; height: 100%; display: block; }
#scene3d { width: 100%; height: 100%; }

/* Floating "back to 2D" button in the 3D pane */
#back2d {
  position: absolute; top: 16px; left: 16px; z-index: 10;
}
#pane3d .hint {
  position: absolute; bottom: 16px; left: 16px; color: #7c8696;
  background: rgba(15,20,30,0.78); padding: 8px 12px; border-radius: 8px;
}

/* Fullscreen toggle now lives IN the viewbar (it's a view function) as a
   .vb-icon button. app.js toggles .on while actually in fullscreen — light it
   like an active toggle so the state reads at a glance (icon stays ⛶). */
.viewbar .vb-fs button.on {
  color: var(--acc-on); border-color: var(--acc);
  background: var(--acc-soft, rgba(90,160,255,0.16));
}

/* SPL color legend in the 3D pane (the 2D view draws its own on-canvas).
   Bottom-LEFT, stacked just above the always-on orbit hint (which stays pinned
   to the corner) — keeps the legend clear of the bottom-right feedback pill. */
.legend3d {
  position: absolute; bottom: 60px; left: 16px; width: 170px;
  background: rgba(15,20,30,0.85); padding: 8px 12px 10px; border-radius: 8px;
  font-size: 10px; color: #9aa5b5;
}
.legend3d-title { margin-bottom: 5px; }
.legend3d-bar {
  height: 10px; border-radius: 3px;
  /* Same stops as spl.js heatColor — keep these in sync. */
  background: linear-gradient(to right, #13243f, #2563eb 25%, #19b787 50%, #ffd43b 75%, #ff5a5a);
}
.legend3d-scale { display: flex; justify-content: space-between; margin-top: 3px; }
/* Re-fit glyph: barely-there by default, glows amber when the held color scale
   has drifted from the design's real peak (.stale toggled by app.js). Click
   re-fits. Mirrors the 2D canvas legend glyph (plotter.js drawLegend). */
.legend3d-refit {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13px; line-height: 1; color: rgba(154,165,181,0.35);
  transition: color .2s, text-shadow .2s;
}
.legend3d-refit:hover { color: #9aa5b5; }
.legend3d-refit.stale { color: #f5a623; text-shadow: 0 0 8px #f5a623; }

/* --- Left: control panel --- */
#panel {
  width: 312px; flex-shrink: 0; padding: 16px 16px 18px; overflow-y: auto;
  background: rgba(23,26,33,0.97); border-right: 1px solid rgba(90,160,140,0.13);
  /* Column layout lets the settings footer pin to the bottom (margin-top:auto)
     while everything above scrolls normally. */
  display: flex; flex-direction: column;
}
#panel > * { flex-shrink: 0; }  /* scroll, don't squish, when content overflows */

/* Settings footer (gear + accent-theme picker) is SHARED chrome — moved to
   css/design-system.css. #panel is a flex column so the footer pins bottom. */

/* ── v0.40 menu redesign — structural pieces ─────────────────────────────────
   What shipped of the redesign: the project switcher collapses to a thin bar
   while you work (.pjsw below). The proposed Room/Speakers/Info tabs and the
   inspector-row layout did NOT ship — the .menu-section accordion + .group/.row/
   .field layout won; their dead styles were swept (session 79). */

/* collapsible project switcher — thin bar when collapsed, drawer when open */
.pjsw { border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge);
        background: #13151a; margin: 4px -16px 0; }
.pjsw-bar {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 16px;
  background: transparent; border: none; cursor: pointer; color: #cdd6e0; text-align: left;
}
.pjsw-bar:hover { background: #171a20; }
/* Muted "Project:" / "Zone:" prefix before the active name. */
.pjsw-bar .pjsw-label { font-size: 12.5px; font-weight: 500; color: #828893; }

/* Accent theme swatches (.theme-row/.theme-swatches/.theme-sw) are SHARED chrome
   — moved to css/design-system.css. The heatmap-palette swatches below are
   distributed-only (PA renders its own legend), so they stay here. */
/* Heatmap palette swatches — wider rounded-rect so the gradient reads (vs the
   round accent dots above). Each previews its palette as a linear-gradient. */
.heat-sw { width: 34px; height: 16px; border-radius: 4px; cursor: pointer;
           border: 2px solid transparent; padding: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.4); }
.heat-sw:hover { transform: scale(1.08); }
.heat-sw.active { border-color: #e7edf4; }
.pjsw-bar .pjsw-name { font-size: 12.5px; font-weight: 600; color: #dfe3e8;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.pjsw-bar .pjsw-chev { margin-left: auto; color: #828893; font-size: 11px; transition: transform 0.15s; }
.pjsw.open .pjsw-bar .pjsw-chev { transform: rotate(180deg); }
.pjsw-body { display: none; padding: 2px 16px 12px; }
.pjsw.open .pjsw-body { display: block; }
/* Zone picker is STATIC (no collapse) — the zone tabs always show; the bar is just
   a label (session 81). Scoped to #zoneSwitcher so the Floor switcher still collapses. */
#zoneSwitcher .pjsw-body { display: block; }
#zoneSwitcher .pjsw-bar { cursor: default; }
#zoneSwitcher .pjsw-bar:hover { background: transparent; }
#panel h1 { font-size: 17px; margin: 0 0 2px; color: var(--acc-on); }
#panel .sub { color: #7c8696; font-size: 12px; margin-bottom: 18px; }

/* Logo badge + gradient wordmark + status pill are SHARED chrome — moved to
   css/design-system.css (themeable). The distributed-only ! / i header buttons
   stay below. */
/* "!" beta-disclaimer button — same shape as the ⓘ info button. Muted slate so
   it sits quietly in the header (was hot amber, which shouted in a calm spot —
   v0.25.0 calm pass). Still a click target for the beta disclaimer. */
.beta-info {
  width: 15px; height: 15px; border-radius: 50%;
  background: #14171d; border: 1px solid var(--edge); color: #7c8696;
  font-size: 10px; font-weight: 700; cursor: pointer; line-height: 1;
  flex-shrink: 0; padding: 0; display: flex; align-items: center; justify-content: center;
}
.beta-info:hover { border-color: var(--edge-hi); color: #9aa5b5; }

/* .panel-head + the logo particle animations are SHARED chrome (design-system.css).
   The ⓘ info button is distributed-only and stays here. */
.info-btn {
  width: 20px; height: 20px; border-radius: 50%;
  background: #14171d; border: 1px solid var(--edge); color: var(--acc-on);
  font-size: 12px; font-style: italic; font-family: Georgia, serif;
  cursor: pointer; line-height: 1; flex-shrink: 0;
}
.info-btn:hover { border-color: var(--edge-hi); background: #222c40; }

/* --- Info modal --- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 6, 10, 0.65);
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  position: relative; width: min(560px, calc(100vw - 32px));
  max-height: 84vh; overflow-y: auto;
  background: #11161f; border: 1px solid var(--edge); border-radius: 12px;
  padding: 24px 28px; line-height: 1.55;
}
.modal-card h2 { margin: 0 0 6px; font-size: 16px; color: var(--acc-on); }
.modal-card h3 {
  margin: 18px 0 4px; font-size: 11px; color: #7c8696;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.modal-card p { margin: 4px 0; color: #cdd6e0; font-size: 12.5px; }
/* Intro line under the modal title — quieter, sets up the expanders below. */
.modal-card .modal-sub { color: #7c8696; font-size: 11.5px; margin: 0 0 8px; }
.modal-card code {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  color: var(--acc-on); background: #14171d; padding: 1px 4px; border-radius: 4px;
}
.modal-card ul { margin: 4px 0; padding-left: 18px; color: #cdd6e0; font-size: 12.5px; }
.modal-card li { margin: 2px 0; }
.modal-card .formula {
  background: #14171d; border: 1px solid var(--edge); border-radius: 6px;
  padding: 8px 10px; margin: 8px 0; font-family: ui-monospace, Menlo, monospace;
  font-size: 12px; color: var(--acc-on); text-align: center;
}
/* "Why & sources" expanders inside the How-it-works modal. Same native <details>
   chevron idiom as the menu sections, but small + muted — the simple paragraph is
   the headline, the citation is a secondary layer you open only if you want it. */
.modal-card details.why { margin: 2px 0 6px; }
.modal-card details.why > summary {
  cursor: pointer; user-select: none; list-style: none;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--acc); padding: 2px 0;
}
.modal-card details.why > summary:hover { color: var(--acc-on); }
.modal-card details.why > summary::-webkit-details-marker { display: none; }
.modal-card details.why > summary::before {
  content: '▸'; font-size: 10px; transition: transform 0.15s;
}
.modal-card details.why[open] > summary::before { transform: rotate(90deg); }
.modal-card details.why .why-body {
  border-left: 2px solid var(--edge); padding: 2px 0 4px 10px; margin: 4px 0 2px;
}
.modal-card details.why .why-body p { font-size: 11.5px; color: #aeb9c7; }
/* Source line — even quieter than the explanation; it's the citation footer. */
.modal-card details.why .src { font-size: 11px; color: #7c8696; margin-top: 5px; }

.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 26px; height: 26px; border-radius: 6px;
  background: transparent; border: none; color: #7c8696;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: #cdd6e0; background: #14171d; }

.group { margin-bottom: 18px; }
.group > label.title {
  display: block; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 11px; color: #7c8696; margin-bottom: 8px;
}

.row { display: flex; gap: 8px; margin-bottom: 8px; }
.field { flex: 1; }
.field label { display: block; font-size: 12px; color: #9aa5b5; margin-bottom: 3px; }
/* Inline "suggest" affordance in a field label — text-link styling, no button chrome. */
.link-btn {
  background: none; border: none; padding: 0; margin-left: 6px;
  color: var(--acc); font-size: 11px; cursor: pointer; text-decoration: underline;
}
.link-btn:hover { color: var(--acc-on); }
.field input, .field select, #subModel {
  width: 100%; padding: 6px 8px; border-radius: 6px;
  background: #14171d; border: 1px solid var(--edge); color: #cdd6e0; font-size: 14px;
}

/* The .toggle recessed segmented control now lives in css/design-system.css
   (shared with the PA workspace). The viewbar-local override stays below. */

/* Persistent view toolbar — floats over the top-left of the plot stage
   (#stage is position:relative; the panes are absolute/inset:0, so this sits
   on top of them). The menu is design-only now; this is "what am I looking at". */
.viewbar {
  position: absolute; top: 10px; left: 10px; z-index: 20;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  max-width: calc(100% - 20px);
  padding: 6px; border-radius: 10px;
  background: rgba(16, 22, 33, 0.86); border: 1px solid var(--edge);
  backdrop-filter: blur(6px);
}
/* In the bar, buttons size to their label (the menu's .toggle stretches them
   with flex:1 — we don't want that floating over a canvas). */
.viewbar .vb-group { flex: 0 0 auto; }
.viewbar .toggle button { flex: 0 0 auto; }
/* Compact icon-only toggles (SPL heatmap / coverage discs) — the glyph carries
   the meaning, the data-tip tooltip spells it out on hover. Keeps the bar to
   one line. */
.viewbar .vb-icon { padding: 5px 9px; font-size: 15px; line-height: 1; }

/* Custom hover tooltip for the viewbar — native `title` renders tiny and slow;
   this is a touch larger and readable. Used on the compact icon/short-label
   buttons via data-tip. */
.viewbar [data-tip] { position: relative; }
.viewbar [data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 7px); left: 0;
  white-space: nowrap; z-index: 60;
  padding: 5px 9px; border-radius: 7px;
  background: rgba(10, 14, 20, 0.97); border: 1px solid var(--edge-hi);
  color: #dfe7f2; font-size: 12.5px; line-height: 1.3;
  opacity: 0; transform: translateY(-2px); pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.viewbar [data-tip]:hover::after { opacity: 1; transform: translateY(0); }
/* A toggle grouped with the inline control it owns (SPL + opacity, 2D/3D + field
   style) — so related controls read as one unit in the bar. */
.vb-cluster { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
/* Inline heatmap-opacity slider — small, sits next to the Heatmap button. */
.vb-opacity { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.vb-opacity input[type="range"] { width: 60px; accent-color: var(--acc); cursor: pointer; }
.vb-opacity span {
  font-size: 11px; color: #9aa5b5; min-width: 30px;
  font-variant-numeric: tabular-nums;
}
/* dB-band tolerance toggle — small glass pill, flips ±3 ⇄ ±1 dB. Same language
   as the scenario <select> so it reads as part of the bar. */
.vb-tol {
  padding: 5px 7px; border-radius: 6px; flex: 0 0 auto; white-space: nowrap;
  background: #14171d; border: 1px solid var(--edge); color: #d6deea;
  font-size: 11px; line-height: 1; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.vb-tol:hover { border-color: var(--edge-hi); }
/* Scenario switcher dropdown — same glass-pill language as the bar's buttons,
   but a <select> because a room can hold many snapshots (segments don't scale). */
.vb-snap select {
  padding: 6px 9px; border-radius: 6px;
  background: #14171d; border: 1px solid var(--edge); color: #d6deea;
  font-size: 12px; cursor: pointer; line-height: 1; max-width: 160px;
}
.vb-snap select:hover { border-color: var(--edge-hi); }
/* Display-tuning popover dropping out of the gear. */
/* Snapshot list — a column of saved layout scenarios for the room. */
.snapshot-list { display: flex; flex-direction: column; gap: 4px; }
.snapshot-list:empty { display: none; }
.snapshot-row {
  display: flex; align-items: center; gap: 4px;
  border-radius: 6px; border: 1px solid var(--edge); background: #14171d;
  overflow: hidden;
}
.snapshot-row.active { border-color: var(--acc-bd); background: var(--acc-weak); }
.snapshot-apply {
  flex: 1; min-width: 0; text-align: left; padding: 6px 8px;
  background: none; border: none; color: #9aa5b5; font-size: 12px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snapshot-row.active .snapshot-apply { color: #fff; }
.snapshot-apply:hover { color: #cdd6e3; }
.snapshot-del {
  padding: 6px 8px; background: none; border: none; color: #5a6472;
  font-size: 13px; line-height: 1; cursor: pointer;
}
.snapshot-del:hover { color: #e06464; }

.readout {
  background: #11161f; border: 1px solid var(--edge); border-radius: 6px;
  padding: 8px 10px; font-size: 13px; color: #9aa5b5; margin-bottom: 10px;
}

/* Action buttons */
.btn {
  width: 100%; padding: 9px; border-radius: 7px; border: none;
  font-size: 13px; cursor: pointer; margin-bottom: 8px;
}
/* Primary action (Import Floor Plan) — flat teal-tinted toolbar button, not a
   glowy fill (matches the mockup's .act). */
.btn.primary { background: var(--acc-fill2); color: var(--acc-on); border: 1px solid var(--edge-hi); }
.btn.primary:hover { background: #1a2a25; border-color: var(--edge-hi); }
.btn.ghost { background: #14171d; color: #cdd6e0; border: 1px solid var(--edge); }
.btn.ghost:hover { border-color: var(--edge-hi); }
.btn.ghost.active { background: var(--acc-weak); border-color: var(--acc-bd); color: var(--acc-on); }

/* ── Project picker ─────────────────────────────────────────────────────── */
.project-select {
  flex: 1; min-width: 0;
  padding: 5px 6px; border-radius: 6px;
  background: #14171d; border: 1px solid var(--edge); color: #cdd6e0;
  font-size: 13px;
}

.folder-status {
  flex: 1; font-size: 11px; line-height: 1.4; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.folder-status.active     { color: var(--acc); }
.folder-status.inactive   { color: #6b7686; }

/* ── Room tabs ───────────────────────────────────────────────────────────── */
.room-row {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 14px;
}
.room-tabs {
  display: flex; gap: 4px; flex: 1;
  overflow-x: auto; min-width: 0;
  scrollbar-width: none; /* Firefox */
}
.room-tabs::-webkit-scrollbar { display: none; }

.room-tab {
  display: flex; align-items: center; gap: 3px;
  padding: 5px 8px; border-radius: 5px;
  background: #14171d; border: 1px solid var(--edge); color: #9aa5b5;
  font-size: 12px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.room-tab.active  { background: var(--acc-weak); border-color: var(--acc-bd); color: var(--acc-on); }
.room-tab:hover:not(.active) { border-color: var(--edge-hi); }

.room-tab-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }

.room-tab-x {
  background: none; border: none; color: #4a5568;
  font-size: 13px; cursor: pointer; padding: 0; line-height: 1;
}
.room-tab-x:hover { color: #9aa5b5; }

/* ── Icon buttons (project + / ✎ / × and new-room +) ───────────────────── */
.icon-btn {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 5px; border: 1px solid var(--edge);
  background: #14171d; color: #9aa5b5;
  font-size: 13px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover:not(:disabled) { border-color: var(--edge-hi); color: #cdd6e0; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* Utility actions — lighter than primary controls: smaller, muted text. */
.io-btn { flex: 1; font-size: 11px; padding: 6px 4px; margin-bottom: 0; color: #9aa5b5; }
.io-btn:hover { color: #cdd6e0; }
.io-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Collapsible menu sections (native <details>) ────────────────────────── */
/* Card sections (chosen look, session 62). Each collapsible section is a raised
   card, so its header clearly OWNS the body inside it — fixes the old blue
   underlined header that read like the footer of the drawer above it. Recolored
   from blue to the teal skin. Applies to Speakers + Project Details. */
.menu-section {
  background: #13151a;
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 12px;
}
.menu-section summary {
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 11px; font-weight: 700; color: var(--acc-on);
  padding: 0;
}
/* Only gap the header from its body when the card is open — a collapsed card
   stays a tidy single bar. */
.menu-section[open] summary { padding-bottom: 9px; }
.menu-section summary:hover { color: var(--acc); }
/* Replace the default marker with a rotating chevron */
.menu-section summary { list-style: none; }
.menu-section summary::-webkit-details-marker { display: none; }
.menu-section summary::before {
  content: '▸'; color: var(--acc); font-size: 11px;
  transition: transform 0.15s;
}
.menu-section[open] summary::before { transform: rotate(90deg); }

/* ── Launch welcome card (progressive disclosure) ────────────────────────── */
.welcome {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: #0a0e14;
}
.welcome-card { text-align: center; }
.welcome-title { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 10px; }
.welcome-sub { color: #7c8696; font-size: 13px; }

/* ── Launch cards — the workspace chooser (site entry) ────────────────────────
   Full-app overlay (above the panel + stage) shown first; pick a mode to enter
   its workspace. Themeable via the shared accent tokens. */
.launch {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #0a0e14;
}
.launch-inner { width: min(900px, 94vw); text-align: center; }
.launch-title { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
.launch-tagline { color: #7c8696; font-size: 14px; margin: 10px 0 30px; }
.launch-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 760px) { .launch-cards { grid-template-columns: 1fr; } }
/* Each card is its own raised tile. The active two are a <button>/<a>; the
   coming-soon one is an inert <div>. */
.launch-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: 9px; text-align: left; padding: 22px 18px 20px;
  background: #13151a; border: 1px solid var(--edge); border-radius: 12px;
  color: #cdd6e0; font-family: inherit; cursor: pointer; text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.launch-card:not(.is-soon):hover {
  border-color: var(--acc-bd); background: #161a22; transform: translateY(-2px);
}
.lc-icon { color: var(--acc); line-height: 0; }
.lc-icon svg { width: 36px; height: 36px; }
.lc-title { font-size: 16px; font-weight: 700; color: #e7edf4; }
.lc-desc { font-size: 12px; color: #828893; line-height: 1.45; }
/* Status tag, top-right (Beta on PA / Coming soon on Immersive). */
.lc-tag {
  position: absolute; top: 12px; right: 12px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: #0a0e14; background: var(--acc); border-radius: 3px; padding: 2px 6px;
}
.lc-tag.soon { color: #8a93a3; background: #20242c; border: 1px solid var(--edge); }
/* Immersive — present but inert, dimmed so it reads as a roadmap teaser. */
.launch-card.is-soon { opacity: 0.5; cursor: default; }
.launch-card.is-soon .lc-icon { color: #5a6472; }
/* Nested "From floor plan" action inside a mode card (s75). Sits at the bottom;
   the card body still picks a blank room. margin-top:auto pins it to the base so
   uneven card heights stay aligned. */
.lc-plan {
  margin-top: auto; align-self: stretch;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 10px; border-radius: 8px; font-family: inherit; font-size: 11.5px;
  font-weight: 600; cursor: pointer; color: #aeb7c4;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--edge); transition: border-color 0.15s, background 0.15s, color 0.15s;
}

/* Inline line-art glyph for action buttons (replaces the old emoji). Inherits the
   button's currentColor, so it tracks hover/active states for free. flex-shrink:0
   keeps it crisp; it never squashes when the label wraps. */
.btn-ico { width: 15px; height: 15px; flex: 0 0 auto; }
.lc-plan:hover { border-color: var(--acc-bd); color: var(--acc); background: #161a22; }

/* ── Project gate (the front door: open a project / new / import) ────────── */
/* The gate gets an animated waveform backdrop (gateScene.js) painted on
   #gateBg; the card floats over it on a frosted panel for legibility. */
.gate-launch { background: #070a10; overflow: hidden; }
.gate-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0;
}
/* Vignette: darken the edges so the card + corners stay readable over the
   bright center of the field. */
.gate-launch::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 46%,
              rgba(7,10,16,0) 38%, rgba(7,10,16,0.55) 78%, rgba(7,10,16,0.9) 100%);
}
.gate-inner {
  width: min(440px, 94vw);
  position: relative; z-index: 2;          /* above the canvas + vignette */
  padding: 30px 30px 28px;
  background: rgba(15, 18, 26, 0.72);
  border: 1px solid var(--edge);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 24px 70px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(90,159,255,0.04);
}
/* Gate wordmark — the menu-header treatment, a touch bigger with a soft accent
   glow; BETA badge + version centered below it (reuses .logo-sub/.beta-badge). */
.gate-inner .launch-title {
  font-size: 40px;
  filter: drop-shadow(0 2px 16px color-mix(in srgb, var(--acc) 38%, transparent));
}
.gate-sub { justify-content: center; margin: 11px 0 0; }
.gate-sub .version-tag { font-size: 12px; }
.gate-inner .launch-tagline { margin-top: 12px; }
.gate { display: flex; flex-direction: column; gap: 10px; text-align: left; }

/* Open-a-project list — info cards, one per project. */
.gate-open-label { font-size: 12px; font-weight: 600; color: #7c8696; margin-bottom: -3px; }
.gate-projects {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 280px; overflow-y: auto; margin: 0 -4px; padding: 1px 4px;
}
.gate-project {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; background: #13151a; border: 1px solid var(--edge);
  border-radius: 10px; color: #cdd6e0; font-family: inherit; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.gate-project:hover { border-color: var(--acc-bd); background: #161a22; transform: translateY(-1px); }
.gp-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.gp-name {
  font-size: 15px; font-weight: 600; color: #e7edf4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-meta { font-size: 11px; color: #7c8696; font-variant-numeric: tabular-nums; }
.gp-badges { display: flex; gap: 4px; flex-shrink: 0; }
/* Mode pill — subtle accent tint by default; PA / Immersive get their own hue. */
.gp-badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent);
}
.gp-badge--pa { color: #d59a4e; background: rgba(213,154,78,0.14); border-color: rgba(213,154,78,0.28); }
.gp-badge--immersive { color: #a98ce0; background: rgba(169,140,224,0.14); border-color: rgba(169,140,224,0.28); }
.gp-badge--empty { color: #8a93a3; background: #20242c; border-color: var(--edge); }
/* Inline manage controls (rename / delete) — always present on the card, muted
   at rest, brightening on their own hover. */
.gp-actions { display: flex; gap: 2px; flex-shrink: 0; }
.gp-act {
  width: 24px; height: 24px; border-radius: 6px; background: none; border: none;
  color: #5a6472; font-family: inherit; font-size: 13px; line-height: 1; cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.gp-act:hover { color: var(--acc); background: rgba(90,159,255,0.1); }
.gp-act--del:hover { color: #e06464; background: #2a1818; }

.gate-divider { height: 1px; background: var(--edge); margin: 6px 0; }
.gate-actions { display: flex; flex-direction: column; gap: 8px; }
.gate-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; background: #13151a; border: 1px solid var(--edge);
  border-radius: 10px; color: #cdd6e0; font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.gate-btn:hover { border-color: var(--acc-bd); background: #161a22; }
.gate-btn.primary { color: #0a0e14; background: var(--acc); border-color: var(--acc); }
.gate-btn.primary:hover { filter: brightness(1.08); background: var(--acc); }

/* Sample Rooms (s77) — bundled demo plans, expandable inside the add-zone
   Distributed card under "From sample room…". The toggle reuses .lc-plan; this is
   the revealed list + its items. align-self:stretch so they span the card width. */
.lc-samples, .lc-pa-samples {
  align-self: stretch; display: flex; flex-direction: column; gap: 6px;
  max-height: 168px; overflow-y: auto; margin-top: 2px;
}
.lc-sample, .lc-pa-sample {
  text-align: left; padding: 6px 10px; border-radius: 7px; cursor: pointer;
  background: #13151a; border: 1px solid var(--edge); color: #cdd6e0;
  font-family: inherit; font-size: 12px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.lc-sample:hover, .lc-pa-sample:hover { border-color: var(--acc-bd); background: #161a22; color: var(--acc); }

/* Lobby project file IO — Save / Open to a real .json on disk, side by side. */
.lobby-io { display: flex; gap: 8px; margin: 4px 0 16px; }
.lobby-io .gate-btn { flex: 1; justify-content: center; padding: 10px 12px; }

/* ── Project lobby (pick/add a zone within a project) ───────────────────── */
/* Shares the gate's ambient backdrop (#lobbyBg) + a frosted panel, so the two
   full-screen entry screens read as one family. */
.lobby-inner { width: min(560px, 94vw); position: relative; }
.lobby-inner.lobby-frost {
  z-index: 2;                                /* above the canvas + vignette */
  padding: 30px 30px 26px;
  background: rgba(15, 18, 26, 0.72);
  border: 1px solid var(--edge);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 24px 70px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(90,159,255,0.04);
}
.lobby-back {
  position: absolute; top: 14px; left: 18px; background: none; border: none;
  color: #7c8696; font-family: inherit; font-size: 13px; cursor: pointer; padding: 4px 0; z-index: 1;
}
.lobby-back:hover { color: var(--acc); }
.lobby-inner .launch-title { font-size: 26px; margin-top: 8px; }
/* Client subline — project-level info, right under the project name. */
.lobby-client { color: var(--acc); font-size: 13.5px; font-weight: 600; margin: 5px 0 0; }
.lobby-inner .launch-tagline { margin: 8px 0 18px; }
.lobby-floors { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.lobby-floor {
  padding: 6px 14px; border-radius: 8px; background: #13151a; border: 1px solid var(--edge);
  color: #cdd6e0; font-family: inherit; font-size: 13px; cursor: pointer;
}
.lobby-floor:hover { border-color: var(--acc-bd); }
.lobby-floor.active { color: #0a0e14; background: var(--acc); border-color: var(--acc); }
.lobby-floor.add { color: #7c8696; border-style: dashed; background: none; }
/* Zone cards reuse the gate's .gate-project info card; the list scrolls if long. */
.lobby-zones {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  max-height: 44vh; overflow-y: auto; margin: 0 -4px; padding: 1px 4px;
}
.lobby-zone.lobby-add { border-style: dashed; background: none; }
.lobby-zone.lobby-add:hover { background: #161a22; }
.lobby-zone.lobby-add .gp-name { color: #cdd6e0; font-weight: 600; }

/* Project Details — collapsible, below the zone list. The moved form (s74). */
.lobby-details { margin-top: 16px; border-top: 1px solid var(--edge); padding-top: 12px; text-align: left; }
.lobby-details > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: #cdd6e0;
  list-style: none; text-align: center; padding: 2px;
}
.lobby-details > summary::-webkit-details-marker { display: none; }
.lobby-details > summary::before { content: '▸'; color: var(--acc); margin-right: 6px; }
.lobby-details[open] > summary::before { content: '▾'; }
.lobby-details > summary:hover { color: var(--acc); }
.lobby-details-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px;
  margin-top: 14px; max-height: 38vh; overflow-y: auto; padding-right: 4px;
}
.lobby-details-grid .group-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .lobby-details-grid { grid-template-columns: 1fr; } }

/* Breadcrumb "up" nav at the top of the panel (in a workspace):
   Projects › Project › [Floor ›] Zone. */
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  margin-bottom: 12px; font-size: 12px;
}
.crumb {
  background: none; border: none; padding: 2px 4px; border-radius: 4px;
  color: var(--acc); font-family: inherit; font-size: 12px; cursor: pointer;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb:hover:not(:disabled) { background: #1a2230; text-decoration: underline; }
.crumb.current { color: #cdd6e0; font-weight: 600; cursor: default; }
.crumb:disabled { cursor: default; }
.crumb-sep { color: #5a6472; font-size: 12px; padding: 0 1px; }

/* ── PA workspace (graduated PA mode) ──────────────────────────────────────
   Scoped to #paPanel / #viewport so it can't touch the distributed UI. Ported
   from the PA prototype's css/style.css (component bits only — the shell, the
   .viewbar/.vb-* classes, .snapshot-row/-apply, and .hint are already shared).
   The section chrome (cards + headers) is now the shared .menu-section/summary —
   the old fieldset/legend rules were dropped when PA went collapsible (session 81).
   Body label/select fonts are matched to the distributed .field styles. */
#paPanel label { display: block; color: #9aa5b5; font-size: 12px; margin: 8px 0 2px; }
#paPanel label .val { float: right; color: #cdd6e0; font-variant-numeric: tabular-nums; }
#paPanel input[type=range] { width: 100%; accent-color: var(--acc); }
#paPanel input[type=number] { width: 64px; background: #14171d; color: #cdd6e0; border: 1px solid var(--edge); border-radius: 6px; padding: 4px 6px; }
#paPanel select { width: 100%; padding: 6px 8px; border-radius: 6px; background: #14171d; border: 1px solid var(--edge); color: #cdd6e0; font-size: 14px; }
#paPanel .row { display: flex; gap: 8px; align-items: center; }
#paPanel .row label { margin: 0; }
#paPanel .check { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #828893; font-size: 11px; cursor: pointer; }
#paPanel .check input { accent-color: var(--acc); }
#paPanel .autobtn { width: 100%; margin-top: 8px; padding: 7px; border-radius: 7px; cursor: pointer; background: #14171d; color: #828893; border: 1px solid var(--edge); font-size: 12px; }
#paPanel .autobtn:hover { color: #cdd6e0; border-color: var(--acc); }
#paPanel .autobtn.armed { color: #cdd6e0; border-color: var(--acc); background: #16233c; }
#paPanel .snap-save { width: 100%; margin-top: 6px; padding: 6px; background: none; border: 1px dashed var(--edge); border-radius: 6px; color: #828893; font-size: 11px; cursor: pointer; }
#paPanel .snap-save:hover { color: #cdd6e0; border-color: var(--acc); }
#paReadout { background: #14171d; border: 1px solid var(--edge); border-radius: 8px; padding: 10px 12px; font-variant-numeric: tabular-nums; margin-top: 4px; }
#paReadout .ro-title { color: var(--acc); font-weight: 600; margin-bottom: 4px; }
#paReadout .ro-line { display: flex; justify-content: space-between; padding: 1px 0; }
#paReadout .ro-line .k { color: #828893; }
#paReadout .ro-sep { border-top: 1px dashed var(--edge); margin: 6px 0; }
#paReadout .ro-fit { padding: 6px 8px; border-radius: 6px; margin-bottom: 8px; font-size: 12px; line-height: 1.3; }
#paReadout .ro-fit.marginal { background: #3a2f17; color: #e8b339; }
#paReadout .ro-fit.inadequate { background: #3a1c1c; color: #ef8a8a; }

/* PA 3D viewport — its own pane (distributed uses #pane2d/#pane3d). */
#viewport { position: absolute; inset: 0; }
#viewport canvas { display: block; }
#viewport #viewlabel { position: absolute; bottom: 12px; right: 12px; color: #828893; font-size: 11px; background: rgba(11,15,23,.7); padding: 4px 8px; border-radius: 6px; pointer-events: none; }
#viewport #legend { position: absolute; bottom: 16px; left: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(11,15,23,.7); padding: 8px; border-radius: 8px; font-size: 11px; color: #cdd6e0; font-variant-numeric: tabular-nums; pointer-events: none; }
#viewport .legend-bar { width: 14px; height: 120px; border-radius: 4px; background: linear-gradient(to top, #13243f 0%, #2563eb 25%, #19b787 50%, #ffd43b 75%, #ff5a5a 100%); }

/* ── Locked room dimension display ──────────────────────────────────────── */
.dim-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
/* Reset the margin added by .group > label.title when it's inside dim-header */
.dim-header > label.title { margin-bottom: 0; }

.dim-display {
  background: #11161f; border: 1px solid var(--edge); border-radius: 6px;
  padding: 9px 11px; display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap;
}
.dim-display span:first-child {
  font-size: 14px; color: #cdd6e0; font-weight: 500;
}
.dim-sqft {
  font-size: 12px; color: #6b7686;
}
.dim-done-btn {
  font-size: 12px; padding: 5px 10px; margin-top: 4px; margin-bottom: 0;
  width: auto;
}

/* ── CAD import: per-layer show/hide list ────────────────────────────────── */
.cad-layers { margin-top: 8px; }
.cad-layers-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: #6b7686; margin-bottom: 4px;
}
.cad-layer-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: #c2cad6; padding: 2px 0; cursor: pointer;
}
.cad-layer-row input { margin: 0; cursor: pointer; }
.cad-layer-swatch {
  width: 11px; height: 11px; border-radius: 2px; flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.15);
}
.cad-layer-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cad-layer-count { color: #6b7686; font-variant-numeric: tabular-nums; }

/* ── Details panel form fields ───────────────────────────────────────────── */
.detail-field { margin-bottom: 8px; }
.detail-field:last-child { margin-bottom: 0; }
.field textarea {
  width: 100%; padding: 6px 8px; border-radius: 6px;
  background: #14171d; border: 1px solid var(--edge); color: #cdd6e0;
  font-size: 13px; font-family: inherit; line-height: 1.5;
  resize: vertical; min-height: 80px;
}

/* --- Popover menu (the + buttons: Blank vs From floor plan) --- */
.popover {
  position: fixed; z-index: 100; min-width: 190px;
  background: #141a26; border: 1px solid var(--edge); border-radius: 8px;
  padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.popover button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 10px; border: none; border-radius: 5px;
  background: transparent; color: #cdd6e0; font-size: 13px; font-family: inherit;
}
.popover button:hover { background: var(--acc-weak); color: var(--acc-on); }

/* --- Feedback widget (💬 pill + modal; reuses .modal/.modal-card) --- */
/* Pill sits BOTTOM-right (fullscreen moved into the viewbar, freeing the top
   corners for the toolbar). The 3D legend also lives bottom-right but higher up,
   so the small pill tucks under it without colliding. */
.fb-fab {
  /* Bottom-right corner. position:fixed (viewport) so it hides in fullscreen
     (it lives outside #app). In SPL+3D the color legend also hugs bottom-right,
     but it sits higher/left of this small pill — they don't collide. */
  position: fixed; bottom: 14px; right: 14px; z-index: 90;
  padding: 8px 14px; border-radius: 999px;
  background: #11161f; border: 1px solid var(--edge); color: #9aa5b5;
  font-size: 12px; cursor: pointer;
}
.fb-fab:hover { border-color: var(--edge-hi); color: #cdd6e0; }
/* Entry link under the Speaker Profile dropdown — the in-context
   speaker-request shortcut (opens the modal preset to request mode). */
.fb-link {
  background: none; border: none; padding: 0; margin-top: 6px;
  font-size: 11px; color: #7c8696; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.fb-link:hover { color: var(--acc-on); }
/* "Default for this ceiling — set your model" cue under the Speaker Profile
   dropdown. Muted/italic: it's an honesty note (this is a starting point, not
   a recommendation), not a warning. Hidden once the user picks a speaker. */
#profileDefaultHint { margin: 6px 0 0; font-size: 11px; font-style: italic; color: #7c8696; }
#profileDefaultHint.hidden { display: none; }
.fb-card { width: min(440px, calc(100vw - 32px)); }
.fb-status { min-height: 1.2em; font-size: 12px; color: #e2b93d; margin-bottom: 8px; }
.fb-status.ok { color: #36c47f; }
.fb-send { width: auto; margin-left: auto; display: block; padding: 9px 22px; }
