/* Chicane V3 design system — see memory/reference_design_decisions.md */

:root, [data-theme="dark"] {
    --bg: #0f1117;
    --surface-1: #161b22;
    --surface-2: #21262d;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-ghost: #484f58;
    --main: #3b82f6;
    --radius-sm: 6px;

    --c-success: #00c98e;
    --c-warning: #f59e0b;
    --c-error:   #ef4444;
    --c-info:    #3b82f6;
    --c-purple:  #8b5cf6;
    --c-muted:   #8b949e;
}

[data-theme="light"] {
    --bg: #f6f8fa;
    --surface-1: #ffffff;
    --surface-2: #f0f2f5;
    --border: #d0d7de;
    --text: #1f2937;
    --text-muted: #57606a;
    --text-ghost: #8b949e;
    --main: #3b82f6;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font: 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    height: 100%;
}

a { color: var(--main); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: "Cascadia Code", Consolas, "SF Mono", monospace; font-size: 12px; }

h1 { font-size: 20px; font-weight: 600; margin: 0 0 12px; color: var(--text); }
h2 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
h3, h4 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }

/* Redis deployment host picker */
.redis-deploy-host-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.redis-deploy-host-row > div { min-width: 0; }
.redis-host-picker { position: relative; min-width: 0; }
.redis-host-picker-controls { display: flex; gap: 6px; }
.redis-host-picker-controls input { min-width: 0; width: 100%; }
.redis-host-picker-controls button { flex-shrink: 0; }
.redis-host-picker-controls :focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.redis-host-picker-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    margin-top: 3px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px #0003;
}
.redis-host-picker-options { list-style: none; margin: 0; padding: 4px; max-height: 240px; overflow-y: auto; }
.redis-host-picker-option { padding: 7px 9px; border-radius: 3px; cursor: pointer; overflow-wrap: anywhere; }
.redis-host-picker-option:hover { background: var(--surface-2); }
.redis-host-picker-option.is-active { background: var(--surface-2); outline: 1px solid var(--main); outline-offset: -1px; }
.redis-host-picker-option[aria-selected="true"] { font-weight: 600; color: var(--main); }
.redis-host-picker-empty { padding: 10px; color: var(--text-muted); }

/* MSSQL standalone install host picker */
.mssql-install-toolbar { display: flex; gap: 6px; }
.mssql-install-toolbar input { min-width: 0; }
.mssql-install-toolbar button { flex-shrink: 0; }
.mssql-install-hosts { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mssql-install-hosts .table th { top: 0; z-index: 1; }
.mssql-install-hosts .mssql-install-check { width: 34px; }
.mssql-install-hosts tr.is-selectable { cursor: pointer; }
.mssql-install-hosts tr.is-selected { background: color-mix(in srgb, var(--main), transparent 88%); }
.mssql-install-hosts td { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .redis-deploy-host-row { grid-template-columns: minmax(0, 1fr); }
    .mssql-install-toolbar { flex-wrap: wrap; }
    .mssql-install-toolbar input { flex-basis: 100%; }
}

/* Page chrome */
.page {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    align-items: stretch;
}
.sidebar {
    grid-column: 1;
    grid-row: 1 / 3;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 220px;
    height: 100%;
    min-height: 0;
    background: var(--surface-1);
    border-right: 1px solid var(--border);
    padding: 0 0 8px;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 5;
    position: relative;
}
main {
    grid-column: 2;
    grid-row: 2;
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.top-row {
    grid-column: 2;
    grid-row: 1;
    min-height: 44px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 16px;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 4;
    position: relative;
}
.content {
    flex: 1;
    min-height: 0;
    padding: 16px 20px;
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
}
html, body { overflow-x: hidden; }
.navbar-brand {
    display: block;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    background: var(--surface-1);
}
.nav-search {
    position: relative;
    padding: 2px 12px 10px;
}
.nav-search::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 12px;
    width: 13px;
    height: 13px;
    pointer-events: none;
    opacity: .72;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238b949e' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m10.5 10.5 3 3'/%3E%3C/svg%3E");
}
.nav-search input[type="search"] {
    box-sizing: border-box;
    width: 100%;
    height: 34px;
    padding: 0 30px 0 32px;
    color: var(--text);
    font: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.nav-search input[type="search"]::placeholder { color: var(--text-ghost); }
.nav-search input[type="search"]:hover { border-color: var(--text-ghost); }
.nav-search input[type="search"]:focus {
    background: var(--surface-2);
    border-color: var(--main);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--main), transparent 75%);
}
.nav-search input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
    filter: invert(62%) sepia(8%) saturate(409%) hue-rotate(171deg);
}
.sidebar nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}
.nav-link {
    display: block;
    padding: 7px 16px;
    color: var(--text-muted);
    border-left: 3px solid transparent;
    text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--surface-2); color: var(--text); border-left-color: var(--main); }
