/* VAS – Videoarchivsystem Styles */

:root {
    --color-bg:           #0d0f14;
    --color-bg-deep:      #080a0f;
    --color-surface:      #161b25;
    --color-surface-2:    #1e2535;
    --color-border:       #2a3347;
    --color-border-light: #374461;
    --color-accent:       #4f8ef7;
    --color-accent-dk:    #3570d4;
    --color-accent-rgb:   79, 142, 247;
    --color-text:         #e2e8f0;
    --color-text-muted:   #7f8ea3;
    --color-success:      #34d399;
    --color-danger:       #f87171;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-surface) 100%);
    color: var(--color-text);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: left;
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 30px;
    position: relative;
    z-index: 40;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

header h1 .vas-brand {
    color: var(--color-accent);
}

header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.back-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 1.1em;
    display: inline-block;
    margin-bottom: 10px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dk));
    color: white;
}

.btn-secondary {
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-accent);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
}

/* Scan Section */
.scan-section {
    background: rgba(42, 51, 71, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid var(--color-border);
}

.scan-section h2 {
    margin-bottom: 20px;
    color: var(--color-accent);
}

.scan-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.manual-add-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 280px;
}

.credential-hint {
    font-size: 0.85em;
    color: var(--color-text-muted);
    line-height: 1.35;
    max-width: 520px;
}

.credential-hint strong {
    color: var(--color-text);
}

.manual-add {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.manual-add-credentials {
    flex-wrap: wrap;
}

.manual-add-credentials input {
    min-width: 140px;
}

.manual-add input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-deep);
    color: var(--color-text);
    font-size: 1em;
}

.manual-add input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Results */
.results {
    margin-top: 20px;
}

.results.hidden {
    display: none;
}

