:root {
  --bg: #f4f6f9;
  --panel: #fff;
  --panel-soft: #f7f9fc;
  --panel-strong: #eef2f7;
  --line: #e3e7ee;
  --line-strong: #cfd6e2;
  --fg: #101828;
  --dim: #667085;
  --dim-light: #98a2b3;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --green: #12b76a;
  --green-soft: rgba(18, 183, 106, 0.1);
  --amber: #f79009;
  --amber-soft: rgba(247, 144, 9, 0.12);
  --red: #f04438;
  --red-soft: rgba(240, 68, 56, 0.1);
  --ink: #18201c;
  --lime: #c8f169;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  --radius: 14px;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-soft: #1d212a;
  --panel-strong: #242a35;
  --line: #2a303b;
  --line-strong: #3a4250;
  --fg: #f2f4f7;
  --dim: #98a2b3;
  --dim-light: #667085;
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, 0.12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fg);
  background:
    radial-gradient(circle at 90% 4%, rgba(200, 241, 105, 0.18), transparent 26rem),
    var(--bg);
  font: 13px/1.5 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.6; }
code, pre { font-family: var(--mono); }
h1, h2, h3, p { margin-top: 0; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
  display: block;
  color: var(--accent);
  font: 700 9.5px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.muted { color: var(--dim); }
.small { font-size: 11px; }
.mobile-only { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.72fr);
  align-items: center;
  gap: clamp(36px, 8vw, 130px);
  max-width: 1260px;
  margin: 0 auto;
  padding: 40px 28px;
}
.login-story h1 {
  margin: 18px 0 22px;
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}
.login-story h1 em { color: var(--accent); font-style: normal; }
.login-story > p { max-width: 560px; color: var(--dim); font-size: 15px; line-height: 1.8; }
.story-grid { display: flex; gap: 36px; margin-top: 38px; }
.story-grid div { display: grid; gap: 3px; }
.story-grid b { font-size: 27px; letter-spacing: -0.04em; }
.story-grid span { color: var(--dim); font: 10px/1.2 var(--mono); }
.login-card {
  display: grid;
  gap: 17px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.login-card h2 { margin: 0; font-size: 27px; letter-spacing: -0.04em; }
.login-card > p { margin: 0; color: var(--dim); font-size: 12px; line-height: 1.7; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  flex: 0 0 236px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 24px; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 800 13px/1 var(--mono);
  box-shadow: 0 5px 12px rgba(79, 70, 229, 0.24);
}
.brand-copy { display: flex; flex-direction: column; }
.brand-copy b { font-size: 14px; letter-spacing: -0.02em; }
.brand-copy span { margin-top: 2px; color: var(--dim-light); font: 9px/1.2 var(--mono); }
.nav-label {
  padding: 0 10px 8px;
  color: var(--dim-light);
  font: 700 9px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 550;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item svg { width: 17px; height: 17px; opacity: 0.78; }
.nav-item:hover { background: var(--panel-soft); color: var(--fg); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.sidebar-foot a, .sidebar-foot button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  padding: 7px;
  border-radius: 7px;
  text-align: left;
  text-decoration: none;
  font-size: 10.5px;
}
.sidebar-foot a:hover, .sidebar-foot button:hover { background: var(--panel-soft); color: var(--fg); }
.runtime-line { display: flex; align-items: center; gap: 7px; padding: 9px 7px 1px; color: var(--dim-light); font-size: 9.5px; }
.status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }

.main-column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px;
  flex: 0 0 68px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 18px; letter-spacing: -0.03em; line-height: 1.2; }
.topbar-title p { margin: 2px 0 0; color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.version-pill, .connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--dim);
  font: 600 10px/1 var(--mono);
  white-space: nowrap;
}
.connection-pill.offline { color: var(--red); }
.connection-pill.offline .status-dot { background: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.icon-button {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--dim);
}
.icon-button:hover { background: var(--panel-soft); color: var(--fg); }
.icon-button svg { width: 16px; height: 16px; }

