:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f2f2f0;
  --surface-raised: #ffffff;
  --ink: #111111;
  --ink-2: #5d5d5d;
  --ink-3: #9e9e9e;
  --line: #e3e3e0;
  --line-strong: #c9c9c4;
  --accent: #111111;
  --accent-ink: #ffffff;
  --positive: #292929;
  --positive-bg: #e9e9e6;
  --attention: #5d5d5d;
  --attention-bg: #eeeeeb;
  --danger: #111111;
  --danger-bg: #e3e3e0;
  --shadow: 0 18px 50px rgba(24, 24, 20, 0.08);
  --sidebar: 208px;
  --rail: 264px;
}

.auth-page { min-height: 100vh; background: var(--bg); color: var(--ink); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.auth-panel { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; padding: clamp(32px, 8vw, 112px); border-right: 1px solid var(--line); }
.auth-brand { position: absolute; top: 28px; left: clamp(32px, 8vw, 112px); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.auth-panel h1 { max-width: 620px; margin: 10px 0 16px; font-size: 24px; font-weight: 500; }
.auth-copy { max-width: 560px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.auth-rules { width: min(100%, 560px); margin: 36px 0 22px; border-top: 1px solid var(--line); }
.auth-rules > div { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.auth-rules span { color: var(--ink-3); }
.auth-rules strong { font-weight: 500; }
.auth-button { width: fit-content; min-width: 210px; justify-content: space-between; }
.auth-error { width: min(100%, 560px); margin-top: 16px; color: var(--danger); font-size: 13px; }
.auth-footnote { max-width: 560px; margin-top: 24px; color: var(--ink-3); font-size: 12px; line-height: 1.55; }
.auth-aside { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 88px); background: var(--surface-soft); }
.auth-aside ol { margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.auth-aside li { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.auth-aside li > span { color: var(--ink-3); font-size: 12px; }
.auth-aside strong { font-size: 14px; font-weight: 500; }
.auth-aside p { margin: 5px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
@media (max-width: 720px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { min-height: 76vh; padding: 96px 24px 48px; border-right: 0; }
  .auth-brand { left: 24px; }
  .auth-aside { padding: 44px 24px; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --surface: #111111;
    --surface-soft: #1b1b1b;
    --surface-raised: #161616;
    --ink: #f4f4f1;
    --ink-2: #aaaaa5;
    --ink-3: #70706c;
    --line: #2b2b2b;
    --line-strong: #444442;
    --accent: #efefec;
    --accent-ink: #111111;
    --positive: #f0f0ec;
    --positive-bg: #252525;
    --attention: #b0b0aa;
    --attention-bg: #242424;
    --danger: #ffffff;
    --danger-bg: #2d2d2d;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  }
}

:root[data-theme="dark"] {
  --bg: #111111;
  --surface: #111111;
  --surface-soft: #1b1b1b;
  --surface-raised: #161616;
  --ink: #f4f4f1;
  --ink-2: #aaaaa5;
  --ink-3: #70706c;
  --line: #2b2b2b;
  --line-strong: #444442;
  --accent: #efefec;
  --accent-ink: #111111;
  --positive: #f0f0ec;
  --positive-bg: #252525;
  --attention: #b0b0aa;
  --attention-bg: #242424;
  --danger: #ffffff;
  --danger-bg: #2d2d2d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f2f2f0;
  --surface-raised: #ffffff;
  --ink: #111111;
  --ink-2: #5d5d5d;
  --ink-3: #9e9e9e;
  --line: #e3e3e0;
  --line-strong: #c9c9c4;
  --accent: #111111;
  --accent-ink: #ffffff;
  --positive: #292929;
  --positive-bg: #e9e9e6;
  --attention: #5d5d5d;
  --attention-bg: #eeeeeb;
  --danger: #111111;
  --danger-bg: #e3e3e0;
  --shadow: 0 18px 50px rgba(24, 24, 20, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.15px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; letter-spacing: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(520px, 1fr) var(--rail); height: 100vh; }
.sidebar, .context-rail { min-height: 0; background: var(--surface); }
.sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px 12px; z-index: 30; }
.brand-row { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding: 0 5px 0 4px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.brand-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--accent-ink); background: var(--accent); font-size: 12px; font-weight: 500; }
.live-dot { display: flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 12px; }
.live-dot i, .pulse-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 3px var(--positive-bg); }
.nav-groups { flex: 1; overflow-y: auto; padding: 22px 0; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-label, .eyebrow, .overline { margin: 0; color: var(--ink-3); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.35px; }
.nav-label { padding: 0 9px 7px; }
.nav-item { display: flex; align-items: center; min-height: 34px; gap: 10px; padding: 0 9px; border-radius: 8px; color: var(--ink-2); font-size: 13px; transition: background 120ms ease, color 120ms ease; }
.nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item.active { background: var(--surface-soft); color: var(--ink); font-weight: 500; }
.nav-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; color: currentColor; font-size: 14px; font-style: normal; }
.nav-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; color: var(--ink-3); background: var(--bg); font-size: 12px; }
.nav-count.attention { color: var(--attention); background: var(--attention-bg); }
.sidebar-foot { display: grid; gap: 8px; }
.environment-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.environment-card div { display: grid; gap: 2px; }
.environment-card strong { font-size: 13px; font-weight: 500; }
.account-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 9px; width: 100%; padding: 7px 5px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.account-row:hover { background: var(--surface-soft); }
.avatar, .agent-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); font-size: 12px; font-weight: 500; }
.account-row span:nth-child(2) { display: grid; gap: 1px; min-width: 0; }
.account-row strong, .account-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row strong { font-size: 13px; font-weight: 500; }
.account-row small, .more { color: var(--ink-3); font-size: 12px; }

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.topbar { height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); z-index: 20; }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 180px; color: var(--ink-3); font-size: 12px; }
.breadcrumb b { font-weight: 400; color: var(--line-strong); }
.breadcrumb strong { color: var(--ink-2); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.icon-button, .search-button, .filter-button { border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; }
.icon-button:hover, .search-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.theme-button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; transition: background 140ms ease; }
.theme-button:hover { background: var(--surface-soft); }
.theme-button:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.theme-symbol { display: grid; width: 20px; height: 20px; place-items: center; color: var(--ink); }
.theme-symbol__icon { grid-area: 1 / 1; width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; transition: opacity 140ms ease, transform 180ms ease; }
.theme-symbol__sun { opacity: 1; transform: scale(1) rotate(0deg); }
.theme-symbol__moon { opacity: 0; transform: scale(.72) rotate(-12deg); }
:root[data-theme="dark"] .theme-symbol__sun { opacity: 0; transform: scale(.72) rotate(14deg); }
:root[data-theme="dark"] .theme-symbol__moon { opacity: 1; transform: scale(1) rotate(0deg); }
.menu-button { display: none; }
.search-button { height: 32px; display: flex; align-items: center; gap: 8px; min-width: 208px; padding: 0 8px 0 10px; border-radius: 8px; color: var(--ink-3); font-size: 12px; text-align: left; }
.search-button span:nth-child(2) { flex: 1; }
kbd { padding: 2px 5px; border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 4px; color: var(--ink-3); background: var(--surface-soft); font-family: inherit; font-size: 12px; font-weight: 400; }
.notification-button { position: relative; color: var(--ink-2); font-size: 8px; }
.notification-button i { position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }

