:root {
    /* Detec Pulse shared semantic palette. Keep component accents and states aligned. */
    color-scheme: light;
    --pulse-font-sans: 'Segoe UI Variable Text', 'Aptos', Inter, 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --pulse-canvas: #f4f7fb;
    --pulse-navy-950: #071827;
    --pulse-navy-900: #0f172a;
    --pulse-navy-800: #172033;
    --pulse-surface: #fff;
    --pulse-surface-soft: #f8fafc;
    --pulse-border: #d8e2ef;
    --pulse-border-strong: #cbd5e1;
    --pulse-text: #0f172a;
    --pulse-muted: #64748b;
    --pulse-action: #0f766e;
    --pulse-action-hover: #115e59;
    --pulse-on-action: #fff;
    --pulse-accent: #0f766e;
    --pulse-accent-bright: #2dd4bf;
    --pulse-accent-soft: #ecfeff;
    --pulse-accent-border: #ccfbf1;
    --pulse-link: #0369a1;
    --pulse-info: #0ea5e9;
    --pulse-info-strong: #0369a1;
    --pulse-info-bright: #44a7ff;
    --pulse-info-soft: #e0f2fe;
    --pulse-info-border: #bae6fd;
    --pulse-blue: #2563eb;
    --pulse-blue-bright: #60a5fa;
    --pulse-success: #16a34a;
    --pulse-success-bright: #4ade80;
    --pulse-success-text: #047857;
    --pulse-success-soft: #ecfdf5;
    --pulse-success-border: #a7f3d0;
    --pulse-warning: #d97706;
    --pulse-warning-bright: #fbbf24;
    --pulse-warning-text: #9a3412;
    --pulse-warning-soft: #fff7ed;
    --pulse-warning-border: #fed7aa;
    --pulse-danger: #dc2626;
    --pulse-danger-bright: #f87171;
    --pulse-danger-text: #b91c1c;
    --pulse-danger-soft: #fee2e2;
    --pulse-danger-border: #fecaca;
    --pulse-focus-ring: rgba(14, 165, 233, .35);
    --pulse-radius-sm: 9px;
    --pulse-radius-md: 13px;
    --pulse-radius-lg: 18px;
    --pulse-radius-xl: 24px;
    --pulse-shadow-sm: 0 4px 14px rgba(15, 23, 42, .055);
    --pulse-shadow-md: 0 14px 36px rgba(15, 23, 42, .075);
    --pulse-shadow-lg: 0 26px 70px rgba(15, 23, 42, .11);
    --pulse-ease-out: cubic-bezier(.22, 1, .36, 1);
    --pulse-page-gutter: clamp(16px, 2.1vw, 32px);

    --bs-body-font-family: var(--pulse-font-sans);
    --bs-body-color: var(--pulse-text);
    --bs-body-bg: var(--pulse-canvas);
    --bs-border-color: var(--pulse-border);
    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: var(--pulse-link);
    --bs-focus-ring-color: var(--pulse-focus-ring);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --pulse-canvas: #0b1220;
    --pulse-surface: #111a2e;
    --pulse-surface-soft: #16213a;
    --pulse-border: #233047;
    --pulse-border-strong: #334155;
    --pulse-text: #e2e8f0;
    --pulse-muted: #94a3b8;
    --pulse-accent: #5eead4;
    --pulse-accent-soft: #0e2a3a;
    --pulse-accent-border: #164e63;
    --pulse-link: #7dd3fc;
    --pulse-info: #38bdf8;
    --pulse-info-strong: #7dd3fc;
    --pulse-info-soft: #0e2a3a;
    --pulse-info-border: #164e63;
    --pulse-success-text: #86efac;
    --pulse-success-soft: #123627;
    --pulse-success-border: #275b47;
    --pulse-warning-text: #fbbf24;
    --pulse-warning-soft: #392f17;
    --pulse-warning-border: #5f5129;
    --pulse-danger-text: #fca5a5;
    --pulse-danger-soft: #3f1726;
    --pulse-danger-border: #6a3540;
}

html, body {
    background: var(--pulse-canvas);
    color: var(--pulse-text);
    font-family: var(--pulse-font-sans);
    margin: 0;
}

html {
    min-height: 100%;
    scrollbar-color: var(--pulse-border-strong) transparent;
    scrollbar-width: thin;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(45, 212, 191, .24);
    color: var(--pulse-text);
}

