@font-face {
  font-family: "Source Han Sans SC";
  src: url("/ops/fonts/SourceHanSansCN-VF.otf.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #F4F6FA;
  --surface: #FFFFFF;
  --surface-hover: #F1F5FA;
  --surface-selected: #EAF0FE;
  --line: #E4EAF3;
  --line-strong: #8290A6;
  --foreground: #25324B;
  --secondary: #52627A;
  --muted-foreground: #64748B;
  --primary: #275DCC;
  --primary-hover: #204FAA;
  --primary-foreground: #ffffff;
  --success: #167249;
  --warning: #9A5B00;
  --danger: #B42318;
  --radius-control: 10px;
  --radius-popover: 24px;
  --font-xs: 12px;
  --font-body: 14px;
  --font-section: 16px;
  --font-title: 26px;
  --line-xs: 18px;
  --line-label: 20px;
  --line-body: 22px;
  --line-section: 24px;
  --line-title: 36px;
  --weight-normal: 400;
  --weight-label: 500;
  --weight-strong: 600;
  --space-half: 2px;
  --space-1: 4px;
  --space-label: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --control-height: 40px;
  --control-inline-height: 28px;
  --control-touch-height: 44px;
  --nav-height: 44px;
  --header-height: 48px;
  --sidebar-width: 232px;
  --drawer-width: 560px;
  --editor-width: 880px;
  --reading-width: 960px;
  --success-surface: #EAF7F0;
  --danger-surface: #FFF0EE;
  --surface-subtle: #F7F9FD;
  --nav-background: #FFFFFF;
  --nav-hover: #F7F9FD;
  --nav-selected: #EAF0FE;
  --nav-foreground: #52627A;
  --nav-strong: #25324B;
  --nav-muted: #64748B;
  --warning-surface: #FFF6DF;
  --info: #275DCC;
  --info-surface: #EAF0FE;
  --radius-panel: 20px;
  --radius-logo: 12px;
  --radius-logo-login: 20px;
  --logo-size: 44px;
  --logo-mobile-size: 32px;
  --logo-login-size: 96px;
  --icon-size: 18px;
  --font-drawer: 20px;
  --font-login: 28px;
  --line-drawer: 28px;
  --line-login: 36px;
  --control-login-height: 40px;
  --login-reference-height: 460px;
  --tree-width: 240px;
  --panel-shadow: 0 2px 4px rgb(38 55 86 / .04), 0 10px 24px rgb(38 55 86 / .07), inset 0 1px 0 rgb(255 255 255 / .95);
  --popover-shadow: 0 16px 48px rgb(38 55 86 / .18);
  --surface-soft: #F7F9FD;
  --control-line: #8290A6;
  --login-width: 480px;
  --radius-tool: 16px;
  --space-10: 40px;
  --card-min: 280px;
  --card-hover-shadow: 0 4px 8px rgb(38 55 86 / .05), 0 14px 28px rgb(38 55 86 / .10);
  --tool-shadow: 0 4px 10px rgb(38 55 86 / .04), 0 18px 36px rgb(38 55 86 / .06);
  --button-shadow: 0 2px 3px rgb(38 55 86 / .08), inset 0 1px 0 #FFF;
  --primary-shadow: 0 4px 8px rgb(39 93 204 / .20), inset 0 1px 0 rgb(255 255 255 / .20);
  --icon-shadow: 0 3px 6px rgb(39 93 204 / .08), inset 0 1px 0 #FFF;
  --control-inset: inset 0 1px 2px rgb(38 55 86 / .04);
  --overlay: rgb(15 23 42 / .42);

}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--canvas); }
body {
  color: var(--foreground);
  background: var(--canvas);
  font-family: "Source Han Sans SC", sans-serif;
  font-size: var(--font-body);
  font-weight: var(--weight-normal);
  line-height: var(--line-body);
  font-synthesis: none;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; color: var(--muted-foreground); background: var(--surface-subtle); border-color: var(--line-strong); box-shadow: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden], .hidden { display: none !important; }