.result-item {
    background: rgba(22, 27, 37, 0.8);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.result-info h3 {
    color: var(--color-accent);
    margin-bottom: 5px;
}

.result-info p {
    color: var(--color-text-muted);
    font-size: 0.9em;
}

/* Camera Grid */
.cameras-section h2 {
    margin-bottom: 20px;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

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

.camera-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.camera-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(var(--color-accent-rgb), 0.15);
}

.camera-preview {
    width: 100%;
    height: 200px;
    background: var(--color-bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.camera-preview img.camera-preview-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.camera-preview img.camera-preview-img.is-hidden {
    display: none;
}

.camera-preview .camera-preview-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: #555;
    background: var(--color-bg-deep);
    z-index: 0;
}

.camera-preview .camera-preview-fallback.is-visible {
    display: flex;
}

.camera-preview .placeholder {
    color: #555;
    font-size: 3em;
}

.camera-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4444;
    z-index: 2;
}

.camera-status.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.camera-details {
    padding: 16px;
}

.camera-details h3 {
    color: var(--color-text);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.camera-details p {
    color: var(--color-text-muted);
    font-size: 0.85em;
    margin-bottom: 5px;
}

.camera-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Camera Detail: einspaltig (Kamera-Info-Panel wurde entfernt) */
.camera-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.camera-detail > .camera-control {
    background: rgba(22, 27, 37, 0.8);
    border-radius: 12px;
    padding: 20px;
}

.camera-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.stream-container {
    background: var(--color-bg-deep);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* PTZ über dem Livebild: dünne Kanten (Hauptachsen), Zoom rechts oben */
.stream-ptz-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    --stream-ptz-edge: clamp(10px, 2.2vw, 16px);
    --stream-ptz-edge-gap: var(--stream-ptz-edge);
    /* Kein nativer Control-Balken mehr (Bildzoom braucht das Video ohne controls) */
    --stream-ptz-edge-bottom-safe: 8px;
}

.stream-ptz-edge {
    position: absolute;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: auto;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    color: rgba(240, 242, 255, 0.92);
    background: linear-gradient(
        to bottom,
        rgba(8, 10, 14, 0.14) 0%,
        rgba(8, 10, 14, 0.32) 50%,
        rgba(8, 10, 14, 0.14) 100%
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stream-ptz-edge--top {
    top: 0;
    left: var(--stream-ptz-edge-gap);
    right: var(--stream-ptz-edge-gap);
    height: var(--stream-ptz-edge);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(to bottom, rgba(8, 10, 14, 0.38) 0%, rgba(8, 10, 14, 0.12) 100%);
}

.stream-ptz-edge--bottom {
    bottom: var(--stream-ptz-edge-bottom-safe);
    left: var(--stream-ptz-edge-gap);
    right: var(--stream-ptz-edge-gap);
    height: var(--stream-ptz-edge);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(to top, rgba(8, 10, 14, 0.38) 0%, rgba(8, 10, 14, 0.12) 100%);
}

.stream-ptz-edge--left {
    left: 0;
    top: var(--stream-ptz-edge-gap);
    bottom: calc(var(--stream-ptz-edge-bottom-safe) + var(--stream-ptz-edge-gap));
    width: var(--stream-ptz-edge);
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(to right, rgba(8, 10, 14, 0.38) 0%, rgba(8, 10, 14, 0.12) 100%);
}

.stream-ptz-edge--right {
    right: 0;
    top: var(--stream-ptz-edge-gap);
    bottom: calc(var(--stream-ptz-edge-bottom-safe) + var(--stream-ptz-edge-gap));
    width: var(--stream-ptz-edge);
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: linear-gradient(to left, rgba(8, 10, 14, 0.38) 0%, rgba(8, 10, 14, 0.12) 100%);
}

.stream-ptz-edge-glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
    background: radial-gradient(
        ellipse at center,
        rgba(var(--color-accent-rgb), 0.22) 0%,
        transparent 72%
    );
    pointer-events: none;
}

.stream-ptz-edge:hover .stream-ptz-edge-glow,
.stream-ptz-edge.ptz-active .stream-ptz-edge-glow {
    opacity: 1;
}

.stream-ptz-edge:hover,
.stream-ptz-edge.ptz-active {
    border-color: rgba(var(--color-accent-rgb), 0.35);
    box-shadow: 0 0 0 1px rgba(var(--color-accent-rgb), 0.12);
}

.stream-ptz-edge.ptz-active {
    background: rgba(var(--color-accent-rgb), 0.22);
}

.stream-ptz-edge-icon {
    position: relative;
    z-index: 1;
    font-size: clamp(0.55rem, 1.8vw, 0.72rem);
    line-height: 1;
    opacity: 0.55;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.stream-ptz-edge:hover .stream-ptz-edge-icon,
.stream-ptz-edge.ptz-active .stream-ptz-edge-icon {
    opacity: 0.95;
}

.stream-ptz-zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    pointer-events: auto;
    background: rgba(6, 8, 14, 0.52);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.stream-ptz-zoom-btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    color: #f0f0f8;
    background: rgba(var(--color-accent-rgb), 0.3);
    border: 1px solid rgba(var(--color-accent-rgb), 0.45);
    transition: background 0.15s, transform 0.1s;
    touch-action: manipulation;
}

.stream-ptz-zoom-btn:hover {
    background: rgba(var(--color-accent-rgb), 0.5);
}

.stream-ptz-zoom-btn.ptz-active {
    background: rgba(var(--color-accent-rgb), 0.85);
    transform: scale(0.96);
}

@media (max-width: 600px) {
    .stream-ptz-zoom {
        top: 8px;
        right: 8px;
    }
    .stream-ptz-overlay {
        --stream-ptz-edge-bottom-safe: 8px;
    }
}

.player-view-viewport {
    position: relative;
    overflow: hidden;
    background: #000;
    touch-action: none;
}

.player-view-viewport video,
.player-view-viewport img {
    width: 100%;
    height: auto;
    display: block;
    transform-origin: center center;
    -webkit-transform-origin: center center;
}

.player-view-gestures {
    position: absolute;
    inset: 0;
    z-index: 3;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.player-view-hud {
    position: absolute;
    left: 22px;
    bottom: 10px;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: rgba(8, 10, 14, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
}

.player-view-hud button {
    width: 32px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.player-view-hud button:hover {
    background: rgba(var(--color-accent-rgb), 0.25);
}

.player-view-hud span {
    min-width: 44px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.player-view-viewport.is-zoomed .player-view-hud span {
    color: var(--color-accent);
}

.archive-view-viewport {
    border-radius: 8px;
}

.archive-view-viewport .archive-video {
    max-height: 480px;
    border-radius: 0;
}

.stream-container:fullscreen,
.stream-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    background: #000;
}

.stream-container:fullscreen .player-view-viewport,
.stream-container:-webkit-full-screen .player-view-viewport {
    height: 100%;
}

.stream-container:fullscreen video,
.stream-container:fullscreen img,
.stream-container:-webkit-full-screen video,
.stream-container:-webkit-full-screen img {
    height: 100%;
    max-height: none;
    object-fit: contain;
}

.stream-container video {
    width: 100%;
    height: auto;
    display: block;
    min-height: 240px;
    background: #000;
}

.stream-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(8, 10, 14, 0.85);
    border-radius: 10px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.2);
}

.stream-tool-label {
    font-size: 0.9rem;
    color: #c8c8d8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stream-tool-check input {
    margin: 0;
}

/* ===== Stream-Einstellungen Panel ===== */
.stream-settings-panel {
    margin-top: 10px;
    background: rgba(8, 10, 14, 0.85);
    border-radius: 10px;
    border: 1px solid rgba(var(--color-accent-rgb), 0.15);
    overflow: hidden;
}

.stream-settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #c8c8d8;
    user-select: none;
    list-style: none;
}
.stream-settings-toggle::-webkit-details-marker { display: none; }
.stream-settings-toggle::after {
    content: '▾';
    margin-left: auto;
    transition: transform 0.2s;
}
details[open] .stream-settings-toggle::after {
    transform: rotate(-180deg);
}
.stream-settings-toggle:hover { color: #fff; }

.stream-settings-body {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 240px;
    align-items: center;
    gap: 12px;
}
.settings-row-check {
    grid-template-columns: 1fr 40px;
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.88rem;
    color: #d0d0e8;
    font-weight: 500;
}
.settings-hint {
    font-size: 0.78rem;
    color: #888;
    font-weight: 400;
}

.settings-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-control input[type="range"] {
    flex: 1;
    accent-color: var(--color-accent);
    cursor: pointer;
}
.settings-val {
    font-size: 0.85rem;
    color: var(--color-accent);
    min-width: 52px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.settings-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 600px) {
    .settings-row {
        grid-template-columns: 1fr;
    }
    .settings-control {
        padding-left: 0;
    }
}

.stream-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-deep);
    color: #eee;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.stream-container img.mjpeg-live {
    width: 100%;
    height: auto;
    display: block;
    min-height: 240px;
    object-fit: contain;
    background: #000;
}

.stream-container img.mjpeg-live.hidden-by-default {
    display: none !important;
}

.stream-container img.mjpeg-live.force-visible {
    display: block !important;
}

.stream-container video.h264-live.force-hidden {
    display: none !important;
}

.status-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-accent);
    font-size: 1.2em;
    text-align: center;
    z-index: 20;
    pointer-events: none;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* gap nur in einer aktiven Lade-Phase (Spinner/Text/Balken) - der
   Fehlerzustand (showStreamError) bringt eigene Absaetze/Buttons mit
   eigenen Margins mit; ein globaler gap wuerde die verdoppeln. */
.status-message[data-stage] {
    gap: 10px;
}

/* display:none statt per Inline-Style (setStreamStatus setzt nur noch diese
   Klasse) - ein Inline-style.display wuerde das display:flex oben
   ueberschreiben und damit das Spinner/Balken-Layout brechen. */
.status-message.is-hidden {
    display: none;
}

/* .status-message selbst ist pointer-events:none (Overlay soll Klicks aufs
   Video durchlassen) - interaktive Kinder (Retry-/Fallback-Buttons in
   showStreamError) muessen das explizit zuruecksetzen, sonst sind sie trotz
   sichtbarem Cursor:pointer per Maus nicht klickbar (Klick faellt auf das
   Element dahinter durch, nur Tab+Enter funktioniert). */
.status-message button {
    pointer-events: auto;
}

/* Spinner/Fortschrittsbalken nur waehrend einer bekannten Lade-Phase
   (data-stage gesetzt von setStreamStage() in camera.js) - der Fehlerzustand
   (showStreamError) setzt data-stage nie, bleibt also unberuehrt. */
.status-message[data-stage]::before {
    content: '';
    width: 22px;
    height: 22px;
    border: 3px solid rgba(var(--color-accent-rgb), 0.25);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Fortschrittsbalken fuer die 'waiting'-Phase - --wc-pct (Prozentwert) wird
   von startLoadProgress() in camera.js pro Sekunde gesetzt. Misst die Naehe
   zum eigenen Client-Timeout, nicht die tatsaechliche Server-Bereitschaft
   (siehe Kommentar bei FIRST_FRAME_WAIT_SEC in camera.js). */
.status-message[data-stage="waiting"]::after {
    content: '';
    width: min(160px, 70%);
    height: 3px;
    border-radius: 2px;
    background-color: rgba(var(--color-accent-rgb), 0.2);
    background-image: linear-gradient(var(--color-accent), var(--color-accent));
    background-repeat: no-repeat;
    background-position: left;
    background-size: var(--wc-pct, 0%) 100%;
    transition: background-size 1.8s linear;
}

.camera-control-heading,
.detection-heading {
    color: var(--color-accent);
    font-size: 1.05rem;
    margin: 24px 0 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(42, 51, 71, 0.6);
}

.camera-control-heading:first-child,
.camera-control > .camera-control-heading {
    margin-top: 12px;
    border-top: none;
    padding-top: 0;
}

.ptz-speed-row {
    margin-bottom: 14px;
}

.ptz-speed-label {
    font-size: 0.85rem;
    color: #c8c8d8;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ptz-speed-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-deep);
    color: #eee;
}

.ptz-zoom-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ptz-zoom-label {
    font-size: 0.85rem;
    color: #c8c8d8;
    min-width: 2rem;
}

.ptz-zoom-btn {
    min-width: 42px;
    font-weight: 700;
}

.ptz-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 220px;
    margin-bottom: 16px;
    touch-action: manipulation;
}

.ptz-pad .ptz-arrow {
    min-height: 48px;
    padding: 0;
    font-size: 1.1rem;
}

.ptz-pad .ptz-diag {
    min-height: 40px;
    padding: 0;
    opacity: 0.92;
}

.ptz-stop {
    min-height: 48px;
    border-radius: 50%;
    max-width: 56px;
    margin: auto;
    justify-self: center;
    font-size: 0.95rem;
    line-height: 1;
}

.ptz-preset-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

.ptz-preset-label {
    font-size: 0.85rem;
    color: #c8c8d8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ptz-preset-input {
    width: 4.5rem;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-deep);
    color: #eee;
}

