:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --ink: #111827;
  --muted: #667085;
  --line: #d7dde8;
  --accent: #0f766e;
  --accent-2: #0f766e;
  --warn: #b45309;
  --bad: #b42318;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #121a23;
  --panel-soft: #17212b;
  --ink: #e5edf5;
  --muted: #9aa7b5;
  --line: #263445;
  --warn: #f59e0b;
  --bad: #f97066;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
body.auth-boot .topbar,
body.auth-boot main,
body.auth-needed .topbar,
body.auth-needed main { display: none; }
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--bg);
}
.auth-screen[hidden] { display: none; }
.auth-panel {
  width: min(960px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.auth-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 40px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 42%),
    var(--panel-soft);
}
.auth-copy::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 100%;
  background: var(--accent);
}
.auth-kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
  text-transform: uppercase;
}
.auth-copy h1 {
  max-width: 520px;
  margin: 0;
  font-size: 38px;
  line-height: 1.08;
  font-weight: 780;
}
.auth-copy p {
  max-width: 560px;
  margin: 0;
  font-size: 16px;
}
.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 40px;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
.login-card h2 {
  font-size: 22px;
  margin-bottom: 6px;
}
.login-card p {
  margin: 0;
  font-size: 13px;
}
.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}
.login-card input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
  outline: none;
}
.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.primary-action {
  width: 100%;
  height: 42px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.primary-action:hover {
  color: #fff;
  border-color: var(--accent-2);
  filter: brightness(0.96);
}
.primary-action:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
.login-error {
  min-height: 20px;
  color: var(--bad);
  font-size: 13px;
  line-height: 1.4;
}
.session-user {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.topbar {
  min-height: 88px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
h1 { margin: 0; font-size: 24px; font-weight: 760; letter-spacing: 0; }
p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; }
button, .theme-picker {
  height: 36px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  border-radius: 7px;
}
button { padding: 0 14px; cursor: pointer; font-weight: 650; }
button:hover { border-color: var(--accent); color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.theme-picker { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); font-size: 13px; }
.theme-picker input { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; }
main { max-width: 1440px; margin: 0 auto; padding: 24px; }
.status-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.status-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.status-card { padding: 16px; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; }
.label, .panel-head span { color: var(--muted); font-size: 13px; }
.status-card strong { font-size: 22px; line-height: 1.2; }
.status-card small { color: var(--muted); overflow-wrap: anywhere; line-height: 1.35; }
.ok { color: var(--accent); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.panel { margin-top: 18px; overflow: hidden; }
.panel-head { padding: 16px 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 15px; }
.table-wrap { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 1120px; table-layout: fixed; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.4; overflow-wrap: anywhere; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; background: var(--panel-soft); }
td code, code { font-weight: 740; color: var(--accent-2); word-break: keep-all; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.production, .badge.passed, .badge.production-commercial { background: rgba(16, 185, 129, 0.14); color: #059669; }
.badge.enabled, .badge.route-opened, .badge.beta-commercial { background: rgba(245, 158, 11, 0.14); color: var(--warn); }
.badge.not_supported, .badge.not-tested, .badge.blocked { background: rgba(244, 63, 94, 0.13); color: var(--bad); }
.badge.muted { background: var(--panel-soft); color: var(--muted); border: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.project { border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-height: 190px; background: var(--panel-soft); }
.project h3 { margin: 0 0 8px; font-size: 16px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.langs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.timeline { padding: 6px 18px 18px; }
.run { padding: 12px 0; border-bottom: 1px solid var(--line); }
.run:last-child { border-bottom: 0; }
.run strong { display: block; margin-bottom: 5px; }
.run pre { margin: 8px 0 0; padding: 10px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; font-size: 12px; }
.eval-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 420px; }
.eval-cell small { display: block; width: 100%; color: var(--muted); line-height: 1.35; }
.score { font-size: 18px; }
.gap { color: var(--muted); line-height: 1.35; margin: 2px 0; }
.lang-cell { display: grid; gap: 4px; min-width: 104px; }
.lang-cell code { font-size: 15px; font-weight: 760; color: var(--accent-2); }
.lang-cell span { color: var(--ink); font-size: 13px; line-height: 1.25; }

.deployment { padding: 16px; display: grid; gap: 16px; }
.deploy-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.deploy-summary > div { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); padding: 12px; display: grid; gap: 5px; min-height: 92px; }
.deploy-summary strong { font-size: 18px; overflow-wrap: anywhere; }
.deploy-summary small { color: var(--muted); line-height: 1.35; }
.deploy-section { display: grid; gap: 10px; }
.deploy-cards, .node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.deploy-card, .node-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); padding: 14px; display: grid; gap: 12px; align-content: start; }
.deploy-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deploy-title span { color: var(--muted); overflow-wrap: anywhere; }
dl { margin: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 7px 12px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.gpu-line { color: var(--ink); font-weight: 680; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips span { border: 1px solid var(--line); background: var(--panel); border-radius: 7px; padding: 5px 8px; font-size: 12px; color: var(--muted); }
.data-list { display: grid; gap: 5px; }
.data-list small { color: var(--muted); overflow-wrap: anywhere; line-height: 1.35; }

.score-model { padding: 16px; }
.formula { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); color: var(--ink); margin-bottom: 14px; overflow-wrap: anywhere; }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.model-block { min-width: 0; }
.model-block.wide { grid-column: 1 / -1; }
.metric-row, .target-row, .unit-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--panel-soft); }
.metric-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.metric-row small { grid-column: 1 / -1; color: var(--muted); line-height: 1.35; }
.target-row { display: grid; grid-template-columns: minmax(74px, auto) minmax(64px, 112px) minmax(0, 1fr); align-items: center; gap: 10px; }
.target-row span, .target-row strong { overflow-wrap: anywhere; }
.unit-row { display: grid; grid-template-columns: minmax(220px, 0.55fr) 88px minmax(0, 1fr); gap: 10px; align-items: start; }
.unit-row code { white-space: normal; word-break: normal; overflow-wrap: anywhere; }
.unit-row span { color: var(--accent); font-weight: 740; }
.unit-row small { color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.badge.p0 { background: rgba(244, 63, 94, 0.13); color: var(--bad); }
.badge.p1 { background: rgba(245, 158, 11, 0.14); color: var(--warn); }
.badge.p2 { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.badge.core { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge.enhanced { background: rgba(245, 158, 11, 0.14); color: var(--warn); }
.badge.planned { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }

.voice-grid { padding: 16px; display: grid; gap: 14px; }
.vi-summary { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--panel-soft); }
.vi-summary strong { display: block; margin-bottom: 6px; }
.vi-summary small { color: var(--muted); }
.vi-section h3 { margin-bottom: 8px; font-size: 14px; color: var(--muted); font-weight: 760; }
.vi-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vi-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 10px 13px; min-height: 0; display: grid; gap: 10px; align-content: start; background: var(--panel-soft); }
.vi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--line); }
.vi-card.priority-core::before { background: var(--accent); }
.vi-card.priority-enhanced::before { background: var(--warn); }
.vi-card.priority-planned::before { background: var(--muted); }
.vi-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vi-title strong { min-width: 0; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.vi-card-badges { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; flex: 0 0 auto; max-width: 44%; }
.vi-card .badge { min-height: 20px; padding: 1px 7px; font-size: 11px; }
.vi-facts { display: grid; gap: 6px; }
.vi-facts div { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; align-items: start; }
.vi-facts span { color: var(--muted); font-size: 12px; font-weight: 760; line-height: 1.35; }
.vi-card small, .api-row small { color: var(--muted); line-height: 1.35; }
.vi-facts small { font-size: 13px; overflow-wrap: anywhere; }
.api-row { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--panel-soft); }
.api-row small { grid-column: 2 / -1; }

.gate-grid, .benchmark-db { padding: 16px; }
.gate-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); margin-bottom: 12px; }
.gate-summary span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.gate-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gate-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; align-content: start; min-height: 168px; background: var(--panel-soft); }
.gate-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gate-lang { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.gate-lang code { font-size: 15px; color: var(--accent-2); font-weight: 760; }
.gate-lang span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.gate-metrics { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; }
.gate-metrics span { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--panel); }
.blocker { color: var(--bad); line-height: 1.35; }
.warning { color: var(--warn); line-height: 1.35; }
.db-state { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); margin-bottom: 12px; }
.table-wrap.compact table { min-width: 840px; }
.table-wrap.compact th, .table-wrap.compact td { padding: 9px 10px; }

