:root {
  --bg: #eef0eb;
  --surface: #fbfcf8;
  --surface-raised: #ffffff;
  --surface-muted: #f0f2ed;
  --surface-strong: #e6eae3;
  --ink: #1c2421;
  --ink-soft: #3d4843;
  --muted: #68736e;
  --faint: #8a948f;
  --line: #d6dcd5;
  --line-strong: #bdc7bf;
  --accent: #146e68;
  --accent-hover: #0e5c57;
  --accent-soft: #dcedea;
  --accent-ink: #0b5651;
  --accent-contrast: #ffffff;
  --success: #2f7450;
  --success-soft: #e2efe7;
  --warning: #8a5a13;
  --warning-soft: #fff1d3;
  --danger: #a14138;
  --danger-hover: #85342e;
  --danger-soft: #f7e5e2;
  --info: #466686;
  --info-soft: #e6edf5;
  --shadow: 0 16px 38px rgba(32, 43, 38, .07);
  --header-height: 64px;
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] {
  --bg: #151a18;
  --surface: #1c221f;
  --surface-raised: #222925;
  --surface-muted: #252c28;
  --surface-strong: #2b332f;
  --ink: #eef3ef;
  --ink-soft: #d2dad5;
  --muted: #9ca8a2;
  --faint: #7f8b85;
  --line: #343e39;
  --line-strong: #4c5a53;
  --accent: #62bdb5;
  --accent-hover: #78cec6;
  --accent-soft: #213e3a;
  --accent-ink: #b9ece7;
  --accent-contrast: #14201e;
  --success: #73c18e;
  --success-soft: #223a2b;
  --warning: #efc275;
  --warning-soft: #392f1f;
  --danger: #ef9288;
  --danger-hover: #ffaaa1;
  --danger-soft: #402725;
  --info: #9fbee0;
  --info-soft: #253443;
  --shadow: 0 18px 46px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { color: inherit; font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
a { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 13px;
  border-radius: 7px;
  color: #fff;
  background: var(--accent-hover);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute !important; top: 0 !important; left: 0 !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px clamp(14px, 2.4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}
.brand { min-width: max-content; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand > span { display: grid; gap: 1px; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 11px; }
.admin-bar-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.header-button,
.theme-control {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  background: var(--surface-raised);
}
.header-button { display: inline-flex; align-items: center; justify-content: center; padding: 7px 11px; text-decoration: none; cursor: pointer; }
.header-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.step-up-button { border-color: color-mix(in srgb, var(--warning) 34%, var(--line)); color: var(--warning); background: var(--warning-soft); font-size: 10px; }
.step-up-button.verified { border-color: color-mix(in srgb, var(--success) 34%, var(--line)); color: var(--success); background: var(--success-soft); }
.theme-control { display: flex; align-items: center; padding-left: 10px; color: var(--muted); font-size: 11px; }
.theme-control select { min-height: 34px; padding: 4px 28px 4px 7px; border: 0; outline: 0; color: var(--ink); background: transparent; cursor: pointer; }
.live-state { min-width: max-content; display: inline-flex; align-items: center; gap: 7px; margin-right: 2px; color: var(--muted); font-size: 12px; }
.live-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px var(--surface-strong); }
.live-state.ok i { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.live-state.paused i { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.live-state.error i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.admin-shell {
  width: min(1560px, 100%);
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  gap: clamp(22px, 3vw, 48px);
  margin: 0 auto;
  padding: 28px clamp(18px, 2.4vw, 34px) 0;
}
.sidebar { position: sticky; top: calc(var(--header-height) + 24px); align-self: start; min-width: 0; }
.sidebar-label { margin: 0 0 9px 11px; color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-nav { display: grid; gap: 3px; }
.section-nav a {
  min-height: 42px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.section-nav a:hover { background: var(--surface-muted); }
.section-nav a[aria-current="page"] { border-color: var(--line); color: var(--accent-ink); background: var(--surface-raised); box-shadow: 0 5px 18px rgba(25, 40, 34, .04); }
.nav-icon { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface-muted); font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.section-nav a[aria-current="page"] .nav-icon { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--accent-ink); background: var(--accent-soft); }
.nav-count { min-width: 21px; height: 19px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border-radius: 10px; color: var(--accent-ink); background: var(--accent-soft); font-size: 10px; font-weight: 800; }
.nav-count.danger { color: var(--danger); background: var(--danger-soft); }
.sidebar-note { display: grid; gap: 6px; margin-top: 24px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: color-mix(in srgb, var(--surface) 65%, transparent); font-size: 11px; line-height: 1.45; }
.sidebar-note strong { color: var(--ink-soft); font-size: 11px; }

.admin-main { min-width: 0; padding-bottom: 32px; }
.admin-section { min-height: calc(100vh - var(--header-height) - 96px); scroll-margin-top: calc(var(--header-height) + 18px); }
.section-heading { min-height: 108px; display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 7px 0 24px; }
.section-heading h1 { margin: 2px 0 7px; font-size: clamp(29px, 3.3vw, 43px); line-height: 1.04; letter-spacing: -.035em; }
.section-heading p:not(.eyebrow) { max-width: 760px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hero-heading { padding-top: 3px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h2 { letter-spacing: -.015em; }

.primary,
.secondary,
.danger-button,
.quiet {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.primary { border: 1px solid var(--accent-hover); color: var(--accent-contrast); background: var(--accent-hover); }
.primary:hover { border-color: var(--accent); background: var(--accent); }
.secondary { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-ink); background: var(--accent-soft); }
.secondary:hover { border-color: var(--accent); }
.danger-button { border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); background: var(--danger-soft); }
.danger-button:hover { border-color: var(--danger); color: var(--danger-hover); }
.quiet { border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface-raised); }
.quiet:hover { border-color: var(--line-strong); background: var(--surface-muted); }
button:disabled { cursor: not-allowed; opacity: .48; }
button[data-busy="true"] { cursor: wait; }

.message { position: sticky; top: calc(var(--header-height) + 10px); z-index: 20; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 10px 12px 10px 14px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink-soft); background: var(--surface-raised); box-shadow: var(--shadow); font-size: 13px; }
.message[data-kind="success"] { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); color: var(--success); background: var(--success-soft); }
.message[data-kind="error"] { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); background: var(--danger-soft); }
.message[data-kind="warning"] { border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); color: var(--warning); background: var(--warning-soft); }
.message button { width: 30px; height: 30px; flex: 0 0 auto; border: 0; border-radius: 50%; color: currentColor; background: transparent; font-size: 20px; cursor: pointer; }
.loading-panel { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; }
.spinner { width: 17px; height: 17px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); gap: 9px; margin-bottom: 12px; }
.summary-card { position: relative; min-height: 114px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; }
.summary-card::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--surface-strong); content: ""; }
.summary-card.attention::after { background: var(--danger); }
.summary-card.running::after { background: var(--accent); }
.summary-card span { display: block; color: var(--muted); font-size: 11px; }
.summary-card strong { display: block; margin: 11px 0 4px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 680; line-height: 1; letter-spacing: -.035em; }
.summary-card small { color: var(--faint); font-size: 10px; }

