/* ==========================================================================
   DIRECTOR'S PLAYER - EXAKTE ORIGINAL-GEOMETRIE MIT NEUEM DESIGN (css/player.css)
   ========================================================================== */

:root {
    --docked-hud-h: 145px;
    --app-w: 100vw;
    --app-h: 100vh;
}

html.is-touch-root {
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    overflow: hidden !important;
    width: var(--app-w);
    height: var(--app-h);
    overscroll-behavior: none;
}

body.player-body {
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    overflow: hidden !important;
    user-select: none;
    font-family: var(--font-ui, Arial, sans-serif);
    width: 100vw;
    height: 100vh;
}

body.player-body.is-touch-device {
    width: var(--app-w);
    height: var(--app-h);
    position: fixed;
    inset: 0;
    overscroll-behavior: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

input, textarea, select, [contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
}

#player-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}
body.is-touch-device #player-container {
    width: var(--app-w);
    height: var(--app-h);
}

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

/* --- STAGE 1: NATIVE SENSOR MASK --- */
#sensor-mask, #aspect-mask {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.sensor-bar {
    position: absolute;
    background-color: rgba(6, 7, 9, 0.92);
    backdrop-filter: blur(2px);
    z-index: 5;
}

/* --- STAGE 2: CREATIVE GUIDELINE MASK --- */
.mask-bar {
    position: absolute;
    background-color: rgba(6, 7, 9, 0.78);
    z-index: 7;
}

/* --- STAGE 3: WHITE FRAMING LINES --- */
#guideline-frame {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 8;
    box-sizing: border-box;
    border: 1px solid rgba(243, 244, 246, 0.85);
    display: none;
}

/* --- MODE TRANSITION ON-SCREEN BADGE --- */
#mode-transition-toast {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(11, 12, 16, 0.94);
    border: 1px solid var(--border-highlight, rgba(229, 169, 108, 0.4));
    color: var(--text-primary, #f3f4f6);
    font-family: var(--font-mono, monospace);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    backdrop-filter: blur(8px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
}
#mode-transition-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- 2:1 VIEWPORT RADAR & 360° OPTICS COCKPIT --- */
#radar-wrapper {
    position: absolute;
    bottom: calc(var(--hud-h, 130px) + 34px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 12;
    max-width: calc(100vw - 20px);
    transition: opacity 0.25s ease, transform 0.25s ease, bottom 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
#radar-wrapper.hud-hidden {
    bottom: 24px !important;
}
#radar-wrapper.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 15px);
}

#radar-container {
    position: relative;
    width: 220px;
    height: 110px;
    background: rgba(8, 9, 12, 0.88);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85);
    overflow: hidden;
    backdrop-filter: blur(5px);
    cursor: crosshair;
    touch-action: none;
    transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#radar-wrapper.radar-car-expanded #radar-container {
    width: 330px;
    height: 165px;
}
#radar-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#radar-angles-badge {
    position: absolute;
    top: 4px; right: 5px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: var(--accent-brass, #e5a96c);
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    pointer-events: none;
    white-space: nowrap;
    font-feature-settings: "tnum" 1;
}

#radar-preset-bar {
    display: flex;
    gap: 4px;
    background: rgba(11, 12, 16, 0.9);
    padding: 3px 6px;
    border-radius: 5px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}
.radar-preset-btn {
    background: #12141b;
    color: var(--accent-brass, #e5a96c);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    padding: 2px 7px;
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-feature-settings: "tnum" 1;
}
.radar-preset-btn:hover {
    background: var(--accent-brass, #e5a96c);
    color: #000;
    border-color: var(--accent-brass, #e5a96c);
}

#radar-car-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 220px;
    background: rgba(10, 11, 15, 0.95);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    border-radius: 5px;
    padding: 3px 6px;
    box-sizing: border-box;
    font-family: var(--font-mono, monospace);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#radar-wrapper.radar-car-expanded #radar-car-controls {
    width: 330px;
}

.radar-car-slider-group {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary, #9e9389);
    flex: 1;
    min-width: 0;
}
.radar-car-slider-group label {
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}
.radar-car-slider-group input[type="range"] {
    accent-color: var(--accent-brass, #e5a96c);
    height: 3px;
    width: 100%;
    min-width: 25px;
    flex: 1;
    margin: 0;
    padding: 0;
    cursor: pointer;
}
.radar-car-slider-group span {
    color: var(--accent-brass, #e5a96c);
    min-width: 28px;
    font-size: 9px;
    text-align: right;
    font-feature-settings: "tnum" 1;
    flex-shrink: 0;
}


/* --- BUFFERING & FAST-START SPINNER --- */
#video-loading-spinner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 9;
    pointer-events: none;
}
.spinner-ring {
    width: 46px; height: 46px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent-brass, #e5a96c);
    border-right-color: rgba(0, 216, 255, 0.72);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(0, 216, 255, 0.16), inset 0 0 8px rgba(229, 169, 108, 0.12);
    animation: spinRing 0.8s linear infinite;
}
.spinner-text {
    font-family: var(--font-display, var(--font-mono, monospace));
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-brass, #e5a96c);
    background: rgba(8, 9, 13, 0.88);
    padding: 4px 10px;
    border-radius: 5px;
    letter-spacing: 0.7px;
    border: 1px solid rgba(0, 216, 255, 0.22);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}
@keyframes spinRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 3-ROW MAIN HUD CONTAINER --- */
.ui-overlay-container {
    position: absolute;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    width: 92vw; max-width: 1450px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 10;
    background: rgba(10, 11, 15, 0.88);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    padding: 12px 15px;
    border-radius: 8px;
    backdrop-filter: blur(6px);
    color: var(--text-primary, #f3f4f6);
    font-size: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    transition: opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1), transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.34s;
    box-sizing: border-box;
}
.ui-overlay-container.minimized {
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translate(-50%, 25px);
}
.ui-overlay-container.auto-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
}

body.hud-docked #webgl-canvas {
    height: 100vh !important;
}
body.is-touch-device.hud-docked #webgl-canvas {
    height: var(--app-h) !important;
}
body.hud-docked .ui-overlay-container {
    position: absolute; bottom: 0; left: 0;
    transform: translateY(0) !important; width: 100vw; max-width: 100vw;
    border-radius: 0; border-left: none; border-right: none; border-bottom: none;
    background: rgba(8, 9, 12, 0.98);
    box-sizing: border-box;
}
body.hud-docked .ui-overlay-container.minimized,
body.hud-docked .ui-overlay-container.auto-hidden {
    transform: translateY(100%) !important;
    opacity: 0;
    pointer-events: none;
}
body.hud-docked .ui-overlay-container.minimized {
    visibility: hidden;
}
body.hud-docked #radar-wrapper {
    bottom: calc(var(--docked-hud-h, 130px) + 14px);
    transition: bottom 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
body.hud-docked #radar-wrapper.hud-auto-hidden {
    bottom: 20px;
}

#hud-restore-btn {
    position: absolute; bottom: 20px; right: 20px; z-index: 12;
    background: rgba(11, 12, 16, 0.65); border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    color: var(--text-secondary, #9ca3af); font-family: var(--font-mono, monospace); font-size: 11px;
    padding: 7px 12px; border-radius: 20px; cursor: pointer; backdrop-filter: blur(5px);
    transition: all 0.2s ease; display: none;
}
#hud-restore-btn:hover {
    background: rgba(10, 11, 15, 0.92); color: var(--accent-brass, #e5a96c);
    border-color: var(--accent-brass, #e5a96c);
}

.hud-top-actions {
    position: absolute;
    bottom: calc(100% + 6px); right: 0;
    display: flex; gap: 6px; z-index: 11;
}

.hud-top-left {
    position: absolute;
    bottom: calc(100% + 6px); left: 0;
    display: flex; align-items: center; gap: 6px; z-index: 11;
}
body.hide-stream-status #hud-stream-status-wrap {
    display: none !important;
}

