:root {
    --bg-color: #0b0f1a;
    --accent-color: #ff3e3e;
    --text-color: #ffffff;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --card-bg: rgba(30, 41, 59, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --safe-area: 40px;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --blur: blur(20px);
    --border-radius: 16px;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Navigation — old top nav hidden */
nav {
    display: none !important;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-color);
    display: inline-block;
    animation: brand-float 3.3s ease-in-out infinite;
}

@keyframes brand-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* ─── LEFT SIDEBAR ─── */
#left-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: rgba(10, 15, 28, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── MOBILE SIDEBAR TOGGLE ─── */
#sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2001;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 15, 28, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    padding: 0;
    line-height: 1;
}

#sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.wizard-cta:active {
    transform: scale(0.98);
}

/* ─── DASHBOARD ONBOARDING ─── */
.dash-onboard-progress-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
    display: none;
    /* Shown if onboarding not completed */
}

.dash-onboard-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.dash-onboard-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.dash-onboard-step:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}

.dash-onboard-step.completed {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.dash-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dash-onboard-step.completed .dash-check {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.dash-onboard-step.completed .dash-check::after {
    content: '✓';
}

/* ─── SIDEBAR BACKDROP ─── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

#left-sidebar .sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

#left-sidebar .sidebar-brand span {
    color: var(--accent-color);
}

#left-sidebar .sidebar-section {
    padding: 16px 0 4px;
}

#left-sidebar .sidebar-section-label {
    padding: 0 18px 8px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
}

#left-sidebar .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    margin: 1px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}

#left-sidebar .sidebar-nav-item:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

#left-sidebar .sidebar-nav-item:hover .sidebar-icon {
    transform: scale(1.15);
    transition: transform 0.2s ease;
}

#left-sidebar .sidebar-nav-item.active {
    color: #fff;
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(255, 62, 62, 0.25);
    font-weight: 700;
}

#left-sidebar .sidebar-nav-item.active:hover {
    transform: none;
}

#left-sidebar .sidebar-nav-item .sidebar-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

#left-sidebar .sidebar-spacer {
    flex: 1;
}

#left-sidebar .sidebar-footer {
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#left-sidebar .sidebar-footer .sidebar-usage {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 0 12px;
    font-size: 11px;
}

#left-sidebar .sidebar-footer .sidebar-usage .usage-icon {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}

#left-sidebar .sidebar-footer .sidebar-usage .usage-bar-track {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

#left-sidebar .sidebar-footer .sidebar-usage .usage-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 2px;
    transition: width 0.4s ease;
}

#left-sidebar .sidebar-footer .sidebar-usage .usage-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
    min-width: 24px;
    text-align: right;
}

#left-sidebar .sidebar-upgrade-btn {
    display: none;
    width: 100%;
    padding: 9px 0;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    color: rgba(165, 180, 252, 0.9);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: none;
    margin-bottom: 12px;
}

#left-sidebar .sidebar-upgrade-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    transform: translateY(-1px);
}

#left-sidebar .sidebar-tunnel {
    display: none;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
    word-break: break-all;
    line-height: 1.5;
}

#left-sidebar .sidebar-user {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
}

#left-sidebar .sidebar-user .user-email {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}

#left-sidebar .sidebar-user .user-plan-badge {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.25);
}

#left-sidebar .sidebar-user .logout-btn {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#left-sidebar .sidebar-user .logout-btn:hover {
    background: rgba(255, 62, 62, 0.2);
}

/* Push view-container right to make room for sidebar */
#view-container {
    margin-left: 220px;
}

/* ─── OLD NAV ITEMS (kept for JS compat but hidden) ─── */
.nav-links {
    display: none;
}

.nav-item {
    display: none;
}

/* --- ACCOUNT VIEW STYLES --- */
#account-view {
    padding: 60px var(--safe-area);
    display: none;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(255, 62, 62, 0.05) 0%, transparent 40%);
}

#account-view.active {
    display: flex;
}