.signal-panel { margin-bottom: 12px; }
.signal-heading { min-height: 68px; }
.signal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.signal-card { min-width: 0; min-height: 102px; display: grid; align-content: center; gap: 6px; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.signal-card:nth-child(4n) { border-right: 0; }
.signal-card:nth-last-child(-n + 4) { border-bottom: 0; }
.signal-card span { color: var(--muted); font-size: 9px; font-weight: 780; letter-spacing: .045em; text-transform: uppercase; }
.signal-card strong { color: var(--ink); font-size: 18px; line-height: 1.1; overflow-wrap: anywhere; }
.signal-card small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.signal-card.attention strong { color: var(--danger); }
.signal-card.warning strong { color: var(--warning); }
.signal-card.ok strong { color: var(--success); }
.security-events-panel { margin-top: 12px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr); gap: 12px; margin-top: 12px; }
.dashboard-grid.wide-left { grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.panel + .panel { margin-top: 12px; }
.dashboard-grid .panel + .panel { margin-top: 0; }
.panel-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 18px; }
.compact-heading { min-height: 68px; }
.service-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px; padding: 18px; }
.service-lead { grid-column: 1 / -1; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.service-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 11px; }
.metric-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 8px 18px 12px; }
.metric-list div { min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.metric-list div:nth-last-child(-n + 2) { border-bottom: 0; }
.metric-list div:nth-child(odd) { padding-right: 13px; }
.metric-list div:nth-child(even) { padding-left: 13px; border-left: 1px solid var(--line); }
.metric-list dt { color: var(--muted); font-size: 10px; }
.metric-list dd { margin: 4px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.text-link { color: var(--accent-ink); font-size: 11px; font-weight: 750; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.compact-list { min-height: 190px; }
.compact-item { min-height: 60px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.compact-item:last-child { border-bottom: 0; }
.compact-item-main { min-width: 0; display: grid; gap: 4px; }
.compact-item-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.compact-item-title strong { max-width: 100%; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-item-main small, .compact-item > small { color: var(--muted); font-size: 10px; }

.status { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-strong); font-size: 10px; font-weight: 750; white-space: nowrap; }
.status::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.status.active,
.status.succeeded,
.status.enabled { color: var(--success); background: var(--success-soft); }
.status.queued,
.status.leased,
.status.running,
.status.pending { color: var(--accent-ink); background: var(--accent-soft); }
.status.suspended,
.status.expired,
.status.archived,
.status.cancelled { color: var(--warning); background: var(--warning-soft); }
.status.failed,
.status.dead,
.status.disabled,
.status.revoked { color: var(--danger); background: var(--danger-soft); }
.status.system_admin { color: var(--info); background: var(--info-soft); }

.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.action-card { min-height: 235px; display: flex; flex-direction: column; align-items: flex-start; gap: 17px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.action-card > div { flex: 1; }
.action-card h2 { margin: 0 0 8px; font-size: 18px; }
.action-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.action-index { width: 34px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; }
.danger-zone { border-color: color-mix(in srgb, var(--warning) 28%, var(--line)); }
.danger-zone.paused { border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); background: color-mix(in srgb, var(--danger-soft) 32%, var(--surface)); }

.filter-heading { min-height: 78px; }
.inline-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.inline-filter select { min-height: 34px; }
.stacked-heading { min-height: auto; align-items: flex-end; flex-wrap: wrap; }
.filter-only { justify-content: flex-end; padding-block: 12px; }
.filter-bar { min-width: min(100%, 660px); display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; margin-left: auto; }
.filter-bar label { min-width: 145px; }
.filter-bar .search-field { min-width: min(250px, 100%); flex: 1 1 210px; }
.filter-bar input, .filter-bar select, .inline-filter select { width: 100%; min-height: 36px; padding: 7px 30px 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: var(--surface-raised); }
.filter-bar input { padding-right: 10px; }
.result-count { min-width: max-content; color: var(--muted); font-size: 10px; }
.compact-filter { min-width: min(100%, 340px); }

.view-tools { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quick-filters, .export-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.export-tools { justify-content: flex-end; margin-left: auto; }
.quick-filter { min-height: 30px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-raised); font-size: 9px; font-weight: 740; cursor: pointer; }
.quick-filter:hover { border-color: var(--line-strong); color: var(--ink-soft); }
.quick-filter.is-active, .quick-filter[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-ink); background: var(--accent-soft); }
.compact-control { min-height: 32px; padding: 5px 9px; font-size: 10px; white-space: nowrap; }

.table-scroll { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; scrollbar-gutter: stable; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table-scroll-hint { display: none; margin: 0; padding: 7px 15px; border-bottom: 1px solid var(--line); color: var(--faint); background: var(--surface-muted); font-size: 9px; line-height: 1.35; }
.table-scroll-hint.is-visible { display: block; }
table { width: 100%; border-collapse: collapse; color: var(--ink-soft); font-size: 12px; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: color-mix(in srgb, var(--surface-muted) 70%, transparent); font-size: 9px; font-weight: 850; letter-spacing: .085em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-muted) 56%, transparent); }
.data-table { min-width: 880px; }
.operations-table { min-width: 1230px; table-layout: fixed; }
.operations-table th:nth-child(1) { width: 240px; }
.operations-table th:nth-child(2) { width: 116px; }
.operations-table th:nth-child(3) { width: 160px; }
.operations-table th:nth-child(4) { width: 180px; }
.operations-table th:nth-child(5) { width: 170px; }
.operations-table th:nth-child(6) { width: 118px; }
.operations-table th:nth-child(7) { width: 116px; }
.operations-table th:nth-child(8) { width: 170px; }
.operations-table th:last-child,
.operations-table td:last-child { position: sticky; right: 0; z-index: 2; border-left: 1px solid var(--line); background: var(--surface); box-shadow: -12px 0 20px -18px rgba(10, 24, 18, .8); }
.operations-table th:last-child { z-index: 4; background: var(--surface-muted); }
.operations-table tbody tr:hover td:last-child { background: var(--surface-muted); }
.audit-table { min-width: 1000px; }
.accounts-table { min-width: 1050px; }
.tenants-table { min-width: 1060px; }
.projects-table { min-width: 1000px; }
.models-table { min-width: 850px; }
.balances-table { min-width: 820px; }
.cell-title { display: block; color: var(--ink); font-size: 12px; font-weight: 720; overflow-wrap: anywhere; }
.cell-note { display: block; max-width: 310px; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.cell-error { display: block; max-width: 340px; margin-top: 6px; color: var(--danger); font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.empty-row { height: 110px; color: var(--muted); text-align: center; }
.table-actions { min-width: max-content; display: flex; justify-content: flex-end; gap: 5px; }
.table-action { min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-soft); background: var(--surface-raised); font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.table-action:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.table-action.accent { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); color: var(--accent-ink); background: var(--accent-soft); }
.table-action.warning { border-color: color-mix(in srgb, var(--warning) 42%, var(--line)); color: var(--warning); background: var(--warning-soft); }
.table-action.danger { border-color: color-mix(in srgb, var(--danger) 32%, var(--line)); color: var(--danger); }
.session-count-button { width: 100%; min-height: 38px; display: grid; justify-items: start; gap: 2px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface-raised); cursor: pointer; text-align: left; }
.session-count-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.session-count-button strong { font-size: 12px; }
.session-count-button small { color: var(--muted); font-size: 9px; }
.membership-list { min-width: 240px; display: flex; flex-wrap: wrap; gap: 5px; }
.membership-chip { min-height: 28px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-soft); background: var(--surface-raised); font-size: 10px; cursor: pointer; }
.membership-chip:hover { border-color: var(--accent); }
.membership-chip:disabled { cursor: default; }
.membership-chip b { color: var(--muted); font-weight: 600; }
.metadata { max-width: 360px; display: block; color: var(--muted); font-family: "Cascadia Mono", Consolas, monospace; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.audit-detail { max-width: 390px; display: grid; gap: 5px; }
.audit-summary { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.audit-links { display: flex; flex-wrap: wrap; gap: 4px; }
.investigation-link { min-height: 27px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent-ink); background: var(--surface-raised); font-size: 9px; font-weight: 700; cursor: pointer; }
.investigation-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.metadata-details { max-width: 390px; }
.metadata-details summary { width: max-content; color: var(--muted); font-size: 9px; cursor: pointer; }
.metadata-details[open] summary { margin-bottom: 5px; color: var(--accent-ink); }
.metadata-details .metadata { max-height: 180px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); overflow: auto; white-space: pre-wrap; }

.pagination { min-height: 48px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.pagination span { min-width: 92px; text-align: center; }

.budget-cell { min-width: 220px; }
.budget-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.budget-line strong { color: var(--ink); font-size: 12px; }
.budget-line span { color: var(--muted); font-size: 9px; }
.budget-track { height: 5px; margin-top: 7px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.budget-track > span { height: 100%; display: block; border-radius: inherit; background: var(--accent); }
.budget-track.warning > span { background: var(--warning); }
.budget-track.danger > span { background: var(--danger); }
.budget-detail { display: flex; justify-content: space-between; gap: 9px; margin-top: 5px; color: var(--muted); font-size: 9px; }
.uncertain-amount { color: var(--warning); font-weight: 700; }

.security-banner { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line)); border-radius: 9px; color: var(--accent-ink); background: var(--accent-soft); }
.security-banner > span { margin-top: 2px; font-size: 10px; }
.security-banner strong { font-size: 12px; }
.security-banner p { margin: 3px 0 0; font-size: 11px; line-height: 1.45; }
.model-routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.price-policy-panel { margin-bottom: 12px; }
.price-policy-form { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(260px, 1.6fr) auto; align-items: end; gap: 18px; padding: 17px 18px; }
.price-policy-form > label { min-width: 0; display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 720; }
.multiplier-input { min-width: 0; display: flex; align-items: center; gap: 7px; }
.multiplier-input input { width: 100%; min-width: 0; height: 38px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: var(--surface-raised); font-variant-numeric: tabular-nums; }
.multiplier-input b { color: var(--accent); font-size: 18px; }
.price-policy-copy { min-width: 0; }
.price-policy-copy strong { display: block; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.price-policy-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.price-policy-form > button { min-height: 38px; white-space: nowrap; }
.model-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.model-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.model-card h2 { margin: 2px 0 3px; font-size: 22px; }
.model-card-id { margin: 15px 0; padding: 10px 11px; border-radius: 7px; color: var(--ink-soft); background: var(--surface-muted); font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; overflow-wrap: anywhere; }
.model-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.model-meta-grid div { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.model-meta-grid span { display: block; color: var(--muted); font-size: 9px; }
.model-meta-grid strong { display: block; margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }
.panel-footnote { margin: 0; padding: 12px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.global-balance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border-bottom: 1px solid var(--line); background: var(--line); }
.global-balance > div { padding: 13px 15px; background: var(--surface-muted); }
.global-balance span { display: block; color: var(--muted); font-size: 9px; }
.global-balance strong { display: block; margin-top: 4px; font-size: 14px; }

.admin-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 2px 0; color: var(--faint); font-size: 9px; }

dialog { width: min(540px, calc(100vw - 24px)); max-height: min(760px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 90px rgba(7, 17, 13, .32); overflow: auto; }
dialog.provider-stages-dialog { width: min(960px, calc(100vw - 24px)); }
dialog.drawer-dialog { width: min(640px, 100vw); height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-width: 0 0 0 1px; border-radius: 12px 0 0 12px; overflow: hidden; }
dialog::backdrop { background: rgba(17, 24, 21, .58); backdrop-filter: blur(2px); }
.dialog-shell { position: relative; display: grid; gap: 15px; margin: 0; padding: 25px; }
.dialog-shell h2 { margin: 1px 40px 0 0; font-size: 22px; }
.dialog-shell > p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.dialog-shell label { min-width: 0; display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 720; }
.dialog-shell label small { color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.4; }
.dialog-shell input:not([type="checkbox"]),
.dialog-shell select,
.dialog-shell textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: var(--surface-raised); resize: vertical; }
.dialog-shell textarea { line-height: 1.45; }
.dialog-shell input[readonly], .dialog-shell textarea[readonly] { color: var(--muted); background: var(--surface-muted); }
.close { position: absolute; top: 13px; right: 13px; z-index: 1; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface-raised); font-size: 20px; cursor: pointer; }
.close:hover { color: var(--ink); border-color: var(--line-strong); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.warning { padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line)); border-radius: 7px; color: var(--warning) !important; background: var(--warning-soft); }
.dialog-note { padding: 10px 11px; border-radius: 7px; color: var(--muted) !important; background: var(--surface-muted); }
.dialog-inline-error { margin: 0; padding: 9px 10px; border-radius: 7px; color: var(--danger) !important; background: var(--danger-soft); font-size: 10px !important; }
.checkbox-row { grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; padding: 11px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.checkbox-row input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.checkbox-row span { display: grid; gap: 3px; }
.checkbox-row strong { font-size: 11px; }
.price-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.price-preview div { padding: 10px; border-radius: 7px; background: var(--surface-muted); }
.price-preview span { display: block; color: var(--muted); font-size: 9px; }
.price-preview strong { display: block; margin-top: 4px; font-size: 12px; }

.provider-stages-shell { gap: 13px; }
.provider-stages-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.provider-stages-summary > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.provider-stages-summary span { display: block; color: var(--muted); font-size: 9px; }
.provider-stages-summary strong { display: block; margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.provider-stages-list { min-height: 80px; display: grid; gap: 8px; }
.provider-stage { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); overflow: hidden; }
.provider-stage.needs-review { border-color: color-mix(in srgb, var(--warning) 38%, var(--line)); }
.provider-stage-heading { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 12px; cursor: pointer; list-style-position: inside; }
.provider-stage-heading:hover { background: var(--surface-muted); }
.provider-stage-heading:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.provider-stage-title { display: inline-grid; gap: 3px; margin-right: auto; }
.provider-stage-title strong { color: var(--ink); font-size: 12px; }
.provider-stage-title small { color: var(--muted); font-size: 9px; }
.stage-outcome { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; }
.stage-outcome.accepted { color: var(--success); background: var(--success-soft); }
.stage-outcome.needs-attention { color: var(--warning); background: var(--warning-soft); }
.provider-stage-body { display: grid; gap: 11px; padding: 0 12px 12px; border-top: 1px solid var(--line); }
.provider-stage-metadata { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; }
.provider-stage-metadata div { min-width: 0; padding: 10px 10px 8px 0; border-bottom: 1px solid var(--line); }
.provider-stage-metadata dt { color: var(--muted); font-size: 9px; }
.provider-stage-metadata dd { margin: 4px 0 0; color: var(--ink-soft); font-family: "Cascadia Mono", Consolas, monospace; font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.provider-stage-warnings { padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--line)); border-radius: 7px; color: var(--warning); background: var(--warning-soft); font-size: 10px; }
.provider-stage-warnings strong { font-size: 10px; }
.provider-stage-warnings ul { margin: 6px 0 0; padding-left: 17px; }
.provider-stage-warnings li + li { margin-top: 3px; }
.provider-output-label { margin: 0; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.provider-output { max-height: 360px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--surface-muted); font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; line-height: 1.5; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; word-break: break-word; }
.provider-stages-policy { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.provider-stages-loading, .provider-stages-empty, .provider-stages-error { min-height: 84px; display: flex; align-items: center; justify-content: center; margin: 0; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); background: var(--surface-muted); font-size: 11px; text-align: center; }
.provider-stages-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 36%, var(--line)); background: var(--danger-soft); }

