:root {
  color-scheme: dark;
  --bg: #060910;
  --sidebar: #080d16;
  --panel: #0d1522;
  --panel-soft: #0a111c;
  --panel-hover: #111b2a;
  --border: #223047;
  --border-soft: #172235;
  --text: #f2f6fb;
  --muted: #8a98ab;
  --muted-2: #65748a;
  --cyan: #22d3ee;
  --blue: #60a5fa;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --shadow: 0 16px 40px rgba(0, 0, 0, .22);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); }
body.auth-required { overflow: hidden; }
body.auth-required .app-shell { filter: blur(5px); opacity: .42; pointer-events: none; user-select: none; }
.auth-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 20%, rgba(18,61,82,.38), transparent 38%), rgba(3,7,13,.76); backdrop-filter: blur(5px); }
body:not(.auth-required) .auth-gate { display: none; }
.auth-card { width: 410px; padding: 22px; background: #0b131f; border: 1px solid #2b4259; border-radius: 9px; box-shadow: 0 28px 90px rgba(0,0,0,.62); }
.auth-brand { padding: 0 0 17px; border: 0; }
.auth-copy { padding-top: 17px; border-top: 1px solid var(--border-soft); }
.auth-copy h1 { margin-top: 5px; font-size: 23px; }
.auth-copy p { color: var(--muted); font-size: 10px; }
.auth-form { display: grid; gap: 11px; margin-top: 17px; }
.auth-form label, .organization-switcher { color: #8e9bad; font-size: 9px; font-weight: 800; }
.auth-form input, .auth-form select, .organization-switcher select { width: 100%; height: 38px; margin-top: 6px; padding: 0 10px; color: var(--text); background: #070d16; border: 1px solid var(--border); border-radius: 5px; }
.auth-form .button { width: 100%; margin-top: 5px; }
.mfa-enrollment { display: grid; justify-items: center; gap: 9px; text-align: center; }
.mfa-enrollment p, .mfa-recovery p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.mfa-qr { width: 210px; height: 210px; padding: 9px; background: white; border-radius: 7px; }
.mfa-secret { max-width: 100%; padding: 7px 9px; color: #b9f7ff; background: #070d16; border: 1px solid var(--border); border-radius: 5px; overflow-wrap: anywhere; font-size: 10px; letter-spacing: .08em; }
.mfa-recovery { display: grid; gap: 11px; margin-top: 17px; }
.mfa-recovery h2 { margin: 0; font-size: 17px; }
.mfa-recovery pre { margin: 0; padding: 12px; color: #dffaff; background: #070d16; border: 1px solid var(--border); border-radius: 6px; font: 11px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; columns: 2; user-select: all; }
.mfa-recovery .button { width: 100%; }
.auth-error { min-height: 14px; margin: 12px 0 0; color: var(--red); font-size: 9px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
svg { width: 17px; height: 17px; stroke-width: 1.8; }

.app-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--border-soft); }
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 19px 20px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-soft); }
.brand-icon { width: 46px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; }
.brand-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 21px; line-height: 1; letter-spacing: -.04em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.nav-list { flex: 1; overflow-y: auto; padding: 16px 11px; }
.nav-label { display: block; margin: 0 10px 8px; color: #5f6d81; font-size: 9px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.nav-label-secondary { margin-top: 23px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 10px; height: 39px; margin: 2px 0; padding: 0 12px; color: #96a4b6; border: 1px solid transparent; border-radius: 6px; text-decoration: none; font-size: 12px; font-weight: 700; transition: 140ms ease; }
.nav-link:hover { color: var(--text); background: #0c1420; border-color: #17243a; }
.nav-link.active { color: #e3fbff; background: #0d1a28; border-color: #194258; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--cyan); border-radius: 0 3px 3px 0; }
.nav-link.active svg { color: var(--cyan); }
.sidebar-footer { padding: 13px 11px 15px; border-top: 1px solid var(--border-soft); }
.tenant-state { display: flex; align-items: center; gap: 8px; margin: 0 8px 12px; }
.tenant-state strong, .tenant-state small { display: block; }
.tenant-state strong { color: #ccd6e1; font-size: 11px; }
.tenant-state small { margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.profile-button { width: 100%; display: grid; grid-template-columns: 32px 1fr 15px; align-items: center; gap: 8px; padding: 8px; color: var(--text); background: #0a121e; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; text-align: left; }
.profile-button:hover { background: #0e1825; border-color: #34506c; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; color: #dffaff; background: #173248; border-radius: 6px; font-size: 10px; font-weight: 900; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.content { position: relative; min-width: 0; padding: 23px 27px 30px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 21px; }
.page-title { min-width: 285px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: #8196ab; font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.035em; }
.page-title p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.search-box { width: min(295px, 24vw); height: 37px; display: flex; align-items: center; gap: 8px; padding: 0 9px; color: var(--muted); background: #09111c; border: 1px solid var(--border); border-radius: 6px; }
.search-box:focus-within { border-color: #28708d; box-shadow: 0 0 0 3px rgba(34, 211, 238, .08); }
.search-box input { min-width: 0; flex: 1; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 11px; }
.search-box input::placeholder { color: #607086; }
kbd { padding: 2px 5px; color: #718096; border: 1px solid #2b3a4e; border-bottom-color: #41546b; border-radius: 4px; font: 9px inherit; }
.icon-button { position: relative; width: 37px; height: 37px; display: inline-grid; place-items: center; padding: 0; color: #a2afbf; background: #0a111c; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.icon-button:hover { color: var(--cyan); background: #0e1825; border-color: #31516d; }
.icon-button.small { width: 31px; height: 31px; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; background: var(--red); border: 2px solid #0a111c; border-radius: 50%; }
.button { height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 850; white-space: nowrap; }
.button.primary { color: #001419; background: var(--cyan); border-color: #67e8f9; }
.button.primary:hover { background: #67e8f9; }
.button.danger { color: #fff; background: #d92b4c; border-color: #fb7185; }
.button.danger:hover { background: #e93c5c; }
.button.secondary { color: #c3cedb; background: #111a27; border-color: #2d3c50; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { min-height: 125px; padding: 16px 17px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.kpi-label svg { color: #63758b; }
.kpi-card > strong { display: block; margin-top: 14px; font-size: 30px; letter-spacing: -.04em; }
.kpi-card .critical-value { color: #ff8da1; }
.kpi-card p { margin: 8px 0 0; color: #6c798c; font-size: 9px; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; }
.trend svg { width: 12px; height: 12px; }
.trend.positive { color: var(--green); }
.trend.negative { color: var(--red); }
.trend.neutral { color: #68778c; }

.workspace, .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.workspace { margin-bottom: 14px; overflow: hidden; }
.section-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading { padding: 15px 17px 11px; }
.section-kicker { display: block; color: #607991; font-size: 8px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h2 { margin: 4px 0 0; font-size: 14px; line-height: 1.2; letter-spacing: -.015em; }
.table-controls { display: flex; align-items: flex-end; gap: 8px; }
.table-controls label > span { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 8px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.table-controls select { height: 31px; padding: 0 27px 0 8px; color: #b9c5d3; background: #09111c; border: 1px solid var(--border); border-radius: 5px; font-size: 10px; }
.tabs { display: flex; gap: 2px; padding: 0 17px; border-bottom: 1px solid var(--border-soft); }
.tab { position: relative; padding: 10px 11px 10px; color: #738198; background: transparent; border: 0; cursor: pointer; font-size: 10px; font-weight: 850; }
.tab:hover { color: #c9d3df; }
.tab.active { color: var(--cyan); }
.tab.active::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; background: var(--cyan); }
.table-scroll { position: relative; min-height: 283px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 10px 13px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: middle; }
.inline-status { max-width: 124px; height: 29px; padding: 0 7px; color: #b9c5d3; background: #09111c; border: 1px solid var(--border); border-radius: 5px; font-size: 8px; }
th { color: #617086; background: #0a111c; font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
th:nth-child(1) { width: 27%; } th:nth-child(2) { width: 18%; } th:nth-child(3) { width: 16%; } th:nth-child(4) { width: 13%; } th:nth-child(5) { width: 10%; } th:nth-child(6) { width: 11%; } th:nth-child(7) { width: 5%; }
td { color: #b7c3d1; font-size: 10px; }
tbody tr:hover { background: var(--panel-hover); }
tbody tr:last-child td { border-bottom: 0; }
.project-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.provider { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; color: white; border-radius: 5px; font-size: 8px; font-weight: 900; }
.provider.cyan { background: #087e91; } .provider.blue { background: #2158a6; } .provider.violet { background: #6b46a8; } .provider.green { background: #167253; } .provider.amber { background: #95640f; } .provider.red { background: #9d2d42; }
.project-cell strong, .project-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-cell strong { color: #e6ecf3; font-size: 10px; }
.project-cell small { margin-top: 2px; color: #68768a; font-size: 8px; }
.owner { display: flex; align-items: center; gap: 7px; }
.owner-avatar { width: 23px; height: 23px; display: grid; place-items: center; color: #c7d3e0; background: #121d2b; border: 1px solid #304059; border-radius: 50%; font-size: 7px; font-weight: 900; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border: 1px solid; border-radius: 999px; font-size: 8px; font-weight: 850; text-transform: capitalize; }
.status.running { color: #73ebff; background: #0c2633; border-color: #155268; }
.status.paused, .status.draft { color: #f9cc5c; background: #29210f; border-color: #604a19; }
.status.completed { color: #68e8b6; background: #10291f; border-color: #1b6049; }
.status.failed { color: #ff91a4; background: #30151c; border-color: #6b2836; }
.row-action { width: 27px; height: 27px; display: grid; place-items: center; margin-left: auto; padding: 0; color: #738198; background: transparent; border: 1px solid transparent; border-radius: 5px; cursor: pointer; }
.row-action:hover { color: var(--cyan); background: #111b29; border-color: #2d415a; }
.empty-state { position: absolute; inset: 35px 0 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); background: var(--panel); font-size: 10px; }
.empty-state[hidden] { display: none; }
.empty-state svg { width: 27px; height: 27px; color: #526177; }
.empty-state strong { color: #d3dbe4; }

.lower-grid { display: grid; grid-template-columns: 1.42fr 1.08fr .96fr; gap: 14px; }
.view-hidden { display: none !important; }
.view-focused { grid-column: 1 / -1 !important; }
.getting-started { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(0,1.8fr); gap: 20px; align-items: center; margin-bottom: 14px; padding: 17px; background: linear-gradient(120deg,#0d1825,#0a121d); border: 1px solid #29435a; border-radius: 8px; box-shadow: var(--shadow); }
.getting-started p,.panel-help { color: var(--muted); font-size: 9px; line-height: 1.55; }
.getting-started p { margin: 7px 0 0; }
.workflow-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.workflow-steps li { display: grid; grid-template-columns: 25px 1fr; gap: 8px; min-width: 0; padding: 10px; background: #08111b; border: 1px solid var(--border-soft); border-radius: 6px; }
.workflow-steps b { width: 23px; height: 23px; display: grid; place-items: center; color: #021116; background: var(--cyan); border-radius: 50%; font-size: 9px; }
.workflow-steps strong,.workflow-steps small { display: block; }
.workflow-steps strong { color: #dce7f0; font-size: 9px; }
.workflow-steps small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.panel-help { margin: -4px 0 12px; padding: 9px 10px; background: #09121d; border-left: 2px solid #26728c; border-radius: 0 5px 5px 0; }
.panel-help strong { color: #d6e8f2; }
.settings-list { display: grid; gap: 8px; }
.settings-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; background: #09111b; border: 1px solid var(--border-soft); border-radius: 6px; }
.settings-card strong,.settings-card small { display: block; }
.settings-card strong { color: #dce7f0; font-size: 10px; }
.settings-card small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.settings-card .row-actions { display: flex; gap: 4px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: 15px; height: 15px; margin: 0; }
.article-editor { min-height: 280px; font: 11px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; }
.panel { min-height: 260px; padding: 15px 16px; }
.panel-heading { margin-bottom: 13px; }
.text-button { display: inline-flex; align-items: center; gap: 4px; padding: 4px; color: #77879b; background: transparent; border: 0; cursor: pointer; font-size: 9px; font-weight: 800; }
.text-button:hover { color: var(--cyan); }
.text-button svg { width: 12px; height: 12px; }
.threats ol, .timeline { margin: 0; padding: 0; list-style: none; }
.threats li { display: grid; grid-template-columns: 27px 1fr 32px; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.rank { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid; border-radius: 5px; font-size: 8px; font-weight: 900; }
.rank.critical { color: #ff9daf; background: #2c1119; border-color: #6b2635; }
.rank.high { color: #ffd36a; background: #2b210d; border-color: #654b17; }
.threats strong, .threats small, .timeline strong, .timeline small, .worker-row strong, .worker-row small { display: block; }
.threats strong, .timeline strong, .worker-row strong { color: #dce4ed; font-size: 9px; }
.threats small, .timeline small, .worker-row small { margin-top: 3px; color: #68778c; font-size: 8px; }
.threats b { color: #ff8ea1; font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.timeline { position: relative; padding-left: 2px; }
.timeline::before { content: ""; position: absolute; left: 12px; top: 10px; bottom: 10px; width: 1px; background: #223149; }
.timeline li { position: relative; display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: 9px; min-height: 45px; }
.activity-icon, .worker-icon { position: relative; z-index: 1; display: grid; place-items: center; background: #0d1520; border: 1px solid; border-radius: 5px; }
.activity-icon { width: 25px; height: 25px; }
.activity-icon svg, .worker-icon svg { width: 12px; height: 12px; }
.blue { color: #73a6ff; border-color: #254e89; } .red { color: #ff8ca0; border-color: #652635; } .green { color: #69e8b5; border-color: #1d684d; } .amber { color: #ffd15f; border-color: #684e19; } .muted { color: #8290a3; border-color: #354258; }
.worker-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--border-soft); }
.worker-row > .row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.worker-row > .row-actions .row-action { margin-left: 0; }
.member-list { display: grid; }
.member-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--border-soft); }
.member-row:first-child { border-top: 0; }
.member-row > span:first-child { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #132536; border: 1px solid #2b4960; color: var(--cyan); font-size: 9px; font-weight: 800; }
.member-row div { min-width: 0; }
.member-row strong, .member-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row small { color: var(--muted); margin-top: 3px; font-size: 8px; }
.member-row > em { font-style: normal; color: #9eb3c6; font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.worker-icon { width: 29px; height: 29px; }
.worker-row > span:last-child { display: flex; align-items: center; gap: 5px; color: #8997aa; font-size: 8px; }
.graph-engagement { display: grid; gap: 6px; color: var(--muted); font-size: 8px; font-weight: 800; }
.graph-engagement select { width: 100%; height: 33px; padding: 0 8px; color: var(--text); background: #080e18; border: 1px solid var(--border); border-radius: 5px; }
.graph-summary { display: flex; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.graph-summary strong { color: var(--cyan); font-size: 15px; }
.graph-summary span { color: var(--muted); font-size: 9px; }
.graph-results { display: grid; gap: 6px; max-height: 300px; overflow: auto; padding-top: 10px; }
.graph-record { display: grid; grid-template-columns: minmax(80px, .4fr) minmax(130px, 1fr) minmax(80px, .5fr); gap: 8px; align-items: center; padding: 8px 9px; border: 1px solid var(--border-soft); border-radius: 6px; background: #09111b; }
.graph-record b { color: var(--cyan); font-size: 7px; text-transform: uppercase; letter-spacing: .055em; }
.graph-record span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.graph-record small { color: var(--muted); text-align: right; font-size: 7px; }
.graph-heading-actions { display: flex; align-items: center; gap: 8px; }
.graph-paths-panel { margin-top: 14px; padding: 13px; background: #08111b; border: 1px solid #29435a; border-radius: 7px; }
.graph-paths-panel .subsection-heading { margin-bottom: 10px; }
.graph-paths-panel .subsection-heading h3 { margin: 4px 0 0; font-size: 13px; }
.graph-paths-form { display: grid; grid-template-columns: minmax(180px, 1.25fr) minmax(100px, .45fr) repeat(2, minmax(220px, 1fr)) auto; align-items: end; gap: 8px; }
.graph-paths-form label { color: #8190a4; font-size: 8px; font-weight: 800; }
.graph-paths-form input, .graph-paths-form select { width: 100%; height: 34px; margin-top: 5px; padding: 0 8px; color: var(--text); background: #050c14; border: 1px solid var(--border); border-radius: 5px; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.graph-paths-freshness { margin: 11px 0 7px; color: #9fc3d5; font-size: 8px; font-weight: 750; }
.graph-paths-results { max-height: 330px; overflow: auto; border: 1px solid var(--border-soft); border-radius: 6px; }
.graph-paths-results table { min-width: 660px; table-layout: auto; }
.graph-paths-results th:nth-child(1) { width: 58px; }
.graph-paths-results th:nth-child(2) { width: 72px; }
.graph-paths-results th:nth-child(3) { width: auto; }
.graph-paths-results th, .graph-paths-results td { padding: 8px 9px; }
.graph-paths-results td { font: 8px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.graph-paths-results td:last-child { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-paths-empty, .graph-paths-limit { margin: 0; padding: 12px; color: var(--muted); font-size: 9px; }
.graph-paths-empty.error { color: #ff9daf; }
.tools-panel { grid-column: span 2; }
.tool-filters { display: grid; grid-template-columns: minmax(160px, 1.3fr) repeat(3, minmax(110px, .8fr)) auto; align-items: end; gap: 8px; margin-bottom: 12px; }
.tool-filters label { color: #8190a4; font-size: 8px; font-weight: 800; }
.tool-filters input, .tool-filters select { width: 100%; height: 33px; margin-top: 5px; padding: 0 8px; color: var(--text); background: #080e18; border: 1px solid var(--border); border-radius: 5px; font-size: 9px; }
.tool-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 330px; overflow: auto; }
.tool-card { min-width: 0; padding: 9px 10px; background: #09111b; border: 1px solid var(--border-soft); border-radius: 6px; }
.tool-card header { display: flex; justify-content: space-between; gap: 8px; }
.tool-card strong, .tool-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card strong { color: #dbe6ef; font-size: 9px; }
.tool-card small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.tool-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.tool-badges span { padding: 3px 5px; color: #9db2c5; background: #0d1a27; border: 1px solid #243b50; border-radius: 999px; font-size: 7px; text-transform: uppercase; }
.panel-empty { min-height: 174px; display: grid; place-content: center; justify-items: center; gap: 6px; color: #6d7c90; text-align: center; }
.panel-empty[hidden] { display: none; }
.panel-empty svg { width: 25px; height: 25px; color: #46566d; }
.panel-empty strong { color: #aebac7; font-size: 9px; }
.panel-empty span { font-size: 8px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.dot.healthy { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .09); }
.dot.warning { background: var(--amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, .09); }
.dot.offline { background: #59677a; }

.popover { position: fixed; z-index: 20; padding: 8px; background: #0d1521; border: 1px solid #2b3c52; border-radius: 8px; box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
.popover[hidden] { display: none; }
.notifications { top: 67px; right: 179px; width: 315px; }
.profile-popover { left: 17px; bottom: 76px; width: 207px; }
.popover-header { display: flex; justify-content: space-between; padding: 8px 9px 10px; border-bottom: 1px solid var(--border-soft); font-size: 10px; }
.popover-header span { color: var(--muted); font-size: 8px; }
.popover button { width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 10px 9px; color: #bac6d4; background: transparent; border: 0; border-radius: 5px; cursor: pointer; text-align: left; }
.popover button:hover { color: var(--text); background: #111d2b; }
.popover button svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; color: var(--cyan); }
.popover button strong, .popover button small { display: block; }
.popover button strong { font-size: 9px; }
.popover button small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.organization-switcher { display: block; padding: 6px 9px 10px; border-bottom: 1px solid var(--border-soft); }
.organization-switcher select { height: 32px; }
.popover-empty { display: grid; place-items: center; gap: 7px; min-height: 94px; color: #738197; font-size: 9px; }
.popover-empty svg { width: 20px; height: 20px; color: #4c5c72; }

dialog { width: 425px; color: var(--text); background: #0d1521; border: 1px solid #31445e; border-radius: 9px; box-shadow: 0 24px 80px rgba(0, 0, 0, .62); }
dialog.wide-dialog { width: min(920px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(2, 5, 10, .78); backdrop-filter: blur(4px); }
dialog form { padding: 11px; }
.dialog-mark { width: 37px; height: 37px; display: grid; place-items: center; margin-bottom: 12px; color: var(--cyan); background: #102534; border: 1px solid #23536a; border-radius: 7px; }
dialog h2 { margin: 5px 0 8px; font-size: 19px; }
dialog p { margin: 0 0 17px; color: var(--muted); font-size: 10px; line-height: 1.55; }
dialog label { display: block; margin-top: 11px; color: #8e9bad; font-size: 9px; font-weight: 800; }
dialog input, dialog select, dialog textarea { width: 100%; margin-top: 6px; padding: 0 10px; color: var(--text); background: #080e18; border: 1px solid var(--border); border-radius: 5px; }
dialog input, dialog select { height: 37px; }
dialog textarea { min-height: 86px; padding-top: 9px; resize: vertical; }
.agent-team-dialog { width: min(1320px, calc(100vw - 32px)) !important; max-height: calc(100vh - 32px); padding: 0; overflow: hidden; }
.agent-team-dialog form { max-height: calc(100vh - 34px); padding: 18px 20px 0; overflow: auto; }
.agent-team-dialog-header { position: sticky; top: -18px; z-index: 4; display: grid; grid-template-columns: 42px minmax(0, 1fr) 37px; align-items: start; gap: 13px; margin: -1px -1px 16px; padding: 18px 1px 14px; background: #0d1521; border-bottom: 1px solid var(--border-soft); }
.agent-team-dialog-header .dialog-mark { margin: 0; }
.agent-team-dialog-header h2 { margin-top: 2px; }
.agent-team-dialog-header p { max-width: 850px; margin: 6px 0 0; }
.agent-team-summary-grid { display: grid; grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(150px, .65fr)) minmax(190px, .9fr); gap: 10px; align-items: end; }
.agent-team-summary-grid label { margin-top: 0; }
.agent-team-summary-grid #agentTeamHistoryField { grid-column: 1 / -1; }
dialog label > small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 8px; font-weight: 600; line-height: 1.45; }
.agent-team-default-field { min-height: 37px; padding: 0 10px; color: #c4d4e2; background: #080e18; border: 1px solid var(--border); border-radius: 5px; }
.agent-team-default-field input { width: 15px; height: 15px; margin: 0; }
.agent-team-provenance { display: grid; grid-template-columns: .55fr .8fr 1.2fr 1.2fr; gap: 1px; margin-top: 13px; overflow: hidden; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: 7px; }
.agent-team-provenance > div { min-width: 0; padding: 10px 11px; background: #09111b; }
.agent-team-provenance span, .agent-team-provenance strong, .agent-team-provenance code { display: block; }
.agent-team-provenance span { color: var(--muted-2); font-size: 7px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.agent-team-provenance strong, .agent-team-provenance code { margin-top: 5px; overflow: hidden; color: #cce2ee; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.agent-team-provenance code { color: #9deefa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.agent-team-editor-note { margin: 12px 0 !important; padding: 9px 11px; color: #a9bac9 !important; background: #0a1823; border-left: 2px solid var(--cyan); border-radius: 0 5px 5px 0; }
.agent-team-members-section { margin-top: 12px; }
.agent-team-members-section .subsection-heading { margin-bottom: 9px; }
.agent-team-members-section h3 { margin: 4px 0 0; font-size: 13px; }
.agent-team-members-section .subsection-heading > strong { color: var(--cyan); font-size: 9px; }
.agent-team-members { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.agent-team-member-card { min-width: 0; padding: 12px; background: linear-gradient(145deg, #0a131f, #08101a); border: 1px solid #213249; border-radius: 8px; }
.agent-team-member-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.agent-team-member-card > header > div:first-child { min-width: 0; display: flex; align-items: center; gap: 8px; }
.agent-team-member-card h4 { min-width: 0; margin: 0; overflow: hidden; color: #e4edf5; font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.agent-team-role-badge { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; color: #b9f7ff; background: #123044; border: 1px solid #245f78; border-radius: 6px; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; }
.agent-team-member-controls { display: flex; align-items: flex-end; gap: 7px; }
.agent-team-member-controls label { margin: 0; white-space: nowrap; }
.agent-team-member-controls .checkbox-field { min-height: 30px; color: #b8c8d5; }
.agent-team-member-controls input[type="checkbox"] { width: 14px; height: 14px; margin: 0; }
.agent-team-member-controls input[type="number"] { width: 68px; height: 30px; margin-top: 4px; }
.agent-team-locked-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.agent-team-locked-grid label { margin: 0; color: #708197; font-size: 7px; letter-spacing: .05em; text-transform: uppercase; }
.agent-team-locked-grid input[readonly] { height: 30px; margin-top: 4px; color: #8ca0b4; background: #07101a; border-style: dashed; cursor: not-allowed; }
.agent-team-member-card > label { margin-top: 9px; }
.agent-team-member-card textarea { min-height: 74px; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.agent-team-member-card textarea[data-member-field="instructions"] { min-height: 92px; }
.agent-team-form-error { margin: 14px 0 0 !important; padding: 10px 12px; color: #ffd4dc !important; background: #30151c; border: 1px solid #6b2836; border-radius: 6px; }
.agent-team-dialog-actions { position: sticky; bottom: 0; z-index: 4; margin: 16px -20px 0; padding: 13px 20px; background: rgba(13, 21, 33, .97); border-top: 1px solid var(--border); backdrop-filter: blur(8px); }
.agent-team-action-spacer { flex: 1; }
.agent-team-list-card > div { min-width: 0; }
.agent-team-list-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-body { max-height: 190px; overflow: auto; padding: 10px; color: #b9d9e8; background: #050a11; border: 1px solid var(--border-soft); border-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.knowledge-layout { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(0, 1.5fr); gap: 12px; margin-top: 14px; }
.knowledge-layout article { min-width: 0; }
.knowledge-layout h3 { margin: 0 0 8px; font-size: 12px; }
.knowledge-results { max-height: 360px; overflow: auto; border: 1px solid var(--border-soft); border-radius: 5px; }
.knowledge-result { width: 100%; padding: 9px 10px; color: var(--text); background: #080e18; border: 0; border-bottom: 1px solid var(--border-soft); text-align: left; cursor: pointer; }
.knowledge-result:last-child { border-bottom: 0; }
.knowledge-result:hover { background: #102033; }
.knowledge-result strong, .knowledge-result small { display: block; }
.knowledge-result small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.knowledge-body { height: 330px; overflow: auto; margin: 0; padding: 10px; color: #b9d9e8; background: #050a11; border: 1px solid var(--border-soft); border-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.scope-entries { display: grid; gap: 5px; margin-top: 12px; }
.scope-entry { display: flex; justify-content: space-between; padding: 7px 9px; color: #aebbc9; background: #09111b; border: 1px solid var(--border-soft); border-radius: 5px; font-size: 9px; }
.plan-entries { display: grid; gap: 5px; max-height: 240px; overflow: auto; }
.plan-entry { display: grid; grid-template-columns: 24px minmax(0, 1fr) 108px; align-items: center; gap: 8px; padding: 7px 9px; background: #09111b; border: 1px solid var(--border-soft); border-radius: 5px; }
.plan-entry > span { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.plan-entry strong, .plan-entry small { display: block; }
.plan-entry strong { color: #d3dfeb; font-size: 9px; }
.plan-entry small { margin-top: 2px; color: var(--muted); font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; }
.plan-entry select { width: 100%; padding: 5px 6px; color: #cfe3f1; background: #07101a; border: 1px solid var(--border-soft); border-radius: 4px; font-size: 8px; }
.enrollment-result { display: grid; gap: 8px; margin-top: 14px; padding: 11px; background: #08121c; border: 1px solid #24536c; border-radius: 6px; }
.enrollment-result strong { color: var(--cyan); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.enrollment-result code { overflow-wrap: anywhere; color: #d9faff; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; }
.live-context-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 12px 0; padding: 10px; border: 1px solid var(--border-soft); border-radius: 8px; background: #0d1522; }
.live-context-toolbar label { min-width: 150px; margin: 0; }
.live-context-toolbar .checkbox-row { min-width: auto; align-self: center; }
.live-context-events { max-height: min(58vh, 620px); overflow: auto; scroll-behavior: smooth; }
.live-context-events .knowledge-card[hidden] { display: none; }
.live-context-events .knowledge-card { padding: 10px 11px; border-bottom: 1px solid var(--border-soft); }
.live-context-events .knowledge-card strong, .live-context-events .knowledge-card small { display: block; }
.live-context-events .knowledge-card small { margin: 4px 0 7px; color: var(--muted); font-size: 8px; }
.live-context-events .knowledge-body { height: auto; max-height: 160px; }
.live-context-unseen { color: #9fb3ca; font-size: 10px; font-weight: 700; }
.toast { position: fixed; right: 23px; bottom: 23px; z-index: 30; display: flex; align-items: center; gap: 8px; min-width: 225px; padding: 11px 13px; color: #dce8f3; background: #101a26; border: 1px solid #2d475d; border-radius: 7px; box-shadow: var(--shadow); font-size: 10px; transform: translateY(90px); opacity: 0; pointer-events: none; transition: 180ms ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { color: var(--green); }
.toast.warning svg { color: var(--amber); }
.toast.error svg { color: var(--red); }

body.compact .content { padding-top: 17px; }
body.compact .kpi-card { min-height: 107px; padding-top: 12px; padding-bottom: 12px; }
body.compact .kpi-card > strong { margin-top: 9px; font-size: 27px; }
body.compact th, body.compact td { padding-top: 7px; padding-bottom: 7px; }
body.compact .panel { min-height: 225px; }

@media (max-width: 1300px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .content { padding-left: 19px; padding-right: 19px; }
  .search-box { width: 240px; }
  .button { padding: 0 10px; }
  .tool-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .graph-paths-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav-list { display: flex; gap: 4px; overflow-x: auto; padding: 9px 11px; }
  .nav-label { display: none; }
  .nav-link { flex: 0 0 auto; }
  .nav-link.active::before { display: none; }
  .sidebar-footer { display: none; }
  .topbar { flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .search-box { width: min(100%,420px); }
  .getting-started { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lower-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .agent-team-summary-grid,.agent-team-provenance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-team-members { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .content { padding: 16px 12px 24px; }
  .kpi-grid,.lower-grid,.workflow-steps,.field-grid,.knowledge-layout { grid-template-columns: 1fr; }
  .tool-filters,.graph-paths-form { grid-template-columns: 1fr; }
  .graph-heading-actions { align-items: flex-end; flex-direction: column; }
  .tools-panel { grid-column: auto; }
  .top-actions .button { flex: 1; }
  dialog,dialog.wide-dialog { width: calc(100vw - 20px); max-width: none; }
  .agent-team-dialog form { padding-left: 12px; padding-right: 12px; }
  .agent-team-dialog-header { grid-template-columns: 37px minmax(0, 1fr) 37px; }
  .agent-team-summary-grid,.agent-team-provenance,.agent-team-members,.agent-team-locked-grid { grid-template-columns: 1fr; }
  .agent-team-member-card > header { display: grid; }
  .agent-team-dialog-actions { flex-wrap: wrap; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .agent-team-action-spacer { display: none; }
  .agent-team-dialog-actions .button { flex: 1 1 auto; }
}

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