.primary-inline {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.primary-inline:hover { border-color: var(--accent); color: #fff; filter: brightness(0.96); }
.public-doc-entry { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); border-radius: 7px; background: color-mix(in srgb, var(--accent) 9%, var(--panel)); color: var(--accent); font-size: 13px; font-weight: 720; }
.public-doc-entry:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.public-doc-entry span { font-size: 15px; }
.tenant-head-actions { display: flex !important; align-items: center; gap: 8px !important; }
.button-link { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); color: var(--ink); font-size: 13px; font-weight: 650; }
.button-link:hover { border-color: var(--accent); color: var(--accent); }
.tenant-panel-head > div { display: grid; gap: 5px; }
.tenant-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px 16px 0; }
.tenant-summary article { min-width: 0; display: grid; gap: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.tenant-summary span, .tenant-summary small { color: var(--muted); font-size: 12px; }
.tenant-summary strong { font-size: 19px; overflow-wrap: anywhere; }
.tenant-toolbar { display: flex; align-items: flex-end; gap: 10px; padding: 14px 16px; }
.tenant-toolbar label, .admin-form label, .key-create-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 680; }
.tenant-toolbar label span, .admin-form label > span, .key-create-form label span { line-height: 1.2; }
.tenant-toolbar input, .tenant-toolbar select, .admin-form input, .key-create-form input, .key-maintain input {
  height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: var(--panel-soft); color: var(--ink); font: inherit; outline: none;
}
.tenant-toolbar input:focus, .tenant-toolbar select:focus, .admin-form input:focus, .key-create-form input:focus, .key-maintain input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.tenant-toolbar select { min-width: 142px; }
.tenant-search { flex: 1 1 280px; max-width: 420px; }
.tenant-table { min-width: 1180px; }
.tenant-table th:nth-child(1) { width: 15%; }
.tenant-table th:nth-child(2) { width: 10%; }
.tenant-table th:nth-child(3) { width: 10%; }
.tenant-table th:nth-child(4) { width: 9%; }
.tenant-table th:nth-child(5) { width: 11%; }
.tenant-table th:nth-child(6) { width: 11%; }
.tenant-table th:nth-child(7) { width: 18%; }
.tenant-table th:nth-child(8) { width: 16%; }
.tenant-table td > small, .tenant-table td > span + small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.tenant-name { display: grid; gap: 4px; }
.tenant-name strong { font-size: 14px; }
.tenant-name code { font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions button, .key-maintain button { height: 30px; padding: 0 9px; font-size: 12px; }
.danger-action { color: var(--bad); }
.danger-action:hover { color: var(--bad); border-color: var(--bad); }
.tenant-empty { padding: 24px; color: var(--muted); text-align: center; }
.tenant-db-state { margin: 16px 16px 0; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--bad) 7%, var(--panel-soft)); font-size: 13px; overflow-wrap: anywhere; }

