:root {
  color-scheme: dark;
  --bg: #070b12;
  --bg-2: #0b1220;
  --panel: rgba(13, 22, 35, 0.86);
  --panel-2: rgba(10, 18, 30, 0.94);
  --line: rgba(122, 184, 255, 0.18);
  --line-strong: rgba(122, 184, 255, 0.32);
  --text: #eef6ff;
  --muted: #8fa3ba;
  --dim: #64758a;
  --cyan: #5bd7ff;
  --green: #50e3a4;
  --amber: #ffca6b;
  --red: #ff6b7a;
  --blue: #2f7dff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(47, 125, 255, 0.18), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(80, 227, 164, 0.09), transparent 22%),
    linear-gradient(180deg, #08111e 0%, var(--bg) 58%, #05070c 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(122, 184, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 184, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(91, 215, 255, 0.72);
  outline-offset: 2px;
}

.app-frame {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(5, 10, 18, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 18px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(91, 215, 255, 0.54);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(91, 215, 255, 0.16), rgba(80, 227, 164, 0.08));
  color: var(--cyan);
  font-weight: 800;
}

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

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.secondary-nav {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.secondary-nav a {
  min-height: 32px;
  padding: 6px 10px;
  color: var(--dim);
  font-size: 12px;
}

.secondary-nav a::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(91, 215, 255, 0.36);
}

.side-nav a:hover,
.side-nav a.active {
  border-color: var(--line);
  background: rgba(91, 215, 255, 0.08);
  color: var(--text);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  color: var(--cyan);
}

.main-surface {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 22px 28px 44px;
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.command-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 100%);
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 13, 22, 0.72);
  color: var(--dim);
}

.control-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.boundary-badge,
.collector-time {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.boundary-badge {
  border-color: rgba(80, 227, 164, 0.38);
  color: var(--green);
  gap: 7px;
}

.boundary-badge strong,
.boundary-badge span {
  display: inline-block;
}

.boundary-badge strong {
  color: var(--green);
  font-size: 12px;
}

.boundary-badge span {
  color: var(--muted);
}

.boundary-secure {
  border-color: rgba(80, 227, 164, 0.46);
  background: rgba(80, 227, 164, 0.07);
}

.logout-form button,
.action-form button {
  border: 1px solid rgba(91, 215, 255, 0.44);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(91, 215, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.logout-form button:hover,
.action-form button:hover,
.login-form button:hover {
  border-color: rgba(91, 215, 255, 0.68);
  background: rgba(91, 215, 255, 0.16);
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
}

.hero-copy,
.page-head,
.panel,
.signal-card,
.metric,
.login-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 28, 44, 0.88), rgba(9, 16, 27, 0.88));
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.26);
}

.hero-copy,
.page-head {
  padding: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.12;
}

h2 {
  font-size: 18px;
}

p,
.muted {
  color: var(--muted);
}

.hero-copy p:last-child,
.page-head p:last-child {
  margin-top: 10px;
  max-width: 760px;
}

.health-orb {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle, rgba(91, 215, 255, 0.2), transparent 58%),
    rgba(8, 15, 25, 0.86);
}

.health-orb span {
  color: var(--muted);
  font-size: 13px;
}

.health-orb strong {
  margin-top: 8px;
  color: var(--green);
  font-size: 24px;
  text-transform: uppercase;
}

.health-warn strong,
.status-failed,
.status-needs_manual_intervention {
  color: var(--red);
}

.health-caution strong {
  color: var(--amber);
}

.signal-strip,
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

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

.signal-card,
.metric {
  min-height: 92px;
  padding: 16px;
}

.signal-card span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.signal-card strong,
.metric strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 25px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.mission-control {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.5fr) minmax(260px, 0.9fr);
  gap: 16px;
}

.panel {
  margin-top: 18px;
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  min-width: 0;
}

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

.section-head a,
.collector-list a,
.action-form a {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.button-secondary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: rgba(3, 8, 15, 0.32);
}

.attention-list,
.boundary-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attention-list li,
.boundary-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(3, 8, 15, 0.36);
  color: var(--text);
}

.assistant-panel {
  border-color: rgba(91, 215, 255, 0.28);
}

.assistant-alert {
  border-color: rgba(255, 107, 122, 0.36);
}

.assistant-waiting {
  border-color: rgba(255, 202, 107, 0.36);
}

.assistant-status {
  display: grid;
  gap: 14px;
}

