/* Eigenify Design OS + iOS 26 / macOS 26 Native Spatial Chrome
 * Canonical tokens from eigenify-ai/src/ui/tokens/, eigen-advisor-client, and eigenify-design-os.
 * - Light theme default (#FFFFFF ground, #202124 carbon ink, #00B698 teal, #219FCF blue, #E5E7EB hairlines, #F8F9FA surfaces, #DC2626 error)
 * - Dark theme True Black (#000000 ground, #111113 / #18181B neutral obsidian surfaces, #F5F5F7 text - zero blue/navy tint)
 * - Dual Typography: iOS 26 / macOS 26 SF Pro + Inter UI typography paired with Montserrat Eigenify brand display + SF Mono / JetBrains Mono
 * - Cards 12px radius + soft elevation, pill buttons, 8px inputs, zero status pills, zero status dots, zero left accent borders
 */

:root {
  --bg: #FFFFFF;
  --surface: #F8F9FA;
  --surface-raised: #FFFFFF;
  --surface-hover: #F3F4F6;
  --glass: rgba(255, 255, 255, 0.84);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(229, 231, 235, 0.90);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --ink: #202124;
  --ink-secondary: #4B5563;
  --ink-muted: #6B7280;
  --border: #E5E7EB;
  --border-subtle: #F3F4F6;

  --teal: #00B698;
  --teal-hover: #00A087;
  --teal-ink: #007A66;
  --teal-soft: rgba(0, 182, 152, 0.10);

  --blue: #219FCF;
  --blue-ink: #1B8AB5;
  --blue-soft: rgba(33, 159, 207, 0.10);

  --amber: #F59E0B;
  --amber-ink: #B45309;
  --amber-soft: rgba(245, 158, 11, 0.12);

  --error: #DC2626;
  --error-soft: rgba(220, 38, 38, 0.10);

  --shadow-card: 0 4px 20px rgba(7, 30, 73, 0.05);
  --shadow-float: 0 10px 30px rgba(7, 30, 73, 0.09), 0 1px 4px rgba(7, 30, 73, 0.05);
  --shadow-popover: 0 14px 36px rgba(7, 30, 73, 0.13), 0 2px 6px rgba(7, 30, 73, 0.06);

  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-sans: var(--font-ui);
  --font-mono: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, Monaco, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-gentle: 360ms;
  --radius-card: 12px;
  --radius-input: 8px;
  --radius-pill: 9999px;
}

[data-theme="dark"] {
  --bg: #000000;
  --surface: #111113;
  --surface-raised: #18181B;
  --surface-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(14, 14, 16, 0.82);
  --glass-strong: rgba(20, 20, 22, 0.92);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --ink: #F5F5F7;
  --ink-secondary: #D4D4D8;
  --ink-muted: #A1A1AA;
  --border: rgba(255, 255, 255, 0.11);
  --border-subtle: rgba(255, 255, 255, 0.06);

  --teal-ink: #00B698;
  --blue-ink: #219FCF;
  --amber-ink: #F59E0B;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.50);
  --shadow-float: 0 14px 36px rgba(0, 0, 0, 0.65);
  --shadow-popover: 0 18px 42px rgba(0, 0, 0, 0.72);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

code, .mono {
  font-family: var(--font-mono);
}

/* ==================== Floating Liquid Glass Top Capsule ==================== */

.nav-capsule {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1180px, calc(100vw - 24px));
  height: 52px;
  padding: 0 10px 0 14px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  backdrop-filter: saturate(190%) blur(24px);
  -webkit-backdrop-filter: saturate(190%) blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), var(--glass-highlight);
  transition: border-color var(--t-base) var(--ease-out), background-color var(--t-base) var(--ease-out);
}

.nav-capsule.is-updating {
  border-color: rgba(0, 182, 152, 0.55);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}

.nav-logo {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-brand-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.nav-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  flex-shrink: 0;
}

.nav-conn {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t-base) var(--ease-out);
}

