:root {
    --bg: #070a12;
    --surface: #0f172a;
    --surface-2: #0a1020;
    --border: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --emerald: #10b981;
    --blue: #3b82f6;
    --cyan: #06b6d4;
    --amber: #f59e0b;
    --red: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at top center, #0e1a32 0%, var(--bg) 55%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.85em;
    color: #7dd3fc;
}

.sl-shell {
    padding: 18px 16px 64px;
}

.sl-container {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Boot splash */
.sl-boot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 24px;
}

.sl-boot-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid #1e293b;
    border-top-color: var(--emerald);
    animation: spin 0.8s linear infinite;
}

.sl-boot-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.sl-boot-sub {
    font-size: 0.9rem;
    color: var(--muted);
}

.sl-boot-sub a {
    color: #6ee7b7;
    font-weight: 700;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#blazor-error-ui {
    background: #450a0a;
    color: #fecaca;
    bottom: 0;
    display: none;
    left: 0;
    padding: 10px 16px;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* Top bar */
.sl-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.sl-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sl-brand-btn {
    background: none;
    border: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
}

.sl-badge-dev {
    background: rgba(6, 182, 212, 0.14);
    border: 1px solid rgba(6, 182, 212, 0.45);
    color: #67e8f9;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.04em;
}

.sl-badge-live {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
}

.sl-badge-kill {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
}

.sl-room-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sl-room-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
}

.sl-room-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sl-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.sl-chip:hover {
    border-color: var(--cyan);
    color: #fff;
}

.chip-active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--emerald);
    color: #6ee7b7;
}

/* Pipeline Flowchart */
.pipeline-strip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pipeline-strip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pipeline-strip-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 800;
}

.room-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: #93c5fd;
    font-size: 0.76rem;
    padding: 2px 8px;
    border-radius: 999px;
}