.admin-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 42px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28); }
.admin-dialog::backdrop { background: rgba(9, 16, 25, 0.58); backdrop-filter: blur(2px); }
.admin-form { display: grid; gap: 16px; margin: 0; padding: 0 20px 20px; }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.admin-form .dialog-head { margin: 0 -20px; }
.dialog-head > div { display: grid; gap: 3px; }
.dialog-kicker { color: var(--accent); font-size: 11px; font-weight: 780; letter-spacing: 0.08em; text-transform: uppercase; }
.icon-button { width: 34px; padding: 0; font-size: 22px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-form label small { color: var(--muted); font-weight: 400; line-height: 1.35; }
.check-row { display: flex !important; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.check-row input { width: 17px; height: 17px; padding: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.form-error { min-height: 18px; color: var(--bad); font-size: 13px; line-height: 1.35; }
.key-dialog { padding-bottom: 18px; }
.key-dialog > .form-error, .key-dialog > .dialog-actions, .key-dialog > .key-list, .key-dialog > .key-create-form, .key-dialog > .new-key-reveal { margin-left: 20px; margin-right: 20px; }
.new-key-reveal { display: grid; gap: 8px; margin-top: 16px; padding: 12px; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--warn) 8%, var(--panel-soft)); }
.new-key-reveal[hidden] { display: none; }
.new-key-reveal > div { display: flex; align-items: center; gap: 8px; }
.new-key-reveal code { flex: 1; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.key-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 16px; }
.key-list { display: grid; gap: 10px; margin-top: 10px; }
.key-row { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.key-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.key-row-head > div { min-width: 0; display: grid; gap: 3px; }
.key-row-head code { font-size: 11px; }
.key-meta { color: var(--muted); font-size: 12px; }
.key-maintain { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; align-items: center; }

@media (max-width: 1100px) {
  .status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards, .vi-cards, .gate-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-grid, .deploy-summary, .deploy-cards, .node-grid { grid-template-columns: 1fr; }
  .tenant-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .auth-screen { padding: 16px; align-items: stretch; }
  .auth-panel {
    min-height: auto;
    grid-template-columns: 1fr;
  }
  .auth-copy {
    min-height: 190px;
    padding: 28px 24px;
  }
  .auth-copy h1 { font-size: 30px; }
  .auth-copy p { font-size: 14px; }
  .login-card {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px;
  }
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px; }
  .top-actions { justify-content: flex-start; }
  main { padding: 14px; }
  .status-grid, .cards, .vi-cards, .gate-cards, .tenant-summary { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .tenant-head-actions { width: 100%; }
  .tenant-head-actions .button-link, .tenant-head-actions button { flex: 1; justify-content: center; }
  .tenant-toolbar { align-items: stretch; flex-direction: column; }
  .tenant-search { max-width: none; }
  .form-grid, .key-create-form, .key-maintain { grid-template-columns: 1fr; }
  .target-row, .unit-row, .api-row, dl { grid-template-columns: 1fr; }
  .api-row small { grid-column: auto; }
}