.account-card {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.account-header {
    text-align: left;
}

.account-header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
}

.account-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 20px;
}

.info-label {
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.info-value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
}

/* --- RECORDINGS VIEW STYLES --- */
#recordings-view {
    padding: 40px var(--safe-area);
    box-sizing: border-box;
    overflow-y: auto;
}

.recordings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.recordings-table th,
.recordings-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

/* --- AUTH OVERLAY --- */
#auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1e293b 0%, #0b0f1a 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    padding: 48px 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    animation: card-entry 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes card-entry {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.2);
    background: #f8fafc;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #8b949e;
    font-size: 11px;
    font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider:not(:empty)::before {
    margin-right: 15px;
}

.auth-divider:not(:empty)::after {
    margin-left: 15px;
}

.auth-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
    font-size: 14px;
}

.auth-toggle {
    margin-top: 15px;
    font-size: 12px;
    color: #8b949e;
}

.auth-toggle span {
    color: var(--accent-color);
    cursor: pointer;
    font-weight: bold;
}

/* Debug tools: hidden unless ?debug=1 */
.debug-only {
    display: none !important;
}

body.debug-mode .debug-only {
    display: block !important;
}

/* ═══ WELCOME WIZARD ═══ */
#welcome-wizard {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, #1a1f3a 0%, #0b0f1a 70%);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}

#welcome-wizard.active {
    display: flex;
}

.wizard-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 48px 44px 40px;
    max-width: 720px;
    width: 92%;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
    animation: card-entry 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
}

/* Progress dots */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 36px;
}

.wizard-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.12);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.wizard-dot.completed {
    background: #6366f1;
    border-color: #6366f1;
}

.wizard-dot.completed::after {
    content: '✓';
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-dot.active {
    background: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
    transform: scale(1.15);
}

.wizard-line {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.4s ease;
}

.wizard-line.completed {
    background: #6366f1;
}

/* Step panels */
.wizard-step {
    display: none;
    animation: wizardFadeIn 0.4s ease;
}

.wizard-step.active {
    display: block;
}

@keyframes wizardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -1px;
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.2;
}

.wizard-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Value props (Step 1) */
.wizard-features {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
}

.wizard-feature {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.wizard-feature:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.wizard-feature-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.wizard-feature-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.wizard-feature-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* Plan cards (Step 2) */
.wizard-plans {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 28px;
}

.wizard-plan {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.wizard-plan:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.wizard-plan.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.15);
}

.wizard-plan.recommended::before {
    content: 'POPULAR';
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: #6366f1;
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 6px;
    letter-spacing: 0.08em;
}

.wizard-plan-name {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.wizard-plan-price {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -1px;
}

.wizard-plan-price span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.wizard-plan-features {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    line-height: 1.5;
}

.wizard-plan-feature-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    text-align: left;
}

.wizard-plan-feature-list li {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wizard-plan-feature-list li::before {
    content: '✓';
    color: #10b981;
    font-size: 9px;
    font-weight: 900;
}

.wizard-trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 24px;
}

/* Timeline (Step 3) */
.wizard-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 28px;
    padding-left: 20px;
    position: relative;
}

.wizard-timeline::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: rgba(255, 255, 255, 0.06);
}

.wizard-timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    position: relative;
}

.wizard-timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    z-index: 1;
}

.wizard-timeline-step.now .wizard-timeline-icon {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.wizard-timeline-step.future .wizard-timeline-icon {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
}

.wizard-timeline-title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 2px;
}

.wizard-timeline-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

/* Cancel note */
.wizard-cancel-note {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.wizard-cancel-note-title {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
}

.wizard-cancel-note-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

/* CTA button */
.wizard-cta {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    letter-spacing: -0.2px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.3);
}

.wizard-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(99, 102, 241, 0.4);
}

.wizard-skip {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
}

.wizard-skip:hover {
    color: rgba(255, 255, 255, 0.5);
}