button,
input,
select,
textarea {
    font: inherit;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--pulse-focus-ring);
    outline-offset: 2px;
}

body.nav-open,
body.command-open {
    overflow: hidden;
}

a, .btn-link {
    color: var(--pulse-link);
    text-underline-offset: .18em;
}

.btn-primary {
    --bs-btn-bg: var(--pulse-action);
    --bs-btn-border-color: var(--pulse-action);
    --bs-btn-hover-bg: var(--pulse-action-hover);
    --bs-btn-hover-border-color: var(--pulse-action-hover);
    --bs-btn-active-bg: var(--pulse-action-hover);
    --bs-btn-active-border-color: var(--pulse-action-hover);
    color: var(--pulse-on-action);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 4px var(--pulse-focus-ring);
}

.content {
    padding-top: 1.1rem;
}

.relay-header {
    align-items: center;
    backdrop-filter: blur(18px);
    background: linear-gradient(135deg, #071827 0%, #0b3850 54%, #0f766e 100%);
    box-shadow: 0 18px 45px rgba(7, 24, 39, 0.18);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 68px;
    padding: 10px 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.relay-header nav,
.relay-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.relay-search {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    display: flex;
    flex: 1 1 220px;
    gap: 8px;
    max-width: 420px;
    min-width: 150px;
    padding: 6px 14px;
}

.relay-search-icon {
    font-size: 13px;
    opacity: .8;
}

.relay-search input {
    background: transparent;
    border: 0;
    color: #f9fafb;
    flex: 1;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.relay-search input::placeholder {
    color: rgba(249, 250, 251, .65);
}

.relay-header-tools {
    align-items: center;
    display: flex;
    gap: 10px;
}

.relay-status {
    align-items: center;
    color: #e5f2f1;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
}

.status-dot {
    background: #9ca3af;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, .25);
    height: 9px;
    width: 9px;
}

.relay-status.is-online .status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .25);
}

.relay-status.is-offline .status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .25);
}

.theme-toggle {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 7px 11px;
    transition: background .18s ease, transform .18s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, .26);
    transform: translateY(-1px);
}