.nav-item-row { display: flex; align-items: stretch; }
.nav-item-row .nav-link { flex: 1 1 auto; min-width: 0; }
.nav-star {
    padding: 0 10px;
    color: var(--text-ghost);
    background: transparent;
    border: 0;
    cursor: pointer;
    opacity: 0;
}
.nav-item-row:hover .nav-star, .nav-star:focus-visible, .nav-star.is-fav { opacity: 1; }
.nav-star.is-fav { color: var(--c-warning); }
.top-favourites { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.top-fav-link {
    padding: 3px 8px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 12px;
    text-decoration: none;
}
.top-fav-link:hover, .top-fav-link.active {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-block; padding: 6px 14px; font-size: 13px;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: background 0.15s;
}
.btn:hover { background: color-mix(in srgb, var(--surface-2), var(--text) 8%); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--main); border-color: var(--main); color: white; }
.btn-primary:hover { background: color-mix(in srgb, var(--main), black 15%); }
.btn-danger { background: var(--c-error); border-color: var(--c-error); color: white; }
.btn-danger:hover { background: color-mix(in srgb, var(--c-error), black 15%); }
.btn-success { background: var(--c-success); border-color: var(--c-success); color: white; }
.btn-sm { padding: 3px 10px; font-size: 12px; }

/* Forms */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
textarea, select, .form-control {
    width: 100%; box-sizing: border-box;
    padding: 6px 10px; font-size: 13px;
    background: var(--surface-1); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--main); }