.nav-conn.is-live {
  color: var(--teal-ink);
}

/* Growing Araucaria brand activity indicator (Eigenify motion canon) */
.nav-araucaria {
  width: 18px;
  height: 18px;
  color: var(--teal);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  flex-shrink: 0;
}

.nav-capsule.is-updating .nav-araucaria {
  opacity: 1;
  transform: scale(1);
}

.eigen-araucaria {
  display: block;
  width: 100%;
  height: 100%;
}

.eigen-araucaria .ar-sway {
  animation: eigen-sway 3s ease-in-out 600ms infinite;
  transform-origin: 10px 18px;
}

.eigen-araucaria .ar-t {
  transform-origin: 10px 17px;
  animation: eigen-grow 2600ms var(--ease-out) infinite;
}

.eigen-araucaria .ar-t1 { animation-delay: 120ms; }
.eigen-araucaria .ar-t2 { animation-delay: 280ms; }
.eigen-araucaria .ar-t3 { animation-delay: 440ms; }

@keyframes eigen-grow {
  0%, 100% { opacity: 0.28; transform: scale(0.48); }
  20%, 70% { opacity: 1; transform: scale(1); }
  88% { opacity: 0.55; transform: scale(0.92); }
}

@keyframes eigen-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* Segmented Navigation Control with 60fps Sliding Thumb */
.segmented-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
}

.segmented-thumb {
  position: absolute;
  top: 3px;
  left: 0;
  height: calc(100% - 6px);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: 0 2px 8px rgba(7, 30, 73, 0.08);
  transition: transform 320ms var(--ease-out), width 320ms var(--ease-out);
  pointer-events: none;
  will-change: transform, width;
}

.seg-btn {
  position: relative;
  z-index: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease-out);
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.active {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ==================== Canonical Eigenify Pill Buttons ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-xs { height: 28px; padding: 0 11px; font-size: 11.5px; }
.btn-icon { width: 34px; height: 34px; padding: 0; background: transparent; color: var(--ink-secondary); }
.btn-icon:hover { background: var(--surface-hover); color: var(--ink); }

.btn-primary {
  background: var(--teal);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--teal-hover);
}

.btn-secondary {
  background: var(--ink);
  color: var(--bg);
}
.btn-secondary:hover {
  opacity: 0.90;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-hover);
}

/* ==================== Notice & Narration Ribbon Stack ==================== */

.notice-stack {
  position: fixed;
  top: calc(var(--nav-bottom, 68px) + 10px);
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(620px, calc(100vw - 32px));
  pointer-events: none;
}

.narration-ribbon,
.hypothetical-notice {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  animation: fade-rise 260ms var(--ease-out);
}

.hypothetical-notice {
  border-color: rgba(245, 158, 11, 0.42);
  color: var(--amber-ink);
  font-size: 12px;
}

.ribbon-araucaria {
  width: 16px;
  height: 16px;
  color: var(--teal);
  flex-shrink: 0;
}

.narration-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ribbon-action {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--blue-ink);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ribbon-action:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes fade-rise {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ==================== View Panels ==================== */

.view-panel {
  display: none;
}

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

/* Studio Full-Bleed Canvas */
.view-studio {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.canvas-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  overflow: hidden;
}

.canvas-stage:active {
  cursor: grabbing;
}

.canvas-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ==================== 60fps Spatial Callout Pins & Human Popover ==================== */

.spatial-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}

.spatial-pin {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 280ms var(--ease-out);
}

.spatial-pin.visible {
  opacity: 1;
}

.spatial-pin-card {
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 8px 12px;
  min-width: 150px;
  max-width: 230px;
  box-shadow: var(--shadow-float);
}

.spatial-pin-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.spatial-pin-metric {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--teal-ink);
}

.spatial-pin.tone-blue .spatial-pin-metric { color: var(--blue-ink); }
.spatial-pin.tone-amber .spatial-pin-metric { color: var(--amber-ink); }
.spatial-pin.tone-neutral .spatial-pin-metric { color: var(--ink-secondary); }

