:root {
    --bg: #edf1f6;
    --panel: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-muted: #f1f4f8;
    --line: #dfe5ed;
    --line-strong: #cfd7e3;
    --ink: #172033;
    --muted: #667085;
    --brand: #2f6fdd;
    --brand-d: #225fc9;
    --danger: #be4f49;
    --ok: #2f9068;
    --warn: #b77a20;
    --theme: #141923;
    --sidebar-hover: #202735;
    --sidebar-active: #252c39;
    --gold: #e1a63a;
    --shadow-sm: 0 1px 2px rgba(23, 32, 51, .04);
    --shadow-md: 0 10px 30px rgba(23, 32, 51, .08);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

html {
    min-width: 320px;
    background: var(--bg);
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    touch-action: manipulation;
}

button {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease,
        box-shadow .18s ease, transform .12s ease;
}

button:active:not(:disabled) {
    transform: none;
    filter: brightness(.97);
}

#app-loading {
    color: var(--muted);
    background: var(--bg);
}

/* Application shell */
#app {
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 224px minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr);
    background: var(--surface-soft);
}

.layout {
    display: contents;
}

.topbar {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 1px 0 rgba(23, 32, 51, .02);
    backdrop-filter: blur(12px);
}

.topbar .brand {
    min-width: 0;
    gap: 12px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: 0;
}

.topbar-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-account {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 7px 5px 10px;
    border: 0;
    border-radius: 10px;
    color: inherit;
    background: transparent;
    cursor: pointer;
    text-align: inherit;
}

.topbar-account:hover,
.topbar-account[aria-expanded="true"] {
    background: var(--surface-muted);
}