.drawer-shell { min-height: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.drawer-header { position: relative; min-height: 108px; display: flex; align-items: flex-start; padding: 22px 66px 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-header h2 { margin: 2px 0 5px; font-size: 24px; letter-spacing: -.025em; }
.drawer-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.drawer-body { min-height: 0; display: grid; align-content: start; gap: 12px; padding: 16px 18px 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.drawer-actions { min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.drawer-loading, .drawer-empty, .drawer-error { min-height: 150px; display: flex; align-items: center; justify-content: center; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); background: var(--surface-muted); font-size: 11px; text-align: center; }
.drawer-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 36%, var(--line)); background: var(--danger-soft); }
.detail-section { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); overflow: hidden; }
.detail-section-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.detail-section-heading h3 { margin: 0; color: var(--ink); font-size: 12px; }
.detail-section-heading small { color: var(--muted); font-size: 9px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.detail-grid > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid > div:nth-child(2n) { border-right: 0; }
.detail-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
.detail-grid dt { color: var(--muted); font-size: 9px; }
.detail-grid dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.detail-grid dd.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 9px; font-weight: 500; }
.detail-error { margin: 0; padding: 11px 12px; color: var(--danger); background: var(--danger-soft); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.detail-warning { margin: 0; padding: 11px 12px; color: var(--warning); background: var(--warning-soft); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.detail-link-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 12px; }
.timeline { display: grid; padding: 4px 12px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 42px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.timeline-item.complete i { background: var(--success); }
.timeline-item.current i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline-item span { color: var(--ink-soft); font-size: 10px; font-weight: 680; }
.timeline-item time { color: var(--muted); font-size: 9px; }
.session-list { display: grid; gap: 9px; }
.session-card { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); overflow: hidden; }
.session-card.current { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); }
.session-card.ended { opacity: .78; }
.session-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.session-card-title { min-width: 0; display: grid; gap: 3px; }
.session-card-title strong { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.session-card-title small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.session-card .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.session-card-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 9px 11px; border-top: 1px solid var(--line); }
.session-pagination { margin-top: 10px; padding-inline: 0; justify-content: space-between; }
.session-pagination .session-page-count { min-width: 0; text-align: left; }
.session-pagination .table-action { min-width: 120px; }