.form-label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--text-muted); }
.mb-3 { margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
/* Responsive columns: base widths survive until their named breakpoint. */
.row > [class*="col-"] { flex: 1; min-width: 0; box-sizing: border-box; }
.row > [class*="col-md-"], .row > [class*="col-lg-"] { flex: 0 0 100%; }
.row > .col-12 { flex: 0 0 100%; }
.row > .col-6 { flex: 0 0 calc(50% - 4px); }
.row > .col-5 { flex: 0 0 calc(41.666% - 5px); }
.row > .col-7 { flex: 0 0 calc(58.333% - 4px); }
.row > .col-4 { flex: 0 0 calc(33.333% - 6px); }
.row > .col-3 { flex: 0 0 calc(25% - 6px); }
.row > .col-2 { flex: 0 0 calc(16.666% - 7px); }
.row > .col-8 { flex: 0 0 calc(66.666% - 3px); }
@media (min-width: 768px) {
    .row > .col-md-12 { flex: 0 0 100%; }
    .row > .col-md-6 { flex: 0 0 calc(50% - 4px); }
    .row > .col-md-5 { flex: 0 0 calc(41.666% - 5px); }
    .row > .col-md-7 { flex: 0 0 calc(58.333% - 4px); }
    .row > .col-md-4 { flex: 0 0 calc(33.333% - 6px); }
    .row > .col-md-3 { flex: 0 0 calc(25% - 6px); }
    .row > .col-md-2 { flex: 0 0 calc(16.666% - 7px); }
    .row > .col-md-8 { flex: 0 0 calc(66.666% - 3px); }
}
@media (min-width: 1024px) {
    .row > .col-lg-12 { flex: 0 0 100%; }
    .row > .col-lg-6 { flex: 0 0 calc(50% - 4px); }
    .row > .col-lg-5 { flex: 0 0 calc(41.666% - 5px); }
    .row > .col-lg-7 { flex: 0 0 calc(58.333% - 4px); }
    .row > .col-lg-4 { flex: 0 0 calc(33.333% - 6px); }
    .row > .col-lg-3 { flex: 0 0 calc(25% - 6px); }
    .row > .col-lg-2 { flex: 0 0 calc(16.666% - 7px); }
    .row > .col-lg-8 { flex: 0 0 calc(66.666% - 3px); }
}

/* Modal dialogs — Blazor-controlled overlay, no JS interop needed.
   Mounted as a fixed-position element with a translucent backdrop;
   the dialog is centred + capped to viewport so long content scrolls
   internally. Page renders <NmModal Open="..."> components and toggles
   the bound boolean to show/hide. */
.nm-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    box-sizing: border-box;
    padding: clamp(8px, 3vw, 24px);
}
.nm-modal {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    max-width: 720px; width: 100%;
    box-sizing: border-box; min-width: 0;
    max-height: calc(100vh - clamp(16px, 6vw, 48px));
    max-height: calc(100dvh - clamp(16px, 6vw, 48px));
    display: flex; flex-direction: column;
}
.nm-modal-header {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.nm-modal-header h4 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.nm-modal-header, .nm-modal-footer { flex-shrink: 0; }
.nm-modal-close { margin-left: auto; flex-shrink: 0; }
.nm-modal-body  { padding: 14px 18px; overflow: auto; flex: 1; min-height: 0; min-width: 0; overflow-wrap: anywhere; }
.nm-modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-responsive { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--surface-2); color: var(--text-muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; }
.table tbody tr:hover { background: var(--surface-2); }

/* Match .content's 16px top padding so Redis rows cannot scroll above the header. */
.browse-table .table thead th { top: -16px; z-index: 1; background: var(--surface-2); }

/* Cards */
.card {
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
}

/* Badges */
.badge {
    display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 500;
    border-radius: 999px; background: color-mix(in srgb, var(--main), transparent 80%); color: var(--main);
}
.badge-success { background: color-mix(in srgb, var(--c-success), transparent 80%); color: var(--c-success); }
.badge-warning { background: color-mix(in srgb, var(--c-warning), transparent 80%); color: var(--c-warning); }
.badge-error,
.badge-danger  { background: color-mix(in srgb, var(--c-error), transparent 80%); color: var(--c-error); }
.badge-muted   { background: color-mix(in srgb, var(--c-muted), transparent 80%); color: var(--c-muted); }
.badge-info    { background: color-mix(in srgb, var(--c-info), transparent 80%); color: var(--c-info); }

/* Alerts */
.alert {
    padding: 10px 14px; border-radius: var(--radius-sm);
    border-left: 3px solid var(--main); background: var(--surface-1); margin-bottom: 12px; font-size: 13px;
}
.alert-success { border-left-color: var(--c-success); }
.alert-warning { border-left-color: var(--c-warning); }
.alert-danger  { border-left-color: var(--c-error); color: var(--text); }
.alert-secondary { border-left-color: var(--text-muted); color: var(--text-muted); }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-ghost { color: var(--text-ghost); }
.small { font-size: 11px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.me-3 { margin-right: 12px; }
.ms-1 { margin-left: 4px; } .ms-3 { margin-left: 12px; }

/* SSO buttons */
.btn-sso {
    display: inline-flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 14px; justify-content: center; font-weight: 500;
    background: var(--surface-1); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px;
}
.btn-sso:hover { background: var(--surface-2); }
.btn-sso .ico { width: 18px; height: 18px; }

/* Settings sections */
.settings-section { margin-bottom: 16px; }
.settings-section-title {
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: 0.05em;
}

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 92%; max-width: 720px; max-height: 90vh; overflow: auto; }
.modal-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 14px 16px; }
.modal-footer { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.btn-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.btn-close:hover { color: var(--text); }

/* Status dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.dot-online { background: var(--c-success); }
.dot-offline { background: var(--c-muted); }
.dot-warning { background: var(--c-warning); }
.dot-error { background: var(--c-error); }


/* Shared wrapping controls and mobile navigation. Keep these in the loaded theme. */
.flex-wrap { flex-wrap: wrap; }
.ms-auto { margin-left: auto; }
.nm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.nm-toolbar > * { min-width: 0; max-width: 100%; }
.nm-toolbar > .btn, .nm-toolbar > a { flex-shrink: 0; }
.btn { box-sizing: border-box; }
.top-row > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.mobile-menu-toggle { display: none; }
:where(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }

@media (max-width: 1023.98px) {
    .page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .top-row { grid-column: 1; padding: 8px 12px; }
    main { grid-column: 1; }
    .mobile-menu-toggle { display: inline-block; }
    .sidebar { display: none; grid-column: 1; grid-row: 2; width: 100%; height: auto; max-height: 50vh; max-height: 50dvh; border-right: 0; border-bottom: 1px solid var(--border); }
    .menu-open { grid-template-rows: auto auto minmax(0, 1fr); }
    .menu-open .sidebar { display: flex; }
    .menu-open main { grid-row: 3; }
    .sidebar .navbar-brand { display: none; }
    .content { padding: 12px; }
}
@media (max-width: 767.98px), (pointer: coarse) {
    .btn, .nav-link, .nav-star, .act-item, .pf-tab { min-height: 44px; min-width: 44px; }
    .nav-star { opacity: 1; }
    .nav-link, .pf-tab { box-sizing: border-box; }
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
    select, textarea, .form-control { font-size: 16px !important; }
    .form-control, select, .nav-search input { min-height: 44px; }
}

/* Critical queue alert (QueueAlertHost). Lives here because component .razor.css files are never loaded. */
.queue-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
    color: #fff;
    background: rgba(93, 0, 0, .94);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: queue-danger-pulse 1s steps(2, end) infinite;
}
.queue-alert-overlay::before,
.queue-alert-overlay::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 22px;
    pointer-events: none;
    background: repeating-linear-gradient(45deg, #ffd400 0 22px, #111 22px 44px);
    box-shadow: 0 0 18px rgba(0, 0, 0, .6);
}
.queue-alert-overlay::before { top: 0; }
.queue-alert-overlay::after { bottom: 0; }