.account-menu {
    position: absolute;
    z-index: 70;
    top: 56px;
    right: 20px;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.account-menu > div {
    padding: 9px 10px 10px;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 3px;
}

.account-menu small {
    color: var(--muted);
    font-size: 11px;
}

.account-menu b {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu button {
    width: 100%;
    min-height: 42px;
    margin-top: 6px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: var(--danger);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.account-menu button:hover {
    background: #fff4f3;
}

.topbar-account-copy {
    min-width: 0;
    display: grid;
    justify-items: end;
    gap: 2px;
}

.topbar-account-copy small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

#adminPhone {
    max-width: 180px;
    overflow: hidden;
    color: #445066;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #242b37;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    font-size: 12px;
    font-weight: 800;
}

.topbar-search {
    width: min(360px, 34vw);
    min-height: 40px;
    margin-left: auto;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7a8698;
    background: var(--surface-soft);
    cursor: pointer;
    text-align: left;
}

.topbar-search:hover {
    border-color: #bfc9d6;
    color: var(--ink);
    background: #fff;
}

.topbar-search svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.topbar-search span {
    flex: 1;
}

.topbar-search kbd {
    padding: 2px 6px;
    border: 1px solid #d8dee8;
    border-radius: 5px;
    color: #7a8698;
    background: #fff;
    font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hamburger {
    width: 44px;
    height: 44px;
    color: #445066;
    border-radius: 9px;
}

.hamburger:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.hamburger svg,
.sidebar-close svg {
    width: 20px;
    height: 20px;
    display: block;
}

.sidebar {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    top: 0;
    align-self: stretch;
    height: 100vh;
    height: 100dvh;
    padding: 14px 11px 24px;
    border-right: 0;
    color: #d9dee8;
    background: var(--theme);
    scrollbar-color: #384151 transparent;
}

.sidebar-brand {
    min-height: 48px;
    margin: 0 1px 14px;
    padding: 0 9px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand img {
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
    padding: 2px;
    border: 1px solid rgba(225, 166, 58, .42);
    border-radius: 9px;
    object-fit: contain;
    background: rgba(225, 166, 58, .1);
}

.sidebar-brand-copy {
    min-width: 0;
    flex: 1;
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand small {
    margin-top: 2px;
    color: #8b95a6;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .13em;
}

.sidebar-close {
    width: 40px !important;
    min-height: 40px !important;
    margin: 0 -6px 0 0 !important;
    padding: 0 !important;
    display: none !important;
    justify-content: center;
    color: #aeb7c6 !important;
}

.nav-group {
    margin-bottom: 13px;
}

.primary-nav {
    display: grid;
    gap: 3px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.primary-nav button span:not(.nav-badge) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-label {
    min-height: 30px;
    padding: 0 9px 6px;
    color: #8b95a6;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
}

.nav-label:hover {
    color: #9da7b8;
}

.nav-label:focus-visible {
    border-radius: 6px;
    outline: 2px solid #74a3ff;
    outline-offset: 2px;
}

.nav-label .chev {
    color: #657082;
}

.sidebar button {
    min-height: 40px;
    height: auto;
    margin: 1px 0;
    padding: 9px 10px;
    border-radius: 8px;
    color: #aeb7c6;
    font-size: 13px;
    line-height: 1.35;
}

.sidebar button:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.sidebar button.active {
    color: #fff;
    background: var(--sidebar-active);
    box-shadow: inset 3px 0 0 var(--brand);
    font-weight: 650;
}

.sidebar button .dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    background: #596579;
}

.sidebar button:hover .dot {
    background: #94a0b2;
}

.sidebar button.active .dot {
    background: #74a3ff;
    box-shadow: 0 0 0 3px rgba(55, 124, 246, .14);
}

.sidebar button.highlight {
    color: #dfb45e;
    background: rgba(225, 166, 58, .08);
}

.sidebar button.highlight .dot {
    background: var(--gold);
}

.nav-badge {
    min-width: 20px;
    min-height: 18px;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: #171719;
    background: var(--gold);
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
}

.nav-badge.danger {
    color: #fff;
    background: #d55b52;
}

.nav-badge.warning {
    color: #302108;
    background: #e8b34f;
}

.nav-badge.info {
    color: #fff;
    background: #4b80dd;
}

.sidebar-secondary {
    margin: 12px 5px 0;
    padding: 10px 7px 8px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: grid;
    gap: 2px;
}

.sidebar-secondary > span {
    padding: 0 7px 6px;
    color: #7f8a9c;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
}

.sidebar .sidebar-secondary button {
    min-height: 34px;
    height: auto;
    margin: 0;
    padding: 7px 9px;
    gap: 8px;
    color: #aeb7c6;
    font-size: 12px;
}

.sidebar-secondary button i {
    width: 5px;
    height: 5px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #596579;
}

.sidebar .sidebar-secondary button.active {
    color: #fff;
    background: rgba(255,255,255,.08);
}

.sidebar .sidebar-secondary button.active i {
    background: #74a3ff;
}

.sidebar .sidebar-clear-badges {
    width: auto;
    min-height: 36px;
    height: auto;
    margin: 10px 12px 0;
    padding: 7px 9px;
    border: 1px solid rgba(225,166,58,.2);
    color: #d8b66c;
    background: rgba(225,166,58,.06);
    font-size: 11px;
    text-align: center;
    justify-content: center;
}

.sidebar .logout {
    margin-top: 18px;
    color: #ee928b;
    border: 1px solid rgba(237, 106, 90, .16);
    background: rgba(237, 106, 90, .05);
}

.content {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    max-width: 1540px;
    min-width: 0;
    padding: 24px;
}

section.active {
    animation-duration: .2s;
}

/* Page hierarchy */
.page-heading {
    margin-bottom: 18px;
    gap: 10px 16px;
}

.page-heading h2 {
    color: var(--ink);
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -.02em;
}

/* Route changes focus the heading for screen readers. It is not an interactive target. */
section h2[tabindex="-1"]:focus,
section h3[tabindex="-1"]:focus {
    outline: none;
}

.page-heading p {
    max-width: 760px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.page-actions {
    gap: 8px;
}

.range-note {
    margin: 10px 2px 14px;
}

.card {
    padding: 16px;
    border-color: var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.card h3 {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.4;
}

.card .sub {
    color: var(--muted);
    line-height: 1.55;
}

.grid,
.grid-2,
.chart-grid,
.monitor-rules,
.asset-upload-grid {
    gap: 12px;
}

.metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    min-height: 112px;
    padding: 16px 16px 15px;
    border-color: var(--line);
}

.metric-card::before {
    width: 3px;
    height: calc(100% - 28px);
    top: 14px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}

.metric {
    margin-top: 9px;
    color: var(--ink);
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
}

.metric-card-link:hover {
    border-color: #b7cffd;
    background: #fbfdff;
    box-shadow: 0 8px 22px rgba(55, 124, 246, .08);
}

.metric-drill {
    color: var(--brand);
}

.banner {
    padding: 15px 17px;
    border-color: #efd89f;
    border-radius: var(--radius-md);
    background: #fffbef;
}

/* Forms and controls */
label {
    margin: 13px 0 6px;
    color: #647187;
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    min-height: 42px;
    padding: 9px 11px;
    border-color: var(--line-strong);
    border-radius: var(--radius-sm);
    color: #344054;
    background: #fff;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.table-wrap select {
    min-height: 34px;
    padding: 5px 30px 5px 8px;
    font-size: 13px;
}

textarea {
    min-height: 104px;
    line-height: 1.55;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #a3adbc;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #aeb9c8;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(55, 124, 246, .12);
}

input:disabled,
select:disabled,
textarea:disabled {
    color: #8a94a4;
    background: var(--surface-muted);
}

.btn {
    min-height: 40px;
    margin-top: 12px;
    padding: 9px 14px;
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 1px 2px rgba(55, 124, 246, .16);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.btn:hover {
    border-color: var(--brand-d);
    background: var(--brand-d);
    box-shadow: 0 5px 14px rgba(55, 124, 246, .18);
}

.btn.secondary {
    border-color: #d8dee8;
    color: #445066;
    background: #fff;
    box-shadow: none;
}

.btn.secondary:hover,
.btn.ghost:hover {
    border-color: #bfc9d6;
    color: var(--ink);
    background: var(--surface-soft);
}

.btn.ghost {
    border-color: #d8dee8;
    color: #445066;
    background: #fff;
    box-shadow: none;
}

.btn.danger {
    border-color: var(--danger);
    background: var(--danger);
}

.btn.ok {
    border-color: var(--ok);
    background: var(--ok);
}

.btn.sm {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
}

.seg {
    padding: 3px;
    border: 0;
    border-radius: var(--radius-sm);
    gap: 2px;
    overflow: visible;
    background: #e7ebf1;
}

.seg button {
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 6px;
    color: #6f7b8e;
    background: transparent;
}

.seg button.active {
    color: #273247;
    background: #fff;
    box-shadow: 0 1px 4px rgba(23, 32, 51, .1);
    font-weight: 700;
}

.toolbar {
    padding: 14px 16px 16px;
    align-items: flex-end;
    background: #fff;
}

.toolbar .field {
    min-width: 180px;
}

.field-help {
    color: var(--muted);
}

.tag,
.status,
.monitor-type-pill {
    font-weight: 600;
}

.tag {
    color: #2868dc;
    background: #edf4ff;
}

.status {
    color: #2a755a;
    background: #e9f8f1;
}

.status.off {
    color: #b34b46;
    background: #fff0ef;
}

.status.warn {
    color: #8a5a10;
    background: #fff5dc;
}

.status.pending,
.status.blue {
    color: #2868dc;
    background: #edf4ff;
}

/* Tables and data */
.table-wrap {
    max-width: 100%;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

table {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 11px 12px;
    border-bottom-color: #e8edf3;
}

th {
    color: #7b8799;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
}

td {
    color: #47536a;
    line-height: 1.5;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tr:hover td,
tr:hover td:first-child {
    background: #f7f9fc;
}

th:first-child,
td:first-child {
    background: #fff;
}

th:first-child {
    background: #f8fafc;
}

.link-btn {
    min-height: 32px;
    padding: 4px 2px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 650;
}

.link-btn:hover {
    color: var(--brand-d);
    text-decoration: underline;
}

.link-btn.danger-link { color: var(--danger); }
.link-btn.danger-link:hover { color: #b42318; }
.btn.danger-outline { color: var(--danger); border-color: #efb8b2; }
.btn.danger-outline:hover { color: #b42318; border-color: #d92d20; background: #fff5f4; }

.pagination {
    padding-top: 2px;
}

.pagination > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination .btn {
    min-height: 38px;
}

.user-summary div,
.monitor-rule,
.asset-file-summary,
.ai-model-section,
.ai-model-advanced,
.uc-conv,
.prompt-item {
    border-color: var(--line);
    border-radius: var(--radius-sm);
}

.user-summary div {
    color: var(--muted);
    background: var(--surface-soft);
}

.user-summary b {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.chart-box canvas {
    max-width: 100%;
}

#dashboard .chart-grid {
    display: grid;
    columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#dashboard .chart-grid > .card {
    display: block;
    width: auto;
    margin: 0;
}

.empty,
.loading,
.error,
.asset-result-empty {
    border-color: #d9e0e9;
    border-radius: var(--radius-sm);
    background: #fafbfd;
}

.prompt-view pre {
    border: 1px solid #293548;
    border-radius: var(--radius-sm);
    background: #121923;
}

/* Dialogs and feedback */
#modal {
    padding: 24px;
    background: rgba(15, 23, 36, .52) !important;
    backdrop-filter: blur(4px);
}

.modal-panel {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 36, .24);
}

.modal-panel > .page-heading {
    position: sticky;
    top: -16px;
    z-index: 5;
    padding: 16px 0 10px;
    background: #fff;
}

#toast {
    --toast-tone: var(--brand);
    --toast-soft: #eff8ff;
    --toast-border: #b2ddff;
    --toast-duration: 3600ms;
    position: fixed;
    z-index: 80;
    top: auto;
    right: 22px;
    bottom: 22px;
    left: auto;
    width: min(390px, calc(100vw - 32px));
    min-height: 70px;
    max-width: none;
    padding: 12px 48px 14px 13px;
    border: 1px solid var(--toast-border);
    border-left: 4px solid var(--toast-tone);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(.98);
    color: var(--ink);
    background: #fff;
    box-shadow: 0 16px 44px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .08);
    line-height: 1.45;
    font-size: 13px;
    text-align: left;
    transition: opacity .2s ease, transform .22s ease;
}

#toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

#toast[data-type="success"] {
    --toast-tone: var(--ok);
    --toast-soft: #ecfdf3;
    --toast-border: #abefc6;
}

#toast[data-type="error"] {
    --toast-tone: var(--danger);
    --toast-soft: #fef3f2;
    --toast-border: #fecdca;
}

#toast[data-type="warn"] {
    --toast-tone: var(--warn);
    --toast-soft: #fffaeb;
    --toast-border: #fedf89;
}

#toast[data-type="info"] {
    --toast-tone: var(--brand);
    --toast-soft: #eff8ff;
    --toast-border: #b2ddff;
}

.toast-status-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--toast-tone);
    background: var(--toast-soft);
}

.toast-status-icon .material-icons {
    font-size: 20px;
}

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

.toast-content b {
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
}

.toast-content > span {
    overflow-wrap: anywhere;
    color: #475467;
    font-size: 12px;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 7px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
}

.toast-close:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.toast-close .material-icons {
    font-size: 18px;
}

.toast-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--toast-tone);
    transform-origin: left center;
}