.assistant-status > strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.agent-focus-panel {
  border-color: rgba(91, 215, 255, 0.34);
}

.agent-focus-list {
  display: grid;
  gap: 9px;
}

.agent-focus-row {
  display: grid;
  grid-template-columns: 94px minmax(90px, 0.7fr) minmax(120px, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(3, 8, 15, 0.34);
  text-decoration: none;
}

.agent-focus-row strong,
.agent-focus-row span,
.agent-focus-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-focus-row strong {
  color: var(--text);
}

.agent-focus-row > span:not(.status-pill) {
  color: var(--muted);
  font-size: 13px;
}

.agent-focus-row small {
  grid-column: 2 / -1;
  color: var(--dim);
  font-size: 12px;
}

.alert-slot {
  border-color: rgba(91, 215, 255, 0.28);
}

.alert-critical {
  border-color: rgba(255, 107, 122, 0.42);
}

.alert-warning {
  border-color: rgba(255, 202, 107, 0.42);
}

.alert-calm {
  border-color: rgba(80, 227, 164, 0.34);
}

.alert-primary {
  display: grid;
  gap: 8px;
}

.alert-primary strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.alert-primary span,
.alert-list span {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.alert-list {
  margin-top: 14px;
}

.alert-list a {
  display: block;
  text-decoration: none;
}

.alert-list strong {
  color: var(--text);
  font-size: 13px;
}

.mini-metrics,
.snapshot-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-metrics div,
.snapshot-meta div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(3, 8, 15, 0.28);
}

.mini-metrics span,
.snapshot-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.mini-metrics strong,
.snapshot-meta dd {
  display: block;
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.backup-status {
  display: grid;
  gap: 8px;
}

.backup-status strong {
  color: var(--green);
  font-size: 28px;
  text-transform: uppercase;
}

.backup-status span {
  color: var(--muted);
}

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

.module-grid a {
  display: grid;
  gap: 7px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(3, 8, 15, 0.34);
  text-decoration: none;
}

.module-grid a:hover,
.lane-card:hover,
.agent-focus-row:hover {
  border-color: rgba(91, 215, 255, 0.38);
  background: rgba(91, 215, 255, 0.07);
}

.module-grid span {
  color: var(--cyan);
  font-size: 22px;
}

.module-grid strong {
  font-size: 15px;
}

.module-grid small {
  color: var(--muted);
}

.module-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.module-detail-card {
  min-height: 150px;
}

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

.model-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(3, 8, 15, 0.34);
}

.model-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.model-card-head > div {
  min-width: 0;
}

.model-actions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.model-action-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.switchboard-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.compact-meta {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.compact-meta div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
}

.compact-meta dt,
.compact-meta dd {
  margin: 0;
  min-width: 0;
}

.compact-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-meta dd {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.detail-dot {
  display: block;
  width: 8px;
  height: 8px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(80, 227, 164, 0.72);
}

.path-note {
  margin-top: 14px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.rollback-backups {
  margin-top: 16px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.json-block {
  overflow: auto;
  max-height: 420px;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(3, 8, 15, 0.42);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid rgba(91, 215, 255, 0.34);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(91, 215, 255, 0.08);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

.status-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.status-table th,
.status-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  white-space: nowrap;
}

.status-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-table a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}

.status-table .path-cell {
  max-width: 360px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.status-pill {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-ok,
.status-active,
.status-fresh,
.status-idle,
.status-completed {
  border-color: rgba(80, 227, 164, 0.42);
  color: var(--green);
}

.status-degraded,
.status-stale,
.status-unknown,
.status-waiting_tool,
.status-waiting_user,
.status-waiting_approval,
.status-waiting_confirm,
.status-executing {
  border-color: rgba(255, 202, 107, 0.42);
  color: var(--amber);
}

.status-working {
  border-color: rgba(91, 215, 255, 0.42);
  color: var(--cyan);
}

.status-offline,
.status-stuck,
.status-interrupted {
  border-color: rgba(255, 107, 122, 0.42);
  color: var(--red);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 380px);
  padding: 26px;
}

.login-panel h1 {
  font-size: 28px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(3, 8, 15, 0.42);
  color: var(--text);
  font: inherit;
}

.login-form button {
  border: 1px solid rgba(91, 215, 255, 0.52);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(91, 215, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.login-error {
  margin-top: 12px;
  color: var(--red);
}

.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.nav-tabs a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(3, 8, 15, 0.28);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-tabs a.active {
  border-color: rgba(91, 215, 255, 0.46);
  color: var(--cyan);
}

.collector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.runtime-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.runtime-legend span {
  border: 1px solid rgba(132, 162, 197, 0.2);
  border-radius: 8px;
  background: rgba(7, 13, 22, 0.46);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 7px 9px;
}

.runtime-legend strong {
  color: var(--text);
  margin-right: 5px;
}

.agent-command-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(320px, 1.15fr);
  gap: 14px;
  margin: 0 0 16px;
}

.switchboard-control-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(260px, 0.9fr);
  gap: 14px;
  margin: 0 0 16px;
}

.action-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.system-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.agent-lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(7, 13, 22, 0.42);
}

.lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.lane-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.lane-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
  text-align: right;
}

.lane-list {
  display: grid;
  gap: 9px;
}

.lane-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(132, 162, 197, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(3, 8, 15, 0.36);
  text-decoration: none;
}

.lane-card strong,
.lane-card span,
.lane-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-card strong {
  color: var(--text);
}

.lane-card small,
.lane-card span:not(.status-pill) {
  color: var(--muted);
  font-size: 12px;
}

.lane-attention {
  border-color: rgba(255, 202, 107, 0.32);
}

.lane-stuck,
.lane-failed,
.lane-offline,
.lane-interrupted {
  border-color: rgba(255, 107, 122, 0.42);
}

.lane-working {
  border-color: rgba(91, 215, 255, 0.32);
}

.lane-routes {
  border-color: rgba(80, 227, 164, 0.26);
}

.compact-lane-list {
  max-height: 320px;
  overflow: auto;
}

.matrix-head {
  margin-top: 18px;
}

.blocker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.blocker-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 13, 22, 0.46);
}