.pipeline-strip-hint {
    font-size: 0.78rem;
    color: var(--muted);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-green { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.dot-amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot-red { background: var(--red); box-shadow: 0 0 8px var(--red); }

.pipeline-nodes {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.pipeline-node {
    flex: 1 1 155px;
    min-width: 145px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.pipeline-node:disabled {
    cursor: default;
}

.pipeline-node:not(:disabled):hover {
    transform: translateY(-1px);
    border-color: var(--cyan);
}

.node-ready { border-color: rgba(16, 185, 129, 0.7); }
.node-checking { border-color: rgba(6, 182, 212, 0.75); }
.node-warning { border-color: rgba(245, 158, 11, 0.7); }
.node-failed { border-color: rgba(239, 68, 68, 0.85); }
.node-active { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45); }

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

.node-step {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.node-ready .node-step { background: #065f46; color: #6ee7b7; }
.node-warning .node-step { background: #78350f; color: #fde68a; }
.node-failed .node-step { background: #7f1d1d; color: #fecaca; }

.node-metric {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, monospace;
}

.node-title {
    font-size: 0.88rem;
    font-weight: 800;
}

.node-sub {
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-arrow {
    color: #475569;
    font-weight: 800;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* Hero & Role Grid */
.sl-hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sl-hero-eyebrow {
    font-size: 0.82rem;
    font-weight: 800;
    color: #6ee7b7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sl-hero h1 {
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 900;
    line-height: 1.15;
}

.sl-hero-sub {
    color: var(--muted);
    max-width: 760px;
    font-size: 1rem;
}

.sl-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.sl-role-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.14s ease, border-color 0.14s ease;
}

.sl-role-card:hover { transform: translateY(-2px); }
.role-emerald:hover { border-color: var(--emerald); }
.role-blue:hover { border-color: var(--blue); }
.role-cyan:hover { border-color: var(--cyan); }
.role-amber:hover { border-color: var(--amber); }

.role-icon { font-size: 1.9rem; }

.role-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #93c5fd;
}

.sl-role-card h2 {
    font-size: 1.15rem;
    font-weight: 800;
}

.sl-role-card p {
    font-size: 0.88rem;
    color: var(--muted);
    flex: 1;
}

.role-cta {
    font-size: 0.86rem;
    font-weight: 800;
    color: #6ee7b7;
}

.sl-telemetry-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

.tele-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tele-label {
    font-size: 0.74rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
}

.tele-val {
    font-size: 0.92rem;
    font-weight: 700;
}

/* Panels & Steps */
.sl-crumb-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sl-crumb-title {
    font-size: 1.05rem;
    font-weight: 800;
}

.sl-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.panel-desc {
    color: var(--muted);
    font-size: 0.93rem;
}

.status-pill {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
}

.pill-green { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.45); }
.pill-amber { background: rgba(245, 158, 11, 0.16); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.45); }

.booth-step-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.step-tab {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 9px;
    cursor: pointer;
}

.tab-active {
    background: rgba(59, 130, 246, 0.18);
    border-color: var(--blue);
    color: #fff;
}

.step-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.sl-input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 0.92rem;
    max-width: 440px;
}

.sl-input-sm {
    padding: 6px 10px;
    width: 120px;
    font-size: 0.85rem;
}

/* Buttons */
.sl-btn-primary,
.sl-btn-secondary,
.sl-btn-danger,
.sl-btn-ghost {
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.sl-btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    border-color: rgba(110, 231, 183, 0.4);
}

.sl-btn-lg {
    padding: 14px 22px;
    font-size: 1rem;
}

.sl-btn-secondary {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}

.sl-btn-danger {
    background: #991b1b;
    color: #fff;
    border-color: #ef4444;
}

.sl-btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}

.sl-btn-ghost:hover { color: #fff; }

/* Language grid */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.lang-btn {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.lang-active {
    border-color: var(--emerald);
    background: rgba(16, 185, 129, 0.14);
}

.lang-flag { font-size: 1.35rem; }
.lang-native { font-weight: 800; font-size: 0.95rem; }
.lang-eng { font-size: 0.78rem; color: var(--muted); }

/* Launch box */
.launch-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.launch-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 4px;
}

.launch-url {
    display: inline-block;
    word-break: break-all;
}

/* Alerts */
.alert-box {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.9rem;
}

.alert-green { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.45); color: #d1fae5; }
.alert-amber { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.45); color: #fef3c7; }
.alert-red { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.5); color: #fee2e2; }

.feedback-line {
    font-size: 0.9rem;
    font-weight: 700;
    color: #93c5fd;
}

/* VU Meter */
.vu-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vu-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.vu-track {
    position: relative;
    height: 16px;
    background: #1e293b;
    border-radius: 999px;
    overflow: hidden;
}

.vu-fill {
    height: 100%;
    background: var(--amber);
    transition: width 0.06s linear;
}

.vu-hot {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.vu-gate-marker {
    position: absolute;
    left: 10%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    opacity: 0.8;
}

.vu-status { font-size: 0.86rem; font-weight: 700; }
.text-emerald { color: #6ee7b7; }
.text-amber { color: #fde68a; }
.text-muted { color: var(--muted); }

/* Specs & Handoff */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

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

.spec-box span { font-size: 0.74rem; color: var(--muted); font-weight: 700; }
.spec-box strong { font-size: 0.95rem; }

.checklist-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.check-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
}

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

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

.obs-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

/* QR Station */
.qr-layout {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 18px;
    align-items: start;
}

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

.qr-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qr-preview-card {
    background: #ffffff;
    color: #0f172a;
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.qr-card-title { font-size: 1.2rem; font-weight: 900; }
.qr-card-sub { font-size: 0.92rem; color: #334155; }

.qr-svg-wrap svg {
    width: 220px;
    height: 220px;
    display: block;
}

.qr-mini svg {
    width: 130px;
    height: 130px;
    background: #fff;
    padding: 6px;
    border-radius: 8px;
}

.qr-url {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    word-break: break-all;
}

@media print {
    body { background: #fff; color: #000; }
    .no-print, .pipeline-strip, .sl-crumb-row { display: none !important; }
    .sl-panel { border: none; background: #fff; padding: 0; }
    .qr-layout { display: block; }
    .qr-preview-card { border: 2px solid #0f172a; max-width: 420px; margin: 24px auto; }
}