#toast.show .toast-progress {
    animation: admin-toast-progress var(--toast-duration) linear forwards;
}

@keyframes admin-toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.backdrop {
    z-index: 70;
    background: rgba(15, 23, 36, .52);
    backdrop-filter: blur(2px);
}

/* Login */
.login-page {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 18%, rgba(55, 124, 246, .13), transparent 34%),
        linear-gradient(145deg, #edf1f6 0%, #f7f9fc 56%, #e8edf4 100%);
}

.login-page::before {
    content: "";
    width: 420px;
    height: 420px;
    position: fixed;
    right: -180px;
    bottom: -220px;
    border: 1px solid rgba(55, 124, 246, .12);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(55, 124, 246, .025), 0 0 0 140px rgba(55, 124, 246, .018);
    pointer-events: none;
}

.login-page .login-shell {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
}

.login-page .brand {
    justify-content: flex-start;
    margin: 0 0 16px 4px;
    color: var(--ink);
    font-size: 16px;
    letter-spacing: 0;
}

.login-page .brand-mark {
    width: 38px;
    height: 38px;
    padding: 2px;
    border: 1px solid rgba(225, 166, 58, .45);
    border-radius: 10px;
    background: var(--theme);
    box-shadow: 0 7px 18px rgba(20, 25, 35, .16);
}

