/* Wave Align v5.1 Standalone — Virtual Laser PtP & Multi-Station PtMP Rooftop Instrument Stylesheet */
:root {
  --bg: #090d16;
  --bg-elev: #101726;
  --bg-card: #131c2e;
  --bg-subtle: #19243a;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.30);
  --text: #f8fafc;
  --text-2: #cbd5e1;
  --text-muted: #94a3b8;

  --laser-red: #ff2d55;
  --laser-glow: rgba(255, 45, 85, 0.42);
  --laser-amber: #f59e0b;
  --laser-glow-amber: rgba(245, 158, 11, 0.32);
  --laser-green: #10b981;
  --laser-cyan: #38bdf8;
  --accent-ui: #2563eb;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

html[data-theme="sun"] {
  --bg: #eef2f7;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #e2e8f0;
  --border: rgba(15, 23, 42, 0.18);
  --border-strong: rgba(15, 23, 42, 0.36);
  --text: #090d16;
  --text-2: #1e293b;
  --text-muted: #475569;

  --laser-red: #dc2626;
  --laser-glow: rgba(220, 38, 38, 0.35);
  --laser-amber: #d97706;
  --laser-green: #059669;
  --laser-cyan: #0284c7;
  --accent-ui: #1d4ed8;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

button,
select,
input {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
}

/* --- Auth & First-Run Setup Screens --- */
.login-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}

.setup-card {
  max-width: 540px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-laser-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--laser-red);
  box-shadow: 0 0 0 4px var(--laser-glow), 0 0 16px var(--laser-red);
  flex-shrink: 0;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ver-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--laser-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.demo-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: var(--laser-amber);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.login-brand p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.login-note {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-2);
}

.field-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.field-hint {
  margin: -8px 0 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.login-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.96rem;
  margin-bottom: 13px;
}

.login-input:focus {
  outline: 2px solid var(--laser-cyan);
  outline-offset: 1px;
}

.setup-storage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.storage-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  cursor: pointer;
  font-size: 0.8rem;
}

.storage-opt input {
  margin-top: 3px;
}

.storage-opt strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
}

.storage-opt span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.setup-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--text-2);
  cursor: pointer;
}

.setup-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 45, 85, 0.14);
  border: 1px solid rgba(255, 45, 85, 0.45);
  color: #fda4af;
  font-size: 0.85rem;
  font-weight: 600;
}

html[data-theme="sun"] .login-error {
  color: #991b1b;
}

.btn-primary {
  min-height: 46px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-ui);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--laser-cyan);
  color: var(--text);
}

.btn-full {
  width: 100%;
}

.safety-footnote {
  margin-top: 14px;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* --- App Topbar --- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin-right: 2px;
}

.link-select {
  min-height: 38px;
  max-width: 390px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.poll-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-2);
}

.poll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--laser-amber);
}

.poll-dot.ok {
  background: var(--laser-green);
  box-shadow: 0 0 8px var(--laser-green);
}

.poll-dot.live {
  background: var(--laser-red);
  box-shadow: 0 0 10px var(--laser-red);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-btn {
  min-height: 36px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tool-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.tool-btn[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--laser-cyan);
  color: var(--text);
}

.tool-btn-ro[aria-pressed="true"] {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--laser-amber);
  color: var(--laser-amber);
}

.tool-btn-accent {
  border-color: rgba(56, 189, 248, 0.42);
  color: var(--laser-cyan);
}

.tool-btn-muted {
  color: var(--text-muted);
}

/* --- Safety Stop Banner --- */
.stop-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 45, 85, 0.18);
  border-bottom: 1px solid var(--laser-red);
  font-size: 0.86rem;
}

.btn-danger-sm {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--laser-red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* --- Main Content Container --- */
.main-wrap {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.context-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.end-tab {
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.end-tab:hover {
  border-color: var(--border-strong);
}

.end-tab.active {
  border-color: var(--laser-cyan);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.03));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.end-tab-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.end-tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-2);
}

.end-tab.active .end-tag {
  background: var(--laser-cyan);
  color: #06121e;
}

.hw-badge {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sec-mini-chip {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-2);
}

.end-tab-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.end-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.end-sig {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 800;
}

.end-sub {
  margin-top: 3px;
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* Actual Physical Radio Locations Strip */
.location-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.loc-node {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.loc-node-right {
  text-align: right;
}

.loc-role {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--laser-cyan);
}

.loc-node strong {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-coords {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

.loc-path-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 170px;
}

.loc-bearing,
.loc-el {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-2);
}

.loc-beam-line {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--laser-cyan), var(--laser-red));
  overflow: hidden;
}