#main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px; }
.page { display: none; }
.page.active { display: block; animation: reveal 0.24s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-intro h2 { margin: 6px 0 4px; font-size: 22px; letter-spacing: -0.035em; }
.page-intro p { margin: 0; color: var(--dim); font-size: 12px; }
.page-intro > .button-row { align-items: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.metric-card span, .metric-card small { color: var(--dim); font: 10px/1.3 var(--mono); }
.metric-card strong { margin: 20px 0 7px; font-size: 31px; line-height: 1; letter-spacing: -0.055em; }
.metric-card small { margin-top: auto; }
.metric-card.dark { background: #18201c; border-color: #18201c; color: #fff; }
.metric-card.dark span, .metric-card.dark small { color: #aebbb2; }
.metric-card.lime { background: var(--lime); border-color: var(--lime); color: #18201c; }
.metric-card.lime span, .metric-card.lime small { color: #4b5a40; }
.compact-grid .metric-card { min-height: 105px; }
.compact-grid .metric-card strong { margin: 14px 0 5px; font-size: 26px; }

.panel { padding: 18px 20px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading.compact { margin-bottom: 14px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 15px; letter-spacing: -0.01em; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr); gap: 14px; align-items: start; }
.overview-grid > .panel { margin-bottom: 0; }
.stack { display: grid; gap: 14px; }
.stack .panel { margin: 0; }
.field { display: grid; gap: 7px; }
.field > span { color: var(--dim); font: 700 9.5px/1.2 var(--mono); letter-spacing: 0.06em; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--fg);
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.55; }
.file-field input { padding: 7px; color: var(--dim); font-size: 11px; }
.file-field input::file-selector-button { margin-right: 8px; border: 0; border-radius: 7px; background: var(--panel-strong); color: var(--fg); padding: 7px 9px; font: 700 10px/1 var(--mono); cursor: pointer; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 11.5px; }
.switch-row small { margin-top: 2px; color: var(--dim); font-size: 10px; }
.switch-row input { width: 35px; height: 19px; accent-color: var(--accent); }


.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--fg);
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.button:hover { background: var(--panel-soft); border-color: var(--line-strong); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 10px rgba(79, 70, 229, 0.18); }
.button.primary:hover { filter: brightness(0.95); }
.button.ghost { background: transparent; color: var(--dim); box-shadow: none; }
.button.wide { width: 100%; }
.button.small { padding: 5px 8px; font-size: 10px; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.text-button { appearance: none; border: 0; background: transparent; color: var(--accent); padding: 0; font-size: 11px; font-weight: 600; }

.detail-list, .settings-list { display: grid; gap: 11px; margin: 0; }
.detail-list div, .settings-list div { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.detail-list dt, .settings-list dt { color: var(--dim); font-size: 10.5px; }
.detail-list dd, .settings-list dd { margin: 0; overflow-wrap: anywhere; font-size: 11.5px; }
.detail-list code, .settings-list code { color: var(--accent); font-size: 10.5px; }


.mini-log-list { display: grid; }
.mini-log { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.mini-log:last-child { border-bottom: 0; }
.mini-log b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11px/1.35 var(--mono); }
.mini-log small { display: block; margin-top: 2px; color: var(--dim); font-size: 9.5px; }
.mini-log-time { color: var(--dim); text-align: right; font: 10px/1.35 var(--mono); }
.log-status { font: 700 9.5px/1.2 var(--mono); }
.log-status.success { color: var(--green); }
.log-status.error { color: var(--red); }
.log-status.running { color: var(--amber); }

#modelCatalog { margin-top: 24px; }
.catalog-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.catalog-heading h2 { margin: 4px 0 6px; font-size: 17px; }
.catalog-heading p { margin: 0; color: var(--dim); font-size: 12px; }
.catalog-total { display: inline-block; margin-left: 8px; color: var(--dim); font-size: 12px; font-weight: 400; white-space: nowrap; }
.catalog-total b { color: var(--fg); font-weight: 650; }
.catalog-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.catalog-toolbar input { flex: 1 1 260px; width: auto; min-width: 160px; max-width: 440px; min-height: 44px; }
.catalog-toolbar .button { margin-left: auto; }
.catalog-meta { display: flex; gap: 8px 20px; flex-wrap: wrap; margin: 12px 0; color: var(--dim); font-size: 12px; }
.catalog-meta b { font-weight: 500; color: var(--fg); }
.catalog-table { table-layout: fixed; min-width: 800px; }
.catalog-col-id { width: 22%; }
.catalog-col-name { width: 12%; }
.catalog-col-rate { width: 9%; }
.catalog-col-capabilities { width: 12%; }
.catalog-col-context { width: 8%; }
.catalog-col-output { width: 7%; }
.catalog-col-effort { width: 16%; }
.catalog-col-sampling { width: 8%; }
.catalog-col-actions { width: 6%; }
.catalog-table th { font: 600 12px/1.5 var(--sans); letter-spacing: 0; padding: 12px 10px; white-space: normal; }
.catalog-table td { max-width: none; padding: 12px 10px; font-size: 12px; }
.catalog-table th:nth-child(3), .catalog-table th:nth-child(5), .catalog-table th:nth-child(6), .catalog-table .catalog-centered { text-align: center; }
.catalog-id { display: flex; align-items: center; gap: 6px; min-width: 0; }
.catalog-id code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; }
.catalog-copy { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 8px; color: var(--dim); background: transparent; }
.catalog-copy:hover { background: var(--panel-strong); border-color: var(--line); color: var(--accent); }
.catalog-copy svg { width: 15px; height: 15px; }
.catalog-copy:focus-visible, .catalog-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.catalog-name { line-height: 1.6; overflow-wrap: anywhere; }
.catalog-default-mark { display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 5px; font-size: 10px; color: var(--accent); background: var(--accent-soft); white-space: nowrap; }
.catalog-capabilities, .catalog-efforts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.catalog-chip, .catalog-effort { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; line-height: 1.6; white-space: nowrap; background: var(--panel-soft); color: var(--dim); }
.catalog-chip.vision { color: color-mix(in srgb, var(--green) 55%, var(--fg)); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 25%, var(--line)); }
.catalog-chip.reasoning { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.catalog-effort { font-family: var(--mono); border-radius: 5px; }
.catalog-effort-note { margin-top: 5px; color: var(--dim); font-size: 11px; }
.catalog-window { font: 650 14px/1.5 var(--mono); white-space: nowrap; }
.catalog-unknown { color: var(--dim); }
.catalog-note { margin: 12px 0 0; color: var(--dim); font-size: 12px; line-height: 1.7; }
.catalog-table .table-empty { padding: 30px 14px; text-align: center; }
.rate-pill, .badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font: 650 9.5px/1.2 var(--mono);
  white-space: nowrap;
}
.badge { border: 1px solid var(--line); background: var(--panel-soft); color: var(--dim); }
.badge.ok { border-color: rgba(18, 183, 106, 0.2); background: var(--green-soft); color: var(--green); }
.rate-pill { background: var(--accent-soft); color: var(--accent); }
.rate-pill.free { color: color-mix(in srgb, var(--green) 55%, var(--fg)); background: var(--green-soft); }

.account-list { display: grid; gap: 9px; }
.account-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.account-identity { min-width: 0; }
.account-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.account-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-state { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 7px; font: 650 9px/1.2 var(--mono); }
.account-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.account-state.ready { color: var(--green); background: var(--green-soft); }
.account-state.cooling { color: var(--amber); background: var(--amber-soft); }
.account-state.disabled { color: var(--red); background: var(--red-soft); }
.account-state.busy { color: var(--accent); background: var(--accent-soft); }
.account-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 7px; color: var(--dim); font: 9.5px/1.4 var(--mono); }
.account-error { margin-top: 7px; color: var(--red); font-size: 10.5px; overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 6px; }

.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.analytics-grid .panel { margin-bottom: 18px; }
.distribution { display: grid; gap: 12px; }
.distribution-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.distribution-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.distribution-row span { color: var(--dim); font: 10px/1 var(--mono); }
.bar-track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--panel-strong); }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.latency-chart { height: 160px; display: flex; align-items: flex-end; gap: 3px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.latency-bar { flex: 1; min-width: 2px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: 0.8; }
.latency-bar.success { background: var(--green); }
.latency-bar.error { background: var(--red); }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.segmented button { appearance: none; border: 0; background: transparent; color: var(--dim); padding: 5px 10px; border-radius: 6px; font-size: 10.5px; font-weight: 600; }
.segmented button.active { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06); }

.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.security-note { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.security-note strong { font-size: 11.5px; }
.security-note p { margin: 7px 0 0; color: var(--dim); font-size: 11px; line-height: 1.7; }
.security-note code { color: var(--accent); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.env-grid { display: grid; grid-template-columns: minmax(240px, 0.7fr) 1fr; gap: 0; }
.env-grid > * { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.env-grid > *:nth-last-child(-n + 2) { border-bottom: 0; }
.env-grid code { color: var(--accent); }
.env-grid span { color: var(--dim); }

.search-input { width: 220px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--panel-soft); color: var(--dim); font: 700 9.5px/1.2 var(--mono); letter-spacing: 0.04em; white-space: nowrap; }
td { max-width: 310px; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-soft); }
td code { font-size: 10.5px; }
.table-empty { padding: 24px; color: var(--dim); text-align: center; }
.empty-state { display: grid; justify-items: center; gap: 7px; padding: 38px 18px; color: var(--dim); text-align: center; }
.empty-state strong { color: var(--fg); font-size: 13px; }
.empty-state p { margin: 0; font-size: 11px; }
.empty-state.compact { padding: 22px; }

.dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--fg); box-shadow: 0 30px 90px rgba(16, 24, 40, 0.25); }
.dialog::backdrop { background: rgba(16, 24, 40, 0.45); backdrop-filter: blur(3px); }
.dialog form { display: grid; gap: 15px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin: 5px 0 0; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; }
.form-error { margin: 0; color: var(--red); font-size: 11px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; max-width: min(420px, calc(100vw - 44px)); padding: 11px 14px; border-radius: 10px; background: #18201c; color: #fff; font-size: 11.5px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; }
.toast.show { opacity: 1; transform: none; }

.sidebar-backdrop { display: none; }
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .sidebar { width: 210px; flex-basis: 210px; }
  #main { padding: 20px; }
  .overview-grid { grid-template-columns: 1fr; }
  .topbar-actions .version-pill { display: none; }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; flex-basis: 260px; transform: translateX(-104%); transition: transform 0.22s ease; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.2); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(16, 24, 40, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .mobile-only { display: inline-grid !important; }
  .topbar { height: 60px; flex-basis: 60px; padding: 0 14px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p { display: none; }
  .topbar-actions .connection-pill, .topbar-actions .button.ghost { display: none; }
  #main { padding: 16px 14px 88px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; }
  .metric-card strong { font-size: 27px; }
  .analytics-grid, .settings-layout { grid-template-columns: 1fr; }
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(60px + env(safe-area-inset-bottom, 0px)); padding: 4px 6px env(safe-area-inset-bottom, 0px); align-items: center; justify-content: space-around; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(14px); }
  .mobile-nav-item { appearance: none; border: 0; background: transparent; color: var(--dim-light); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 54px; height: 50px; border-radius: 9px; font-size: 9px; font-weight: 600; }
  .mobile-nav-item.active { color: var(--accent); background: var(--accent-soft); }
}

