/* Chicane V3 design system — see memory/reference_design_decisions.md */

:root, [data-theme="dark"] {
    --color-scheme: 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"] {
    --color-scheme: 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:focus { outline: none; }
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, .search-select { position: relative; min-width: 0; }
.redis-host-picker-controls, .search-select-controls { display: flex; gap: 6px; }
.redis-host-picker-controls input, .search-select-controls input { min-width: 0; width: 100%; }
.redis-host-picker-controls button, .search-select-controls button { flex-shrink: 0; }
.redis-host-picker-controls :focus-visible, .search-select-controls :focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.redis-host-picker-popup, .search-select-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, .search-select-options { list-style: none; margin: 0; padding: 4px; max-height: 240px; overflow-y: auto; }
.redis-host-picker-option, .search-select-option { padding: 7px 9px; border-radius: 3px; cursor: pointer; overflow-wrap: anywhere; }
.redis-host-picker-option:hover, .search-select-option:hover { background: var(--surface-2); }
.redis-host-picker-option.is-active, .search-select-option.is-active { background: var(--surface-2); outline: 1px solid var(--main); outline-offset: -1px; }
.redis-host-picker-option[aria-selected="true"], .search-select-option[aria-selected="true"] { font-weight: 600; color: var(--main); }
.redis-host-picker-empty, .search-select-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) auto;
    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;
}
/* Reserved strip so the browser's bottom-left link-status bubble never covers nav links or page buttons. Keep non-interactive. */
.page-footer {
    grid-column: 1 / -1;
    grid-row: 3;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 26px;
    padding: 0 16px;
    font-size: 11px;
    color: var(--text-ghost);
    background: var(--surface-1);
    border-top: 1px solid var(--border);
    user-select: none;
    z-index: 6;
}
html, body { overflow-x: hidden; }
.navbar-brand {
    display: block;
    padding: 12px 16px;
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
    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-row > .top-favourites { flex: 1 1 auto; min-width: 0; }
.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); }

/* MongoDB overview shares the padded page scroller, including its host list. */
.mongo-overview-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) auto; }
    .top-row { grid-column: 1; padding: 8px 12px; }
    .top-row > .top-favourites {
        flex: 1 1 100%; order: 2; flex-wrap: nowrap;
        overflow-x: auto; overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }
    .top-favourites > * { flex: 0 0 auto; }
    .top-favourites .top-fav-link { white-space: nowrap; }
    .top-row > .nm-toolbar { margin-left: auto; }
    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) auto; }
    .menu-open .sidebar { display: flex; }
    .menu-open main { grid-row: 3; }
    .menu-open .page-footer { grid-row: 4; }
    .sidebar .navbar-brand { display: none; }
    .content { padding: 12px; }
}
@media (max-width: 767.98px), (pointer: coarse) {
    .page-footer { display: none; }
    .btn, .nav-link, .nav-star, .top-fav-link, .act-item, .pf-tab { min-height: 44px; min-width: 44px; }
    .top-fav-link { display: inline-flex; align-items: center; box-sizing: border-box; }
    .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); }

/* Location VM assignments: explicit layout; Bootstrap display utilities are not loaded. */
.nm-modal-body:has(.location-assignment-fields) { display: flex; flex-direction: column; overflow: hidden; }
.location-assignment-fields { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.location-assignment-fields > :not(.location-assignment-list) { flex-shrink: 0; }
.location-assignment-fields > p { margin: 0; }
.location-assignment-fields > button { align-self: flex-start; }
.location-assignment-list { min-height: 0; max-height: 50vh; max-height: 50dvh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.location-assignment-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 10px; padding: 10px 12px; margin: 0; cursor: pointer; border-bottom: 1px solid var(--border); }
.location-assignment-row:last-child { border-bottom: 0; }
.location-assignment-row:hover { background: var(--surface-2); }
.location-assignment-row.is-selected { background: color-mix(in srgb, var(--main), transparent 88%); box-shadow: inset 3px 0 var(--main); }
.location-assignment-row input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--main); }
.location-assignment-detail { min-width: 0; overflow-wrap: anywhere; }
.location-assignment-name { display: block; font-weight: 600; line-height: 1.4; }
.location-assignment-detail small { display: block; margin-top: 3px; color: var(--text-muted); }
.location-assignment-list:focus-visible, .location-assignment-row:focus-within { outline: 2px solid var(--main); outline-offset: -2px; }
.location-assignment-empty { padding: 12px; margin: 0; color: var(--text-muted); }