.recordings-table td {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.recordings-table th {
    font-size: 11px;
    text-transform: uppercase;
    color: #8b949e;
    letter-spacing: 1px;
}

.recordings-table tr:last-child td {
    border-bottom: none;
}

.recordings-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* View Container */
#view-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    /* Prevent Safari WebRTC capture suspension by avoiding display:none */
    position: absolute;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
    overflow: hidden;
}

.view.active {
    position: relative;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    height: 100%;
    width: 100%;
    /* display property (flex/block) is applied via JS inline style */
}

/* --- SINGLE MONITOR STYLES --- */
#single-monitor-view {
    background: #000;
}

.monitor-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the professional monitor space */
}

.monitor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    padding: var(--safe-area);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.monitor-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.audio-meters {
    display: flex;
    gap: 4px;
    height: 120px;
    background: #0a0f19;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.meter-bar {
    width: 14px;
    height: 100%;
    background: #000;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.meter-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top,
            #2ecc71 0%,
            #2ecc71 60%,
            #f1c40f 60%,
            #f1c40f 85%,
            #e74c3c 85%,
            #e74c3c 100%);
    mask-image: repeating-linear-gradient(to top,
            #000 0px,
            #000 2px,
            transparent 2px,
            transparent 3px);
    -webkit-mask-image: repeating-linear-gradient(to top,
            #000 0px,
            #000 2px,
            transparent 2px,
            transparent 3px);
    transition: height 0.05s linear;
}

.stream-meta {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    min-width: 280px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.monitor-path-input {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    width: 120px;
    pointer-events: all;
}

/* --- MULTIVIEW GRID STYLES --- */
#director-view {
    padding: 20px;
    box-sizing: border-box;
    /* Removed display: none; inheriting .view Absolute visibility hidden logic */
    flex-direction: column;
    height: 100%;
}

#director-view.active {
    display: flex;
    position: relative;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.grid-container {
    display: grid;
    /* grid-template-columns set via JS */
    gap: 15px;
    aspect-ratio: 16 / 9;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #000;
    border-radius: 12px;
}

/* Spotlight mode for single guest */
.grid-container.single-source {
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-container.single-source .source-box {
    max-width: min(100%, 1000px);
    max-height: 80vh;
    width: 100%;
    margin: 0 auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .source-box {
        min-height: 250px;
    }

    #billing-plan-strip {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #billing-details-section .grid-container,
    #billing-details-section>div:nth-child(2) {
        grid-template-columns: 1fr !important;
    }

    #billing-plan-card {
        padding: 20px !important;
    }

    #billing-primary-cta {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    #billing-plan-strip {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    #billing-plan-strip .plan-strip-card {
        padding: 10px 8px !important;
    }

    #billing-feature-badges {
        gap: 4px !important;
    }

    #billing-usage-section,
    #billing-details-section {
        padding: 16px !important;
    }

    #upgrade-banner>div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
}

.source-box {
    display: none;
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: box-entry 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes box-entry {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.source-box:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.source-box.visible {
    display: flex;
}

.source-box video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the container like Zoom */
    background: #000;
    z-index: 5;
}

.source-box.connected {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 62, 62, 0.3);
}

.conn-status {
    font-size: 9px;
    color: #8b949e;
    text-transform: uppercase;
    font-weight: 800;
}

.source-name-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 4px;
    z-index: 6;
    pointer-events: none;
    text-align: center;
    width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    z-index: 20;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.source-label input {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: inherit;
}

.grid-header-tools {
    display: none;
}

/* ─── DIRECTOR VIEW TOP HEADER ─── */
.director-header {
    display: none;
    /* shown by JS when streams connect */
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 12px;
    z-index: 30;
    flex-shrink: 0;
}

.director-header .dh-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.director-header .dh-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    margin-right: 4px;
    white-space: nowrap;
}

.director-header .dh-btn {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.director-header .dh-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
}

.director-header .dh-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 62, 62, 0.25);
}

.director-header .dh-btn.accent-blue {
    border-color: rgba(96, 165, 250, 0.25);
    color: #60a5fa;
}