@media (max-width: 1180px) {
  .admin-shell { grid-template-columns: 196px minmax(0, 1fr); gap: 24px; }
  .summary-grid { grid-template-columns: repeat(3, minmax(105px, 1fr)); }
  .action-grid { grid-template-columns: 1fr 1fr; }
  .action-card:last-child { grid-column: 1 / -1; min-height: 180px; }
  .dashboard-grid.wide-left { grid-template-columns: 1fr; }
  .dashboard-grid.wide-left .panel + .panel { margin-top: 0; }
  .signal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-card:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .signal-card:nth-child(2n) { border-right: 0; }
  .signal-card:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 920px) {
  :root { --header-height: 60px; }
  .admin-bar { gap: 12px; }
  .brand small, .theme-control > span, .live-state > span { display: none; }
  .theme-control { padding-left: 0; }
  .admin-shell { display: block; padding: 0; }
  .sidebar { position: sticky; top: var(--header-height); z-index: 25; padding: 7px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(12px); overflow-x: auto; }
  .sidebar-label, .sidebar-note { display: none; }
  .section-nav { min-width: max-content; display: flex; gap: 5px; }
  .section-nav a { min-height: 38px; display: flex; padding: 5px 9px; }
  .nav-icon { display: none; }
  .admin-main { padding: 22px 18px 28px; }
  .admin-section { min-height: calc(100vh - 140px); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .panel + .panel { margin-top: 0; }
  .model-meta-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 760px) {
  .table-scroll-hint { display: none; }
  .table-scroll { overflow: visible; scrollbar-gutter: auto; }
  .data-table { min-width: 0; display: block; background: transparent; }
  .data-table thead { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
  .data-table tbody { display: grid; gap: 9px; padding: 10px; }
  .data-table tbody tr { min-width: 0; display: grid; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); overflow: hidden; }
  .data-table tbody tr:hover td { background: transparent; }
  .data-table tbody td { min-width: 0; display: grid; grid-template-columns: minmax(88px, 34%) minmax(0, 1fr); align-items: start; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: transparent; overflow-wrap: anywhere; }
  .data-table tbody td::before { color: var(--muted); font-size: 8px; font-weight: 820; letter-spacing: .065em; text-transform: uppercase; content: attr(data-label); }
  .data-table tbody td:last-child { border-bottom: 0; }
  .data-table .empty-row { min-height: 100px; display: flex; align-items: center; justify-content: center; text-align: center; }
  .data-table .empty-row::before { content: none; }
  .operations-table th:last-child,
  .operations-table td:last-child { position: static; width: auto; border-left: 0; background: transparent; box-shadow: none; }
  .operations-table tbody tr:hover td:last-child { background: transparent; }
  .table-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-start; }
  .table-action { min-height: 36px; }
  .membership-list, .budget-cell, .audit-detail, .metadata-details { min-width: 0; max-width: none; }
  .view-tools { align-items: stretch; flex-direction: column; }
  .export-tools { justify-content: flex-start; margin-left: 0; }
  .pagination { justify-content: space-between; }
  dialog.drawer-dialog { width: 100vw; border-left: 0; border-radius: 0; }
}