.loc-laser-pulse {
  position: absolute;
  top: 0;
  right: 0;
  width: 34%;
  height: 100%;
  background: #ffffff;
  opacity: 0.75;
  animation: beamSlide 1.8s infinite linear;
}

@keyframes beamSlide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-320%); }
}

/* --- Multi-Station PtMP Sector Cluster Bar --- */
.ptmp-sector-bar {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ptmp-sector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ptmp-sector-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--laser-cyan);
  letter-spacing: 0.03em;
}

.ptmp-sector-note {
  font-size: 0.78rem;
  color: var(--text-2);
}

.ptmp-sta-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ptmp-sta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
}

.ptmp-sta-chip:hover {
  border-color: var(--laser-cyan);
}

.ptmp-sta-chip.selected {
  border-color: var(--laser-cyan);
  background: rgba(56, 189, 248, 0.14);
}

.ptmp-sta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--laser-green);
  flex-shrink: 0;
}

.ptmp-sta-dot.down {
  background: var(--laser-red);
}

.ptmp-sta-meta {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* --- Hero Stage Card --- */
.laser-stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.steer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}

.steer-banner.state-steer {
  background: linear-gradient(90deg, rgba(255, 45, 85, 0.14), rgba(16, 23, 38, 0.4));
  border-bottom-color: rgba(255, 45, 85, 0.35);
}

.steer-banner.state-warn {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(16, 23, 38, 0.4));
  border-bottom-color: rgba(245, 158, 11, 0.38);
}

.steer-banner.state-locked {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(16, 23, 38, 0.4));
  border-bottom-color: rgba(16, 185, 129, 0.42);
}

.steer-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.steer-arrow-box {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.steer-banner.state-steer .steer-arrow-box {
  border-color: var(--laser-red);
  color: var(--laser-red);
  box-shadow: 0 0 18px var(--laser-glow);
}

.steer-banner.state-locked .steer-arrow-box {
  border-color: var(--laser-green);
  color: var(--laser-green);
}

.steer-banner.state-warn .steer-arrow-box {
  border-color: var(--laser-amber);
  color: var(--laser-amber);
}

.steer-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.laser-mode-pill {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--laser-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.laser-mode-pill.live {
  background: rgba(255, 45, 85, 0.18);
  color: var(--laser-red);
  border-color: rgba(255, 45, 85, 0.5);
}

.active-radio-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.steer-headline {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.24;
}

.steer-detail {
  margin: 3px 0 0;
  font-size: 0.84rem;
  color: var(--text-2);
}

.steer-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.btn-laser-start {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255, 45, 85, 0.65);
  background: linear-gradient(180deg, #ff2d55, #d81b43);
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(255, 45, 85, 0.28);
  white-space: nowrap;
}

.btn-laser-start.running {
  background: linear-gradient(180deg, #ef4444, #991b1b);
  border-color: #fca5a5;
}

.btn-laser-start:disabled {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.aim-timer-sub {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-muted);
}

.droop-banner {
  padding: 9px 18px;
  background: rgba(245, 158, 11, 0.18);
  border-bottom: 1px solid var(--laser-amber);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}

/* --- TWO DEVICE VIEWS SIDE-BY-SIDE --- */
.device-views-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.device-pane {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.device-pane + .device-pane {
  border-left: 1px solid var(--border);
}

.device-pane-primary {
  background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.05), transparent 72%);
}

.pane-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pane-step {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.pane-step-live {
  color: var(--laser-cyan);
}

.pane-title {
  margin: 2px 0 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.pane-persp-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.pane-persp-wrench {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--laser-cyan);
}

.svg-radio-stage {
  width: 100%;
  max-width: 452px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.svg-radio-stage svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.pane-caption {
  width: 100%;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Stage Controls Bar --- */
.stage-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.stage-controls-left,
.stage-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ctrl-pill {
  min-height: 34px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.ctrl-pill.active,
.ctrl-pill[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--laser-cyan);
  color: var(--text);
}

.parity-badge {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

.parity-badge.verified {
  color: var(--laser-green);
  font-weight: 700;
}

.parity-badge.warn {
  color: var(--laser-amber);
  font-weight: 700;
}

/* --- Signal Meter + 4 KPI Strip --- */
.signal-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(0, 1.45fr);
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.sig-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.sig-bar-title {
  font-size: 0.81rem;
  font-weight: 800;
}

.muted-inline {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.delta-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-2);
}

.delta-pill.up {
  background: rgba(16, 185, 129, 0.18);
  color: var(--laser-green);
}

.delta-pill.down {
  background: rgba(255, 45, 85, 0.18);
  color: var(--laser-red);
}

.meter-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  overflow: visible;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 45%, #10b981 82%, #34d399 100%);
  transition: width 0.25s ease;
}

.meter-tick {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  transform: translateX(-1px);
}

.meter-tick span {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 800;
  white-space: nowrap;
}

.meter-tick-target { background: var(--laser-cyan); }
.meter-tick-target span { color: var(--laser-cyan); }
.meter-tick-peak { background: var(--laser-amber); }
.meter-tick-peak span { color: var(--laser-amber); }

.meter-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

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

.kpi-box {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  min-width: 0;
}

.kpi-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.kpi-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-mini-btns {
  display: inline-flex;
  gap: 4px;
}

.mini-link-btn {
  padding: 1px 5px;
  font-size: 0.66rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-2);
  cursor: pointer;
}

.kpi-val {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* --- Granular Sector Breakdown Panel --- */
.granular-panel {
  padding: 12px 16px 15px;
  background: var(--bg-elev);
}

.granular-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}

.granular-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.granular-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.granular-source-badge {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--laser-cyan);
  border: 1px solid var(--border);
}

.granular-contrast {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.sector-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.sec-rank-chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.sec-rank-chip.peak {
  border-color: var(--laser-red);
  background: rgba(255, 45, 85, 0.14);
  color: var(--text);
}

.sec-rank-chip.good {
  border-color: var(--laser-green);
  background: rgba(16, 185, 129, 0.15);
  color: var(--text);
}

.sec-rank-chip.null-warn {
  border-color: var(--laser-amber);
  background: rgba(245, 158, 11, 0.14);
  color: var(--laser-amber);
}

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

.g-meta-item {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  min-width: 0;
}

.g-meta-k {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.g-meta-v {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Modals --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-wide {
  max-width: 960px;
}

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

.modal-head h2 {
  margin: 2px 0 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.btn-icon-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.schematic-body svg {
  width: 100%;
  height: auto;
  display: block;
}

.schem-takeaways {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.schem-takeaways-title {
  font-weight: 800;
  color: var(--laser-cyan);
  margin-bottom: 6px;
}

.schem-takeaways-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
}

.guide-steps ul {
  margin: 6px 0 2px;
  padding-left: 18px;
}

@keyframes laserPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.22); }
}

.svg-laser-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: laserPulse 1.5s infinite ease-in-out;
}

/* Coupled Two-End Ownership & Link Budget Strip */
.two-end-budget-strip {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.55), rgba(9, 13, 22, 0.35));
}