.director-header .dh-btn.accent-blue:hover {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.4);
}

.director-header .dh-btn.accent-green {
    border-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.director-header .dh-btn.accent-green:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.35);
}

.director-header .dh-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0 4px;
}

.director-header .dh-btn.subtle {
    border-color: transparent;
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
}

.director-header .dh-btn.subtle:hover {
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

/* --- DYNAMIC LAYOUTS --- */
.grid-container.solo {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.grid-container.solo .source-box:not(#box-v1) {
    display: none;
}

.grid-container.dual {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.grid-container.dual .source-box:not(#box-v1):not(#box-v2) {
    display: none;
}

.grid-container.pip {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.grid-container.pip #box-v2 {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 30%;
    height: 30%;
    z-index: 50;
    border: 2px solid var(--accent-color);
}

.grid-container.pip .source-box:not(#box-v1):not(#box-v2) {
    display: none;
}

/* Triple Box: 3 sources in a row */
.grid-container.triple {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
}

.grid-container.triple .source-box:not(#box-v1):not(#box-v2):not(#box-v3) {
    display: none;
}

/* L-Bar: Main source with sidebar */
.grid-container.lbar {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.grid-container.lbar #box-v1 {
    grid-row: 1 / 3;
}

.grid-container.lbar .source-box:not(#box-v1):not(#box-v2):not(#box-v3) {
    display: none;
}

/* ─── Scene Transition Animations ─── */
.grid-container {
    transition: opacity var(--transition-duration, 0ms) ease,
        transform var(--transition-duration, 0ms) ease;
}

/* Dissolve */
.scene-transition-dissolve.scene-animating-out {
    opacity: 0;
}

.scene-transition-dissolve.scene-animating-in {
    animation: scene-fade-in var(--transition-duration, 300ms) ease forwards;
}

/* Wipe Left */
.scene-transition-wipeLeft.scene-animating-out {
    animation: scene-wipe-left-out var(--transition-duration, 250ms) ease forwards;
}

.scene-transition-wipeLeft.scene-animating-in {
    animation: scene-wipe-left-in var(--transition-duration, 250ms) ease forwards;
}

/* Wipe Right */
.scene-transition-wipeRight.scene-animating-out {
    animation: scene-wipe-right-out var(--transition-duration, 250ms) ease forwards;
}

.scene-transition-wipeRight.scene-animating-in {
    animation: scene-wipe-right-in var(--transition-duration, 250ms) ease forwards;
}

/* Slide Up */
.scene-transition-slideUp.scene-animating-out {
    animation: scene-slide-up-out var(--transition-duration, 200ms) ease forwards;
}

.scene-transition-slideUp.scene-animating-in {
    animation: scene-slide-up-in var(--transition-duration, 200ms) ease forwards;
}

/* Slide Down */
.scene-transition-slideDown.scene-animating-out {
    animation: scene-slide-down-out var(--transition-duration, 200ms) ease forwards;
}

.scene-transition-slideDown.scene-animating-in {
    animation: scene-slide-down-in var(--transition-duration, 200ms) ease forwards;
}

/* Zoom */
.scene-transition-zoom.scene-animating-out {
    animation: scene-zoom-out var(--transition-duration, 250ms) ease forwards;
}

.scene-transition-zoom.scene-animating-in {
    animation: scene-zoom-in var(--transition-duration, 250ms) ease forwards;
}

@keyframes scene-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scene-wipe-left-out {
    from {
        clip-path: inset(0 0 0 0);
    }

    to {
        clip-path: inset(0 0 0 100%);
    }
}

@keyframes scene-wipe-left-in {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes scene-wipe-right-out {
    from {
        clip-path: inset(0 0 0 0);
    }

    to {
        clip-path: inset(0 100% 0 0);
    }
}

@keyframes scene-wipe-right-in {
    from {
        clip-path: inset(0 0 0 100%);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes scene-slide-up-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-40px);
        opacity: 0;
    }
}

@keyframes scene-slide-up-in {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scene-slide-down-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(40px);
        opacity: 0;
    }
}

@keyframes scene-slide-down-in {
    from {
        transform: translateY(-40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scene-zoom-out {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.85);
        opacity: 0;
    }
}

@keyframes scene-zoom-in {
    from {
        transform: scale(1.15);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.layout-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.layout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.layout-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(255, 62, 62, 0.3);
}

.no-signal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 26, 0.6);
    backdrop-filter: blur(5px);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 3px;
    z-index: 4;
    pointer-events: none;
    text-transform: uppercase;
}

.no-signal::before {
    content: "📡";
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* --- AUDIO MIXER CHANNEL STRIP (OBS STYLE) --- */
.mixer-meters-section {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 10px 4px;
    height: 100%;
    background: #111;
    /* Darker background for meters */
    box-sizing: border-box;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.meter-bar-container {
    position: relative;
    width: 8px;
    /* Slightly wider for better visibility */
    height: 100%;
    background: #000;
    border-radius: 1px;
    overflow: hidden;
}

.meter-bar-grid {
    position: absolute;
    bottom: 0;
    width: 100%;
    /* Segmented Look using repeating-linear-gradient */
    background: linear-gradient(to top,
            #2ecc71 0%,
            /* Green - Low */
            #2ecc71 60%,
            #f1c40f 60%,
            /* Yellow - Mid */
            #f1c40f 85%,
            #e74c3c 85%,
            /* Red - High */
            #e74c3c 100%);
    mask-image: repeating-linear-gradient(to top,
            #000 0px,
            #000 2px,
            transparent 2px,
            transparent 3px);
    /* 1px gaps between 2px segments */
    -webkit-mask-image: repeating-linear-gradient(to top,
            #000 0px,
            #000 2px,
            transparent 2px,
            transparent 3px);
    height: 0%;
    transition: height 0.05s linear;
}

.peak-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #fff;
    box-shadow: 0 0 5px #fff;
    opacity: 0.8;
    pointer-events: none;
    transition: bottom 0.1s linear, opacity 0.3s ease;
}

/* --- MIXER STYLES --- */
.vertical-slider-container {
    position: absolute;
    right: 8px;
    bottom: 40px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    z-index: 25;
    background: rgba(10, 15, 25, 0.9);
    padding: 0;
    border-radius: 8px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 130px;
    /* Slightly taller */
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.mixer-fader-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    gap: 6px;
    min-width: 32px;
}

.mixer-meters-section {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 10px 6px 10px 0;
    height: 100%;
    box-sizing: border-box;
}

.vertical-slider-container .vol-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 12px;
    flex: 1;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.vertical-slider-container .vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.mute-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.mute-btn.active {
    color: #ff3e3e;
}

.rec-dot {
    width: 10px;
    height: 10px;
    background: #444;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.rec-dot.active {
    background: #ff3e3e;
    box-shadow: 0 0 8px #ff3e3e;
}

/* --- ELITE MODAL --- */
.elite-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.elite-modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.elite-modal-card h3 {
    margin-top: 0;
    color: var(--accent-color);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.elite-modal-card p {
    color: #8b949e;
    font-size: 12px;
    margin-bottom: 25px;
}

.link-group {
    margin-bottom: 20px;
}

.link-group label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #8b949e;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.copy-box {
    display: flex;
    gap: 10px;
    background: #0d1117;
    border: 1px solid var(--border-color);
    padding: 5px;
    border-radius: 8px;
}

.copy-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    font-size: 11px;
    font-family: monospace;
    outline: none;
}

.copy-btn {
    background: #21262d;
    border: 1px solid var(--border-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #30363d;
}

.elite-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.elite-icon-btn:hover {
    opacity: 1;
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    min-width: 250px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: toast-in 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.toast.success {
    border-left: 4px solid #2ea043;
}

.toast.error {
    border-left: 4px solid #ff3e3e;
}

.toast.info {
    border-left: 4px solid #3498db;
}

@keyframes toast-in {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast-out {
    animation: toast-out 0.3s forwards ease-in;
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(20px);
        opacity: 0;
    }
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent-color);
    width: 100%;
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* --- TALLY & NOTIFICATIONS --- */
/* --- AUTH OVERLAY --- */
#auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d1117;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.auth-card {
    background: #161b22;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@keyframes upgradePulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 28px rgba(99, 102, 241, 0.5);
    }
}

/* --- PORTAL STYLES --- */
#portal-view {
    padding: 40px var(--safe-area);
    box-sizing: border-box;
    overflow-y: auto;
}

.portal-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cam-id {
    background: var(--accent-color);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.url-box {
    background: #0d1117;
    padding: 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 11px;
    word-break: break-all;
    border: 1px solid var(--border-color);
    color: #8b949e;
}

.qr-area {
    background: white;
    padding: 10px;
    border-radius: 8px;
    align-self: center;
    display: flex;
    justify-content: center;
}

label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    color: #8b949e;
}

/* TELEMETRY STYLES */
.stats-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 10px;
    color: #00ff00;
    pointer-events: none;
    z-index: 20;
    display: none;
    border: 1px solid rgba(0, 255, 0, 0.2);
    min-width: 120px;
}

.stats-overlay.active {
    display: block;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 2px;
}

.stats-val {
    color: white;
    font-weight: bold;
}

/* Shared UI Elements */
.btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 12px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.text-input {
    background: #0d1117;
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
}

.control-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-color);
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    pointer-events: all;
    z-index: 500;
    box-shadow: 0 10px 30px rgba(255, 62, 62, 0.4);
}