.workspace-shell, .ops-root, .stage { min-height: 100dvh; }
.stage { display: flex; flex-direction: column; justify-content: center; background: var(--canvas); }
.gate { width: min(var(--login-width), calc(100% - 32px)); margin: var(--space-6) auto; display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-10); border: 1px solid var(--surface); border-radius: var(--radius-popover); background: var(--surface); box-shadow: var(--panel-shadow); }
.gate-brand { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; }
.gate-logo { width: var(--logo-login-size); height: var(--logo-login-size); object-fit: contain; border-radius: var(--radius-logo-login); box-shadow: var(--icon-shadow); }
.gate-fields { display: flex; flex-direction: column; gap: var(--space-4); }
.gate-fields .status:empty { display: none; }
.gate .title { margin: 0; font-size: var(--font-title); line-height: var(--line-title); }
.gate .field, .gate .ink-btn { min-height: var(--control-login-height); }
.gate .ink-btn { width: 100%; margin-top: var(--space-2); }
.brand-logo { width: var(--logo-size); height: var(--logo-size); border-radius: var(--radius-logo); object-fit: contain; flex: 0 0 auto; box-shadow: var(--icon-shadow); }
.mobile-brand-logo { display: none; width: var(--logo-mobile-size); height: var(--logo-mobile-size); border-radius: var(--radius-control); object-fit: contain; }
.ui-icon { width: var(--icon-size); height: var(--icon-size); flex: 0 0 auto; }

.overview { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: var(--space-6); padding: var(--space-4); min-height: 100dvh; }
.app-sidebar { position: sticky; top: var(--space-4); height: calc(100dvh - 32px); min-height: 0; overflow-y: auto; border: 1px solid var(--surface); border-radius: var(--radius-popover); background: var(--nav-background); color: var(--nav-foreground); display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-6) var(--space-4); box-shadow: var(--tool-shadow); z-index: 30; }
.brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); min-height: var(--nav-height); }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-kicker { color: var(--nav-muted); font-size: var(--font-xs); line-height: var(--line-xs); font-weight: var(--weight-label); }
.brand-name { color: var(--nav-strong); font-size: var(--font-body); font-weight: var(--weight-strong); white-space: nowrap; }
.sidebar-nav { display: flex; flex-direction: column; gap: var(--space-5); }
.nav-group { display: flex; flex-direction: column; gap: var(--space-1); }
.nav-label {
  margin: 0 var(--space-3) var(--space-1);
  color: var(--nav-muted);
  font-size: var(--font-xs);
  font-weight: var(--weight-label);
}
.nav-item {
  position: relative;
  gap: var(--space-3);
  display: flex;
  align-items: center;
  min-height: var(--nav-height);
  width: 100%;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--nav-foreground);
  padding: 0 var(--space-3);
  text-align: left;
  font-size: var(--font-body);
  font-weight: var(--weight-label);
  transition: background-color 180ms, color 180ms;
}
.nav-item:hover { background: var(--nav-hover); color: var(--primary-hover); }
.nav-item[aria-current="page"] { background: var(--nav-selected); color: var(--primary); font-weight: var(--weight-strong); box-shadow: var(--control-inset); }
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--nav-hover);
  padding: var(--space-4) var(--space-3) 0;
  color: var(--nav-muted);
  font-size: var(--font-xs);
}
.app-main { min-width: 0; }
.workspace-header { position: sticky; top: 0; z-index: 20; min-height: var(--header-height); display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-4); background: var(--canvas); }
.breadcrumb { min-width: 0; overflow-wrap: anywhere; color: var(--muted-foreground); font-size: var(--font-body); font-weight: var(--weight-label); }
.breadcrumb strong { color: var(--foreground); font-weight: var(--weight-strong); }
.ghost-btn.mobile-menu-btn, .ghost-btn.sidebar-close { display: none; }
.page-body { width: 100%; margin: 0; padding: var(--space-4); }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-heading-copy { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.page-actions { display: flex; align-items: center; gap: var(--space-2); }
.page-heading .title { margin: 0; }
.title { font-size: var(--font-title); font-weight: var(--weight-strong); line-height: var(--line-title); letter-spacing: -.02em; }
.lede { margin: 0; color: var(--secondary); font-size: var(--font-body); line-height: var(--line-body); }
.page-heading .lede { max-width: 76ch; }
.page-tabs {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  margin: 0 0 var(--space-4);
  scrollbar-width: thin;
}
.page-tabs:empty { display: none; }
.view-tab {
  flex: 0 0 auto;
  min-height: var(--header-height);
  padding: 0 var(--space-half);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--secondary);
  font-size: var(--font-body);
  font-weight: var(--weight-label);
}
.view-tab:hover { color: var(--primary-hover); }
.view-tab[aria-current="true"] { color: var(--primary-hover); border-color: var(--primary); font-weight: var(--weight-strong); }
.zone { min-width: 0; }
#zone-consumption { display: flex; flex-direction: column; gap: var(--space-6); }
#zone-consumption > .toolbar { margin-bottom: 0; }
.consumption-notices { display: flex; flex-direction: column; gap: var(--space-2); }
.zone-title, .zone > .title, .zone > .lede { display: none; }
.cap-list, .cap-panel { min-width: 0; }
.cap-list { display: flex; flex-direction: column; gap: var(--space-6); }
.cap-panel, .work-surface { background: var(--surface); border: 1px solid var(--surface); border-radius: var(--radius-panel); padding: var(--space-5); box-shadow: var(--panel-shadow); }
.cap-panel { display: flex; flex-direction: column; gap: var(--space-4); }
#caps-catalog { background: transparent; border: 0; padding: 0; box-shadow: none; }
.cap-panel > .lede { max-width: 80ch; }
.cap-panel h2 { margin: 0; font-size: var(--font-section); font-weight: var(--weight-strong); line-height: var(--line-section); }
.cap-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); }
.cap-panel.org-connection-strip { flex-direction: row; align-items: center; padding: var(--space-3) var(--space-4); gap: var(--space-6); }
.org-connection-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-6); overflow-x: auto; white-space: nowrap; }
.org-connection-row > *, .org-connection-strip > button { flex-shrink: 0; }
.org-connection-summary { display: flex; align-items: center; gap: var(--space-6); }
.org-connection-checked, .org-connection-row > .lede { color: var(--secondary); font-size: var(--font-xs); line-height: var(--line-xs); }
.cap-live { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--font-body); font-weight: var(--weight-label); }
.cap-live.warn { color: var(--danger); }
.bot-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--muted-foreground); }
.bot-dot.on { background: var(--success); }
.bot-dot.warn { background: var(--danger); }