.spatial-pin-detail {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.35;
}

.spatial-pin-stem {
  width: 1.5px;
  height: 14px;
  margin: 0 auto;
  background: var(--teal);
  opacity: 0.7;
}

.spatial-pin.tone-blue .spatial-pin-stem { background: var(--blue); }
.spatial-pin.tone-amber .spatial-pin-stem { background: var(--amber); }

/* Selection Popover */
.selection-popover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 25;
  width: min(272px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: var(--radius-card);
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-popover), var(--glass-highlight);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
  will-change: transform, opacity;
}

.selection-popover.open {
  opacity: 1;
  pointer-events: auto;
}

.pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.pop-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--blue-ink);
}

.pop-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}

.pop-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.pop-summary {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.pop-coords {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.pop-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pop-sync {
  font-size: 11px;
  color: var(--teal-ink);
  font-weight: 500;
}

/* ==================== Floating Bottom Spatial Controls Bar ==================== */

.spatial-dock {
  position: fixed;
  left: 20px;
  bottom: 18px;
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 8px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), var(--glass-highlight);
  max-width: calc(100vw - 396px);
  transition: max-width var(--t-gentle) var(--ease-out);
}

body.inspector-collapsed .spatial-dock {
  max-width: calc(100vw - 40px);
}

.dock-scrubber {
  width: 170px;
  display: flex;
  align-items: center;
}

.dock-readout {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 68px;
}

.dock-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.dock-cam-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dock-utm {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  padding-left: 4px;
  white-space: nowrap;
}

/* ==================== Floating Collapsible Inspector Sheet ==================== */

.inspector-sheet {
  position: fixed;
  top: 76px;
  right: 14px;
  bottom: 14px;
  width: 356px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--glass-strong);
  backdrop-filter: saturate(190%) blur(26px);
  -webkit-backdrop-filter: saturate(190%) blur(26px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), var(--glass-highlight);
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  transition: transform 360ms var(--ease-out), opacity 260ms var(--ease-out);
  will-change: transform;
}

.inspector-sheet.is-dragging {
  transition: none;
}

body.inspector-collapsed .inspector-sheet {
  transform: translate3d(calc(100% + 28px), 0, 0);
  pointer-events: none;
}

.sheet-grabber {
  display: none;
}

.inspector-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
}

.insp-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.insp-tab.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(7, 30, 73, 0.08);
}

.inspector-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 18px;
}

.insp-panel {
  display: none;
}

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

.sheet-section + .sheet-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-ink);
  margin-bottom: 8px;
}

/* Inputs, Selects & iOS Switches */
.field-select,
.field-input,
.field-textarea {
  width: 100%;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 11px;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.field-select:focus,
.field-input:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.field-textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.field-textarea.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  min-height: 130px;
}

.slider-row {
  margin-top: 11px;
}

.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.num-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--teal-ink);
}

input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--teal);
  cursor: pointer;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

/* Native iOS 26 style toggle switch */
.ios-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 200ms var(--ease-out);
}

.ios-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(7, 30, 73, 0.22);
  transition: transform 220ms var(--ease-out);
}

.ios-switch:checked {
  background: var(--teal);
}

.ios-switch:checked::after {
  transform: translate3d(16px, 0, 0);
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== Metrics, Disclosures & Clean Status List ==================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 11px;
  box-shadow: var(--shadow-card);
}

.metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}