@media (max-width: 700px) {
  .catalog-heading .button { min-height: 44px; }
  .catalog-toolbar { gap: 8px; }
  .catalog-toolbar input { flex-basis: 100%; max-width: none; width: 100%; }
  .catalog-toolbar .button { min-height: 44px; }
  .catalog-table-wrap { border: 0; border-radius: 0; overflow: visible; }
  .catalog-table { display: block; min-width: 0; width: 100%; }
  .catalog-table colgroup, .catalog-table thead { display: none; }
  .catalog-table tbody { display: grid; gap: 12px; }
  .catalog-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
  .catalog-table td { display: block; min-width: 0; padding: 0; border: 0; text-align: left !important; }
  .catalog-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--dim); font-size: 11px; }
  .catalog-table .catalog-id-cell { grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .catalog-id code { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .catalog-table td:nth-child(7) { grid-column: 1 / -1; }
  .catalog-table .table-empty { grid-column: 1 / -1; padding: 14px 0; }
  .catalog-table .table-empty::before { display: none; }
  .catalog-table tbody tr:hover td { background: transparent; }
}

@media (max-width: 620px) {
  .login-shell { grid-template-columns: 1fr; gap: 26px; padding: 28px 16px; }
  .login-story h1 { font-size: 40px; }
  .login-story > p { font-size: 13px; }
  .story-grid { gap: 22px; }
  .login-card { padding: 23px; }
  .page-intro { gap: 10px; }
  .page-intro h2 { font-size: 20px; }
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 102px; padding: 12px; }
  .metric-card strong { margin: 12px 0 5px; font-size: 24px; }
  .panel { padding: 14px 13px; }
  .account-card { grid-template-columns: 1fr; }
  .account-actions { justify-content: flex-end; }
  .mini-log { grid-template-columns: 50px minmax(0, 1fr); }
  .mini-log-time { display: none; }
  .search-input { width: 100%; }
  .button-row:has(.search-input) { width: 100%; }
  .env-grid { grid-template-columns: 1fr; }
  .env-grid > * { border-bottom: 0; }
  .env-grid span { padding-top: 0; }
  .detail-list div, .settings-list div { grid-template-columns: 80px minmax(0, 1fr); }
}