.ghost-btn, .ink-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: var(--control-height);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-control);
  font-size: var(--font-body);
  font-weight: var(--weight-label);
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms;
}
.ghost-btn { border: 1px solid var(--line); background: linear-gradient(var(--surface), var(--surface-subtle)); color: var(--foreground); box-shadow: var(--button-shadow); }
.ghost-btn:hover { background: var(--surface); border-color: var(--line-strong); }
.ink-btn { border: 1px solid var(--primary); background: linear-gradient(var(--info), var(--primary)); color: var(--primary-foreground); box-shadow: var(--primary-shadow); }
.ink-btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.ghost-btn:active:not(:disabled), .ink-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--control-inset); }
.ghost-btn:disabled, .ink-btn:disabled { color: var(--muted-foreground); background: var(--surface-subtle); box-shadow: none; }
.status { min-height: 1.5em; margin: 0; color: var(--secondary); font-size: var(--font-body); }
.status:empty { display: none; }
.status[data-kind="error"] { color: var(--danger); }
.status[data-kind="success"] { color: var(--success); }
label { display: flex; flex-direction: column; gap: var(--space-label); font-size: var(--font-body); font-weight: var(--weight-label); }
.field { min-height: var(--control-height); width: 100%; padding: var(--space-1) var(--space-3); border: 1px solid var(--control-line); border-radius: var(--radius-control); background: var(--surface-soft); color: var(--foreground); font-size: var(--font-body); box-shadow: var(--control-inset); }
.field:disabled { background: var(--surface-subtle); color: var(--muted-foreground); }
.field::placeholder { color: var(--muted-foreground); }
textarea.field { min-height: calc(var(--line-body) * 2 + var(--space-2)); resize: vertical; }
.sync-row, .org-actions, .org-file-row, .org-chips, .org-person-hit, .row-actions, .gov-kinds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.bot-form, .cap-form { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); max-width: var(--editor-width); }
.bot-form > label, .cap-form > label, .bot-form > fieldset, .cap-form > fieldset { width: 100%; }
.cap-form .row-actions { width: 100%; }
/* Model connection groups keep the drawer's form rhythm without changing other fieldsets. */
.llm-connection-group { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; margin: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-tool); }
.llm-connection-group > legend { padding: 0 var(--space-2); color: var(--foreground); font-size: var(--font-body); line-height: var(--line-body); font-weight: var(--weight-strong); }
.llm-aux-fields { display: flex; flex-direction: column; gap: var(--space-4); width: 100%; min-width: 0; }
.llm-connection-group > label, .llm-aux-fields > label, .llm-connection-group .secret-ops { width: 100%; min-width: 0; }
.secret-ops { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); margin: 0; padding: 0; border: 0; }
.secret-ops legend { padding: 0; margin-bottom: var(--space-3); font-size: var(--font-body); font-weight: var(--weight-strong); }
.secret-ops label, .inline-check { flex-direction: row; align-items: center; gap: var(--space-2); font-weight: var(--weight-normal); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); min-width: 18px; min-height: 18px; }
.status-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 0 var(--space-6); margin: 0; border-top: 1px solid var(--line); }
.status-slots > div { min-width: 0; padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.status-slots dt { color: var(--muted-foreground); font-size: var(--font-xs); line-height: var(--line-xs); font-weight: var(--weight-label); }
.status-slots dd { margin: var(--space-1) 0 0; color: var(--foreground); font-size: var(--font-body); overflow-wrap: anywhere; }

.table-wrap { width: 100%; min-width: 0; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: var(--font-body); }
th, td { padding: var(--space-2) var(--space-3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { height: 40px; background: var(--surface-subtle); color: var(--secondary); font-size: var(--font-body); font-weight: var(--weight-label); white-space: nowrap; }
tbody tr { min-height: 44px; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
td { overflow-wrap: anywhere; }
.employee-times { line-height: var(--line-label); font-variant-numeric: tabular-nums; }
#zone-people .toolbar label:first-child { min-width: 240px; }

.cap-panel.plain-panel { background: transparent; border: 0; padding: 0; box-shadow: none; }
.tool-card, .toolbar.tool-card { padding: var(--space-4); margin-bottom: var(--space-6); background: var(--surface); border: 1px solid var(--surface); border-radius: var(--radius-tool); box-shadow: var(--tool-shadow); }
.tool-card label:first-child { flex: 1; }
.toolbar.tool-card .field { max-width: none; }
.object-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min)), 1fr)); gap: var(--space-6); }
.employee-grid { container-type: inline-size; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.object-card, .record-card { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-5); border: 1px solid var(--surface); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--panel-shadow); }
.object-head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.object-head > div { min-width: 0; }
.object-title { margin: 0; font-size: var(--font-section); line-height: var(--line-section); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.object-subtitle { margin: var(--space-half) 0 0; color: var(--muted-foreground); font-size: var(--font-xs); line-height: var(--line-xs); overflow-wrap: anywhere; }
.object-mark { display: grid; place-items: center; flex: 0 0 auto; width: var(--logo-size); height: var(--logo-size); border-radius: var(--radius-tool); background: linear-gradient(var(--surface), var(--surface-selected)); color: var(--primary); box-shadow: var(--icon-shadow); font-size: var(--font-section); font-weight: var(--weight-strong); }
.object-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.object-card .detail-list { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-label) var(--space-3); }
.object-card .detail-list dt { font-size: var(--font-xs); color: var(--muted-foreground); }
.employee-card .detail-list dd { text-align: right; }
.object-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.object-foot .ghost-btn { min-height: var(--control-height); }
.open-object { border: 0; background: transparent; color: var(--primary); padding: 0; box-shadow: none; }
.object-grid > .empty-state, .record-list > .empty-state { grid-column: 1 / -1; border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--panel-shadow); }
#zone-people { container-type: inline-size; }
@container (max-width: 887px) { .employee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 583px) { .employee-grid { grid-template-columns: 1fr; } }
@container (min-width: 1500px) { .employee-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.fact-time { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Source Han Sans SC", monospace; font-size: var(--font-xs); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.table-wrap td.row-actions { display: table-cell; white-space: nowrap; }
.table-wrap td.row-actions > .ghost-btn { border-color: transparent; background: transparent; color: var(--primary-hover); }
.table-wrap td.row-actions > .ghost-btn:hover { background: var(--surface-selected); }
.table-wrap td.row-actions > button + button { margin-inline-start: var(--space-2); }
.row-actions { min-width: 150px; }
.row-actions .ghost-btn, .row-actions .ink-btn { min-height: var(--control-inline-height); padding: var(--space-half) var(--space-2); }
.cap-items { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.cap-items li { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); font-size: var(--font-body); overflow-wrap: anywhere; }
.cap-items .lede { font-size: var(--font-body); }
.mcp-item-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); color: var(--muted-foreground); font-size: var(--font-xs); }
.org-grid { display: grid; grid-template-columns: var(--tree-width) minmax(0, 1fr); gap: var(--space-6); }
.org-grid > * { min-width: 0; }
.tree-pane { display: flex; flex-direction: column; align-self: start; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--surface); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--panel-shadow); }
.tree-pane h3 { margin: 0; font-size: var(--font-body); line-height: var(--line-label); font-weight: var(--weight-strong); }
.tree-pane .org-tree { border: 0; border-radius: 0; background: var(--surface); min-height: 240px; }
.directory-pane { display: flex; flex-direction: column; gap: var(--space-4); }
.directory-context { display: inline; margin-left: var(--space-2); color: var(--secondary); font-size: var(--font-body); font-weight: var(--weight-normal); overflow-wrap: anywhere; }
.org-browser .org-tree-row .ghost-btn { border: 0; background: transparent; color: inherit; padding: var(--space-1) var(--space-2); text-align: left; justify-content: flex-start; min-width: 0; overflow-wrap: anywhere; box-shadow: none; }
.org-browser .org-tree-row:hover { background: var(--surface-hover); }
.org-browser .org-tree-row.is-active { background: var(--surface-selected); box-shadow: inset 3px 0 var(--primary); }
.org-browser .org-tree-node > summary::before { content: "›"; font-size: var(--font-section); color: var(--secondary); transform: rotate(0); }
.org-browser .org-tree-node[open] > summary::before { transform: rotate(90deg); }
#org-mgr-summary, #org-proj-summary { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); padding: var(--space-4); background: var(--surface-subtle); border-radius: var(--radius-control); }
#org-mgr-editor, #org-proj-editor { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-4); }
#org-contacts-report { border-left: 3px solid var(--line-strong); }
#org-roster-summary { color: var(--secondary); font-size: var(--font-xs); line-height: var(--line-xs); }
.asset-catalog-grid { grid-template-columns: var(--tree-width) minmax(0, 1fr); }
.asset-catalog-panel > .cap-head { display: none; }
.asset-object-panel > .cap-head { justify-content: flex-end; }
.asset-object-panel > .cap-head > h2 { display: none; }
.asset-identity { padding: var(--space-4); border: 0; border-left: 3px solid var(--primary); border-radius: var(--radius-control); background: var(--surface-subtle); max-width: var(--reading-width); }
.asset-identity dd, [id$="-scope-summary"] { white-space: pre-wrap; overflow-wrap: anywhere; }
.asset-card-facts dd { white-space: pre-wrap; line-height: var(--line-body); }
.asset-card .asset-updated { white-space: normal; font-variant-numeric: tabular-nums; }
.asset-range { line-height: var(--line-body); }
.asset-excerpt { margin: 0; color: var(--secondary); line-height: var(--line-section); overflow-wrap: anywhere; }
.catalog-tools { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-2); }
.catalog-tools .toolbar { margin-bottom: 0; }
.catalog-tools .toolbar label { flex: 1; }
.catalog-tools .toolbar .field { max-width: none; }
.learning-tools .toolbar label { max-width: 320px; }
.catalog-tools > h3 { margin: 0; }
.catalog-tools .page-tabs { margin-bottom: 0; }
.person-card .detail-list { grid-template-columns: 70px minmax(0, 1fr); }
.detail-list.asset-metadata { grid-template-columns: 100px minmax(0, 1fr) 100px minmax(0, 1fr); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); margin-bottom: var(--space-4); }
.asset-metadata dd { font-variant-numeric: tabular-nums; }
.content-section { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.content-section:last-child { border-bottom: 0; }
.read-content .content-section > h3 { margin: 0 0 var(--space-2); color: var(--secondary); font-size: var(--font-body); font-weight: var(--weight-label); }
.content-section p { margin: 0; line-height: var(--line-section); }
.content-section ol { margin: var(--space-2) 0 0; padding-left: var(--space-6); }
.content-section li { padding: var(--space-2) 0; }
.content-section[data-content-field="body"] { border-bottom: 0; padding-bottom: var(--space-6); }
.content-section[data-content-field="steps"] ol { counter-reset: skill-step; padding-left: 0; list-style: none; }
.content-section[data-content-field="steps"] > ol > li { counter-increment: skill-step; position: relative; padding: var(--space-3) var(--space-4) var(--space-3) var(--space-12); margin-bottom: var(--space-2); background: var(--surface-subtle); border-radius: var(--radius-control); }
.content-section[data-content-field="steps"] > ol > li::before { content: counter(skill-step); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 24px; height: 24px; color: var(--primary); background: var(--surface-selected); border-radius: var(--radius-control); font-weight: var(--weight-strong); }
.content-section[data-content-field="tools"] ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding-left: 0; }
.content-section[data-content-field="tools"] li { padding: var(--space-1) var(--space-2); background: var(--surface-subtle); border-radius: var(--radius-control); }
.content-section[data-content-field="human_confirmations"] { padding: var(--space-4); background: var(--warning-surface); border-radius: var(--radius-control); }
[id$="-scope-view"], [id$="-versions-view"] { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
[id$="-scope-view"] > h3 { margin-top: var(--space-4); }
[id$="-scope-view"] > p { margin: 0; }
[id$="-scope-preview"] { width: 100%; }
[id$="-create-form"] { max-width: var(--editor-width); }
.editor .field-group { padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.editor .field-group:last-child { border-bottom: 0; }
.asset-preview { border-left: 3px solid var(--line-strong); }
.tree-pane .asset-tree-button { border: 0; background: transparent; color: var(--secondary); box-shadow: none; }
.tree-pane .asset-tree-button:hover { background: var(--surface-hover); }
.tree-pane .asset-tree-button[aria-current="true"] { background: var(--surface-selected); color: var(--primary-hover); box-shadow: inset 3px 0 var(--primary); }
.asset-collection-tabs { margin-bottom: 0; }
.asset-scope-row { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); }
.asset-scope-row .toolbar label { flex: 1 1 180px; min-width: 0; }
.asset-scope-row .toolbar .field { max-width: none; }
.asset-preview { padding: var(--space-3); background: var(--surface); border-radius: var(--radius-control); overflow-wrap: anywhere; }
.asset-tree-button { justify-content: flex-start; width: 100%; text-align: left; overflow-wrap: anywhere; white-space: normal; }
.asset-tree-button[aria-current="true"] { background: var(--surface-selected); color: var(--primary-hover); }
.asset-tree-disclosure, .asset-tree-spacer { flex: 0 0 24px; min-width: 24px; }
.asset-tree-disclosure { padding: 0; border-color: transparent; background: transparent; box-shadow: none; }
.org-tree, .org-scroll { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-control); }
.org-tree-row { padding-inline-start: calc(var(--space-2) + var(--tree-depth, 0) * var(--space-4)); display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-height); padding-right: var(--space-3); font-size: var(--font-body); }
.org-tree-row.is-active { background: var(--surface-selected); color: var(--primary-hover); }
.org-tree-node { border: 0; }
.org-tree-node > summary { cursor: pointer; list-style: none; }
.org-tree-node > summary::-webkit-details-marker { display: none; }
.org-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-height); padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface); font-size: var(--font-body); }
.org-pre { width: 100%; min-height: 80px; max-height: 360px; overflow: auto; margin: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); font-family: ui-monospace, "Source Han Sans SC", monospace; font-size: var(--font-xs); white-space: pre-wrap; overflow-wrap: anywhere; }
.org-pre:empty { display: none; }
.org-people-move, .org-grant-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.org-people-move .field { max-width: 160px; }
.org-attr .field { min-width: 112px; }
.org-purge-list { margin: 0; padding-left: var(--space-6); font-size: var(--font-body); }
.gov-kinds [data-active="true"], #org-proj-tabs [data-active="true"] { background: var(--surface-selected); border-color: var(--primary); color: var(--primary-hover); }