body.sunlight-mode .two-end-budget-strip {
  background: var(--bg-subtle);
}

.two-end-budget-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 9px;
}

.sys-state-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.sys-state-chip.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.45);
}

.sys-state-chip.bad {
  background: var(--laser-glow);
  color: var(--laser);
  border-color: rgba(255, 45, 85, 0.45);
}

.sys-state-summary {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.two-end-bins {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.budget-bin {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.budget-bin-lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

.budget-bin-val {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
}

.budget-bin-val.good { color: var(--emerald); }
.budget-bin-val.warn { color: var(--amber); }
.budget-bin-val.bad  { color: var(--laser); }

.pane-persp-tag.tone-good {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--emerald-soft);
}
.pane-persp-tag.tone-warn {
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.45);
  background: var(--amber-soft);
}
.pane-persp-tag.tone-bad {
  color: var(--laser);
  border-color: rgba(255, 45, 85, 0.45);
  background: var(--laser-glow);
}

@media (max-width: 960px) {
  .two-end-bins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-strip { grid-template-columns: 1fr; }
  .granular-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .device-views-grid { grid-template-columns: 1fr; }
  #pane-back {
    order: -1;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .device-pane + .device-pane { border-left: none; }
  .steer-banner { flex-direction: column; align-items: stretch; }
  .steer-cta { align-items: stretch; }
  .btn-laser-start { width: 100%; justify-content: center; }
  .aim-timer-sub { text-align: center; }
  .location-strip { grid-template-columns: 1fr; gap: 6px; }
  .loc-node-right { text-align: left; }
  .kpi-quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-storage-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .end-switcher { grid-template-columns: 1fr; }
  .granular-meta-grid { grid-template-columns: 1fr; }
  .topbar { padding: 8px 12px; }
  .main-wrap { padding: 10px 10px 26px; }
}

/* --- Two-Row x Three-Column Two-Way Virtual Laser + Mobile Rooftop Layout --- */
html[data-theme="sun"] .steer-banner.state-steer {
  background: linear-gradient(90deg, #ffe4e6, #fff1f2);
  border-bottom-color: rgba(220, 38, 38, 0.35);
}
html[data-theme="sun"] .steer-banner.state-warn {
  background: linear-gradient(90deg, #fef3c7, #fffbeb);
  border-bottom-color: rgba(217, 119, 6, 0.38);
}
html[data-theme="sun"] .steer-banner.state-locked {
  background: linear-gradient(90deg, #d1fae5, #ecfdf5);
  border-bottom-color: rgba(5, 150, 105, 0.42);
}

.roof-picker-section { display: flex; flex-direction: column; gap: 6px; }
.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-left: 2px;
}
.roof-flip-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
}
.btn-flip-roof {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.9));
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
html[data-theme="sun"] .btn-flip-roof { background: #0284c7; border-color: #0369a1; color: #ffffff; }
.flip-icon { font-size: 1.18rem; line-height: 1; color: #38bdf8; }
html[data-theme="sun"] .flip-icon { color: #ffffff; }

.roof-card-top { border-color: rgba(56, 189, 248, 0.42); }
.roof-card-bottom { margin-top: 16px; border-color: var(--border-strong); }
.roof-card-ribbon {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--border);
}
.ribbon-top { background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.5)); }
.ribbon-bottom { background: linear-gradient(90deg, rgba(148, 163, 184, 0.12), rgba(15, 23, 42, 0.5)); }
html[data-theme="sun"] .ribbon-top { background: #e0f2fe; }
html[data-theme="sun"] .ribbon-bottom { background: #e2e8f0; }
.ribbon-left { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ribbon-badge { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.05em; color: #38bdf8; }
.ribbon-badge-far { color: #cbd5e1; }
html[data-theme="sun"] .ribbon-badge { color: #075985; }
html[data-theme="sun"] .ribbon-badge-far { color: #0f172a; }
.ribbon-meta { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }

.btn-promote-top {
  padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.14); color: #7dd3fc;
  font-family: var(--font-mono); font-size: 0.73rem; font-weight: 800; cursor: pointer;
}
html[data-theme="sun"] .btn-promote-top { background: #0284c7; border-color: #0369a1; color: #ffffff; }

.other-roof-badge {
  flex-shrink: 0; padding: 3px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  background: rgba(100, 116, 139, 0.22); border: 1px solid rgba(148, 163, 184, 0.4); color: var(--text);
}
.other-roof-badge.tone-good { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.55); color: #34d399; }
.other-roof-badge.tone-warn { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.55); color: #fbbf24; }
.other-roof-badge.tone-bad { background: rgba(255, 45, 85, 0.22); border-color: rgba(255, 45, 85, 0.55); color: #ff6b88; }
html[data-theme="sun"] .other-roof-badge.tone-good { color: #047857; }
html[data-theme="sun"] .other-roof-badge.tone-warn { color: #b45309; }
html[data-theme="sun"] .other-roof-badge.tone-bad { color: #be123c; }

.far-summary-banner { padding: 14px 20px; }
.far-sig-pill-box {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  padding: 8px 14px; border-radius: var(--radius-sm); background: rgba(9, 13, 22, 0.55);
  border: 1px solid var(--border); min-width: 150px;
}
html[data-theme="sun"] .far-sig-pill-box { background: #ffffff; border-color: #cbd5e1; }
.far-card-dbm { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 800; color: var(--text); }

.tri-views-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}
.tri-views-grid .device-pane { padding: 14px 14px 12px; border-left: 1px solid var(--border); min-width: 0; }
.tri-views-grid .device-pane:first-child { border-left: none; }
.tri-pane-center { background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.08), rgba(9, 13, 22, 0.35)); }
html[data-theme="sun"] .tri-pane-center { background: #f8fafc; }

.kpi-quad.kpi-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mobile-row-filter { display: none; }
body[data-mob-view="top"] .roof-card-bottom { display: none; }
body[data-mob-view="bottom"] .roof-card-top { display: none; }

.sector-inline-bar { padding: 12px 18px; border-top: 1px solid var(--border); background: rgba(9, 13, 22, 0.35); }
html[data-theme="sun"] .sector-inline-bar { background: #f8fafc; }
.sector-inline-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }

.eng-drawer { margin-top: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-card); overflow: hidden; }
.eng-summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px; cursor: pointer; font-size: 0.86rem; font-weight: 700; color: var(--text-2); user-select: none;
}
.eng-summary::-webkit-details-marker { display: none; }
.eng-summary::before { content: "▸ "; color: var(--laser-cyan); margin-right: 4px; }
.eng-drawer[open] .eng-summary::before { content: "▾ "; }
.eng-drawer[open] .eng-summary { border-bottom: 1px solid var(--border); }
.eng-summary-hint { font-family: var(--font-mono); font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); }
.eng-body { display: flex; flex-direction: column; }

@media (max-width: 1040px) {
  .tri-views-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tri-pane-center { grid-column: 1 / -1; order: -1; border-left: none !important; border-bottom: 1px solid var(--border); }
  .tri-views-grid > .tri-pane-side:first-child { border-left: none !important; }
  .tri-pane-side { cursor: pointer; position: relative; }
  .tri-views-grid:has(.mobile-expanded) .tri-pane-side { grid-column: 1 / -1; border-left: none !important; border-top: 1px solid var(--border); }
  .tri-pane-side .pane-persp-tag::after { content: " · ⤢"; opacity: 0.78; }
  .tri-pane-side.mobile-expanded .pane-persp-tag::after { content: " · ⤡ Shrink"; }
}

@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .topbar { padding: 8px 10px; gap: 6px; }
  .main-wrap { padding: 8px 8px 24px; gap: 9px; }
  #btn-schematic { display: none; }
  .section-kicker { font-size: 0.64rem; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .roof-flip-grid { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .end-tab { padding: 8px 9px; border-radius: 10px; }
  .end-tab .hw-badge, .end-sub { display: none; }
  .end-tag { font-size: 0.6rem; padding: 1px 5px; }
  .sec-mini-chip { font-size: 0.62rem; padding: 1px 5px; }
  .end-tab-main { flex-direction: column; align-items: flex-start; gap: 1px; }
  .end-title { font-size: 0.84rem; line-height: 1.15; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .end-sig { font-size: 0.82rem; color: var(--laser-cyan); }
  .btn-flip-roof { padding: 6px 9px; min-width: 44px; border-radius: 10px; gap: 2px; }
  .flip-icon { font-size: 1.1rem; }
  .flip-txt { font-size: 0.62rem; font-weight: 800; }
  .mobile-row-filter {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px;
    padding: 3px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border);
  }
  .mob-filter-btn {
    min-height: 34px; padding: 4px 6px; border-radius: 7px; border: none; background: transparent;
    color: var(--text-muted); font-size: 0.72rem; font-weight: 800; cursor: pointer; touch-action: manipulation;
  }
  .mob-filter-btn.active { background: var(--accent-ui); color: #ffffff; }
  .roof-card-ribbon { padding: 7px 11px; gap: 6px; }
  .ribbon-badge, .ribbon-meta { font-size: 0.66rem; }
  .btn-promote-top { width: 100%; text-align: center; padding: 6px 10px; font-size: 0.72rem; }
  .steer-banner, .far-summary-banner { padding: 10px 11px; gap: 9px; }
  .steer-arrow-box { width: 40px; height: 40px; border-radius: 10px; font-size: 1.25rem; }
  .steer-headline { font-size: 0.98rem; line-height: 1.2; }
  .steer-detail { font-size: 0.77rem; line-height: 1.32; }
  .btn-laser-start { min-height: 44px; font-size: 0.88rem; padding: 8px 14px; }
  .far-sig-pill-box { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; padding: 6px 10px; min-width: 0; }
  .far-card-dbm { font-size: 0.96rem; }
  .tri-views-grid .tri-pane-center { padding: 10px 10px 8px; }
  .tri-views-grid .tri-pane-side { padding: 8px 7px 7px; }
  .tri-pane-side .pane-header { flex-direction: column; align-items: flex-start; gap: 3px; margin-bottom: 5px; }
  .tri-pane-side .pane-step { font-size: 0.58rem; }
  .tri-pane-side .pane-title { font-size: 0.78rem; line-height: 1.18; }
  .tri-pane-side .pane-persp-tag { font-size: 0.6rem; padding: 1px 6px; }
  .tri-pane-side .pane-caption { font-size: 0.68rem; line-height: 1.25; margin-top: 5px; }
  .signal-strip { padding: 10px 11px; gap: 9px; }
  .kpi-quad.kpi-trio { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px; }
  .kpi-box { padding: 7px 7px; }
  .kpi-label { font-size: 0.58rem; }
  .kpi-val { font-size: 0.96rem; }
  .kpi-sub { font-size: 0.62rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi-mini-btns { display: none; }
  .roof-card-bottom { margin-top: 10px; }
  .sector-inline-bar { padding: 9px 11px; }
}
/* =========================================================================
   GUIDED PING-PONG ALIGNMENT COACH (1-TECH & 2-TECH SYNCHRONIZED TURN LOCK)
   ========================================================================= */
.guided-card {
  margin: 0 0 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1.5px solid rgba(56, 189, 248, 0.34);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.guided-card.role-my_turn {
  border-color: rgba(16, 185, 129, 0.68);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.24), 0 14px 32px rgba(0, 0, 0, 0.34);
}

.guided-card.role-peer_turn {
  border: 2px solid #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.34), 0 14px 32px rgba(0, 0, 0, 0.34);
}

.guided-card.role-completed {
  border-color: rgba(16, 185, 129, 0.55);
}

html[data-theme="sun"] .guided-card {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  border-color: rgba(2, 132, 199, 0.42);
}

html[data-theme="sun"] .guided-card.role-my_turn {
  border-color: #059669;
}

html[data-theme="sun"] .guided-card.role-peer_turn {
  border-color: #d97706;
}

/* Idle Launcher Bar */
.guided-idle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}

.guided-idle-copy {
  min-width: 0;
  flex: 1;
}

.guided-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.guided-badge-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.38);
}

html[data-theme="sun"] .guided-badge-tag {
  background: #e0f2fe;
  color: #075985;
  border-color: #7dd3fc;
}

.guided-converged-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.44);
}

html[data-theme="sun"] .guided-converged-pill {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.guided-idle-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.guided-idle-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.35;
}

.guided-idle-cta {
  flex-shrink: 0;
}

.btn-guided-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: #38bdf8;
  color: #090d16;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.14s ease, transform 0.1s ease;
}

.btn-guided-launch:hover:not(:disabled) {
  filter: brightness(1.07);
}

.btn-guided-launch:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border-strong);
  cursor: not-allowed;
}

html[data-theme="sun"] .btn-guided-launch:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
  border-color: #0369a1;
}

/* Active / Completed Workspace */
.guided-active-wrap {
  display: flex;
  flex-direction: column;
}

.guided-top-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.guided-card.role-my_turn .guided-top-ribbon {
  background: rgba(16, 185, 129, 0.12);
}

.guided-card.role-peer_turn .guided-top-ribbon {
  background: rgba(245, 158, 11, 0.14);
}

html[data-theme="sun"] .guided-card.role-my_turn .guided-top-ribbon {
  background: #ecfdf5;
}

html[data-theme="sun"] .guided-card.role-peer_turn .guided-top-ribbon {
  background: #fffbeb;
}

.guided-ribbon-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.guided-role-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  background: #10b981;
  color: #051b14;
}

.guided-role-pill.wait {
  background: #f59e0b;
  color: #1f1300;
}

.guided-role-pill.done {
  background: #38bdf8;
  color: #061826;
}

.guided-round-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.guided-other-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-2);
}