.ptz-main-split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px 32px;
    margin-bottom: 8px;
}

.ptz-controls-col {
    flex: 0 0 auto;
    min-width: 0;
}

.ptz-named-presets-col {
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 420px;
}

.ptz-named-heading {
    color: var(--color-accent);
    font-size: 0.95rem;
    margin: 0 0 8px;
    font-weight: 600;
}

.ptz-named-hint {
    font-size: 0.78rem;
    color: #9a9aae;
    line-height: 1.45;
    margin: 0 0 12px;
}

.ptz-named-hint strong {
    color: #c8c8d8;
    font-weight: 600;
}

.ptz-save-named-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ptz-preset-name-input {
    flex: 1 1 140px;
    min-width: 120px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-deep);
    color: #eee;
    font-size: 0.9rem;
}

.named-presets-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid rgba(42, 51, 71, 0.5);
    border-radius: 10px;
    background: rgba(8, 10, 14, 0.4);
}

.named-presets-list:empty::before {
    content: "Noch keine benannten Presets.";
    display: block;
    padding: 14px 12px;
    font-size: 0.85rem;
    color: #7a7a8e;
}

.named-preset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(42, 51, 71, 0.6);
    flex-wrap: wrap;
}

.named-preset-item:last-child {
    border-bottom: none;
}