.metric-value {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.metric-delta {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.metric-delta.good { color: var(--teal-ink); }
.metric-delta.warn { color: var(--amber-ink); }
.metric-delta.bad { color: var(--error); }

.verification-rows {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.verify-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.verify-label { color: var(--ink-secondary); }
.verify-val { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.verify-val.ok { color: var(--teal-ink); }
.verify-val.warn { color: var(--amber-ink); }
.verify-val.err { color: var(--error); }

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  margin-bottom: 8px;
}

.section-head-row .eyebrow {
  margin-bottom: 0;
}

.table-scroll {
  margin-top: 8px;
  max-height: 200px;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  color: var(--ink-muted);
  font-weight: 600;
}

.legend-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.legend-bar {
  width: 20px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.engine-kv {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.engine-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-subtle);
}

.engine-kv dt { color: var(--ink-muted); }
.engine-kv dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
  text-align: right;
}

/* Clean Agent Status List (zero left border, zero status pills) */
.agent-status-list {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-status-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 9px 11px;
}

.agent-status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.agent-status-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.agent-status-state {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-ink);
}

.agent-status-state.completed { color: var(--teal-ink); }
.agent-status-state.unavailable { color: var(--amber-ink); }

.agent-status-scope {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-secondary);
}

/* ==================== Secondary Pages (Figures, Replays, Connect) ==================== */

.view-page {
  min-height: 100vh;
  background: var(--bg);
  padding: calc(var(--nav-bottom, 68px) + 24px) 24px 56px;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.page-lead {
  margin: 8px 0 0;
  max-width: 680px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.header-meta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.count-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.sub-switcher {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
}

.sub-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.sub-btn.active {
  background: var(--teal);
  color: #FFFFFF;
}

.figsub-panel { display: none; }
.figsub-panel.active { display: block; }

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar-row .field-input {
  flex: 1 1 240px;
  max-width: 380px;
}

.panel-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.panel-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 18px;
}

.fig-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.fig-card:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-float);
}

.fig-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.fig-meta {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fig-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-ink);
  letter-spacing: 0.02em;
}

.fig-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.fig-note {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Compare View */
.compare-summary {
  margin-bottom: 18px;
}

.compare-nota {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.compare-rationale {
  margin: 6px 0 10px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.compare-ctm {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal-ink);
  font-variant-numeric: tabular-nums;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.compare-img {
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Replays Grid */
.replays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.replay-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.replay-card.active-replay {
  border-color: var(--teal);
}

.replay-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.replay-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.replay-actor {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-ink);
}

.replay-actor.active { color: var(--teal-ink); }

.replay-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.replay-m-label {
  font-size: 10.5px;
  color: var(--ink-muted);
}

.replay-m-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.replay-m-val.good { color: var(--teal-ink); }
.replay-m-val.bad { color: var(--error); }

/* Connect / MCP View */
.session-card {
  margin-bottom: 18px;
}

.session-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto;
  gap: 16px;
  align-items: center;
}

.session-url {
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-all;
}

.mcp-clients-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.agent-client-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.agent-client-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.agent-client-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.agent-client-state {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.agent-client-state.connected {
  color: var(--teal-ink);
}

.code-box {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.connect-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.event-log {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 290px;
  overflow-y: auto;
}

.event-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

.event-ts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.event-actor {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-ink);
  flex-shrink: 0;
}

.event-summary {
  color: var(--ink);
  min-width: 0;
}

.empty-note {
  font-size: 13px;
  color: var(--ink-muted);
  padding: 12px 0;
}

.page-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-muted);
}

/* ==================== Lightbox Modal ==================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(960px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-popover);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.modal-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #FFFFFF;
}

/* ==================== Responsive Mobile iOS 26 Bottom Sheet (<= 820px) ==================== */

@media (max-width: 960px) {
  .mcp-clients-grid,
  .connect-two-col,
  .compare-grid,
  .session-grid {
    grid-template-columns: 1fr;
  }
  .dock-utm {
    display: none;
  }
}

@media (max-width: 820px) {
  .nav-capsule {
    top: 10px;
    width: calc(100vw - 20px);
    height: auto;
    flex-wrap: wrap;
    border-radius: 20px;
    padding: 8px 10px;
    gap: 8px;
  }

  .nav-brand {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    gap: 8px;
  }

  .nav-actions {
    order: 2;
    flex-shrink: 0;
  }

  #btn-toggle-inspector {
    display: none;
  }

  .segmented-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .seg-btn {
    flex: 1;
    padding: 6px 4px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
  }

  .workspace-pill {
    display: none;
  }

  .lang-btn {
    padding: 3px 6px;
    font-size: 10px;
  }

  .notice-stack {
    top: calc(var(--nav-bottom, 102px) + 8px);
    width: calc(100vw - 24px);
  }

  .spatial-dock {
    left: 10px;
    right: 10px;
    bottom: 84px;
    max-width: none;
    justify-content: space-between;
    padding: 6px 10px;
    gap: 8px;
  }

  .dock-scrubber {
    flex: 1;
    width: auto;
    min-width: 80px;
  }

  .dock-cam-group {
    display: none;
  }

  /* Native iOS 26 Bottom Sheet Drawer */
  .inspector-sheet {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 0;
    width: auto;
    height: 70vh;
    border-radius: 20px 20px 0 0;
    transform: translate3d(0, calc(100% - 68px), 0);
  }

  .inspector-sheet.mobile-open {
    transform: translate3d(0, 0, 0);
  }

  .inspector-sheet.is-dragging {
  transition: none;
}

body.inspector-collapsed .inspector-sheet {
    transform: translate3d(0, calc(100% - 68px), 0);
    pointer-events: auto;
  }

  .sheet-grabber {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 68px;
    padding: 8px 18px 12px;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    flex-shrink: 0;
  }

  .grabber-bar {
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: var(--border);
  }

  .grabber-summary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .grabber-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
  }

  .grabber-metric {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--teal-ink);
  }

  .view-page {
    padding: calc(var(--nav-bottom, 102px) + 20px) 14px 40px;
  }
}