.hud-stream-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(11, 12, 16, 0.86);
    color: var(--text-secondary, #9ca3af);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    padding: 3px 8px;
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    line-height: 1.3;
    cursor: pointer;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    transition: all 0.15s ease;
}
.hud-stream-status-pill:hover {
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
    background: rgba(18, 20, 27, 0.95);
}
.stream-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-sage, #52b788);
    box-shadow: 0 0 5px rgba(82, 183, 136, 0.7);
}
.stream-status-dot.is-max {
    background: var(--accent-sage, #52b788);
    box-shadow: 0 0 5px rgba(82, 183, 136, 0.75);
}
.stream-status-dot.is-adapting {
    background: var(--accent-brass, #e5a96c);
    box-shadow: 0 0 5px rgba(229, 169, 108, 0.75);
}
.stream-status-dot.is-fixed {
    background: #38bdf8;
    box-shadow: 0 0 5px rgba(56, 189, 248, 0.75);
}
.stream-status-dot.is-capped {
    background: var(--accent-poppy, #e76f51);
    box-shadow: 0 0 5px rgba(231, 111, 81, 0.75);
}

/* --- TOP-RIGHT BURGER MENU, TABLET QUICK TOOLS & PERSONALIZATION POPOVER --- */
#player-top-right-tools {
    position: fixed;
    top: 18px;
    right: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 28;
}

.touch-only-btn {
    display: none;
}

.top-tool-pill-btn {
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    background: rgba(18, 16, 14, 0.42);
    color: rgba(240, 235, 228, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    opacity: 0.76;
    touch-action: manipulation;
    user-select: none;
    transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.top-tool-pill-btn:hover,
.top-tool-pill-btn:active {
    opacity: 1;
    color: #fff;
    border-color: rgba(229, 169, 108, 0.6);
    background: rgba(28, 24, 20, 0.78);
}
.top-tool-svg-icon {
    display: block;
    pointer-events: none;
    flex-shrink: 0;
}
#btn-gyro-hud.active,
#btn-fullscreen-hud.active {
    opacity: 0.94;
    background: rgba(217, 119, 54, 0.24) !important;
    color: var(--accent-brass, #e5a96c) !important;
    border-color: rgba(229, 169, 108, 0.75) !important;
    box-shadow: 0 0 10px rgba(217, 119, 54, 0.35);
}
#btn-fullscreen-hud.active .fs-icon-expand {
    display: none !important;
}
#btn-fullscreen-hud.active .fs-icon-compress {
    display: block !important;
}

.burger-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(11, 12, 16, 0.92);
    color: var(--text-primary, #f3f4f6);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.22));
    padding: 6px 11px;
    min-height: 32px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    border-radius: 6px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.65);
    white-space: nowrap;
    transition: all 0.16s ease;
}
.burger-trigger-btn:hover,
.burger-trigger-btn.active {
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
    background: rgba(18, 20, 27, 0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(229, 169, 108, 0.25);
}
.burger-trigger-user {
    color: var(--accent-brass, #e5a96c);
    font-weight: 600;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
}
body.hide-burger-user-pill .burger-trigger-user {
    display: none !important;
}
.burger-team-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.25;
}
.burger-toggle-sub.has-hidden-team {
    color: #38bdf8;
    font-weight: 600;
}
.team-tracks-hint-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.42);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 10.5px;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.team-tracks-hint-btn.has-active-clip-team {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}
.team-tracks-hint-btn:hover {
    background: #38bdf8;
    color: #061824;
    border-color: #38bdf8;
}
.team-hint-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 5px rgba(56, 189, 248, 0.85);
    flex-shrink: 0;
}
.team-tracks-hint-btn:hover .team-hint-dot {
    background: #061824;
    box-shadow: none;
}
.burger-trigger-icon {
    display: block;
    color: var(--text-secondary, #b8ada2);
    transition: color 0.15s ease, transform 0.15s ease;
}
.burger-trigger-btn:hover .burger-trigger-icon,
.burger-trigger-btn.active .burger-trigger-icon {
    color: var(--accent-brass, #e5a96c);
}

.burger-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 316px;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    background: rgba(11, 12, 16, 0.97);
    border: 1px solid rgba(229, 169, 108, 0.35);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    color: var(--text-primary, #f3f4f6);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    z-index: 30;
}

.burger-section {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.burger-section-title {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-secondary, #9e9389);
    text-transform: uppercase;
    margin-bottom: 1px;
}

.burger-profile-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(229, 169, 108, 0.25);
    border-radius: 6px;
    padding: 8px 10px;
}
.burger-profile-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.burger-profile-avatar {
    font-size: 15px;
    flex-shrink: 0;
}
.burger-profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.burger-profile-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-brass, #e5a96c);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.burger-profile-role {
    font-size: 10px;
    color: var(--text-secondary, #9e9389);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.burger-profile-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.burger-action-pill {
    background: rgba(229, 169, 108, 0.14);
    color: var(--accent-brass, #e5a96c);
    border: 1px solid rgba(229, 169, 108, 0.4);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10.5px;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.burger-action-pill:hover {
    background: var(--accent-brass, #e5a96c);
    color: #000;
}
.burger-action-pill.burger-action-danger {
    background: rgba(231, 111, 81, 0.12);
    color: #f0957e;
    border-color: rgba(231, 111, 81, 0.35);
}
.burger-action-pill.burger-action-danger:hover {
    background: var(--accent-poppy, #e76f51);
    color: #fff;
}

.burger-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 26px;
}
.burger-control-label {
    color: var(--text-primary, #f0ebe4);
    font-size: 11px;
}
.burger-select,
.burger-mode-btn {
    background: #12141b;
    color: var(--text-primary, #f3f4f6);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    min-width: 132px;
    height: 26px;
    box-sizing: border-box;
    text-align: center;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.burger-select:hover,
.burger-mode-btn:hover {
    border-color: var(--accent-brass, #e5a96c);
    color: #fff;
}

.burger-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
    cursor: pointer;
    user-select: none;
}
.burger-toggle-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.25;
}
.burger-toggle-title {
    color: var(--text-primary, #f0ebe4);
    font-size: 11px;
    font-weight: 600;
}
.burger-toggle-sub {
    color: var(--text-secondary, #8c8278);
    font-size: 9.5px;
}

.burger-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.burger-switch-slider {
    position: relative;
    width: 34px;
    height: 18px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    flex-shrink: 0;
    transition: background 0.18s ease, border-color 0.18s ease;
}
.burger-switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #b8ada2;
    border-radius: 50%;
    transition: transform 0.18s ease, background 0.18s ease;
}
.burger-switch-input:checked + .burger-switch-slider {
    background: rgba(229, 169, 108, 0.28);
    border-color: var(--accent-brass, #e5a96c);
}
.burger-switch-input:checked + .burger-switch-slider::after {
    transform: translateX(16px);
    background: var(--accent-brass, #e5a96c);
}

.burger-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(0, 0, 0, 0.28);
}
.burger-footer-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #f0ebe4);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}
.burger-footer-btn:hover {
    border-color: var(--accent-brass, #e5a96c);
    color: #fff;
    background: rgba(229, 169, 108, 0.15);
}
.burger-footer-btn.burger-footer-secondary {
    flex: 0 0 auto;
    color: var(--text-secondary, #9e9389);
}

/* --- USER PERSONALIZATION CSS HOOKS --- */
body.hide-timeline-clipnames .global-segment-label {
    display: none !important;
}
body.hide-team-tracks .timeline-range-zone.is-other,
body.hide-team-tracks .timeline-marker-pin.is-other,
body.hide-team-tracks .global-segment-range.is-other,
body.hide-team-tracks .global-segment-marker.is-other,
body.hide-team-tracks .timeline-segment.is-ranged-compact-other::after {
    display: none !important;
}
body.scrub-preview-compact #preview-thumb-ann,
body.scrub-preview-compact #global-preview-thumb-ann,
body.scrub-preview-compact #global-preview-thumb-circle {
    display: none !important;
}
body.scrub-preview-compact #timeline-thumbnail-preview.has-note-callout,
body.scrub-preview-compact #global-timeline-thumbnail-preview.has-note-callout {
    width: 156px !important;
}
body.scrub-preview-off #timeline-thumbnail-preview,
body.scrub-preview-off #global-timeline-thumbnail-preview {
    display: none !important;
}

@media (pointer: coarse) {
    .burger-trigger-btn {
        min-height: 36px;
        padding: 7px 13px;
    }
    .burger-toggle-row,
    .burger-control-row {
        min-height: 32px;
    }
}

:fullscreen #player-top-right-tools {
    display: none !important;
}
:-webkit-full-screen #player-top-right-tools {
    display: none !important;
}
body.is-fullscreen #player-top-right-tools {
    display: none !important;
}
body.is-touch-device:fullscreen #player-top-right-tools,
body.is-touch-device:-webkit-full-screen #player-top-right-tools,
body.is-touch-device.is-fullscreen #player-top-right-tools,
body.is-touch-device.is-pseudo-fullscreen #player-top-right-tools {
    display: flex !important;
}
:fullscreen #btn-burger-menu,
:-webkit-full-screen #btn-burger-menu,
body.is-fullscreen #btn-burger-menu,
body.is-pseudo-fullscreen #btn-burger-menu,
:fullscreen #burger-menu-popover,
:-webkit-full-screen #burger-menu-popover,
body.is-fullscreen #burger-menu-popover,
body.is-pseudo-fullscreen #burger-menu-popover {
    display: none !important;
}

.hud-top-actions button,
.hud-top-actions #btn-toggle-car {
    background: rgba(12, 14, 19, 0.88);
    color: var(--text-secondary, #9ca3af);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    padding: 3px 8px; font-size: 11px; font-family: var(--font-mono, monospace);
    border-radius: 4px; cursor: pointer; backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); white-space: nowrap;
    transition: all 0.2s ease;
}
.hud-top-actions button:hover,
.hud-top-actions #btn-toggle-car:hover {
    color: #fff; border-color: var(--accent-brass, #e5a96c);
}
.hud-top-actions #btn-toggle-car.active {
    background: var(--accent-amber, #d97736);
    color: #000;
    border-color: var(--accent-brass, #e5a96c);
    font-weight: bold;
}
#btn-minimize-hud:hover { color: var(--accent-poppy, #e76f51); border-color: var(--accent-poppy, #e76f51); }

/* --- ROW 1: TITLE, CLIP DRAWER, TIMECODE & CIRCLING --- */
.ui-filename-row {
    position: relative;
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    font-family: var(--font-mono, monospace); gap: 12px;
}
.ui-title-group {
    display: flex; align-items: center; gap: 10px; overflow: hidden;
    flex: 1 1 0; min-width: 0; max-width: calc(50% - 80px);
}
.hud-clip-info {
    display: flex; flex-direction: column; justify-content: center;
    overflow: hidden; min-width: 0; line-height: 1.25;
}
.hud-slate {
    font-size: 13px; color: var(--accent-brass, #e5a96c); font-weight: bold;
    white-space: nowrap; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis;
}
#hud-filename {
    font-size: 13px; color: var(--text-secondary, #9e9389); font-weight: bold;
    white-space: nowrap; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis;
}
.hud-clip-info.has-slate #hud-filename {
    font-size: 10px; color: var(--text-tertiary, #777); font-weight: normal;
    letter-spacing: 0.2px;
}
.ui-status-right {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    margin-left: auto;
}

.hud-tc-center-anchor {
    position: absolute;
    left: 50%;
    top: calc(50% - 3px);
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    z-index: 12;
    pointer-events: auto;
}

#hud-timecode {
    font-size: 15px; color: var(--accent-brass, #e5a96c); font-weight: bold;
    letter-spacing: 0.5px; background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    padding: 2px 8px; border-radius: 4px; font-feature-settings: "tnum" 1;
    white-space: nowrap;
    pointer-events: auto;
}

.hud-audio-control {
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    height: 24px;
    background: rgba(12, 14, 19, 0.92);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    border-radius: 4px;
    box-sizing: border-box;
    backdrop-filter: blur(6px);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.18s ease, background 0.16s ease;
    z-index: 14;
}
.hud-audio-control:hover:not(.no-audio),
.hud-audio-control.is-expanded:not(.no-audio) {
    border-color: var(--accent-brass, #e5a96c);
    background: rgba(10, 11, 15, 0.97);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.78);
}
.hud-audio-control.is-muted:not(.no-audio) {
    border-color: rgba(231, 111, 81, 0.55);
    background: rgba(231, 111, 81, 0.12);
}
.hud-audio-control.is-muted:not(.no-audio) .btn-audio-mute {
    color: var(--accent-poppy, #e76f51);
}
.hud-audio-control.no-audio {
    opacity: 0.36;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(15, 14, 13, 0.65);
}
.hud-audio-control.no-audio .btn-audio-mute {
    color: var(--text-tertiary, #777);
    cursor: not-allowed;
}

.btn-audio-mute {
    background: transparent;
    border: none;
    color: var(--text-secondary, #b8ada2);
    width: 26px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease;
}
.btn-audio-mute:hover {
    color: #fff;
}
.audio-icon-svg {
    display: block;
    pointer-events: none;
}

.hud-audio-slider-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    transition: max-width 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.15s ease, padding 0.18s ease;
}
.hud-audio-control:hover:not(.no-audio) .hud-audio-slider-wrap,
.hud-audio-control:focus-within:not(.no-audio) .hud-audio-slider-wrap,
.hud-audio-control.is-expanded:not(.no-audio) .hud-audio-slider-wrap {
    max-width: 120px;
    opacity: 1;
    padding: 0 7px 0 2px;
    pointer-events: auto;
}

.hud-volume-range {
    width: 64px;
    height: 3px;
    margin: 0;
    accent-color: var(--accent-brass, #e5a96c);
    cursor: pointer;
    flex-shrink: 0;
}
.hud-volume-pct {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-brass, #e5a96c);
    min-width: 28px;
    text-align: right;
    font-feature-settings: "tnum" 1;
    user-select: none;
    white-space: nowrap;
}
.hud-audio-control.is-muted .hud-volume-pct {
    color: var(--accent-poppy, #e76f51);
}

#btn-toggle-playlist {
    background: #12141b; color: var(--accent-brass, #e5a96c);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    height: 24px; box-sizing: border-box;
    padding: 0 8px; font-size: 11px; font-family: var(--font-mono, monospace);
    border-radius: 4px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
#btn-toggle-playlist:hover, #btn-toggle-playlist.active {
    background: var(--accent-amber, #d97736); color: #000; border-color: var(--accent-amber, #d97736);
}

#btn-circle-take {
    background: #12141b; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    color: var(--text-secondary, #9ca3af); font-family: var(--font-mono, monospace);
    height: 24px; box-sizing: border-box;
    font-size: 11px; padding: 0 8px; border-radius: 4px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px; transition: all 0.2s ease;
}
#btn-circle-take:hover { color: var(--accent-sage, #52b788); border-color: var(--accent-sage, #52b788); }
#btn-circle-take.active {
    background: rgba(82, 183, 136, 0.15); border-color: var(--accent-sage, #52b788);
    color: var(--accent-sage, #52b788); font-weight: bold;
}
#btn-circle-take.active.circled-by-other {
    background: rgba(82, 183, 136, 0.08);
    border-style: dashed;
    font-weight: 500;
}

#btn-add-marker, #btn-toggle-notes {
    background: #12141b; color: var(--text-secondary, #9ca3af);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    height: 24px; box-sizing: border-box;
    padding: 0 8px; font-size: 11px; font-family: var(--font-mono, monospace);
    border-radius: 4px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
#btn-add-marker:hover, #btn-toggle-notes:hover, #btn-toggle-notes.active {
    color: #fff; border-color: var(--text-primary, #f3f4f6);
}

/* --- UNIFIED 360° OPTICS & FRAMING BAR (UNDER RADAR YAW PRESETS) --- */
.ui-optics-row,
.radar-optics-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(10, 11, 15, 0.92);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    border-radius: 6px;
    padding: 3px 9px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    font-family: var(--font-mono, monospace);
    box-sizing: border-box;
    max-width: calc(100vw - 24px);
}

/* --- ROW 2: VIEW MODE, CENTERED NLE TRANSPORT DECK & PLAYBACK MODES --- */
.ui-middle-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
    gap: 10px;
    min-height: 40px;
    box-sizing: border-box;
}
.ui-left-group {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    justify-self: start; min-width: 0;
    min-height: 32px;
}
.ui-right-group {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap;
    min-height: 24px;
    padding-left: 8px;
    border-left: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
}
.ui-transport-right-group {
    display: flex; align-items: center; justify-content: flex-end; gap: 6px;
    justify-self: end; min-width: 0;
    min-height: 32px;
}

/* Symmetrisches NLE Transport-Deck exakt mittig in Spalte 2 (kein Überlappen möglich) */
.hud-transport-deck {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(9, 10, 14, 0.94);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.22));
    border-radius: 7px;
    padding: 4px 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
    z-index: 3;
}
.transport-deck-sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.16);
    margin: 0 3px;
    flex-shrink: 0;
}
.transport-deck-btn {
    background: #12141b;
    color: var(--text-secondary, #9ca3af);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.18));
    height: 30px;
    padding: 0 9px;
    gap: 4px;
    font-size: 11.5px;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    touch-action: manipulation;
    user-select: none;
    transition: all 0.14s ease;
}
.transport-deck-btn:hover:not(:disabled) {
    background: #1c202b;
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
}
.transport-deck-btn.transport-frame-btn {
    min-width: 38px;
    color: var(--text-primary, #f0ebe4);
}
#btn-prev-clip, #btn-next-clip {
    min-width: 40px;
}
.transport-io-svg {
    display: block;
    flex-shrink: 0;
}
#btn-mark-in, #btn-mark-out {
    min-width: 50px;
    color: var(--accent-brass, #e5a96c);
    border-color: rgba(229, 169, 108, 0.38);
    font-weight: bold;
}
#btn-mark-in:hover, #btn-mark-out:hover {
    background: rgba(229, 169, 108, 0.18);
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
}
#btn-mark-in.active {
    background: var(--accent-amber, #d97736);
    color: #000;
    border-color: var(--accent-amber, #d97736);
    box-shadow: 0 0 8px rgba(217, 119, 54, 0.6);
}
#btn-goto-in, #btn-goto-out {
    min-width: 52px;
    font-size: 11px;
    color: var(--text-muted, #6e645b);
    border-color: rgba(255, 255, 255, 0.12);
}
#btn-goto-in.has-target, #btn-goto-out.has-target {
    color: var(--accent-brass, #e5a96c);
    border-color: rgba(229, 169, 108, 0.35);
}
#btn-goto-in:disabled, #btn-goto-out:disabled {
    opacity: 0.38;
    cursor: default;
}
@media (pointer: coarse) {
    .ui-middle-row {
        min-height: 44px;
        gap: 8px;
    }
    .hud-transport-deck {
        gap: 5px;
        padding: 4px 7px;
    }
    .transport-deck-sep {
        margin: 0 1px;
    }
    .transport-deck-btn {
        height: 34px;
        min-width: 38px;
        padding: 0 8px;
        font-size: 11.5px;
    }
    #btn-goto-in, #btn-goto-out, #btn-mark-in, #btn-mark-out {
        min-width: 46px;
    }
}
@media (max-width: 960px) {
    .ui-middle-row {
        grid-template-columns: 1fr auto;
    }
    .hud-transport-deck {
        grid-column: 1 / -1;
        justify-self: center;
        order: -1;
    }
}
.control-group {
    display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.control-group label {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary, #9e9389);
    user-select: none;
    cursor: default;
}

#btn-360, #btn-flat {
    background: #12141b;
    color: var(--text-secondary, #9ca3af);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
#btn-360:hover, #btn-flat:hover {
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
}
#btn-360.active, #btn-flat.active {
    background: var(--accent-amber, #d97736);
    color: #000;
    border-color: var(--accent-amber, #d97736);
    font-weight: bold;
}

/* --- 2D FLAT PLAYLIST MODE (NO 360° / IMMERSIVE) --- */
body.playlist-mode-2d #view-mode-toggle-group,
body.playlist-mode-2d #car-view-controls,
body.playlist-mode-2d #btn-radar-toggle,
body.playlist-mode-2d #radar-wrapper,
body.playlist-mode-2d .shortcut-360-only {
    display: none !important;
}
.ui-left-group #regie-right-group {
    border-left: none;
    padding-left: 0;
    font-family: var(--font-mono, monospace);
}
.ui-left-group #ratio-select {
    height: 26px;
    font-size: 11px;
    padding: 1px 8px;
}
body.playlist-mode-2d #preview-thumb-img,
body.playlist-mode-2d #global-preview-thumb-img {
    width: 144px;
    height: auto;
    max-height: 112px;
    object-fit: contain;
}

.ui-optics-panel {
    display: flex; align-items: center; gap: 7px; font-family: var(--font-mono, monospace);
    background: transparent; padding: 0; border-radius: 0;
    border: none; flex-shrink: 0;
    min-height: 24px; box-sizing: border-box;
}
.panel-divider { width: 1px; height: 15px; background-color: var(--border-medium, rgba(255, 255, 255, 0.2)); flex-shrink: 0; }

#hud-camera-select {
    background: #0b0c10; color: #fff; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    padding: 1px 6px; font-size: 10.5px; font-family: var(--font-mono, monospace);
    border-radius: 4px; cursor: pointer; outline: none; flex-shrink: 0;
    height: 22px; box-sizing: border-box;
}
#hud-camera-select:hover { border-color: var(--accent-brass, #e5a96c); }

#hud-focal {
    font-size: 12px; color: var(--accent-brass, #e5a96c); font-weight: bold;
    cursor: ew-resize; padding: 1px 5px; border-radius: 4px;
    background: rgba(229, 169, 108, 0.12); border: 1px solid rgba(229, 169, 108, 0.25);
    flex-shrink: 0; touch-action: none;
    font-feature-settings: "tnum" 1;
}
#lens-info { font-size: 10.5px; color: var(--text-secondary, #9ca3af); flex-shrink: 0; font-feature-settings: "tnum" 1; }

#btn-touch-roll-mode {
    background: #12141b; color: var(--text-secondary, #9ca3af); border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    font-family: var(--font-mono, monospace); font-size: 10.5px; padding: 0 7px; border-radius: 4px; cursor: pointer;
    height: 22px; box-sizing: border-box; display: inline-flex; align-items: center;
    transition: all 0.15s ease;
}
#btn-touch-roll-mode:hover {
    color: #fff; border-color: var(--accent-brass, #e5a96c);
}
#btn-touch-roll-mode.active {
    background: var(--accent-amber, #d97736); border-color: var(--accent-amber, #d97736);
    color: #000; font-weight: bold;
}

#btn-toggle-car {
    background: #12141b; color: var(--text-secondary, #9ca3af); border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    font-family: var(--font-mono, monospace); font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer;
    transition: all 0.15s ease;
}
#btn-toggle-car:hover { color: #fff; border-color: var(--accent-brass, #e5a96c); }
#btn-toggle-car.active {
    background: var(--accent-amber, #d97736); border-color: var(--accent-amber, #d97736);
    color: #000; font-weight: bold;
}
#car-seat-select, #car-model-select {
    background: #0b0c10; color: #fff; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    padding: 3px 6px; font-size: 11px; font-family: var(--font-mono, monospace);
    border-radius: 4px; cursor: pointer; outline: none;
}
#car-seat-select:hover, #car-model-select:hover { border-color: var(--accent-brass, #e5a96c); }

.creative-controls { display: none; }
.regie-slider {
    width: 56px;
    height: 3px;
    vertical-align: middle;
    accent-color: var(--accent-brass, #e5a96c);
    cursor: pointer;
}

#ratio-select {
    background: #0b0c10;
    color: #fff;
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    padding: 1px 6px;
    font-size: 10.5px;
    font-family: var(--font-mono, monospace);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    height: 22px;
    box-sizing: border-box;
}
#ratio-select:hover {
    border-color: var(--accent-brass, #e5a96c);
}

#eff-focal-info {
    background: rgba(0, 0, 0, 0.6); padding: 1px 6px; border-radius: 4px;
    font-family: var(--font-mono, monospace); font-size: 10px; color: var(--accent-brand-cyan-tw, #22d3ee);
    border: 1px solid rgba(0, 216, 255, 0.35); font-feature-settings: "tnum" 1;
    height: 22px; box-sizing: border-box; display: inline-flex; align-items: center;
}

/* --- ROW 3: FULL-WIDTH LOWER CLIP TIMELINE --- */
.ui-bottom-row {
    display: flex; align-items: center; border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    padding-top: 6px; width: 100%;
}
#video-controls { display: flex; align-items: center; gap: 8px; width: 100%; }