.named-preset-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.9rem;
    color: var(--color-text);
}

.named-preset-meta {
    font-size: 0.75rem;
    color: #8888a0;
}

.named-preset-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 968px) {
    .ptz-named-presets-col {
        max-width: none;
    }
}

/* PTZ-Tour */
.ptz-tour-panel {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(42, 51, 71, 0.7);
}

.ptz-tour-heading {
    margin-top: 0;
}

.ptz-tour-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.ptz-tour-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
}

.ptz-tour-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4a9eff;
    cursor: pointer;
}

.ptz-tour-dwell-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: #a0a0b8;
}

.ptz-tour-dwell-input {
    width: 64px;
    padding: 5px 8px;
    border-radius: 7px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-deep);
    color: #eee;
    font-size: 0.88rem;
    text-align: center;
}

.ptz-tour-status {
    margin-top: 8px;
    font-size: 0.82rem;
    color: #6aacff;
    min-height: 1.2em;
}

.detection-panel {
    margin-top: 8px;
}

.detection-status {
    font-size: 0.88rem;
    color: #c4c4d8;
    line-height: 1.45;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.detection-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.detection-poll-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.detection-poll-label input {
    margin: 0;
}

.spinner {
    border: 3px solid rgba(var(--color-accent-rgb), 0.25);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.empty-state .icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #888;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: min(560px, calc(100vw - 40px));
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.toast.error {
    cursor: pointer;
}

.toast.success {
    background: linear-gradient(135deg, #00b894, #00a381);
}

.toast.error {
    background: linear-gradient(135deg, #ff4444, #cc0000);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Clip-Erstellung */
.clip-section {
    background: rgba(42, 51, 71, 0.15);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 20px;
}

.clip-section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 6px;
}

.clip-section-hint {
    font-size: 0.82rem;
    color: #a0a0b0;
    margin-bottom: 14px;
    line-height: 1.4;
}

.clip-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.clip-datetime-input {
    padding: 9px 13px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-deep);
    color: var(--color-text);
    font-size: 0.97rem;
    flex: 1 1 220px;
    max-width: 280px;
    color-scheme: dark;
}

.clip-datetime-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.clip-create-btn {
    flex-shrink: 0;
}

.clip-progress {
    font-size: 0.88rem;
    color: #b0c0d0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(42, 51, 71, 0.3);
    margin-bottom: 12px;
    line-height: 1.45;
}

.clip-progress.clip-progress-error {
    color: #ff7070;
    background: rgba(80, 0, 0, 0.3);
}

.clip-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clip-preview-label {
    font-size: 0.83rem;
    color: #a0b0c0;
    line-height: 1.4;
}

.clip-video {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    background: #000;
    aspect-ratio: 16 / 9;
}

.clip-download-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hidden {
    display: none !important;
}

/* Vorherige/Nächste Kamera - fix links/rechts am Bildschirmrand, unabhängig
   vom Player selbst (nicht nur innerhalb des Vollbild-Containers), damit sie
   auch außerhalb des Vollbilds erreichbar sind. */
.camera-nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 44px;
    height: 64px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.camera-nav-arrow:hover { background: rgba(0, 0, 0, 0.55); }
.camera-nav-prev { left: 8px; }
.camera-nav-next { right: 8px; }

@media (max-width: 640px) {
    .camera-nav-arrow { width: 34px; height: 52px; font-size: 1.4rem; }
}

/* ===========================================================================
   Cloudcontrol-Link
   =========================================================================== */

.cloudcontrol-link-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.cloudcontrol-link-label {
    font-size: 0.82rem;
    color: #8899aa;
    margin: 14px 0 6px;
}

.cloudcontrol-link-label:first-of-type {
    margin-top: 0;
}

.cloudcontrol-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cloudcontrol-link-input {
    flex: 1;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-deep);
    color: #a0b8d0;
    font-size: 0.80rem;
    font-family: ui-monospace, "Cascadia Code", "Fira Mono", monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
    color-scheme: dark;
    min-width: 0;
}

.cloudcontrol-link-input:focus {
    outline: none;
    border-color: #3b82f6;
    color: #cce0ff;
}

.cloudcontrol-copy-btn {
    flex-shrink: 0;
}

.cloudcontrol-link-hint {
    font-size: 0.78rem;
    color: #5a8a5a;
    margin-top: 6px;
    min-height: 1em;
}

/* ===========================================================================
   Wakeword-Alarm-Panel
   =========================================================================== */

@keyframes alarm-blink {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px 4px rgba(239, 68, 68, 0.9);
    }
    50% {
        opacity: 0.15;
        box-shadow: none;
    }
}

.alarm-panel {
    background: rgba(42, 51, 71, 0.35);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.alarm-panel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.alarm-lamp {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3a3a4a;
    border: 2px solid #555;
    transition: background 0.3s, border-color 0.3s;
}

/* Monitoring aktiv, kein Alarm → grüne Ruheanzeige */
.alarm-lamp.monitoring {
    background: #22c55e;
    border-color: #16a34a;
    box-shadow: 0 0 6px 2px rgba(34, 197, 94, 0.5);
}

/* Alarm ausgelöst → rotes Blinken */
.alarm-lamp.alarm {
    background: #ef4444;
    border-color: #dc2626;
    animation: alarm-blink 0.7s ease-in-out infinite;
}

.alarm-label {
    flex: 1;
    font-size: 0.92rem;
    color: #c0d0e0;
    min-width: 0;
}

.alarm-label.alarm-active {
    color: #ef4444;
    font-weight: 600;
}

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

.alarm-event-log {
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
    font-size: 0.78rem;
    color: #8ba0b8;
    line-height: 1.5;
}

.alarm-event-entry {
    padding: 1px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.alarm-event-entry.alarm-hit {
    color: #f87171;
    font-weight: 500;
}

/* =========================================================
   Login-Seite
   ========================================================= */

.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-surface) 100%);
}