.pulse-highlight {
    animation: input-pulse 0.5s ease-out;
}

@keyframes input-pulse {
    0% {
        border-color: var(--accent-color);
        box-shadow: 0 0 15px var(--accent-color);
    }

    100% {
        border-color: var(--border-color);
        box-shadow: none;
    }
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    :root {
        --safe-area: 15px;
    }

    /* ─── COLLAPSIBLE SIDEBAR (MOBILE) ─── */
    #sidebar-toggle {
        display: flex;
    }

    .sidebar-backdrop {
        display: block;
    }

    #left-sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
    }

    #left-sidebar.open {
        transform: translateX(0);
    }

    #view-container {
        margin-left: 0 !important;
        width: 100% !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .view.active {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: auto;
        min-height: 100%;
    }

    nav {
        flex-direction: column;
        gap: 12px;
        padding: 15px var(--safe-area);
        padding-top: 60px;
        /* Room for hamburger */
        height: auto;
        text-align: center;
        align-items: center;
    }

    #user-info {
        width: auto;
        justify-content: center;
        padding: 6px 12px;
        font-size: 11px !important;
        border-radius: 10px;
    }


    .nav-links {
        width: 100vw;
        margin-left: calc(-1 * var(--safe-area));
        margin-right: calc(-1 * var(--safe-area));
        overflow-x: auto;
        padding: 10px var(--safe-area);
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-item {
        white-space: nowrap;
        padding: 8px 15px;
        font-size: 12px;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.03);
    }

    .status-container {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
    }

    #active-list,
    #tunnel-info {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
        word-break: break-all;
        font-size: 11px;
    }

    .badge {
        font-size: 11px;
        padding: 6px 12px;
    }

    #stats-toggle {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        width: 88%;
        max-width: none;
    }

    .logo {
        font-size: 18px;
    }

    .auth-btn {
        padding: 10px 16px;
        font-size: 12px !important;
    }

    .auth-input {
        padding: 10px;
        font-size: 13px;
    }

    #portal-view h1,
    #director-view h1,
    #recordings-view h1 {
        font-size: 20px;
    }

    #user-info {
        flex-direction: column;
        gap: 5px;
    }

    .monitor-overlay {
        padding: 15px;
    }

    .monitor-overlay>div:first-child {
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 5px !important;
    }

    #stream-name {
        font-size: 20px !important;
    }

    #stream-info {
        font-size: 11px !important;
    }

    .audio-meters {
        height: 80px;
        gap: 3px;
        padding: 6px;
    }

    .vol-slider {
        width: 80px !important;
    }

    .mixer-group {
        gap: 10px;
    }

    .mixer-group .mute-btn {
        font-size: 14px !important;
    }

    .monitor-path-input {
        font-size: 11px;
        padding: 4px;
    }
}