.queue-alert-panel {
    width: min(860px, 100%);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    box-sizing: border-box;
    padding: clamp(24px, 5vw, 56px);
    text-align: center;
    border: 5px solid #fff;
    border-radius: 20px;
    background: #b40000;
    box-shadow: 0 0 0 12px rgba(255, 255, 255, .16), 0 24px 80px #000;
    animation: queue-glow 1.1s ease-in-out infinite alternate, queue-panel-shake .65s ease-in-out infinite alternate;
}

.queue-alert-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 18px;
    border-radius: 999px;
    color: #111;
    background: #ffd400;
    font-size: clamp(13px, 1.6vw, 16px);
    font-weight: 900;
    letter-spacing: .3em;
    text-transform: uppercase;
    box-shadow: 0 0 0 3px #111, 0 0 18px rgba(255, 212, 0, .8);
}

.queue-alert-icon {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    border-radius: 50%;
    color: #9b0000;
    background: #fff;
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 0 6px #9b0000, 0 0 0 10px #fff, 0 0 30px rgba(255, 255, 255, .7);
    animation: queue-icon-bounce .6s ease-in-out infinite alternate;
}

.queue-alert-panel h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(32px, 7vw, 72px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-shadow: 0 4px 0 #5a0000, 0 6px 24px rgba(0, 0, 0, .6);
}
.queue-alert-lead { margin: 16px 0 8px; font-size: clamp(16px, 2vw, 22px); font-weight: 600; }
.queue-alert-panel ul { max-height: 36vh; overflow: auto; margin: 12px 0 0; padding: 0; list-style: none; font-size: clamp(16px, 2.2vw, 22px); font-weight: 800; }
.queue-alert-panel li {
    margin: 10px 0;
    padding: 14px 16px;
    text-align: left;
    background: rgba(0, 0, 0, .3);
    border-left: 6px solid #fff;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.queue-dismiss {
    margin-top: 18px;
    min-height: 44px;
    padding: 14px 28px;
    color: #8b0000;
    background: #fff;
    border: 3px solid #fff;
    border-radius: 12px;
    font-size: clamp(15px, 1.8vw, 18px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
    box-shadow: 0 6px 0 #5a0000;
}
.queue-dismiss:hover:not(:disabled) { color: #fff; background: #5a0000; border-color: #fff; }
.queue-alert-hint { margin: 18px 0 0; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: clamp(13px, 1.6vw, 16px); }

.queue-alert-strip {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #fff;
    background: #8f1111;
    border-bottom: 3px solid #ffd400;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    font-size: 13px;
}
.queue-alert-strip strong { text-transform: uppercase; letter-spacing: .06em; }

@keyframes queue-danger-pulse { from { background-color: rgba(93, 0, 0, .94); } to { background-color: rgba(220, 0, 0, .97); } }
@keyframes queue-panel-shake { from { transform: rotate(-.25deg) scale(1); } to { transform: rotate(.25deg) scale(1.015); } }
@keyframes queue-glow {
    from { box-shadow: 0 0 0 12px rgba(255, 255, 255, .16), 0 0 0 rgba(255, 60, 60, 0), 0 24px 80px #000; }
    to   { box-shadow: 0 0 0 12px rgba(255, 255, 255, .5), 0 0 60px 12px rgba(255, 80, 80, .9), 0 24px 80px #000; }
}
@keyframes queue-icon-bounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-10px) scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
    .queue-alert-overlay, .queue-alert-panel, .queue-alert-icon { animation: none; }
    .queue-alert-panel { box-shadow: 0 0 0 12px rgba(255, 255, 255, .4), 0 0 60px 12px rgba(255, 80, 80, .8), 0 24px 80px #000; }
}

@media (max-width: 600px) {
    .queue-alert-overlay { padding: 30px 12px; }
    .queue-alert-overlay::before, .queue-alert-overlay::after { height: 14px; background-size: auto; }
    .queue-alert-panel { padding: 20px 16px; max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); border-width: 4px; }
    .queue-alert-icon { width: 72px; height: 72px; font-size: 48px; }
    .queue-alert-panel li { font-size: 16px; padding: 12px; }
    .queue-alert-strip { flex-direction: column; gap: 2px; text-align: center; }
}
.drop-zone {
    position: relative;
    display: grid !important;
    justify-items: center;
    gap: 5px !important;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 28px;
    margin: 16px 0;
    text-align: center;
    cursor: pointer;
    background: var(--surface-2);
}
.drop-zone:hover, .drop-zone:focus-within, .drop-zone.dragging { border-color: var(--main); }
.drop-zone.dragging { background: var(--surface-1); }
.drop-zone:focus-within { outline: 2px solid var(--main); outline-offset: 2px; }
.drop-zone.compact { padding: 12px; }
.drop-zone.disabled { opacity: .6; cursor: wait; }
.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: inherit;
}
.drop-zone .drop-icon { font-size: 28px; color: var(--main); }
.drop-zone small { color: var(--text-muted); }
.upload-progress { display: block; width: 100%; height: 8px; accent-color: var(--main); }
.upload-files { width: 100%; font-size: 12px; }
.upload-files td:first-child { overflow-wrap: anywhere; }
.upload-files td:last-child { text-align: right; }

.backup-tabs { display:flex; flex-wrap:wrap; gap:.5rem; padding:.75rem 0; margin-bottom:1rem; border-bottom:1px solid var(--border); }