.login-card {
    background: rgba(30, 37, 53, 0.75);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(var(--color-accent-rgb), 0.12);
    border: 1px solid rgba(var(--color-accent-rgb), 0.25);
    border-radius: 14px;
    margin: 0 auto 16px;
    color: var(--color-accent);
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 32px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-field { display: flex; flex-direction: column; gap: 6px; }

.login-field label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.login-field input {
    padding: 10px 14px;
    background: var(--color-bg-deep);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.login-field input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.12);
}

.login-btn {
    margin-top: 8px;
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.login-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    color: #f87171;
    font-size: 0.9rem;
    text-align: center;
}

.login-tester-download {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.login-tester-download #testerDownloadPanel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

/* =========================================================
   Header Benutzer-Info
   ========================================================= */

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

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(var(--color-accent-rgb), 0.12);
    border: 1px solid rgba(var(--color-accent-rgb), 0.25);
    border-radius: 10px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.header-titles {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.header-user span { font-weight: 500; }

.header-beta {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
    color: var(--color-accent);
    border: 1px solid rgba(var(--color-accent-rgb), 0.4);
    background: rgba(var(--color-accent-rgb), 0.12);
}

.site-filter {
    position: relative;
}

.site-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 240px;
}

.site-filter-btn.is-filtered {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

#siteFilterLabel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.site-filter-caret {
    font-size: 0.7rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.site-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 280px;
    max-width: min(360px, 90vw);
    max-height: min(420px, 70vh);
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: 6px;
    z-index: 80;
}

.site-filter-action {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.site-filter-action:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.site-filter-sep {
    height: 1px;
    background: var(--color-border);
    margin: 4px 6px;
}

.site-filter-empty {
    padding: 10px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.site-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--color-text);
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.site-filter-item:hover,
.site-filter-item:focus-visible {
    background: var(--color-surface-2);
    outline: none;
}

.site-filter-item.is-hidden-site {
    color: var(--color-text-muted);
}

.site-filter-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--color-border-light);
    background: var(--color-bg-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
}

.site-filter-item:not(.is-hidden-site) .site-filter-check {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.site-filter-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-filter-count {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* =========================================================
   Admin-Panel
   ========================================================= */

.admin-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 30px;
}

.admin-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
}

.admin-tab {
    padding: 7px 16px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.admin-tab:hover { border-color: var(--color-accent); color: var(--color-text); }
.admin-tab.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; font-weight: 600; }

.admin-tab-content.hidden { display: none; }

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.admin-toolbar h3 {
    font-size: 1rem;
    color: var(--color-text);
}

.admin-list { display: flex; flex-direction: column; gap: 8px; }

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--color-bg-deep);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.admin-row-info { display: flex; flex-direction: column; gap: 3px; }
.admin-row-info strong { font-size: 0.95rem; color: var(--color-text); }
.admin-row-meta { font-size: 0.8rem; color: var(--color-text-muted); }
.admin-row-warn { color: var(--color-danger); }
.admin-row-key {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.external-key-code {
    font-size: 0.78rem;
    color: #c4d4e8;
    background: var(--color-bg-deep);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}
.admin-row-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.modal-field-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.modal-field-row .modal-input { flex: 1; }

.admin-empty, .admin-error {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    padding: 20px 0;
}
.admin-error { color: #f87171; }

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

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.hidden { display: none; }

.modal-box {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 28px 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal-box-wide { max-width: 560px; }

.pairing-code {
    font-size: 1.7rem;
    letter-spacing: 0.16em;
    font-weight: 600;
    text-align: center;
    color: #67e8f9;
    font-variant-numeric: tabular-nums;
}

.pairing-code-empty {
    font-size: 0.95rem;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--color-text-muted);
}

.pairing-expiry {
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    min-height: 1.2em;
    margin-bottom: 8px;
}

.modal-box h3 {
    font-size: 1.1rem;
    margin-bottom: 18px;
    color: var(--color-text);
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.modal-field label { font-size: 0.85rem; color: var(--color-text-muted); }

.modal-input {
    padding: 9px 13px;
    background: var(--color-bg-deep);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.95rem;
}

.modal-input:focus { outline: none; border-color: var(--color-accent); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-hint {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 10px;
    line-height: 1.6;
}

.token-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-bg-deep);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 10px 0;
}

.token-display code {
    flex: 1;
    font-size: 0.8rem;
    word-break: break-all;
    color: #67e8f9;
}

/* =========================================================
   Status-Labels
   ========================================================= */

.status-online { color: #4ade80; font-weight: 600; }
.status-update-available { color: #fbbf24; font-weight: 600; }

.agent-release-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.agent-release-card {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 16px;
}
.agent-release-card h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #e2e8f0;
}
.agent-release-card p {
    margin: 4px 0;
    font-size: 0.85rem;
    color: #94a3b8;
}
.agent-release-card code {
    font-size: 0.78rem;
    color: #cbd5e1;
}
.agent-release-sites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.agent-release-sites-header h4 { margin: 0; }
.agent-release-sites-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.agent-release-site-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.agent-release-site-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    cursor: pointer;
}
.agent-release-site-row:hover {
    border-color: #64748b;
}
.agent-release-site-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}
.agent-release-site-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.agent-release-site-info strong {
    font-size: 0.9rem;
    color: var(--color-text);
}
.agent-release-site-version {
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.status-offline { color: #f87171; }

/* =========================================================
   Archiv-Panel
   ========================================================= */

.archive-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.archive-heading {
    font-size: 1.15rem;
    color: var(--color-text);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 10px;
}

.archive-unavailable {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    padding: 12px 0;
}

.archive-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.archive-date-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.archive-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.archive-datetime {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    color: var(--color-text);
    padding: 6px 10px;
    font-size: 0.88rem;
}

.archive-datetime:focus {
    outline: none;
    border-color: var(--color-accent);
}

.archive-load-btn {
    align-self: flex-end;
}

.archive-quick-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.archive-quick {
    font-size: 0.8rem;
    padding: 5px 12px;
}

.archive-status {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    min-height: 20px;
}

.archive-status.error {
    color: #f87171;
}

.archive-downloads-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.archive-downloads-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.archive-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.archive-downloads-empty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: 6px 0;
}

.archive-download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--color-bg);
}