.login-page .login-card {
    padding: 28px;
    border-color: var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(23, 32, 51, .12);
}

.login-page h1 {
    color: var(--ink);
    font-size: 22px;
}

.login-page .subtitle {
    color: var(--muted);
}

.login-page label {
    color: #647187;
}

.login-page input {
    min-height: 46px;
}

.login-page button {
    min-height: 46px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    box-shadow: 0 6px 16px rgba(55, 124, 246, .18);
}

.login-page button:hover {
    background: var(--brand-d);
}

.login-page .safe-note {
    color: #929dad;
}

/* Solo operations information architecture */
.page-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
}

.section-tabs {
    max-width: 100%;
    margin: -4px 0 16px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    display: flex;
    gap: 3px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    background: #fff;
    scrollbar-width: thin;
}

.section-tabs button {
    min-height: 36px;
    padding: 7px 12px;
    border: 0;
    border-radius: 7px;
    flex: 0 0 auto;
    color: #667085;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.section-tabs button:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.section-tabs button.active {
    color: #fff;
    background: var(--brand);
    box-shadow: 0 2px 8px rgba(47, 111, 221, .2);
}

.global-search-results {
    min-height: 72px;
    max-height: min(380px, 48vh);
    margin-top: 10px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow-y: auto;
    background: var(--surface-soft);
}