.guided-ribbon-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.guided-mini-btn {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.guided-mini-btn:hover {
  background: var(--bg-subtle);
}

.guided-mini-finish.ready {
  background: #10b981;
  color: #051b14;
  border-color: #059669;
  font-weight: 800;
}

.guided-mini-muted {
  color: var(--text-2);
}

/* 3-Step Single-Axis Stepper */
.guided-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px 4px;
}

.guided-step-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.guided-step-tab .gstep-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--bg-subtle);
  color: var(--text);
  flex-shrink: 0;
}

.guided-step-tab.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  color: var(--text);
}

.guided-step-tab.active .gstep-num {
  background: #10b981;
  color: #051b14;
}

.guided-step-tab.done .gstep-num {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

html[data-theme="sun"] .guided-step-tab.active {
  background: #ecfdf5;
  border-color: #059669;
  color: #090d16;
}

html[data-theme="sun"] .guided-step-tab.done .gstep-num {
  background: #d1fae5;
  color: #065f46;
}

/* Shared AP Guardrail & Convergence Strips */
.guided-ap-guard {
  margin: 8px 14px 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.48);
  color: #fde68a;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

html[data-theme="sun"] .guided-ap-guard {
  background: #fffbeb;
  border-color: #d97706;
  color: #78350f;
}

.btn-guided-skip-ap {
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.65);
  background: #f59e0b;
  color: #1f1300;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.guided-converged-strip {
  margin: 8px 14px 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.48);
  color: #a7f3d0;
  font-size: 0.8rem;
}