.archive-download-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.archive-download-cam {
    color: var(--color-text);
}

.archive-download-meta {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-download-status {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.archive-download-status.status-running { color: var(--color-accent); }
.archive-download-status.status-done { color: var(--color-success); }
.archive-download-status.status-error { color: var(--color-danger); }
.archive-download-status.status-expired { color: var(--color-text-muted); }

.archive-download-link {
    font-size: 0.8rem;
    white-space: nowrap;
}

.archive-timeline {
    margin-bottom: 14px;
}

#archiveMergeUi {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#archiveMergeUi #archiveMergeStatus,
#archiveMergeUi .archive-video {
    flex-basis: 100%;
    margin-top: 0;
}

.archive-timeline-label {
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 4px;
}

.archive-timeline-track {
    position: relative;
}

.archive-activity-canvas {
    display: block;
    width: 100%;
    height: 56px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: var(--color-surface);
    /* Rein visuell – Klick/Scrub bleibt an .archive-timeline-bar darunter. */
    pointer-events: none;
}

.archive-timeline-bar {
    position: relative;
    height: 18px;
    background: var(--color-surface);
    border-radius: 4px;
    overflow: hidden;
}

/* Wiedergabeposition, über Waveform + Segment-Leiste hinweg (spannt beide
   Elemente des Tracks, siehe .archive-timeline-track). Nur sichtbar,
   während ein Archiv-Player aktiv ist (_updateArchiveTimelineUi()). */
.archive-timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: #fff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.9);
    pointer-events: none;
    z-index: 3;
    transform: translateX(-1px);
}