/* ==================== Dual Typography, ES/EN Switcher & Dual-Workflow Platform ==================== */

.nav-title,
.page-header h1,
.hub-card h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  gap: 2px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.active {
  background: var(--teal);
  color: #FFFFFF;
}

.workspace-pill {
  display: inline-block;
  vertical-align: middle;
  padding: 3px 10px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.workspace-pill:hover {
  border-color: var(--teal);
  color: var(--ink);
}

/* Proposals Dual-Workflow Hub */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}

.hub-card:hover {
  border-color: var(--teal);
}

.hub-card h2 {
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.hub-card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.hub-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.template-card {
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.template-card:hover {
  border-color: var(--teal);
  background: var(--surface-hover);
}

.template-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.template-desc {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.saved-card {
  padding: 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.saved-card-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* Scratch Proposal Builder inside Floating Inspector */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.zone-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zone-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-card.selected-zone {
  border-color: var(--teal);
}

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

.zone-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.zone-grid-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.zone-mini-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.zone-mini-field span {
  font-size: 11px;
  color: var(--ink-muted);
}

.zone-mini-field input,
.zone-mini-field select {
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

body.mode-scratch .existing-only,
body.mode-scratch .house-only {
  display: none !important;
}

body.mode-existing .scratch-only,
body.mode-existing .house-only {
  display: none !important;
}

body.mode-house .existing-only,
body.mode-house .scratch-only {
  display: none !important;
}

/* ==================== 2D / 3D BIM / 2D+3D Split Revit Viewport ==================== */

.hub-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.viewport-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.viewport-shell > .canvas-stage {
  position: relative;
  flex: 1 1 100%;
  min-width: 0;
  height: 100%;
}

.bim-pane {
  position: relative;
  flex: 0 0 0;
  min-width: 0;
  height: 100%;
  display: none;
  background: var(--bg);
  overflow: hidden;
}

#bim-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#bim-canvas:active {
  cursor: grabbing;
}

body.view-3d .viewport-shell > .canvas-stage {
  display: none;
}

body.view-3d .bim-pane {
  display: block;
  flex: 1 1 100%;
}

body.view-split .viewport-shell > .canvas-stage {
  display: block;
  flex: 1 1 50%;
  border-right: 1px solid var(--border);
}

body.view-split .bim-pane {
  display: block;
  flex: 1 1 50%;
}

@media (min-width: 821px) {
  body.view-split:not(.inspector-collapsed) .viewport-shell,
  body.view-3d:not(.inspector-collapsed) .viewport-shell {
    padding-right: 372px;
  }
}

/* Floating Revit / BIM Viewport HUD (Liquid Glass, True-Black dark) */
.bim-hud {
  position: absolute;
  left: 14px;
  top: calc(var(--nav-bottom, 64px) + 56px);
  z-index: 22;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  max-width: calc(100% - 28px);
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), var(--glass-highlight);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

@media (min-width: 821px) {
  body.view-split .bim-hud {
    top: auto;
    bottom: 16px;
    left: 14px;
    max-width: calc(100% - 28px);
  }
}

.bim-hud-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--surface);
}

.bim-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.bim-btn:hover {
  color: var(--ink);
}

.bim-btn.active {
  background: var(--surface-raised);
  color: var(--teal-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.bim-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.bim-slider-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.bim-slider-chip input[type="range"] {
  width: 70px;
}

.bim-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--teal-ink);
  min-width: 34px;
}

/* 2D | 3D BIM | 2D + 3D View Mode Segmented Switcher in Spatial Dock */
.view-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--surface);
}