.global-search-results > button {
    width: 100%;
    min-height: 50px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.global-search-results > button:hover,
.global-search-results > button:focus-visible {
    background: #fff;
}

.global-search-results > button span {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 2px;
}

.global-search-results > button b {
    font-size: 13px;
}

.global-search-results > button small,
.global-search-help,
.global-search-empty span {
    color: var(--muted);
    font-size: 11px;
}

.global-search-results kbd {
    color: var(--muted);
    font: 10px ui-monospace,SFMono-Regular,Menlo,monospace;
}

.global-search-help,
.global-search-empty {
    min-height: 64px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.failure-category,
.failure-detail {
    display: block;
}

.failure-category {
    color: var(--danger);
    font-size: 12px;
}

.failure-detail {
    max-width: 360px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.notification-status-note {
    margin-bottom: 10px;
}

.task-diagnosis {
    display: grid;
    gap: 12px;
}

.task-error-summary {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    display: grid;
    gap: 4px;
    background: var(--surface-soft);
}

.task-error-summary.is-error {
    border-color: #f3c2be;
    color: #8f332d;
    background: #fff6f5;
}

.task-error-summary small {
    color: var(--muted);
}

.task-diagnosis details {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}

.task-diagnosis summary {
    min-height: 44px;
    padding: 11px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.task-diagnosis pre {
    max-height: 42vh;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-top: 1px solid var(--line);
    white-space: pre-wrap;
    font-size: 11px;
}

.raw-detail {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
}

.raw-detail summary {
    min-height: 44px;
    padding: 11px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.raw-detail pre {
    max-height: 42vh;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-top: 1px solid var(--line);
    white-space: pre-wrap;
    font-size: 11px;
}

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

.inline-list-error {
    min-height: 112px;
    padding: 18px;
    border: 1px solid #f3c2be;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    color: #8f332d;
    background: #fff6f5;
}

.inline-list-error span {
    color: #8c5a56;
    font-size: 12px;
}

.bulk-action-bar {
    min-height: 52px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid #b2ccff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #234e98;
    background: #f2f6ff;
    box-shadow: var(--shadow-sm);
}

.bulk-action-bar > div,
.compact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.row-check {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.mobile-bulk-check {
    min-height: 42px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--brand);
    background: #fff;
    font-size: 12px;
    font-weight: 650;
}

.mobile-bulk-check input {
    width: 18px;
    height: 18px;
    margin: 0;
}

@media (max-width: 620px) {
    .bulk-action-bar {
        position: sticky;
        z-index: 18;
        top: calc(58px + env(safe-area-inset-top));
        align-items: stretch;
        flex-direction: column;
    }

    .bulk-action-bar > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .bulk-action-bar .btn {
        min-height: 44px;
    }
}

.health-banner {
    min-height: 64px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #b7e3cf;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 11px;
    color: #28634d;
    background: #f0fbf6;
}

.health-banner.degraded {
    border-color: #f4c9c5;
    color: #9a3f39;
    background: #fff5f4;
}

.health-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--ok);
    font-size: 18px;
    font-weight: 850;
}

.degraded .health-icon {
    background: var(--danger);
}

.health-banner > div {
    min-width: 0;
    flex: 1;
}

.health-banner b,
.health-banner small {
    display: block;
}

.health-banner b {
    font-size: 14px;
}

.health-banner small,
.health-updated {
    margin-top: 2px;
    color: currentColor;
    font-size: 12px;
    opacity: .76;
}

.workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 18px;
}

.workbench-grid > .card {
    margin-bottom: 0;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.section-heading .btn {
    margin: 0;
    flex: 0 0 auto;
}

.action-list,
.compact-record-list {
    display: grid;
    gap: 8px;
}

.action-list {
    margin-top: 12px;
}

.action-item {
    width: 100%;
    min-height: 66px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    text-align: left;
}

.action-item:hover {
    border-color: #b7cffd;
    background: #fbfdff;
}

.action-signal {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(47, 111, 221, .1);
}

.action-item.danger .action-signal {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(190, 79, 73, .1);
}

.action-item.warning .action-signal {
    background: var(--warn);
    box-shadow: 0 0 0 4px rgba(183, 122, 32, .1);
}

.action-item b,
.action-item small {
    display: block;
}

.action-item b {
    font-size: 13px;
}

.action-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.action-item strong {
    color: var(--brand);
    font-size: 12px;
    white-space: nowrap;
}

.success-empty {
    border-color: #b7e3cf;
    color: #28634d;
    background: #f4fbf7;
}

.success-empty b,
.success-empty span {
    display: block;
}

.success-empty span {
    margin-top: 4px;
    font-size: 12px;
}

.flow-steps {
    display: grid;
    gap: 3px;
    margin-top: 12px;
}

.flow-step {
    min-height: 58px;
    padding: 8px 4px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid #edf0f4;
}

.flow-step:last-child {
    border-bottom: 0;
}

.flow-index {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: #edf4ff;
    font-size: 12px;
    font-weight: 800;
}

.flow-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 2px 10px;
}

.flow-copy small {
    color: #445066;
    font-size: 13px;
    font-weight: 650;
}

.flow-copy b {
    color: var(--ink);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.flow-copy em {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}

.flow-step > i {
    color: #a3adbc;
    font-style: normal;
}

.dashboard-trend-heading {
    margin: 2px 0 10px;
}

#dashboard .workbench-trends {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scale-details summary {
    min-height: 40px;
    display: flex;
    align-items: center;
    color: #445066;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.scale-details[open] summary {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.content-quality-grid {
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
}

.compact-record {
    min-height: 64px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
}

.compact-record > div:first-child {
    min-width: 0;
}

.compact-record b,
.compact-record small {
    display: block;
}

.compact-record b {
    margin-top: 5px;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-record small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.compact-record > div:last-child {
    display: flex;
    gap: 6px;
}

.compact-record .btn {
    margin: 0;
}

.release-platform-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.release-platform-head {
    display: flex;
    align-items: center;
    gap: 11px;
}

.release-platform-head > div {
    min-width: 0;
    flex: 1;
}

.platform-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 18px;
    font-weight: 850;
}

.platform-mark.android { background: #2f9068; }
.platform-mark.ios { background: #242b37; }

.release-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.release-actions .btn {
    margin: 0;
}

.release-grid {
    margin-top: 12px;
}

.release-checklist ul {
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 9px;
    list-style: none;
}

.release-checklist li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #445066;
    font-size: 13px;
}

.release-checklist li span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ok);
    background: #e9f8f1;
    font-weight: 800;
}

.mobile-card-list,
.mobile-bottom-nav {
    display: none;
}

.dirty-action-bar {
    position: fixed;
    z-index: 45;
    right: 24px;
    bottom: 14px;
    left: 248px;
    min-height: 68px;
    margin-top: 12px;
    padding: 10px 12px 10px 16px;
    border: 1px solid #b7cffd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #273247;
    background: rgba(245, 248, 255, .97);
    box-shadow: 0 12px 30px rgba(23, 32, 51, .16);
    backdrop-filter: blur(12px);
}

.dirty-action-bar[hidden] { display: none; }

.dirty-action-bar b,
.dirty-action-bar small {
    display: block;
}

.dirty-action-bar small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

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

.dirty-actions .btn { margin: 0; }

.risk-summary {
    padding: 12px;
    border: 1px solid #f4c9c5;
    border-radius: 9px;
    display: flex;
    gap: 10px;
    color: #8f3934;
    background: #fff5f4;
}

.risk-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--danger);
    font-weight: 850;
}

.risk-summary p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.55;
}

.change-summary {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--surface-soft);
}

.change-summary div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    padding: 5px 0;
}