html[data-theme="sun"] .guided-converged-strip {
  background: #ecfdf5;
  border-color: #059669;
  color: #065f46;
}

/* Main Coaching Instruction + Action Stack */
.guided-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

.guided-instruction-box {
  min-width: 0;
  flex: 1;
}

.guided-headline {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.24;
  color: var(--text);
}

.guided-card.role-peer_turn .guided-headline {
  color: #fde68a;
}

html[data-theme="sun"] .guided-card.role-peer_turn .guided-headline {
  color: #92400e;
}

.guided-detail {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.38;
}

.guided-action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  min-width: 235px;
}

.btn-guided-primary {
  min-height: 44px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: none;
  background: #10b981;
  color: #051b14;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.btn-guided-primary.wait-follow {
  background: #f59e0b;
  color: #1f1300;
}

.btn-guided-primary:hover {
  filter: brightness(1.06);
}

.btn-guided-secondary {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-guided-secondary:hover {
  background: var(--bg-subtle);
}

/* Before -> Now Proof Strip */
.guided-proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.gproof-cell {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gproof-label {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

html[data-theme="sun"] .gproof-label {
  color: #334155;
}

.gproof-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gproof-val.tone-good {
  color: #34d399;
}

.gproof-val.tone-warn {
  color: #fbbf24;
}

.gproof-val.tone-bad {
  color: #fb7185;
}

html[data-theme="sun"] .gproof-val.tone-good {
  color: #047857;
}

html[data-theme="sun"] .gproof-val.tone-warn {
  color: #b45309;
}

html[data-theme="sun"] .gproof-val.tone-bad {
  color: #be123c;
}

/* Shared Recorded Turns Log */
.guided-history-wrap {
  border-top: 1px solid var(--border);
  padding: 10px 14px 12px;
  background: rgba(9, 13, 22, 0.35);
}

html[data-theme="sun"] .guided-history-wrap {
  background: #f8fafc;
}

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

.guided-history-title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

html[data-theme="sun"] .guided-history-title {
  color: #334155;
}

.guided-history-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-2);
}

.guided-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.guided-history-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  flex-wrap: wrap;
}