.vm-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.vm-btn:hover {
  color: var(--ink);
}

.vm-btn.active {
  background: var(--teal);
  color: #FFFFFF;
}

.level-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 3px;
  background: var(--surface);
  padding: 2px;
  border-radius: 8px;
}

.lvl-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
}

.lvl-btn.active {
  background: var(--teal);
  color: #FFFFFF;
}

.lvl-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

@media (min-width: 821px) {
  body:not(.inspector-collapsed) .notice-stack {
    left: calc((100% - var(--inspector-w, 340px)) / 2);
    max-width: calc(100% - var(--inspector-w, 340px) - 36px);
  }
}

@media (max-width: 1100px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .workspace-pill {
    display: none;
  }
  .nav-conn {
    display: none;
  }
  body.view-split .viewport-shell {
    flex-direction: column;
  }
  body.view-split .viewport-shell > .canvas-stage {
    flex: 1 1 50%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  body.view-split .bim-pane {
    flex: 1 1 50%;
  }
  .bim-hud {
    top: calc(var(--nav-bottom, 58px) + 8px);
    left: 8px;
    right: 8px;
    max-width: none;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    padding: 5px 8px;
    gap: 5px 7px;
  }
  .bim-hud .bim-sep {
    display: none;
  }
  body.view-split .bim-hud {
    top: 8px;
  }
  body.view-3d .bim-hud {
    top: auto;
    bottom: 130px;
  }
  .bim-slider-chip {
    white-space: nowrap;
    font-size: 10.5px;
    gap: 4px;
  }
  .bim-slider-chip input[type="range"] {
    width: 48px;
  }
  .bim-btn {
    font-size: 10.5px;
    padding: 3px 6px;
  }
}

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

/* ==================== Agent / MCP-First Spotlight Co-Design Bar (macOS 26 / iOS 26) ==================== */

.cmd-dock {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 11px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.cmd-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cmd-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.4;
}

.cmd-mcp-link {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--teal-ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.cmd-mcp-link:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.cmd-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-ink);
  font-size: 11.5px;
  font-weight: 600;
}

.cmd-selection-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-sel-clear {
  border: none;
  background: transparent;
  color: var(--teal-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 3px;
}

.cmd-thread {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 82px;
  overflow-y: auto;
  font-size: 11.5px;
}

.cmd-thread:empty {
  display: none;
}

.cmd-msg {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.35;
}

.cmd-msg-actor {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--teal-ink);
  margin-right: 6px;
}

.cmd-msg-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
}

.cmd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cmd-chip {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.cmd-chip:hover {
  border-color: var(--teal);
  color: var(--teal-ink);
}

.cmd-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cmd-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 12px;
}