#btn-play-pause {
    width: 88px; min-width: 88px; height: 30px; padding: 0 14px;
    text-align: center; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-amber, #d97736); color: #000; border: 1px solid var(--accent-amber, #d97736);
    font-family: var(--font-mono, monospace); font-size: 12px; font-weight: bold;
    letter-spacing: 0.3px;
    border-radius: 5px; cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: background 0.14s ease, transform 0.1s ease;
}
#btn-play-pause:hover { background: #e28546; }
@media (pointer: coarse) {
    #btn-play-pause {
        width: 80px; min-width: 80px; height: 34px; font-size: 12px; padding: 0 10px;
    }
}

.transport-nav-btn {
    font-family: var(--font-mono, monospace); font-weight: bold; padding: 5px 9px; font-size: 12px;
}

#btn-loop-mode {
    font-family: var(--font-mono, monospace); font-size: 11px; min-width: 84px; text-align: center;
}
#btn-loop-mode.mode-single {
    background: rgba(229, 169, 108, 0.15); border-color: var(--accent-brass, #e5a96c); color: var(--accent-brass, #e5a96c);
}
#btn-loop-mode.mode-all {
    background: rgba(255, 255, 255, 0.08); border-color: var(--border-medium, rgba(255, 255, 255, 0.2)); color: #fff;
}

#btn-range-mode {
    font-family: var(--font-mono, monospace); font-size: 11px; min-width: 96px; text-align: center;
    background: rgba(229, 169, 108, 0.15); border-color: var(--accent-brass, #e5a96c); color: var(--accent-brass, #e5a96c);
}
#btn-range-mode.mode-full {
    background: #12141b; border-color: var(--border-medium, rgba(255, 255, 255, 0.2)); color: var(--text-muted, #5b6370);
}

#range-user-filter-select {
    background: #0b0c10; color: var(--accent-brass, #e5a96c); border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    padding: 3px 6px; font-size: 11px; font-family: var(--font-mono, monospace); border-radius: 4px;
    cursor: pointer; outline: none; max-width: 150px; text-overflow: ellipsis;
}

#playback-status-badge {
    font-family: var(--font-mono, monospace); font-size: 10px; padding: 2px 6px; border-radius: 3px;
    letter-spacing: 0.5px; white-space: nowrap;
}
#playback-status-badge.mode-selected {
    background: rgba(229, 169, 108, 0.12); border: 1px solid var(--accent-brass, #e5a96c); color: var(--accent-brass, #e5a96c);
}
#playback-status-badge.mode-full {
    background: #12141b; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15)); color: var(--text-muted, #5b6370);
}

#hud-quality-select {
    background: #12141b;
    color: var(--text-primary, #f3f4f6);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    padding: 3px 8px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    width: 142px; min-width: 142px; max-width: 142px;
    height: 26px;
    box-sizing: border-box;
    text-overflow: ellipsis; white-space: nowrap;
    text-align: center;
}
#hud-quality-select:hover {
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
}
#hud-quality-select option {
    background: #12141b;
    color: var(--text-primary, #f3f4f6);
}

#time-display {
    white-space: nowrap;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    color: var(--text-secondary, #9e9389);
    font-feature-settings: "tnum" 1;
    cursor: pointer;
    flex-shrink: 0;
    padding-left: 4px;
    user-select: none;
    transition: color 0.15s ease;
}
#time-display:hover {
    color: var(--accent-brass, #e5a96c);
}

/* Timeline Track */
.timeline-container {
    position: relative; flex-grow: 1; display: flex; align-items: center; height: 38px;
}
.timeline-container::after {
    content: '';
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: var(--hover-x, 0px);
    width: 1px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.1s ease;
}
.timeline-container.is-hovering-timeline::after {
    opacity: 1;
}
.ui-global-timeline-row {
    display: flex;
    align-items: center;
    width: 100%;
}
.ui-global-timeline-row .timeline-container {
    height: 38px;
    width: 100%;
    margin-bottom: 4px;
}
#global-timeline-track {
    position: absolute; left: 0; right: 0; height: 30px; border-radius: 4px;
    background: #07080b; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.25));
    box-sizing: border-box; pointer-events: none; z-index: 1; overflow: visible; display: block;
}
#global-timeline-track::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    pointer-events: none;
    z-index: 3;
}
#seek-bar,
#global-seek-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    z-index: 4;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}
#seek-bar:focus,
#global-seek-bar:focus { outline: none; }
#seek-bar::-webkit-slider-runnable-track,
#global-seek-bar::-webkit-slider-runnable-track { 
    height: 100%; 
    background: transparent; 
    border: none;
}
#seek-bar::-moz-range-track,
#global-seek-bar::-moz-range-track { 
    height: 100%; 
    background: transparent; 
    border: none;
}

/* Der schmale NLE-Playhead: Identisch auf beiden Timelines */
#seek-bar::-webkit-slider-thumb,
#global-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 4px;
    height: 34px;
    margin-top: 0;
    background: var(--accent-brass, #e5a96c);
    border: none;
    border-radius: 2px;
    cursor: ew-resize;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 0 6px rgba(229, 169, 108, 0.9);
}
#seek-bar::-moz-range-thumb,
#global-seek-bar::-moz-range-thumb {
    width: 4px;
    height: 34px;
    background: var(--accent-brass, #e5a96c);
    border: none;
    border-radius: 2px;
    cursor: ew-resize;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.95), 0 0 6px rgba(229, 169, 108, 0.9);
}

#timeline-markers-track {
    position: absolute; left: 0; right: 0; height: 30px; border-radius: 4px;
    background: linear-gradient(
        to bottom,
        #07080b 0px,
        #07080b 6px,
        rgba(255, 255, 255, 0.16) 6px,
        rgba(255, 255, 255, 0.16) 7px,
        #14161e 7px,
        #14161e 21px,
        rgba(255, 255, 255, 0.16) 21px,
        rgba(255, 255, 255, 0.16) 22px,
        #07080b 22px,
        #07080b 100%
    );
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.25));
    box-sizing: border-box; pointer-events: none; z-index: 1; overflow: hidden; display: block;
}
#timeline-markers-track.is-circled::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    height: 2.5px;
    background: var(--accent-sage, #52b788);
    pointer-events: none;
    z-index: 2;
}
#timeline-markers-track::before {
    content: '';
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: 0;
    width: var(--seek-pct, 0%);
    background: rgba(217, 119, 54, 0.3);
    border-right: 1px solid rgba(229, 169, 108, 0.55);
    pointer-events: none;
}

.timeline-container.range-mode-active #timeline-markers-track {
    border-color: var(--border-subtle, rgba(255, 255, 255, 0.22));
}

.timeline-pending-in-zone {
    position: absolute;
    top: 12px;
    height: 14px;
    pointer-events: none;
    z-index: 4;
    box-sizing: border-box;
    border-left: 2.5px solid var(--accent-brass, #e5a96c);
}
.timeline-pending-in-zone::before {
    content: '';
    position: absolute;
    top: -7px;
    left: -2.5px;
    width: 7px;
    height: 21px;
    border-top: 2px solid var(--accent-brass, #e5a96c);
    border-bottom: 2px solid var(--accent-brass, #e5a96c);
    border-left: 2.5px solid var(--accent-brass, #e5a96c);
    border-radius: 1px 0 0 1px;
    box-sizing: border-box;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9));
}
.timeline-pending-in-zone.has-preview-span {
    background: repeating-linear-gradient(
        -45deg,
        rgba(229, 169, 108, 0.14),
        rgba(229, 169, 108, 0.14) 4px,
        rgba(229, 169, 108, 0.28) 4px,
        rgba(229, 169, 108, 0.28) 8px
    );
    border-top: 1px dashed rgba(229, 169, 108, 0.7);
    border-bottom: 1px dashed rgba(229, 169, 108, 0.7);
}

.timeline-range-zone {
    position: absolute;
    min-width: 4px;
    border-radius: 1.5px;
    z-index: 5;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.15s ease, transform 0.12s ease, filter 0.12s ease;
    box-sizing: border-box;
}
.timeline-range-zone.is-own {
    top: 5.5px;
    height: 5px;
    background: var(--accent-brass, #e5a96c);
}
.timeline-range-zone.is-other {
    bottom: 5.5px;
    top: auto;
    height: 5px;
    background: #38bdf8;
}
.timeline-container.range-mode-active .timeline-range-zone {
    opacity: 0.94;
}
.timeline-container.range-mode-active .timeline-range-zone.is-filter-dimmed {
    opacity: 0.34;
}
.timeline-container.range-mode-active .timeline-range-zone:not(.is-filter-dimmed).is-own::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 14px;
    background: rgba(229, 169, 108, 0.14);
    border-left: 1.5px solid rgba(229, 169, 108, 0.75);
    border-right: 1.5px solid rgba(229, 169, 108, 0.75);
    pointer-events: none;
}
.timeline-container.range-mode-active .timeline-range-zone:not(.is-filter-dimmed).is-other::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    height: 14px;
    background: rgba(56, 189, 248, 0.12);
    border-left: 1.5px solid rgba(56, 189, 248, 0.7);
    border-right: 1.5px solid rgba(56, 189, 248, 0.7);
    pointer-events: none;
}
.timeline-range-zone:hover {
    opacity: 1 !important;
    filter: brightness(1.2);
    z-index: 7;
}
.timeline-container.range-mode-full .timeline-range-zone { opacity: 0.5; }
.timeline-container.range-mode-full .timeline-range-zone:hover { opacity: 0.95; }

.timeline-range-del-btn {
    position: absolute; top: -18px; right: -8px; width: 20px; height: 20px;
    line-height: 18px; text-align: center; background: var(--accent-poppy, #e76f51);
    color: #fff; font-size: 11px; font-weight: bold; font-family: var(--font-mono, monospace);
    border-radius: 50%; border: 1px solid #fff; cursor: pointer; display: none; z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.timeline-range-zone:hover .timeline-range-del-btn, .timeline-range-del-btn:hover { display: block; }

.timeline-marker-pin {
    position: absolute;
    width: 9px;
    height: 9px;
    background: transparent;
    z-index: 6;
    cursor: pointer;
    pointer-events: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.95));
    transition: transform 0.12s ease, filter 0.12s ease;
}
.timeline-marker-pin.is-own {
    top: 0px;
    color: var(--accent-brass, #e5a96c);
    z-index: 6;
}
.timeline-marker-pin.is-other {
    bottom: 0px;
    top: auto;
    color: #38bdf8;
    z-index: 5;
}
.timeline-marker-pin::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    transition: background 0.12s ease;
}
.timeline-marker-pin.is-own::after {
    clip-path: polygon(0% 0%, 100% 0%, 100% 55%, 50% 100%, 0% 55%);
}
.timeline-marker-pin.is-other::after {
    clip-path: polygon(50% 0%, 100% 45%, 100% 100%, 0% 100%, 0% 45%);
}
.timeline-marker-pin:hover,
.timeline-marker-pin.is-hovered {
    transform: translateX(-50%) scale(1.4);
    color: #ffffff !important;
    filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.95));
    z-index: 8;
}

@media (pointer: coarse) {
    .timeline-marker-pin::before {
        content: '';
        position: absolute;
        top: -6px;
        bottom: -6px;
        left: -10px;
        right: -10px;
    }
    .timeline-range-zone:active .timeline-range-del-btn {
        display: block;
    }
}

.timeline-segment {
    position: absolute; top: 7px; bottom: 7px; box-sizing: border-box;
    border-right: 1px solid rgba(0, 0, 0, 0.9); transition: background 0.15s ease, box-shadow 0.15s ease;
}
.timeline-segment.even { background: rgba(255, 255, 255, 0.07); }
.timeline-segment.odd { background: rgba(255, 255, 255, 0.14); }
.timeline-segment.is-hovered-segment:not(.active-clip) {
    background: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.timeline-segment.active-clip {
    background: rgba(217, 119, 54, 0.4);
    box-shadow: inset 0 0 0 1px rgba(255, 215, 160, 0.75), inset 0 0 8px rgba(217, 119, 54, 0.65);
    z-index: 3;
}
.timeline-segment.is-circled {
    border-bottom: 2.5px solid var(--accent-sage, #52b788);
}
.global-segment-label {
    position: absolute;
    left: 6px;
    right: 4px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-family: var(--font-mono, monospace);
    font-size: 9.5px;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    transition: color 0.15s ease;
}
.timeline-segment.active-clip .global-segment-label,
.timeline-segment.is-hovered-segment .global-segment-label {
    color: rgba(255, 255, 255, 0.95);
}
.timeline-segment.is-ranged-compact-own::before {
    content: ''; position: absolute; top: -6px; left: 0; right: 0; height: 4.5px; border-radius: 1px;
    background: var(--accent-brass, #e5a96c); opacity: 0.94; transition: opacity 0.15s ease; z-index: 2;
}
.timeline-segment.is-ranged-compact-other::after {
    content: ''; position: absolute; bottom: -6px; top: auto; left: 0; right: 0; height: 4.5px; border-radius: 1px;
    background: #38bdf8; opacity: 0.94; transition: opacity 0.15s ease; z-index: 2;
}
.timeline-container.range-mode-full .timeline-segment.is-ranged-compact-own::before,
.timeline-container.range-mode-full .timeline-segment.is-ranged-compact-other::after {
    opacity: 0.5;
}
.timeline-container.range-mode-active .timeline-segment.is-compact-own-dimmed::before,
.timeline-container.range-mode-active .timeline-segment.is-compact-other-dimmed::after {
    opacity: 0.34;
}
.global-segment-range {
    position: absolute;
    min-width: 4px;
    border-radius: 1.5px;
    opacity: 0.94;
    border: none;
    box-sizing: border-box;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 2;
}
.global-segment-range.is-own {
    top: -6px;
    height: 4.5px;
    background: var(--accent-brass, #e5a96c);
}
.global-segment-range.is-other {
    bottom: -6px;
    top: auto;
    height: 4.5px;
    background: #38bdf8;
}
.timeline-container.range-mode-active .global-segment-range {
    opacity: 0.94;
}
.timeline-container.range-mode-active .global-segment-range.is-filter-dimmed {
    opacity: 0.34;
}
.timeline-container.range-mode-active .global-segment-range:not(.is-filter-dimmed).is-own::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 14px;
    background: rgba(229, 169, 108, 0.14);
    border-left: 1.5px solid rgba(229, 169, 108, 0.75);
    border-right: 1.5px solid rgba(229, 169, 108, 0.75);
    pointer-events: none;
}
.timeline-container.range-mode-active .global-segment-range:not(.is-filter-dimmed).is-other::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    height: 14px;
    background: rgba(56, 189, 248, 0.12);
    border-left: 1.5px solid rgba(56, 189, 248, 0.7);
    border-right: 1.5px solid rgba(56, 189, 248, 0.7);
    pointer-events: none;
}
.timeline-container.range-mode-full .global-segment-range {
    opacity: 0.5;
}
.global-segment-marker {
    position: absolute;
    width: 8px;
    height: 9px;
    transform: translateX(-50%);
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.95));
    opacity: 0.92;
    pointer-events: none;
    transition: transform 0.12s ease, opacity 0.15s ease, background 0.12s ease;
    z-index: 6;
}
.global-segment-marker.is-own {
    top: -11px;
    bottom: auto;
    clip-path: polygon(0% 0%, 100% 0%, 100% 55%, 50% 100%, 0% 55%);
    background: var(--accent-brass, #e5a96c);
    z-index: 6;
}
.global-segment-marker.is-other {
    bottom: -11px;
    top: auto;
    clip-path: polygon(50% 0%, 100% 45%, 100% 100%, 0% 100%, 0% 45%);
    background: #38bdf8;
    z-index: 5;
}
.global-segment-marker.is-cluster {
    width: 11px;
    height: 9px;
}
.global-segment-marker.is-compact {
    width: 7px;
    height: 8px;
}
#global-timeline-container:hover .global-segment-marker,
.timeline-segment.active-clip .global-segment-marker,
.timeline-segment.is-hovered-segment .global-segment-marker {
    opacity: 1;
}
.global-segment-marker.is-hovered {
    opacity: 1;
    transform: translateX(-50%) scale(1.45);
    z-index: 7;
    background: #fff !important;
    filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.95));
}