.ghist-left {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.ghist-turn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text);
}

.ghist-roof {
  font-weight: 800;
  color: var(--text);
}

.ghist-summary {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-2);
}

.ghist-ts {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Mobile Responsive Optimization for Guided Coach */
@media (max-width: 900px) {
  .guided-idle-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  .btn-guided-launch {
    width: 100%;
  }
  .guided-top-ribbon {
    padding: 8px 11px;
    gap: 7px;
  }
  .guided-stepper {
    gap: 5px;
    padding: 8px 11px 2px;
  }
  .guided-step-tab {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 6px 7px;
    min-height: 44px;
    font-size: 0.69rem;
    line-height: 1.18;
  }
  .guided-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 11px;
  }
  .guided-headline {
    font-size: 0.96rem;
  }
  .guided-detail {
    font-size: 0.77rem;
  }
  .guided-action-stack {
    min-width: 0;
    width: 100%;
  }
  .guided-proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 0 11px 10px;
  }
  .gproof-cell {
    padding: 7px 8px;
  }
  .gproof-val {
    font-size: 0.76rem;
    white-space: normal;
    line-height: 1.2;
  }
  .guided-history-wrap {
    padding: 8px 11px 10px;
  }
}

/* --- Durable SQLite Storage Pill & Saved Alignment Receipts Drawer (v6.7) --- */
.guided-storage-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: #6ee7b7;
}