.alarms-nav {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.alarm-badge {
    background: #ef4444;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    min-width: 18px;
    padding: 3px 6px;
    text-align: center;
}

.relay-header a {
    color: #f9fafb;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    opacity: .92;
    padding: 9px 12px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .18s ease, opacity .18s ease, transform .18s ease;
}

.relay-brand {
    align-items: center;
    display: inline-flex;
    font-size: 17px !important;
    font-weight: 800 !important;
    gap: 10px;
    padding-left: 0 !important;
    white-space: nowrap;
}

.brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 12px;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.relay-header a:hover {
    background: rgba(255, 255, 255, .14);
    opacity: 1;
    text-decoration: none;
    transform: translateY(-1px);
}

.relay-header a.nav-item.active {
    background: rgba(255, 255, 255, .22);
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.breadcrumbs {
    align-items: center;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 6px;
    margin-bottom: 10px;
}

.breadcrumbs a {
    color: #0f766e;
    font-weight: 600;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    color: #9ca3af;
}

.breadcrumbs .current {
    color: #111827;
    font-weight: 700;
}

.relay-header .dashboard-link {
    background: #14b8a6;
    color: #052e2b;
    font-weight: 800;
}

.alarm-page {
    margin: 0 auto;
    max-width: 1500px;
    padding: 28px;
}

.alarm-header {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.alarm-header h1 {
    color: #0f172a;
    font-size: 34px;
    letter-spacing: -.03em;
    margin: 0;
}

.alarm-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.alarm-actions a {
    background: #0f172a;
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .14);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    text-decoration: none;
}

.alarm-actions a:hover {
    filter: brightness(0.9);
}

.alarm-count {
    background: #e0f2fe;
    border-radius: 999px;
    color: #075985;
    font-size: 14px;
    font-weight: 800;
    padding: 8px 14px;
}

.alarm-filter {
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
}

.alarm-empty {
    background: #fff;
    border: 1px solid #d8e2ef;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
    color: #4b5563;
    padding: 24px;
}

.alarm-table {
    background: #fff;
    border: 1px solid #d8e2ef;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
    border-collapse: collapse;
    font-size: 14px;
    overflow: hidden;
    width: 100%;
}

.alarm-table th,
.alarm-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.alarm-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.alarm-table tbody tr:hover {
    background: #f8fbff;
}

.alarm-event-cell {
    color: #6b7280;
    font-size: 12px;
    word-break: break-all;
}

.alarm-camera-name {
    color: #111827;
    font-weight: 700;
}

.alarm-camera-id {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
    word-break: break-all;
}

.alarm-row-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.alarm-row-links a {
    background: #eef2ff;
    border-radius: 4px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 6px;
    text-decoration: none;
}

.alarm-row-links a:hover {
    background: #dbeafe;
}

.alarm-click-row {
    cursor: pointer;
}

.alarm-click-row.is-selected {
    background: #f0f9ff;
}

.alarm-detail-button {
    background: #0f766e;
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 11px;
}

.alarm-detail-button:hover {
    background: #115e59;
}

.alarm-detail-row td {
    background: #f8fafc;
    padding: 0;
}

.alarm-detail-panel {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 420px) 1fr;
    padding: 18px;
}

.alarm-snapshot-frame {
    align-items: center;
    background: #0f172a;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    min-height: 220px;
    overflow: hidden;
}

.alarm-snapshot-frame img {
    display: block;
    max-height: 420px;
    object-fit: contain;
    width: 100%;
}

.alarm-snapshot-empty {
    color: #cbd5e1;
    font-weight: 700;
    padding: 20px;
    text-align: center;
}

.alarm-detail-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.alarm-detail-list div {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
}

.alarm-detail-list dt {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.alarm-detail-list dd {
    color: #0f172a;
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .relay-header,
    .alarm-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .relay-header {
        gap: 10px;
        min-height: auto;
        padding: 14px 18px;
        position: static;
    }

    .relay-search {
        box-sizing: border-box;
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
    }

    .relay-header nav,
    .relay-nav {
        gap: 4px;
        justify-content: flex-start;
        width: 100%;
    }

    .relay-header a.nav-item {
        font-size: 12px;
        padding: 7px 9px;
    }

    .relay-header-tools {
        justify-content: space-between;
        width: 100%;
    }

    .alarm-page {
        padding: 18px;
    }

    .alarm-actions {
        justify-content: flex-start;
    }

    .alarm-detail-panel,
    .alarm-detail-list {
        grid-template-columns: 1fr;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ----------------------------------------------------------------------- */
/* Dark theme (toggled via [data-theme="dark"] on <html> by relay-ui.js)   */
/* ----------------------------------------------------------------------- */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background: #0b1220;
    color: #e5e7eb;
}

html[data-theme="dark"] a,
html[data-theme="dark"] .btn-link {
    color: #5eead4;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2 {
    color: #f1f5f9 !important;
}

/* Generic light surfaces used across pages */
html[data-theme="dark"] .camera-header,
html[data-theme="dark"] .camera-card,
html[data-theme="dark"] .camera-loading,
html[data-theme="dark"] .camera-error,
html[data-theme="dark"] .camera-empty,
html[data-theme="dark"] .alarm-empty,
html[data-theme="dark"] .alarm-table,
html[data-theme="dark"] .live-message,
html[data-theme="dark"] .camera-alarms-panel,
html[data-theme="dark"] .detail-alarm-table {
    background: #111a2e !important;
    border-color: #233047 !important;
    box-shadow: none !important;
    color: #cbd5e1;
}

html[data-theme="dark"] .camera-name,
html[data-theme="dark"] .alarm-camera-name {
    color: #e2e8f0;
}

html[data-theme="dark"] .alarm-table th,
html[data-theme="dark"] .detail-alarm-table th,
html[data-theme="dark"] .panel-title-row {
    background: #16213a !important;
    color: #cbd5e1 !important;
    border-color: #233047 !important;
}

html[data-theme="dark"] .alarm-table td,
html[data-theme="dark"] .detail-alarm-table td {
    border-color: #233047 !important;
}

html[data-theme="dark"] .alarm-table tbody tr:hover,
html[data-theme="dark"] .camera-card:hover {
    background: #16213a !important;
}

html[data-theme="dark"] .alarm-click-row.is-selected,
html[data-theme="dark"] .alarm-detail-row td {
    background: #16213a !important;
}

html[data-theme="dark"] .alarm-detail-list div {
    background: #111a2e;
    border-color: #233047;
}

html[data-theme="dark"] .alarm-detail-list dd {
    color: #e2e8f0;
}

html[data-theme="dark"] .camera-count,
html[data-theme="dark"] .alarm-count {
    background: #0e2a3a;
    color: #7dd3fc;
}

html[data-theme="dark"] .camera-icon {
    background: #0e2a3a;
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* ----------------------------------------------------------------------- */
/* Live alarm toasts (rendered by relay-ui.js into #relay-toast-stack)     */
/* ----------------------------------------------------------------------- */
#relay-toast-stack {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    position: fixed;
    right: 16px;
    top: 82px;
    width: min(348px, calc(100vw - 24px));
    z-index: 1080;
}

#relay-toast-stack > * {
    pointer-events: auto;
}

.relay-toast-sound {
    align-items: center;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-border);
    border-radius: 999px;
    box-shadow: var(--pulse-shadow-sm);
    color: var(--pulse-muted);
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.relay-toast-sound[hidden] {
    display: none;
}

.relay-toast-sound:hover {
    border-color: var(--pulse-danger);
    color: var(--pulse-danger-text);
}

.relay-toast-sound svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    width: 18px;
}

.relay-toast-sound .relay-toast-sound-on,
.relay-toast-sound.is-sound-on .relay-toast-sound-off {
    display: none;
}

.relay-toast-sound.is-sound-on .relay-toast-sound-on {
    display: block;
}

.relay-toast-sound.is-sound-on {
    border-color: var(--pulse-danger-border);
    color: var(--pulse-danger-text);
}

.relay-toast {
    animation: relay-toast-pulse 1.4s ease-in-out 4;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-danger);
    border-radius: var(--pulse-radius-md);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .18), var(--pulse-shadow-md);
    display: flex;
    overflow: hidden;
    transition: opacity .18s ease, transform .18s ease;
    width: 100%;
}

