:root {
  color-scheme: dark;
  --bg: #0b1118;
  --surface: #111a24;
  --surface-2: #162331;
  --surface-3: #1b2b3b;
  --line: #26384a;
  --text: #edf4fb;
  --muted: #8ea2b7;
  --faint: #647a90;
  --blue: #55a8ff;
  --green: #3ed3a3;
  --amber: #f3b75b;
  --red: #ff6e75;
  --violet: #b39cff;
  --shadow: 0 18px 45px rgba(0, 0, 0, .22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #0b1118; }
.gate-panel { width: min(460px, 100%); padding: 38px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; background: var(--blue); color: #08121d; font-weight: 850; letter-spacing: .02em; }
.brand-mark.small { width: 36px; height: 36px; font-size: 12px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 8px; color: var(--faint); font-size: 10px; letter-spacing: .16em; font-weight: 800; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 19px; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: 0; }
h3 { margin-bottom: 4px; font-size: 14px; }
h4 { margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.muted { color: var(--muted); }
.compact { font-size: 11px; }
.gate-panel h1 { margin: 20px 0 10px; font-size: 26px; }
.gate-panel > .muted { line-height: 1.65; font-size: 13px; }
.key-form { margin-top: 26px; }
.key-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.key-form textarea { width: 100%; resize: vertical; min-height: 86px; padding: 12px; border: 1px solid var(--line); background: #0b131c; color: var(--text); line-height: 1.45; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.key-form .button { margin-top: 12px; width: 100%; justify-content: space-between; }
.form-error { margin: 10px 0 0; color: var(--red); font-size: 12px; }
.gate-footnote { margin: 24px 0 0; color: var(--faint); font-size: 11px; line-height: 1.6; }

.topbar { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: rgba(11, 17, 24, .96); backdrop-filter: blur(12px); }
.topbar-inner { width: min(1540px, calc(100% - 40px)); min-height: 70px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.title-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title-block h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.status-pill.ok { color: var(--green); border-color: rgba(62,211,163,.35); }
.status-pill.ok .status-dot { background: var(--green); }
.status-pill.error { color: var(--red); border-color: rgba(255,110,117,.35); }
.status-pill.error .status-dot { background: var(--red); }

.page { width: min(1540px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 70px; }
.data-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; margin-bottom: 16px; border: 1px solid var(--blue); background: var(--surface); }
.data-status > div { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.data-status strong { color: var(--blue); font-size: 14px; }
.data-status p { margin: 8px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.data-status time { color: var(--faint); font-size: 11px; }
.data-status.error { border-color: var(--red); }
.data-status.error strong { color: var(--red); }
.control-band { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; padding: 14px; border: 1px solid var(--line); background: var(--surface); }
.control-group { display: grid; grid-template-columns: auto auto; align-items: end; gap: 7px; }
.control-group .control-label { grid-column: 1 / -1; }
.control-label, .select-control > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.segmented { display: inline-flex; border: 1px solid var(--line); }
.segment { min-width: 48px; padding: 8px 11px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; }
.segment:last-child { border-right: 0; }
.segment:hover { color: var(--text); background: var(--surface-2); }
.segment.active { background: var(--blue); color: #07121f; font-weight: 800; }
.select-control { display: grid; gap: 7px; min-width: 145px; }
.select-control select, .modal-controls input, .modal-controls select { min-height: 35px; padding: 7px 10px; border: 1px solid var(--line); background: #0c151f; color: var(--text); font-size: 12px; }
.toggle-control { display: inline-flex; align-items: center; gap: 8px; min-height: 35px; color: var(--muted); font-size: 12px; }
.toggle-control input { accent-color: var(--green); }
.control-band > .compact { margin-left: auto; padding-bottom: 9px; }
.compact-button { min-height: 35px; padding-inline: 10px; }
.custom-range { flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)) auto auto; align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.custom-range label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.custom-range input { min-height: 35px; padding: 7px 10px; border: 1px solid var(--line); background: #0c151f; color: var(--text); color-scheme: dark; font-size: 12px; }
.custom-range .form-error { grid-column: 1 / -1; margin: 0; }

.button { min-height: 35px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 750; }
.button:hover { background: var(--surface-3); }
.button-primary { border-color: var(--blue); background: var(--blue); color: #07121f; }
.button-primary:hover { background: #7bbcff; }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover { color: var(--text); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 750; }
.text-button:hover { color: #9acaFF; }
.icon-button, .info-button { display: inline-grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.icon-button { width: 31px; height: 31px; font-size: 21px; line-height: 1; }
.icon-button:hover { color: var(--text); background: var(--surface-2); }
.info-button { width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; }
.info-button:hover { color: var(--blue); border-color: var(--blue); }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 34px; }
.kpi-card { min-height: 122px; display: flex; flex-direction: column; gap: 8px; padding: 15px; border: 1px solid var(--line); background: var(--surface); }
.kpi-card:nth-child(4n + 1) { border-top: 2px solid var(--blue); }
.kpi-card:nth-child(4n + 2) { border-top: 2px solid var(--green); }
.kpi-card:nth-child(4n + 3) { border-top: 2px solid var(--amber); }
.kpi-card:nth-child(4n + 4) { border-top: 2px solid var(--violet); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.kpi-card strong { margin-top: auto; color: var(--text); font-size: 25px; font-weight: 780; letter-spacing: 0; line-height: 1.05; }
.kpi-card small { color: var(--faint); font-size: 10px; line-height: 1.4; }
.kpi { min-height: 122px; padding: 15px; border: 1px solid var(--line); background: var(--surface); }
.kpi-value { margin: 14px 0 7px; color: var(--text); font-size: 25px; font-weight: 780; letter-spacing: 0; }
.kpi-meta { color: var(--faint); font-size: 10px; }
.kpi.blue-accent { border-top: 2px solid var(--blue); }
.kpi.green-accent { border-top: 2px solid var(--green); }
.kpi.amber-accent { border-top: 2px solid var(--amber); }
.kpi.red-accent { border-top: 2px solid var(--red); }
.kpi.violet-accent { border-top: 2px solid var(--violet); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 30px 0 12px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.panel-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dimension-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-load-panel { grid-column: 1 / -1; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.panel-header > div:first-child { min-width: 0; }
.panel-header-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.granularity-control { min-height: 28px; display: inline-flex; align-items: center; gap: 7px; padding-left: 8px; border: 1px solid var(--line); background: #0c151f; color: var(--faint); font-size: 9px; font-weight: 750; white-space: nowrap; }
.granularity-control span { letter-spacing: 0; }
.granularity-control select { min-height: 26px; width: 82px; padding: 4px 6px; border: 0; border-left: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 10px; }
.panel-subtitle { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.chart-panel { min-height: 340px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 16px 8px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 18px; height: 2px; display: inline-block; background: var(--blue); }
.legend-line.green { background: var(--green); }
.legend-line.red { background: var(--red); }
.legend-line.amber { background: var(--amber); }
.legend-line.violet { background: var(--violet); }
.legend-line.violet.dashed { height: 0; background: transparent; border-top: 2px dashed var(--violet); }
.canvas-wrap { position: relative; min-height: 0; padding: 0 12px 12px; }
canvas { width: 100%; display: block; }
.canvas-wrap canvas { cursor: crosshair; }
.chart-tooltip { position: absolute; max-width: min(280px, calc(100% - 16px)); pointer-events: none; padding: 7px 9px; border: 1px solid var(--line); background: #081019; color: var(--text); font-size: 10px; line-height: 1.4; white-space: normal; box-shadow: var(--shadow); }
.chart-filter { display: grid; grid-template-columns: minmax(150px, 1fr) auto; align-items: center; gap: 6px 12px; margin: 0 16px 8px; padding: 9px 10px; border: 1px solid rgba(38,56,74,.72); background: #0c151f; }
.chart-filter label { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; font-weight: 750; }
.chart-filter output { color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.chart-filter input[type="range"] { min-width: 0; width: 100%; accent-color: var(--blue); }
.chart-filter small { color: var(--faint); font-size: 10px; white-space: nowrap; }
.distribution-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 10px; }
.distribution-grid > div { min-width: 0; }
.throughput-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 10px 8px; }
.throughput-grid > div { min-width: 0; }
.chart-subhead { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 6px; }
.chart-subhead h4 { margin: 0; }
.analysis-meta { margin: 0; padding: 0 16px 9px; color: var(--faint); font-size: 10px; line-height: 1.45; }
.throughput-grid .analysis-meta { min-height: 38px; padding: 7px 4px 0; border-top: 1px solid rgba(38,56,74,.55); }
.heatmap-toolbar { width: fit-content; display: flex; margin: 0 16px 8px; border: 1px solid var(--line); }
.heatmap-toolbar .segment { min-width: 72px; }
.panel-footer-action { display: block; margin: 0 16px 14px; }

.table-panel { min-height: 300px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table { table-layout: fixed; }
th { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 10px; font-weight: 800; text-align: left; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 10px 12px; border-bottom: 1px solid rgba(38,56,74,.62); color: var(--muted); vertical-align: top; white-space: nowrap; }
td strong { display: block; color: var(--text); font-weight: 700; }
td small { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
tbody tr[data-drill-model], tbody tr[data-drill-account], tbody tr[data-drill-user], tbody tr[data-drill-error], tbody tr[data-raw-request] { cursor: pointer; }
td.primary { color: var(--text); font-weight: 700; }
td.good { color: var(--green); }
td.warn { color: var(--amber); }
td.bad { color: var(--red); }
.empty-row td { padding: 28px 12px; color: var(--faint); text-align: center; }
.count-badge { min-width: 25px; padding: 4px 7px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }

.status-tag { display: inline-block; padding: 3px 6px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.1; }
.status-tag.success, .status-tag.active, .status-tag.healthy, .status-tag.ok { color: var(--green); border-color: rgba(62,211,163,.35); }
.status-tag.error, .status-tag.failed, .status-tag.critical, .status-tag.disabled { color: var(--red); border-color: rgba(255,110,117,.35); }
.status-tag.warning, .status-tag.degraded, .status-tag.pending { color: var(--amber); border-color: rgba(243,183,91,.35); }
.metric-good { color: var(--green); }
.metric-bad { color: var(--red); }
.basis { color: var(--faint); font-size: 10px; white-space: normal; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.model-table th:nth-child(1), .model-table td:nth-child(1) { width: 34%; }
.model-table th:not(:first-child), .model-table td:not(:first-child) { width: 16.5%; text-align: right; }
.user-table th:nth-child(1), .user-table td:nth-child(1) { width: 34%; }
.user-table th:not(:first-child), .user-table td:not(:first-child) { width: 16.5%; text-align: right; }
.error-table th:nth-child(1), .error-table td:nth-child(1) { width: 24%; }
.error-table th:nth-child(2), .error-table td:nth-child(2) { width: 12%; text-align: right; }
.error-table th:nth-child(3), .error-table td:nth-child(3) { width: 14%; text-align: right; }
.error-table th:nth-child(4), .error-table td:nth-child(4) { width: 50%; }
.preview-table th:nth-child(1), .preview-table td:nth-child(1) { width: 20%; }
.preview-table th:nth-child(2), .preview-table td:nth-child(2) { width: 12%; }
.preview-table th:nth-child(3), .preview-table td:nth-child(3) { width: 28%; }
.preview-table th:nth-child(n+4), .preview-table td:nth-child(n+4) { width: 13.33%; text-align: right; }
.raw-table { min-width: 1120px; }
.raw-table th:nth-child(1), .raw-table td:nth-child(1) { width: 135px; }
.raw-table th:nth-child(2), .raw-table td:nth-child(2) { width: 68px; }
.raw-table th:nth-child(3), .raw-table td:nth-child(3) { width: 150px; }
.raw-table th:nth-child(4), .raw-table td:nth-child(4) { width: 130px; }
.raw-table th:nth-child(5), .raw-table td:nth-child(5) { width: 110px; }
.raw-table th:nth-child(6), .raw-table td:nth-child(6) { width: 86px; text-align: right; }
.raw-table th:nth-child(7), .raw-table td:nth-child(7) { width: 130px; text-align: right; }
.raw-table th:nth-child(8), .raw-table td:nth-child(8) { width: 66px; text-align: right; }
.raw-table th:nth-child(9), .raw-table td:nth-child(9) { width: 86px; text-align: right; }
.raw-table th:nth-child(10), .raw-table td:nth-child(10) { width: 160px; }
.cell-clamp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 22px; align-items: start; gap: 5px; min-width: 0; }
.cell-clamp { min-width: 0; display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.cell-clamp.expanded { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; }
.cell-expand-button { width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 14px; line-height: 1; }
.cell-expand-button:hover { border-color: var(--blue); color: var(--blue); }

.pool-panel { padding-bottom: 2px; }
.pool-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 12px 14px; border: 1px solid var(--line); background: var(--line); }
.pool-metric { min-height: 92px; display: flex; flex-direction: column; gap: 6px; padding: 13px; background: var(--surface); }
.pool-metric span { color: var(--faint); font-size: 10px; }
.pool-metric strong { color: var(--text); font-size: 18px; line-height: 1.15; }
.pool-metric small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.progress { width: 100%; height: 5px; margin-top: auto; background: #263442; }
.progress i { display: block; height: 100%; background: var(--green); }
.pool-stat { min-height: 78px; padding: 12px; background: var(--surface); }
.pool-stat-label { color: var(--faint); font-size: 10px; }
.pool-stat-value { margin-top: 8px; color: var(--text); font-size: 17px; font-weight: 760; }
.quota-bar { width: 110px; height: 5px; margin-top: 6px; background: #263442; }
.quota-bar > span { display: block; height: 100%; background: var(--green); }
.quota-window { display: grid; gap: 2px; }
.quota-window + .quota-window { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(38,56,74,.7); }
.quota-window-name { color: var(--text); font-size: 10px; }
.quota-window-meta { color: var(--faint); font-size: 10px; }
.quota-distribution-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.quota-distribution { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quota-distribution:nth-child(2n) { border-right: 0; }

.alert-list { max-height: 335px; overflow: auto; padding: 0 16px 12px; }
.alert-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(38,56,74,.62); }
.alert-main { min-width: 0; }
.alert-main strong { display: block; color: var(--text); font-size: 12px; font-weight: 750; }
.alert-main p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.alert-severity { display: inline-block; margin-bottom: 6px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.alert-item.warning .alert-severity { color: var(--amber); }
.alert-item.critical .alert-severity { color: var(--red); }
.alert-meta { display: grid; align-content: start; justify-items: end; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.alert-meta time { color: var(--faint); }

.definitions-panel { min-height: 360px; }
.definitions-list { padding: 0 16px 14px; }
.definition-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border: 0; border-bottom: 1px solid rgba(38,56,74,.62); background: transparent; color: var(--text); text-align: left; }
.definition-row:last-child { border-bottom: 0; }
.definition-row:hover { color: var(--blue); background: var(--surface-2); }
.definition-row span { min-width: 0; }
.definition-row strong { display: block; font-size: 11px; font-weight: 750; }
.definition-row small { display: block; margin-top: 4px; color: var(--faint); font-family: ui-monospace, monospace; font-size: 10px; }
.definition-content { padding: 0 20px 22px; }
.definition-content dl { margin: 0; }
.definition-content dt { margin-top: 14px; color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.definition-content dd { margin: 5px 0 0; color: var(--text); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.definition-content code { color: var(--green); font-family: ui-monospace, monospace; font-size: 11px; }

.modal-layer { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3,7,11,.78); }
.modal { position: relative; width: min(1240px, 100%); max-height: min(88vh, 820px); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.narrow-modal { width: min(620px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 18px; }
.modal-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.modal-controls input { flex: 1 1 260px; }
.modal-table { max-height: 57vh; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.modal-footer > div { display: flex; gap: 8px; }

.loading-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(5,10,16,.78); backdrop-filter: blur(4px); }
.loading-panel { width: min(360px, 100%); display: grid; justify-items: center; gap: 9px; padding: 24px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.loading-panel strong { font-size: 14px; }
.loading-panel span, .loading-panel time { color: var(--muted); font-size: 11px; }
.loading-spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: dashboard-spin .8s linear infinite; }
@keyframes dashboard-spin { to { transform: rotate(360deg); } }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 70; max-width: min(420px, calc(100% - 44px)); padding: 11px 14px; border: 1px solid var(--line); background: var(--surface-3); color: var(--text); font-size: 12px; box-shadow: var(--shadow); }
.toast.error { border-color: rgba(255,110,117,.5); color: #ffd2d4; }
.empty-cell { padding: 28px 12px !important; color: var(--faint) !important; text-align: center; }

@media (max-width: 1220px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .three-up { grid-template-columns: 1fr 1fr; }
  .three-up > :last-child { grid-column: 1 / -1; }
  .pool-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .topbar-inner, .page { width: min(100% - 24px, 1540px); }
  .topbar-inner { min-height: 62px; }
  .button-label { display: none; }
  .control-band { align-items: stretch; }
  .control-group { flex: 1 1 100%; }
  .segmented { overflow-x: auto; }
  .custom-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-band > .compact { width: 100%; margin-left: 0; padding-bottom: 0; }
  .select-control { flex: 1 1 140px; }
  .two-up, .three-up, .dimension-grid { grid-template-columns: 1fr; }
  .three-up > :last-child { grid-column: auto; }
  .account-load-panel { grid-column: auto; }
  .quota-distribution-grid { grid-template-columns: 1fr; }
  .quota-distribution { border-right: 0; }
}

@media (max-width: 560px) {
  .gate { padding: 12px; }
  .gate-panel { padding: 25px 20px; }
  .topbar-inner, .page { width: calc(100% - 20px); }
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding-block: 10px; }
  .title-block .eyebrow { display: none; }
  .title-block h1 { font-size: 16px; }
  .topbar-actions { width: 100%; gap: 4px; }
  .topbar-actions .status-pill { margin-right: auto; }
  .status-pill { padding: 6px; }
  .status-pill:not(.ok):not(.error) { font-size: 0; }
  .status-pill:not(.ok):not(.error) .status-dot { margin: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .kpi-card, .kpi { min-height: 106px; padding: 12px; }
  .kpi-card strong, .kpi-value { margin-top: 11px; font-size: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-actions { justify-content: flex-start; }
  .panel-header { flex-wrap: wrap; padding: 13px 12px 9px; }
  .panel-header-actions { width: 100%; justify-content: flex-start; }
  .distribution-grid { grid-template-columns: 1fr; }
  .throughput-grid { grid-template-columns: 1fr; }
  .pool-summary { margin-inline: 8px; }
  .custom-range { grid-template-columns: 1fr; }
  .chart-filter { grid-template-columns: 1fr; }
  .chart-filter small { white-space: normal; }
  th, td { padding-inline: 9px; }
  .modal-layer { padding: 8px; }
  .modal { max-height: 94vh; }
  .modal-header, .modal-controls, .modal-footer { padding-inline: 12px; }
  .modal-table { max-height: 58vh; }
  .modal-footer { align-items: flex-start; flex-direction: column; }
}

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