html[data-theme="sun"] .guided-storage-pill {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.guided-idle-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.guided-receipts-drawer {
  border-top: 1px solid var(--border);
  padding: 12px 16px 14px;
  background: rgba(2, 6, 23, 0.38);
}

html[data-theme="sun"] .guided-receipts-drawer {
  background: #f8fafc;
}

.guided-receipts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.guided-receipts-head-left,
.guided-receipts-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.guided-receipts-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.guided-receipts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.guided-receipt-card {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.greceipt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.greceipt-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.greceipt-ts {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--laser-cyan);
}

.greceipt-summary {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.greceipt-turns {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 4px;
  border-left: 2px solid rgba(56, 189, 248, 0.35);
}

.greceipt-del-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px 7px;
  cursor: pointer;
}

.greceipt-del-btn:hover {
  border-color: #f43f5e;
  color: #fda4af;
}

html[data-theme="sun"] .greceipt-del-btn:hover {
  color: #be123c;
}

@media (max-width: 760px) {
  .guided-idle-cta {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .guided-receipts-drawer {
    padding: 10px 11px 12px;
  }
}

/* =========================================================================
   INTERACTIVE BOLT SIMULATOR & GUIDED SPOTLIGHT TOUR (WAVE ALIGN DEMO)
   ========================================================================= */

.tool-btn-tour {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-weight: 800;
}

.tool-btn-tour:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: #38bdf8;
}

html[data-theme="sun"] .tool-btn-tour {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

.demo-sim-card {
  background: linear-gradient(180deg, rgba(14, 24, 42, 0.96) 0%, rgba(10, 17, 30, 0.96) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.38);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);
}

html[data-theme="sun"] .demo-sim-card {
  background: #f0f9ff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

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

.demo-sim-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-sim-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

html[data-theme="sun"] .demo-sim-kicker {
  background: #bae6fd;
  border-color: #0284c7;
  color: #0c4a6e;
}

.demo-sim-roof-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
}

.demo-sim-live-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.demo-sim-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sim-preset-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.sim-preset-btn:hover {
  border-color: #38bdf8;
}

.sim-preset-ok {
  border-color: rgba(34, 197, 94, 0.48);
  color: #86efac;
}

html[data-theme="sun"] .sim-preset-ok {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

.sim-preset-warn {
  border-color: rgba(245, 158, 11, 0.48);
  color: #fcd34d;
}

html[data-theme="sun"] .sim-preset-warn {
  background: #fef3c7;
  border-color: #d97706;
  color: #78350f;
}

.demo-sim-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.demo-sim-axis {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
}

html[data-theme="sun"] .demo-sim-axis {
  background: #ffffff;
}

.demo-sim-axis-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.demo-sim-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-2);
}