/* ==================== Live Agent Magic: SVG Leader Lines, Iteration HUD & Slider Pulse ==================== */

.leader-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.spatial-pin {
  z-index: 2;
  transition: opacity 260ms var(--ease-out);
}

.spatial-pin-card {
  max-width: 204px;
  padding: 8px 11px;
}

.live-hud {
  position: fixed;
  left: 16px;
  bottom: 72px;
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), var(--glass-highlight);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}

.live-hud-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.live-hud-iter {
  font-weight: 700;
  color: var(--teal-ink);
  letter-spacing: -0.01em;
}

.live-hud-kpi {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface);
}

.live-hud-kpi.good {
  color: var(--teal-ink);
  background: var(--teal-soft);
}

.live-hud-kpi.bad {
  color: var(--amber-ink);
  background: var(--amber-soft);
}

.slider-row.agent-touched,
.switch-row.agent-touched {
  border-radius: 8px;
  background: var(--teal-soft);
  box-shadow: 0 0 0 1px rgba(0, 182, 152, 0.35);
  padding: 6px 8px;
  margin-left: -8px;
  margin-right: -8px;
  transition: background 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}

@media (max-width: 960px) {
  .live-hud {
    display: none !important;
  }
}

/* ==================== BIM Workbench, Schedules, Clashes, 2D Sheets & Multiplayer ==================== */

.inspector-tabs {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  flex-wrap: nowrap !important;
}

.inspector-tabs .insp-tab {
  font-size: 11.5px;
  padding: 6px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bim-undo-group,
.bim-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.bim-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.bim-stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 7px 9px;
}

.bim-stat-lbl {
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bim-stat-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}

.bim-datum-list,
.bim-family-list,
.bim-clash-list,
.team-roster-list,
.team-locks-list,
.team-comments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.bim-datum-row,
.bim-family-row,
.bim-clash-row,
.team-peer-row,
.team-lock-row,
.team-comment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 12px;
}

.bim-datum-row input[type="number"] {
  width: 68px;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
}

.bim-grid-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.bim-grid-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink-secondary);
}

.bim-sched-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 3px;
}

.bim-subtab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
}

.bim-subtab.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.bim-table-wrap {
  max-height: 185px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
}

.bim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.bim-table th,
.bim-table td {
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  white-space: nowrap;
}

.bim-table th {
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: var(--surface-raised);
}

.bim-table td input.bim-cell-edit {
  width: 96px;
  padding: 2px 4px;
  font-size: 11px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.bim-meta-line,
.bim-meta-inline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 6px;
}

.bim-meta-inline {
  margin-top: 0;
  color: var(--teal-ink);
  font-weight: 600;
}

.bim-clash-row {
  cursor: pointer;
  flex-direction: column;
  align-items: stretch;
}

.bim-clash-row:hover {
  background: var(--surface-hover);
}

.bim-clash-head {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--ink);
}

.bim-clash-sev-critical {
  color: var(--error);
}

.bim-clash-sev-major {
  color: var(--amber-ink);
}

.bim-clash-sev-minor {
  color: var(--blue-ink);
}

.bim-sheet-preview {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  overflow: hidden;
  min-height: 0;
}

.bim-sheet-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.bim-file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.team-peer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-color-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

.team-peer-role {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

.team-comment-row {
  flex-direction: column;
  align-items: stretch;
}

.team-comment-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
}

.team-comment-body {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.38;
}

.team-comment-resolved {
  opacity: 0.56;
}

/* ==================== Reduce-Motion Compliance (07-MOTION-SYSTEM.md) ==================== */

@media (prefers-reduced-motion: reduce) {
  .eigen-araucaria .ar-sway,
  .eigen-araucaria .ar-t {
    animation: none;
  }
  .segmented-thumb,
  .inspector-sheet,
  .spatial-pin,
  .selection-popover,
  .btn,
  .ios-switch::after {
    transition: none;
  }
}