/* --- GLOBAL BUTTONS & CONTROLS --- */
.btn {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.vol-slider {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    outline: none;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 62, 62, 0.5);
}

/* ═══════════ ROUND 101: Director Chat Sidebar ═══════════ */
.chat-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: rgba(10, 15, 28, 0.98);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9999;
    display: flex;
    flex-direction: row;
    /* Sideways layout for the bar */
    transform: translateX(calc(100% - 40px));
    /* Leave 40px visible */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.6);
}

.chat-sidebar.open {
    transform: translateX(0);
}

/* The vertical bar shown when collapsed */
.chat-collapsed-bar {
    width: 40px;
    height: 100%;
    background: rgba(243, 156, 18, 0.1);
    border-left: 1px solid rgba(243, 156, 18, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.chat-collapsed-bar:hover {
    background: rgba(243, 156, 18, 0.2);
}

.chat-collapsed-bar span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 11px;
    font-weight: 900;
    color: #f39c12;
    opacity: 0.7;
}

.chat-sidebar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 380px;
}

.chat-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.chat-sidebar-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #f39c12;
    text-transform: uppercase;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 60, 60, 0.2);
    color: #ff4444;
    border-color: rgba(255, 60, 60, 0.3);
}

.chat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.chat-user-list {
    width: 130px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    padding: 8px 0;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.chat-user-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
}