.archive-timeline-playhead::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.9);
}

.archive-timeline-segment {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--color-accent);
    opacity: 0.75;
    cursor: pointer;
    transition: opacity 0.15s;
}

.archive-timeline-segment:hover {
    opacity: 1;
}

.archive-timeline-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #555;
    margin-top: 3px;
}

.archive-player-wrap {
    margin-top: 14px;
}

.archive-video {
    width: 100%;
    max-height: 480px;
    background: #000;
    border-radius: 8px;
}

.archive-transport {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.archive-time {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    min-width: 42px;
    text-align: center;
}

.archive-seek-slider {
    flex: 1;
    min-width: 120px;
    accent-color: var(--color-accent);
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

/* Track transparent lassen, damit der per JS gesetzte Gradient
   (gespielt/gepuffert/ungeladen, siehe _paintArchiveSeekBuffered) sichtbar bleibt. */
.archive-seek-slider::-webkit-slider-runnable-track {
    background: transparent;
    height: 6px;
    border-radius: 3px;
}
.archive-seek-slider::-moz-range-track {
    background: transparent;
    height: 6px;
    border-radius: 3px;
}
.archive-seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
}
.archive-seek-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
}

.archive-speed-btns {
    display: flex;
    gap: 6px;
}

.archive-speed.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* Site footer */
.site-footer {
    text-align: center;
    padding: 24px 20px 16px;
    margin-top: 32px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.site-footer p {
    margin: 0;
}

.login-body .site-footer {
    margin-top: auto;
    border-top: none;
    padding-top: 32px;
    padding-bottom: 24px;
}

/* ---------------------------------------------------------------------- */
/* Admin-Tab: Walls (Wall Builder)                                        */
/* ---------------------------------------------------------------------- */

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

.wall-admin-card {
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: #05070c;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.wall-admin-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-border-light);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

/* Live-Vorschau: Kamera-Thumbnails exakt im Wall-Layout (Col/Row-Span) */
.wall-admin-card-preview {
    position: absolute;
    inset: 0;
    display: grid;
    gap: 2px;
    padding: 2px;
    background: #05070c;
}

.wall-admin-preview-cell {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #10141d;
}

.wall-admin-preview-cell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.wall-admin-preview-empty {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.82rem;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    margin: 8px;
}

.wall-admin-preview-scrim {
    position: absolute;
    inset: auto 0 0 0;
    height: 52%;
    background: linear-gradient(to top, rgba(5, 7, 12, 0.92) 0%, rgba(5, 7, 12, 0) 100%);
    pointer-events: none;
}

.wall-admin-preview-title {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    transition: opacity 0.18s ease;
}

.wall-admin-preview-title-count {
    font-weight: 500;
    font-size: 0.76rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.wall-admin-card:hover .wall-admin-preview-title {
    opacity: 0;
}

/* Hover-Overlay: Meta + Aktionen, sonst unsichtbar über der Vorschau */
.wall-admin-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    background: rgba(6, 8, 13, 0.72);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.wall-admin-card:hover .wall-admin-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

.wall-admin-card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wall-admin-card-body h4 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.wall-admin-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wall-admin-chip {
    font-size: 0.74rem;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.wall-admin-chip--accent {
    color: var(--color-accent);
    border-color: rgba(var(--color-accent-rgb), 0.35);
    background: rgba(var(--color-accent-rgb), 0.1);
}

.wall-admin-card-actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wall-admin-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 48px 20px;
    text-align: center;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    border-radius: 14px;
}

.wall-admin-empty-icon {
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 6px;
}

.wall-admin-empty h4 {
    margin: 0;
    color: var(--color-text);
}

.wall-admin-empty p {
    margin: 0;
    max-width: 360px;
    font-size: 0.86rem;
}