.demo-sim-readout {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
}

html[data-theme="sun"] .demo-sim-readout {
  color: #0369a1;
}

.demo-sim-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-nudge-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  min-height: 34px;
}

.sim-nudge-btn:hover {
  border-color: #38bdf8;
}

.sim-range {
  flex: 1;
  min-width: 80px;
  accent-color: #38bdf8;
  cursor: pointer;
  height: 24px;
}

/* Guided Spotlight Tour Overlay */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  pointer-events: none;
}

.tour-spotlight {
  position: fixed;
  border-radius: 12px;
  border: 2.5px solid #38bdf8;
  box-shadow:
    0 0 0 9999px rgba(3, 8, 18, 0.72),
    0 0 24px rgba(56, 189, 248, 0.55);
  transition: top 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              left 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

html[data-theme="sun"] .tour-spotlight {
  border-color: #0284c7;
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.52),
    0 0 24px rgba(2, 132, 199, 0.45);
}

.tour-popover {
  position: fixed;
  z-index: 9810;
  width: min(390px, calc(100vw - 24px));
  background: #0d1628;
  border: 1.5px solid #38bdf8;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
  color: #f8fafc;
  pointer-events: auto;
  transition: top 0.22s ease, left 0.22s ease;
}

html[data-theme="sun"] .tour-popover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0f172a;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.28);
}

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

.tour-step-badge {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
}

html[data-theme="sun"] .tour-step-badge {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #0284c7;
}

.tour-skip-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #94a3b8;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.tour-skip-btn:hover {
  color: #f8fafc;
  border-color: #94a3b8;
}

html[data-theme="sun"] .tour-skip-btn {
  color: #475569;
}

.tour-title {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
}

.tour-body {
  margin: 0 0 11px;
  font-size: 0.82rem;
  line-height: 1.48;
  color: #cbd5e1;
}

html[data-theme="sun"] .tour-body {
  color: #334155;
}

.tour-action-wrap {
  margin-bottom: 11px;
}

.tour-try-btn {
  width: 100%;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: #86efac;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.tour-try-btn:hover {
  background: rgba(34, 197, 94, 0.28);
}

html[data-theme="sun"] .tour-try-btn {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

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

.tour-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.38);
  padding: 0;
  cursor: pointer;
}

.tour-dot.active {
  width: 20px;
  background: #38bdf8;
}

html[data-theme="sun"] .tour-dot.active {
  background: #0284c7;
}

.tour-nav-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tour-nav-btn {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

html[data-theme="sun"] .tour-nav-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.tour-nav-primary {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #04111f;
}

html[data-theme="sun"] .tour-nav-primary {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

@media (max-width: 820px) {
  .demo-sim-body {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .demo-sim-presets {
    width: 100%;
  }
  .sim-preset-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .sim-nudge-btn {
    min-height: 40px;
    padding: 7px 11px;
  }
}