.content { flex: 1; min-height: 0; overflow-y: scroll; scrollbar-gutter: stable; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; padding: 18px 20px 48px; }
.content::-webkit-scrollbar, .context-rail::-webkit-scrollbar, .sidebar *::-webkit-scrollbar { width: 8px; height: 8px; }
.content::-webkit-scrollbar-thumb, .context-rail::-webkit-scrollbar-thumb, .sidebar *::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: var(--line-strong); background-clip: padding-box; }
.preview-banner { min-height: 36px; display: flex; align-items: center; gap: 9px; margin-bottom: 22px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: var(--surface); font-size: 12px; }
.preview-banner button { margin-left: auto; border: 0; background: transparent; color: var(--ink); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.preview-badge { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: var(--attention-bg); color: var(--attention); font-weight: 500; }
.view { display: none; animation: appear 180ms ease both; }
.view.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.page-head, .section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head h1, .section-title h1 { margin: 5px 0 5px; font-size: 24px; line-height: 1.16; font-weight: 500; letter-spacing: -0.35px; }
.page-head p:not(.overline), .section-title p:not(.overline) { margin: 0; color: var(--ink-2); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; cursor: pointer; }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.secondary { background: var(--surface); color: var(--ink); }
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.button-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--positive); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.metric-card, .panel, .data-panel, .list-card, .agent-card, .provider-card, .knowledge-card, .cost-card, .policy-card, .setting-card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; }
.metric-card { min-height: 144px; padding: 14px; display: flex; flex-direction: column; }
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; }
.card-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--ink-2); font-size: 20px; }
.status-chip { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.status-chip.positive { color: var(--positive); background: var(--positive-bg); }
.status-chip.attention { color: var(--attention); background: var(--attention-bg); }
.status-chip.danger { color: var(--danger); background: var(--danger-bg); }
.status-chip.neutral { color: var(--ink-2); background: var(--surface-soft); }
.metric-card > p { margin: 13px 0 2px; color: var(--ink-2); font-size: 12px; }
.metric-card > strong { font-size: 24px; line-height: 1.1; font-weight: 500; }
.metric-card > strong small { color: var(--ink-3); font-size: 14px; font-weight: 400; }
.metric-card > span { margin-top: 3px; color: var(--ink-3); font-size: 12px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: 10px; }
.panel { overflow: hidden; }
.panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-head h2, .drawer-head h2 { margin: 3px 0 0; font-size: 14px; line-height: 1.2; font-weight: 500; }
.text-button, .panel-footer-button, .rail-title button { border: 0; background: transparent; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.text-button:hover, .rail-title button:hover { color: var(--ink); }
.priority-list { margin: 0; padding: 0; list-style: none; }
.priority-list li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.priority-list li:last-child { border-bottom: 0; }
.priority-number { color: var(--ink-3); font-size: 12px; }
.priority-list strong, .approval-item strong, .agent-row strong { font-size: 13px; font-weight: 500; }
.priority-list p, .approval-item p, .agent-row p { margin: 3px 0 0; color: var(--ink-3); font-size: 12px; }
.tag { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: 12px; }
.pulse-label { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; }
.agent-list { padding: 4px 14px 6px; }
.agent-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 9px; padding: 9px 0; }
.agent-avatar.muted { color: var(--ink-3); }
.agent-row .time { color: var(--ink-3); font-size: 12px; }
.panel-footer-button { width: 100%; height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-top: 1px solid var(--line); cursor: pointer; }
.panel-footer-button:hover { background: var(--surface-soft); }
.approval-list { padding: 4px 14px; }
.approval-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; }
.approval-icon, .provider-glyph { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 12px; font-style: normal; font-weight: 500; }
.small-button { min-height: 27px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12px; cursor: pointer; }
.small-button:hover { background: var(--surface-soft); }
.connection-summary { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 19px 14px 14px; }
.connection-ring { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--positive) 0 79%, var(--attention) 79% 93%, var(--line) 93%); position: relative; }
.connection-ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.connection-ring span { position: relative; z-index: 1; font-size: 24px; font-weight: 500; }
.connection-ring small { color: var(--ink-3); font-size: 12px; }
.connection-legend { display: grid; gap: 7px; color: var(--ink-2); font-size: 12px; }
.connection-legend span { display: flex; align-items: center; gap: 7px; }
.connection-legend i, .connection-logos i { width: 6px; height: 6px; border-radius: 50%; }
.healthy { background: var(--positive); }.warning { background: var(--attention); }.offline { background: var(--ink-3); }
.connection-logos { display: flex; gap: 7px; padding: 12px 14px; border-top: 1px solid var(--line); overflow-x: auto; }
.connection-logos > span { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; position: relative; font-size: 12px; font-weight: 500; }
.connection-logos i { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--surface); width: 8px; height: 8px; }
.span-two { grid-column: 1 / -1; }
.filter-button { min-height: 28px; padding: 0 9px; border-radius: 8px; color: var(--ink-2); font-size: 12px; }
.timeline-table { overflow-x: auto; }
.table-row { min-width: 710px; display: grid; grid-template-columns: minmax(220px, 1.7fr) 1fr .8fr .7fr .75fr; align-items: center; min-height: 46px; padding: 0 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.table-row:first-child { border-top: 0; }
.table-row > span:first-child { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; }
.table-head { min-height: 34px; background: var(--surface-soft); color: var(--ink-3); }
.table-head > span:first-child { color: var(--ink-3); font-size: 12px; }
.provider-glyph { width: 26px; height: 26px; }
.result { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; }
.result::before { content: ""; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; }
.result.success { color: var(--positive); }.result.success::before { background: var(--positive); }
.result.review { color: var(--attention); }.result.review::before { background: var(--attention); }
.result.blocked { color: var(--danger); }.result.blocked::before { background: var(--danger); }

.agent-runtime-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(180px, .8fr); margin-bottom: 14px; border: 1px solid var(--line-strong); }
.agent-runtime-strip > div, .agent-runtime-strip > button { min-height: 72px; display: grid; align-content: center; gap: 4px; padding: 10px 14px; border: 0; border-right: 1px solid var(--line); background: transparent; text-align: left; }
.agent-runtime-strip > :last-child { border-right: 0; }
.agent-runtime-strip span, .agent-runtime-strip small { color: var(--ink-3); font-size: 12px; }
.agent-runtime-strip strong { font-size: 13px; font-weight: 500; }
.agent-runtime-strip > button { position: relative; cursor: pointer; color: var(--ink); }
.agent-runtime-strip > button:hover { background: var(--surface-soft); }
.agent-runtime-strip > button > span { position: absolute; top: 12px; right: 12px; color: var(--ink); font-size: 14px; }
.agent-card-grid, .provider-grid, .knowledge-grid, .policy-grid, .settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.agent-card, .provider-card, .knowledge-card, .policy-card, .setting-card { padding: 14px; }
.agent-card { width: 100%; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.agent-card:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.agent-card:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.agent-card-top, .provider-card-top, .card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.agent-card .agent-avatar { width: 36px; height: 36px; }
.agent-card h2, .provider-card h2, .knowledge-card h2, .cost-card h2, .policy-card h2, .setting-card h2 { margin: 12px 0 4px; font-size: 14px; font-weight: 500; }
.agent-card p, .provider-card p, .knowledge-card p, .cost-card p, .policy-card p, .setting-card p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.agent-task { margin-top: 16px; padding: 10px; border-radius: 8px; background: var(--surface-soft); }
.agent-task span { display: block; margin-bottom: 4px; color: var(--ink-3); font-size: 12px; text-transform: uppercase; }
.agent-task strong { font-size: 12px; font-weight: 500; }
.agent-card .card-meta strong { color: var(--ink); font-size: 12px; font-weight: 500; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.approval-board, .card-list { display: grid; gap: 10px; }
.list-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px; }
.list-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-soft); font-size: 14px; font-weight: 500; }
.list-card h2 { margin: 0 0 4px; font-size: 14px; font-weight: 500; }
.list-card p { margin: 0; color: var(--ink-2); font-size: 12px; }
.list-actions { display: flex; align-items: center; gap: 7px; }
.data-panel { overflow: hidden; }
.filter-tabs { display: flex; gap: 5px; margin-bottom: 12px; }
.filter-tabs button { height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--surface); font-size: 12px; cursor: pointer; }
.filter-tabs button.active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.provider-card { min-height: 188px; display: flex; flex-direction: column; }
.provider-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); font-size: 13px; font-weight: 500; }
.provider-card .card-meta { margin-top: auto; }
.provider-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.provider-actions .small-button { flex: 1 1 auto; }
.knowledge-card { min-height: 158px; }
.knowledge-card .overline { display: block; margin-bottom: 22px; }
.cost-layout { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.cost-card { padding: 14px; min-height: 160px; }
.cost-card.wide { grid-column: span 2; }
.cost-number { display: block; margin: 17px 0 6px; font-size: 24px; font-weight: 500; }
.bar-set { display: grid; gap: 10px; margin-top: 17px; }
.bar-row { display: grid; grid-template-columns: 82px 1fr 38px; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; }
.bar-track { height: 5px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.policy-card, .setting-card { min-height: 148px; }
.policy-toggle { width: 32px; height: 18px; border: 0; border-radius: 999px; background: var(--line-strong); padding: 2px; cursor: pointer; }
.policy-toggle::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform 140ms ease; }
.policy-toggle.active { background: var(--positive); }.policy-toggle.active::after { transform: translateX(14px); }

.context-rail { border-left: 1px solid var(--line); padding: 6px 14px 14px; overflow-y: auto; z-index: 30; }
.rail-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rail-section:last-child { border-bottom: 0; }
.rail-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--ink-3); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.rail-title button { text-transform: none; letter-spacing: -0.15px; }
.rail-close { display: none; }
.state-card { display: flex; align-items: center; gap: 11px; }
.large-live-dot { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--positive-bg); }
.large-live-dot i { width: 9px; height: 9px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 5px color-mix(in srgb, var(--positive) 17%, transparent); }
.state-card strong, .run-card strong { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 500; }
.state-card p, .run-card p { margin: 0; color: var(--ink-3); font-size: 12px; }
.run-card { padding: 12px; border: 1px solid var(--line); border-radius: 16px; }
.run-agent { display: flex; align-items: center; gap: 9px; }
.progress-track { height: 4px; margin: 14px 0 7px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.run-meta { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; }
.control-row { display: flex; width: 100%; align-items: center; justify-content: space-between; min-height: 37px; padding: 0; border: 0; background: transparent; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.switch { width: 30px; height: 17px; padding: 2px; border-radius: 999px; background: var(--line-strong); }
.switch::after { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); }
.switch.on { background: var(--positive); }.switch.on::after { transform: translateX(13px); }
.rail-notes textarea { width: 100%; min-height: 104px; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: var(--surface-soft); font-size: 12px; line-height: 1.45; }
.rail-notes textarea:focus { border-color: var(--line-strong); }
.mobile-context-button { display: none; }

/* Editorial command view: evidence first, ornament last. */
.editorial-head { align-items: flex-end; margin-bottom: 30px; }
.editorial-head h1 { margin-top: 7px; }
.operating-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.operating-strip > div { min-width: 0; display: grid; gap: 4px; padding: 13px 14px 14px 0; }
.operating-strip > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.operating-strip span, .operating-strip small { color: var(--ink-3); font-size: 12px; }
.operating-strip strong { font-size: 14px; font-weight: 500; }
.operating-strip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .72fr); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.ledger { min-width: 0; background: transparent; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.ledger-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.ledger-head h2 { margin: 4px 0 0; font-size: 14px; font-weight: 500; }
.decision-list { margin: 0; padding: 0; list-style: none; }
.decision-list li { min-height: 67px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.decision-list li:last-child { border-bottom: 0; }
.decision-index { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.decision-list strong { display: block; font-size: 13px; font-weight: 500; }
.decision-list p { margin: 3px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.signal { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.signal.attention { color: var(--attention); background: var(--attention-bg); }
.signal.neutral { color: var(--ink-2); background: var(--surface-soft); }
.authority-list > div { min-height: 67px; display: grid; grid-template-columns: 1fr auto; align-content: center; column-gap: 10px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.authority-list > div:last-child { border-bottom: 0; }
.authority-list span, .authority-list small { font-size: 12px; }
.authority-list span { color: var(--ink-2); }
.authority-list strong { font-size: 12px; font-weight: 500; text-align: right; }
.authority-list small { grid-column: 1 / -1; margin-top: 4px; color: var(--ink-3); }
.evidence-table { overflow-x: auto; }
.evidence-row { min-width: 720px; display: grid; grid-template-columns: 1.1fr .7fr 1.55fr 1.25fr; align-items: center; min-height: 48px; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.evidence-row:last-child { border-bottom: 0; }
.evidence-row > span:first-child { color: var(--ink); font-size: 13px; font-weight: 500; }
.evidence-head { min-height: 34px; color: var(--ink-3); background: color-mix(in srgb, var(--surface-soft) 55%, transparent); }
.evidence-head > span:first-child { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.ledger-date { color: var(--ink-3); font-size: 12px; }
.proof-list > div { min-height: 48px; display: grid; grid-template-columns: 70px 1fr 1.5fr auto; align-items: center; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.proof-list > div:last-child { border-bottom: 0; }
.proof-list time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.proof-list span { font-size: 13px; }
.proof-list strong { color: var(--ink-2); font-size: 12px; font-weight: 400; }
.release-ledger { border-top: 1px solid var(--line); }
.release-ledger > div { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.release-ledger span { color: var(--ink-2); }
.release-ledger strong { font-weight: 500; }
.command-grid .span-two { grid-column: 1 / -1; }
.data-map-ledger, .audit-ledger { border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.domain-table { overflow-x: auto; }
.domain-row { min-width: 820px; min-height: 52px; display: grid; grid-template-columns: .85fr 1.65fr 1.35fr .8fr; align-items: center; gap: 14px; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.domain-row:last-child { border-bottom: 0; }
.domain-row > span:first-child { color: var(--ink); font-size: 13px; font-weight: 500; }
.domain-head { min-height: 36px; color: var(--ink-3); background: color-mix(in srgb, var(--surface-soft) 55%, transparent); }
.domain-head > span:first-child { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.receipt-schema { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.receipt-schema span { min-height: 48px; display: flex; align-items: center; padding: 0 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.receipt-schema span:nth-child(4n) { border-right: 0; }
.receipt-schema span:nth-last-child(-n + 4) { border-bottom: 0; }
.empty-evidence { padding: 28px 15px; }
.empty-evidence strong { font-size: 13px; font-weight: 500; }
.empty-evidence p { max-width: 680px; margin: 6px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.metric-card, .panel, .data-panel, .list-card, .agent-card, .provider-card, .knowledge-card, .cost-card, .policy-card, .setting-card { box-shadow: none; }
.button:hover { transform: none; box-shadow: none; }

.command-dialog[hidden] { display: none; }
.command-dialog { position: fixed; isolation: isolate; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: min(18vh, 160px); background: rgba(0,0,0,.44); }
.dialog-backdrop, .drawer-backdrop { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(0,0,0,.44); }
.dialog-backdrop { pointer-events: none; background: transparent; }
.drawer-backdrop { backdrop-filter: blur(3px); }
.command-box { position: relative; z-index: 1; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface-raised); box-shadow: var(--shadow); }
.command-input-row { display: flex; align-items: flex-start; gap: 10px; min-height: 92px; padding: 14px; border-bottom: 1px solid var(--line); }
.command-input-row > span { margin-top: 2px; }
.command-input-row textarea { flex: 1; min-width: 0; min-height: 62px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; line-height: 1.45; }
.command-input-row kbd { margin-left: auto; }
.command-body { min-height: 0; overflow-y: auto; padding: 8px; }
.command-body .nav-label { padding-top: 4px; }
.command-boundary { margin: 5px 9px 10px; color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.command-suggestions { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.command-nav-label { margin-top: 8px; }
.command-body button { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.command-body button:hover { background: var(--surface-soft); }
.command-body button > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.command-body button div { display: grid; gap: 2px; }
.command-body strong { font-size: 13px; font-weight: 500; }
.command-body small { color: var(--ink-3); font-size: 12px; }
.command-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }

.review-drawer, .agent-drawer, .run-drawer { position: fixed; inset: 0; z-index: 110; pointer-events: none; visibility: hidden; }
.review-drawer.open, .agent-drawer.open, .run-drawer.open { pointer-events: auto; visibility: visible; }
.drawer-backdrop { opacity: 0; transition: opacity 180ms ease; }
.review-drawer.open .drawer-backdrop, .agent-drawer.open .drawer-backdrop, .run-drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; z-index: 1; top: 0; right: 0; width: min(430px, 100vw); height: 100%; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); transform: translateX(100%); transition: transform 200ms ease; }
.review-drawer.open .drawer-panel { transform: none; }
.agent-drawer-panel { position: absolute; z-index: 1; top: 0; right: 0; width: min(720px, 100vw); height: 100%; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); transform: translateX(100%); transition: transform 200ms ease; }
.agent-drawer.open .agent-drawer-panel { transform: none; }
.run-drawer-panel { position: absolute; z-index: 1; top: 0; right: 0; width: min(760px, 100vw); height: 100%; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); transform: translateX(100%); transition: transform 200ms ease; }
.run-drawer.open .run-drawer-panel { transform: none; }
.run-status-strip { display: grid; grid-template-columns: 1fr 1.4fr 1fr; border-bottom: 1px solid var(--line); }
.run-status-strip > div { min-width: 0; min-height: 72px; display: grid; align-content: center; gap: 5px; padding: 12px 16px; border-right: 1px solid var(--line); }
.run-status-strip > div:last-child { border-right: 0; }
.run-status-strip span { color: var(--ink-3); font-size: 12px; }
.run-status-strip strong { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
#runStatus[data-state="working"], #runStatus[data-state="accepted"] { color: var(--positive); }
#runStatus[data-state="input_required"] { color: var(--attention); }
#runStatus[data-state="failed"] { color: var(--danger); }
.run-body { flex: 1; min-height: 0; overflow-y: auto; }
.run-section { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.run-output { display: grid; gap: 10px; }
.run-output p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.run-timeline { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.run-timeline li { min-height: 42px; display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.run-timeline span { color: var(--ink-3); font-size: 12px; }
.run-timeline p { margin: 0; color: var(--ink-2); font-size: 12px; }
.run-input-list { display: grid; gap: 8px; }
.run-input-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.run-input-card > p { margin: 0 0 10px; color: var(--ink); font-size: 13px; line-height: 1.45; }
.run-input-options { display: flex; flex-wrap: wrap; gap: 7px; }
.run-input-options input { flex: 1 1 220px; min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: 12px; }
.run-followup { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.run-followup input { min-width: 0; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface); font-size: 13px; }
.run-followup input:disabled { color: var(--ink-3); background: var(--surface-soft); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-body section { margin-bottom: 20px; }
.drawer-body h3 { margin: 0 0 7px; font-size: 12px; font-weight: 500; text-transform: uppercase; color: var(--ink-3); }
.drawer-body p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.drawer-body pre { white-space: pre-wrap; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: var(--surface-soft); font: 12px/1.5 "SFMono-Regular", Consolas, monospace; }
.agent-inspector-body { flex: 1; overflow-y: auto; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.agent-inspector-hero { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.agent-inspector-hero .agent-avatar { width: 42px; height: 42px; border-radius: 50%; }
.agent-inspector-hero h3 { margin: 0; font-size: 14px; font-weight: 500; }
.agent-inspector-hero p { margin: 4px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.agent-live-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.agent-live-grid > div { min-height: 76px; display: grid; align-content: center; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--line); }
.agent-live-grid > div:last-child { border-right: 0; }
.agent-live-grid span, .agent-live-grid small { color: var(--ink-3); font-size: 12px; }
.agent-live-grid strong { font-size: 13px; font-weight: 500; }
.inspector-section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.inspector-section:last-child { border-bottom: 0; }
.inspector-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.inspector-section h4 { margin: 0; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.inspector-section-head span { color: var(--ink-3); font-size: 12px; }
.inspector-ledger { border-top: 1px solid var(--line); }
.inspector-ledger > div { min-height: 43px; display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); font-size: 12px; }
.inspector-ledger dt { color: var(--ink-3); }
.inspector-ledger dd { margin: 0; color: var(--ink-2); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--surface); font-size: 12px; }
.empty-live-state { padding: 13px; border: 1px solid var(--line); background: var(--surface-soft); }
.empty-live-state strong { display: block; font-size: 13px; font-weight: 500; }
.empty-live-state p { margin: 5px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.drawer-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 150; max-width: calc(100vw - 32px); padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--accent-ink); background: var(--accent); box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .context-rail { position: fixed; top: 0; right: 0; width: var(--rail); height: 100vh; box-shadow: var(--shadow); transform: translateX(105%); transition: transform 180ms ease; }
  .context-rail.open { transform: none; }
  .rail-close { display: inline-grid; place-items: center; }
  .mobile-context-button { display: grid; place-items: center; position: fixed; right: 16px; bottom: 16px; z-index: 35; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent-ink); background: var(--accent); box-shadow: var(--shadow); cursor: pointer; }
}

@media (max-width: 900px) {
  .agent-runtime-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-runtime-strip > :nth-child(2) { border-right: 0; }
  .agent-runtime-strip > :nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .operating-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operating-strip > div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .operating-strip > div:nth-child(4) { border-top: 1px solid var(--line); }
  .command-grid { grid-template-columns: 1fr; }
  .command-grid .span-two { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .agent-card-grid, .provider-grid, .knowledge-grid, .policy-grid, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100vh; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform 180ms ease; }
  .sidebar.open { transform: none; }
  .workspace { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { position: sticky; top: 0; padding: 0 12px; }
  .menu-button { display: grid; }
  .breadcrumb { min-width: 0; }
  .breadcrumb span, .breadcrumb b { display: none; }
  .search-button { min-width: 32px; width: 32px; padding: 0; display: grid; place-items: center; }
  .search-button span:nth-child(2), .search-button kbd { display: none; }
  .content { overflow: visible; padding: 14px 12px 60px; }
  .preview-banner { align-items: flex-start; flex-wrap: wrap; }
  .preview-banner button { margin-left: 0; }
  .page-head, .section-title { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-actions { width: 100%; overflow-x: auto; }
  .page-actions .button { flex: 0 0 auto; }
  .operating-strip { grid-template-columns: 1fr; }
  .operating-strip > div, .operating-strip > div + div { padding: 11px 0; border-left: 0; border-top: 1px solid var(--line); }
  .operating-strip > div:first-child { border-top: 0; }
  .decision-list li { grid-template-columns: 24px 1fr; }
  .decision-list .signal { grid-column: 2; width: fit-content; }
  .proof-list > div { grid-template-columns: 64px 1fr auto; padding: 9px 12px; }
  .proof-list strong { grid-column: 2 / -1; }
  .receipt-schema { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receipt-schema span:nth-child(4n) { border-right: 1px solid var(--line); }
  .receipt-schema span:nth-child(2n) { border-right: 0; }
  .receipt-schema span:nth-last-child(-n + 4) { border-bottom: 1px solid var(--line); }
  .receipt-schema span:nth-last-child(-n + 2) { border-bottom: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 132px; }
  .priority-list li { grid-template-columns: 24px 1fr; }
  .priority-list .tag { grid-column: 2; width: fit-content; }
  .approval-item { grid-template-columns: 30px 1fr; }
  .approval-item .small-button { grid-column: 2; width: fit-content; }
  .agent-card-grid, .provider-grid, .knowledge-grid, .policy-grid, .settings-grid, .cost-layout { grid-template-columns: 1fr; }
  .agent-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-live-grid > div:nth-child(2) { border-right: 0; }
  .agent-live-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .run-status-strip { grid-template-columns: 1fr 1fr; }
  .run-status-strip > div:nth-child(2) { border-right: 0; }
  .run-status-strip > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .run-followup { grid-template-columns: 1fr 1fr; }
  .run-followup input { grid-column: 1 / -1; }
  .cost-card.wide { grid-column: auto; }
  .list-card { grid-template-columns: 36px 1fr; }
  .list-card .list-actions { grid-column: 2; }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 11px; }
  .metric-card > strong { font-size: 24px; }
  .metric-top .status-chip { display: none; }
  .topbar-actions { gap: 5px; }
  .page-actions { display: grid; grid-template-columns: 1fr; }
  .page-actions .button { width: 100%; }
  .connection-summary { justify-content: flex-start; }
}

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