.change-summary dt { color: var(--muted); }
.change-summary dd { margin: 0; color: var(--ink); font-weight: 650; }
.confirmation-prompt { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; }
.confirmation-prompt label { flex:1 1 240px; min-width:0; margin:0; }
.confirmation-fill-btn { flex:0 0 auto; min-height:44px; margin:0 !important; white-space:nowrap; }
.role-confirm { min-height: 44px; margin-top: 12px; }
.delete-scope { margin-top: 12px; padding: 12px; border-radius: 9px; color: #475467; background: var(--surface-soft); }
.delete-scope p { margin: 5px 0 0; font-size: 13px; line-height: 1.65; }
.destructive-submit { width: 100%; min-height: 46px; margin-top: 16px !important; }
.danger-zone { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:24px; padding:16px; border:1px solid #f4c9c5; border-radius:10px; background:#fffafa; }
.danger-zone h3 { margin:0; color:#8f3934; }
.danger-zone p { margin:5px 0 0; color:#8f3934; font-size:13px; }
.danger-zone .btn { margin:0; white-space:nowrap; }
#userDeleteConfirmation { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.membership-grant-form .btn { min-height: 44px; }
.membership-grant-form input, .membership-grant-form select, #membershipGrantConfirmation { min-height:44px; }
.membership-grant-result { margin:12px 0 0; padding:10px 12px; border:1px solid #b7dfc9; border-radius:9px; color:#067647; background:#ecfdf3; font-size:13px; line-height:1.55; }
.grant-summary { padding:12px; border:1px solid #ead59a; border-radius:9px; color:#7a5512; background:#fffaeb; }
.grant-summary p { margin:4px 0 0; font-size:12px; line-height:1.55; }
#membershipGrantConfirmation { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.record-summary { color: #445066; font-size: 13px; line-height: 1.55; }

@media (max-width: 1180px) {
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #dashboard .chart-grid {
        grid-template-columns: 1fr;
    }

    .workbench-grid,
    .content-quality-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    #app {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .topbar {
        grid-column: 1;
        grid-row: 1;
        min-height: calc(58px + env(safe-area-inset-top));
        height: auto;
        padding: env(safe-area-inset-top) 14px 0;
    }

    .topbar-search {
        width: 44px;
        min-height: 44px;
        margin-left: auto;
        padding: 0;
        justify-content: center;
    }

    .topbar-search span,
    .topbar-search kbd {
        display: none;
    }

    .hamburger {
        display: inline-flex;
        margin-left: -8px;
    }

    .content {
        grid-column: 1;
        grid-row: 2;
        padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
    }

    .sidebar {
        width: min(300px, 88vw);
        height: 100vh;
        height: 100dvh;
        top: 0;
        z-index: 80;
        padding-top: calc(12px + env(safe-area-inset-top));
        box-shadow: 14px 0 40px rgba(15, 23, 36, .24);
    }

    .sidebar-brand {
        margin-bottom: 12px;
    }

    .sidebar-close {
        display: inline-flex !important;
        width: 44px !important;
        min-height: 44px !important;
    }

    .sidebar button {
        min-height: 44px;
    }

    .nav-label {
        min-height: 40px;
    }

    .page-heading h2 {
        font-size: 22px;
    }

    .grid-2,
    .asset-upload-grid,
    .release-platform-grid {
        grid-template-columns: 1fr;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 50;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 10px;
        min-height: 66px;
        padding: 5px 6px;
        border: 1px solid rgba(207, 215, 227, .9);
        border-radius: 17px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 12px 36px rgba(23, 32, 51, .2);
        backdrop-filter: blur(16px);
    }

    .mobile-bottom-nav button {
        min-width: 0;
        min-height: 54px;
        padding: 5px 2px;
        border: 0;
        border-radius: 11px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: #7a8698;
        background: transparent;
        cursor: pointer;
        font-size: 10px;
        font-weight: 650;
    }

    .mobile-bottom-nav button.active {
        color: var(--brand);
        background: #edf4ff;
    }

    .mobile-bottom-nav svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-bottom-nav i {
        min-width: 17px;
        height: 17px;
        position: absolute;
        margin: -27px 0 0 24px;
        padding: 0 4px;
        border-radius: 99px;
        display: grid;
        place-items: center;
        color: #fff;
        background: var(--danger);
        font-size: 9px;
        font-style: normal;
        font-weight: 800;
    }

    .section-tabs {
        position: sticky;
        z-index: 20;
        top: calc(58px + env(safe-area-inset-top));
        margin-right: -4px;
        margin-left: -4px;
        box-shadow: 0 4px 12px rgba(23, 32, 51, .06);
    }

    .dirty-action-bar {
        right: 16px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        left: 16px;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding-right: 12px;
        padding-left: 12px;
    }

    .topbar-title {
        font-size: 14px;
    }

    .topbar-account-copy small {
        display: none;
    }

    #adminPhone {
        max-width: 108px;
        font-size: 11px;
    }

    .topbar-avatar {
        width: 32px;
        height: 32px;
    }

    .content {
        padding: 16px 12px calc(98px + env(safe-area-inset-bottom));
    }

    .page-heading {
        align-items: stretch;
        margin-bottom: 14px;
    }

    .page-heading > div:first-child {
        width: 100%;
    }

    .page-heading > button,
    .page-heading > button + button,
    .page-actions {
        margin-left: 0;
    }

    .page-actions {
        width: 100%;
        align-items: stretch;
    }

    .page-actions .btn,
    .page-heading > .btn {
        flex: 1 1 auto;
    }

    .page-heading h2 {
        font-size: 21px;
    }

    .page-heading p {
        font-size: 12px;
    }

    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .metric-card {
        min-height: 96px;
        padding: 13px 11px 12px 15px;
    }

    .metric-card::before {
        top: 12px;
        height: calc(100% - 24px);
    }

    .metric {
        font-size: clamp(21px, 6vw, 25px);
    }

    .metric-drill {
        right: 9px;
        bottom: 7px;
        font-size: 10px;
    }

    .card {
        padding: 14px;
        border-radius: 9px;
    }

    input,
    select,
    textarea {
        min-height: 46px;
        font-size: 16px;
    }

    .table-wrap select {
        min-height: 44px;
        font-size: 16px;
    }

    .btn,
    .btn.sm,
    .pagination .btn {
        min-height: 44px;
    }

    .toolbar {
        padding: 13px;
    }

    .toolbar .field,
    .toolbar .btn {
        width: 100%;
        max-width: none !important;
    }

    .seg {
        width: 100%;
        overflow-x: auto;
    }

    .seg button {
        min-height: 44px;
        flex: 1 0 auto;
    }

    .section-tabs button {
        min-height: 44px;
    }

    .table-wrap {
        margin-right: -6px;
        margin-left: -6px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .table-wrap table {
        min-width: 560px;
    }

    #users > .card .table-wrap,
    #asyncTasks #asyncTaskTable,
    #opsMonitor #monitorAlertTable,
    #changelogHistory #changelogHistoryTable {
        display: none;
    }

    .mobile-card-list {
        display: grid;
        gap: 10px;
        margin-top: 4px;
    }

    .mobile-record-card {
        min-width: 0;
        padding: 13px;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }

    .mobile-record-card.is-alerting {
        border-color: #f0c3bf;
        background: #fffafa;
    }

    .mobile-record-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .mobile-record-head > div {
        min-width: 0;
    }

    .mobile-record-head h3 {
        margin-top: 4px;
        overflow-wrap: anywhere;
        font-size: 15px;
    }

    .record-id {
        color: var(--muted);
        font-size: 11px;
        font-weight: 650;
    }

    .mobile-record-card dl {
        margin: 12px 0 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .mobile-record-card dl div {
        min-width: 0;
        padding: 9px;
        border-radius: 8px;
        background: var(--surface-soft);
    }

    .mobile-record-card dt {
        color: var(--muted);
        font-size: 11px;
    }

    .mobile-record-card dd {
        margin: 4px 0 0;
        overflow-wrap: anywhere;
        color: var(--ink);
        font-size: 13px;
        font-weight: 650;
    }

    .mobile-record-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        gap: 8px;
        margin-top: 12px;
    }

    .mobile-record-actions .btn {
        width: 100%;
        min-height: 44px;
        margin: 0;
        padding-right: 8px;
        padding-left: 8px;
    }

    .workbench-grid,
    #dashboard .workbench-trends,
    .content-quality-grid,
    .release-platform-grid {
        grid-template-columns: 1fr;
    }

    .health-banner {
        align-items: flex-start;
    }

    .health-updated {
        display: none;
    }

    .action-item {
        grid-template-columns: 8px minmax(0, 1fr);
    }

    .action-item strong {
        grid-column: 2;
        margin-top: -3px;
    }

    .flow-copy b {
        font-size: 18px;
    }

    .compact-record {
        align-items: flex-start;
        flex-direction: column;
    }

    .compact-record > div:last-child,
    .compact-record > .btn {
        width: 100%;
    }

    .compact-record > div:last-child .btn,
    .compact-record > .btn {
        min-height: 44px;
        flex: 1;
    }

    .release-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .release-actions .btn {
        min-height: 44px;
    }

    .dirty-action-bar {
        right: 12px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        left: 12px;
        padding: 12px;
        align-items: stretch;
        flex-direction: column;
    }

    .dirty-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .change-summary div {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    th,
    td {
        padding: 10px;
    }

    th:first-child,
    td:first-child {
        position: static;
    }

    .link-btn {
        min-height: 40px;
        padding: 7px 3px;
    }

    .pagination {
        align-items: stretch;
    }

    .pagination > div {
        width: 100%;
    }

    .pagination > div .btn {
        flex: 1;
    }

    #modal {
        padding: 44px 0 0;
        align-items: flex-end !important;
    }

    .modal-panel {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(92dvh - env(safe-area-inset-top)) !important;
        margin: 0 !important;
        padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
        border-radius: 18px 18px 0 0;
    }

    .modal-panel > .page-heading {
        top: -16px;
        padding-top: 14px;
    }

    #toast {
        right: 12px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        left: 12px;
        width: auto;
        max-width: none;
        min-height: 68px;
        padding-right: 46px;
        text-align: left;
    }

    .toast-close {
        top: 4px;
        right: 3px;
        width: 44px;
        height: 44px;
    }

    .asset-result-card,
    .asset-result-row,
    .ai-unit-input {
        grid-template-columns: 1fr;
    }

    .asset-result-card-preview {
        width: 100%;
        height: 160px;
    }

    .monitor-config-actions,
    .asset-result-actions,
    .plan-actions {
        align-items: stretch;
    }

    .monitor-config-actions .btn,
    .asset-result-actions .btn,
    .plan-actions .btn {
        flex: 1 1 140px;
    }

    .login-page {
        align-items: flex-start;
        padding: max(8vh, calc(32px + env(safe-area-inset-top))) 14px calc(24px + env(safe-area-inset-bottom));
    }

    .login-page .login-card {
        padding: 24px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #toast {
        transition: none;
    }

    #toast.show .toast-progress {
        animation: none;
    }
}

@media (max-width: 380px) {
    #adminPhone {
        display: none;
    }

    .metrics {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 90px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}

/* ===== 导航中心 ===== */
.navigation-auth-note {
    margin-bottom: 12px;
}

.navigation-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding: 11px;
}