.chat-user-item.active {
    background: rgba(243, 156, 18, 0.08);
    color: #f39c12;
    border-left-color: #f39c12;
}

.chat-user-item .user-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}

.chat-user-item.is-room .user-dot {
    background: #60a5fa;
}

.chat-user-item .unread-badge {
    margin-left: auto;
    background: #f39c12;
    color: #000;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}

.chat-thread-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-thread-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-thread-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 12px;
    font-weight: 600;
}

.chat-msg {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 90%;
    align-self: flex-end;
    background: rgba(243, 156, 18, 0.12);
    border: 1px solid rgba(243, 156, 18, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.chat-msg .msg-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
}

.chat-msg .msg-status.acked {
    color: #10b981;
}

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: white;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: #f39c12;
}

.chat-input-area button {
    padding: 0 16px;
    background: #f39c12;
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.chat-input-area button:hover {
    background: #e67e22;
    transform: scale(1.02);
}

.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.chat-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* --- PROFESSIONAL ON-AIR SIGN (Round 102) --- */
.live-btn {
    position: relative;
    background: #444 !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease;
    overflow: visible;
}

.live-btn.active {
    background: linear-gradient(149.6deg, #FF5A96 -19.96%, #FF2640 105.98%), #EF5364 !important;
    border: none !important;
    font-weight: 900 !important;
    box-shadow: 0 0 20px rgba(255, 38, 64, 0.4) !important;
}

.live-btn.active:before,
.live-btn.active:after {
    content: "";
    opacity: 0.1;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: inherit;
    z-index: -1;
    animation: onair-pulse 1.5s linear infinite forwards;
    background: linear-gradient(149.6deg, #FF5A96 -19.96%, #FF2640 105.98%), #EF5364;
}

@keyframes goLivePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes onair-pulse {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.3;
    }

    75% {
        transform: scale(1.5);
        opacity: 0.2;
    }

    100% {
        transform: scale(1.6);
        opacity: 0.1;
    }
}


#dashboard-view {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
    box-sizing: border-box;
}

/* Grid overflow fix — prevent items from exceeding container */
#dashboard-view>div {
    min-width: 0;
}

#dashboard-view>div>div {
    min-width: 0;
}