.relay-toast.is-leaving {
    opacity: 0;
    transform: translateX(14px);
}

@keyframes relay-toast-pulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(239, 68, 68, .18), var(--pulse-shadow-md);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, .3), var(--pulse-shadow-md);
    }
}

.relay-toast-link {
    align-items: center;
    color: inherit;
    display: flex;
    flex: 1;
    gap: 10px;
    min-width: 0;
    padding: 10px 4px 10px 10px;
    text-decoration: none;
}

.relay-toast-link:hover {
    text-decoration: none;
}

.relay-toast-thumb {
    background: var(--pulse-navy-900);
    border-radius: 8px;
    flex: 0 0 auto;
    height: 44px;
    object-fit: cover;
    width: 66px;
}

.relay-toast-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.relay-toast-title {
    color: var(--pulse-text);
    font-size: 13px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.relay-toast-meta {
    color: var(--pulse-muted);
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.relay-toast-time {
    color: var(--pulse-danger-text);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.relay-toast-close {
    align-self: flex-start;
    background: transparent;
    border: 0;
    color: var(--pulse-muted);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
    padding: 8px 10px;
}

.relay-toast-close:hover {
    color: var(--pulse-danger-text);
}

html[data-theme="dark"] .relay-toast {
    border-color: #7f2d3a;
}

html[data-theme="dark"] .relay-toast-thumb {
    background: #060b14;
}

/* Stable source identity shown beside camera names across server and WASM views. */
.server-id-badge {
    align-items: center;
    background: var(--pulse-accent-soft);
    border: 1px solid var(--pulse-accent-border);
    border-radius: 999px;
    color: var(--pulse-accent);
    display: inline-flex;
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .035em;
    line-height: 1;
    margin-inline-start: .38rem;
    max-width: 10rem;
    min-height: 1.25rem;
    overflow: hidden;
    padding: .18rem .42rem;
    text-overflow: ellipsis;
    vertical-align: .14em;
    white-space: nowrap;
}

html[data-theme="dark"] .server-id-badge {
    background: color-mix(in srgb, var(--pulse-accent) 14%, transparent);
}

@media (max-width: 820px) {
    #relay-toast-stack {
        top: 74px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .relay-toast {
        /* Steady red ring instead of the pulse. */
        animation: none;
        box-shadow: 0 0 0 4px rgba(239, 68, 68, .28), var(--pulse-shadow-md);
    }
}