/* Management forms follow the existing panel, color and spacing system. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.form-stack { display: grid; gap: 14px; margin-top: 18px; }
.form-stack > .button { justify-self: start; }
.field > span { font-size: 12px; letter-spacing: 0.01em; line-height: 1.5; }
.field input, .field select { min-height: 44px; }
.field textarea { font-size: 14px; }
.form-feedback { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--panel-soft); color: var(--fg); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.form-feedback.is-error { color: var(--red); border: 1px solid currentColor; }
.filter-grid { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(120px, 1fr)); gap: 12px; align-items: end; }
.selection-toolbar { display: grid; gap: 12px; margin: 16px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.selection-toolbar p { margin: 0; font-size: 12px; }
.selection-toolbar .button, .pagination .button, .dialog .button, .settings-panel .button, .account-actions .button { min-height: 44px; font-size: 12px; }
.button.danger { background: var(--red-soft); color: var(--red); border-color: currentColor; }
.button.danger:hover { background: var(--red-soft); filter: brightness(0.94); }
.button.primary.danger { box-shadow: none; }
.button:disabled { cursor: not-allowed; }
.button[aria-busy="true"] { cursor: progress; }
.account-actions { flex-wrap: wrap; justify-content: flex-end; }
.account-card { align-items: start; }
.account-remark { margin: 8px 0 0; color: var(--dim); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.check-label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
.check-label input { width: 20px; height: 20px; flex: 0 0 20px; padding: 0; accent-color: var(--accent); }
.account-title .check-label { min-width: 0; }
.selector-field { border: 1px solid var(--line); border-radius: 10px; min-width: 0; padding: 12px; }
.selector-field legend { font-weight: 600; padding: 0 5px; }
.check-options { display: grid; gap: 4px; max-height: 230px; overflow: auto; }
.check-options .check-label { padding: 3px 6px; border-radius: 6px; }
.check-options .check-label:hover { background: var(--panel-soft); }
.key-list { display: grid; gap: 12px; }
.key-list .account-meta { font-size: 11px; }
.pagination { justify-content: flex-end; margin-top: 16px; font-size: 12px; }
#newKeySecret { font-family: var(--mono); font-size: 14px; }
.dialog .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
.dialog form > .muted, .dialog .form-stack > p { font-size: 13px; }
.dialog { overscroll-behavior: contain; }
@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .filter-grid { grid-template-columns: 1fr; }
  .selection-toolbar .button-row { gap: 8px; }
  .selection-toolbar .button { flex: 1 1 130px; }
  .account-actions { justify-content: flex-start; gap: 8px; }
  .key-list .account-card { grid-template-columns: 1fr; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .panel-heading { flex-wrap: wrap; }
  .dialog { padding: 18px; max-height: calc(100dvh - 24px); }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1 1 auto; }
}
/* Shared console tables: clear hierarchy, consistent numbers and row actions. */
:root { --success-text: #067647; --danger-text: #b42318; --warning-text: #b54708; }
[data-theme="dark"] { --success-text: #6ee7b7; --danger-text: #fda29b; --warning-text: #fde68a; }
body { font-size: 13px; line-height: 1.5; background: var(--bg); }
.eyebrow { font-size: 11px; letter-spacing: .1em; }
.nav-item { font-size: 12.5px; padding: 8px 10px; }
.topbar-title p { font-size: 11px; }
.button { font-size: 11.5px; }
input, select, textarea { font-size: 12px; }
.topbar-title h1 { font-size: 18px; font-weight: 750; }
.page-intro h2 { font-size: 22px; line-height: 1.5; font-weight: 750; }
.page-intro p, .small, .metric-card span, .metric-card small { font: 12px/1.6 var(--sans); }
.panel-heading h2 { font-size: 15px; line-height: 1.5; font-weight: 700; }
.text-button { font-size: 13px; min-height: 36px; }
.metric-card { padding: 14px 16px; }
.metric-card strong { font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.detail-list dt, .settings-list dt, .detail-list dd, .settings-list dd { font-size: 13px; }
.detail-list code, .settings-list code { font-size: 12px; line-height: 1.7; }
.security-note strong { font-size: 14px; }
.security-note p, .security-note ~ form .muted { font-size: 13px; }
.overview-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: 20px; }
.overview-grid > .overview-requests { margin: 0; }
.overview-connection { min-width: 0; }
.overview-connection > .panel { margin: 0; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.data-table { width: 100%; table-layout: fixed; font-size: 11.5px; line-height: 1.5; }
.data-table th { padding: 9px 12px; font: 700 9.5px/1.5 var(--sans); letter-spacing: .04em; color: var(--dim); }
.data-table td { padding: 10px 12px; max-width: none; overflow-wrap: anywhere; }
.data-table th, .data-table td { font-variant-numeric: tabular-nums; }
.data-table .numeric { text-align: right; white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.cell-primary { display: block; color: var(--fg); font-size: 11.5px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.cell-secondary { display: block; margin-top: 2px; color: var(--dim); font-size: 11px; line-height: 1.5; font-weight: 400; }
.cell-muted { color: var(--dim); font-size: 11px; }
.data-table .table-code { display: block; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 12px/1.5 var(--mono); }
.cell-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.time-cell { font: 12px/1.5 var(--mono); white-space: nowrap; }
.status-badge, .mode-pill, .code-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; font-size: 9.5px; line-height: 1.5; font-weight: 650; background: var(--panel-soft); color: var(--dim); }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.success, .account-state.ready { color: var(--success-text); background: var(--green-soft); }
.status-badge.error, .code-pill { color: var(--danger-text); background: var(--red-soft); }
.status-badge.running, .account-state.cooling { color: var(--warning-text); background: var(--amber-soft); }
.status-badge.disabled, .account-state.disabled { color: var(--dim); background: var(--panel-soft); }
.success-text { color: var(--success-text); }
.error-text { color: var(--danger-text); font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cell-details { min-width: 0; margin-top: 4px; }
.cell-details > summary { cursor: pointer; color: var(--dim); font-size: 12px; line-height: 1.6; padding: 4px 0; overflow-wrap: anywhere; }
.cell-details[open] > summary { color: var(--accent); }
.cell-details > div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); margin-top: 4px; }
.error-details > summary { color: var(--danger-text); }
.error-details[open] { min-width: 0; }
.scope-list { display: grid; gap: 6px; }
.scope-list code { font-size: 11.5px; overflow-wrap: anywhere; }
.selection-cell { width: 44px; padding: 6px !important; text-align: center !important; }
.selection-cell input { display: block; width: 18px; height: 18px; padding: 0; margin: auto; accent-color: var(--accent); }
.row-select { display: grid; place-items: center; width: 32px; min-height: 44px; cursor: pointer; }
.data-table tr.is-selected td { background: var(--accent-soft); }
.account-state { font-size: 9.5px; line-height: 1.5; padding: 3px 7px; }
.table-actions .account-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px; }
.table-actions .button { min-height: 0; padding: 4px 8px; font: 600 10px/1.5 var(--sans); white-space: nowrap; }
.table-actions-heading { text-align: center; }
.accounts-table { min-width: 880px; }
.accounts-table th:nth-child(2) { width: 220px; }
.accounts-table th:nth-child(3) { width: 90px; }
.accounts-table th:nth-child(4) { width: 112px; }
.accounts-table th:last-child { width: 190px; }
.keys-table { min-width: 980px; }
.keys-table th:first-child { width: 21%; }
.keys-table th:nth-child(2) { width: 10%; }
.keys-table th:nth-child(3), .keys-table th:nth-child(4) { width: 14%; }
.keys-table th:nth-child(5) { width: 9%; }
.keys-table th:nth-child(6) { width: 13%; }
.keys-table th:last-child { width: 19%; }
.recent-table { min-width: 860px; }
.recent-table th:first-child { width: 100px; }
.recent-table th:nth-child(2) { width: 30%; }
.recent-table th:nth-child(3) { width: 15%; }
.recent-table th:nth-child(4) { width: 14%; }
.recent-table th:nth-child(5) { width: 65px; }
.recent-table th:nth-child(6) { width: 80px; }
.recent-table th:last-child { width: 90px; }
.usage-table { min-width: 660px; }
.usage-table th:first-child { width: 38%; }
.logs-table { min-width: 1040px; }
.logs-table th:first-child { width: 100px; }
.logs-table th:nth-child(2) { width: 28%; }
.logs-table th:nth-child(3) { width: 12%; }
.logs-table th:nth-child(4) { width: 12%; }
.logs-table th:nth-child(5) { width: 65px; }
.logs-table th:nth-child(6) { width: 80px; }
.logs-table th:nth-child(7) { width: 85px; }
.logs-table-wrap { max-height: 70vh; overflow: auto; }
.data-table thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-soft); }
.management-table-wrap .table-actions { position: sticky; right: 0; z-index: 1; background: var(--panel); border-left: 1px solid var(--line); }
.management-table-wrap th:last-child { position: sticky; right: 0; z-index: 3; }
.accounts-table .selection-cell { position: sticky; left: 0; z-index: 1; background: var(--panel); }
.accounts-table td.identity-cell { position: sticky; left: 44px; z-index: 1; background: var(--panel); border-right: 1px solid var(--line); }
.accounts-table th:first-child, .accounts-table th:nth-child(2) { position: sticky; z-index: 3; background: var(--panel-soft); }
.accounts-table th:nth-child(2) { left: 44px; }
.data-table tbody tr:hover .table-actions, .accounts-table tbody tr:hover .selection-cell, .accounts-table tbody tr:hover td.identity-cell { background: var(--panel-soft); }
.catalog-table th { font: 700 9.5px/1.5 var(--sans); letter-spacing: .04em; padding: 9px 12px; }
.catalog-table td, .catalog-name { font-size: 11.5px; }
.catalog-table td { padding: 10px 12px; }
.catalog-id code { font-size: 12px; }
.catalog-chip { padding: 3px 7px; border-radius: 999px; font: 650 9.5px/1.5 var(--sans); }
.catalog-effort { padding: 2px 8px; font: 600 11px/1.4 var(--sans); }
.catalog-effort-note { font-size: 11px; line-height: 1.4; }
.catalog-default-mark { font-size: 9.5px; }
.catalog-window { font: 700 11.5px/1.5 var(--sans); }
.catalog-copy { width: 24px; height: 24px; }
.distribution-row code, .distribution-row span { font-size: 12px; }
.distribution-row > div:first-child { align-items: center; gap: 16px; }
.distribution-row { padding: 5px 0; }
.latency-chart { height: 190px; }
.segmented button { font-size: 12px; padding: 8px 13px; min-height: 40px; }
.pagination { font-size: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 700px) {
  .data-table { display: block; width: 100%; min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 12px; }
  .data-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; position: relative; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
  .data-table td { display: block; width: auto; min-width: 0; padding: 0; border: 0; text-align: left !important; }
  .data-table td::before { display: block; content: attr(data-label); margin-bottom: 5px; color: var(--dim); font-size: 12px; font-weight: 400; }
  .data-table td.identity-cell, .data-table td.model-identity-cell, .data-table td.table-actions, .logs-table td:last-child { grid-column: 1 / -1; }
  .data-table .table-code { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .management-table-wrap, .logs-table-wrap, #overviewLogsWrap { overflow: visible; max-height: none; border: 0; border-radius: 0; }
  .management-table-wrap .table-actions, .accounts-table td.identity-cell { position: static; border: 0; background: transparent; }
  .accounts-table .selection-cell { position: absolute; top: 12px; right: 12px; left: auto; width: 44px; padding: 0 !important; background: transparent; }
  .selection-cell::before { display: none !important; }
  .accounts-table .identity-cell { padding-right: 50px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .row-select { width: 44px; }
  .table-actions .account-actions { justify-content: flex-start; }
  .table-actions .button, .cell-details > summary { min-height: 44px; }
  .data-table tbody tr:hover td, .data-table tbody tr.is-selected td { background: transparent; }
  .data-table tbody tr.is-selected { border-color: var(--accent); background: var(--accent-soft); }
  .data-table .table-empty { grid-column: 1 / -1; padding: 12px 0; text-align: center !important; }
  .data-table .table-empty::before { display: none; }
  .cell-primary { font-size: 14px; }
  .page-intro h2 { font-size: 22px; }
  .metric-card { padding: 14px; }
  .filter-grid input, .filter-grid select, .search-input { font-size: 16px; }
}

/* Values taken from WorkBuddy dashboard's html[data-ui="next"] layer. */
:root { --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.panel { padding: 18px 20px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.metric-grid { gap: 12px; margin-bottom: 16px; }
.metric-card, .metric-card.dark, .metric-card.lime { min-height: 104px; background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.metric-card > span { font-size: 10.5px; font-weight: 600; color: var(--dim); }
.metric-card strong { font-size: 23px; font-weight: 750; margin: 10px 0 4px; }
.metric-card small { font-size: 10px; color: var(--dim-light); }
.accounts-table .identity-cell > .cell-primary { font-size: 14px; }
.table-wrap { border-radius: 12px; }
.button.small { font-size: 10px; padding: 4px 8px; box-shadow: none; }
.selection-toolbar .button, .pagination .button { min-height: 32px; font-size: 11.5px; }
.time-cell { font-size: 12px; }
.cell-details > summary { font-size: 11px; line-height: 1.5; }
.account-state.ready { color: #047857; }
[data-theme="dark"] .account-state.ready { color: var(--success-text); }
@media (max-width: 700px) {
  .data-table td { padding: 0; }
  .data-table td::before { font-size: 10px; }
  .cell-primary { font-size: 12px; }
  .accounts-table .identity-cell > .cell-primary { font-size: 14px; }
  .catalog-table th { white-space: normal; }
  .catalog-table td { padding: 0; }
  .panel { padding: 14px 13px; }
  .table-actions .button, .selection-toolbar .button, .pagination .button { min-height: 44px; font-size: 12px; }
}

/* Match the computed sizes measured in the deployed WorkBuddy console. */
@media (min-width: 701px) {
  .recent-table tbody tr, .logs-table tbody tr { height: 43.4px; }
}
.request-model-content { display: flex; align-items: center; gap: 8px; min-width: 0; }
.data-table .request-model-id { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 12px/1.5 var(--mono); }
.request-account, .request-key { font: 400 11px/1.5 var(--mono); }
.request-account > span, .request-key > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-id-details { flex: 0 0 auto; font: 400 11px/1.5 var(--mono); }
.request-id-details > summary { cursor: pointer; color: var(--dim); padding: 2px 0; }
.request-id-details[open] { min-width: 0; flex-shrink: 1; }
.request-id-details > code { display: block; overflow-wrap: anywhere; white-space: normal; font: inherit; }
.accounts-table .identity-cell .cell-secondary, .accounts-table .identity-cell .table-code { font-size: 11px; line-height: 1.5; }
@media (max-width: 700px) {
  .request-model-content { flex-wrap: wrap; }
  .data-table .request-model-id { white-space: normal; overflow-wrap: anywhere; }
  .request-account > span, .request-key > span { white-space: normal; overflow-wrap: anywhere; }
  .request-id-details > summary { min-height: 44px; display: flex; align-items: center; }
  .catalog-copy { width: 44px; height: 44px; }
}

/* Full request records follow WorkBuddy's field order and numeric alignment. */
.requests-table { table-layout: auto; min-width: 1170px; }
.requests-table th { width: auto !important; white-space: nowrap; }
.requests-table td { white-space: nowrap; }
.requests-table .request-model-content { width: 180px; min-width: 0; max-width: 180px; }
.requests-table .request-account > span, .requests-table .request-key > span { max-width: 110px; }
.requests-table th:nth-child(n + 8) { text-align: right; }
.logs-table th:last-child { text-align: left; }
.request-metrics-note { font-size: 11px; line-height: 1.5; margin: 10px 0 0; }
.estimated-metric { text-decoration: underline dotted; text-underline-offset: 3px; }
@media (max-width: 700px) {
  .requests-table { min-width: 0; }
  .requests-table td { white-space: normal; }
  .requests-table .request-model-content { width: auto; min-width: 0; max-width: none; }
  .requests-table .request-account > span, .requests-table .request-key > span { max-width: none; }
}

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

.qr-dialog { max-width: 430px; }
.qr-stage { min-height: 300px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; text-align: center; }
.qr-stage img { display: block; width: min(248px, 100%); height: auto; aspect-ratio: 1; background: #fff; padding: 8px; border-radius: 8px; }
.qr-stage img[hidden] { display: none; }
.benefit-summary { min-width: 130px; max-width: 220px; }
.benefit-summary .cell-secondary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.benefit-result { padding: 12px 0; border-bottom: 1px solid var(--line); }
.automation-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 18px; align-items: start; }
.automation-layout > .panel { margin: 0; }
.automation-run-actions { margin-top: 16px; flex-wrap: wrap; }
.automation-details { margin-top: 24px; }
.automation-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr); gap: 12px; max-width: 680px; margin-bottom: 16px; }
.automation-table { min-width: 900px; }
.automation-table th:nth-child(1) { width: 19%; }
.automation-table th:nth-child(2) { width: 11%; }
.automation-table th:nth-child(3) { width: 13%; }
.automation-table th:nth-child(4) { width: 14%; }
.automation-table th:nth-child(5) { width: 14%; }
.automation-table th:nth-child(6) { width: 17%; }
.automation-table th:nth-child(7) { width: 12%; }
.quota-content { max-height: 60vh; overflow: auto; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.filter-bar .field { flex: 1 1 140px; min-width: 0; }
.filter-bar .form-feedback { flex-basis: 100%; }
#routingForm { margin-top: 12px; }
#historyUsageRows code { overflow-wrap: anywhere; white-space: normal; }
#automationForm .check-option { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#automationForm input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: 0 0 16px; }
#automationAccounts { display: grid; grid-template-columns: minmax(0, 1fr); max-height: 180px; overflow-y: auto; overflow-x: hidden; padding: 4px 0; }
@media (max-width: 700px) {
  .automation-layout, .automation-filters { grid-template-columns: minmax(0, 1fr); }
  .automation-table { min-width: 0; }
  .mobile-nav-item { min-width: 0; flex: 1; font-size: 11px; }
  .benefit-summary { max-width: 100%; }
  .benefit-summary .cell-secondary { white-space: normal; overflow-wrap: anywhere; }
}