/* KPI Card polish */
.dash-stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Counter animation */
.dash-counter {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Action button hover */
.dash-action-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.15);
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.dash-action-btn:active {
    transform: scale(0.98);
}

/* Status dot pulse when live */
@keyframes dash-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

.dash-dot-live {
    animation: dash-pulse 2s ease-in-out infinite;
    background: #10b981 !important;
}

/* Activity feed wave animation */
@keyframes dash-wave-move {
    0% {
        d: path('M0 12 Q10 4, 20 12 T40 12 T60 12');
    }

    50% {
        d: path('M0 12 Q10 20, 20 12 T40 12 T60 12');
    }

    100% {
        d: path('M0 12 Q10 4, 20 12 T40 12 T60 12');
    }
}

.dash-wave {
    animation: dash-wave-move 3s ease-in-out infinite;
}

.dash-wave-2 {
    animation: dash-wave-move 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

/* Activity item fade-in */
@keyframes dash-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1000px) {
    #dashboard-view>div:nth-child(2) {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 900px) {

    #dashboard-view>div:nth-child(3),
    #dashboard-view>div:nth-child(4) {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 520px) {
    #dashboard-view>div:nth-child(2) {
        grid-template-columns: 1fr 1fr !important;
    }

    #dashboard-view {
        padding: 16px !important;
    }
}


/* Streaming Destination Cards */
.dest-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.dest-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.dest-card.live {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
}

.dest-platform-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.dest-info {
    flex: 1;
    min-width: 0;
}

.dest-name {
    font-size: 13px;
    font-weight: 700;
}

.dest-key-preview {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    font-family: 'SF Mono', monospace;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dest-status {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.dest-status.idle {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.3);
}

.dest-status.connecting {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.dest-status.live {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: destPulse 2s infinite;
}

.dest-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

@keyframes destPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.dest-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.dest-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.dest-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.dest-action-btn.live-toggle {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.dest-action-btn.live-toggle:hover {
    background: rgba(239, 68, 68, 0.15);
}

.dest-action-btn.live-toggle.active {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.dest-action-btn.remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Platform selector buttons */
.platform-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
}

.platform-select-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.platform-select-btn.selected {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
    color: white;
}

.platform-select-btn .plat-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.03em;
}


/* ─── SIDEBAR COLLAPSE UX FOR EDITOR ─── */
#left-sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#view-container {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#left-sidebar.collapsed {
    width: 68px;
    padding-top: 10px;
}

#left-sidebar.collapsed .sidebar-brand {
    font-size: 11px;
    padding: 10px 0;
    text-align: center;
    line-height: 1.2;
}

#left-sidebar.collapsed .sidebar-brand span {
    display: block;
    margin-top: 4px;
    font-size: 9px;
}

#left-sidebar.collapsed .sidebar-section-label,
#left-sidebar.collapsed .sidebar-footer,
#left-sidebar.collapsed .sidebar-spacer,
#left-sidebar.collapsed .sidebar-user,
#left-sidebar.collapsed .sidebar-nav-item span:not(.sidebar-icon) {
    display: none !important;
}

#left-sidebar.collapsed .sidebar-nav-item {
    font-size: 0;
    /* Hides bare text nodes cleanly */
    justify-content: center;
    padding: 14px 0;
    margin: 4px;
    border-radius: 12px;
}

#left-sidebar.collapsed .sidebar-nav-item .sidebar-icon {
    font-size: 20px;
    margin: 0;
}

#view-container.collapsed {
    margin-left: 68px;
}

/* ─── Paddle Checkout Overlay — ensure it renders above everything ─── */
.paddle-frame-overlay,
.paddle-frame-inline,
div[class*="paddle"],
iframe[src*="paddle"] {
    z-index: 999999 !important;
}

/* Disable backdrop-filter on main containers while Paddle is open */
body.paddle-checkout-open #left-sidebar,
body.paddle-checkout-open .main-content,
body.paddle-checkout-open #view-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}