.location-assignment-branch { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 10px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; }
.location-assignment-branch > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.location-assignment-branch small { color: var(--text-muted); }
.location-assignment-branch:focus-visible { outline: 2px solid var(--main); outline-offset: -2px; }
.location-assignment-children, .location-assignment-vms { margin-left: 14px; border-left: 1px solid var(--border); }
@media (max-width: 600px) { .location-assignment-children, .location-assignment-vms { margin-left: 7px; } .location-assignment-row { padding: 10px 8px; } }

.location-image-host-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.location-image-host-filter { max-width: 100%; padding: 6px 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.location-image-host-filter:hover { border-color: var(--main); }
.location-image-host-filter.is-selected { background: color-mix(in srgb, var(--main), transparent 80%); border-color: var(--main); color: var(--main); }
.location-image-host-filter:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.location-image-catalogue { table-layout: fixed; width: 100%; }
.location-image-operations { margin: 12px 0; }
.location-image-run { margin: 8px 0; border-left: 3px solid var(--main); }
.location-image-run[data-state="Needs review"] { border-left-color: var(--danger, #c43b43); }
.location-image-run ul { margin: 8px 0; padding-left: 20px; }
.location-image-run li { margin: 6px 0; overflow-wrap: anywhere; }
.location-image-run progress { display: block; width: 100%; height: 8px; margin-top: 4px; }
.location-image-catalogue th, .location-image-catalogue td { overflow-wrap: anywhere; }
.location-image-catalogue th:nth-child(4) { width: 32%; }
.location-image-catalogue th:first-child { width: 3rem; }
.location-image-catalogue th:last-child { width: 14%; }
@media (max-width: 600px) { .location-image-catalogue th, .location-image-catalogue td { padding: 6px 4px; } }

@media (max-width: 600px) {
    .location-image-catalogue, .location-image-catalogue tbody, .location-image-catalogue tr { display: block; }
    .location-image-catalogue thead { display: none; }
    .location-image-catalogue tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
    .location-image-catalogue td { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; border: 0; }
    .location-image-catalogue td::before { color: var(--text-muted); font-size: 12px; }
    .location-image-catalogue td:nth-child(1)::before { content: "Select"; }
    .location-image-catalogue td:nth-child(2)::before { content: "Image"; }
    .location-image-catalogue td:nth-child(3)::before { content: "Host"; }
    .location-image-catalogue td:nth-child(4)::before { content: "Backing file"; }
    .location-image-catalogue td:nth-child(5)::before { content: "VM usage"; }
    .location-image-catalogue td:nth-child(6)::before { content: "Action"; }
    .location-image-catalogue td .btn { justify-self: start; }
}

.location-usage-summary p { margin: 6px 0; }
.location-image-usage { table-layout: fixed; width: 100%; }
.location-image-usage td { overflow-wrap: anywhere; }
.location-image-usage small { color: var(--text-muted); }
@media (max-width: 600px) { .location-image-catalogue td:nth-child(5) .btn { grid-column: 2; } }

.location-disk-limit { display:block; overflow-wrap:anywhere; }
.location-register-placement { border:0; padding:0; margin:0; min-width:0; }
@media (max-width:700px) {
  .location-vm-table, .location-vm-table tbody, .location-vm-table tr, .location-vm-table td { display:block; width:100%; box-sizing:border-box; }
  .location-vm-table thead { display:none; }
  .location-vm-table tr { margin-bottom:1rem; border:1px solid var(--border); }
  .location-vm-table td { overflow-wrap:anywhere; }
  .location-vm-table td::before { content:attr(data-label); display:block; font-weight:600; margin-bottom:.4rem; }
}
.location-image-actions { display:flex; flex-wrap:wrap; gap:.35rem; }
@media (max-width:600px) {
  .location-image-actions { grid-column:2; }
}

.location-guest-ip { overflow-wrap:anywhere; }
.location-disk-status { display:inline-flex; align-items:baseline; gap:.35rem; }
.location-disk-status > [aria-hidden] { flex-shrink:0; font-weight:700; }
.location-disk-status.is-verified { color:var(--c-success); }
.location-disk-status.is-other { color:var(--c-error); }
.location-disk-status.is-unknown { color:var(--text-muted); }
.location-health-status { display:inline-flex; align-items:baseline; gap:.35rem; overflow-wrap:anywhere; }
.location-health-status > [aria-hidden] { flex-shrink:0; font-weight:700; }
.location-health-status.is-healthy { color:var(--c-success); }
.location-health-status.is-unhealthy { color:var(--c-error); }
.location-health-status.is-checking, .location-health-status.is-unchecked { color:var(--text-muted); }
.csm-map-coverage { position:relative; isolation:isolate; height:320px; border-radius:6px; overflow:hidden; }
.location-attached-disk { display:flex; align-items:center; gap:.5rem; }
.location-attached-disk > span { min-width:0; overflow-wrap:anywhere; }
.location-disk-add { flex-shrink:0; min-width:28px; font-size:18px; line-height:1; color:var(--main); }

/* Phone layouts keep navigation, form controls and reading text usable without zoom. */
@media (max-width: 767.98px) {
    body { font-size: 15px; }
    .small, small, .form-label, .text-muted.small { font-size: 13px; line-height: 1.5; }
    .btn-sm, .badge { font-size: 13px; }
    .content { min-width: 0; overflow-wrap: anywhere; }
    .content > .d-flex { flex-wrap: wrap; gap: 8px; }
    .content > .d-flex > * { min-width: 0; max-width: 100%; }
    .pf-tabs, .agent-tabs, .backup-tabs, .platform-tabs, .addagent-tabs { flex-wrap: wrap !important; overflow-x: visible !important; gap: 6px; }
    .pf-tabs > button, .agent-tabs > button, .backup-tabs > a, .platform-tabs > button, .addagent-tabs > button { flex: 1 1 auto; white-space: normal; }
    .nm-modal-body { overscroll-behavior: contain; }
    .nm-modal-header h4 { font-size: 16px; text-transform: none; letter-spacing: normal; }
    .nm-modal-footer > .btn { flex: 1 1 120px; }
    .nm-modal-footer > span { flex: 1 1 100%; }
    .modal-card { max-height: calc(100dvh - 16px); }
    .modal-footer { flex-wrap: wrap; }
    .modal-footer > .btn { flex: 1 1 120px; }
    pre { max-width: 100%; overflow-x: auto; }
    .table-responsive { scrollbar-width: thin; }
    .table-responsive .table { font-size: 13px; }
    .table-responsive .table th { white-space: normal; }
}

@media (max-width: 767.98px) {
    h1[tabindex="-1"]:focus { outline: none; }
    table[data-mobile-records] { display: block; width: 100% !important; min-width: 0 !important; }
    table[data-mobile-records] > thead { display: block; }
    table[data-mobile-records] > thead > tr { display: flex; flex-wrap: wrap; gap: 8px; }
    table[data-mobile-records] > thead th[data-mobile-control="false"] { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
    table[data-mobile-records] > thead th[data-mobile-control="true"] { display: flex; align-items: center; position: static; padding: 6px; }
    table[data-mobile-records] > tbody { display: grid; gap: 12px; }
    table[data-mobile-records] > tbody > tr { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-1); }
    table[data-mobile-records] > tbody > tr > td { display: block; width: auto !important; min-width: 0 !important; max-width: 100%; white-space: normal !important; overflow-wrap: anywhere; border: 0; padding: 5px 0; text-align: left; }
    table[data-mobile-records] > tbody > tr > td::before { content: attr(data-mobile-label); display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 3px; }
    table[data-mobile-records] td > input, table[data-mobile-records] td > select { max-width: 100%; }
    table[data-mobile-records] input[type="checkbox"] { width: 22px; height: 22px; }
    table[data-mobile-records] td > .btn { margin: 3px; }
}

@media (min-width: 360px) and (max-width: 767.98px) {
    table[data-mobile-records] > tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
    table[data-mobile-records] > tbody > tr > td:first-child,
    table[data-mobile-records] > tbody > tr > td:last-child { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
    button.filter-chip, button.upd-badge { min-height: 44px; min-width: 44px; font-size: 13px; padding: 8px 10px; }
    .nm-toolbar > .badge { align-self: center; }
}

.map-database-activity { padding: 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.map-database-activity > summary { cursor: pointer; }
.map-database-activity > summary strong { margin-inline-end: 8px; }
.map-database-activity[open] > summary { margin-bottom: 4px; }
.map-database-query { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.map-database-counters { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0; }
@media (max-width: 767.98px) { .map-database-counters { display: grid; grid-template-columns: 1fr; } }

.agent-status-label { display: none; }
@media (max-width: 767.98px) {
    .agent-status-label { display: inline; }
    table[data-mobile-records] > tbody > tr { opacity: 1 !important; }
}

/* Structured review of a Location Servers VM creation request. */
.location-create-review { display: grid; gap: 20px; }
.location-create-review-power { display: grid; gap: 4px; border-left: 3px solid var(--main); border-radius: 4px; padding: 12px 14px; background: var(--surface-2); }
.location-create-review-power span, .location-create-review-hint { color: var(--text-muted); font-size: 12px; }
.location-create-review-specs { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; margin: 0; }
.location-create-review-specs > div { min-width: 0; }
.location-create-review dt { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.location-create-review-specs dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; }
.location-create-review-specs small { display: inline-block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.location-create-review h5 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.location-create-review-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 6px 16px; list-style: none; padding: 12px; margin: 0; border: 1px solid var(--border); border-radius: 4px; }
.location-create-review-names li { min-width: 0; overflow-wrap: anywhere; font-family: monospace; }
.location-create-review-hint { margin: 0 0 10px; }
.location-create-review-hosts { display: grid; gap: 10px; }
.location-create-review-host { padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; min-width: 0; }
.location-create-review-host h6 { margin: 0 0 10px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.location-create-review-host dl { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.location-create-review-host dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
    .location-create-review-specs { grid-template-columns: 1fr 1fr; }
    .location-create-review-specs > div:last-child { grid-column: 1 / -1; }
    .location-create-review-host dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .location-create-review-host dd + dt { margin-top: 6px; }
}

/* MongoDB Explorer (/mongo-explorer): connection tree beside a tabbed pane, each scrolling on its own.
   Below 1024px the columns stack and the tree is capped at 40% of the viewport height. */
.mx-page { display: flex; flex-direction: column; height: 100%; min-height: 520px; }
.mx-page > h1, .mx-notice { flex-shrink: 0; }
.mx-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.mx-tree { background: var(--surface-1); border-right: 1px solid var(--border); overflow: auto; min-height: 0; padding: 8px 0; }
.mx-tree-bar { display: flex; gap: 6px; padding: 0 10px 8px; }
.mx-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-ghost); padding: 8px 12px 3px; }
.mx-empty { color: var(--text-muted); font-size: 12px; padding: 3px 12px 3px 26px; }
.mx-row { position: relative; display: flex; align-items: center; min-width: 0; }
.mx-row:hover, .mx-row:focus-within { background: var(--surface-2); }
.mx-row.mx-sel { background: color-mix(in srgb, var(--main) 24%, var(--surface-1)); }
.mx-l1 { padding-left: 12px; } .mx-l2 { padding-left: 28px; } .mx-l3 { padding-left: 46px; }
.mx-pager { gap: 6px; padding-top: 3px; padding-bottom: 3px; color: var(--text-muted); font-size: 11px; }
.mx-pager:hover { background: none; }
.mx-pager .btn { padding: 0 7px; line-height: 1.5; }
.mx-pager-at { white-space: nowrap; }
.mx-info-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--text-muted); font-size: 12px; }
.mx-info-pager .form-control { width: 220px; max-width: 100%; } .mx-l4 { padding-left: 64px; } .mx-l5 { padding-left: 82px; }
.mx-node { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 0; background: none; border: 0; color: var(--text); font: inherit; text-align: left; white-space: nowrap; cursor: pointer; }
.mx-node:focus-visible, .mx-more:focus-visible, .mx-menu-item:focus-visible, .mx-tab:focus-visible { outline: 2px solid var(--main); outline-offset: -2px; }
.mx-node.mx-ro, .mx-node.mx-ro .mx-ic { color: var(--text-muted); }
.mx-caret { width: 14px; flex-shrink: 0; text-align: center; color: var(--text-muted); }
.mx-ic { flex-shrink: 0; color: var(--text-muted); }
.mx-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mx-sz { margin-left: auto; padding-left: 8px; color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.mx-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-sizing: border-box; border: 1px solid var(--text-ghost); background: transparent; }
.mx-dot-ok { background: var(--c-success); border-color: var(--c-success); }
.mx-dot-off { background: var(--text-ghost); }
.mx-more { flex-shrink: 0; opacity: 0; background: none; border: 0; color: var(--text-muted); font: inherit; padding: 0 8px; cursor: pointer; }
.mx-row:hover > .mx-more, .mx-row:focus-within > .mx-more, .mx-more[aria-expanded="true"] { opacity: 1; }
.mx-more:hover { color: var(--text); }
.mx-status, .mx-error { gap: 8px; padding-top: 3px; padding-bottom: 3px; padding-right: 10px; font-size: 12px; }
.mx-status { color: var(--text-muted); }
.mx-error { color: var(--c-error); flex-wrap: wrap; overflow-wrap: anywhere; }
.mx-filter { display: block; width: calc(100% - 56px); margin: 2px 10px 4px 46px; padding: 3px 8px; font-size: 12px; }
.mx-menu-backdrop { position: fixed; inset: 0; z-index: 1050; }
.mx-menu { position: absolute; top: 100%; right: 8px; z-index: 1051; min-width: 210px; max-width: 280px; box-sizing: border-box; padding: 4px 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.mx-menu.mx-menu-at { position: fixed; right: auto; }
.mx-menu-item { display: block; width: 100%; padding: 5px 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mx-menu-item:hover, .mx-menu-item:focus { background: color-mix(in srgb, var(--main) 35%, var(--surface-2)); }
.mx-menu-danger { color: var(--c-error); }
.mx-menu-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.mx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.mx-crumb { padding: 10px 16px 0; color: var(--text-muted); overflow-wrap: anywhere; }
.mx-crumb b { color: var(--text); }
.mx-tabs { display: flex; gap: 2px; padding: 8px 16px 0; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.mx-tab { flex-shrink: 0; padding: 7px 13px; background: none; border: 1px solid transparent; border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--text-muted); font: inherit; cursor: pointer; }
.mx-tab.on { background: var(--surface-1); border-color: var(--border); color: var(--text); }
.mx-tab:disabled { opacity: .45; cursor: not-allowed; }
.mx-view { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.mx-confirm-target { margin: 0 0 10px; font-weight: 600; overflow-wrap: anywhere; }
.mx-field { margin-bottom: 8px; }
.mx-hint { margin: 4px 0 0; }
.mx-dialog-alert { margin: 8px 0 0; }
.mx-conn-string { display: flex; gap: 8px; }
.mx-conn-string > .form-control { flex: 1; min-width: 0; }
.mx-test-ok { color: var(--c-success); }
.mx-test-bad { color: var(--c-error); }
/* Documents tab: search bar, result line, table / JSON page, editor and change list. */
.mx-docs { min-width: 0; }
.mx-ro-banner { margin: 0 0 10px; padding: 6px 10px; border-left: 3px solid var(--text-muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-1); color: var(--text-muted); overflow-wrap: anywhere; }
.mx-docs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin-bottom: 10px; }
.mx-docs-bar > * { min-width: 0; max-width: 100%; }
.mx-docs-bar > .btn { flex-shrink: 0; }
.mx-docs-label { color: var(--text-muted); }
.mx-docs-filter { flex: 1 1 260px; width: auto; }
.mx-docs-sort { flex: 0 1 200px; width: auto; }
.mx-docs-filter, .mx-docs-sort { padding: 5px 8px; font-size: 12px; }
.mx-docs-size { width: auto; padding: 4px 8px; font-size: 12px; }
.mx-seg { display: inline-flex; gap: 2px; }
.mx-seg .btn.on { background: color-mix(in srgb, var(--main) 35%, var(--surface-2)); border-color: var(--main); }
.mx-btn-danger-outline { border-color: var(--c-error); color: var(--c-error); }
.mx-docs-result { margin-left: auto; color: var(--text-muted); overflow-wrap: anywhere; }
.mx-docs-notice { margin: 0 0 10px; overflow-wrap: anywhere; }
.mx-docs-grid { border-collapse: collapse; width: 100%; }
.mx-docs-grid th, .mx-docs-grid td { padding: 5px 9px; white-space: nowrap; vertical-align: middle; }
.mx-docs-check { width: 1%; }
.mx-cell { background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-align: left; white-space: nowrap; cursor: pointer; }
.mx-cell:hover { text-decoration: underline; }
.mx-cell:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.mx-docs-pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mx-json-doc { margin-bottom: 10px; padding: 8px 10px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.mx-json-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.mx-json-id { min-width: 0; overflow-wrap: anywhere; }
.mx-json-bar > .btn { margin-left: auto; flex-shrink: 0; }
.mx-json-more { margin-top: 6px; }
.mx-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; color: var(--text); }
.mx-pre.mx-viewer { max-height: none; }
.mx-editor { display: block; min-height: 280px; height: 50vh; height: 50dvh; resize: vertical; background: var(--bg); line-height: 1.5; }
.mx-editor-sub { margin: 0 0 8px; overflow-wrap: anywhere; }
.mx-confirm-id { margin: 0 0 6px; overflow-wrap: anywhere; }
.mx-changes { margin: 0; padding-left: 18px; }
.mx-changes li { overflow-wrap: anywhere; }
/* Delete all matching a filter. */
.mx-bulk-count { margin: 8px 0 4px; font-weight: 600; }
.mx-bulk-filter { margin: 0 0 10px; padding: 6px 10px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; }
.mx-bulk-warning { margin: 0 0 10px; overflow-wrap: anywhere; }
/* Collection info, Database info and Server activity: a title bar, figure cards, and read-only tables. */
.mx-info { min-width: 0; }
.mx-info-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin-bottom: 10px; }
.mx-info-title { min-width: 0; color: var(--text-muted); overflow-wrap: anywhere; }
.mx-info-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.mx-target { width: auto; max-width: 100%; padding: 4px 8px; font-size: 12px; }
.mx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mx-card { min-width: 0; padding: 10px 12px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mx-card-k { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.mx-card-v { margin-top: 2px; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.mx-card-v-text { font-size: 15px; padding-top: 5px; }
.mx-card-wait { font-size: 15px; font-weight: 400; color: var(--text-muted); padding-top: 5px; }
.mx-card-s { color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.mx-card-note { margin-top: 4px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.mx-spark { display: block; width: 100%; height: 30px; margin-top: 6px; }
.mx-spark polyline { fill: none; stroke: var(--main); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mx-h { margin: 14px 0 6px; color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.mx-h-note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mx-warn { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--c-warning); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-1); color: var(--text-muted); overflow-wrap: anywhere; }
.mx-info-grid { border-collapse: collapse; width: 100%; }
.mx-info-grid th, .mx-info-grid td { padding: 5px 9px; white-space: nowrap; vertical-align: middle; }
.mx-info-grid .mx-r { text-align: right; }
.mx-info-grid tr.mx-row-on td { background: color-mix(in srgb, var(--main) 16%, transparent); }
.mx-info-grid td.mx-notes { white-space: normal; min-width: 120px; }
.mx-notes .badge { margin: 1px 4px 1px 0; }
.mx-shape { white-space: normal; overflow-wrap: anywhere; min-width: 160px; }
.mx-row-warn { color: var(--text-muted); font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.mx-footnote { margin: 10px 0 0; }
.mx-sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.mx-sort:hover { color: var(--text); }
.mx-sort:focus-visible, .mx-link:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.mx-click { cursor: pointer; }
.mx-link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mx-link:hover { text-decoration: underline; }
.mx-bar { display: inline-block; width: 160px; max-width: 30vw; height: 8px; vertical-align: middle; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.mx-bar > i { display: block; height: 8px; border-radius: 3px; background: var(--main); }
@media (hover: none) { .mx-more { opacity: 1; } }
@media (max-width: 1023.98px) {
    .mx-page { height: auto; min-height: 0; }
    .mx-shell { grid-template-columns: minmax(0, 1fr); overflow: visible; }
    .mx-tree { max-height: 40vh; max-height: 40dvh; border-right: 0; border-bottom: 1px solid var(--border); }
    .mx-main { overflow: visible; min-height: 50vh; }
    .mx-more { opacity: 1; }
}

/* Layout utilities used by the page components. The application intentionally
   uses this theme without Bootstrap's stylesheet. */
.d-block { display: block; }
.d-inline { display: inline; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-end { justify-content: flex-end; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 4px; }
.gap-3 { gap: 16px; }
.w-100 { width: 100%; box-sizing: border-box; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mt-1 { margin-top: 4px; }
.ms-2 { margin-left: 8px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.my-1 { margin-top: 4px; margin-bottom: 4px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 4px; }
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.border { border: 1px solid var(--border); }
.rounded { border-radius: var(--radius-sm); }