#timeline-thumbnail-preview,
#global-timeline-thumbnail-preview {
    position: absolute; bottom: calc(100% + 14px); left: 0;
    transform: translateX(-50%); display: none; flex-direction: column;
    align-items: center; background: rgba(10, 11, 15, 0.96);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.22)); border-radius: 6px; padding: 5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85); pointer-events: none; z-index: 20;
    backdrop-filter: blur(5px); will-change: left;
    width: 156px; box-sizing: border-box;
    transition: width 0.12s ease, border-color 0.12s ease;
}
#timeline-thumbnail-preview.has-note-callout,
#global-timeline-thumbnail-preview.has-note-callout {
    width: 268px;
    border-color: rgba(229, 169, 108, 0.5);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.92);
}
#timeline-thumbnail-preview.touch-lingering,
#global-timeline-thumbnail-preview.touch-lingering {
    pointer-events: auto;
    border-color: var(--accent-brass, #e5a96c);
}
#timeline-thumbnail-preview.touch-lingering .global-preview-ann-badge,
#global-timeline-thumbnail-preview.touch-lingering .global-preview-ann-badge {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}
.global-preview-pl-badge {
    width: 100%; box-sizing: border-box;
    font-family: var(--font-mono, monospace); font-size: 9.5px; font-weight: bold;
    color: var(--accent-brass, #e5a96c); background: rgba(229, 169, 108, 0.14);
    border: 1px solid rgba(229, 169, 108, 0.3); border-radius: 3px;
    padding: 2px 5px; margin-bottom: 4px; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#preview-thumb-img,
#global-preview-thumb-img {
    width: 144px; height: 72px; object-fit: cover; border-radius: 3px; background: #000; display: block;
}
.global-preview-clip-name {
    width: 100%; box-sizing: border-box;
    font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 600;
    color: var(--text-primary, #f3f4f6); margin-top: 4px; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#preview-thumb-tc,
#global-preview-thumb-tc {
    font-family: var(--font-mono, monospace); font-size: 11px; font-weight: bold;
    color: var(--accent-brass, #e5a96c); margin-top: 2px; letter-spacing: 0.5px;
    font-feature-settings: "tnum" 1;
}
.global-preview-circle-badge {
    width: 100%; box-sizing: border-box;
    font-family: var(--font-mono, monospace); font-size: 9.5px; font-weight: 600;
    color: var(--accent-sage, #52b788); background: rgba(82, 183, 136, 0.14);
    border: 1px solid rgba(82, 183, 136, 0.35); border-left: 3px solid var(--accent-sage, #52b788);
    border-radius: 3px; padding: 2px 6px; margin-top: 3px; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.has-note-callout .global-preview-circle-badge {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
}
.global-preview-ann-badge {
    width: 100%; box-sizing: border-box;
    font-family: var(--font-mono, monospace); font-size: 9.5px;
    color: #fff; background: rgba(255, 255, 255, 0.08);
    border-left: 2px solid #00e5ff; border-radius: 3px;
    padding: 3px 6px; margin-top: 4px; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.has-note-callout .global-preview-ann-badge {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    background: rgba(5, 6, 9, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left-width: 3px;
    padding: 6px 8px;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}
.ann-callout-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ann-callout-item + .ann-callout-item {
    padding-top: 5px;
    border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.ann-callout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 9.5px;
    line-height: 1.2;
}
.ann-callout-author-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
}
.ann-callout-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ann-callout-author {
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ann-callout-role {
    font-size: 8.5px;
    color: var(--text-secondary, #9ca3af);
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 4px;
    border-radius: 2px;
    flex-shrink: 0;
}
.ann-callout-tc {
    font-size: 9px;
    color: var(--accent-brass, #e5a96c);
    flex-shrink: 0;
    font-feature-settings: "tnum" 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ann-callout-edit-btn,
.ann-callout-del-btn {
    background: rgba(229, 169, 108, 0.18);
    border: 1px solid rgba(229, 169, 108, 0.45);
    color: var(--accent-brass, #e5a96c);
    font-size: 8.5px;
    font-family: var(--font-mono, monospace);
    padding: 1px 5px;
    border-radius: 3px;
    cursor: pointer;
    pointer-events: auto;
}
.ann-callout-edit-btn:hover,
.ann-callout-edit-btn:active {
    background: var(--accent-brass, #e5a96c);
    color: #000;
}
.ann-callout-del-btn {
    background: rgba(231, 111, 81, 0.16);
    border-color: rgba(231, 111, 81, 0.48);
    color: var(--accent-poppy, #e76f51);
}
.ann-callout-del-btn:hover,
.ann-callout-del-btn:active {
    background: var(--accent-poppy, #e76f51);
    color: #fff;
}
.ann-callout-body {
    font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
    font-size: 11px;
    line-height: 1.38;
    color: #f3f4f6;
    white-space: pre-wrap;
    word-break: break-word;
}
.ann-callout-step-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 5px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    color: var(--text-secondary, #9ca3af);
}
.ann-callout-step-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--text-primary, #f3f4f6);
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
}
.ann-callout-step-btn:hover,
.ann-callout-step-btn:active {
    background: var(--accent-brass, #e5a96c);
    border-color: var(--accent-brass, #e5a96c);
    color: #000;
}
.ann-callout-step-pos {
    color: var(--accent-brass, #e5a96c);
    font-weight: bold;
    letter-spacing: 0.4px;
}
.marker-step-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.marker-step-group .marker-step-btn {
    background: #12141b;
    color: var(--text-secondary, #9ca3af);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    height: 24px;
    padding: 0 7px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
.marker-step-group .marker-step-btn:hover {
    color: var(--accent-brass, #e5a96c);
    border-color: var(--accent-brass, #e5a96c);
    background: #191c26;
}
.marker-step-svg {
    display: block;
    pointer-events: none;
    flex-shrink: 0;
}
.playhead-context-pill {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    max-width: min(320px, 88vw);
    background: rgba(10, 11, 15, 0.94);
    border: 1px solid rgba(229, 169, 108, 0.45);
    border-left: 3px solid #00e5ff;
    border-radius: 999px;
    padding: 3px 10px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: var(--text-primary, #f3f4f6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
    cursor: pointer;
    pointer-events: auto;
    z-index: 15;
    user-select: none;
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.playhead-context-pill:hover,
.playhead-context-pill:active {
    border-color: var(--accent-brass, #e5a96c);
    transform: translateX(-50%) scale(1.03);
}

/* --- DRAWERS (Clip-Liste & Notizen) --- */
/* Top margin leaves 60px clearance so top-right User & Shortcuts buttons remain unobstructed above the drawer */
#clip-drawer {
    position: absolute; bottom: calc(100% + 10px); left: 0;
    width: 100%; height: calc(100vh - var(--hud-h, 140px) - 90px); max-height: calc(100vh - var(--hud-h, 140px) - 90px);
    min-width: 360px; min-height: 240px; box-sizing: border-box;
    background: rgba(10, 11, 15, 0.96); border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.25));
    border-radius: 8px; backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.85); display: none; flex-direction: column; z-index: 30;
    overflow: hidden; resize: none;
}

body.hud-docked #clip-drawer {
    height: calc(100vh - var(--docked-hud-h, 145px) - 70px);
    max-height: calc(100vh - var(--docked-hud-h, 145px) - 70px);
}

body.is-fullscreen #clip-drawer {
    height: calc(100vh - var(--hud-h, 140px) - 50px);
    max-height: calc(100vh - var(--hud-h, 140px) - 50px);
}

body.is-fullscreen.hud-docked #clip-drawer {
    height: calc(100vh - var(--docked-hud-h, 145px) - 30px);
    max-height: calc(100vh - var(--docked-hud-h, 145px) - 30px);
}

.ui-overlay-container.drawer-open {
    z-index: 25 !important;
}

.drawer-resize-bar {
    position: absolute; top: 0; left: 0; right: 26px; height: 6px;
    cursor: ns-resize; z-index: 30; transition: background 0.15s ease;
}
.drawer-resize-bar:hover { background: var(--accent-amber, #d97736); }

.drawer-corner-resizer {
    position: absolute; top: 2px; right: 2px; width: 20px; height: 18px;
    cursor: nesw-resize; z-index: 35; display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: var(--text-muted, #777); transition: color 0.15s ease; user-select: none;
}
.drawer-corner-resizer:hover { color: var(--accent-brass, #e5a96c); }

.drawer-header {
    padding: 8px 12px; background: rgba(16, 18, 25, 0.96);
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1)); display: flex;
    justify-content: space-between; align-items: center; font-family: var(--font-mono, monospace);
    font-size: 11px; color: var(--text-secondary, #9ca3af); flex-shrink: 0;
}
.drawer-header-left { display: flex; align-items: center; gap: 8px; }
.drawer-view-modes { display: flex; align-items: center; gap: 4px; }

/* Grid Size Controls */
.drawer-size-group {
    display: inline-flex; gap: 2px; background: #050507; border-radius: 3px; padding: 1px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
}
.btn-drawer-size {
    background: transparent; border: none; color: var(--text-muted, #777); font-family: var(--font-mono, monospace);
    font-size: 9.5px; font-weight: bold; padding: 2px 5px; border-radius: 2px; cursor: pointer; line-height: 1;
}
.btn-drawer-size:hover { color: #fff; }
.btn-drawer-size.active { background: var(--accent-brass, #e5a96c); color: #000; }

.drawer-close-btn { font-size: 11px; cursor: pointer; margin-left: 8px; line-height: 18px; color: var(--text-muted, #888); }
.drawer-close-btn:hover { color: #fff; }

.btn-drawer-mode {
    background: #12141b; color: var(--text-secondary, #9ca3af); border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.2));
    padding: 2px 8px; font-size: 10px; font-family: var(--font-mono, monospace); border-radius: 3px; cursor: pointer;
}
.btn-drawer-mode:hover { color: #fff; border-color: #666; }
.btn-drawer-mode.active {
    background: var(--accent-amber, #d97736); color: #000; border-color: var(--accent-amber, #d97736); font-weight: bold;
}

/* Drawer Group Toggle (Folders vs Scenes) */
.drawer-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    padding: 2px 3px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    margin-left: 8px;
}
.drawer-group-label {
    font-size: 9.5px;
    color: var(--text-muted, #777);
    margin-right: 3px;
    margin-left: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-mono, monospace);
}
.btn-group-pill {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary, #9ca3af);
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.15s ease;
}
.btn-group-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.btn-group-pill.active {
    background: #1e222e;
    color: #fff;
    font-weight: bold;
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-group-pill#btn-group-scenes.active {
    background: var(--accent-brass, #e5a96c);
    color: #000;
    border-color: var(--accent-brass, #e5a96c);
    font-weight: bold;
    box-shadow: 0 0 8px rgba(229, 169, 108, 0.35);
}
.drawer-group-toggle.has-scenes #btn-group-scenes:not(.active) {
    color: var(--accent-brass, #e5a96c);
    border-color: rgba(229, 169, 108, 0.4);
}
.drawer-group-toggle.has-scenes #btn-group-scenes:not(.active):hover {
    background: rgba(229, 169, 108, 0.15);
    color: #fff;
}

.drawer-search-bar {
    display: flex; align-items: center; background: #07080b;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15)); padding: 0 10px;
    flex-shrink: 0; gap: 8px;
}
.drawer-search {
    width: 100%; background: transparent; border: none; color: #fff;
    padding: 8px 4px; font-size: 12px; outline: none; font-family: var(--font-mono, monospace);
}
.btn-collapse-all {
    background: transparent; border: 1px solid var(--border-subtle, rgba(255,255,255,0.15));
    color: var(--text-secondary, #9ca3af); font-size: 9.5px; font-family: var(--font-mono, monospace);
    padding: 2px 7px; border-radius: 3px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.btn-collapse-all:hover { border-color: #777; color: #fff; }

/* Playback Queue & Selective Playback Bar */
.drawer-queue-bar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    background: #0b0c10; border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    padding: 5px 10px; gap: 8px; flex-shrink: 0; font-family: var(--font-mono, monospace);
}
.drawer-queue-modes {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.drawer-queue-label {
    font-size: 9.5px; color: var(--text-muted, #777); text-transform: uppercase;
    letter-spacing: 0.5px; margin-right: 3px;
}
.btn-queue-pill {
    background: #141720; border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-secondary, #9ca3af); font-size: 10px; font-family: var(--font-mono, monospace);
    padding: 2px 8px; border-radius: 3px; cursor: pointer; transition: all 0.15s ease;
}
.btn-queue-pill:hover { color: #fff; border-color: rgba(229, 169, 108, 0.45); }
.btn-queue-pill.active {
    background: rgba(229, 169, 108, 0.2); border-color: var(--accent-brass, #e5a96c);
    color: var(--accent-brass, #e5a96c); font-weight: bold;
}
.btn-queue-logic-toggle {
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    font-size: 9.5px;
    font-weight: bold;
    font-family: var(--font-mono, monospace);
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-queue-logic-toggle:hover {
    background: rgba(56, 189, 248, 0.26);
    color: #fff;
}
.btn-queue-logic-toggle.is-or-mode {
    background: rgba(229, 169, 108, 0.16);
    border-color: rgba(229, 169, 108, 0.55);
    color: var(--accent-brass, #e5a96c);
}
.drawer-selection-actions {
    display: flex; align-items: center; gap: 5px; margin-left: auto;
}
.drawer-sel-count {
    font-size: 10px; color: var(--accent-brass, #e5a96c); font-weight: bold; margin-right: 2px;
}
.btn-sel-action {
    background: #141720; border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-secondary, #9ca3af); font-size: 9.5px; font-family: var(--font-mono, monospace);
    padding: 2px 6px; border-radius: 3px; cursor: pointer;
}
.btn-sel-action:hover { color: #fff; border-color: #888; }
.btn-sel-play {
    background: var(--accent-amber, #e5b869); border: 1px solid var(--accent-amber, #e5b869);
    color: #000; font-size: 10px; font-weight: bold; font-family: var(--font-mono, monospace);
    padding: 2px 9px; border-radius: 3px; cursor: pointer;
}
.btn-sel-play:hover { background: #f0c475; }
.btn-sel-play:disabled { opacity: 0.45; cursor: not-allowed; }

.drawer-clip-checkbox {
    accent-color: var(--accent-amber, #e5b869); cursor: pointer;
    width: 13px; height: 13px; margin: 0 7px 0 0; flex-shrink: 0;
}
.grid-card-select-box {
    position: absolute; bottom: 4px; left: 4px; z-index: 4;
    background: rgba(8, 9, 12, 0.85); border: 1px solid rgba(255,255,255,0.28);
    border-radius: 3px; padding: 2px 4px; display: flex; align-items: center;
}
.grid-card.is-selected-clip {
    border-color: var(--accent-amber, #e5b869);
    box-shadow: 0 0 0 1px rgba(240, 196, 117, 0.45);
}
.drawer-item.is-selected-clip {
    background: rgba(240, 196, 117, 0.12);
}
.group-header-right {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.btn-play-group-only {
    background: rgba(229, 169, 108, 0.12); border: 1px solid rgba(229, 169, 108, 0.35);
    color: var(--accent-brass, #e5a96c); font-size: 9.5px; font-family: var(--font-mono, monospace);
    padding: 1px 6px; border-radius: 3px; cursor: pointer; transition: all 0.15s ease;
}
.btn-play-group-only:hover {
    background: var(--accent-brass, #e5a96c); color: #000;
}
.timeline-segment.playlist-boundary-start {
    border-left: none;
}
.global-timeline-pl-divider {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    border-radius: 1px;
    background: var(--accent-brass, #e5a96c);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 6;
    transform: translateX(-50%);
}

.drawer-content-container {
    overflow-y: auto; flex-grow: 1; height: 100%; min-height: 0; scrollbar-width: thin;
}

/* Group Headers & Collapsible Styles */
.drawer-group-header {
    background: #161922; color: var(--accent-brass, #e5a96c); font-size: 11px; font-weight: bold;
    padding: 7px 12px; border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.06);
    font-family: var(--font-mono, monospace); display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; user-select: none; transition: background 0.15s ease;
}
.drawer-group-header:hover { background: #1e222e; color: #fff; }
.drawer-group-header .group-header-left {
    display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer-group-header .group-toggle-icon {
    display: inline-block; width: 12px; text-align: center; color: var(--accent-amber, #d97736); font-size: 11px;
}
.drawer-group-header .group-count {
    font-size: 10px; color: var(--text-muted, #777); font-weight: normal; font-family: var(--font-mono, monospace);
    margin-left: 8px; flex-shrink: 0;
}

.drawer-list-group { display: flex; flex-direction: column; }
.drawer-list-group-items { display: flex; flex-direction: column; }
.drawer-list-group.is-collapsed .drawer-list-group-items { display: none !important; }

.drawer-grid-group { display: flex; flex-direction: column; gap: 8px; }
.drawer-grid-group.is-collapsed .drawer-grid-group-cards { display: none !important; }

.drawer-list { display: flex; flex-direction: column; }
.drawer-item {
    padding: 8px 12px; display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono, monospace); font-size: 11px; color: var(--text-secondary, #9ca3af);
}
.drawer-item:hover { background: rgba(240, 196, 117, 0.14); color: #fff; }
.drawer-item.active { background: var(--accent-amber, #e5b869); color: #000; font-weight: bold; }
.drawer-item .item-meta-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.drawer-item .item-duration { font-size: 10px; color: var(--text-muted, #5b6370); }
.drawer-item-range-badge {
    background: rgba(229, 169, 108, 0.15); border: 1px solid var(--accent-brass, #e5a96c);
    color: var(--accent-brass, #e5a96c); font-size: 9px; padding: 1px 4px; border-radius: 3px;
}
.drawer-item-marker-badge {
    background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.55);
    color: #38bdf8; font-size: 9px; padding: 1px 4px; border-radius: 3px;
}
.drawer-item.active .drawer-item-range-badge,
.drawer-item.active .drawer-item-marker-badge {
    background: rgba(0, 0, 0, 0.35); border-color: rgba(0, 0, 0, 0.5); color: #fff;
}
.drawer-slate-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(229, 169, 108, 0.15); border: 1px solid rgba(229, 169, 108, 0.4);
    color: var(--accent-brass, #e5a96c); font-size: 10px; font-weight: bold;
    padding: 1px 5px; border-radius: 3px; margin-right: 6px;
    font-family: var(--font-mono, monospace); white-space: nowrap; flex-shrink: 0;
}
.drawer-item.active .drawer-slate-badge {
    background: rgba(0, 0, 0, 0.3); border-color: rgba(0, 0, 0, 0.5); color: #000;
}

/* Drawer Grid with Sizes */
.drawer-grid {
    display: flex; flex-direction: column; gap: 12px; padding: 10px;
    --grid-card-min: 140px; --grid-thumb-h: 78px;
}
.drawer-grid.size-sm { --grid-card-min: 105px; --grid-thumb-h: 60px; }
.drawer-grid.size-md { --grid-card-min: 140px; --grid-thumb-h: 78px; }
.drawer-grid.size-lg { --grid-card-min: 195px; --grid-thumb-h: 108px; }

.drawer-grid-group-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--grid-card-min, 140px), 1fr));
    gap: 10px; padding: 4px 2px;
}
.grid-card {
    background: #12141b; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    border-radius: 6px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: all 0.15s ease;
}
.grid-card:hover { border-color: var(--accent-brass, #e5a96c); transform: translateY(-2px); }
.grid-card.active { border-color: var(--accent-brass, #e5a96c); }
.grid-thumb-box { position: relative; width: 100%; height: var(--grid-thumb-h, 78px); background: #000; overflow: hidden; }
.grid-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono, monospace); font-size: 10px; color: #666; background: #0a0b0f; }
.grid-card-badge { position: absolute; top: 4px; left: 4px; background: var(--accent-sage, #52b788); color: #000; font-size: 9px; font-weight: bold; padding: 1px 4px; border-radius: 2px; z-index: 3; }
.grid-card-top-right-badges {
    position: absolute; top: 4px; right: 4px;
    display: flex; align-items: center; gap: 3px;
    z-index: 3; pointer-events: none;
}
.grid-card-range-badge {
    background: var(--accent-brass, #e5a96c); color: #000;
    font-size: 9px; font-weight: bold; padding: 1px 4px; border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}
.grid-card-marker-badge {
    background: rgba(10, 14, 20, 0.92); color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.65);
    font-size: 9px; font-weight: bold; padding: 1px 4px; border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}
.grid-card-duration { position: absolute; bottom: 6px; right: 4px; background: rgba(0, 0, 0, 0.78); color: var(--accent-brass, #e5a96c); font-size: 9px; padding: 1px 4px; border-radius: 2px; z-index: 3; }
.grid-thumb-mini-timeline {
    position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: rgba(0, 0, 0, 0.65); z-index: 2; pointer-events: none;
}
.grid-mini-range {
    position: absolute; top: 0; bottom: 0; min-width: 2px;
    background: var(--accent-brass, #e5a96c); opacity: 0.92;
}
.grid-mini-range.is-other {
    background: #38bdf8;
}
.grid-mini-marker {
    position: absolute; bottom: 0; width: 2.5px; height: 6px;
    transform: translateX(-50%);
    background: var(--accent-brass, #e5a96c);
    border-radius: 1px 1px 0 0;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.9);
}
.grid-mini-marker.is-other {
    background: #38bdf8;
}
.grid-card-title { padding: 5px 7px; font-family: var(--font-mono, monospace); font-size: 10px; color: var(--text-secondary, #9ca3af); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #0a0b0f; display: flex; flex-direction: column; }
.grid-card-slate-title { font-size: 10px; font-weight: bold; color: var(--accent-brass, #e5a96c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-card-subfile { font-size: 9px; color: var(--text-tertiary, #777); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* Notes Drawer */
#notes-drawer {
    position: absolute; bottom: calc(100% + 10px); right: 0;
    width: 480px; max-width: 92vw; max-height: 520px;
    background: rgba(10, 11, 15, 0.96); border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.25));
    border-radius: 8px; backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.85); display: none; flex-direction: column; z-index: 16; overflow: hidden;
    font-family: var(--font-mono, monospace);
}
.notes-header {
    padding: 8px 12px; background: rgba(16, 18, 25, 0.96);
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1)); display: flex;
    justify-content: space-between; align-items: center; font-size: 11px; color: var(--accent-brass, #e5a96c);
}
.notes-scope-bar {
    display: flex;
    gap: 4px;
    padding: 5px 8px;
    background: #07080b;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
}
.notes-scope-btn {
    flex: 1;
    background: #12141b;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-secondary, #9ca3af);
    font-family: var(--font-mono, monospace);
    font-size: 9.5px;
    padding: 3px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.notes-scope-btn:hover {
    color: #fff;
    border-color: rgba(229, 169, 108, 0.45);
}
.notes-scope-btn.active {
    background: rgba(229, 169, 108, 0.2);
    border-color: var(--accent-brass, #e5a96c);
    color: var(--accent-brass, #e5a96c);
    font-weight: bold;
}
.notes-tabs-bar { display: flex; background: #0a0b0f; border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15)); }
.notes-tab-btn {
    flex: 1; background: transparent; border: none; border-bottom: 2px solid transparent;
    color: var(--text-muted, #5b6370); font-family: var(--font-mono, monospace); font-size: 11px;
    padding: 7px 4px; cursor: pointer; border-radius: 0;
}
.notes-tab-btn.active { color: var(--accent-brass, #e5a96c); border-bottom-color: var(--accent-brass, #e5a96c); font-weight: bold; }
.notes-list { overflow-y: auto; flex-grow: 1; max-height: 420px; padding: 10px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }

.drawer-user-group {
    display: flex; flex-direction: column; gap: 6px; background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15)); border-radius: 6px; padding: 8px;
}
.drawer-user-group-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 11px;
}
.drawer-user-title { display: flex; align-items: center; gap: 6px; font-weight: bold; }
.user-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.btn-fork-group { background: #12141b; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.2)); color: var(--text-secondary, #9ca3af); font-size: 10px; padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.btn-fork-group:hover { color: #fff; border-color: var(--accent-brass, #e5a96c); }

.note-card {
    background: #12141b; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    border-radius: 4px; padding: 7px 9px; display: flex; flex-direction: column; gap: 5px;
}
.note-card.is-active-clip {
    border-color: rgba(229, 169, 108, 0.45);
    background: rgba(229, 169, 108, 0.06);
}
.note-clip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    color: var(--text-secondary, #9ca3af);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 3px;
    padding: 1px 5px;
    cursor: pointer;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-clip-badge:hover {
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
}
.note-clip-badge.is-active {
    color: var(--accent-brass, #e5a96c);
    border-color: rgba(229, 169, 108, 0.45);
    background: rgba(229, 169, 108, 0.14);
}
.note-clip-badge.is-filtered-out {
    border-style: dashed;
    opacity: 0.85;
}
.note-slate-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: bold;
    color: var(--accent-brass, #e5a96c);
    background: rgba(229, 169, 108, 0.14);
    border: 1px solid rgba(229, 169, 108, 0.38);
    border-radius: 3px;
    padding: 1px 5px;
    cursor: pointer;
    white-space: nowrap;
}
.note-slate-badge:hover {
    background: var(--accent-brass, #e5a96c);
    color: #000;
}
.note-card.is-range { border-left-width: 4px !important; }
.note-card:hover { border-color: #666; }
.note-card-top { display: flex; justify-content: space-between; align-items: center; }
.note-tc-link { font-weight: bold; cursor: pointer; font-size: 11px; padding: 2px 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.05); }
.note-tc-link:hover { background: rgba(255, 255, 255, 0.2); text-decoration: underline; }
.note-actions { display: flex; gap: 5px; align-items: center; }
.btn-note-action { background: transparent; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.2)); color: var(--text-muted, #5b6370); cursor: pointer; font-size: 10px; font-family: var(--font-mono, monospace); padding: 2px 5px; border-radius: 3px; }
.btn-note-action:hover { color: #fff; border-color: #fff; background: #262b38; }
.btn-note-action.btn-fork:hover { color: var(--accent-brass, #e5a96c); border-color: var(--accent-brass, #e5a96c); }
.btn-note-del:hover { color: #fff; background: var(--accent-poppy, #e76f51); border-color: var(--accent-poppy, #e76f51); }
.note-text-content { font-size: 11px; color: var(--text-primary, #f3f4f6); white-space: pre-wrap; word-break: break-word; line-height: 1.35; }

/* --- ANNOTATION MODAL --- */
#annotation-modal {
    position: absolute; bottom: calc(100% + 15px); right: 0;
    width: 360px; max-width: 90vw; background: rgba(10, 11, 15, 0.98);
    border: 1px solid var(--border-highlight, rgba(229, 169, 108, 0.4)); border-radius: 8px; padding: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.9); display: none; flex-direction: column; gap: 8px; z-index: 25;
    font-family: var(--font-mono, monospace);
}
.ann-modal-header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--accent-brass, #e5a96c); }
#ann-text-input {
    background: #050507; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    color: #fff; padding: 8px 10px; font-size: 12px; font-family: var(--font-mono, monospace);
    border-radius: 4px; outline: none; width: 100%; box-sizing: border-box; resize: none;
}
#ann-text-input:focus { border-color: var(--accent-brass, #e5a96c); }
.ann-modal-buttons { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.ann-modal-delete-btn {
    margin-right: auto;
    background: rgba(231, 111, 81, 0.14);
    border: 1px solid rgba(231, 111, 81, 0.45);
    color: var(--accent-poppy, #e76f51);
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    align-items: center;
    gap: 4px;
}
.ann-modal-delete-btn:hover,
.ann-modal-delete-btn:active {
    background: var(--accent-poppy, #e76f51);
    color: #fff;
}

/* --- DIALOG MODALS: AUTH, HELP, CUSTOM --- */
/* WICHTIG: play-overlay ist anfangs flex, help-overlay & custom-modal sind anfangs display: none ! */
#play-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(circle at 22% 18%, rgba(0, 216, 255, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 78% 82%, rgba(255, 0, 106, 0.05) 0%, transparent 48%),
        rgba(5, 5, 7, 0.92);
    backdrop-filter: blur(10px);
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 15px; z-index: 20;
    overflow: hidden;
}

/* RegardingPicture.com Signature LED Dot-Matrix auf dem Start-/Login-/Portal-Screen */
#play-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 216, 255, 0.18) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 35%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 35%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

#play-overlay > * {
    position: relative;
    z-index: 1;
}

#help-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 7, 0.88); backdrop-filter: blur(8px);
    display: none; /* Exakt wie im Original: erst bei H oder Klick sichtbar! */
    justify-content: center; align-items: center; z-index: 30;
}

#custom-modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 7, 0.82); backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center; z-index: 60;
}

.auth-card {
    position: relative;
    background: rgba(11, 12, 16, 0.94); padding: 24px 30px; border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; flex-direction: column; gap: 12px; align-items: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.88), 0 0 36px rgba(0, 216, 255, 0.05);
    max-width: 450px; width: 90vw; text-align: center; box-sizing: border-box;
}

/* Signature RegardingPicture 1px Cyan-to-Pink Gradient Border Mask */
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 216, 255, 0.45), rgba(255, 255, 255, 0.08) 48%, rgba(255, 0, 106, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.auth-brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}
.auth-brand-logo {
    height: 36px;
    max-width: 225px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(0, 216, 255, 0.22));
}

.auth-legal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: var(--text-muted, #5b6370);
    letter-spacing: 0.4px;
    margin-top: -4px;
}
.auth-input-wrapper { display: flex; gap: 6px; width: 100%; }
.auth-input {
    background: #06070a; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.18)); color: #fff;
    padding: 10px 14px; border-radius: 6px; font-size: 14px; outline: none; flex-grow: 1; text-align: center; letter-spacing: 1px;
}
.auth-input:focus { border-color: var(--accent-amber, #d97736); }
.auth-clear-btn {
    background: #12141b; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15)); color: var(--text-muted, #5b6370);
    border-radius: 6px; font-size: 11px; padding: 0 10px; cursor: pointer;
}
.auth-clear-btn:hover { color: #fff; background: #191c26; }

.identity-container {
    width: 100%; display: flex; flex-direction: column; gap: 8px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1)); padding-top: 10px; margin-top: 2px;
}
.identity-greeting-box {
    background: rgba(229, 169, 108, 0.08); border: 1px solid var(--border-highlight, rgba(229, 169, 108, 0.3));
    border-radius: 6px; padding: 10px; display: flex; justify-content: space-between; align-items: center; width: 100%;
    box-sizing: border-box; font-family: var(--font-mono, monospace); font-size: 12px;
}
.greeting-text { color: var(--text-primary, #f3f4f6); text-align: left; }
.greeting-text strong { color: var(--accent-brass, #e5a96c); }
.btn-switch-identity {
    background: #12141b; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.2)); color: var(--text-secondary, #9ca3af);
    font-size: 10px; padding: 4px 8px; border-radius: 4px; cursor: pointer;
}
.btn-switch-identity:hover { color: #fff; border-color: var(--accent-brass, #e5a96c); }

.identity-title { font-size: 11px; color: var(--text-secondary, #9ca3af); font-family: var(--font-mono, monospace); text-align: left; letter-spacing: 1px; font-weight: bold; }
.user-name-input {
    width: 100%; background: #06070a; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.18));
    color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 12px; font-family: var(--font-mono, monospace); outline: none; box-sizing: border-box;
}
.user-name-input:focus { border-color: var(--accent-brass, #e5a96c); }
.role-picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.btn-role-opt {
    background: #12141b; border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.18)); color: var(--text-secondary, #9ca3af);
    padding: 8px 4px; font-size: 11px; font-family: var(--font-mono, monospace); border-radius: 5px; cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
}
.btn-role-opt:hover { border-color: var(--accent-brass, #e5a96c); color: #fff; }
.btn-role-opt.active {
    background: rgba(217, 119, 54, 0.18); border-color: var(--accent-amber, #d97736); color: var(--accent-brass, #e5a96c); font-weight: bold;
}
.identity-error-msg { color: var(--accent-poppy, #e76f51); font-size: 11px; font-family: var(--font-mono, monospace); text-align: left; display: none; }

#start-btn {
    font-size: 15px; font-family: var(--font-display, var(--font-sans, sans-serif)); letter-spacing: 0.3px;
    padding: 12px 24px; background: var(--accent-amber, #d97736); border: none;
    border-radius: 24px; color: #000; font-weight: 700; cursor: pointer; width: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 18px rgba(217, 119, 54, 0.22);
    transition: opacity 0.2s, transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease; margin-top: 4px;
}
#start-btn:hover {
    opacity: 0.96;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 22px rgba(217, 119, 54, 0.35);
}
#btn-submit-inline-viewer:hover,
.portal-cta-shimmer:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 6px 18px rgba(0, 0, 0, 0.55) !important;
}
.shortcuts-hint { font-size: 11px; color: var(--text-muted, #5b6370); text-align: center; line-height: 1.4; }
.missing-id-box {
    color: var(--accent-brass, #e5a96c); font-size: 13px; line-height: 1.5; font-family: var(--font-mono, monospace);
    padding: 10px; background: rgba(229, 169, 108, 0.1); border: 1px solid var(--border-highlight, rgba(229, 169, 108, 0.3)); border-radius: 6px;
}

/* --- UPGRADED VISUAL HELP CARD LAYOUT --- */
.help-card {
    background: #0b0c10;
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.2));
    border-radius: 12px;
    padding: 20px 24px;
    width: 780px;
    max-width: 94vw;
    color: var(--text-primary, #f3f4f6);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.92);
    font-family: var(--font-ui, Arial, sans-serif);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.help-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    padding-bottom: 10px;
}
.help-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-brass, #e5a96c);
    letter-spacing: 0.7px;
    font-family: var(--font-display, var(--font-mono, monospace));
}
.help-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    color: var(--text-muted, #9ca3af);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 8px;
    transition: all 0.15s ease;
}
.help-close-btn:hover {
    color: #fff;
    border-color: var(--accent-brass, #e5a96c);
    background: rgba(229, 169, 108, 0.14);
}

.help-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
.help-sections-grid > .help-section-box:only-child,
.help-sections-grid > .help-section-box:first-child:nth-last-child(1) {
    grid-column: 1 / -1;
}
@media (max-width: 720px) {
    .help-sections-grid {
        grid-template-columns: 1fr;
    }
}

.help-section-box {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    box-sizing: border-box;
}
.help-section-heading {
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: var(--accent-brass, #e5a96c);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 5px;
}

.help-io-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: rgba(229, 169, 108, 0.07);
    border: 1px solid rgba(229, 169, 108, 0.24);
    border-radius: 6px;
    padding: 5px 9px;
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    color: var(--text-primary, #f3f4f6);
}
.help-io-flow .io-step {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.help-io-flow .io-arrow {
    color: var(--accent-brass, #e5a96c);
    font-size: 11px;
    opacity: 0.75;
}

/* 2-Spalten-Grid für Shortcuts mit Keycaps */
.shortcuts-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 6px;
    column-gap: 10px;
    align-items: center;
    font-size: 11.5px;
    font-family: var(--font-mono, monospace);
}
.shortcut-key {
    color: var(--accent-brass, #e5a96c);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}
.shortcut-desc {
    color: var(--text-secondary, #d1d5db);
    line-height: 1.3;
    font-family: var(--font-ui, system-ui, sans-serif);
    font-size: 11.5px;
}

.kbd-cap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: linear-gradient(180deg, #1d202b 0%, #101218 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: 2px solid rgba(0, 0, 0, 0.85);
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.6);
    color: #f3f4f6;
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}
.kbd-cap.kbd-accent {
    background: linear-gradient(180deg, rgba(229, 169, 108, 0.28) 0%, rgba(217, 119, 54, 0.16) 100%);
    border-color: rgba(229, 169, 108, 0.55);
    color: var(--accent-brass, #e5a96c);
}
.kbd-cap.kbd-mod {
    font-size: 9.5px;
    height: 18px;
    padding: 0 6px;
    color: var(--accent-brass, #e5a96c);
    border-color: rgba(229, 169, 108, 0.4);
}
.kbd-inline {
    display: inline-block;
    padding: 0 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 3px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: var(--accent-brass, #e5a96c);
}

/* 360° & 3D Previz Section + Visual WASD + Q/E Keyblock */
.help-360-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
}
@media (max-width: 680px) {
    .help-360-layout {
        grid-template-columns: 1fr;
    }
}
.wasd-cluster-card {
    background: rgba(7, 8, 11, 0.82);
    border: 1px solid rgba(229, 169, 108, 0.28);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wasd-cluster-title {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: var(--text-secondary, #9ca3af);
}
.wasd-keyblock {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}
.wasd-row {
    display: flex;
    gap: 4px;
}
.wasd-key {
    width: 44px;
    height: 36px;
    background: linear-gradient(180deg, #1b1e28 0%, #0f1117 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 3px solid #040507;
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-family: var(--font-mono, monospace);
    box-sizing: border-box;
}
.wasd-key.is-primary {
    background: linear-gradient(180deg, rgba(229, 169, 108, 0.24) 0%, rgba(18, 20, 27, 0.95) 100%);
    border-color: rgba(229, 169, 108, 0.52);
}
.wasd-key .wk-char {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.wasd-key.is-primary .wk-char {
    color: var(--accent-brass, #e5a96c);
}
.wasd-key .wk-sub {
    font-size: 8px;
    color: var(--text-secondary, #9ca3af);
    letter-spacing: 0.2px;
    line-height: 1;
}
.wasd-mod-hint {
    font-family: var(--font-mono, monospace);
    font-size: 9.5px;
    color: var(--text-secondary, #9ca3af);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}

/* Touch & Tablet Gestures Grid */
.help-touch-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
@media (max-width: 720px) {
    .help-touch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .help-touch-grid {
        grid-template-columns: 1fr;
    }
}
.touch-gesture-item {
    background: rgba(7, 8, 11, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tg-badge {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-brass, #e5a96c);
}
.tg-desc {
    font-size: 10.5px;
    color: var(--text-secondary, #d1d5db);
    line-height: 1.3;
}

.help-copyright {
    margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    text-align: center; font-size: 10px; color: var(--text-muted, #5b6370); letter-spacing: 0.5px;
    font-family: var(--font-mono, monospace);
}
.help-oss-toggle-btn {
    background: none;
    border: none;
    color: var(--accent-brass, #e5a96c);
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    letter-spacing: 0.4px;
    cursor: pointer;
    padding: 0 2px;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: 0.85;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.help-oss-toggle-btn:hover {
    opacity: 1;
    color: #fff;
}
.help-oss-credits {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.45;
    letter-spacing: 0.2px;
    color: var(--text-secondary, #9ca3af);
}
.help-oss-section + .help-oss-section {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.help-oss-heading {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--accent-brass, #e5a96c);
    letter-spacing: 0.6px;
    margin-bottom: 3px;
}
.help-oss-item {
    font-size: 10px;
    color: var(--text-secondary, #9ca3af);
}
.help-oss-item strong {
    color: var(--text-primary, #f3f4f6);
    font-weight: 600;
}
.help-oss-item span {
    color: var(--text-muted, #6b7280);
}
.help-oss-license-link-row {
    text-align: center;
}
.help-oss-license-link {
    color: var(--accent-brass, #e5a96c);
    font-size: 9.5px;
    text-decoration: none;
    letter-spacing: 0.3px;
    opacity: 0.9;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.help-oss-license-link:hover {
    opacity: 1;
    color: #fff;
    text-decoration: underline;
}

/* Custom Modal */
.custom-modal-card {
    background: #0b0c10; border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.25));
    border-radius: 8px; padding: 22px 26px; width: 440px; max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95); display: flex; flex-direction: column; gap: 14px;
    font-family: var(--font-mono, monospace); text-align: left;
}
.custom-modal-title { font-size: 13px; font-weight: bold; color: var(--accent-brass, #e5a96c); letter-spacing: 0.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); padding-bottom: 6px; }
.custom-modal-msg { font-size: 12px; color: var(--text-primary, #f3f4f6); line-height: 1.5; white-space: pre-line; word-break: break-word; }
.custom-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.btn-modal-action { font-family: var(--font-mono, monospace); font-size: 11px; padding: 6px 14px; border-radius: 4px; cursor: pointer; }
.btn-modal-cancel { background: #12141b; border: 1px solid #3f4654; color: #9ca3af; }
.btn-modal-cancel:hover { color: #fff; border-color: #888; }
.btn-modal-confirm { background: var(--accent-amber, #d97736); border: 1px solid var(--accent-amber, #d97736); color: #000; font-weight: bold; }
.btn-modal-confirm:hover { background: #e28546; }

/* --- 3D VEHICLE RIGGING & CALIBRATION PANEL --- */
.calib-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; z-index: 99999;
}
.calib-pin-card {
    background: #0b0c10; border: 1px solid var(--accent-brass, #e5a96c);
    border-radius: 8px; padding: 22px; width: 340px; max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0,0,0,0.95); font-family: var(--font-mono, monospace);
    margin: auto;
}
.calib-pin-header {
    display: flex; justify-content: space-between; align-items: center;
    color: var(--accent-brass, #e5a96c); font-weight: bold; font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 8px;
}
.calib-pin-input {
    width: 100%; box-sizing: border-box; background: #050507;
    border: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
    padding: 8px 12px; font-size: 16px; font-family: monospace;
    border-radius: 4px; text-align: center; letter-spacing: 4px;
}
.calib-pin-input:focus { border-color: var(--accent-brass, #e5a96c); outline: none; }
.calib-btn-prim {
    background: var(--accent-amber, #d97736); border: 1px solid var(--accent-amber, #d97736);
    color: #000; font-weight: bold; font-family: var(--font-mono, monospace);
    font-size: 11px; padding: 6px 12px; border-radius: 4px; cursor: pointer;
}
.calib-btn-sec {
    background: #141720; border: 1px solid #3f4654; color: #d1d5db;
    font-family: var(--font-mono, monospace); font-size: 11px;
    padding: 6px 12px; border-radius: 4px; cursor: pointer;
}
.calib-btn-danger {
    background: #331515; border: 1px solid #772222; color: #ff8888;
    font-family: var(--font-mono, monospace); font-size: 11px;
    padding: 6px 10px; border-radius: 4px; cursor: pointer;
}
.calib-btn-prim:hover { background: #e28546; }
.calib-btn-sec:hover { color: #fff; border-color: #888; }
.calib-btn-danger:hover { background: #441a1a; color: #fff; }

.calib-panel {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 360px; max-width: calc(100vw - 24px);
    max-height: calc(100vh - 30px);
    background: rgba(10, 11, 15, 0.96); border: 1px solid var(--accent-brass, #e5a96c);
    border-radius: 8px; box-shadow: 0 14px 50px rgba(0,0,0,0.95);
    backdrop-filter: blur(12px); z-index: 9000; font-family: var(--font-mono, monospace);
    display: none; flex-direction: column; overflow: hidden;
}
.calib-panel-header {
    background: #0b0c10; padding: 10px 14px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--accent-brass, #e5a96c); font-size: 12px; font-weight: bold;
    cursor: move; user-select: none; touch-action: none; flex-shrink: 0;
}
.calib-icon-btn {
    background: none; border: none; color: #888; font-size: 13px; cursor: pointer; padding: 2px 6px;
}
.calib-icon-btn:hover { color: #fff; }
.calib-panel-body {
    padding: 10px 12px; max-height: calc(100vh - 90px); overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column; gap: 6px;
}
.calib-accordion {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    transition: all 0.15s ease;
}
.calib-acc-header {
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.calib-acc-header:hover {
    background: rgba(229, 169, 108, 0.12);
}
.calib-acc-title {
    font-size: 11px;
    font-weight: bold;
    color: var(--accent-brass, #e5a96c);
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.calib-acc-icon {
    font-size: 8px;
    color: #888;
    transition: transform 0.2s ease;
}
.calib-accordion.collapsed .calib-acc-icon {
    transform: rotate(-90deg);
}
.calib-accordion.collapsed .calib-acc-content {
    display: none;
}
.calib-acc-content {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.calib-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #d1d5db; }
.calib-select {
    background: #050507; border: 1px solid #3f4654; color: #fff; padding: 4px 8px;
    font-family: var(--font-mono, monospace); font-size: 11px; border-radius: 4px; outline: none;
}
.calib-divider {
    font-size: 10px; font-weight: bold; color: var(--accent-brass, #e5a96c);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 3px; margin-top: 6px;
    letter-spacing: 0.5px;
}
.calib-grid { display: flex; flex-direction: column; gap: 6px; }
.calib-input-group {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: #9ca3af;
}
.calib-input-group label { width: 110px; flex-shrink: 0; }
.calib-input-group input[type="range"] { flex: 1; accent-color: var(--accent-brass, #e5a96c); height: 4px; }
.calib-input-group span { width: 45px; text-align: right; color: #fff; font-size: 10px; }
.calib-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.calib-status-msg { font-size: 11px; min-height: 16px; margin-top: 4px; font-weight: bold; }

.calib-restore-pill {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 8500;
    background: rgba(10, 11, 15, 0.9);
    border: 1px solid var(--accent-brass, #e5a96c);
    color: var(--accent-brass, #e5a96c);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: bold;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.calib-restore-pill:hover {
    background: var(--accent-amber, #d97736);
    color: #000;
    border-color: var(--accent-amber, #d97736);
    box-shadow: 0 6px 20px rgba(217, 119, 54, 0.45);
    transform: translateY(-1px);
}

/* ==========================================================================
   SCREENING & REVIEW PORTAL — LOGIN & PROJECT SELECTION HUB
   ========================================================================== */
body.portal-active .ui-overlay-container,
body.portal-active #radar-wrapper,
body.portal-active #player-top-right-tools,
body.portal-active #hud-restore-btn {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

body.portal-active #play-overlay {
    background:
        radial-gradient(circle at 22% 18%, rgba(0, 216, 255, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 78% 82%, rgba(255, 0, 106, 0.06) 0%, transparent 48%),
        radial-gradient(circle at 50% 24%, rgba(18, 22, 32, 0.95) 0%, rgba(5, 5, 7, 0.98) 75%);
    backdrop-filter: blur(12px);
}

.auth-card.portal-login-card {
    max-width: 430px;
    width: 92vw;
    padding: 28px 30px;
    align-items: stretch;
    text-align: left;
    gap: 16px;
    background: rgba(11, 12, 16, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.92), 0 0 40px rgba(0, 216, 255, 0.06);
}

.auth-card.portal-card {
    max-width: 720px;
    width: 94vw;
    padding: 22px 26px;
    align-items: stretch;
    text-align: left;
    gap: 14px;
    background: rgba(11, 12, 16, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 24px 68px rgba(0, 0, 0, 0.94), 0 0 45px rgba(0, 216, 255, 0.06);
}

/* --- Portal Top Identity Bar --- */
.portal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.portal-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.portal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 216, 255, 0.14), rgba(229, 169, 108, 0.18));
    border: 1px solid rgba(0, 216, 255, 0.35);
    color: var(--accent-brass, #e5a96c);
    font-family: var(--font-mono, monospace);
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.portal-user-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    text-align: left;
}

.portal-user-top {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.portal-user-name {
    font-family: var(--font-display, var(--font-sans, sans-serif));
    font-size: 15px;
    font-weight: 700;
    color: #f3f4f6;
    letter-spacing: 0.2px;
}

.portal-role-pill {
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #d1d5db;
    white-space: nowrap;
}

.portal-perm-pill {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}
.portal-perm-pill.is-review {
    background: rgba(229, 169, 108, 0.14);
    border: 1px solid rgba(229, 169, 108, 0.35);
    color: var(--accent-brass, #e5a96c);
}
.portal-perm-pill.is-view {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
}

.portal-user-sub {
    font-size: 11px;
    color: #7d8594;
    font-family: var(--font-mono, monospace);
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.portal-action-btn {
    background: #141720;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #d1d5db;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}
.portal-action-btn:hover {
    background: #1c202c;
    color: #fff;
    border-color: rgba(229, 169, 108, 0.45);
}
.portal-action-btn.is-accent {
    color: var(--accent-brass, #e5a96c);
    border-color: rgba(229, 169, 108, 0.38);
    background: rgba(229, 169, 108, 0.08);
}
.portal-action-btn.is-accent:hover {
    background: rgba(229, 169, 108, 0.16);
    border-color: var(--accent-brass, #e5a96c);
}
.portal-action-btn.is-danger {
    color: #e76f51;
    border-color: rgba(231, 111, 81, 0.35);
}
.portal-action-btn.is-danger:hover {
    background: rgba(231, 111, 81, 0.12);
    border-color: #e76f51;
    color: #ff8b70;
}

/* --- Toolbar: Section Heading + Search + View Switcher --- */
.portal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 800;
    color: #9ca3af;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.portal-count-pill {
    background: rgba(229, 169, 108, 0.15);
    border: 1px solid rgba(229, 169, 108, 0.35);
    color: var(--accent-brass, #e5a96c);
    font-size: 10.5px;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
}

.portal-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    min-width: 200px;
}

.portal-search-input {
    background: #06070a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f3f4f6;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
    width: 190px;
    max-width: 100%;
    transition: border-color 0.15s ease, width 0.2s ease;
}
.portal-search-input:focus {
    border-color: var(--accent-brass, #e5a96c);
    width: 230px;
}

.portal-view-switch {
    display: inline-flex;
    background: #06070a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.portal-view-btn {
    background: transparent;
    border: none;
    color: #7d8594;
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.portal-view-btn:hover {
    color: #e5e7eb;
}
.portal-view-btn.active {
    background: rgba(229, 169, 108, 0.18);
    color: var(--accent-brass, #e5a96c);
}

/* --- Projects List & Grid Container --- */
.portal-projects-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.portal-projects-container.is-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

@media (max-width: 620px) {
    .portal-projects-container.is-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Individual Project Card --- */
.portal-project-card {
    background: rgba(255, 255, 255, 0.028);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
    text-align: left;
    box-sizing: border-box;
}

.portal-project-card:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(0, 216, 255, 0.38);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 216, 255, 0.06);
}

.portal-project-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.portal-project-left {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    flex: 1;
}

.portal-project-logo-box {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #06070a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.portal-project-logo-box.is-fallback {
    background: linear-gradient(135deg, rgba(0, 216, 255, 0.1), rgba(11, 12, 16, 0.95));
    border-color: rgba(0, 216, 255, 0.25);
    font-size: 20px;
}

.portal-project-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
}

.portal-project-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.portal-project-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.portal-project-title {
    font-family: var(--font-display, var(--font-sans, sans-serif));
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.portal-proj-badge {
    font-family: var(--font-mono, monospace);
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.portal-proj-badge.is-360 {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}
.portal-proj-badge.is-2d {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #9ca3af;
}

.portal-project-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: #9ca3af;
}

.portal-prod-name {
    color: #d1d5db;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.portal-meta-sep {
    color: rgba(255, 255, 255, 0.2);
}

.portal-meta-stats {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    color: #7d8594;
}

.portal-open-btn {
    background: var(--accent-brass, #e5a96c);
    color: #0b0c10;
    font-family: var(--font-mono, monospace);
    font-weight: 800;
    font-size: 11.5px;
    padding: 8px 14px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 3px 10px rgba(0, 0, 0, 0.45);
}
.portal-project-main:hover .portal-open-btn {
    background: #f0b87d;
    transform: translateY(-1px) translateX(1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 5px 14px rgba(0, 0, 0, 0.55);
}

/* Grid adjustments for .portal-project-card */
.portal-projects-container.is-grid .portal-project-main {
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
}
.portal-projects-container.is-grid .portal-open-btn {
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 7px 12px;
}

/* --- Sub-Playlists Section inside a Project Card --- */
.portal-playlists-section {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.portal-playlists-label {
    font-family: var(--font-mono, monospace);
    font-size: 9.5px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.portal-projects-container.is-grid .portal-playlists-grid {
    grid-template-columns: 1fr;
}

.portal-playlist-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    text-decoration: none;
    font-size: 11.5px;
    transition: all 0.14s ease;
    min-width: 0;
}
.portal-playlist-chip:hover {
    background: rgba(229, 169, 108, 0.12);
    border-color: rgba(229, 169, 108, 0.4);
    color: #fff;
}

.portal-playlist-chip-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.portal-playlist-chip-meta {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: #7d8594;
    white-space: nowrap;
    flex-shrink: 0;
}
.portal-playlist-chip:hover .portal-playlist-chip-meta {
    color: var(--accent-brass, #e5a96c);
}

/* ==========================================================================
   TABLET & TOUCH OPTIMIZATIONS (iPadOS / Android Tablets / Smartphones)
   Desktop remains 100% untouched — rules only apply under body.is-touch-device
   ========================================================================== */

body.is-touch-device #start-shortcuts-hint {
    display: none;
}

body.is-touch-device .touch-only-btn {
    display: inline-flex;
}

body.is-touch-device.playlist-mode-2d #btn-gyro-hud {
    display: none !important;
}

/* Safe-Area Insets for iPadOS Home Indicator & Notch */
body.is-touch-device .ui-overlay-container {
    bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 10px));
    width: calc(100vw - max(24px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px) + 20px));
}

body.is-touch-device.hud-docked .ui-overlay-container {
    bottom: 0;
    width: 100vw;
    padding-bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    padding-left: max(15px, calc(env(safe-area-inset-left, 0px) + 12px));
    padding-right: max(15px, calc(env(safe-area-inset-right, 0px) + 12px));
}
body.is-touch-device.hud-docked .hud-top-actions {
    right: max(14px, calc(env(safe-area-inset-right, 0px) + 12px));
}
body.is-touch-device.hud-docked .hud-top-left {
    left: max(14px, calc(env(safe-area-inset-left, 0px) + 12px));
}

body.is-touch-device #hud-restore-btn {
    bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 14px));
    right: max(20px, calc(env(safe-area-inset-right, 0px) + 14px));
    padding: 10px 16px;
    font-size: 12px;
}

body.is-touch-device #player-top-right-tools {
    top: max(16px, calc(env(safe-area-inset-top, 0px) + 12px));
    right: max(18px, calc(env(safe-area-inset-right, 0px) + 14px));
}

/* Prevent iOS Safari auto-zoom on text inputs (requires >= 16px font-size) */
body.is-touch-device #auth-password,
body.is-touch-device #user-name-input,
body.is-touch-device #drawer-search,
body.is-touch-device #ann-text-input,
body.is-touch-device #calib-pin-input,
body.is-touch-device #inline-viewer-user,
body.is-touch-device #inline-viewer-pass,
body.is-touch-device #portal-login-user,
body.is-touch-device #portal-login-pass,
body.is-touch-device #portal-old-pw,
body.is-touch-device #portal-new-pw,
body.is-touch-device #portal-project-search {
    font-size: 16px !important;
}

/* Ergonomic Touch Targets (Buttons, Selects, Scrubbers) */
body.is-touch-device .hud-top-actions button,
body.is-touch-device .hud-top-actions #btn-toggle-car,
body.is-touch-device #btn-toggle-playlist,
body.is-touch-device #btn-circle-take,
body.is-touch-device #btn-add-marker,
body.is-touch-device #btn-toggle-notes,
body.is-touch-device #btn-360,
body.is-touch-device #btn-flat,
body.is-touch-device #btn-touch-roll-mode,
body.is-touch-device #btn-toggle-car,
body.is-touch-device #btn-loop-mode,
body.is-touch-device #btn-range-mode,
body.is-touch-device .radar-preset-btn,
body.is-touch-device .marker-step-group .marker-step-btn,
body.is-touch-device .team-tracks-hint-btn {
    min-height: 32px;
    height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

body.is-touch-device #hud-camera-select,
body.is-touch-device #car-seat-select,
body.is-touch-device #car-model-select,
body.is-touch-device #ratio-select,
body.is-touch-device #hud-quality-select,
body.is-touch-device #range-user-filter-select {
    min-height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
    touch-action: manipulation;
}

body.is-touch-device #hud-focal {
    min-height: 30px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Audio Control on Tablet: larger tap target & wider slider when expanded */
body.is-touch-device .hud-audio-control {
    height: 30px;
}
body.is-touch-device .btn-audio-mute {
    width: 32px;
    height: 28px;
    touch-action: manipulation;
}
body.is-touch-device .hud-audio-control.is-expanded:not(.no-audio) .hud-audio-slider-wrap {
    max-width: 145px;
    padding: 0 9px 0 4px;
}
body.is-touch-device .hud-volume-range {
    width: 82px;
    height: 6px;
}

/* Larger touch hitboxes for timeline scrubbers & range delete button */
body.is-touch-device #seek-bar::-webkit-slider-thumb,
body.is-touch-device #global-seek-bar::-webkit-slider-thumb {
    width: 14px;
    height: 34px;
    border-radius: 4px;
}

body.is-touch-device .timeline-range-del-btn {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    top: -10px;
    right: -8px;
}
body.is-touch-device .timeline-range-zone.touch-active .timeline-range-del-btn {
    display: block;
}

body.is-touch-device .timeline-marker-pin {
    width: 6px;
    margin-left: -3px;
}

/* Smooth momentum touch scrolling in drawers & popovers */
body.is-touch-device #drawer-list,
body.is-touch-device #drawer-grid,
body.is-touch-device #notes-list,
body.is-touch-device #burger-menu-popover,
body.is-touch-device .calib-panel-body,
body.is-touch-device .portal-projects-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Compact right-side mode controls on Tablet so Play: I/O + filter dropdown fit cleanly beside Transport Deck */
body.is-touch-device .ui-transport-right-group {
    gap: 5px;
}
body.is-touch-device #btn-loop-mode {
    min-width: 72px;
    padding-left: 7px;
    padding-right: 7px;
}
body.is-touch-device #btn-range-mode {
    min-width: 84px;
    padding-left: 7px;
    padding-right: 7px;
}
body.is-touch-device #range-user-filter-select {
    max-width: 118px;
    padding-left: 5px;
    padding-right: 4px;
}

/* Tablet Portrait & Compact Landscape Layout Adjustments (<= 1024px) */
@media (max-width: 1024px) {
    body.is-touch-device .ui-overlay-container {
        padding: 10px 12px;
        gap: 6px;
    }
    body.is-touch-device .ui-left-group,
    body.is-touch-device .ui-right-group,
    body.is-touch-device .ui-transport-right-group {
        height: auto;
        min-height: 32px;
        flex-wrap: wrap;
        row-gap: 4px;
    }
    body.is-touch-device #regie-optics-row {
        max-width: calc(100vw - 20px);
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    body.is-touch-device #regie-optics-row::-webkit-scrollbar {
        display: none;
    }
    body.is-touch-device #clip-drawer,
    body.is-touch-device #notes-drawer {
        max-width: calc(100vw - 24px);
        max-height: 55vh;
    }
}

/* Tablet / Mobile WebKit Compositor Boost:
   Multiple stacked backdrop-filter layers over a full-screen 60fps WebGL canvas
   cause severe GPU tile-memory bandwidth throttling and frame drops on iPadOS. */
body.is-touch-device .ui-overlay-container,
body.is-touch-device #radar-container,
body.is-touch-device #radar-preset-bar,
body.is-touch-device #radar-car-controls,
body.is-touch-device .ui-optics-row,
body.is-touch-device .radar-optics-bar,
body.is-touch-device .hud-top-actions button,
body.is-touch-device .hud-top-actions #btn-toggle-car,
body.is-touch-device .hud-stream-status-pill,
body.is-touch-device .hud-audio-control,
body.is-touch-device #hud-restore-btn,
body.is-touch-device #clip-drawer,
body.is-touch-device #notes-drawer,
body.is-touch-device #annotation-modal,
body.is-touch-device #timeline-thumbnail-preview,
body.is-touch-device #global-timeline-thumbnail-preview,
body.is-touch-device .playhead-context-pill,
body.is-touch-device .sensor-bar,
body.is-touch-device #mode-transition-toast,
body.is-touch-device .burger-trigger-btn,
body.is-touch-device .top-tool-pill-btn,
body.is-touch-device .burger-menu-popover {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.is-touch-device .ui-overlay-container {
    background: rgba(10, 11, 15, 0.96);
}
body.is-touch-device #clip-drawer,
body.is-touch-device #notes-drawer,
body.is-touch-device #annotation-modal,
body.is-touch-device .burger-menu-popover {
    background: rgba(11, 12, 16, 0.98);
}






/* ==========================================================================
   LIVESTREAM MODE (body.playlist-mode-live) - additiv, siehe js/player_live.js
   Ausgeblendet: Timelines, Clip-/Notes-Drawer, Review-/Transport-Elemente, Timeline-Einstellungen.
   Erhalten: 360°/2D-Ansicht, Optik/Framing, Radar, 3D-Previz, Qualitaet, Fullscreen, HUD-Dock/Auto-Hide.
   ========================================================================== */
.live-status-group,
.live-cam-pills,
.live-cam-sep,
.live-playlist-select,
.live-only-shortcut { display: none; }

body.playlist-mode-live .live-status-group {
    display: inline-flex;
    justify-self: end;
}
body.playlist-mode-live .live-only-shortcut { display: flex; }
body.playlist-mode-live .help-card {
    gap: 16px;
    padding: 24px 28px;
}
body.playlist-mode-live .help-sections-grid {
    gap: 16px;
}
body.playlist-mode-live .help-section-box {
    padding: 15px 17px;
    gap: 12px;
}
body.playlist-mode-live .help-section-box .shortcuts-grid {
    row-gap: 10px;
}
body.playlist-mode-live.live-is-multicam #live-tc-sep { display: inline-block; }
body.playlist-mode-live.live-is-multicam #hud-clip-info { display: none !important; }

/* 1-Zeilen Broadcast Bar im Live-Modus: obere Zeile, Play/Pause + Timelines komplett ausblenden */
body.playlist-mode-live .ui-filename-row,
body.playlist-mode-live #global-timeline-row,
body.playlist-mode-live .ui-bottom-row,
body.playlist-mode-live #btn-play-pause,
body.playlist-mode-live #live-cam-sep,
body.playlist-mode-live #btn-toggle-playlist,
body.playlist-mode-live #clip-drawer,
body.playlist-mode-live #notes-drawer,
body.playlist-mode-live #annotation-modal,
body.playlist-mode-live #btn-circle-take,
body.playlist-mode-live #btn-add-marker,
body.playlist-mode-live #btn-toggle-notes,
body.playlist-mode-live #marker-step-group,
body.playlist-mode-live #btn-team-tracks-hint,
body.playlist-mode-live #btn-mark-in,
body.playlist-mode-live #btn-mark-out,
body.playlist-mode-live #btn-goto-in,
body.playlist-mode-live #btn-goto-out,
body.playlist-mode-live #btn-frame-prev,
body.playlist-mode-live #btn-frame-next,
body.playlist-mode-live #btn-prev-clip,
body.playlist-mode-live #btn-next-clip,
body.playlist-mode-live .hud-transport-deck .transport-deck-sep:not(.live-cam-sep),
body.playlist-mode-live .ui-transport-right-group,
body.playlist-mode-live #btn-live-jump,
body.playlist-mode-live #timeline-thumbnail-preview,
body.playlist-mode-live #global-timeline-thumbnail-preview,
body.playlist-mode-live #playhead-context-pill,
body.playlist-mode-live .vod-only-setting,
body.playlist-mode-live .vod-only-shortcut,
body.playlist-mode-live .review-only-shortcut,
body.playlist-mode-live .review-only-transport {
    display: none !important;
}

/* TimeOfDay & Audio direkt im zentrierten Transport-Deck (1-Zeilen-HUD) */
body.playlist-mode-live #hud-transport-deck .hud-tc-center-anchor {
    position: static;
    transform: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
body.playlist-mode-live #hud-transport-deck #hud-timecode {
    height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    font-size: 13.5px;
    box-sizing: border-box;
}
body.playlist-mode-live #hud-transport-deck .hud-audio-control {
    position: static;
    transform: none;
    height: 30px;
}
@media (pointer: coarse) {
    body.playlist-mode-live #hud-transport-deck #hud-timecode,
    body.playlist-mode-live #hud-transport-deck .hud-audio-control {
        height: 34px;
    }
}

/* Status-Gruppe im HUD (rechts in der Broadcast Bar) */
.live-status-group {
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #fff;
    background: rgba(231, 111, 81, 0.18);
    border: 1px solid rgba(231, 111, 81, 0.55);
    white-space: nowrap;
    box-sizing: border-box;
    user-select: none;
    transition: all 0.15s ease;
}
.live-status-group.is-live .live-badge {
    background: rgba(255, 56, 76, 0.22);
    border-color: rgba(255, 56, 76, 0.75);
    color: #ff7a85;
    animation: livePulse 1.8s ease-in-out infinite;
}
.live-status-group.is-behind .live-badge {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.78);
    color: #fcd34d;
    cursor: pointer;
}
.live-status-group.is-behind .live-badge:hover {
    background: rgba(245, 158, 11, 0.34);
    color: #fff;
}
.live-status-group.is-offline .live-badge {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.4);
    color: #94a3b8;
    cursor: pointer;
}
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 56, 76, 0.0); }
    50%      { box-shadow: 0 0 10px 1px rgba(255, 56, 76, 0.45); }
}
.live-jump-btn {
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    color: #111;
    background: var(--accent-brass, #f0c475);
    border: none;
    white-space: nowrap;
}
.live-jump-btn:hover { filter: brightness(1.08); }
.live-telemetry,
.live-viewers {
    color: var(--text-secondary, #9ca3af);
    white-space: nowrap;
}
.live-viewers { color: #e5e7eb; font-weight: 600; }

/* Kamera-Umschalter (Multicam, zentriert im Transport-Deck neben Play/Pause) + Playlist-Wechsel */
body.playlist-mode-live .live-cam-pills {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.live-cam-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    color: #cbd5e1;
    background: #12141b;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-sizing: border-box;
    white-space: nowrap;
    transition: all 0.14s ease;
}
.live-cam-pill:hover {
    color: #fff;
    background: #1c202b;
    border-color: rgba(0, 216, 255, 0.55);
}
.live-cam-pill.active {
    color: #fff;
    background: rgba(0, 216, 255, 0.18);
    border-color: rgba(0, 216, 255, 0.75);
    box-shadow: 0 0 10px rgba(0, 216, 255, 0.2);
}
@media (pointer: coarse) {
    .live-cam-pill { height: 34px; }
}
.live-cam-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #64748b;
}
.live-cam-pill.is-on .live-cam-dot { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.7); }
.live-cam-pill.is-off .live-cam-dot { background: #ef4444; }
.live-cam-pill.is-switching .live-cam-dot {
    background: #00d8ff;
    box-shadow: 0 0 8px rgba(0, 216, 255, 0.9);
}
.live-mv-btn {
    border-color: rgba(229, 169, 108, 0.38);
    color: var(--accent-brass, #f0c475);
}
.live-mv-btn:hover {
    border-color: var(--accent-brass, #f0c475);
    color: #fff;
}
.live-mv-btn.active {
    background: rgba(229, 169, 108, 0.24);
    border-color: var(--accent-brass, #f0c475);
    color: #fff;
    box-shadow: 0 0 10px rgba(229, 169, 108, 0.28);
}
.live-cam-key {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #9ca3af;
    margin-left: 1px;
}
.live-cam-pill.active .live-cam-key {
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.28);
}

/* Im Multiview wird die globale Vollbild-Maske ausgeblendet; jede Kachel bekommt ihre eigene Ratio-Maske */
body.live-is-multiview #sensor-mask,
body.live-is-multiview #aspect-mask,
body.live-is-multiview #guideline-frame,
body.live-single-tile #sensor-mask,
body.live-single-tile #aspect-mask,
body.live-single-tile #guideline-frame {
    display: none !important;
}

/* Multiview Split-Screen / Quad-Grid */
#live-multiview {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    background: #050609;
    padding: 12px 12px 72px;
    gap: 10px;
    box-sizing: border-box;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
}
#live-multiview.show {
    display: grid;
}
body.hud-docked #live-multiview {
    padding-bottom: calc(var(--docked-hud-h, 58px) + 12px);
}
#live-multiview.hud-is-hidden,
body.hud-docked #live-multiview.hud-is-hidden {
    padding-bottom: 12px !important;
}
#live-multiview.show.is-single {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    padding: 0;
    gap: 0;
    background: #050609;
}
body.hud-docked #live-multiview.show.is-single {
    padding-bottom: var(--docked-hud-h, 58px);
}
#live-multiview.show.is-single.hud-is-hidden,
body.hud-docked #live-multiview.show.is-single.hud-is-hidden {
    padding-bottom: 0 !important;
}
#live-multiview.show.is-single .live-mv-tile {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: default;
    background: #050609;
}
#live-multiview.show.is-single .live-mv-header,
#live-multiview.show.is-single .live-mv-actions,
#live-multiview.show.is-single .live-mv-waiting {
    display: none !important;
}
@media (max-width: 768px) and (orientation: portrait) {
    #live-multiview[data-count="2"] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }
}
.live-mv-tile {
    position: relative;
    background: #0b0d13;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.live-mv-tile:hover {
    border-color: rgba(255, 255, 255, 0.35);
}
.live-mv-tile.is-audio-active {
    border-color: rgba(0, 216, 255, 0.85);
    box-shadow: 0 0 16px rgba(0, 216, 255, 0.22);
}
.live-mv-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #050609;
    display: block;
    pointer-events: none;
}
.live-mv-frame-guide {
    position: absolute;
    pointer-events: none;
    z-index: 2;
    box-sizing: border-box;
    border: 1px solid rgba(243, 244, 246, 0.85);
    display: none;
}
.live-mv-header {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 3;
}
.live-mv-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(8, 10, 15, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    font-weight: 700;
    color: #f3f4f6;
}
.live-mv-tile.is-on .live-cam-dot { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.7); }
.live-mv-tile.is-off .live-cam-dot { background: #ef4444; }
.live-mv-meta {
    font-weight: 500;
    font-size: 10.5px;
    color: #9ca3af;
    margin-left: 4px;
}
.live-mv-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    z-index: 3;
}
.live-mv-audio-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 700;
    background: rgba(8, 10, 15, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
}
.live-mv-tile.is-audio-active .live-mv-audio-pill {
    color: #00d8ff;
    border-color: rgba(0, 216, 255, 0.55);
    background: rgba(0, 216, 255, 0.14);
}
/* Broadcast Mini-VU-Meter (HUD & Multiview Tiles) */
.live-vu-meter {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 15px;
    padding: 1px 2px;
    border-radius: 3px;
    background: rgba(4, 6, 10, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-sizing: border-box;
    vertical-align: middle;
}
body.playlist-mode-live #live-hud-vu {
    display: inline-flex !important;
    height: 18px;
    padding: 2px 3px;
}
body.playlist-mode-live.live-is-multiview #live-hud-vu {
    display: none !important;
}
.live-vu-bar {
    position: relative;
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 1.5px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.live-vu-bar > i {
    display: block;
    width: 100%;
    height: 0%;
    border-radius: 1.5px;
    background: linear-gradient(0deg, #22c55e 0%, #22c55e 62%, #eab308 82%, #ef4444 100%);
    transition: height 0.07s linear;
}
/* Multiview OSD Ausblendung ([O] / OSD-Button / HUD ausgeblendet [U]) */
#live-multiview.osd-hidden .live-mv-header,
#live-multiview.osd-hidden .live-mv-actions {
    opacity: 0;
    pointer-events: none;
}
#live-multiview.osd-hidden .live-mv-tile.is-audio-active {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}
.live-osd-btn {
    border-color: rgba(255, 255, 255, 0.22);
    color: #cbd5e1;
}
.live-osd-btn.active {
    background: rgba(0, 216, 255, 0.16);
    border-color: rgba(0, 216, 255, 0.55);
    color: #e0f9ff;
}
.live-mv-expand-btn {
    height: 25px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(8, 10, 15, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.live-mv-expand-btn:hover {
    color: #fff;
    border-color: var(--accent-brass, #f0c475);
    background: rgba(229, 169, 108, 0.22);
}
.live-mv-waiting {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: radial-gradient(circle at 50% 42%, #131824 0%, #07090e 68%, #040508 100%);
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.live-mv-tile.is-waiting .live-mv-waiting {
    display: flex;
}
.live-mv-waiting .live-waiting-card.live-mv-slate-card {
    min-width: 0;
    max-width: min(320px, calc(100% - 28px));
    padding: 16px 20px;
    gap: 8px;
    border-radius: 11px;
}
.live-mv-waiting .live-slate-logo {
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
}
.live-mv-waiting .live-slate-project {
    font-size: 13.5px;
    letter-spacing: 1.1px;
}
.live-mv-waiting .live-slate-production {
    font-size: 10px;
}
.live-mv-waiting .live-mv-wait-txt {
    font-family: var(--font-display, var(--font-mono, monospace));
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-brass, #f0c475);
}
.live-playlist-select {
    height: 26px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    padding: 0 8px;
    border-radius: 4px;
    color: #f3c892;
    background: rgba(229, 169, 108, 0.12);
    border: 1px solid rgba(229, 169, 108, 0.4);
    cursor: pointer;
}

/* Waiting Room: Cinema/Broadcast-Slate */
#live-waiting {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 8; /* unter dem HUD (10), damit Qualitaet/Kamerawahl/Fullscreen auch im Waiting Room bedienbar bleiben */
    background: radial-gradient(circle at 50% 42%, #131824 0%, #07090e 68%, #040508 100%);
    overflow: hidden;
    cursor: pointer;
}
#live-waiting.show { display: flex; }
.live-waiting-slate-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.9) 15%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.9) 15%, transparent 78%);
}
.live-waiting-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 480px;
    padding: 28px 34px;
    text-align: center;
    border-radius: 14px;
    background: rgba(10, 12, 18, 0.86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.live-slate-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.live-slate-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    margin-bottom: 4px;
    opacity: 0.92;
}
.live-slate-project {
    font-family: var(--font-display, var(--font-mono, monospace));
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #f8fafc;
}
.live-slate-production {
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #94a3b8;
}
.live-slate-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    margin: 2px 0;
}
.live-waiting-status-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.live-waiting-pulse {
    width: 11px; height: 11px;
    border-radius: 50%;
    background: #ff384c;
    animation: livePulse 1.6s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(255, 56, 76, 0.65);
    flex-shrink: 0;
}
.live-waiting-title {
    font-family: var(--font-display, var(--font-mono, monospace));
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-brass, #f0c475);
    letter-spacing: 0.4px;
}
.live-waiting-sub {
    font-size: 12px;
    line-height: 1.45;
    color: #9ca3af;
}

/* 3.1: Set Curtain (strong video blur while stream stays connected – visible to everyone incl. Admin) */
body.playlist-mode-live #player-container > canvas,
body.playlist-mode-live .live-mv-video {
    transition: filter 0.35s ease, transform 0.35s ease;
}
body.playlist-mode-live.live-curtain-active #player-container > canvas,
body.playlist-mode-live.live-curtain-active .live-mv-video {
    filter: blur(36px) brightness(0.42) saturate(0.75) !important;
    transform: scale(1.06);
}

/* 2.1: Broadcast Notice / Regie-Einblendung fuer alle Zuschauer */
.live-broadcast-notice {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    pointer-events: none;
    display: flex;
    justify-content: center;
    max-width: min(680px, calc(100vw - 40px));
    transition: all 0.25s ease;
}
body.playlist-mode-live.live-curtain-active .live-broadcast-notice {
    top: 46%;
    transform: translate(-50%, -50%);
}
.live-notice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 24px 14px;
    border-radius: 11px;
    background: rgba(10, 12, 18, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(229, 169, 108, 0.55);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
    text-align: center;
}
body.playlist-mode-live.live-curtain-active .live-notice-card {
    padding: 20px 32px 22px;
    border-color: rgba(229, 169, 108, 0.72);
}
.live-notice-head {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-brass, #f0c475);
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}
.live-notice-ico {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.live-notice-text {
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #f8fafc;
    word-break: break-word;
}
body.playlist-mode-live.live-curtain-active .live-notice-text {
    font-size: 17.5px;
}
/* 3 selectable Notice Overlay Sizes: S (Compact), M (Standard), L (Large) */
.live-broadcast-notice[data-size="s"] {
    max-width: min(440px, calc(100vw - 40px));
}
.live-broadcast-notice[data-size="s"] .live-notice-card {
    padding: 9px 16px 10px;
    gap: 3px;
    border-radius: 8px;
}
.live-broadcast-notice[data-size="s"] .live-notice-head {
    font-size: 9px;
    letter-spacing: 0.9px;
    gap: 5px;
}
.live-broadcast-notice[data-size="s"] .live-notice-ico {
    width: 12px;
    height: 12px;
}
.live-broadcast-notice[data-size="s"] .live-notice-text {
    font-size: 13px !important;
}

.live-broadcast-notice[data-size="l"] {
    max-width: min(880px, calc(100vw - 40px));
}
.live-broadcast-notice[data-size="l"] .live-notice-card {
    padding: 26px 42px 30px;
    gap: 10px;
    border-radius: 15px;
    border-width: 1.5px;
}
.live-broadcast-notice[data-size="l"] .live-notice-head {
    font-size: 12.5px;
    letter-spacing: 1.5px;
    gap: 8px;
}
.live-broadcast-notice[data-size="l"] .live-notice-ico {
    width: 18px;
    height: 18px;
}
.live-broadcast-notice[data-size="l"] .live-notice-text {
    font-size: 24px !important;
    line-height: 1.35;
}

/* Regie-Trigger im HUD & Regie-Popover (nur Superadmin / Admin / Editor) */
.live-regie-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.live-regie-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    font-weight: 700;
    color: #cbd5e1;
    background: #12141b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
}
.live-regie-trigger:hover {
    color: #fff;
    border-color: var(--accent-brass, #f0c475);
    background: #1a1e29;
}
.live-regie-trigger.is-on-air {
    color: #fff;
    background: rgba(245, 158, 11, 0.24);
    border-color: rgba(245, 158, 11, 0.85);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.live-regie-popover {
    position: fixed;
    bottom: 70px;
    right: 16px;
    width: 390px;
    max-width: calc(100vw - 24px);
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(12, 14, 20, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.78);
    z-index: 30;
    color: #e5e7eb;
    font-family: var(--font-sans, system-ui, sans-serif);
    box-sizing: border-box;
}
.live-regie-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 11px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.live-regie-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--accent-brass, #f0c475);
}
.live-regie-status-pill {
    font-size: 9.5px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #94a3b8;
}
.live-regie-status-pill.is-on {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.75);
    color: #fcd34d;
}
.live-regie-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}
.live-regie-close:hover { color: #fff; }
.live-regie-curtain-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    margin-bottom: 14px;
}
.live-regie-curtain-row:hover {
    border-color: rgba(255, 255, 255, 0.22);
}
.live-regie-curtain-info {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12px;
    line-height: 1.35;
}
.live-regie-curtain-info .live-regie-svg {
    margin-top: 2px;
    color: var(--accent-brass, #f0c475);
}
.live-regie-curtain-info strong {
    display: block;
    color: #f3f4f6;
    font-size: 12px;
}
.live-regie-curtain-info small {
    display: block;
    color: #94a3b8;
    font-size: 10.5px;
    margin-top: 2px;
}
.live-regie-switch {
    width: 17px;
    height: 17px;
    accent-color: #f59e0b;
    cursor: pointer;
    flex-shrink: 0;
}
.live-regie-section-lbl {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: #94a3b8;
    margin-bottom: 6px;
}
.live-regie-size-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}
.live-regie-sizes {
    display: inline-flex;
    background: #0b0d13;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.live-regie-size-btn {
    height: 24px;
    padding: 0 9px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s ease;
}
.live-regie-size-btn:hover {
    color: #f8fafc;
}
.live-regie-size-btn.active {
    background: rgba(229, 169, 108, 0.24);
    color: var(--accent-brass, #f0c475);
    box-shadow: inset 0 0 0 1px rgba(229, 169, 108, 0.55);
}
.live-regie-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 13px;
}
.live-regie-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    background: #161922;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s ease;
}
.live-regie-preset-btn:hover {
    color: #fff;
    background: #202534;
    border-color: rgba(0, 216, 255, 0.55);
}
.live-regie-input-row {
    margin-bottom: 10px;
}
.live-regie-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    background: #0b0d13;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    font-size: 12.5px;
    box-sizing: border-box;
}
.live-regie-input:focus {
    outline: none;
    border-color: var(--accent-brass, #f0c475);
}
.live-regie-actions {
    display: flex;
    gap: 8px;
}
.live-regie-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 31px;
    padding: 0 12px;
    border-radius: 6px;
    background: #161922;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s ease;
}
.live-regie-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}
.live-regie-btn.primary {
    background: rgba(229, 169, 108, 0.22);
    border-color: var(--accent-brass, #f0c475);
    color: #fff;
}
.live-regie-btn.primary:hover {
    background: rgba(229, 169, 108, 0.34);
}