.blocker-card span {
  color: var(--muted);
  font-size: 12px;
}

.blocker-card strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
}

.blocker-card p {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.blocker-stuck,
.blocker-failed,
.blocker-offline,
.blocker-interrupted {
  border-color: rgba(255, 107, 122, 0.42);
}

.blocker-working {
  border-color: rgba(91, 215, 255, 0.42);
}

.blocker-waiting_user,
.blocker-waiting_tool {
  border-color: rgba(255, 202, 107, 0.42);
}

.action-zone p {
  min-height: 58px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.action-zone-form {
  margin-top: 14px;
}

.action-zone-read {
  border-color: rgba(80, 227, 164, 0.34);
}

.action-zone-plan {
  border-color: rgba(91, 215, 255, 0.34);
}

.action-zone-recovery {
  border-color: rgba(255, 202, 107, 0.36);
}

.action-zone-danger {
  border-color: rgba(255, 107, 122, 0.38);
}

.action-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-form-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 6px;
}

.action-form input,
.action-form select {
  width: 100%;
  background: rgba(9, 18, 32, 0.88);
  border: 1px solid rgba(132, 162, 197, 0.25);
  border-radius: 8px;
  color: var(--text);
  min-height: 38px;
  padding: 0 10px;
}

.action-form .checkbox-line {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 38px;
}

.action-form .checkbox-line input {
  min-height: auto;
}

@media (max-width: 1100px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-hero,
  .mission-control,
  .overview-grid,
  .module-detail-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .signal-strip,
  .grid,
  .module-grid,
  .model-grid,
  .blocker-grid,
  .agent-command-grid,
  .switchboard-control-grid,
  .action-command-grid,
  .system-control-grid,
  .action-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-action-form {
    grid-template-columns: 1fr;
  }

  .switchboard-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .main-surface {
    padding: 18px;
  }

  .hero-copy,
  .page-head,
  .panel {
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 17px;
  }

  .control-bar,
  .control-actions,
  .section-head,
  .model-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .command-box,
  .boundary-badge,
  .collector-time,
  .logout-form button,
  .action-form button {
    width: 100%;
  }

  .side-nav,
  .signal-strip,
  .grid,
  .mini-metrics,
  .snapshot-meta,
  .module-grid,
  .model-grid,
  .blocker-grid,
  .agent-command-grid,
  .switchboard-control-grid,
  .action-command-grid,
  .system-control-grid,
  .action-form-grid {
    grid-template-columns: 1fr;
  }

  .agent-focus-row {
    grid-template-columns: 1fr;
  }

  .agent-focus-row small {
    grid-column: auto;
  }

  .lane-head {
    align-items: flex-start;
  }

  .status-table {
    min-width: 680px;
  }

  .switchboard-form {
    grid-template-columns: 1fr;
  }
}