@media (max-width: 680px) {
  .admin-bar { padding-inline: 10px; }
  .brand > span { display: none; }
  .brand img { width: 36px; height: 36px; }
  .admin-bar-actions { gap: 5px; }
  .live-state { margin-inline: 2px; }
  .workplace-link span { font-size: 0; }
  .workplace-link span::after { content: "Работа"; font-size: 11px; }
  .header-button { padding-inline: 8px; font-size: 11px; }
  .theme-control select { width: 104px; padding-left: 8px; font-size: 11px; }
  .step-up-button { max-width: 112px; padding-inline: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar { padding-inline: 10px; }
  .section-nav a { font-size: 11px; }
  .admin-main { padding: 18px 10px 24px; }
  .section-heading { min-height: auto; align-items: stretch; flex-direction: column; gap: 14px; padding: 7px 2px 20px; }
  .section-heading > button { align-self: flex-start; }
  .section-heading h1 { font-size: 30px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { min-height: 104px; }
  .dashboard-grid { gap: 10px; margin-top: 10px; }
  .panel-heading { padding-inline: 14px; }
  .service-body { grid-template-columns: 1fr; padding: 15px 14px; }
  .service-body .secondary { justify-self: start; }
  .metric-list { padding-inline: 14px; }
  .action-grid { grid-template-columns: 1fr; gap: 10px; }
  .action-card, .action-card:last-child { grid-column: auto; min-height: 205px; padding: 17px; }
  .filter-heading { align-items: flex-start; flex-direction: column; }
  .inline-filter { width: 100%; justify-content: space-between; }
  .stacked-heading { align-items: stretch; }
  .filter-bar { min-width: 100%; justify-content: stretch; margin: 0; }
  .filter-bar label, .filter-bar .search-field { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .filter-bar .search-field { min-width: 100%; flex-basis: 100%; }
  .result-count { width: 100%; }
  th, td { padding: 11px 13px; }
  .model-routes { grid-template-columns: 1fr; gap: 10px; }
  .price-policy-form { grid-template-columns: 1fr; gap: 12px; }
  .price-policy-form > button { width: 100%; }
  .global-balance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .dialog-shell { padding: 22px 17px 17px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions > button { width: 100%; }
  .provider-stages-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .provider-stage-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .provider-stage-heading { align-items: flex-start; }
  .signal-heading { align-items: flex-start; flex-direction: column; }
  .signal-heading .inline-filter { width: 100%; }
  .detail-grid, .session-card .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-grid > div:last-child { border-bottom: 0; }
  .drawer-header { min-height: 96px; padding: 18px 58px 14px 16px; }
  .drawer-body { padding: 12px 10px 18px; }
  .drawer-actions { padding-inline: 10px; }
  .session-drawer-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .brand { display: none; }
  .admin-bar { justify-content: flex-end; }
  .admin-bar-actions { width: 100%; justify-content: space-between; }
  .theme-control select { width: 98px; }
  .step-up-button { display: none; }
  .summary-grid { gap: 7px; }
  .summary-card { padding: 13px; }
  .summary-card strong { font-size: 27px; }
  .metric-list { grid-template-columns: 1fr; }
  .metric-list div:nth-child(n) { padding-inline: 0; border-bottom: 1px solid var(--line); border-left: 0; }
  .metric-list div:last-child { border-bottom: 0; }
  .compact-item { padding-inline: 14px; }
  .model-meta-grid { grid-template-columns: 1fr; }
  .price-preview { grid-template-columns: 1fr; }
  .provider-stage-metadata { grid-template-columns: 1fr; }
  .signal-grid { grid-template-columns: 1fr; }
  .signal-card:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-card:last-child { border-bottom: 0; }
  .data-table tbody td { grid-template-columns: 82px minmax(0, 1fr); }
  .quick-filter { flex: 1 1 auto; }
}

@media (pointer: coarse) {
  .primary, .secondary, .danger-button, .quiet, .multiplier-input input { min-height: 44px; }
  .multiplier-input input { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 1.5s; }
  *, *::before, *::after { transition-duration: .001ms !important; }
}