.purge-mask, .sidebar-mask { position: fixed; inset: 0; z-index: 40; background: var(--overlay); }
.purge-mask { display: grid; place-items: center; padding: var(--space-4); }
.purge-card { display: flex; flex-direction: column; gap: var(--space-4); width: min(var(--drawer-width), 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: var(--space-6); border-radius: var(--radius-popover); background: var(--surface); box-shadow: var(--popover-shadow); }
.purge-card h2 { margin: 0; font-size: var(--font-section); font-weight: var(--weight-strong); }
.purge-card p { margin: 0; font-size: var(--font-body); }
.purge-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

.cap-panel h3 { margin: 0; font-size: var(--font-body); line-height: var(--line-label); font-weight: var(--weight-strong); }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3); margin-bottom: var(--space-3); }
.toolbar label { min-width: 140px; }
.toolbar .field { max-width: 320px; }
.text-btn { border: 0; background: transparent; color: var(--primary-hover); padding: var(--space-half) var(--space-2); min-height: var(--control-inline-height); font-size: var(--font-body); }
.detail-list { margin: 0; display: grid; grid-template-columns: minmax(100px, 160px) minmax(0, 1fr); gap: var(--space-3) var(--space-4); }
.detail-list dt { color: var(--secondary); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.drawer { border-radius: var(--radius-popover) 0 0 var(--radius-popover); margin: 0 0 0 auto; width: min(var(--drawer-width), 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--line); padding: var(--space-6); color: var(--foreground); background: var(--surface); box-shadow: var(--popover-shadow); }
.drawer::backdrop { background: var(--overlay); }
.drawer[open] { display: flex; flex-direction: column; gap: var(--space-4); }
.drawer h2 { margin: 0; font-size: var(--font-drawer); line-height: var(--line-drawer); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.drawer-head h2 { overflow-wrap: anywhere; min-width: 0; }
.drawer-close { margin-left: auto; flex: 0 0 auto; }
.fact-section { display: flex; flex-direction: column; gap: var(--space-3); }
.fact-section h3 { margin: 0; font-size: var(--font-body); font-weight: var(--weight-strong); }
.drawer form { width: 100%; }
.drawer .status-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-stack { display: flex; flex-direction: column; gap: var(--space-4); width: 100%; }
.field-group { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); }
.field-group > .ghost-btn { align-self: flex-start; }
.editor { max-width: var(--editor-width); }
.read-content { max-width: var(--reading-width); }
.read-content h3 { margin: var(--space-4) 0 var(--space-2); }
.read-content p { white-space: pre-wrap; overflow-wrap: anywhere; }
.edit-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.error-text { color: var(--danger); }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-control); color: var(--secondary); background: var(--surface-hover); white-space: nowrap; font-size: var(--font-body); font-weight: var(--weight-label); }
.status-badge[data-state="failed"] { color: var(--danger); background: var(--danger-surface); }
.status-badge[data-state="ready"] { color: var(--success); background: var(--success-surface); }
.status-badge[data-state="starting"], .status-badge[data-tone="info"] { color: var(--info); background: var(--info-surface); }
.status-badge[data-tone="success"] { color: var(--success); background: var(--success-surface); }
.status-badge[data-tone="warning"] { color: var(--warning); background: var(--warning-surface); }
.status-badge[data-tone="danger"] { color: var(--danger); background: var(--danger-surface); }
#zone-caps .cap-list { container-type: inline-size; }
.capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.capability-card { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; padding: var(--space-6); background: var(--surface); border: 1px solid var(--surface); border-radius: var(--radius-panel); box-shadow: var(--panel-shadow); }
.capability-head { display: flex; align-items: center; gap: var(--space-3); }
.capability-icon { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border-radius: var(--radius-tool); background: linear-gradient(var(--surface), var(--surface-selected)); color: var(--primary); box-shadow: var(--icon-shadow); }
.capability-card h3 { margin: 0; font-size: var(--font-section); line-height: var(--line-section); }
.capability-card .detail-list { grid-template-columns: 88px minmax(0, 1fr); gap: var(--space-2) var(--space-3); }
.capability-error { margin: 0; padding: var(--space-3); color: var(--danger); background: var(--danger-surface); border-radius: var(--radius-control); overflow-wrap: anywhere; }
.capability-purpose { margin: var(--space-half) 0 0; color: var(--secondary); font-size: var(--font-xs); }
.capability-foot { margin-top: auto; display: flex; align-items: center; justify-content: flex-end; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-8) var(--space-4); text-align: center; color: var(--secondary); }
.empty-state .ui-icon { width: 28px; height: 28px; color: var(--muted-foreground); margin-bottom: var(--space-2); }
.empty-state p { margin: 0; }
.empty-state strong { font-weight: var(--weight-label); color: var(--foreground); }
.sync-row > span { display: none; }
@container (max-width: 620px) { .capability-grid { grid-template-columns: 1fr; } }
.record-content { display: flex; flex-direction: column; gap: var(--space-4); }
.record-list { display: flex; flex-direction: column; gap: var(--space-4); }
.learning-task-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.learning-task-card .object-head { flex-wrap: wrap; }
.learning-task-card .object-foot { grid-column: 2; grid-row: 1; border: 0; padding-top: 0; }
.learning-task-card .detail-list { grid-column: 1 / -1; grid-template-columns: repeat(3, auto minmax(0, 1fr)); }
.learning-task-card .evidence-error { grid-column: 1 / -1; }
.record-status { display: flex; flex-direction: row; align-items: center; gap: var(--space-3); }
.evidence-error { margin: 0; padding: var(--space-4); color: var(--danger); background: var(--danger-surface); border-radius: var(--radius-control); overflow-wrap: anywhere; }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.evidence-section { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-5); border: 1px solid var(--surface); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--panel-shadow); }
.evidence-section .open-object { align-self: flex-start; text-align: left; overflow-wrap: anywhere; }
.evidence-section > h2 { margin: 0; }
.cap-items li.evidence-record { border-left: 3px solid var(--line-strong); padding-left: var(--space-4); }
.diagnostic { padding-top: var(--space-3); color: var(--secondary); }
.diagnostic > summary { cursor: pointer; margin-bottom: var(--space-3); }
.context-panel > .cap-head > h2, #gov-object-label { display: none; }
.context-panel > .row-actions .ghost-btn { min-height: var(--control-height); }
#gov-rank-rows td:not(:first-child):not(:last-child) { font-variant-numeric: tabular-nums; }
@media (pointer: coarse) {
  .ghost-btn, .ink-btn, .text-btn, .row-actions .ghost-btn, .row-actions .ink-btn, .nav-item, .field { min-height: var(--control-touch-height); }
  .field { font-size: var(--font-section); }
}
@media (max-width: 1023px) {
  .overview { display: block; padding: var(--space-3); }
  .app-sidebar { position: fixed; left: var(--space-3); top: var(--space-3); width: min(280px, calc(100vw - 48px)); height: calc(100dvh - 24px); transform: translateX(calc(-100% - 24px)); transition: transform 180ms; }
  .overview.menu-open .app-sidebar { transform: translateX(0); z-index: 50; }
  .ghost-btn.mobile-menu-btn, .ghost-btn.sidebar-close { display: inline-flex; }
  .sidebar-close { margin-left: auto; }
  .brand { padding: 0; gap: var(--space-2); }
  .sidebar-close { background: var(--nav-hover); color: var(--nav-strong); border-color: var(--nav-muted); }
  .mobile-brand-logo { display: block; }
  .org-grid { grid-template-columns: 1fr; }
  .tree-pane { padding: var(--space-4); }
  .tree-pane .org-tree { min-height: 0; max-height: 240px; }
  .workspace-header { padding: 0 var(--space-2); }
  .page-body { padding: var(--space-2); }
}
@media (max-width: 767px) {
  .ghost-btn, .ink-btn, .text-btn, .row-actions .ghost-btn, .row-actions .ink-btn, .nav-item, .field { min-height: var(--control-touch-height); }
  .field { font-size: var(--font-section); }
  .gate { margin: var(--space-4) auto; padding: var(--space-6); }
  .gate .field, .gate .ink-btn { min-height: var(--control-touch-height); }
  .work-surface, .cap-panel, .capability-card { padding: var(--space-4); }
  .page-heading { align-items: flex-start; }
  .page-actions { width: 100%; }
  .evidence-grid { grid-template-columns: 1fr; }
  .learning-task-card { grid-template-columns: 1fr; }
  .learning-task-card .detail-list { grid-template-columns: auto minmax(0, 1fr); }
  .learning-task-card .object-foot { grid-column: 1; grid-row: auto; justify-content: flex-end; }
  .drawer { width: 100%; padding: var(--space-4); }
  .detail-list.asset-metadata { grid-template-columns: 100px minmax(0, 1fr); }
  .workspace-header { min-height: var(--header-height); padding: 0; }
  .page-body { padding: var(--space-3) 0; }
  .title { font-size: var(--font-title); }
  .page-tabs { gap: var(--space-5); }
  .org-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .status-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); }
  .cap-head { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .ghost-btn:active, .ink-btn:active { transform: none; }
}

.enterprise-access-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); overflow-wrap: anywhere; }
.enterprise-access-row .lede { margin: 0; min-width: 0; }
.enterprise-access-row button { flex: 0 0 auto; }

/* MCP selection keeps full organization paths readable inside the shared drawer. */
.scope-picker .org-tree { flex: 1 0 180px; min-height: 180px; }
.scope-rule { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-block: var(--space-2); border-bottom: 1px solid var(--line); }
.scope-rule > span:first-child { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.scope-rule .capability-error { flex-basis: 100%; margin: 0; }
.scope-descendant { display: flex; align-items: center; gap: var(--space-2); font-size: var(--font-body); }
.scope-descendant .field { width: auto; }
.scope-tree-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2); min-height: var(--control-height); overflow-wrap: anywhere; }
.scope-tree-row > span:not(.scope-tree-toggle) { flex: 1 1 150px; min-width: 0; }
.scope-tree-children { padding-left: var(--space-3); }
.scope-tree-toggle { color: var(--secondary); }
.scope-picker details[open] > summary > .scope-tree-toggle { transform: rotate(90deg); }
