:root {
  color-scheme: dark;
  --bg: #050b14;
  --bg-deep: #030811;
  --surface: #0a1524;
  --surface-2: #0d1b2d;
  --surface-3: #11233a;
  --border: #1c334c;
  --border-strong: #274663;
  --text: #f5f8fc;
  --muted: #8ca0b7;
  --muted-2: #60758d;
  --blue: #4da3ff;
  --blue-2: #1677ff;
  --violet: #9967ff;
  --green: #6ddd83;
  --amber: #f6b94f;
  --red: #ff6b72;
  --shadow: 0 20px 65px rgba(0, 0, 0, .34);
  --radius: 14px;
  --sidebar: 220px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 70% -20%, rgba(31, 93, 170, .16), transparent 36%), var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 25%, rgba(50, 124, 214, .18), transparent 32%), linear-gradient(145deg, #030812, #081323); }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(160deg, rgba(15, 31, 51, .96), rgba(6, 14, 25, .98)); box-shadow: var(--shadow); }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(77, 163, 255, .6); border-radius: 16px; color: #72b8ff; font-size: 29px; font-weight: 900; background: linear-gradient(145deg, rgba(40, 115, 207, .25), rgba(82, 40, 170, .15)); box-shadow: inset 0 0 30px rgba(38, 131, 255, .08); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.login-card h1 { margin: 8px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.login-copy { color: var(--muted); margin: 0 0 28px; line-height: 1.55; }
.login-security { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 9px; }

.eyebrow { margin: 0 0 5px; color: #6d8aac; font-size: 10px; line-height: 1.2; letter-spacing: .17em; font-weight: 800; }
.muted { color: var(--muted); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 4px rgba(96, 117, 141, .08); }
.status-dot.ok { background: var(--green); box-shadow: 0 0 12px rgba(109, 221, 131, .6); }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 12px rgba(246, 185, 79, .5); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 12px rgba(255, 107, 114, .5); }

.stack-form { display: flex; flex-direction: column; gap: 10px; }
.stack-form.compact { margin-top: 24px; }
label { color: #b8c7d7; font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--border-strong); border-radius: 9px; padding: 12px 13px; outline: none; background: #07111e; color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77, 163, 255, .12); }
textarea { resize: vertical; min-height: 130px; line-height: 1.55; }
.form-error { color: #ff8e94; min-height: 18px; margin: 2px 0 0; font-size: 12px; }

.button { border: 1px solid transparent; border-radius: 9px; padding: 11px 16px; font-weight: 800; font-size: 12px; letter-spacing: .025em; cursor: pointer; transition: transform .15s, filter .15s, border-color .15s; }
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { background: linear-gradient(135deg, var(--blue-2), #328fff); color: #fff; box-shadow: 0 8px 24px rgba(22, 119, 255, .2); }
.button.secondary { background: #0b1b2d; border-color: var(--border-strong); color: #cfe1f4; }
.button.warning { background: linear-gradient(135deg, #4a2b12, #6b3d13); border-color: #a26727; color: #ffd9a2; }
.button.danger-outline { background: transparent; border-color: #64323a; color: #ff9da2; }
.button.wide { width: 100%; margin-top: 8px; }
.button.large { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; }
.icon-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: #0a1727; cursor: pointer; font-size: 18px; }
.link-button { padding: 5px 0; border: 0; color: #8eabc9; background: transparent; cursor: pointer; font-size: 11px; }
.link-button:hover { color: var(--blue); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 18px 12px; display: flex; flex-direction: column; border-right: 1px solid #13253a; background: rgba(4, 11, 20, .96); backdrop-filter: blur(16px); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 24px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 14px; letter-spacing: .13em; }
.sidebar-brand span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.nav-list { display: flex; flex-direction: column; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #aabace; cursor: pointer; text-align: left; font-size: 12px; }
.nav-item span { width: 18px; text-align: center; font-size: 17px; color: #90a9c3; }
.nav-item:hover { background: rgba(19, 46, 75, .45); color: #fff; }
.nav-item.active { border-color: rgba(77, 163, 255, .25); background: linear-gradient(90deg, rgba(43, 114, 196, .28), rgba(21, 51, 82, .15)); color: #fff; box-shadow: inset 3px 0 var(--blue); }
.nav-item.active span { color: var(--blue); }
.sidebar-status { margin-top: auto; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: #081625; }
.sidebar-status div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sidebar-status > span, .sidebar-status small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.main-content { min-height: 100vh; margin-left: var(--sidebar); padding: 22px 24px 30px; }
.topbar { min-height: 60px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar h1 { margin: 0 0 4px; font-size: 25px; line-height: 1.15; letter-spacing: -.035em; }
.topbar p { margin: 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: #081523; color: var(--muted); font-size: 11px; }
.user-button { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 5px; border: 0; background: transparent; cursor: pointer; color: #dce7f2; font-size: 12px; }
.user-button > span:first-child, .avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #27384d; color: #fff; font-weight: 800; }

.page { display: none; }
.page.active { display: block; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: .3; transform: translateY(3px); } }

.agent-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.agent-card { min-height: 92px; display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, #0d1d30, #091522); }
.agent-avatar { flex: 0 0 auto; width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid #2e72b8; border-radius: 50%; background: radial-gradient(circle, rgba(47, 126, 220, .28), rgba(14, 31, 53, .6)); color: #7fc0ff; font-weight: 900; font-size: 16px; }
.agent-avatar.violet { border-color: #7452aa; color: #c4a8ff; background: radial-gradient(circle, rgba(117, 66, 199, .28), rgba(29, 18, 50, .55)); }
.agent-avatar.green { border-color: #3d9152; color: #79df8e; background: radial-gradient(circle, rgba(49, 145, 74, .22), rgba(16, 43, 26, .55)); }
.agent-card-content { min-width: 0; flex: 1; }
.agent-card-title { display: flex; align-items: center; gap: 8px; }
.agent-card-title strong { font-size: 14px; }
.status-label { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .07em; }
.status-label.offline { color: var(--red); }
.agent-card p { margin: 6px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.overview-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.top-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.bottom-grid { grid-template-columns: 1.45fr .8fr .75fr .62fr; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(155deg, rgba(13, 28, 47, .96), rgba(7, 17, 29, .98)); box-shadow: 0 10px 35px rgba(0, 0, 0, .12); }
.activity-panel, .queue-panel { min-height: 350px; padding: 16px; }
.health-panel, .automation-panel, .usage-panel { min-height: 250px; padding: 16px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(39, 70, 99, .55); }
.panel-heading h2, .security-panel h2, .settings-card h2 { margin: 0; font-size: 14px; letter-spacing: -.01em; }

.activity-list { padding-top: 6px; }
.activity-row { position: relative; display: grid; grid-template-columns: 65px 30px 1fr; gap: 8px; min-height: 55px; align-items: center; }
.activity-row::after { content: ""; position: absolute; left: 79px; top: 42px; bottom: -13px; width: 1px; background: #24405e; }
.activity-row:last-child::after { display: none; }
.activity-time { color: #8298b0; font-size: 10px; font-variant-numeric: tabular-nums; }
.activity-icon { z-index: 1; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #2868a8; border-radius: 50%; background: #0d315a; color: #8bc8ff; font-size: 10px; }
.activity-copy strong, .activity-copy span { display: block; }
.activity-copy strong { font-size: 11px; }
.activity-copy span { margin-top: 4px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.queue-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 14px; }
.queue-column h3 { margin: 0 0 10px; color: #a9bed3; font-size: 11px; }
.queue-column.waiting h3 { color: var(--amber); }
.queue-column.running h3 { color: var(--blue); }
.queue-column.done h3 { color: var(--green); }
.queue-item { margin-bottom: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: rgba(8, 21, 36, .65); }
.queue-item strong { display: block; font-size: 10px; line-height: 1.35; }
.queue-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.empty-state { padding: 22px 10px; color: var(--muted-2); text-align: center; font-size: 10px; }

.health-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 14px; }
.metric-card { min-width: 0; padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: rgba(7, 18, 31, .65); text-align: center; }
.metric-card label { display: block; color: #c6d5e5; font-size: 10px; }
.metric-value { margin: 11px 0 6px; color: #fff; font-size: 20px; font-weight: 800; }
.metric-card small { color: var(--muted); font-size: 8px; }
.meter { height: 4px; margin-top: 10px; border-radius: 999px; overflow: hidden; background: #1d2d40; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #61d77b, #8ce99d); }
.health-footer { margin-top: 12px; padding: 9px 11px; border: 1px solid rgba(49, 95, 77, .7); border-radius: 8px; color: #9bb8aa; background: rgba(22, 66, 43, .18); font-size: 9px; }

.compact-list { padding-top: 7px; }
.compact-row { min-height: 42px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid rgba(36, 62, 87, .6); }
.compact-row:last-child { border-bottom: 0; }
.compact-row .compact-icon { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; color: #91bde8; background: #09192a; font-size: 10px; }
.compact-row strong { flex: 1; min-width: 0; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle { width: 31px; height: 17px; padding: 2px; border-radius: 999px; background: #2a3a4a; }
.toggle::after { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: #9caabb; }
.toggle.on { background: #2878d0; }
.toggle.on::after { margin-left: 14px; background: #fff; }

.usage-list { padding-top: 12px; }
.usage-item { margin-bottom: 14px; padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: rgba(7, 18, 31, .6); }
.usage-item-header { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.usage-item p { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.usage-item .meter > span { background: linear-gradient(90deg, var(--violet), #b68cff); }
.usage-item.claude .meter > span { background: linear-gradient(90deg, #54c970, #8fe6a0); }

.security-panel { min-height: 250px; padding: 18px 14px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.security-icon { width: 76px; height: 76px; display: grid; place-items: center; margin: 8px 0 14px; border: 2px solid #51bd6b; border-radius: 24px; color: #d9e8ef; font-size: 29px; transform: rotate(45deg); background: rgba(38, 113, 57, .12); }
.security-icon::first-letter { transform: rotate(-45deg); }
.security-panel strong { margin-top: 8px; font-size: 12px; }
.security-panel > span { margin: 6px 0 13px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.security-panel .button { margin-top: auto; font-size: 9px; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 12px; }
.section-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 4px 0 18px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, #0c1b2d, #081421); }
.section-toolbar h2 { margin: 0; font-size: 20px; }
.section-toolbar p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.section-panel { padding: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.detail-card { padding: 18px; }
.detail-card h3 { margin: 14px 0 6px; font-size: 17px; }
.detail-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.detail-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 17px; }
.detail-stat { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: rgba(5, 14, 24, .55); }
.detail-stat span, .detail-stat strong { display: block; }
.detail-stat span { color: var(--muted); font-size: 8px; }
.detail-stat strong { margin-top: 5px; font-size: 11px; }

.council-overview { margin-bottom: 14px; }
.council-project { padding: 18px; }
.council-project-title { display: flex; align-items: center; gap: 14px; }
.council-project-title h3 { margin: 0; font-size: 20px; }
.council-project-title p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.council-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 16px; }
.council-turns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.council-turn { position: relative; min-height: 210px; padding: 17px; overflow: hidden; }
.council-turn::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--blue); opacity: .75; }
.council-turn.pending::before { background: var(--muted-2); opacity: .4; }
.council-turn-heading { display: flex; align-items: center; gap: 10px; }
.council-turn-heading > div { min-width: 0; flex: 1; }
.council-turn-heading h3 { margin: 0; font-size: 14px; }
.council-turn-number { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; color: #91c7ff; background: #0a1b2d; font-size: 11px; font-weight: 900; }
.council-turn-summary { min-height: 72px; margin: 18px 0 14px; color: #c4d3e1; font-size: 11px; line-height: 1.58; }
.council-turn.pending .council-turn-summary { color: var(--muted-2); }
.council-turn-meta { padding-top: 11px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; line-height: 1.5; }
.council-verdict { padding: 19px; border-color: #665127; }
.council-verdict.approved { border-color: #2e6d43; background: linear-gradient(155deg, rgba(21, 63, 40, .48), rgba(7, 17, 29, .98)); }
.council-verdict.rejected { border-color: #743b42; background: linear-gradient(155deg, rgba(70, 27, 33, .48), rgba(7, 17, 29, .98)); }
.council-verdict h3 { margin: 0; font-size: 17px; }
.council-verdict > p:not(.eyebrow) { margin: 9px 0 13px; color: #bfd0df; font-size: 11px; line-height: 1.58; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: #7891aa; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
td { color: #cbd8e5; }
td .subtle { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.task-list, .automation-list, .logs-list { display: flex; flex-direction: column; gap: 10px; }
.task-card, .automation-card, .log-card { padding: 15px 17px; border: 1px solid var(--border); border-radius: 11px; background: linear-gradient(145deg, #0c1a2b, #081421); }
.task-card-header, .automation-card, .log-card { display: flex; align-items: center; gap: 13px; }
.task-card-header > div:nth-child(2), .automation-card > div:nth-child(2), .log-card > div:nth-child(2) { min-width: 0; flex: 1; }
.task-card h3, .automation-card h3, .log-card h3 { margin: 0; font-size: 12px; }
.task-card p, .automation-card p, .log-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.task-output { margin: 13px 0 0; padding: 12px; max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: #050d17; color: #b8cbe0; white-space: pre-wrap; word-break: break-word; font: 10px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px; color: #a7bbcf; background: #0a1929; font-size: 8px; font-weight: 800; white-space: nowrap; }
.badge.success { border-color: #2e6d43; color: #7de094; }
.badge.failed { border-color: #743b42; color: #ff979c; }
.badge.running { border-color: #285f97; color: #75b9ff; }
.badge.queued { border-color: #6d562e; color: #f1c673; }
.automation-actions { display: flex; gap: 7px; }
.automation-actions .button { padding: 7px 10px; font-size: 9px; }
.log-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: #0a1b2d; color: #7ebaff; }
.log-time { color: var(--muted); font-size: 9px; white-space: nowrap; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 520px)); gap: 14px; }
.settings-card { padding: 22px; }
.settings-card > p:not(.eyebrow) { color: var(--muted); font-size: 11px; }
.account-row { display: flex; align-items: center; gap: 12px; margin: 24px 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(7, 17, 29, .6); }
.account-row strong, .account-row span { display: block; }
.account-row div > span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.definition-list { margin: 0 0 22px; }
.definition-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 10px; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; color: #d4e0eb; text-align: right; }

.modal { width: min(680px, calc(100% - 28px)); padding: 0; border: 1px solid var(--border-strong); border-radius: 15px; background: #091625; color: var(--text); box-shadow: 0 30px 100px #000; }
.modal::backdrop { background: rgba(0, 4, 10, .78); backdrop-filter: blur(5px); }
.modal form { padding: 22px; }
.modal label { display: block; margin: 13px 0 7px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.modal-heading h2 { margin: 0; font-size: 21px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.modal-note { color: var(--muted); font-size: 10px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.small-modal { max-width: 450px; }
.small-modal p { color: var(--muted); line-height: 1.55; }

.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; width: min(380px, calc(100% - 36px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 9px; background: #0c1d30; color: #dce8f4; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .18s ease-out; }
.toast.success { border-color: #327248; }
.toast.error { border-color: #773b43; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 1250px) {
  .bottom-grid { grid-template-columns: repeat(2, 1fr); }
  .security-panel { min-height: 240px; }
}

@media (max-width: 960px) {
  :root { --sidebar: 74px; }
  .sidebar { padding-inline: 9px; }
  .sidebar-brand > div:last-child, .nav-item:not(.active) { }
  .sidebar-brand strong, .sidebar-brand span, .nav-item { font-size: 0; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item span { font-size: 18px; }
  .sidebar-status { padding: 10px 6px; text-align: center; }
  .sidebar-status strong, .sidebar-status > span, .sidebar-status small { display: none; }
  .sidebar-status div { justify-content: center; }
  .top-grid { grid-template-columns: 1fr; }
  .agent-strip, .card-grid { grid-template-columns: 1fr 1fr; }
  .agent-strip .agent-card:last-child { grid-column: span 2; }
  .council-turns { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --sidebar: 0px; }
  .sidebar { position: fixed; inset: auto 0 0 0; width: auto; height: 64px; padding: 7px; border: 1px solid var(--border); border-radius: 14px 14px 0 0; flex-direction: row; }
  .sidebar-brand, .sidebar-status { display: none; }
  .nav-list { width: 100%; flex-direction: row; justify-content: space-around; overflow-x: auto; }
  .nav-item { min-width: 46px; width: auto; padding: 8px 10px; }
  .nav-item:nth-child(n+6) { display: none; }
  .main-content { margin-left: 0; padding: 16px 13px 84px; }
  .topbar { align-items: center; }
  .topbar h1 { font-size: 20px; }
  .connection-pill, .user-button > span:last-child { display: none; }
  .agent-strip, .card-grid, .bottom-grid, .quick-actions { grid-template-columns: 1fr; }
  .agent-strip .agent-card:last-child { grid-column: auto; }
  .council-facts { grid-template-columns: 1fr; }
  .queue-columns { grid-template-columns: 1fr; }
  .health-metrics { grid-template-columns: repeat(2, 1fr); }
  .activity-row { grid-template-columns: 54px 28px 1fr; }
  .activity-row::after { left: 67px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .automation-card, .log-card { align-items: flex-start; flex-wrap: wrap; }
  .automation-actions { width: 100%; }
}