.navigation-search {
    width: min(360px, 100%);
    margin: 0;
}

.navigation-search input,
.navigation-category-filter select {
    min-height: 40px;
}

.navigation-mode {
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: flex;
    background: var(--surface-soft);
}

.navigation-mode button {
    min-height: 32px;
    padding: 0 11px;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 650;
}

.navigation-mode button.active {
    color: var(--brand);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.navigation-category-filter {
    width: 160px;
    margin: 0;
}

.navigation-result-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 11px;
}

.navigation-category-list {
    display: grid;
    gap: 10px;
}

.navigation-category-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.navigation-category-head {
    min-height: 43px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fcfdfe;
}

.navigation-category-head > i,
.navigation-category-manager article > i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--navigation-category-color, #98a2b3);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--navigation-category-color, #98a2b3) 14%, transparent);
}

.navigation-category-head b {
    font-size: 12px;
}

.navigation-category-head span {
    color: var(--muted);
    font-size: 10px;
}

.navigation-category-head button {
    width: 40px;
    height: 36px;
    margin-left: auto;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
}

.navigation-category-head button:hover {
    color: var(--brand);
    background: var(--brand-soft);
}

.navigation-link-grid {
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 7px;
}

.navigation-link-card {
    min-width: 0;
    min-height: 76px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    align-items: center;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.navigation-link-card:hover {
    border-color: #a9bce2;
    background: #fbfdff;
    box-shadow: 0 3px 10px rgba(23, 92, 211, .08);
}

.navigation-link-main {
    min-width: 0;
    min-height: 74px;
    flex: 1;
    padding: 9px 4px 9px 9px;
    border: 0;
    border-radius: 7px 0 0 7px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    background: transparent;
    text-align: left;
}

.navigation-site-icon {
    position: relative;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.navigation-site-icon img,
.navigation-icon-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.navigation-site-icon img {
    object-fit: contain;
    background: #fff;
}

.navigation-icon-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.navigation-link-copy {
    min-width: 0;
    flex: 1;
}

.navigation-link-copy > span {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.navigation-link-copy b,
.navigation-link-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navigation-link-copy b {
    color: var(--ink);
    font-size: 12px;
}

.navigation-link-copy small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.navigation-link-copy em {
    flex: 0 0 auto;
    padding: 1px 5px;
    border: 1px solid #d0d5dd;
    border-radius: 99px;
    color: var(--muted);
    background: #f9fafb;
    font-size: 7px;
    font-style: normal;
}

.navigation-link-actions {
    height: 74px;
    padding: 0 4px;
    display: flex;
    align-items: center;
}

.navigation-link-actions button {
    width: 31px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: #98a2b3;
    background: transparent;
    font-size: 16px;
}

.navigation-link-actions .material-icons {
    font-size: 18px;
}

.navigation-link-actions button:hover {
    color: var(--brand);
    background: var(--brand-soft);
}

.navigation-link-actions .navigation-pin-button.active {
    color: #f79009;
}

.navigation-note-button {
    display: none !important;
}

.navigation-empty .btn {
    margin-top: 12px;
}

.navigation-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.navigation-form-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.navigation-pinned-check {
    margin-top: 12px;
}

.navigation-icon-upload {
    margin-top: 10px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    background: var(--surface-soft);
}

.navigation-icon-upload label {
    grid-column: 1 / -1;
    margin: 0;
}

.navigation-icon-upload input {
    min-height: 40px;
    padding: 7px;
    background: #fff;
}

.navigation-icon-upload button {
    margin: 0;
}

.navigation-icon-upload span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 10px;
}

.navigation-category-manager {
    display: grid;
    gap: 7px;
    margin: 12px 0;
}

.navigation-category-manager article {
    min-height: 54px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navigation-category-manager article > span {
    min-width: 0;
    flex: 1;
}

.navigation-category-manager b,
.navigation-category-manager small {
    display: block;
}

.navigation-category-manager b {
    font-size: 12px;
}

.navigation-category-manager small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.navigation-category-manager button {
    min-width: 38px;
    min-height: 38px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    color: var(--body);
    background: transparent;
    font-size: 11px;
}

.navigation-category-manager button:hover:not(:disabled) {
    color: var(--brand);
    background: var(--brand-soft);
}

.navigation-category-manager button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.navigation-category-manager .danger-link {
    color: var(--danger);
}

.monitor-notify-error {
    display: block;
    max-width: 360px;
    margin-top: 3px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--danger);
    font-size: 11px;
    font-weight: 500;
}

#modal .table-wrap .link-btn + .link-btn {
    margin-left: 6px;
}

@media (max-width: 700px) {
    .monitor-notify-table {
        display: none;
    }

    .navigation-toolbar {
        align-items: stretch;
    }

    .navigation-search,
    .navigation-category-filter {
        width: 100%;
    }

    .navigation-mode {
        flex: 1;
    }

    .navigation-mode button {
        min-height: 40px;
        flex: 1;
    }

    .navigation-result-count {
        width: 100%;
        margin-left: 0;
    }

    .navigation-link-grid,
    .navigation-form-grid {
        grid-template-columns: 1fr;
    }

    .navigation-link-actions button {
        width: 42px;
        height: 44px;
    }

    .navigation-category-head button {
        width: 44px;
        height: 44px;
    }

    .navigation-category-manager article {
        flex-wrap: wrap;
    }

    .navigation-category-manager article > span {
        min-width: 150px;
    }
}

/* Daily operations: readable records on phones, no mandatory horizontal table scrolling. */
#dailyWorkbench { margin-bottom: 24px; }
#dailyWorkbench .page-actions { flex-wrap: wrap; gap: 10px; margin: 12px 0; }
#dailyWorkbench .metric-card { text-align: left; }
@media (max-width: 620px) {
  #dailyWorkbench .btn { min-height: 44px; }
  #dailyWorkbench .daily-table { min-width: 0; width: 100%; }
  #dailyWorkbench .daily-table thead { display: none; }
  #dailyWorkbench .daily-table tr { display: block; border-bottom: 1px solid var(--border, #ddd); padding: 12px 0; }
  #dailyWorkbench .daily-table td { display: flex; gap: 12px; justify-content: space-between; white-space: normal; padding: 6px; }
  #dailyWorkbench .daily-table td::before { content: attr(data-label); flex: 0 0 80px; color: #687178; }
}
