:root {
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #17212b;
  --ink-soft: #52606d;
  --ink-faint: #85909c;
  --line: #e4e9ee;
  --line-strong: #d4dce4;
  --blue: #2167d5;
  --blue-dark: #154a9e;
  --blue-soft: #eaf2ff;
  --teal: #087f78;
  --teal-soft: #e6f6f3;
  --amber: #a46306;
  --amber-soft: #fff5dd;
  --red: #b6363b;
  --red-soft: #fff0f0;
  --sidebar: #13212c;
  --sidebar-soft: #1b2d3b;
  --shadow: 0 8px 24px rgba(20, 34, 48, .06);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
.is-hidden { display: none !important; }
html, body { overflow-x: hidden; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(33, 103, 213, .24); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; top: 0; left: 0; z-index: 20; width: 248px; height: 100vh; height: 100dvh; background: var(--sidebar); color: #e7eef4; display: flex; flex-direction: column; padding: 25px 15px 16px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 27px; }
.brand-mark { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; background: #53b7af; color: #10242c; font-weight: 800; font-size: 18px; }
.brand strong { display: block; letter-spacing: .02em; font-size: 15px; }
.brand span { display: block; margin-top: 3px; color: #91a4b3; font-size: 11px; }
.workspace-picker { padding: 0 7px 22px; border-bottom: 1px solid rgba(224, 237, 246, .1); }
.eyebrow, .nav-label { display: block; text-transform: uppercase; letter-spacing: .12em; color: #7e95a5; font-size: 10px; font-weight: 700; }
.project-switcher { width: 100%; border: 1px solid rgba(210, 228, 240, .16); border-radius: 7px; background: var(--sidebar-soft); color: inherit; display: flex; align-items: center; gap: 9px; margin-top: 9px; padding: 10px 9px; text-align: left; }
.project-switcher:hover { border-color: rgba(210, 228, 240, .35); }
.project-dot { width: 8px; height: 8px; background: #51b8a9; border-radius: 50%; flex: 0 0 auto; }
.project-switcher-copy { min-width: 0; flex: 1; }
.project-switcher-copy strong, .project-switcher-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-switcher-copy strong { color: #edf5f8; font-size: 12px; font-weight: 600; }
.project-switcher-copy small { margin-top: 3px; color: #8da2b0; font-size: 10px; }
.chevron { color: #91a4b3; font-size: 17px; line-height: 1; }
.nav-groups { min-height: 0; flex: 1 1 auto; overflow-y: auto; scrollbar-width: none; padding: 16px 0; }
.nav-groups::-webkit-scrollbar { display: none; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-label { padding: 0 12px 8px; }
.nav-item { width: 100%; border: 0; border-radius: 6px; background: transparent; color: #a9b8c3; display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 2px 0; text-align: left; font-size: 13px; transition: background .16s, color .16s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #edf5f8; }
.nav-item.is-active { background: #25465c; color: #fff; box-shadow: inset 3px 0 #63c0b5; }
.nav-icon { width: 17px; color: #82a3b7; text-align: center; font-size: 15px; }
.nav-item.is-active .nav-icon { color: #76d1c6; }
.nav-count { margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 10px; background: #d89532; color: #17212b; font-size: 10px; font-weight: 800; }
.sidebar-bottom { flex: 0 0 auto; margin-top: auto; }
.user-chip strong, .user-chip small { display: block; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 9px 8px 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #d4e5f4; color: #244b6d; font-size: 12px; font-weight: 700; }
.user-chip strong { font-size: 11px; color: #e7eef4; font-weight: 600; }
.user-chip small { color: #7f98a8; margin-top: 2px; font-size: 10px; }
.user-chip > span { min-width: 0; flex: 1; }
.user-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { border: 0; background: transparent; color: var(--ink-faint); width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 6px; font-weight: 700; letter-spacing: 2px; }
.icon-button:hover { background: rgba(110, 130, 147, .1); color: var(--ink); }
.sidebar .icon-button { color: #8da2b0; }

.main-content { min-width: 0; flex: 1; margin-left: 248px; }
.topbar { height: 65px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 3.4vw, 48px); gap: 18px; }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 9px; color: var(--ink-faint); font-size: 12px; }
.breadcrumbs strong { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.breadcrumb-separator { color: #b4bec7; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.scoring-mode-control { display: flex; align-items: center; gap: 7px; color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.scoring-mode-control select { min-height: 34px; max-width: 155px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink-soft); padding: 0 28px 0 9px; font: inherit; font-size: 11px; }
.scoring-mode-control select:focus { outline: 2px solid rgba(33, 103, 213, .18); border-color: var(--blue); }
.sync-status { color: var(--ink-faint); font-size: 11px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.button { min-height: 34px; border-radius: 6px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; font-size: 12px; font-weight: 600; transition: background .16s, border-color .16s, color .16s, transform .16s; }
.button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button-quiet { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.button-quiet:hover { background: var(--surface-muted); color: var(--ink); }
.button-danger { background: var(--red-soft); border-color: #f4cdd0; color: var(--red); }
.button-danger:hover { background: #ffe4e4; }
.button-small { min-height: 30px; padding: 0 10px; font-size: 11px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 700; white-space: nowrap; }
.text-button:hover { color: var(--blue-dark); }

.content-wrap { max-width: 1480px; margin: 0 auto; padding: 31px clamp(20px, 3.4vw, 48px) 60px; }
.page-heading { display: flex; justify-content: space-between; gap: 25px; align-items: flex-start; margin-bottom: 24px; }
.page-heading > div:first-child { min-width: 0; }
.heading-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 700; }
.status-in-progress { color: #176b65; background: var(--teal-soft); }
.status-done { color: #176b65; background: var(--teal-soft); }
.status-waiting { color: #8e5b08; background: var(--amber-soft); }
.status-draft { color: #5e6d7a; background: #edf1f4; }
.status-blocked { color: var(--red); background: var(--red-soft); }
.muted { color: var(--ink-faint); font-size: 11px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; letter-spacing: 0; font-weight: 750; }
#page-title { overflow-wrap: anywhere; word-break: break-word; }
.project-title-row { min-width: 0; display: flex; align-items: center; gap: 8px; }
.project-name-edit-button { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-faint); font-size: 16px; line-height: 1; transition: background .16s, color .16s; }
.project-name-edit-button:hover { background: var(--surface-muted); color: var(--teal); }
.project-name-edit-button:focus-visible { outline: 2px solid rgba(8,127,120,.2); outline-offset: 1px; }
.page-heading p { color: var(--ink-soft); font-size: 13px; margin-top: 9px; }
.divider-dot { width: 3px; height: 3px; display: inline-block; vertical-align: middle; border-radius: 50%; background: #abb6bf; margin: 0 7px; }
.heading-meta { display: flex; align-items: center; gap: 25px; padding-top: 7px; }
.heading-meta > div span, .heading-meta > div strong { display: block; }
.heading-meta > div span { color: var(--ink-faint); font-size: 10px; margin-bottom: 4px; }
.heading-meta > div strong { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.icon-button.outlined { border: 1px solid var(--line-strong); background: #fff; letter-spacing: 1px; }

.notice-bar { min-height: 52px; border: 1px solid #ecdcae; border-left: 3px solid #db9a2d; border-radius: 7px; background: #fffaf0; display: flex; align-items: center; gap: 11px; padding: 8px 13px; margin-bottom: 23px; }
.notice-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #f3d28e; color: #76510b; font-size: 12px; font-weight: 800; }
.notice-bar > div { min-width: 0; flex: 1; display: flex; gap: 10px; align-items: baseline; }
.notice-bar strong { color: #76510b; font-size: 12px; }
.notice-bar div span { color: #927746; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.view { animation: fade-in .2s ease-out; }
@keyframes fade-in { from { opacity: .3; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.project-overview-tabs { min-height: 44px; display: flex; align-items: stretch; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line-strong); margin-bottom: 18px; scrollbar-width: thin; }
.project-overview-tabs button { min-width: max-content; min-height: 44px; flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-soft); padding: 0 18px; font-size: 12px; font-weight: 650; }
.project-overview-tabs button:hover { background: #f0f4f7; color: var(--ink); }
.project-overview-tabs button.is-active { border-bottom-color: var(--blue); color: var(--blue-dark); }
.segmented-control { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; padding: 3px; }
.segmented-control button { min-height: 29px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); padding: 0 12px; font-size: 11px; font-weight: 650; }
.segmented-control button.is-active { background: var(--ink); color: #fff; }
.classification-layout { min-height: 650px; display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.48fr); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.issue-onboarding-choice { display:flex; gap:12px; flex-wrap:wrap; padding:28px 0; }
.classification-tree-pane { min-width: 0; border-right: 1px solid var(--line); background: #fafbfd; }
.classification-tree-pane > header { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 16px; }
.classification-tree-pane > header div strong, .classification-tree-pane > header div span { display: block; }
.classification-tree-pane > header strong { font-size: 13px; }
.classification-tree-pane > header span, .classification-tree-pane > header small { color: var(--ink-faint); font-size: 10px; margin-top: 3px; }
.classification-tree-scroll { max-height: 720px; overflow: auto; padding: 10px; }
.classification-tree, .classification-tree ul { list-style: none; margin: 0; padding: 0; }
.classification-tree ul { margin-left: 18px; border-left: 1px solid var(--line); padding-left: 6px; }
.classification-tree-row { width: 100%; min-height: 35px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink-soft); padding: 5px 8px; text-align: left; }
.classification-tree-row:hover { background: #eef3f7; color: var(--ink); }
.classification-tree-row.is-selected { border-color: #a9c5e9; background: var(--blue-soft); color: var(--blue-dark); }
.classification-tree-row.is-archived .tree-node-name::after { content: "已归档"; display: inline-block; margin-left: 7px; color: var(--teal); font-size: 9px; font-weight: 750; }
.classification-tree-row small { color: var(--ink-faint); font-size: 9px; white-space: nowrap; }
.tree-toggle { color: var(--ink-faint); text-align: center; }
.tree-node-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.classification-detail-pane { min-width: 0; padding: 20px; }
.catalog-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--ink-faint); text-align: center; }
.catalog-empty strong { color: var(--ink-soft); font-size: 14px; }
.catalog-empty span { max-width: 420px; font-size: 11px; line-height: 1.6; }
.catalog-empty.compact { min-height: 70px; }
.assignment-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 14px; }
.assignment-summary > div span, .assignment-summary > div strong { display: block; }
.assignment-summary span { color: var(--ink-faint); font-size: 10px; }
.assignment-summary strong { margin-top: 5px; font-size: 12px; line-height: 1.55; }
.assignment-factor-list { display: grid; gap: 9px; max-height: 525px; overflow: auto; padding-right: 4px; }
.assignment-factor { min-height: 112px; display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 9px; border: 1px solid var(--line); border-radius: 7px; padding: 13px; background: #fff; }
.assignment-factor.is-selected { border-color: #b9cfeb; box-shadow: inset 3px 0 var(--blue); }
.assignment-factor-check { padding-top: 2px; }
.assignment-factor-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.factor-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.factor-card-heading strong { font-size: 12px; }
.factor-card-heading span { color: var(--blue-dark); font-size: 11px; font-weight: 750; }
.assignment-factor p, .factor-library-card > p { color: var(--ink-soft); font-size: 10px; line-height: 1.6; margin-top: 5px; }
.factor-card-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; color: var(--ink-faint); font-size: 9px; }
.document-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.factor-binding-warning { display: block; color: var(--amber); font-size: 9px; margin-top: 8px; }
.factor-completeness-warning { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; border: 1px solid #ecdcae; border-left: 3px solid #d7972b; border-radius: 6px; background: #fffaf0; padding: 10px 12px; margin-bottom: 12px; }
.factor-completeness-warning strong { color: #76510b; font-size: 10px; }
.factor-completeness-warning span { color: #927746; font-size: 9px; }
.factor-completeness-warning .button { grid-column: 2; grid-row: 1 / span 2; }
.assignment-factor details { margin-top: 9px; }
.assignment-factor summary { color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 650; }
.skill-copy { color: var(--ink-soft); font-size: 10px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.assignment-factor details .skill-copy { border-left: 2px solid #cbd7df; padding-left: 9px; margin-top: 7px; }
.classification-confirm-bar { min-height: 52px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 14px; }
.classification-confirm-bar small { min-width: 0; flex: 1; color: var(--ink-faint); font-size: 9px; line-height: 1.5; }
.tree-node-editor { max-width: 880px; margin: 0 auto; }
.tree-editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.tree-editor-header span, .tree-editor-header small { color: var(--ink-faint); font-size: 9px; }
.tree-editor-header h3 { font-size: 16px; margin: 4px 0; }
.tree-editor-grid, .factor-library-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.tree-editor-grid label, .factor-library-form label, .skill-editor { display: grid; gap: 6px; }
.tree-editor-grid label > span, .factor-library-form label > span, .skill-editor > span > strong { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.tree-editor-grid input, .tree-editor-grid select, .tree-editor-grid textarea, .factor-library-form input, .factor-library-form select, .factor-library-form textarea, .skill-editor textarea, .catalog-search input { width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); padding: 8px 9px; font-size: 11px; }
.tree-field-wide, .factor-form-wide { grid-column: 1 / -1; }
.tree-node-actions { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 15px 0; }
.tree-node-actions .button-danger { margin-left: auto; }
.tree-editor-note { border: 1px solid #d9e3eb; border-radius: 6px; background: #f7fafc; color: var(--ink-soft); padding: 13px; margin-top: 16px; font-size: 10px; }
.tree-factor-bindings { margin-top: 16px; }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.subsection-heading strong, .subsection-heading span { display: block; }
.subsection-heading strong { font-size: 12px; }
.subsection-heading span { color: var(--ink-faint); font-size: 9px; margin-top: 3px; }
.tree-factor-options, .factor-policy-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 290px; overflow: auto; }
.tree-factor-options label, .factor-policy-option { min-width: 0; display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 9px; }
.tree-factor-options input, .factor-policy-option input { flex: 0 0 auto; accent-color: var(--blue); }
.tree-factor-options label > span, .factor-policy-option > span { min-width: 0; }
.tree-factor-options strong, .tree-factor-options small, .factor-policy-option strong, .factor-policy-option small { display: block; }
.tree-factor-options strong, .factor-policy-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.tree-factor-options small, .factor-policy-option small { color: var(--ink-faint); font-size: 8px; margin-top: 3px; }
.tree-save-bar { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.tree-save-bar small { min-width: 0; flex: 1; color: var(--ink-faint); font-size: 9px; }
.catalog-search { min-width: 260px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; padding-left: 9px; color: var(--ink-faint); }
.catalog-search input { border: 0; padding-left: 0; outline: 0; }
.factor-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.factor-library-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); padding: 15px; }
.factor-library-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.factor-library-card > header h3 { font-size: 13px; line-height: 1.35; margin: 5px 0 3px; }
.factor-library-card > header small { color: var(--ink-faint); font-size: 8px; overflow-wrap: anywhere; }
.factor-dimension { color: var(--teal); font-size: 9px; font-weight: 750; }
.factor-card-section { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.factor-card-section > strong { display: block; color: var(--ink-soft); font-size: 9px; margin-bottom: 5px; }
.factor-card-section .skill-copy { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.factor-library-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); margin-top: auto; padding-top: 12px; }
.factor-library-card > footer small { color: var(--ink-faint); font-size: 8px; }
.factor-library-card > footer div { display: flex; gap: 6px; }
.new-factor-panel { border: 1px solid #b9cfeb; border-radius: 8px; background: #fff; box-shadow: var(--shadow); padding: 16px; margin-bottom: 15px; }
.factor-library-editor { grid-column: 1 / -1; border-top: 2px solid var(--blue); margin-top: 14px; padding-top: 2px; }
.factor-library-editor .factor-library-form { margin-top: 14px; }
.factor-editor-section { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 14px; }
.skill-editor > span small { display: block; color: var(--ink-faint); font-size: 9px; margin-top: 3px; }
.factor-library-editor-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi-card { min-height: 118px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px 17px; position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: -20px; top: -24px; width: 82px; height: 82px; border-radius: 50%; background: var(--blue-soft); opacity: .72; }
.kpi-card.teal::after { background: var(--teal-soft); }
.kpi-card.amber::after { background: var(--amber-soft); }
.kpi-card.red::after { background: var(--red-soft); }
.kpi-label { position: relative; z-index: 1; color: var(--ink-faint); font-size: 11px; }
.kpi-value { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 5px; margin-top: 12px; font-size: 27px; font-weight: 750; letter-spacing: 0; }
.kpi-value small { color: var(--ink-faint); font-size: 11px; font-weight: 500; }
.kpi-meta { position: relative; z-index: 1; margin-top: 7px; color: var(--ink-soft); font-size: 10px; }
.kpi-meta.positive { color: var(--teal); }
.kpi-meta.warning { color: var(--amber); }
.kpi-meta.danger { color: var(--red); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.43fr) minmax(320px, .87fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.panel-header { min-height: 59px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; gap: 12px; }
.panel-title { display: flex; align-items: center; gap: 9px; }
.panel-title h2, .panel-title h3 { font-size: 14px; font-weight: 700; }
.panel-subtitle { color: var(--ink-faint); font-size: 11px; }
.panel-body { padding: 18px; }
.panel-link { border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 700; }

.workflow-track { padding: 6px 4px 4px; }
.workflow-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 11px; position: relative; padding: 0 0 21px; }
.workflow-item:last-child { padding-bottom: 0; }
.workflow-item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 29px; bottom: 0; width: 1px; background: var(--line-strong); }
.workflow-marker { width: 31px; height: 31px; position: relative; z-index: 1; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-faint); font-size: 12px; font-weight: 750; }
.workflow-item.complete .workflow-marker { border-color: #9bdbd1; background: var(--teal-soft); color: var(--teal); }
.workflow-item.active .workflow-marker { border: 2px solid var(--blue); background: var(--blue-soft); color: var(--blue); box-shadow: 0 0 0 4px rgba(33,103,213,.08); }
.workflow-item.blocked .workflow-marker { border-color: #e6a9ad; background: var(--red-soft); color: var(--red); }
.workflow-item.locked .workflow-marker { background: #f6f8fa; }
.workflow-copy { padding-top: 2px; min-width: 0; }
.workflow-copy strong { display: block; font-size: 12px; font-weight: 700; }
.workflow-copy p { color: var(--ink-soft); font-size: 11px; line-height: 1.55; margin-top: 4px; }
.workflow-time { color: var(--ink-faint); font-size: 10px; white-space: nowrap; padding-top: 4px; }
.workflow-state { display: inline-flex; margin-top: 7px; }

.gate-panel { border-top: 3px solid #d7972b; }
.gate-panel.is-rework { border-top-color: var(--red); }
.gate-panel.is-rework .gate-symbol { background: var(--red-soft); color: var(--red); }
.gate-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gate-heading { display: flex; gap: 10px; }
.gate-symbol { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 7px; background: var(--amber-soft); color: var(--amber); font-weight: 800; }
.gate-heading h2 { font-size: 14px; }
.gate-heading p { color: var(--ink-faint); font-size: 11px; margin-top: 4px; }
.gate-progress { height: 5px; border-radius: 5px; background: #edf0f2; margin: 20px 0 18px; overflow: hidden; }
.gate-progress span { display: block; width: 25%; height: 100%; border-radius: inherit; background: #d7972b; }
.gate-checklist { border-top: 1px solid var(--line); }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-icon { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 10px; font-weight: 800; }
.check-icon.pending { background: var(--amber-soft); color: var(--amber); }
.check-row span { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.gate-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.gate-footer small { color: var(--ink-faint); font-size: 10px; }
.gate-actions { display: flex; gap: 7px; }
.gate-blocker { margin-top: 14px; padding: 11px 12px; border: 1px solid #f0d39a; border-radius: 6px; background: #fffaf0; color: #7a5a20; font-size: 11px; line-height: 1.55; }
.scorecard-blocker { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scorecard-review { margin-bottom: 14px; }
.scorecard-review summary { cursor: pointer; color: #6f5018; font-weight: 700; }
.scorecard-review ul { max-height: 220px; overflow: auto; margin: 9px 0 0; padding-left: 18px; }
.scorecard-review li { padding: 3px 0; overflow-wrap: anywhere; }
.scorecard-confirm-guide, .gate-confirm-note { display: grid; gap: 4px; margin: 14px 0; padding: 11px 12px; border: 1px solid #b9d5ef; border-left: 3px solid var(--blue); border-radius: 6px; background: #f5f9ff; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.scorecard-confirm-guide strong, .gate-confirm-note strong { color: var(--blue-dark); font-size: 11px; }
.scorecard-confirm-guide span, .gate-confirm-note span { color: var(--ink-soft); }
.rework-note { border: 1px solid #f1d1d3; border-radius: 6px; background: #fff8f8; color: #7d4a4d; font-size: 11px; line-height: 1.6; margin-top: 18px; padding: 11px 12px; }

.evidence-readiness { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; padding: 15px 17px; border: 1px solid #f0d39a; border-left: 3px solid var(--amber); border-radius: 7px; background: #fffaf0; }
.evidence-readiness.is-ready { border-color: #b8e1da; border-left-color: var(--teal); background: #f4fcfa; }
.readiness-icon { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--amber-soft); color: var(--amber); font-weight: 800; }
.evidence-readiness.is-ready .readiness-icon { background: var(--teal-soft); color: var(--teal); }
.readiness-copy { min-width: 0; }
.readiness-copy > strong { display: block; font-size: 12px; color: var(--ink); }
.readiness-copy > p { margin-top: 5px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.readiness-copy ul { display: grid; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.readiness-copy li { display: flex; align-items: flex-start; gap: 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.readiness-copy li strong { margin-left: 3px; color: var(--ink); }
.readiness-dot { width: 6px; height: 6px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.readiness-copy small { display: block; margin-top: 10px; color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.readiness-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.readiness-detail { color: var(--amber) !important; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.43fr) minmax(320px, .87fr); gap: 18px; margin-top: 18px; }
.activity-list { padding: 1px 18px; }
.activity-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-avatar { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #edf2f7; color: #557083; font-size: 10px; font-weight: 700; }
.activity-copy { min-width: 0; flex: 1; }
.activity-copy strong { display: block; font-size: 11px; font-weight: 600; }
.activity-copy span { display: block; color: var(--ink-faint); font-size: 10px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.agent-map { min-width: 0; max-width: 100%; padding: 18px; }
.agent-map-intro { color: var(--ink-soft); font-size: 11px; line-height: 1.55; margin-bottom: 17px; }
.agent-flow { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 3px 0 8px; }
.agent-node { min-width: 84px; text-align: center; }
.agent-node-box { width: 47px; height: 47px; margin: 0 auto 7px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-strong); background: #fbfcfd; color: var(--ink-soft); font-size: 15px; font-weight: 750; }
.agent-node.active .agent-node-box { border-color: #83b2f0; color: var(--blue); background: var(--blue-soft); }
.agent-node.done .agent-node-box { border-color: #a1d9d1; color: var(--teal); background: var(--teal-soft); }
.agent-node.rework .agent-node-box { border-color: #e6a9ad; color: var(--red); background: var(--red-soft); }
.agent-node.locked .agent-node-box { color: #a3adb5; background: #f4f6f8; }
.agent-node strong { display: block; color: var(--ink-soft); font-size: 10px; font-weight: 600; white-space: nowrap; }
.agent-node small { display: block; color: var(--ink-faint); font-size: 9px; margin-top: 3px; white-space: nowrap; }
.agent-arrow { color: #b3bdc6; font-size: 16px; padding-bottom: 22px; }

.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-toolbar h2 { font-size: 16px; }
.section-toolbar p { margin-top: 4px; color: var(--ink-faint); font-size: 11px; }
.toolbar-actions { display: flex; gap: 8px; }
.goal-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.candidate-card { border: 1px solid #bbd4f7; background: #fbfdff; border-radius: 8px; padding: 18px; }
.candidate-card.is-rework { border-color: #efc5c8; background: #fffafa; }
.candidate-header { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; margin-bottom: 15px; }
.candidate-header h3 { font-size: 14px; }
.candidate-header p { color: var(--ink-faint); font-size: 11px; margin-top: 4px; }
.ai-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--blue-soft); color: var(--blue); border-radius: 4px; padding: 4px 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.ai-tag::before { content: "✦"; }
.diagnosis-list { display: grid; gap: 9px; }
.diagnosis-row { display: grid; grid-template-columns: 83px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid #e6eef7; }
.diagnosis-row dt { color: var(--ink-faint); font-size: 10px; }
.diagnosis-row dt { overflow-wrap: anywhere; }
.diagnosis-row dd { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.confidence { color: var(--teal); font-size: 10px; white-space: nowrap; }
.source-chip { display: inline-flex; align-items: center; gap: 4px; color: #597189; background: #f0f4f8; border-radius: 4px; padding: 3px 6px; font-size: 9px; white-space: nowrap; }
.source-chip::before { content: "↗"; color: #7692a8; }
.candidate-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #e6eef7; margin-top: 13px; padding-top: 13px; }
.candidate-footer small { color: var(--ink-faint); font-size: 10px; }
.candidate-actions { display: flex; gap: 7px; }
.fact-panel .panel-body { padding: 0 18px; }
.fact-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fact-row:last-child { border-bottom: 0; }
.fact-row span { color: var(--ink-faint); font-size: 10px; }
.fact-row strong { color: var(--ink-soft); font-size: 11px; text-align: right; font-weight: 600; }
.fact-note { padding: 12px 0 14px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }

.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--ink-faint); background: #fbfcfd; font-size: 10px; font-weight: 700; white-space: nowrap; }
td { color: var(--ink-soft); font-size: 11px; }
td strong { display: block; color: var(--ink); font-size: 11px; font-weight: 650; }
td small { display: block; color: var(--ink-faint); font-size: 10px; margin-top: 3px; }
td .factor-name-cn { color: var(--ink); font-size: 11px; font-weight: 700; }
td .factor-id-en { margin-top: 3px; color: var(--ink-faint); font-size: 9px; font-weight: 500; }
.score-rationale { max-width: 340px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.score { color: var(--teal); font-size: 15px; font-weight: 750; }
.score.low { color: var(--amber); }
.table-footer { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; color: var(--ink-faint); font-size: 10px; }

.factor-editor-panel { margin-bottom: 18px; border-top: 3px solid var(--blue); }
.editor-note { margin: 0 0 14px; color: var(--ink-faint); font-size: 11px; line-height: 1.6; }
.factor-edit-list { display: grid; gap: 8px; }
.factor-edit-row { display: grid; grid-template-columns: 56px minmax(180px, 1.6fr) 82px 118px 112px 145px 28px; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.qwen-factor-edit-row { grid-template-columns: 56px minmax(170px, 1.2fr) 72px 72px 72px minmax(190px, 1.2fr) minmax(155px, .9fr) 28px; }
.factor-include { display: flex; align-items: center; gap: 5px; color: var(--ink-faint); font-size: 10px; }
.factor-include input { accent-color: var(--blue); }
.factor-edit-main { min-width: 0; }
.factor-edit-main strong, .factor-edit-main span, .factor-edit-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.factor-edit-main .factor-name-cn { color: var(--ink); font-size: 11px; font-weight: 700; }
.factor-edit-main .factor-id-en { margin-top: 3px; color: var(--ink-faint); font-size: 9px; font-weight: 500; }
.factor-edit-main small { margin-top: 2px; color: var(--ink-faint); font-size: 9px; }
.factor-field { display: grid; gap: 3px; min-width: 0; }
.factor-field span, .factor-note-field span { color: var(--ink-faint); font-size: 9px; }
.factor-field input, .factor-field select, .factor-add-grid input, .factor-add-grid select, .factor-note-field input { width: 100%; min-height: 29px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink-soft); padding: 0 7px; font-size: 10px; }
.factor-field input:focus, .factor-field select:focus, .factor-add-grid input:focus, .factor-add-grid select:focus, .factor-note-field input:focus { outline: 2px solid rgba(33, 103, 213, .18); border-color: var(--blue); }
.factor-remove { width: 26px; height: 26px; color: var(--red); font-size: 16px; }
.factor-add-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.factor-add-form > strong { display: block; margin-bottom: 9px; color: var(--ink-soft); font-size: 11px; }
.factor-add-grid { display: grid; grid-template-columns: 1.1fr 1.4fr .7fr 1fr .65fr .9fr 1.1fr 1.1fr .8fr .65fr auto; gap: 6px; align-items: center; }
.qwen-factor-add-grid { grid-template-columns: 1.1fr 1.25fr .65fr .9fr .55fr .55fr .55fr .8fr 1.4fr auto; }
.factor-editor-footer { display: flex; align-items: end; justify-content: flex-end; gap: 14px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.factor-editor-footer small { margin-right: auto; color: var(--ink-faint); font-size: 10px; }
.factor-note-field { display: grid; gap: 4px; width: min(360px, 45%); margin-right: auto; }

.citation { color: var(--blue); background: var(--blue-soft); border-radius: 3px; padding: 2px 4px; font-size: 10px; white-space: nowrap; }
.inference { color: var(--amber); background: var(--amber-soft); border-radius: 3px; padding: 2px 4px; font-size: 10px; }

.evidence-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.evidence-list { padding: 0 18px; }
.evidence-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.evidence-item:last-child { border-bottom: 0; }
.evidence-item:hover .evidence-copy strong { color: var(--blue); }
.file-icon { width: 32px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 5px; background: #edf3fa; color: #48749c; font-size: 10px; font-weight: 800; }
.evidence-copy { min-width: 0; flex: 1; }
.evidence-copy strong { display: block; color: var(--ink); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-copy small { display: block; color: var(--ink-faint); font-size: 10px; margin-top: 4px; }
.evidence-state { font-size: 10px; color: var(--teal); }
.evidence-number { display: inline-flex; color: var(--blue); background: var(--blue-soft); border-radius: 4px; padding: 3px 6px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.evidence-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.evidence-link { border: 1px solid #c9d9ed; border-radius: 4px; background: #f4f8fd; color: #285f9b; padding: 3px 6px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.evidence-link:hover { border-color: var(--blue); background: var(--blue-soft); }
.material-intake { display: grid; gap: 18px; margin-bottom: 18px; }
.project-intake-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 130px minmax(260px, 1.4fr) minmax(260px, 1.4fr); gap: 11px; }
.project-intake-grid .wide { grid-column: span 2; }
.project-intake-grid label, .material-upload-controls label { display: grid; gap: 5px; color: var(--ink-faint); font-size: 10px; }
.project-intake-grid input, .project-intake-grid textarea, .material-upload-controls input, .material-upload-controls select, .material-row select { width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); padding: 8px 9px; font-size: 11px; }
.project-intake-grid textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
.funding-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; grid-column: span 2; }
.material-upload-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.material-upload-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; flex: 0 0 546px; padding: 2px 0; }
.material-upload-controls > * { min-width: 0; }
.material-upload-controls label > span { display: block; min-height: 15px; }
.material-upload-controls label small { display: block; min-height: 26px; margin-top: 5px; color: var(--ink-faint); font-size: 9px; line-height: 1.4; }
.material-upload-controls input, .material-upload-controls select { height: 38px; min-height: 38px; }
.material-pool-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.material-category-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px 4px; border-top: 1px solid var(--line); }
.material-category-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink-faint); cursor: pointer; font-size: 10px; font-weight: 700; }
.material-category-tab strong { min-width: 18px; padding: 1px 4px; border-radius: 9px; background: var(--surface-muted); color: var(--ink-soft); font-size: 9px; text-align: center; }
.material-category-tab:hover, .material-category-tab.is-active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.material-category-tab.is-active strong { background: var(--blue); color: #fff; }
.material-pagination, .evidence-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 4px 18px 10px; color: var(--ink-faint); font-size: 10px; }
.material-pagination .icon-button, .evidence-pagination .icon-button { flex: 0 0 28px; }
.evidence-snapshot-empty { min-height: 144px; }
.category-guide { position: relative; align-self: start; width: 100%; padding-top: 0; color: var(--ink-faint); font-size: 10px; }
.category-guide::before { content: "资料分类"; display: block; height: 15px; color: var(--ink-faint); font-size: 10px; line-height: 15px; }
.category-guide summary { width: 100%; height: 38px; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 5px; cursor: pointer; list-style: none; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--blue); font-weight: 700; }
.category-guide summary::-webkit-details-marker { display: none; }
.category-guide summary::after { content: "⌄"; color: var(--ink-faint); font-size: 14px; line-height: 1; transition: transform .16s ease; }
.category-guide[open] summary { border-color: #b8cbea; background: var(--blue-soft); }
.category-guide[open] summary::after { transform: rotate(180deg); }
.category-guide summary:hover { border-color: #b8cbea; background: var(--blue-soft); }
.category-guide-list { position: absolute; z-index: 8; top: 63px; left: 0; width: min(620px, calc(100vw - 80px)); display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 7px 16px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; box-shadow: 0 12px 28px rgba(20,34,48,.13); }
.category-guide-list span { display: block; line-height: 1.4; }
.category-guide-list strong { color: var(--ink-soft); margin-right: 4px; }
.material-drop-zone { display: flex; align-items: center; gap: 10px; min-height: 54px; flex: 1 1 290px; padding: 9px 12px; border: 1px dashed #9eb5cb; border-radius: 6px; background: #f7fafc; color: var(--ink-soft); cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.material-drop-zone:hover, .material-drop-zone:focus-visible { border-color: var(--blue); background: var(--blue-soft); outline: none; }
.material-drop-zone.is-dragover { border-color: var(--blue); border-style: solid; background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(33,103,213,.12); }
.material-drop-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 5px; background: #e3edf8; color: var(--blue); font-size: 17px; font-weight: 700; }
.material-drop-zone strong, .material-drop-zone small { display: block; }
.material-drop-zone strong { color: var(--ink); font-size: 11px; }
.material-drop-zone small { margin-top: 3px; color: var(--ink-faint); font-size: 9px; line-height: 1.35; }
.material-upload-note { flex: 1 1 250px; color: var(--ink-faint); font-size: 10px; line-height: 1.45; max-width: 340px; }
.material-folder-queue { display: flex; align-items: center; gap: 8px; flex: 1 1 330px; min-width: 260px; padding: 7px 9px; border: 1px solid #c6d8e8; border-radius: 6px; background: #f4f9fd; }
.material-folder-queue-icon { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 5px; background: #dcebf8; color: var(--blue); font-size: 16px; font-weight: 700; }
.material-folder-queue strong, .material-folder-queue small { display: block; }
.material-folder-queue strong { color: var(--ink); font-size: 10px; }
.material-folder-queue small { margin-top: 3px; color: var(--ink-faint); font-size: 9px; }
.material-folder-queue .button:first-of-type { margin-left: auto; }
.material-list { padding: 0 18px; }
.material-group-heading { display: flex; align-items: baseline; gap: 8px; padding: 13px 0 4px; border-bottom: 1px solid var(--line); color: var(--ink-faint); }
.material-group-heading strong { color: var(--ink-soft); font-size: 11px; }
.material-group-heading span { font-size: 9px; }
.material-row { display: grid; grid-template-columns: 38px minmax(260px, 1fr) 194px 118px 180px; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.material-row:last-child { border-bottom: 0; }
.material-main { min-width: 0; }
.material-main strong, .material-main span, .material-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-main strong { color: var(--ink); font-size: 11px; }
.material-main span { margin-top: 3px; color: var(--blue); font-size: 10px; font-weight: 700; }
.material-main small { margin-top: 3px; color: var(--ink-faint); font-size: 9px; }
.classification-meta { margin-left: 6px; color: var(--teal); font-style: normal; font-weight: 700; }
.classification-meta.is-confirmed { color: var(--blue); }
.classification-meta.is-pending { color: var(--amber); }
.material-row > select { width: 194px; justify-self: end; }
.material-row > .status-pill { justify-self: end; min-width: 118px; justify-content: center; }
.material-actions { display: flex; justify-content: flex-end; gap: 6px; width: 180px; justify-self: end; }
.material-row .material-actions { display: grid; grid-template-columns: repeat(4, 29px); justify-content: end; }
.material-row .material-actions [data-material-text], .material-row .material-actions [data-evidence-id] { grid-column: 1; }
.material-row .material-actions [data-material-ocr] { grid-column: 2; }
.material-row .material-actions [data-material-verify] { grid-column: 3; }
.material-row .material-actions [data-material-archive] { grid-column: 4; }
.material-actions .icon-button { width: 29px; height: 29px; font-size: 13px; letter-spacing: 0; }
.material-warning { color: var(--amber); font-size: 9px; margin-top: 4px; white-space: normal; line-height: 1.4; }
.pool-empty { padding: 48px 20px; text-align: center; }
.pool-empty strong { display: block; color: var(--ink-soft); font-size: 13px; }
.pool-empty span { display: block; margin-top: 7px; color: var(--ink-faint); font-size: 11px; }
.pool-summary { display: flex; gap: 18px; flex-wrap: wrap; padding: 14px 18px; }
.pool-summary div { min-width: 92px; }
.pool-summary span, .pool-summary strong { display: block; }
.pool-summary span { color: var(--ink-faint); font-size: 9px; }
.pool-summary strong { margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.trace-list { padding: 7px 18px; }
.trace-item { display: flex; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.trace-item:last-child { border-bottom: 0; }
.trace-key { color: var(--ink-faint); flex: 0 0 64px; font-size: 10px; }
.trace-value { color: var(--ink-soft); font-size: 10px; line-height: 1.5; }

.source-preview-dock { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; left: 248px; min-width: 0; display: flex; flex-direction: column; background: #fff; box-shadow: -18px 0 48px rgba(19, 33, 44, .18); }
.source-preview-dock.is-hidden { display: none; }
.source-preview-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px 13px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.source-preview-identity { min-width: 0; flex: 1; }
.source-preview-kicker { display: flex; align-items: center; gap: 7px; color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.source-preview-kicker b { color: var(--blue); font-weight: 800; }
.source-preview-header strong { display: block; margin-top: 4px; color: var(--ink); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-preview-header small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-preview-toolbar { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.source-preview-modes { display: inline-flex; align-items: center; min-height: 34px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #f3f6f8; }
.source-preview-modes button { min-width: 62px; height: 26px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-faint); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.source-preview-modes button:hover { color: var(--ink-soft); }
.source-preview-modes button.is-active { background: #fff; color: var(--blue-dark); box-shadow: 0 1px 4px rgba(20, 34, 48, .11); }
.source-preview-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.source-preview-actions a { text-decoration: none; }
.source-preview-body { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(350px, .78fr) minmax(480px, 1.22fr); background: #edf1f4; }
.source-preview-dock[data-mode="ocr"] .source-preview-body, .source-preview-dock[data-mode="original"] .source-preview-body { grid-template-columns: minmax(0, 1fr); }
.source-preview-dock[data-mode="ocr"] .source-original-pane { display: none; }
.source-preview-dock[data-mode="original"] .source-text-pane { display: none; }
.source-review-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.source-text-pane { border-right: 1px solid var(--line-strong); }
.source-pane-header { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.source-pane-header > div { min-width: 0; }
.source-pane-header strong, .source-pane-header span { display: block; }
.source-pane-header strong { color: var(--ink); font-size: 12px; }
.source-pane-header span { margin-top: 3px; color: var(--ink-faint); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-copy-button { min-width: 66px; flex: 0 0 auto; }
.source-text-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ocr-edit-actions { display: flex; align-items: center; gap: 6px; }
.source-transcript { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; background: #fff; scrollbar-gutter: stable; }
.source-text-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 5px 12px 9px; border-top: 1px solid var(--line); background: #fbfcfd; color: var(--ink-faint); font-size: 10px; }
.source-text-pagination .icon-button { flex: 0 0 28px; }
.source-text-page { padding: 17px 18px 20px; border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 transparent; transition: background .16s, box-shadow .16s; }
.source-text-page:hover { background: #fafcff; }
.source-text-page.is-active { background: #f5f9ff; box-shadow: inset 3px 0 var(--blue); }
.source-text-page > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.source-text-page > header > div { min-width: 0; }
.source-text-page > header strong, .source-text-page > header span { display: block; }
.source-text-page > header strong { color: var(--ink); font-size: 12px; }
.source-text-page > header span { margin-top: 3px; color: var(--ink-faint); font-size: 9px; overflow-wrap: anywhere; }
.source-page-target { min-height: 28px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: 0; }
.source-page-target:hover { border-color: #b8cbea; background: var(--blue-soft); }
.source-text-content { color: #34424f; font-size: 13px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.ocr-edit-textarea { display: block; width: 100%; min-height: 130px; resize: vertical; border: 1px solid #b9cee2; border-radius: 5px; padding: 10px; background: #fbfdff; color: #34424f; font-family: inherit; font-size: 13px; line-height: 1.72; }
.ocr-edit-textarea:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgba(33,103,213,.12); }
.source-original-content { min-height: 0; flex: 1; background: #dfe4e8; }
.source-preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.source-preview-image { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.source-preview-empty { height: 100%; display: grid; place-content: center; justify-items: center; padding: 30px; color: var(--ink-faint); text-align: center; }
.source-preview-empty strong { color: var(--ink-soft); font-size: 13px; }
.source-preview-empty span { max-width: 340px; margin-top: 7px; font-size: 11px; line-height: 1.55; }
body.preview-open { overflow: hidden; }

.run-list { padding: 0 18px; }
.run-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.run-item:last-child { border-bottom: 0; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.run-dot.waiting { background: #d7972b; }
.run-dot.failed { background: var(--red); }
.run-copy strong { display: block; color: var(--ink); font-size: 11px; }
.run-copy small { display: block; color: var(--ink-faint); font-size: 10px; margin-top: 4px; }
.run-sequence { display: inline-grid; place-items: center; min-width: 19px; height: 19px; border-radius: 4px; background: #edf2f7; color: var(--ink-faint); font-size: 9px; margin-right: 7px; }
.run-outputs { display: block; color: #748695; font-size: 9px; margin-top: 5px; overflow-wrap: anywhere; }
.run-time { color: var(--ink-faint); font-size: 10px; }
.run-audit-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 18px; margin-top: 18px; align-items: start; }
.tool-version { color: var(--ink-faint); font-size: 9px; font-weight: 500; margin-left: 5px; }
.tool-timing { display: grid; justify-items: end; gap: 6px; }
.tool-timing .status-pill { padding: 3px 7px; }

.empty-state { padding: 54px 20px; text-align: center; color: var(--ink-faint); }
.empty-state strong { display: block; color: var(--ink-soft); font-size: 13px; margin-bottom: 7px; }
.empty-state span { font-size: 11px; }
.loading-skeleton { height: 130px; border-radius: 8px; background: linear-gradient(90deg,#f1f4f6,#fafbfc,#f1f4f6); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* Keep project metadata controls compact and aligned with the upload actions. */
#project-material-pool .material-upload-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 9px;
  padding: 12px 18px;
}
#project-material-pool .material-upload-controls {
  display: grid;
  grid-template-columns: repeat(3, 140px);
  grid-template-rows: 54px;
  column-gap: 9px;
  row-gap: 0;
  flex: 0 0 438px;
  padding: 0;
}
#project-material-pool .material-upload-controls label {
  display: grid;
  grid-template-rows: 15px 34px;
  row-gap: 5px;
  width: 140px;
  height: 54px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#project-material-pool .material-upload-controls label > span {
  display: flex;
  align-items: center;
  height: 15px;
  min-height: 15px;
  line-height: 15px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}
#project-material-pool .material-upload-controls input,
#project-material-pool .material-upload-controls select {
  width: 140px;
  height: 34px;
  min-height: 34px;
  border-color: #cfdbe6;
  border-radius: 5px;
}
#project-material-pool .material-upload-controls input:focus,
#project-material-pool .material-upload-controls select:focus {
  border-color: #82a9d8;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(33, 103, 213, .1);
}
#project-material-pool .category-guide {
  display: grid;
  grid-template-rows: 15px 34px;
  row-gap: 5px;
  width: 140px;
  height: 54px;
  min-width: 0;
  padding: 0;
}
#project-material-pool .category-guide::before {
  display: flex;
  align-items: center;
  height: 15px;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 15px;
}
#project-material-pool .category-guide summary {
  width: 140px;
  min-height: 34px;
  height: 34px;
  margin: 0;
  border-color: #cfdbe6;
  border-radius: 5px;
  padding: 0 10px;
  color: var(--blue-dark);
}
#project-material-pool .category-guide-list {
  top: calc(100% + 8px);
}
#project-material-pool .material-drop-zone {
  min-height: 54px;
  flex: 1 1 250px;
  border-radius: 6px;
  padding: 7px 10px;
}
#project-material-pool .upload-progress-wrap,
#project-material-pool .material-folder-queue {
  width: 100%;
  min-width: 0;
  flex: none;
}
#project-material-pool .material-upload-status {
  flex: 0 0 100%;
  width: 100%;
  display: grid;
  gap: 8px;
  min-width: 0;
}
#project-material-pool .material-upload-bar > [data-action="choose-materials"],
#project-material-pool .material-upload-bar > [data-action="choose-material-folder"] {
  min-width: 0;
  align-self: flex-end;
}

.toast-region { position: fixed; z-index: 60; top: 82px; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); display: grid; gap: 8px; width: min(620px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 7px; background: #fff; box-shadow: 0 12px 32px rgba(22,35,47,.14); padding: 12px 10px 12px 13px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; animation: toast-in .2s ease-out; pointer-events: auto; }
.toast-message { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.toast-close { width: 24px; height: 24px; flex: 0 0 auto; border: 0; border-radius: 5px; background: transparent; color: var(--ink-faint); font-size: 18px; line-height: 1; }
.toast-close:hover { background: var(--surface-muted); color: var(--ink); }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(18,32,44,.42); }
.modal-backdrop.is-hidden { display: none; }
.decision-modal { width: min(450px, 100%); position: relative; border-radius: 9px; background: #fff; box-shadow: 0 22px 55px rgba(10,26,39,.2); padding: 25px; }
.modal-close { position: absolute; right: 14px; top: 14px; font-size: 21px; font-weight: 400; letter-spacing: 0; }
.modal-kicker { color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.decision-modal h2 { margin-top: 8px; font-size: 17px; }
.decision-modal p { margin-top: 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.field-label { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 600; margin: 20px 0 7px; }
.decision-modal textarea { width: 100%; resize: vertical; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 10px; color: var(--ink); font-size: 11px; line-height: 1.5; }
.decision-modal textarea::placeholder { color: #aab4bc; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
#decision-confirm { min-width: 142px; }
.project-delete-modal { width: min(470px, 100%); }
.project-delete-modal .modal-kicker { color: var(--red); }
.project-delete-summary { display: grid; gap: 3px; margin-top: 18px; border-left: 3px solid var(--red); background: var(--red-soft); padding: 10px 12px; }
.project-delete-summary span { color: var(--ink-faint); font-size: 9px; font-weight: 700; }
.project-delete-summary strong { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.project-delete-modal input { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; padding: 8px 10px; color: var(--ink); font-size: 11px; }
.project-delete-modal input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(190, 54, 62, .1); outline: none; }
#project-delete-confirm { min-width: 96px; }
.project-name-modal { width: min(470px, 100%); }
.project-name-modal .modal-kicker { color: var(--teal); }
.project-name-modal input { width: 100%; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; padding: 8px 10px; color: var(--ink); font-size: 12px; }
.project-name-modal input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,120,.1); outline: none; }
#project-name-save { min-width: 76px; }

/* Automatic intake and the shared policy library use the same quiet audit
   language as the source pool, while keeping their review states distinct. */
.project-intake-panel { overflow: hidden; border-top: 3px solid #4e83d4; }
.project-intake-panel .panel-header { min-height: 72px; align-items: center; padding: 14px 20px; background: #fff; }
.project-intake-panel .panel-title { min-width: 0; gap: 11px; }
.intake-title-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #cfe0f7; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 16px; font-weight: 800; }
.intake-header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.intake-header-actions .button span { font-size: 11px; }
.intake-header-status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border: 1px solid #e0e7ed; border-radius: 999px; color: var(--ink-faint); background: #f7f9fb; font-size: 10px; font-weight: 700; white-space: nowrap; }
.intake-header-status.is-ready { border-color: #b9ddd7; color: var(--teal); background: var(--teal-soft); }
.project-intake-panel > .panel-body { padding: 20px; background: #fcfdff; }
.intake-summary { display: flex; justify-content: space-between; gap: 18px; border: 1px solid #d5e3ee; border-left: 4px solid var(--teal); border-radius: 9px; background: #f8fbfd; padding: 16px 17px; }
.intake-summary-copy { min-width: 0; }
.intake-summary strong { display: block; color: var(--ink); font-size: 15px; margin-top: 6px; }
.intake-summary p { max-width: 720px; margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.intake-summary-meta { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 7px; color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.intake-model { display: inline-flex; align-items: center; gap: 5px; }
.intake-model-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,120,.11); }
.intake-confirm-count { padding: 4px 8px; border-radius: 5px; color: var(--teal); background: var(--teal-soft); font-weight: 700; }
.intake-candidate-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 21px; }
.intake-candidate-heading span { color: var(--ink); font-size: 12px; font-weight: 750; }
.intake-candidate-heading small { color: var(--ink-faint); font-size: 10px; }
.intake-candidate-list { display: grid; gap: 10px; margin-top: 10px; }
.intake-candidate { position: relative; border: 1px solid #dfe6ed; border-radius: 9px; background: #fff; padding: 15px 16px 13px; box-shadow: 0 2px 8px rgba(37,58,78,.035); transition: border-color .16s, box-shadow .16s, transform .16s; }
.intake-candidate:hover { border-color: #c4d7ec; box-shadow: 0 6px 16px rgba(37,58,78,.07); transform: translateY(-1px); }
.intake-candidate.is-confirmed { border-color: #a8d9d0; background: #fbfefd; }
.intake-candidate.is-confirmed::before { background: var(--teal); }
.intake-candidate.is-rejected { opacity: .62; }
.intake-candidate::before { content: ""; position: absolute; top: 15px; bottom: 15px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: #d7e5f5; }
.intake-candidate > header, .policy-candidate > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.intake-candidate > header > div { min-width: 0; }
.intake-candidate > header strong, .policy-candidate > header strong { display: block; color: var(--ink); font-size: 12px; font-weight: 750; }
.intake-candidate > header span:not(.status-pill), .policy-candidate > header span:not(.status-pill) { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 10px; }
.intake-candidate .status-pill { flex: 0 0 auto; }
.intake-candidate textarea, .intake-candidate input { display: block; width: 100%; margin-top: 12px; border: 1px solid #d8e2eb; border-radius: 7px; background: #fbfdff; padding: 10px 11px; color: var(--ink); font: inherit; line-height: 1.55; transition: border-color .16s, box-shadow .16s; }
.intake-candidate textarea:focus, .intake-candidate input:focus { outline: 0; border-color: #7ea9df; box-shadow: 0 0 0 3px rgba(33,103,213,.1); background: #fff; }
.intake-candidate textarea { min-height: 66px; resize: vertical; }
.intake-candidate-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #edf1f5; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.intake-candidate-meta > span:first-child { flex: 1 1 360px; }
.intake-candidate-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.intake-candidate-actions .button span { font-size: 11px; line-height: 1; }
.manual-intake { margin-top: 18px; border: 1px solid #dfe6ed; border-radius: 8px; background: #fff; overflow: hidden; }
.manual-intake summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 12px 14px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.manual-intake summary::-webkit-details-marker { display: none; }
.manual-intake summary::after { content: "⌄"; margin-left: auto; color: var(--ink-faint); font-size: 15px; line-height: 1; transition: transform .16s; }
.manual-intake[open] summary::after { transform: rotate(180deg); }
.manual-intake summary:hover { background: #f8fafc; color: var(--ink); }
.manual-intake-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: #eef3f7; color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.manual-intake summary small { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.manual-intake .project-intake-grid { margin: 0; padding: 15px; border-top: 1px solid var(--line); background: #fbfcfd; }
.intake-empty { min-height: 132px; display: grid; place-content: center; justify-items: center; padding: 22px 20px; border: 1px dashed #d7e3ef; border-radius: 9px; background: #fbfdff; }
.intake-empty-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 16px; }
.intake-empty strong { color: var(--ink-soft); font-size: 13px; }
.intake-empty span:last-child { margin-top: 6px; color: var(--ink-faint); font-size: 10px; }
.pool-empty.compact { padding: 20px; }
.policy-citation-panel { border-top: 3px solid #7195a6; }
.policy-search-bar { display: flex; gap: 8px; padding: 0 17px 13px; }
.policy-search-bar input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 5px; padding: 8px 10px; color: var(--ink); font: inherit; }
.policy-candidate-list { display: grid; gap: 9px; padding: 0 17px 17px; }
.policy-candidate { border: 1px solid var(--line); border-radius: 6px; padding: 12px 13px; background: #fff; }
.policy-candidate.is-selected { border-color: #9bcfc7; box-shadow: inset 3px 0 0 var(--teal); }
.policy-candidate p { margin: 10px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.65; max-height: 86px; overflow: hidden; }
.policy-retrieval-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: -3px 0 10px; color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.policy-retrieval-meta span:first-child { color: var(--teal-strong); font-weight: 700; }
.policy-candidate footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.policy-library-view .section-toolbar p { max-width: 720px; }
.policy-upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.policy-upload-grid label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.policy-upload-grid label.wide { grid-column: 1 / -1; }
.policy-upload-grid input, .policy-upload-grid select { width: 100%; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 7px 9px; color: var(--ink); background: #fff; font: inherit; }
.policy-library-list { display: grid; }
.policy-library-entry { border-top: 1px solid var(--line); }
.policy-library-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 13px 17px; }
.policy-library-entry > .policy-library-row { border-top: 0; }
.policy-library-main { min-width: 0; }
.policy-library-main strong, .policy-library-main span, .policy-library-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.policy-library-main strong { color: var(--ink); font-size: 12px; }
.policy-library-main span { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.policy-library-main small { margin-top: 5px; color: var(--ink-faint); font-size: 10px; }
.policy-library-row .material-actions { display: flex; gap: 5px; }
.policy-metadata-editor { padding: 14px 17px 16px 67px; background: #f8fafb; border-top: 1px solid var(--line); }
.policy-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.upload-progress-wrap { display: grid; gap: 6px; flex: 1 1 320px; min-width: 240px; min-height: 42px; padding: 7px 10px; border: 1px solid #c9d8e6; border-radius: 6px; background: #f7fafc; }
.upload-progress-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 10px; }
.upload-progress-header span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-header strong { flex: 0 0 auto; color: var(--blue); font-size: 10px; }
.upload-progress-track { height: 6px; overflow: hidden; border-radius: 5px; background: #dfe7ef; }
.upload-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .2s ease; }

/* Project workbench */
.nav-item:disabled, .nav-item.is-disabled { opacity: .42; cursor: not-allowed; }
.workbench-toolbar { margin-bottom: 17px; }
.workbench-stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.workbench-stat-strip > div { min-height: 86px; display: flex; flex-direction: column; justify-content: center; padding: 14px 20px; border-right: 1px solid var(--line); }
.workbench-stat-strip > div:last-child { border-right: 0; }
.workbench-stat-strip span { color: var(--ink-faint); font-size: 10px; }
.workbench-stat-strip strong { margin-top: 8px; color: var(--ink); font-size: 24px; font-weight: 750; }
.project-list-panel { overflow: hidden; }
.project-list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.project-search { min-width: 260px; flex: 1; max-width: 440px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; padding: 0 10px; }
.project-search span { color: var(--ink-faint); font-size: 14px; }
.project-search input { width: 100%; min-height: 34px; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 11px; }
.project-filters { display: flex; gap: 7px; }
.project-filters select { min-height: 34px; max-width: 180px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink-soft); padding: 0 28px 0 9px; font: inherit; font-size: 10px; }
.project-table { min-width: 1040px; }
.project-table th:first-child { width: 27%; }
.project-table th:last-child { width: 155px; }
.project-table tbody tr { transition: background .14s; }
.project-table tbody tr:hover { background: #fafcfd; }
.project-name-link { max-width: 100%; border: 0; background: transparent; padding: 0; text-align: left; }
.project-name-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue-dark); font-size: 12px; }
.project-name-link:hover strong { color: var(--blue); text-decoration: underline; }
.project-row-actions { white-space: nowrap; }
.project-row-actions .button + .button { margin-left: 6px; }
.project-run-history { margin-bottom: 18px; overflow: hidden; }
.current-run-panel { margin-bottom: 18px; }

.project-create-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; border-top: 1px solid var(--line-strong); }
.project-create-progress span { position: relative; display: flex; align-items: center; gap: 8px; padding: 13px 6px 0 0; color: var(--ink-faint); font-size: 10px; }
.project-create-progress span::before { content: ""; position: absolute; left: 0; right: 7px; top: -2px; height: 3px; background: var(--line-strong); }
.project-create-progress span.is-active { color: var(--blue); font-weight: 700; }
.project-create-progress span.is-active::before { background: var(--blue); }
.project-create-progress b { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: inherit; font-size: 9px; }
.project-create-progress span.is-active b { border-color: var(--blue); background: var(--blue-soft); }
.project-create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 22px; align-items: start; }
.project-create-main { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.form-section { padding: 21px 22px; border-bottom: 1px solid var(--line); }
.form-section > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.form-section > header h3 { color: var(--ink); font-size: 14px; }
.form-section > header span { color: var(--ink-faint); font-size: 10px; }
.create-segment-group { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 12px; }
.create-segment-group > label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.project-option-control { width: 100%; }
.project-option-control button { flex: 1; min-width: 0; }
.project-create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-create-grid label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.project-create-grid label.wide { grid-column: 1 / -1; }
.project-create-grid label i { color: var(--red); font-style: normal; }
.project-create-grid input, .project-create-grid textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); padding: 9px 10px; font: inherit; font-size: 11px; }
.project-create-grid input { min-height: 37px; }
.project-create-grid textarea { resize: vertical; line-height: 1.55; }
.project-create-grid input:focus, .project-create-grid textarea:focus { outline: 2px solid rgba(33, 103, 213, .14); border-color: var(--blue); }
.project-create-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; }
.project-create-aside { border-left: 3px solid var(--teal); background: #f7fbfa; padding: 18px 18px 8px; }
.project-create-aside h3 { color: var(--ink); font-size: 13px; }
.project-create-aside ol { list-style: none; margin: 13px 0 0; padding: 0; }
.project-create-aside li { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid #dce9e6; }
.project-create-aside li > span { color: var(--teal); font-size: 9px; font-weight: 800; }
.project-create-aside li div { min-width: 0; }
.project-create-aside strong, .project-create-aside small { display: block; }
.project-create-aside strong { color: var(--ink-soft); font-size: 11px; }
.project-create-aside small { margin-top: 4px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.issue-dimension-section > header { align-items: flex-start; gap: 16px; }
.issue-dimension-section > header > div { min-width: 0; }
.issue-dimension-section > header p { margin-top: 5px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.issue-dimension-section > footer { margin-top: 14px; border-top: 1px solid var(--line); color: var(--ink-faint); padding-top: 12px; font-size: 9px; line-height: 1.5; }
.issue-dimension-groups { display: grid; gap: 15px; }
.issue-dimension-group { min-width: 0; border-top: 1px solid var(--line); padding-top: 13px; }
.issue-dimension-group:first-child { border-top: 0; padding-top: 0; }
.issue-dimension-group > header { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.issue-dimension-group > header > span { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e9f2ff; color: var(--blue); font-size: 9px; font-weight: 800; }
.issue-dimension-group > header strong, .issue-dimension-group > header small { display: block; }
.issue-dimension-group > header strong { color: var(--ink); font-size: 11px; }
.issue-dimension-group > header small { margin-top: 2px; color: var(--ink-faint); font-size: 9px; }
.issue-dimension-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.issue-dimension-group:last-child .issue-dimension-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.issue-dimension-option { min-width: 0; min-height: 58px; display: block; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink-soft); padding: 9px 10px; text-align: left; }
.issue-dimension-option span, .issue-dimension-option small { display: block; }
.issue-dimension-option span { font-size: 10px; font-weight: 750; }
.issue-dimension-option small { margin-top: 4px; color: var(--ink-faint); font-size: 8px; line-height: 1.45; }
.issue-dimension-option:hover:not(:disabled) { border-color: #83aeea; background: #f7faff; }
.issue-dimension-option.is-active { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.issue-dimension-option.is-active span { color: var(--blue-dark); }
.issue-dimension-option:disabled { cursor: default; opacity: .72; }
.issue-dimension-reason { margin-top: 7px; border-left: 2px solid #79bdb5; background: #f4faf9; color: #446e69; padding: 7px 9px; font-size: 9px; line-height: 1.5; }
.project-issue-dimensions { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); padding: 22px; }
.project-issue-dimensions > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 17px; margin-bottom: 18px; }
.project-issue-dimensions > header > div { min-width: 0; }
.project-issue-dimensions > header span { color: var(--teal); font-size: 9px; font-weight: 750; }
.project-issue-dimensions > header h3 { margin-top: 5px; color: var(--ink); font-size: 16px; }
.project-issue-dimensions > header p { margin-top: 6px; color: var(--ink-faint); font-size: 10px; line-height: 1.55; }
.project-issue-dimensions > footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 19px; }
.project-issue-dimensions > footer > div { min-width: 0; }
.project-issue-dimensions > footer strong, .project-issue-dimensions > footer span { display: block; }
.project-issue-dimensions > footer strong { color: var(--ink-soft); font-size: 10px; }
.project-issue-dimensions > footer span { margin-top: 3px; color: var(--ink-faint); font-size: 9px; line-height: 1.5; }
.formal-stage-stack { display: grid; gap: 16px; }
.formal-preset-banner { border: 1px solid #cbdedb; border-left: 3px solid var(--teal); border-radius: 7px; background: #f5faf9; padding: 15px 17px; }
.formal-preset-banner.is-missing { border-color: #ead7ad; border-left-color: var(--amber); background: #fffaf0; }
.formal-preset-banner > header, .formal-preset-banner:not(:has(> header)) { min-width: 0; }
.formal-preset-banner > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.formal-preset-banner > header > div, .formal-preset-banner > div { min-width: 0; }
.formal-preset-banner span, .formal-preset-banner strong, .formal-preset-banner p { display: block; }
.formal-preset-banner > header span, .formal-preset-banner > div > span { color: var(--teal); font-size: 8px; font-weight: 800; }
.formal-preset-banner > header strong, .formal-preset-banner > div > strong { margin-top: 4px; color: var(--ink); font-size: 12px; line-height: 1.45; }
.formal-preset-banner > header p, .formal-preset-banner > div > p { margin-top: 5px; color: var(--ink-faint); font-size: 9px; line-height: 1.55; }
.formal-preset-banner > header > small { flex: 0 0 auto; color: var(--ink-faint); font-size: 8px; }
.formal-preset-modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.formal-preset-modules details { min-width: 0; border-top: 1px solid #cadbd8; padding-top: 8px; }
.formal-preset-modules summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-soft); cursor: pointer; font-size: 9px; }
.formal-preset-modules summary strong { flex: 0 0 auto; color: var(--teal); font-size: 9px; }
.formal-preset-modules details > div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.formal-preset-modules details > div span { border: 1px solid #d3e0de; border-radius: 4px; background: #fff; color: #536a67; padding: 3px 5px; font-size: 8px; }

@media (max-width: 1180px) {
  .source-preview-modes button[data-source-preview-mode="split"] { display: none; }
  .source-preview-dock[data-mode="split"] .source-preview-body { grid-template-columns: minmax(0, 1fr); }
  .source-preview-dock[data-mode="split"] .source-original-pane { display: none; }
  .material-row { grid-template-columns: 38px minmax(0, 1fr) 160px 94px 134px; gap: 10px; }
  .material-row > select { width: 160px; }
  .material-row > .status-pill { min-width: 94px; }
  .material-actions { width: 134px; gap: 6px; }
}

@media (max-width: 1080px) {
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; }
  .source-preview-dock { left: 215px; }
  .overview-grid, .lower-grid, .goal-layout, .evidence-grid, .run-audit-grid { grid-template-columns: 1fr; }
  .gate-panel { order: -1; }
  .project-intake-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .policy-upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-actions { flex: 0 0 auto; gap: 8px; }
  .topbar-actions #run-button { flex: 0 0 auto; white-space: nowrap; }
  .scoring-mode-control select { width: 126px; }
  .sync-status { display: none; }
  .factor-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classification-layout { grid-template-columns: minmax(250px, .65fr) minmax(0, 1.35fr); }
  .project-create-layout { grid-template-columns: 1fr; }
  .project-create-aside { display: none; }
  .issue-dimension-group:last-child .issue-dimension-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formal-preset-modules { grid-template-columns: 1fr; }
  .project-list-toolbar { align-items: stretch; flex-direction: column; }
  .project-search { max-width: none; width: 100%; }
  .project-filters { width: 100%; }
  .project-filters select { min-width: 0; max-width: none; flex: 1; }
}
@media (max-width: 740px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; min-height: 0; padding: 12px 14px 10px; }
  .main-content { margin-left: 0; }
  .brand { padding: 0 3px 11px; }
  .workspace-picker { display: none; }
  .sidebar-bottom { position: absolute; top: 10px; right: 14px; display: block; max-width: 44%; margin: 0; }
  .sidebar-bottom .avatar, .sidebar-bottom .user-chip small { display: none; }
  .sidebar-bottom .user-chip { gap: 2px; padding: 0; }
  .sidebar-bottom .user-chip strong { font-size: 11px; }
  .sidebar-bottom .icon-button { flex: 0 0 30px; }
  .nav-groups { display: flex; flex-wrap: wrap; gap: 2px 6px; padding: 0; overflow: visible; }
  .nav-group { display: grid; flex: 1 1 100%; min-width: 0; align-items: center; gap: 4px; }
  .nav-group:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-group:nth-child(2) { grid-template-columns: minmax(0, 1fr); }
  .nav-group:nth-child(3) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-group:last-child { grid-template-columns: minmax(0, 1fr); }
  .nav-group + .nav-group { margin-top: 0; }
  .nav-label { display: none; }
  .nav-item { width: 100%; min-width: 0; justify-content: center; gap: 4px; padding: 8px 3px; overflow: hidden; white-space: nowrap; font-size: 10px; }
  .nav-item .nav-icon { display: none; }
  .nav-count { margin-left: 1px; }
  .topbar { height: 57px; position: relative; padding: 0 16px; }
  .breadcrumbs { display: none; }
  .sync-status { display: none; }
  .topbar-actions { position: absolute; right: 12px; top: 11px; max-width: calc(100% - 24px); width: auto; gap: 7px; justify-content: flex-end; }
  .scoring-mode-control span { display: none; }
  .scoring-mode-control select { max-width: 132px; }
  .topbar-actions #refresh-button { display: none; }
  .topbar-actions #run-button { width: 36px; min-width: 36px; padding: 0; font-size: 0; }
  .topbar-actions #run-button span { font-size: 14px; }
  .scoring-mode-control select { width: 112px; }
  .button { padding: 0 10px; }
  .content-wrap { padding: 23px 15px 40px; }
  .page-heading { display: block; }
  .heading-meta { padding-top: 17px; gap: 18px; }
  .notice-bar > div { display: block; }
  .notice-bar div span { display: block; margin-top: 3px; white-space: normal; }
  .content-wrap, .view, .kpi-grid { width: 100%; min-width: 0; }
  .project-overview-tabs { display: flex; margin-bottom: 15px; }
  .project-overview-tabs button { width: auto; min-width: 88px; padding: 0 10px; white-space: nowrap; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi-card { min-height: 107px; padding: 13px; }
  .kpi-value { font-size: 23px; margin-top: 10px; }
  .panel-header { min-height: 0; padding: 12px 14px; flex-wrap: wrap; }
  .panel-header > .panel-title { min-width: 0; flex: 1 1 100%; }
  .panel-header > .status-pill { margin-left: auto; }
  .project-intake-panel .panel-header { align-items: flex-start; }
  .project-intake-panel .panel-header > .panel-title { flex: 1 1 100%; }
  .intake-header-actions { width: 100%; justify-content: flex-end; }
  .intake-header-status { margin-right: auto; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .section-toolbar > * { max-width: 100%; }
  .section-toolbar .segmented-control { width: 100%; }
  .section-toolbar .segmented-control button { flex: 1; }
  .classification-layout { min-height: 0; grid-template-columns: 1fr; }
  .workbench-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-stat-strip > div { min-height: 72px; padding: 12px 14px; }
  .workbench-stat-strip > div:nth-child(2) { border-right: 0; }
  .workbench-stat-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .project-list-toolbar { padding: 12px; }
  .project-search { min-width: 0; }
  .project-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; padding-bottom: 0; }
  .project-filters select { width: 100%; min-width: 0; max-width: none; }
  .project-filters select:last-child { grid-column: 1 / -1; }
  .project-table { min-width: 0; }
  .project-table thead { display: none; }
  .project-table, .project-table tbody { display: block; width: 100%; }
  .project-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; padding: 14px; border-bottom: 1px solid var(--line); }
  .project-table tbody tr:last-child { border-bottom: 0; }
  .project-table tbody td { display: block; min-width: 0; padding: 0; border: 0; }
  .project-table tbody td:first-child { grid-column: 1; grid-row: 1; }
  .project-table tbody td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .project-table tbody td:nth-child(3) { grid-column: 1; grid-row: 3; }
  .project-table tbody td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .project-table tbody td:nth-child(5) { grid-column: 1; grid-row: 4; }
  .project-table tbody td:nth-child(6) { grid-column: 2; grid-row: 2 / span 3; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 7px; }
  .project-table tbody td[colspan] { grid-column: 1 / -1; grid-row: auto; }
  .project-table td .status-pill { justify-content: center; }
  .project-row-actions .button + .button { margin-left: 0; }
  .project-create-progress { overflow-x: auto; }
  .project-create-progress span { min-width: 120px; }
  .form-section { padding: 17px 15px; }
  .create-segment-group { grid-template-columns: 1fr; }
  .project-option-control { overflow-x: auto; }
  .project-option-control.four button { min-width: 84px; }
  .project-create-grid { grid-template-columns: 1fr; }
  .project-create-grid label.wide { grid-column: auto; }
  .project-create-actions { padding: 14px 15px; }
  .project-create-actions .button { flex: 1; }
  .classification-tree-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .classification-tree-scroll { max-height: 360px; }
  .classification-detail-pane { padding: 14px; }
  .assignment-summary, .tree-editor-grid, .factor-library-form { grid-template-columns: 1fr; }
  .tree-field-wide, .factor-form-wide { grid-column: auto; }
  .tree-factor-options, .factor-policy-options { grid-template-columns: 1fr; }
  .classification-confirm-bar, .tree-save-bar { align-items: stretch; flex-direction: column; }
  .factor-completeness-warning { grid-template-columns: 1fr; }
  .factor-completeness-warning .button { grid-column: auto; grid-row: auto; width: 100%; }
  .classification-confirm-bar .button, .tree-save-bar .button { width: 100%; }
  .tree-node-actions { flex-wrap: wrap; }
  .tree-node-actions .button-danger { margin-left: 0; }
  .factor-library-grid { grid-template-columns: 1fr; }
  .factor-library-view .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .catalog-search { min-width: 0; width: 100%; }
  .panel-body { padding: 14px; }
  .workflow-item { grid-template-columns: 29px minmax(0, 1fr); }
  .workflow-time { grid-column: 2; padding-top: 0; }
  .workflow-item:not(:last-child)::before { left: 14px; }
  .workflow-marker { width: 29px; height: 29px; }
  .agent-flow { padding-bottom: 3px; }
  .agent-map-panel .panel-header { align-items: flex-start; flex-direction: column; padding-bottom: 12px; padding-top: 12px; }
  .agent-map-panel .panel-title { flex-wrap: wrap; }
  .diagnosis-row { grid-template-columns: 72px minmax(0, 1fr); }
  .diagnosis-row .confidence { grid-column: 2; }
  .candidate-footer { align-items: flex-start; flex-direction: column; }
  .candidate-actions { width: 100%; }
  .candidate-actions .button { flex: 1; }
  .gate-footer { align-items: flex-start; flex-direction: column; }
  .gate-actions { width: 100%; }
  .gate-actions .button, .gate-footer > .button { flex: 1; width: 100%; }
  .run-item { align-items: start; }
  .run-time { white-space: normal; text-align: right; }
  .tool-timing { max-width: 105px; }
  .factor-edit-list, .factor-add-form { overflow-x: auto; }
  .factor-edit-row { min-width: 760px; }
  .factor-add-grid { min-width: 980px; }
  .factor-editor-footer { align-items: stretch; flex-wrap: wrap; }
  .factor-note-field { width: 100%; order: -1; }
  .project-intake-grid { grid-template-columns: 1fr; }
  .project-intake-grid .wide, .funding-fields { grid-column: auto; }
  .funding-fields { grid-template-columns: 1fr; }
  .project-intake-panel > .panel-body { padding: 14px; }
  .intake-candidate-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .intake-candidate-actions { justify-content: stretch; }
  .intake-candidate-actions .button { flex: 1; }
  .intake-summary-meta { align-items: flex-start; }
  .material-upload-bar { align-items: stretch; flex-direction: column; }
  .material-upload-controls { grid-template-columns: 1fr; }
  .material-pool-header-actions { align-items: flex-start; justify-content: flex-start; }
  .category-guide { width: 100%; min-width: 0; flex-basis: auto; }
  .category-guide-list { position: static; width: 100%; margin-top: 7px; grid-template-columns: 1fr; box-shadow: none; }
  .material-drop-zone, .material-upload-note { flex-basis: auto; max-width: none; }
  .material-folder-queue { width: 100%; min-width: 0; }
  .upload-progress-wrap { width: 100%; min-width: 0; }
  .material-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .material-row > select, .material-row > .status-pill { grid-column: 2; }
  .material-row > select { width: 100%; justify-self: stretch; }
  .material-row > .status-pill { min-width: 0; justify-self: start; }
  .material-actions { width: auto; grid-column: 3; grid-row: 1 / span 3; flex-direction: column; }
  .material-row .material-actions { width: 29px; grid-template-columns: 29px; justify-content: start; }
  .material-row .material-actions [data-material-text], .material-row .material-actions [data-evidence-id], .material-row .material-actions [data-material-ocr], .material-row .material-actions [data-material-verify], .material-row .material-actions [data-material-archive] { grid-column: 1; }
  .policy-library-row { grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; }
  .policy-library-row > .status-pill { grid-column: 2; justify-self: start; }
  .policy-library-row .material-actions { grid-column: 3; grid-row: 1 / span 3; flex-direction: column; }
  .policy-metadata-editor { padding: 13px 14px; }
  .policy-upload-grid { grid-template-columns: 1fr; }
  .policy-upload-grid label.wide { grid-column: auto; }
  .policy-search-bar { flex-direction: column; }
  .intake-summary { flex-direction: column; }
  .intake-summary-meta { align-items: flex-start; flex-direction: row; }
  .source-preview-dock { left: 0; width: 100%; min-width: 0; }
  .source-preview-header { min-height: 0; align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 12px 13px; }
  .source-preview-header strong { font-size: 14px; }
  .source-preview-toolbar { width: 100%; justify-content: space-between; gap: 8px; }
  .source-preview-modes { min-width: 0; flex: 1; }
  .source-preview-modes button { min-width: 0; flex: 1; }
  .source-pane-header { padding-left: 13px; padding-right: 13px; }
  .source-text-page { padding: 15px 14px 18px; }
  .source-text-page > header { align-items: flex-start; }
  .source-text-content { font-size: 12px; line-height: 1.7; }
  h1 { font-size: 23px; }
}

@media (max-width: 740px) {
  #project-material-pool { min-width: 0; max-width: 100%; }
  #project-material-pool .material-upload-controls,
  #project-material-pool .material-pool-header-actions,
  #project-material-pool .material-list,
  #project-material-pool .material-row { min-width: 0; max-width: 100%; }
  #project-material-pool .material-upload-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 13px 14px 15px;
  }
  #project-material-pool .material-upload-controls {
    grid-template-columns: repeat(3, 140px);
    grid-template-rows: 54px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    column-gap: 9px;
    row-gap: 0;
    flex: 0 0 auto;
    scrollbar-width: thin;
  }
  #project-material-pool .material-upload-controls label {
    min-height: 0;
  }
  #project-material-pool .category-guide {
    width: 140px;
    min-width: 140px;
    height: 54px;
    flex-basis: 140px;
  }
  #project-material-pool .category-guide-list {
    position: static;
    width: 100%;
    margin-top: 7px;
    grid-template-columns: 1fr;
    box-shadow: none;
  }
  #project-material-pool .material-drop-zone {
    min-height: 58px;
  }
  #project-material-pool .material-upload-bar > [data-action="choose-materials"],
  #project-material-pool .material-upload-bar > [data-action="choose-material-folder"] {
    width: 100%;
  }
}

/* Project Agent */
.button-agent { position: relative; background: #f2faf9; border-color: #b8deda; color: #176b65; }
.button-agent:hover { background: #e5f6f3; border-color: #83c7bf; }
.agent-toggle-mark { color: var(--teal); font-size: 14px; }
.agent-unread { min-width: 17px; height: 17px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--red); color: #fff; font-size: 8px; }

.agent-panel { position: sticky; top: 0; z-index: 40; width: 440px; flex: 0 0 440px; height: 100vh; height: 100dvh; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; box-shadow: -9px 0 28px rgba(24, 39, 52, .07); overflow: hidden; transition: width .2s ease, flex-basis .2s ease, transform .2s ease; }
.agent-panel.is-collapsed { width: 0; flex-basis: 0; border-left: 0; box-shadow: none; }
.agent-panel > * { width: 439px; flex: 0 0 auto; }
.agent-panel-header { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 14px; }
.agent-panel-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.agent-panel-identity > div { min-width: 0; }
.agent-panel-identity strong, .agent-panel-identity small { display: block; }
.agent-panel-identity strong { font-size: 13px; }
.agent-panel-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-faint); font-size: 9px; margin-top: 3px; }
.agent-main-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #2aa89d; box-shadow: 0 0 0 4px rgba(42, 168, 157, .12); }
.agent-panel.is-running .agent-main-dot { animation: agent-breathe 1.45s ease-in-out infinite; }
.agent-header-actions { display: flex; align-items: center; gap: 5px; }
.agent-header-actions .icon-button { width: 29px; height: 29px; }
.agent-session-row { min-height: 45px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 7px 13px; background: #fafbfd; }
.agent-session-row select { min-width: 0; flex: 1; height: 29px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink-soft); padding: 0 24px 0 8px; font-size: 10px; }
.agent-session-row span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-faint); font-size: 9px; }
.agent-context-popover { position: absolute; z-index: 3; top: 60px; left: 13px; right: 13px; width: auto; max-height: calc(100dvh - 110px); overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; box-shadow: 0 12px 30px rgba(18, 35, 49, .16); padding: 13px; }
.agent-context-popover header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agent-context-popover header strong { font-size: 11px; }
.agent-context-popover header small { color: var(--ink-faint); font-size: 9px; }
.agent-context-meter { height: 5px; overflow: hidden; border-radius: 3px; background: #edf1f4; margin: 12px 0; }
.agent-context-meter span { display: block; width: 0; height: 100%; background: var(--teal); transition: width .2s ease; }
.agent-context-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.agent-context-grid > div { min-width: 0; }
.agent-context-grid span, .agent-context-grid strong { display: block; }
.agent-context-grid span { color: var(--ink-faint); font-size: 8px; }
.agent-context-grid strong { overflow-wrap: anywhere; color: var(--ink-soft); font-size: 10px; margin-top: 3px; }
.agent-model-ledger { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-strong); font-size: 10px; }
.agent-model-ledger header { margin-bottom: 7px; }
.agent-model-ledger header strong { font-size: 11px; }
.agent-model-ledger header button { font-size: 10px; }
.agent-model-ledger select { width: 100%; min-width: 0; padding: 6px; margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: transparent; color: inherit; }
.agent-model-summary { display: grid; gap: 4px; line-height: 1.45; }
.agent-model-summary span, .agent-model-ledger > small, .agent-model-call small { color: var(--ink-faint); }
.agent-model-calls { max-height: 230px; overflow: auto; margin: 9px 0; }
.agent-model-call { display: grid; gap: 3px; padding: 7px 0; border-top: 1px solid var(--line-strong); }
.agent-model-call strong { font-size: 10px; font-weight: 600; }
.agent-model-detail { display: block; width: max-content; margin-top: 5px; padding: 0; font-size: 10px; }
.agent-mode-control { min-height: 43px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; border-bottom: 1px solid var(--line); background: #f8fafc; padding: 6px 12px; }
.agent-mode-control button { min-width: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); font-size: 9px; font-weight: 650; }
.agent-mode-control button:hover { background: #edf2f5; }
.agent-mode-control button.is-active { background: #fff; color: var(--teal); box-shadow: 0 0 0 1px var(--line-strong), 0 2px 5px rgba(25, 40, 52, .06); }

.agent-thread { width: 439px; min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; padding: 14px 13px 22px; scroll-behavior: auto; }
.agent-thread-empty { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-faint); text-align: center; padding: 25px; }
.agent-thread-empty > span { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #bdded9; border-radius: 50%; background: #eef9f7; color: var(--teal); font-size: 17px; }
.agent-thread-empty strong { color: var(--ink-soft); font-size: 12px; margin-top: 12px; }
.agent-thread-empty p { max-width: 300px; font-size: 10px; line-height: 1.65; margin-top: 6px; }
.agent-thread-item { margin-bottom: 13px; }
.agent-message { display: flex; gap: 8px; align-items: flex-start; }
.agent-message-avatar { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e7f5f3; color: var(--teal); font-size: 10px; font-weight: 750; }
.agent-message.user { justify-content: flex-end; }
.agent-message.user .agent-message-avatar { display: none; }
.agent-message-copy { min-width: 0; max-width: 88%; color: var(--ink-soft); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.agent-message.user .agent-message-copy { border-radius: 7px 2px 7px 7px; background: #edf4ff; color: #23476f; padding: 8px 10px; }
.agent-message.assistant .agent-message-copy { padding-top: 2px; }
.agent-message-copy p + p { margin-top: 7px; }
.agent-message-copy .agent-markdown-bullet { position: relative; padding-left: 12px; }
.agent-message-copy .agent-markdown-bullet::before { content: ""; position: absolute; left: 1px; top: .72em; width: 4px; height: 4px; border-radius: 50%; background: #8ba0b1; }
.agent-message-time { display: block; color: #a0aab3; font-size: 8px; margin-top: 4px; }

.agent-activity { position: relative; display: grid; grid-template-columns: 17px minmax(0, 1fr); gap: 7px; padding: 5px 0; }
.agent-activity.is-child { margin-left: 18px; }
.agent-activity.is-child::before { content: ""; position: absolute; left: -10px; top: -5px; bottom: 50%; width: 8px; border-left: 1px solid #dce3e8; border-bottom: 1px solid #dce3e8; border-radius: 0 0 0 5px; }
.agent-bullet { width: 9px; height: 9px; align-self: start; justify-self: center; border-radius: 50%; background: #6f8798; margin-top: 5px; box-shadow: 0 0 0 3px rgba(111, 135, 152, .1); }
.agent-color-teal .agent-bullet { background: #178d84; box-shadow: 0 0 0 3px rgba(23, 141, 132, .12); }
.agent-color-cyan .agent-bullet { background: #168aaa; box-shadow: 0 0 0 3px rgba(22, 138, 170, .12); }
.agent-color-blue .agent-bullet { background: #3776d0; box-shadow: 0 0 0 3px rgba(55, 118, 208, .12); }
.agent-color-amber .agent-bullet { background: #c38723; box-shadow: 0 0 0 3px rgba(195, 135, 35, .13); }
.agent-color-green .agent-bullet { background: #368d55; box-shadow: 0 0 0 3px rgba(54, 141, 85, .12); }
.agent-color-rose .agent-bullet { background: #bd5b76; box-shadow: 0 0 0 3px rgba(189, 91, 118, .12); }
.agent-activity.status-running .agent-bullet, .agent-activity.status-queued .agent-bullet { animation: agent-breathe 1.3s ease-in-out infinite; }
.agent-activity.status-completed .agent-bullet { box-shadow: none; }
.agent-activity.status-waiting .agent-bullet, .agent-activity.status-paused .agent-bullet { background: #fff; border: 2px solid #d0922e; box-shadow: none; }
.agent-activity.status-failed .agent-bullet { background: var(--red); box-shadow: 0 0 0 3px rgba(182, 54, 59, .12); }
.agent-activity.status-interrupted .agent-bullet { background: #9aa5ae; box-shadow: none; }
.agent-activity-copy { min-width: 0; }
.agent-activity-copy strong { display: block; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.agent-activity-copy small { display: block; color: var(--ink-faint); font-size: 8px; line-height: 1.55; margin-top: 2px; overflow-wrap: anywhere; }
.agent-activity-meta { color: #9ca8b1; font-size: 8px; margin-top: 3px; }
.agent-inline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.agent-inline-actions .button { min-height: 27px; padding: 0 8px; font-size: 9px; }
.agent-citation-list { display: grid; gap: 5px; margin-top: 7px; }
.agent-citation { border-left: 2px solid #b8c8d5; background: #f8fafc; color: var(--ink-soft); padding: 6px 8px; font-size: 8px; line-height: 1.55; }
.agent-artifact { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid #cfe2df; border-radius: 7px; background: #f5fbfa; padding: 9px; }
.agent-artifact-icon { width: 30px; height: 34px; display: grid; place-items: center; border-radius: 4px; background: #dcefeb; color: var(--teal); font-size: 9px; font-weight: 800; }
.agent-artifact strong, .agent-artifact small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-artifact strong { color: var(--ink-soft); font-size: 10px; }
.agent-artifact small { color: var(--ink-faint); font-size: 8px; margin-top: 3px; }
.agent-artifact .icon-button { border: 1px solid #b8d7d2; background: #fff; color: var(--teal); text-decoration: none; }

.agent-composer { width: 439px; border-top: 1px solid var(--line); background: #fff; padding: 9px 11px 10px; }
.agent-composer-status { min-height: 0; color: var(--amber); font-size: 11px; padding: 0 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.agent-composer-status:not(:empty) { padding-bottom: 6px; }
.agent-composer-shell { position: relative; display: flex; align-items: flex-end; gap: 7px; min-height: 68px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 7px; }
.agent-composer-shell .agent-input { min-width: 0; min-height: 52px; max-height: 168px; flex: 1; overflow-x: hidden; overflow-y: auto; border: 0; background: transparent; color: var(--ink); padding: 9px 4px; outline: 0; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-input:empty::before { content: attr(data-placeholder); color: #84918f; pointer-events: none; }
.agent-composer-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.agent-composer-shell .icon-button { width: 40px; height: 40px; flex: 0 0 40px; }
.agent-stop { border: 1px solid #efc8ca; background: var(--red-soft); color: var(--red); font-size: 9px; letter-spacing: 0; }
.agent-send { background: var(--teal); color: #fff; font-size: 16px; letter-spacing: 0; }
.agent-send:hover { background: #086b66; color: #fff; }
.agent-send:disabled { background: #a7bbb9; }

#agent-authorization-modal { padding: 14px; }
.agent-authorization-modal { display: flex; flex-direction: column; width: min(600px, 100%); min-width: 0; min-height: 0; max-height: calc(100vh - 28px); max-height: min(780px, calc(100dvh - 28px)); overflow: hidden; padding: 20px; border-radius: 16px; }
.agent-authorization-modal > .modal-kicker, .agent-authorization-modal > h2 { flex-shrink: 0; padding-right: 30px; }
.agent-authorization-body { flex: 1 1 auto; min-height: 0; min-width: 0; margin-top: 8px; overflow-y: auto; overflow-x: hidden; overflow-wrap: anywhere; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #afc6c1 transparent; }
.agent-authorization-body:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; border-radius: 8px; }
.agent-authorization-modal .modal-actions { flex: 0 0 auto; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.agent-authorization-scope { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; border: 1px solid #cbdad7; border-radius: 8px; background: #f3f8f7; color: var(--ink-soft); padding: 12px; margin: 14px 0 12px; font-size: 10px; line-height: 1.6; }
.agent-alignment-reference-list { min-width: 0; }
.agent-alignment-reference-list > summary { cursor: pointer; color: #176c65; font-weight: 750; padding: 4px 0; }
.agent-alignment-reference-list > summary::marker { color: #58716d; }
.agent-alignment-block > span, .agent-alignment-endpoint > span { display: block; color: #58716d; font-size: 8px; font-weight: 750; }
.agent-alignment-files { display: grid; gap: 6px; margin-top: 6px; }
.agent-alignment-files > div { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid #d8e4e1; border-radius: 6px; background: #fff; padding: 6px 8px; }
.agent-alignment-files i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #dceeea; color: #176c65; font-size: 9px; font-style: normal; font-weight: 800; }
.agent-alignment-files > div > span { min-width: 0; }
.agent-alignment-files strong, .agent-alignment-files small { display: block; white-space: normal; overflow-wrap: anywhere; }
.agent-alignment-files strong { color: var(--ink); font-size: 10px; }
.agent-alignment-files small, .agent-alignment-evidence { color: var(--ink-faint); font-size: 8px; }
.agent-alignment-evidence { display: block; margin-top: 6px; }
.agent-alignment-block p { color: var(--amber); margin: 5px 0 0; }
.agent-alignment-block ol { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 20px; }
.agent-alignment-block li { color: #344d49; }
.agent-alignment-endpoint { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-top: 1px solid #d5e2df; padding-top: 9px; }
.agent-alignment-endpoint > span { flex-shrink: 0; }
.agent-alignment-endpoint strong { min-width: 0; color: #176c65; text-align: right; }
.agent-authorization-option { display: flex; align-items: flex-start; gap: 9px; border-top: 1px solid var(--line); padding: 10px 2px; }
.agent-authorization-option input { margin-top: 2px; accent-color: var(--teal); }
.agent-authorization-option span { min-width: 0; }
.agent-authorization-option strong, .agent-authorization-option small { display: block; }
.agent-authorization-option strong { color: var(--ink-soft); font-size: 10px; }
.agent-authorization-option small { color: var(--ink-faint); font-size: 8px; line-height: 1.55; margin-top: 3px; }

@keyframes agent-breathe {
  0%, 100% { opacity: .55; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1.14); }
}

@media (max-width: 1180px) {
  .agent-panel { position: fixed; right: 0; top: 0; width: 440px; flex-basis: 440px; box-shadow: -14px 0 32px rgba(15, 31, 45, .18); }
  .agent-panel.is-collapsed { width: 440px; flex-basis: 440px; transform: translateX(102%); border-left: 1px solid var(--line); }
}

@media (max-width: 740px) {
  .topbar-actions .button-agent { width: 36px; min-width: 36px; padding: 0; }
  .topbar-actions .button-agent > span:not(.agent-toggle-mark), .topbar-actions .button-agent > b { display: none; }
  .agent-panel, .agent-panel.is-collapsed { width: 100%; max-width: none; flex-basis: 100%; }
  .agent-panel > *, .agent-thread, .agent-composer { width: 100%; }
  .agent-panel.is-collapsed { transform: translateX(102%); }
  .agent-panel-header { min-height: 57px; }
  .agent-context-popover { top: 98px; }
  .agent-message-copy { max-width: 91%; }
  .agent-authorization-modal .modal-actions { flex-direction: column; }
  .agent-authorization-modal .modal-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-panel, .agent-context-meter span { transition: none; }
  .agent-panel.is-running .agent-main-dot, .agent-activity.status-running .agent-bullet, .agent-activity.status-queued .agent-bullet { animation: none; }
}

/* Agent replaces the main workspace while the project navigation stays visible. */
body.agent-workspace-open { overflow: hidden; }
body.agent-workspace-open .main-content { visibility: hidden; }
.agent-panel {
  position: fixed;
  inset: 0 0 0 248px;
  z-index: 39;
  width: auto;
  height: auto;
  flex: none;
  border: 0;
  background: #0b0f10;
  color: #dbe5e4;
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 -10px 36px rgba(0,0,0,.18);
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity .16s ease, visibility .16s ease;
}
.agent-panel.is-collapsed {
  width: auto;
  flex-basis: auto;
  border: 0;
  opacity: 0;
  transform: none;
  visibility: hidden;
  pointer-events: none;
}
.agent-panel > * { width: auto; }
.agent-panel-header { min-height: 58px; border-color: #253033; padding: 9px clamp(16px, 2.8vw, 34px); background: #0d1213; }
.agent-panel-identity strong { color: #eef5f4; font-size: 14px; }
.agent-panel-identity small { color: #7f9290; font-size: 10px; }
.agent-panel .icon-button { color: #8fa3a0; }
.agent-panel .icon-button:hover { background: #1a2425; color: #eff8f6; }
.agent-panel .icon-button.outlined { border-color: #2b393a; background: #111718; }
.agent-session-row { min-height: 42px; border-color: #202a2c; padding: 6px clamp(16px, 2.8vw, 34px); background: #0d1213; }
.agent-session-row select { max-width: 420px; border-color: #2b393a; background: #111819; color: #bdcac8; }
.agent-session-row span { max-width: 240px; color: #718481; }
.agent-mode-control { min-height: 42px; width: min(420px, calc(100% - 32px)); grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: center; border: 1px solid #263234; border-radius: 6px; background: #101617; padding: 4px; margin: 8px 0; }
.agent-mode-control button { color: #899b98; font-size: 10px; }
.agent-mode-control button:hover { background: #182122; }
.agent-mode-control button.is-active { background: #1c2828; color: #65c9bd; box-shadow: inset 0 0 0 1px #31504d; }
.agent-context-popover { top: 60px; left: auto; right: 22px; width: min(380px, calc(100% - 30px)); border-color: #304042; background: #111819; color: #dce6e4; box-shadow: 0 18px 44px rgba(0,0,0,.42); }
.agent-context-popover .agent-model-ledger, .agent-context-popover .agent-model-call { border-color: #304042; }
.agent-context-popover .agent-model-ledger select { border-color: #304042; background: #111819; }
.agent-context-popover .agent-model-summary span, .agent-context-popover .agent-model-ledger > small, .agent-context-popover .agent-model-call small { color: #9eaaa7; }
.agent-context-popover header strong, .agent-context-grid strong { color: #dce6e4; }
.agent-context-meter { background: #263133; }

.agent-workspace-body { min-height: 0; width: 100%; flex: 1 1 auto; display: grid; grid-template-columns: minmax(440px, 1fr) minmax(320px, 370px); border-top: 1px solid #1e292a; overflow: hidden; }
.agent-conversation { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #0b0f10; }
.agent-thread { width: auto; min-height: 0; flex: 1 1 auto; padding: 26px clamp(18px, 4vw, 64px) 34px; }
.agent-thread-item { width: min(900px, 100%); margin-left: auto; margin-right: auto; margin-bottom: 16px; }
.agent-thread-empty { min-height: 100%; }
.agent-thread-empty > span { width: 46px; height: 46px; border-color: #315652; background: #142220; color: #64c9bd; box-shadow: 0 0 28px rgba(57,179,165,.12); }
.agent-thread-empty strong { color: #dce7e5; font-size: 14px; }
.agent-quick-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.agent-quick-actions button { min-height: 34px; border: 1px solid #2a3a3b; border-radius: 6px; background: #111819; color: #9fb0ad; padding: 0 12px; font-size: 10px; }
.agent-quick-actions button:hover { border-color: #43716d; color: #dce9e7; }
.agent-message-copy { color: #b9c6c4; font-size: 12px; }
.agent-message-copy strong { color: #dce7e5; }
.agent-message-copy { min-width: 0; overflow-wrap: anywhere; line-height: 1.7; }
.agent-message-copy h1, .agent-message-copy h2, .agent-message-copy h3,
.agent-message-copy h4, .agent-message-copy h5, .agent-message-copy h6 { font-size: 14px; line-height: 1.5; margin: 16px 0 8px; color: #dce7e5; }
.agent-message-copy ul, .agent-message-copy ol { padding-left: 22px; margin: 8px 0; }
.agent-message-copy li { padding-left: 2px; margin: 4px 0; }
.agent-message-copy a { color: #80cfc3; text-decoration: underline; text-underline-offset: 3px; }
.agent-message-copy blockquote { margin: 10px 0; padding: 2px 14px; border-left: 2px solid #3e6660; color: #96aba6; }
.agent-message-copy pre { max-width: 100%; overflow: auto; padding: 12px; background: #151e20; border: 1px solid #293638; border-radius: 5px; }
.agent-message-copy code { color: #c5dbd3; font-size: 11px; }
.agent-markdown-table-wrap { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 12px 0; border: 1px solid #2d3c3e; border-radius: 5px; scrollbar-color: #415855 #16201f; }
.agent-markdown-table-wrap table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: 11px; line-height: 1.65; }
.agent-markdown-table-wrap th, .agent-markdown-table-wrap td { min-width: 100px; padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #293638; border-right: 1px solid #293638; }
.agent-markdown-table-wrap th { background: #182725; color: #c7dcd6; font-weight: 650; }
.agent-markdown-table-wrap td { color: #b9c6c4; }
.agent-markdown-table-wrap tr:last-child td { border-bottom: 0; }
.agent-markdown-table-wrap th:last-child, .agent-markdown-table-wrap td:last-child { border-right: 0; }
.agent-markdown-table-wrap tbody tr:nth-child(even) { background: #111a1a; }
.agent-response-mode-row { display: flex; align-items: center; padding: 0 4px 7px; }
.agent-response-mode-control { display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 3px; border: 1px solid #2a3939; border-radius: 16px; background: #111819; }
.agent-response-mode-control button { display: inline-flex; align-items: center; justify-content: center; min-width: 60px; height: 22px; padding: 0 11px; border: 0; border-radius: 12px; background: transparent; color: #8eaaa4; font-size: 10px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; transition: color 120ms ease, background 120ms ease; }
.agent-response-mode-control button:hover { color: #d5e6e0; background: #1c2928; }
.agent-response-mode-control button.is-active { color: #d1e8e1; background: #28413b; }
.agent-response-mode-control button:focus-visible { outline: 2px solid #80cfc3; outline-offset: 2px; }
.research-source-table.is-native-stream th:first-child { width: 58%; }
.research-source-table.is-native-stream th:last-child { width: 42%; }
.agent-message.user .agent-message-copy { border: 1px solid #254543; background: #142220; color: #d6e6e3; }
.agent-message-avatar { background: #16302d; color: #6fd3c6; }
.agent-message-time, .agent-activity-meta { color: #637471; }
.agent-panel .agent-activity.status-waiting:not(.agent-attention),
.agent-panel .agent-activity.status-paused:not(.agent-attention) { color: inherit; background: transparent; }
.agent-panel .agent-activity.status-waiting:not(.agent-attention) .agent-bullet,
.agent-panel .agent-activity.status-paused:not(.agent-attention) .agent-bullet { border: 2px solid #4d7b76; background: #101718; box-shadow: 0 0 0 3px rgba(77,123,118,.1); }
.agent-activity-copy strong { color: #c4d0ce; font-size: 11px; }
.agent-activity-copy small { color: #82928f; font-size: 9px; }
.agent-activity.is-child::before { border-color: #2c393a; }
.agent-activity.agent-attention {
  --agent-attention-accent: #61c4b8;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  border: 1px solid #2c4441;
  border-left-color: #42726c;
  border-radius: 7px;
  background: #101718;
  color: #d5e1df;
  padding: 13px 14px;
  box-shadow: 0 12px 26px rgba(0,0,0,.16), inset 3px 0 0 rgba(97,196,184,.17);
}
.agent-activity.agent-attention::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -1px;
  left: -72px;
  width: 72px;
  height: 2px;
  background: var(--agent-attention-accent);
  opacity: 0;
  animation: agent-attention-scan 4.2s ease-in-out infinite;
  pointer-events: none;
}
.agent-activity.agent-attention > * { position: relative; z-index: 1; }
.agent-activity.agent-attention .agent-bullet {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  align-self: start;
  border: 1px solid #39645f;
  border-radius: 6px;
  background: #162725;
  color: var(--agent-attention-accent);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 18px rgba(66,164,153,.08);
}
.agent-attention-topline { min-height: 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.agent-attention-kicker { color: var(--agent-attention-accent); font-size: 9px; font-weight: 750; line-height: 1.4; }
.agent-attention-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; color: #78918d; font-size: 8px; line-height: 1.4; }
.agent-attention-state::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--agent-attention-accent);
  animation: agent-attention-pulse 1.8s ease-in-out infinite;
}
.agent-attention .agent-attention-summary { color: #e0e9e7; font-size: 12px; line-height: 1.55; }
.agent-attention .agent-activity-copy > small { color: #879a96; margin-top: 4px; }
.agent-attention .agent-activity-meta { margin-top: 5px; }
.agent-attention .agent-inline-actions { margin-top: 11px; }
.agent-attention .agent-inline-actions .agent-attention-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #3b716b;
  border-radius: 5px;
  background: #17302d;
  color: #7bd3c8;
  padding: 0 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}
.agent-attention .agent-inline-actions .agent-attention-action:hover { border-color: #55a49b; background: #1a3935; color: #a1e1d9; transform: translateY(-1px); }
.agent-attention .agent-inline-actions .agent-attention-action:active { transform: translateY(0); }
.agent-attention .agent-inline-actions .agent-attention-action span { font-size: 13px; font-weight: 500; line-height: 1; }
.agent-activity.has-source-preview .agent-citation-list { gap: 6px; margin-top: 10px; }
.agent-citation { width: 100%; border: 1px solid #253436; border-left: 2px solid #4f7773; border-radius: 4px; background: #111718; color: #9eb0ad; text-align: left; }
.agent-citation[href] { display: block; text-decoration: none; }
.agent-citation strong, .agent-citation span { display: block; }
.agent-citation span { margin-top: 3px; }
.agent-activity.has-source-preview .agent-citation { transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease; }
.agent-activity.has-source-preview .agent-citation:hover { border-color: #38605c; border-left-color: #61c4b8; background: #141d1e; color: #c1cfcc; transform: translateX(2px); }
.agent-artifact { border-color: #31534f; background: #111c1b; }
.agent-artifact-icon { background: #1b3632; color: #71cec2; }
.agent-artifact strong { color: #d5e1df; }
.agent-artifact small { color: #728581; }
.agent-artifact .icon-button { border-color: #31534f; background: #14211f; color: #71cec2; }

.agent-composer { width: auto; border-color: #253032; background: #0d1213; padding: 12px clamp(18px, 4vw, 64px) 14px; }
.agent-composer > * { width: min(900px, 100%); margin-left: auto; margin-right: auto; }
.agent-composer-shell { min-height: 72px; border-color: #344345; background: #111718; box-shadow: 0 14px 32px rgba(0,0,0,.28), inset 0 1px 0 #1b2526; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.agent-composer-shell::before { content: ""; position: absolute; top: -1px; left: 14px; width: 48px; height: 1px; background: #4cb7ab; opacity: .38; pointer-events: none; transition: width 180ms ease, opacity 180ms ease; }
.agent-composer-shell:focus-within { border-color: #4c8f87; background: #121a1b; box-shadow: 0 16px 38px rgba(0,0,0,.34), 0 0 0 3px rgba(66,164,153,.11), inset 0 1px 0 #203031; }
.agent-composer-shell:focus-within::before { width: 96px; opacity: .9; }
.agent-composer-shell.is-running::before, .agent-composer-shell.is-sending::before { animation: agent-composer-signal 1.6s ease-in-out infinite; opacity: 1; }
.agent-composer-shell.is-dragover { border-color: #69c8bc; background: #152121; box-shadow: 0 0 0 3px rgba(91, 199, 186, .16), inset 0 0 0 1px rgba(111, 211, 199, .32); }
.agent-composer-shell .agent-input { color: #e0e8e6; padding: 10px 5px 9px; font-size: 12px; caret-color: #65c9bd; }
.agent-composer-shell .agent-input:empty::before { color: #627370; }
.agent-attachment-wrap { position: relative; flex: 0 0 auto; align-self: flex-end; }
.agent-attachment { border: 1px solid #344547; background: #151e1f; color: #91a5a1; font-size: 18px; letter-spacing: 0; box-shadow: inset 0 1px 0 #202b2c; transition: border-color 150ms ease, color 150ms ease, background 150ms ease, box-shadow 150ms ease; }
.agent-attachment:hover { border-color: #4d7772; background: #192425; color: #7cd0c5; box-shadow: 0 0 16px rgba(66,164,153,.12), inset 0 1px 0 #263334; }
.agent-attachment-menu { position: absolute; z-index: 5; left: -8px; bottom: calc(100% + 12px); width: 260px; overflow: hidden; border: 1px solid #344547; border-radius: 7px; background: #141b1c; box-shadow: 0 16px 34px rgba(0,0,0,.42); }
.agent-attachment-menu button { width: 100%; border: 0; border-bottom: 1px solid #263234; background: transparent; color: #d2ddda; padding: 10px 12px; text-align: left; }
.agent-attachment-menu button:last-child { border-bottom: 0; }
.agent-attachment-menu button:hover { background: #1b2526; }
.agent-attachment-menu strong, .agent-attachment-menu small { display: block; }
.agent-attachment-menu strong { font-size: 11px; }
.agent-attachment-menu small { color: #778986; font-size: 9px; margin-top: 3px; }
.agent-mention-menu { position: absolute; z-index: 8; left: 54px; bottom: calc(100% + 10px); width: min(430px, calc(100% - 118px)); max-height: 310px; overflow: auto; border: 1px solid #3a4b4d; border-radius: 7px; background: #12191a; box-shadow: 0 18px 40px rgba(0,0,0,.46); padding: 5px; }
.agent-mention-menu button { width: 100%; min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 9px; border: 0; border-radius: 5px; background: transparent; color: #d5dfdc; padding: 8px; text-align: left; }
.agent-mention-menu button:hover, .agent-mention-menu button.is-active { background: #1c2929; box-shadow: inset 2px 0 0 #58b9ae; }
.agent-mention-menu button > span:last-child { min-width: 0; }
.agent-mention-menu strong, .agent-mention-menu small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-mention-menu strong { font-size: 10px; line-height: 1.4; }
.agent-mention-menu small { color: #718582; font-size: 8px; margin-top: 3px; }
.agent-mention-type { min-height: 22px; display: grid; place-items: center; border: 1px solid #385957; border-radius: 4px; background: #172424; color: #64c3b8; font-size: 8px; font-weight: 750; }
.agent-mention-empty { color: #788b88; font-size: 9px; padding: 12px; text-align: center; }
.agent-composer-controls { align-self: flex-end; padding-bottom: 0; }
.agent-stop { border-color: #64383b; background: #2c1719; color: #e9858a; box-shadow: inset 0 1px 0 #432326; }
.agent-send { width: 40px !important; height: 40px !important; flex-basis: 40px !important; border: 1px solid #48a99e; border-radius: 6px; background: #1f8178; color: #fff; box-shadow: 0 2px 0 #10554f, 0 0 18px rgba(55,176,163,.14), inset 0 1px 0 rgba(255,255,255,.16); transform: none; transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease; }
.agent-send span { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 19px; font-weight: 800; line-height: 1; transform: none; }
.agent-send:hover { border-color: #6bc6bc; background: #26958b; color: #fff; box-shadow: 0 3px 0 #10554f, 0 0 24px rgba(71,199,184,.24), inset 0 1px 0 rgba(255,255,255,.2); }
.agent-send:active { transform: translateY(1px); box-shadow: 0 0 0 #10554f, 0 0 12px rgba(71,199,184,.18), inset 0 1px 0 rgba(255,255,255,.12); }
.agent-send:disabled { border-color: #3b514f; background: #273634; color: #718581; box-shadow: 0 2px 0 #1b2725; transform: none; }

@keyframes agent-composer-signal {
  0%, 100% { opacity: .42; }
  50% { opacity: 1; }
}

@keyframes agent-attention-scan {
  0%, 18% { left: -72px; opacity: 0; }
  28% { opacity: .9; }
  68% { left: 100%; opacity: .7; }
  69%, 100% { left: 100%; opacity: 0; }
}

@keyframes agent-attention-pulse {
  0%, 100% { opacity: .45; box-shadow: 0 0 0 0 rgba(97,196,184,.08); }
  50% { opacity: 1; box-shadow: 0 0 0 4px rgba(97,196,184,0); }
}

.agent-research-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid #253032; background: #101516; }
.agent-research-pane > header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #253032; padding: 9px 13px 9px 16px; }
.agent-research-pane > header span, .agent-research-pane > header strong { display: block; }
.agent-research-pane > header span { color: #5faea5; font-size: 8px; font-weight: 750; }
.agent-research-pane > header strong { color: #d5dfdd; font-size: 12px; margin-top: 3px; }
.agent-research-content { min-height: 0; flex: 1; overflow-y: auto; padding: 12px; }
.research-empty { min-height: 260px; display: grid; place-content: center; justify-items: center; color: #6f807d; text-align: center; padding: 24px; }
.research-empty strong { color: #b8c5c2; font-size: 12px; }
.research-empty span { max-width: 260px; margin-top: 7px; font-size: 9px; line-height: 1.6; }
.research-empty button { margin-top: 14px; }
.research-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin-bottom: 10px; }
.research-summary div { min-width: 0; border: 1px solid #273335; border-radius: 6px; background: #131a1b; padding: 8px; }
.research-summary span, .research-summary strong { display: block; }
.research-summary span { color: #70817e; font-size: 8px; }
.research-summary strong { color: #ced9d7; font-size: 12px; margin-top: 4px; }
.research-review-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px; border: 1px solid #293638; border-radius: 6px; background: #131a1b; }
.research-review-toolbar span { min-width: 0; flex: 1; color: #758683; font-size: 8px; line-height: 1.5; }
.research-review-toolbar button { min-height: 28px; flex: 0 0 auto; border: 1px solid #356058; border-radius: 5px; background: #172522; color: #6bc9bd; padding: 0 9px; font-size: 9px; font-weight: 700; }
.research-review-toolbar button:hover:not(:disabled) { border-color: #55a99f; color: #a2e3db; }
.research-review-toolbar button:disabled { opacity: .55; cursor: wait; }
.research-job-heading { margin-bottom: 11px; }
.research-job-heading strong, .research-job-heading span { display: block; }
.research-job-heading strong { color: #d6e0de; font-size: 12px; line-height: 1.45; }
.research-job-heading span { color: #72827f; font-size: 9px; margin-top: 4px; }
.research-source-list { display: grid; gap: 7px; }
.research-source { border: 1px solid #263234; border-radius: 6px; background: #121819; padding: 9px; }
.research-source.is-verified { border-color: #31564f; background: #111d1b; }
.research-source.is-rejected { opacity: .58; }
.research-source.is-unreachable { border-color: #563436; }
.research-source > header { display: flex; align-items: flex-start; gap: 8px; }
.research-source-index { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 4px; background: #202a2b; color: #829591; font-size: 8px; }
.research-source-copy { min-width: 0; flex: 1; }
.research-source-copy a { display: block; color: #c7d3d0; font-size: 10px; font-weight: 650; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.research-source-copy a:hover { color: #6cc8bd; text-decoration: underline; }
.research-source-copy small { display: block; color: #71817e; font-size: 8px; line-height: 1.5; margin-top: 4px; }
.research-source p { color: #8fa09d; font-size: 8px; line-height: 1.55; margin-top: 7px; }
.research-source-actions { display: flex; gap: 6px; margin-top: 8px; }
.research-source-actions button { min-height: 27px; flex: 1; border: 1px solid #304041; border-radius: 5px; background: #171f20; color: #91a3a0; font-size: 9px; }
.research-source-actions button[data-research-status="verified"] { border-color: #356058; color: #63c5b9; }
.research-source-actions button[data-research-status="rejected"] { border-color: #583a3c; color: #d57b80; }
.research-source-actions button[data-research-status="candidate"] { border-color: #4b5557; color: #a9b6b3; }
.research-source-status { flex: 0 0 auto; color: #788a87; font-size: 8px; }
.research-workpaper-actions { position: sticky; bottom: -12px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border-top: 1px solid #283436; background: #101516; padding: 11px 0 2px; margin-top: 10px; }
.research-workpaper-actions .button { min-width: 0; padding: 0 8px; font-size: 9px; }
.research-workpaper-actions .button-quiet { border-color: #31534f; background: #14211f; color: #71cec2; text-decoration: none; }
.research-workpaper-actions .button-quiet:hover { border-color: #55a49b; background: #1a3935; color: #a1e1d9; }
.research-workpaper-actions .wide { grid-column: 1 / -1; }
.research-task-complete { grid-column: 1 / -1; border: 1px solid #31504d; border-radius: 6px; background: #172321; color: #72bdb4; padding: 9px 10px; text-align: center; font-size: 9px; }
.agent-research-inline { min-width: 0; margin-top: 10px; }
.research-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #2a393a; border-radius: 7px; background: #111718; }
.research-source-table { width: 100%; min-width: 520px; border-collapse: collapse; table-layout: fixed; }
.research-source-table th { height: 31px; border-bottom: 1px solid #2d3c3d; background: #172021; color: #82938f; padding: 0 9px; font-size: 8px; font-weight: 750; text-align: left; }
.research-source-table th:first-child { width: 46%; }
.research-source-table th:nth-child(2) { width: 36%; }
.research-source-table th:last-child { width: 18%; text-align: center; }
.research-source-table.is-readonly th:first-child { width: 68%; }
.research-source-table.is-readonly th:last-child { width: 32%; text-align: left; }
.research-source-table td { border-bottom: 1px solid #222e2f; color: #b7c5c2; padding: 9px; vertical-align: middle; }
.research-source-table tbody tr:last-child td { border-bottom: 0; }
.research-source-table tbody tr.is-excluded td { background: rgba(87, 48, 51, .1); opacity: .68; }
.research-source-table tbody tr.is-unreachable td { background: #172021; opacity: 1; }
.research-source-table tbody tr.is-adopted td:first-child { box-shadow: inset 2px 0 0 #4da99f; }
.research-comparison-table { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
.research-comparison-table th { height: 31px; border-bottom: 1px solid #2d3c3d; background: #172021; color: #82938f; padding: 0 9px; font-size: 8px; text-align: left; }
.research-comparison-table th:first-child { width: 18%; }
.research-comparison-table th:nth-child(2) { width: 36%; }
.research-comparison-table th:last-child { width: 46%; }
.research-comparison-table td { border-bottom: 1px solid #222e2f; color: #aebdb9; padding: 9px; vertical-align: top; }
.research-comparison-table tbody tr:last-child td { border-bottom: 0; }
.research-comparison-table td > strong { color: #d4dfdc; font-size: 9px; line-height: 1.45; }
.research-comparison-table td > p { color: #93a4a0; font-size: 8px; line-height: 1.55; white-space: pre-wrap; }
.research-comparison-table.is-matrix { table-layout: auto; }
.research-comparison-table.is-matrix th { width: auto; min-width: 170px; }
.research-comparison-table.is-matrix th:first-child { width: 92px; min-width: 92px; }
.research-comparison-table.is-matrix th:nth-child(2) { width: 220px; min-width: 220px; }
.research-comparison-table.is-matrix th:last-child { width: 230px; min-width: 230px; }
.research-comparison-table.is-matrix td:first-child { background: #141d1e; }
.research-comparison-sources { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.research-comparison-sources a, .research-comparison-sources span { border: 1px solid #31514d; border-radius: 4px; background: #152220; color: #6cbab1; padding: 2px 5px; font-size: 7px; text-decoration: none; }
.research-table-name { min-width: 0; }
.research-table-name > a { display: block; color: #d2ddda; font-size: 9px; font-weight: 700; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.research-table-name > a:hover { color: #73d0c5; text-decoration: underline; }
.research-table-name small { display: block; color: #748582; font-size: 8px; line-height: 1.45; margin-top: 4px; }
.research-recommendation { display: inline-flex; align-items: center; border: 1px solid #315a55; border-radius: 4px; background: #172623; color: #6dc4ba; padding: 1px 5px; margin-right: 5px; font-size: 7px; font-weight: 750; }
.research-recommendation.is-excluded { border-color: #554144; background: #241b1d; color: #bf898d; }
.research-recommendation.is-unavailable { border-color: #4c5557; background: #242c2e; color: #aab6b3; }
.research-fetch-error, .research-source-table .is-unreachable small { overflow-wrap: anywhere; }
.research-table-url { display: block; color: #769c98; font-size: 8px; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.research-table-url:hover { color: #78d1c6; text-decoration: underline; }
.research-adopt-toggle { position: relative; display: grid; grid-template-columns: 31px auto; justify-content: center; align-items: center; gap: 6px; cursor: pointer; }
.research-adopt-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.research-adopt-toggle > span { position: relative; width: 31px; height: 17px; border: 1px solid #425052; border-radius: 9px; background: #273031; transition: background .15s, border-color .15s; }
.research-adopt-toggle > span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 11px; height: 11px; border-radius: 50%; background: #84918f; transition: transform .15s, background .15s; }
.research-adopt-toggle input:checked + span { border-color: #4aa69b; background: #215650; }
.research-adopt-toggle input:checked + span::after { background: #a0e2da; transform: translateX(14px); }
.research-adopt-toggle input:focus-visible + span { outline: 2px solid #68c7bb; outline-offset: 2px; }
.research-adopt-toggle input:disabled + span { opacity: .5; cursor: wait; }
.research-adopt-toggle.is-unavailable, .research-adopt-toggle.is-unavailable input:disabled + span { cursor: not-allowed; }
.research-adopt-toggle strong { color: #91a39f; font-size: 8px; font-weight: 700; white-space: nowrap; }
.research-selection-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #2b393a; background: #101617; padding: 11px 0 1px; margin-top: 10px; }
.research-selection-action.is-inline { border: 1px solid #31504d; border-radius: 6px; background: #14201f; padding: 9px; }
.research-selection-action > span { min-width: 0; color: #81918e; font-size: 8px; line-height: 1.5; }
.research-selection-action .button { flex: 0 0 auto; min-height: 30px; padding: 0 10px; font-size: 9px; }
.agent-research-inline .research-table-wrap.is-compact { max-height: 310px; overflow: auto; }
.agent-research-content .research-source-table { min-width: 0; }
.agent-research-content .research-source-table th:first-child { width: 50%; }
.agent-research-content .research-source-table th:nth-child(2) { width: 25%; }
.agent-research-content .research-source-table th:last-child { width: 25%; }
.agent-research-content .research-source-table.is-readonly th:first-child { width: 68%; }
.agent-research-content .research-source-table.is-readonly th:last-child { width: 32%; text-align: left; }
.agent-research-content .research-source-table th,
.agent-research-content .research-source-table td { padding-left: 6px; padding-right: 6px; }
.agent-research-content .research-table-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-research-content .research-adopt-toggle { gap: 4px; }
.agent-research-content .research-source-table th { font-size: 10px; }
.agent-research-content .research-table-name > a { font-size: 11px; }
.agent-research-content .research-table-name small,
.agent-research-content .research-table-url { font-size: 10px; }
.agent-research-content .research-recommendation { font-size: 9px; }
.agent-research-content .research-adopt-toggle strong { font-size: 10px; }
.agent-research-content .research-source-table td { padding-top: 11px; padding-bottom: 11px; }
.material-role-badge { display: inline-flex; align-items: center; min-height: 19px; border: 1px solid #b9dcd7; border-radius: 4px; background: #edf8f6; color: #176b65; padding: 0 6px; margin-left: 7px; font-size: 8px; font-style: normal; font-weight: 700; }

@media (max-width: 1080px) {
  .agent-panel { left: 215px; }
  .agent-workspace-body { grid-template-columns: minmax(380px, 1fr) 310px; }
  .agent-thread { padding-left: 20px; padding-right: 20px; }
  .agent-composer { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 740px) {
  .agent-panel, .agent-panel.is-collapsed { inset: 0; width: auto; max-width: none; height: auto; flex-basis: auto; }
  .agent-workspace-body { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 38%); }
  .agent-research-pane { border-left: 0; border-top: 1px solid #253032; }
  .agent-panel-header { min-height: 52px; }
  .agent-mode-control { width: calc(100% - 24px); }
  .agent-thread { padding: 16px 13px 20px; }
  .agent-composer { padding: 9px 12px; }
  .agent-composer-shell { min-height: 66px; gap: 5px; padding: 6px; }
  .agent-composer-shell .icon-button { width: 38px; height: 38px; flex-basis: 38px; }
  .agent-composer-shell .agent-input { min-height: 48px; padding-left: 3px; padding-right: 3px; }
  .agent-attachment-menu { left: -6px; right: auto; width: min(260px, calc(100vw - 36px)); }
  .agent-mention-menu { left: 6px; width: calc(100% - 12px); }
  .agent-send { width: 38px !important; height: 38px !important; flex-basis: 38px !important; }
  .agent-activity.agent-attention { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 11px; }
  .agent-activity.agent-attention .agent-bullet { width: 28px; height: 28px; }
  .agent-attention .agent-inline-actions .agent-attention-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-panel { transition: none; }
  .agent-composer-shell, .agent-composer-shell::before, .agent-attachment, .agent-send { transition: none; animation: none; }
  .agent-activity.agent-attention::after, .agent-attention-state::before { animation: none; }
  .agent-activity.has-source-preview .agent-citation { transition: none; }
  .agent-activity.has-source-preview .agent-citation:hover { transform: none; }
}

/* Project workpaper center */
.workpaper-view { display: grid; gap: 22px; }
.project-lifecycle-band { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid #d8e1e3; border-bottom: 1px solid #d8e1e3; background: #f5f8f8; padding: 12px 24px; }
.project-lifecycle-band.is-completed { border-color: #b8d7d2; background: #eef7f5; }
.project-lifecycle-band > div { min-width: 0; display: flex; align-items: center; gap: 13px; }
.project-lifecycle-band > div > div { min-width: 0; }
.project-lifecycle-band strong, .project-lifecycle-band small { display: block; overflow-wrap: anywhere; }
.project-lifecycle-band strong { color: #23353c; font-size: 11px; }
.project-lifecycle-band small { color: #67777e; font-size: 9px; line-height: 1.55; margin-top: 3px; }
.workpaper-band { width: 100%; border-top: 1px solid #d9e0e3; border-bottom: 1px solid #d9e0e3; background: #fff; padding: 22px 24px; }
.workpaper-generator > header, .project-artifact-inventory > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.workpaper-generator > header > div:first-child { max-width: 720px; }
.workpaper-generator h2, .workpaper-output h2, .project-artifact-inventory h3 { color: #17252c; font-size: 18px; line-height: 1.35; margin: 3px 0 0; letter-spacing: 0; }
.workpaper-generator header p, .workpaper-output .section-toolbar p, .project-artifact-inventory header p { max-width: 780px; color: #62717a; font-size: 11px; line-height: 1.65; margin: 6px 0 0; }
.section-kicker { color: #17716a; font-size: 9px; font-weight: 800; }
.workpaper-readiness-grid { width: min(360px, 42%); display: grid; grid-template-columns: repeat(4, minmax(68px, 1fr)); gap: 6px; }
.workpaper-readiness { min-height: 58px; display: grid; align-content: center; border: 1px solid #dde3e5; background: #f7f9fa; padding: 8px 10px; }
.workpaper-readiness span, .workpaper-readiness strong { display: block; }
.workpaper-readiness span { color: #75838a; font-size: 8px; white-space: nowrap; }
.workpaper-readiness strong { color: #9a4e31; font-size: 17px; margin-top: 4px; }
.workpaper-readiness.is-ready { border-color: #bad7d3; background: #f0f8f6; }
.workpaper-readiness.is-ready strong { color: #176b65; }
.workpaper-kind-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.workpaper-kind-control button { min-width: 0; min-height: 88px; display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: auto auto; align-content: center; column-gap: 10px; border: 1px solid #d6dee1; border-radius: 6px; background: #f8fafb; color: #24343b; padding: 12px; text-align: left; }
.workpaper-kind-control button > span { grid-row: 1 / 3; width: 34px; height: 34px; display: grid; place-items: center; align-self: center; border-radius: 5px; background: #e4ecef; color: #31596c; font-size: 13px; font-weight: 800; }
.workpaper-kind-control button strong { min-width: 0; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.workpaper-kind-control button small { min-width: 0; color: #728087; font-size: 9px; line-height: 1.45; margin-top: 3px; overflow-wrap: anywhere; }
.workpaper-kind-control button:hover { border-color: #79aaa5; background: #f4f9f8; }
.workpaper-kind-control button.is-active { border-color: #31877e; background: #edf7f5; box-shadow: inset 0 0 0 1px #31877e; }
.workpaper-kind-control button.is-active > span { background: #176f68; color: #fff; }
.workpaper-generator-form { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(240px, 1.2fr) auto; gap: 12px; align-items: end; border-top: 1px solid #e1e6e8; margin-top: 18px; padding-top: 18px; }
.workpaper-generator-form label { min-width: 0; display: grid; gap: 6px; }
.workpaper-generator-form label > span, .workpaper-editor label > span { color: #5c6b72; font-size: 9px; font-weight: 750; }
.workpaper-generator-form select, .workpaper-generator-form textarea, .workpaper-editor input, .workpaper-editor textarea { width: 100%; min-width: 0; border: 1px solid #cbd5d9; border-radius: 5px; background: #fff; color: #1d2d34; padding: 9px 10px; font: inherit; font-size: 11px; line-height: 1.55; letter-spacing: 0; resize: vertical; }
.workpaper-generator-form select { height: 40px; }
.workpaper-generator-form .wide { grid-column: 2 / 4; }
.workpaper-upload-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.workpaper-generate-button { min-width: 176px; height: 40px; }
.workpaper-output { display: grid; gap: 12px; }
.workpaper-output > .section-toolbar { border-bottom: 1px solid #dfe5e7; padding-bottom: 12px; }
.workpaper-record-list { display: grid; gap: 12px; }
.workpaper-record { min-width: 0; border: 1px solid #d5dde0; border-left: 3px solid #8197a2; border-radius: 7px; background: #fff; overflow: hidden; }
.workpaper-record.is-confirmed { border-left-color: #278278; }
.workpaper-record-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px 10px; }
.workpaper-record-header > div { min-width: 0; }
.workpaper-kind { display: block; color: #337066; font-size: 8px; font-weight: 800; }
.workpaper-record-header h3 { color: #1c2b32; font-size: 14px; line-height: 1.45; margin: 4px 0 0; overflow-wrap: anywhere; letter-spacing: 0; }
.workpaper-record-header small { display: block; color: #718087; font-size: 9px; line-height: 1.55; margin-top: 4px; overflow-wrap: anywhere; }
.workpaper-record-actions { min-height: 46px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; border-top: 1px solid #edf0f1; border-bottom: 1px solid #e2e7e9; background: #fafbfb; padding: 7px 18px; }
.workpaper-record-actions a span { margin-left: 5px; }
.workpaper-detail > summary { cursor: pointer; color: #355661; font-size: 10px; font-weight: 750; padding: 11px 18px; list-style-position: inside; }
.workpaper-detail[open] > summary { border-bottom: 1px solid #e2e7e9; }
.workpaper-section { padding: 16px 18px 4px; }
.workpaper-section + .workpaper-section { border-top: 1px solid #e4e9eb; margin-top: 12px; }
.workpaper-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workpaper-section h4 { color: #1c2b32; font-size: 12px; line-height: 1.45; margin: 0; letter-spacing: 0; }
.workpaper-section > header > span { color: #78868c; font-size: 9px; }
.workpaper-section-summary { color: #617078; font-size: 10px; line-height: 1.65; margin: 6px 0 12px; }
.workpaper-template-fields { margin: 12px 0; border: 1px solid #dce5e5; border-radius: 8px; overflow: hidden; }
.workpaper-template-field { display: grid; grid-template-columns: minmax(110px, 24%) minmax(0, 1fr); }
.workpaper-template-field + .workpaper-template-field { border-top: 1px solid #dce5e5; }
.workpaper-template-field dt { min-width: 0; padding: 12px; background: #f2f7f6; color: #315e59; font-size: 10px; line-height: 1.65; font-weight: 750; white-space: pre-wrap; overflow-wrap: anywhere; }
.workpaper-template-field dd { min-width: 0; margin: 0; padding: 12px; color: #34454c; }
.workpaper-template-field dd > p { margin: 0; min-height: 1.7em; font-size: 10px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .workpaper-template-field { grid-template-columns: minmax(0, 1fr); }
  .workpaper-template-field dt { padding-bottom: 8px; }
}
.workpaper-entry-list { display: grid; gap: 12px; }
.workpaper-entry { border-top: 1px solid #dfe5e7; padding: 12px 0 4px; }
.workpaper-entry > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workpaper-entry > header strong { min-width: 0; color: #23343b; font-size: 11px; overflow-wrap: anywhere; }
.workpaper-score { flex: 0 0 auto; color: #176b65; font: 750 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.workpaper-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 16px; margin-top: 10px; }
.workpaper-entry-grid > div { min-width: 0; border-left: 2px solid #d9e2e5; padding-left: 9px; }
.workpaper-entry-grid > div.is-finding { border-left-color: #bc6048; background: #fff9f7; padding-top: 6px; padding-bottom: 6px; }
.workpaper-entry-grid > div.is-recommendation { border-left-color: #388b78; background: #f6fbf9; padding-top: 6px; padding-bottom: 6px; }
.workpaper-entry-grid span { display: block; color: #738087; font-size: 8px; font-weight: 750; }
.workpaper-entry-grid p { color: #34454c; font-size: 10px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; }
.workpaper-evidence-ref { margin-top: 8px; padding-top: 6px; border-top: 1px solid #d9e2e5; overflow-wrap: anywhere; }
.workpaper-evidence-ref strong, .workpaper-evidence-ref small { display: block; font-size: 9px; line-height: 1.6; }
.workpaper-evidence-ref small { color: #738087; }
.workpaper-evidence-ref p { font-size: 10px; line-height: 1.7; white-space: pre-wrap; margin: 4px 0 0; }
.workpaper-entry-sources { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.workpaper-entry-sources > span, .workpaper-no-source { display: inline-flex; border: 1px solid #d8e0e2; background: #f6f8f9; color: #67777e; padding: 3px 6px; font-size: 8px; }
.workpaper-editor { border-top: 1px solid #dce3e5; background: #f8fafb; padding: 16px 18px; }
.workpaper-editor label { display: grid; gap: 5px; }
.workpaper-title-editor { margin-bottom: 14px; }
.workpaper-section-editor { border-top: 1px solid #dbe2e4; padding-top: 14px; margin-top: 14px; }
.workpaper-section-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.workpaper-section-editor > header strong { color: #26373e; font-size: 11px; }
.workpaper-section-editor > header small { color: #76858b; font-size: 9px; }
.workpaper-entry-editor { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; border: 1px solid #d9e1e3; border-radius: 5px; background: #fff; padding: 12px; margin-top: 12px; }
.workpaper-entry-editor legend { color: #315661; font-size: 10px; font-weight: 750; padding: 0 6px; }
.workpaper-entry-editor label:first-of-type, .workpaper-entry-editor label:nth-of-type(2) { grid-column: 1 / -1; }
.workpaper-editor-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #d9e1e3; padding-top: 14px; margin-top: 16px; }
.project-artifact-inventory > header > span { flex: 0 0 auto; color: #506169; font-size: 10px; }
.project-artifact-list { display: grid; border-top: 1px solid #dde4e6; margin-top: 16px; }
.project-artifact-row { min-width: 0; min-height: 54px; display: grid; grid-template-columns: 92px minmax(0,1fr) 92px 34px; align-items: center; gap: 12px; border-bottom: 1px solid #e6eaec; padding: 8px 0; }
.project-artifact-row > div { min-width: 0; }
.project-artifact-row strong, .project-artifact-row small { display: block; overflow-wrap: anywhere; }
.project-artifact-row strong { color: #26363d; font-size: 10px; }
.project-artifact-row small { color: #78868c; font-size: 8px; margin-top: 3px; }
.artifact-category { width: 88px; display: inline-flex; align-items: center; justify-content: center; min-height: 24px; border: 1px solid #d4dfe1; background: #f3f7f7; color: #416069; font-size: 8px; font-weight: 750; }

@media (max-width: 980px) {
  .workpaper-generator > header { display: grid; }
  .workpaper-readiness-grid { width: 100%; }
  .workpaper-generator-form { grid-template-columns: 1fr 1fr; }
  .workpaper-generator-form .wide { grid-column: 1 / -1; }
  .workpaper-generate-button { width: 100%; }
  .workpaper-entry-grid { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 680px) {
  .project-lifecycle-band { align-items: stretch; flex-direction: column; padding: 13px; }
  .project-lifecycle-band > button { width: 100%; }
  .workpaper-band { padding: 16px 13px; }
  .workpaper-kind-control { grid-template-columns: minmax(0,1fr); }
  .workpaper-kind-control button { min-height: 74px; }
  .workpaper-generator-form { grid-template-columns: minmax(0,1fr); }
  .workpaper-generator-form .wide { grid-column: auto; }
  .workpaper-upload-actions { display: grid; grid-template-columns: minmax(0,1fr); }
  .workpaper-record-header { display: grid; }
  .workpaper-record-actions { justify-content: flex-start; }
  .workpaper-entry-editor { grid-template-columns: minmax(0,1fr); }
  .workpaper-entry-editor label { grid-column: 1 !important; }
  .project-artifact-row { grid-template-columns: 74px minmax(0,1fr) 34px; }
  .project-artifact-row > .status-pill { display: none; }
  .artifact-category { width: 70px; }
}

/* Structured Agent references */
.agent-composer-shell { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: end; }
.agent-attachment-wrap { grid-column: 1; grid-row: 1; }
.agent-composer-shell .agent-input { grid-column: 2; grid-row: 1; width: 100%; }
.agent-composer-controls { grid-column: 3; grid-row: 1; }
.agent-attachment-menu-label { border-top: 1px solid #2a3738; background: #101617; color: #5e7773; padding: 7px 12px 5px; font-size: 8px; font-weight: 750; }
.agent-attachment-menu-label:first-child { border-top: 0; }
.agent-attachment-menu button:has(.agent-upload-icon) { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 9px; }
.agent-upload-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #385452; border-radius: 4px; background: #182524; color: #6bc6bb; font-size: 9px; font-weight: 800; }
.agent-mention-header { position: sticky; top: -5px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #283536; background: #12191a; color: #95aaa6; padding: 8px 8px 7px; }
.agent-mention-header span { font-size: 9px; font-weight: 750; }
.agent-mention-header small { color: #60736f; font-size: 8px; }
.agent-mention-menu button { grid-template-columns: 36px minmax(0, 1fr) 20px; }
.agent-mention-menu button > span:nth-child(2) { min-width: 0; }
.agent-mention-menu button em { display: block; color: #55a99f; font-size: 7px; font-style: normal; font-weight: 750; margin-bottom: 2px; }
.agent-mention-menu button > i { color: #526763; font-size: 13px; font-style: normal; text-align: center; }
.agent-mention-menu button:hover > i, .agent-mention-menu button.is-active > i { color: #78d1c6; }
.agent-mention-type { min-height: 30px; font-size: 10px; }

/* Project workpaper pools */
.workpaper-pool-heading, .intermediate-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid #dbe2e4; padding: 4px 2px 18px; }
.workpaper-pool-heading h2, .workpaper-output-group h2, .intermediate-heading h2 { color: #17272e; font-size: 18px; line-height: 1.35; margin: 4px 0 0; letter-spacing: 0; }
.workpaper-pool-heading p, .workpaper-output-group header p, .intermediate-heading p { max-width: 760px; color: #617078; font-size: 11px; line-height: 1.65; margin: 6px 0 0; }
.workpaper-pool-heading p b { color: #176f68; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.workpaper-pool-stats { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, 82px); gap: 6px; }
.workpaper-pool-stats span { min-height: 56px; display: grid; align-content: center; border-left: 2px solid #95aaa6; background: #f4f7f8; color: #6b7980; padding: 7px 10px; font-size: 8px; }
.workpaper-pool-stats b { display: block; color: #263a42; font-size: 17px; line-height: 1.1; margin-bottom: 4px; }
.workpaper-reference-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.workpaper-reference-group { min-width: 0; border-top: 2px solid #81969d; border-bottom: 1px solid #d9e1e3; background: #fff; padding: 15px 0 0; }
.workpaper-reference-group:nth-child(1) { border-top-color: #278078; }
.workpaper-reference-group:nth-child(2) { border-top-color: #416f9d; }
.workpaper-reference-group:nth-child(3) { border-top-color: #a36a3f; }
.workpaper-reference-group > header { min-height: 78px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 0 12px 13px; }
.workpaper-reference-group h3 { color: #21343c; font-size: 13px; margin: 0; letter-spacing: 0; }
.workpaper-reference-group header p { color: #6d7b82; font-size: 9px; line-height: 1.55; margin: 5px 0 0; }
.workpaper-reference-list { display: grid; gap: 1px; background: #e4e9eb; }
.workpaper-reference-card { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; background: #f9fbfb; padding: 12px; }
.workpaper-reference-card > div:nth-child(2) { min-width: 0; }
.workpaper-reference-icon { width: 32px; height: 36px; display: grid; place-items: center; border: 1px solid #cad8d8; border-radius: 4px; background: #eaf2f1; color: #276f69; font-size: 11px; font-weight: 800; }
.workpaper-reference-type { display: block; color: #47736f; font-size: 7px; font-weight: 800; }
.workpaper-reference-card strong { display: block; color: #26373e; font-size: 10px; line-height: 1.45; margin-top: 3px; overflow-wrap: anywhere; }
.workpaper-reference-card p { color: #6f7d83; font-size: 8px; line-height: 1.55; margin: 5px 0 0; }
.workpaper-reference-card small { display: block; color: #8a969b; font-size: 7px; line-height: 1.45; margin-top: 5px; overflow-wrap: anywhere; }
.workpaper-reference-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; border-top: 1px solid #e2e7e8; padding-top: 8px; }
.workpaper-reference-empty { min-height: 118px; display: grid; place-content: center; justify-items: center; background: #f8fafa; color: #89959a; padding: 18px; text-align: center; }
.workpaper-reference-empty > span { color: #a8b2b6; font-size: 18px; }
.workpaper-reference-empty strong { color: #6f7d83; font-size: 9px; margin-top: 6px; }
.workpaper-reference-empty button { border: 0; background: transparent; color: #17716a; font-size: 9px; font-weight: 750; margin-top: 8px; }
.workpaper-stage-strip { min-height: 76px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; border-top: 1px solid #cfdadd; border-bottom: 1px solid #cfdadd; background: #f3f6f7; padding: 12px 18px; }
.workpaper-stage-strip > span { min-width: 86px; display: grid; place-items: center; min-height: 36px; border: 1px solid #87aaa6; background: #fff; color: #176e67; padding: 0 10px; font-size: 10px; font-weight: 800; }
.workpaper-stage-strip strong, .workpaper-stage-strip p { display: block; margin: 0; }
.workpaper-stage-strip strong { color: #26383f; font-size: 11px; }
.workpaper-stage-strip p { color: #6b7980; font-size: 9px; line-height: 1.55; margin-top: 3px; }
.workpaper-output-group { display: grid; gap: 12px; border-top: 1px solid #d7dfe2; padding-top: 18px; }
.workpaper-output-group > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.analysis-workpaper-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analysis-workpaper-card { min-width: 0; border: 1px solid #d4dfe0; border-left: 3px solid #3c7e77; border-radius: 7px; background: #fff; padding: 15px; }
.analysis-workpaper-card > header { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: flex-start; gap: 10px; }
.analysis-workpaper-mark { width: 36px; height: 40px; display: grid; place-items: center; border: 1px solid #bfd7d4; border-radius: 4px; background: #edf7f5; color: #176f68; font-size: 12px; font-weight: 800; }
.analysis-workpaper-card header > div { min-width: 0; }
.analysis-workpaper-card header > div > span { color: #39766f; font-size: 8px; font-weight: 800; }
.analysis-workpaper-card h3 { color: #22353c; font-size: 12px; line-height: 1.45; margin: 3px 0 0; overflow-wrap: anywhere; letter-spacing: 0; }
.analysis-workpaper-card small { display: block; color: #7b898f; font-size: 8px; margin-top: 4px; }
.analysis-workpaper-card > p { color: #627178; font-size: 9px; line-height: 1.65; margin: 12px 0; }
.analysis-workpaper-card > footer { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid #e2e7e9; padding-top: 10px; }

/* Intermediate product pool */
.intermediate-view { display: grid; gap: 22px; }
.intermediate-process-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1px; border-top: 1px solid #d7dfe1; border-bottom: 1px solid #d7dfe1; background: #dfe5e7; }
.intermediate-process-card { min-width: 0; min-height: 112px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: 5px 9px; border: 0; background: #fff; color: #26383f; padding: 14px; text-align: left; }
.intermediate-process-card > span { grid-row: 1 / 3; align-self: start; color: #5f8f89; font: 800 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.intermediate-process-card strong { min-width: 0; font-size: 11px; }
.intermediate-process-card small { min-width: 0; color: #748188; font-size: 8px; line-height: 1.5; }
.intermediate-process-card i { grid-column: 3; grid-row: 1 / 3; align-self: center; color: #8a999d; font-size: 14px; font-style: normal; }
.intermediate-section { display: grid; gap: 12px; border-top: 1px solid #d8e0e2; padding-top: 17px; }
.intermediate-section > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.intermediate-section h3 { color: #20323a; font-size: 14px; margin: 0; letter-spacing: 0; }
.intermediate-section header p { color: #6b7980; font-size: 9px; line-height: 1.55; margin: 4px 0 0; }
.intermediate-section header > span { color: #6d7d83; font-size: 9px; }
.intermediate-findings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.intermediate-finding { min-width: 0; border: 1px solid #d8e0e2; border-top: 2px solid #477e9d; border-radius: 6px; background: #fff; padding: 13px; }
.intermediate-finding.is-risk { border-top-color: #ad644f; }
.intermediate-finding > span { color: #577a8c; font-size: 7px; font-weight: 800; }
.intermediate-finding.is-risk > span { color: #9a5745; }
.intermediate-finding strong { display: block; color: #27383f; font-size: 10px; line-height: 1.45; margin-top: 4px; }
.intermediate-finding p { color: #627178; font-size: 9px; line-height: 1.65; margin: 7px 0; }
.intermediate-finding small { color: #89959a; font-size: 8px; }
.intermediate-file-list { display: grid; border-top: 1px solid #dfe5e7; }
.intermediate-file-row { min-width: 0; min-height: 56px; display: grid; grid-template-columns: 54px minmax(0, 1fr) 34px; align-items: center; gap: 12px; border-bottom: 1px solid #e3e8ea; padding: 8px 2px; }
.intermediate-file-row > span { display: grid; place-items: center; min-height: 25px; border: 1px solid #d3dddf; background: #f2f6f6; color: #47636d; font-size: 8px; font-weight: 800; }
.intermediate-file-row > div { min-width: 0; }
.intermediate-file-row strong, .intermediate-file-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intermediate-file-row strong { color: #293a41; font-size: 10px; }
.intermediate-file-row small { color: #7c898f; font-size: 8px; margin-top: 4px; }
.intermediate-empty { min-height: 320px; display: grid; place-content: center; justify-items: center; gap: 14px; border-top: 1px solid #d8e0e2; border-bottom: 1px solid #d8e0e2; color: #718087; text-align: center; }
.intermediate-empty strong { color: #465a62; font-size: 13px; }

@media (max-width: 1080px) {
  .workpaper-reference-groups { grid-template-columns: minmax(0, 1fr); }
  .workpaper-reference-group > header { min-height: 0; }
  .analysis-workpaper-list { grid-template-columns: minmax(0, 1fr); }
  .intermediate-findings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .agent-composer-shell { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .agent-mention-header small { display: none; }
  .workpaper-pool-heading, .intermediate-heading, .workpaper-output-group > header { display: grid; }
  .workpaper-pool-stats { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workpaper-pool-stats span { min-width: 0; }
  .workpaper-stage-strip { grid-template-columns: minmax(0, 1fr); }
  .workpaper-stage-strip > span { width: max-content; }
  .workpaper-stage-strip > button { width: 100%; }
  .analysis-workpaper-card > header { grid-template-columns: 36px minmax(0, 1fr); }
  .analysis-workpaper-card > header .status-pill { grid-column: 2; width: max-content; }
  .intermediate-process-grid, .intermediate-findings { grid-template-columns: minmax(0, 1fr); }
}

/* Agent upload pools and compact composer */
.agent-composer { padding-top: 9px; padding-bottom: 10px; }
.agent-composer-shell {
  min-height: 46px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  column-gap: 5px;
  border-radius: 24px;
  padding: 5px 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24), inset 0 1px 0 #1b2526;
}
.agent-composer-shell::before { display: none; }
.agent-composer-shell:focus-within {
  box-shadow: 0 10px 28px rgba(0, 0, 0, .3), 0 0 0 3px rgba(66, 164, 153, .1), inset 0 1px 0 #203031;
}
.agent-composer-shell .agent-input {
  min-height: 34px;
  max-height: 128px;
  padding: 7px 3px 6px;
  font-size: 11px;
  line-height: 1.45;
}
.agent-attachment-wrap { align-self: center; }
.agent-composer-shell .agent-attachment,
.agent-composer-shell .agent-stop,
.agent-composer-shell .agent-send {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  flex-basis: 32px !important;
  border-radius: 50%;
}
.agent-attachment {
  display: grid;
  place-items: center;
  padding: 0;
  border-color: #3a4a4b;
  background: #182021;
  color: #a3b3b0;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}
.agent-composer-controls { align-self: center; gap: 4px; }
.agent-stop { padding: 0; font-size: 7px; }
.agent-send {
  display: grid;
  place-items: center;
  padding: 0;
  border-color: #439b92;
  background: #237d75;
  box-shadow: none;
}
.agent-send span {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-1px);
}
.agent-send:hover { background: #2a9187; box-shadow: 0 0 0 3px rgba(78, 174, 163, .12); }
.agent-send:active { transform: none; box-shadow: none; }
.agent-send:disabled { box-shadow: none; }

.agent-attachment-menu {
  left: -8px;
  bottom: calc(100% + 11px);
  width: min(440px, calc(100vw - 44px));
  max-height: min(610px, calc(100vh - 150px));
  overflow-y: auto;
  border-color: #3a4a4b;
  border-radius: 8px;
  background: #12191a;
}
.agent-attachment-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #293536;
  padding: 13px 14px 11px;
}
.agent-attachment-heading strong { color: #d8e2df; font-size: 11px; }
.agent-attachment-heading small { color: #748682; font-size: 8px; margin-top: 3px; }
.agent-pool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #293536;
  padding: 10px 12px;
}
.agent-attachment-menu .agent-pool-tags button {
  width: auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #344647;
  border-radius: 16px;
  background: #182122;
  color: #aab9b6;
  padding: 5px 9px 5px 6px;
  font-size: 9px;
  line-height: 1.2;
}
.agent-attachment-menu .agent-pool-tags button > span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #263536;
  color: #8eb8b3;
  font-size: 7px;
  font-weight: 800;
}
.agent-attachment-menu .agent-pool-tags button:hover { border-color: #4d6b68; background: #1c2828; }
.agent-attachment-menu .agent-pool-tags button.is-active {
  border-color: #4e968e;
  background: #1c302e;
  color: #d7e5e2;
  box-shadow: inset 0 0 0 1px rgba(100, 190, 179, .08);
}
.agent-attachment-menu .agent-pool-tags button.is-active > span { background: #2d766e; color: #eff9f7; }
.agent-attachment-menu .agent-pool-tags .agent-pool-failure-count { flex:none; width:auto; min-width:17px; height:17px; padding:0 4px; border-radius:9px; background:#6d3433; color:#ffe0da; font-size:9px; font-variant-numeric:tabular-nums; }
.agent-pool-failure-count[hidden] { display:none !important; }
.agent-attachment-menu .agent-pool-tags button.has-failures { border-color:#6c4541; }
.agent-attachment-menu .agent-pool-tags button.has-failures.is-active { background:#302120; border-color:#a46a60; color:#f0d4cc; }
.agent-pool-failures { padding:12px; }
.agent-pool-failures > header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:10px; color:#d5dfdc; font-size:11px; }
.agent-pool-failures > header > span { color:#c49990; font-size:10px; }
.agent-pool-failures-empty { padding:24px 12px; color:#849995; text-align:center; font-size:12px; }
.agent-pool-failures .material-import-job { margin-bottom:10px; }
.agent-pool-failures .material-import-job > div:first-child { gap:10px; }
.agent-pool-failures .material-import-job strong { min-width:0; overflow-wrap:anywhere; }
.agent-pool-failures .material-import-job > div:first-child > span { flex:none; font-size:10px; }
.agent-pool-upload { padding: 12px; }
.agent-pool-upload > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 1px 2px 10px;
}
.agent-pool-upload > header > div { min-width: 0; }
.agent-pool-upload > header strong { color: #d5dfdc; font-size: 11px; }
.agent-pool-upload > header small { color: #768985; font-size: 8px; line-height: 1.5; margin-top: 3px; }
.agent-pool-upload > header > span {
  flex: 0 0 auto;
  border: 1px solid #3a5250;
  border-radius: 12px;
  background: #172321;
  color: #79b8b0;
  padding: 4px 8px;
  font-size: 8px;
}
.agent-pool-dropzone {
  min-height: 190px;
  display: grid;
  place-content: center;
  justify-items: center;
  border: 1px dashed #47605e;
  border-radius: 7px;
  background: #101718;
  padding: 24px 18px;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.agent-pool-dropzone.is-dragover {
  border-color: #65bdb2;
  background: #142321;
  box-shadow: inset 0 0 0 2px rgba(91, 191, 179, .09);
}
.agent-pool-dropzone.is-compact { min-height: 118px; padding: 16px; }
.agent-pool-dropzone.is-compact .agent-pool-add { width: 34px; height: 34px; font-size: 18px; }
.agent-attachment-menu .agent-pool-add {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #4a6a66;
  border-radius: 50%;
  background: #1c2b2a;
  color: #78c9bf;
  padding: 0;
  font-size: 21px;
  font-weight: 300;
  line-height: 1;
}
.agent-attachment-menu .agent-pool-add:hover { border-color: #68b9af; background: #233735; }
.agent-pool-dropzone > strong { color: #c7d4d1; font-size: 10px; margin-top: 11px; }
.agent-pool-dropzone > small { color: #687c78; font-size: 8px; margin-top: 5px; }
.agent-pool-choose {
  display: flex;
  gap: 6px;
  margin-top: 13px;
}
.agent-attachment-menu .agent-pool-choose button {
  width: auto;
  border: 1px solid #3a504e;
  border-radius: 5px;
  background: #182422;
  color: #abc0bc;
  padding: 7px 10px;
  font-size: 8px;
}
.agent-attachment-menu .agent-pool-choose button:hover { border-color: #52827d; background: #1d2c2a; }
.agent-pool-upload-progress {
  border-top: 1px solid #293536;
  color: #91a5a1;
  margin-top: 10px;
  padding-top: 10px;
  font-size: 8px;
}
.agent-pool-file-browser {
  display: grid;
  gap: 8px;
  border-top: 1px solid #293536;
  margin-top: 11px;
  padding-top: 11px;
}
.agent-pool-browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-pool-browser-toolbar label {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  border: 1px solid #344344;
  border-radius: 6px;
  background: #0f1617;
  color: #6f8581;
  padding: 0 7px;
}
.agent-pool-browser-toolbar input {
  min-width: 0;
  height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ced9d6;
  font-size: 9px;
}
.agent-pool-browser-toolbar label:focus-within {
  border-color: var(--reference-border, #4e968e);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--reference-accent, #69bcae) 10%, transparent);
}
.agent-pool-browser-toolbar small { flex: 0 0 auto; color: #71827f; font-size: 8px; }
.agent-pool-file-list {
  display: grid;
  max-height: 214px;
  overflow-y: auto;
  border-top: 1px solid #293536;
  scrollbar-color: #416964 #0d1314;
  scrollbar-width: thin;
}
.agent-pool-file-row {
  min-width: 0;
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #293536;
  padding: 7px 2px;
}
.agent-pool-file-icon {
  width: 32px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--reference-border, #3a5250);
  border-radius: 4px;
  background: var(--reference-soft, #172321);
  color: var(--reference-accent, #79b8b0);
  font-size: 7px;
  font-weight: 800;
}
.agent-pool-file-row > div:nth-child(2) { min-width: 0; }
.agent-pool-file-row strong,
.agent-pool-file-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-pool-file-row strong { color: #c9d4d1; font-size: 9px; }
.agent-pool-file-row small { color: #697b78; font-size: 7px; margin-top: 4px; }
.agent-pool-file-actions { display: flex; align-items: center; gap: 3px; }
.agent-pool-file-actions .icon-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: 1px solid #344344;
  border-radius: 50%;
  background: #151e1f;
  color: #95aaa6;
  font-size: 9px;
}
.agent-pool-file-actions .icon-button:hover { border-color: var(--reference-border, #4e716d); color: var(--reference-accent, #b7cbc7); }
.agent-pool-file-actions .agent-pool-delete:hover { border-color: #7b4c49; background: #2a1c1c; color: #e29a91; }
.agent-pool-file-empty {
  min-height: 70px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #71817e;
  text-align: center;
}
.agent-pool-file-empty strong { color: #9aaba7; font-size: 9px; }
.agent-pool-file-empty span { font-size: 7px; margin-top: 4px; }
.agent-pool-pagination { display: flex; align-items: center; justify-content: center; gap: 9px; color: #71817e; font-size: 8px; }
.agent-pool-pagination button {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #344344;
  border-radius: 50%;
  background: #151e1f;
  color: #9aadaa;
  padding: 0;
}
.agent-pool-pagination button:disabled { opacity: .35; }

/* Report drafts generated from the two project workpaper pools */
.project-report-draft-groups { display: grid; gap: 24px; margin-bottom: 28px; }
.project-report-draft-group {
  display: grid;
  gap: 14px;
  border-top: 2px solid #2f8178;
  border-bottom: 1px solid #d7dfe2;
  padding: 18px 0 20px;
}
.project-report-draft-group:nth-child(2) { border-top-color: #587a9a; }
.project-report-draft-group > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.project-report-draft-group > header > div { min-width: 0; }
.project-report-draft-group h2 { color: #1f3239; font-size: 17px; margin: 3px 0 0; letter-spacing: 0; }
.project-report-draft-group header p { max-width: 780px; color: #68777e; font-size: 10px; line-height: 1.65; margin: 6px 0 0; }
.project-report-draft-group .workpaper-record-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workpaper-reference-groups.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 780px) {
  .agent-attachment-menu {
    left: -7px;
    width: min(420px, calc(100vw - 30px));
    max-height: min(560px, calc(100vh - 120px));
  }
  .project-report-draft-group .workpaper-record-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .agent-composer { padding: 8px 10px 9px; }
  .agent-composer-shell { min-height: 44px; grid-template-columns: 32px minmax(0, 1fr) auto; padding: 5px; }
  .agent-composer-shell .agent-attachment,
  .agent-composer-shell .agent-stop,
  .agent-composer-shell .agent-send { width: 30px !important; height: 30px !important; min-width: 30px; flex-basis: 30px !important; }
  .agent-composer-shell .agent-input { min-height: 32px; }
  .agent-attachment-menu {
    position: absolute;
    left: -6px;
    right: auto;
    bottom: calc(100% + 11px);
    width: calc(100vw - 20px);
    max-height: min(340px, calc(50vh - 82px));
    max-height: min(340px, calc(50dvh - 82px));
  }
  .agent-pool-tags { gap: 5px; }
  .agent-attachment-menu .agent-pool-tags button { font-size: 8px; }
  .agent-pool-dropzone { min-height: 164px; }
  .project-report-draft-group > header { display: grid; }
}

/* Project Agent navigation, dark scrollbars and categorized references */
.nav-item-agent > span:not(.nav-icon) { min-width: 0; }
.nav-item-agent .agent-unread { margin-left: auto; }

.agent-panel {
  color-scheme: dark;
  scrollbar-color: #3f6762 #0d1314;
  scrollbar-width: thin;
}
.agent-thread,
.agent-research-content,
.agent-attachment-menu,
.agent-mention-menu,
.agent-reference-picker-list {
  scrollbar-color: #416964 #0d1314;
  scrollbar-width: thin;
}
.agent-thread::-webkit-scrollbar,
.agent-research-content::-webkit-scrollbar,
.agent-attachment-menu::-webkit-scrollbar,
.agent-mention-menu::-webkit-scrollbar,
.agent-reference-picker-list::-webkit-scrollbar { width: 9px; height: 9px; }
.agent-pool-file-list::-webkit-scrollbar { width: 8px; height: 8px; }
.agent-thread::-webkit-scrollbar-track,
.agent-research-content::-webkit-scrollbar-track,
.agent-attachment-menu::-webkit-scrollbar-track,
.agent-mention-menu::-webkit-scrollbar-track,
.agent-reference-picker-list::-webkit-scrollbar-track,
.agent-pool-file-list::-webkit-scrollbar-track { background: #0d1314; }
.agent-thread::-webkit-scrollbar-thumb,
.agent-research-content::-webkit-scrollbar-thumb,
.agent-attachment-menu::-webkit-scrollbar-thumb,
.agent-mention-menu::-webkit-scrollbar-thumb,
.agent-reference-picker-list::-webkit-scrollbar-thumb,
.agent-pool-file-list::-webkit-scrollbar-thumb {
  border: 2px solid #0d1314;
  border-radius: 8px;
  background: #3f6762;
}
.agent-thread::-webkit-scrollbar-thumb:hover,
.agent-research-content::-webkit-scrollbar-thumb:hover,
.agent-attachment-menu::-webkit-scrollbar-thumb:hover,
.agent-mention-menu::-webkit-scrollbar-thumb:hover,
.agent-reference-picker-list::-webkit-scrollbar-thumb:hover,
.agent-pool-file-list::-webkit-scrollbar-thumb:hover { background: #56837d; }

[data-reference-tone="workpaper"] { --reference-accent: #69bcae; --reference-soft: #17312e; --reference-border: #396a63; }
[data-reference-tone="issue"] { --reference-accent: #d28c78; --reference-soft: #30211f; --reference-border: #6d4941; }
[data-reference-tone="intermediate"] { --reference-accent: #c4aa68; --reference-soft: #2c291d; --reference-border: #655b38; }
[data-reference-tone="raw"] { --reference-accent: #79aecd; --reference-soft: #1c2b34; --reference-border: #3f6175; }
[data-reference-tone="policy"] { --reference-accent: #9fbc73; --reference-soft: #24301f; --reference-border: #536b40; }

.agent-inline-reference,
.agent-message-inline-reference {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--reference-border);
  border-radius: 5px;
  background: var(--reference-soft);
  color: var(--reference-accent);
  padding: 1px 6px;
  font: inherit;
  font-size: .92em;
  font-weight: 700;
  line-height: 1.55;
  vertical-align: baseline;
  white-space: nowrap;
  cursor: pointer;
}
.agent-inline-reference { margin: 0 2px; user-select: none; }
.agent-inline-reference:hover,
.agent-inline-reference:focus,
.agent-message-inline-reference:hover,
.agent-message-inline-reference:focus { outline: 0; filter: brightness(1.16); }
.agent-message-inline-reference { margin: 0 3px; appearance: none; }

.agent-mention-menu { width: min(510px, calc(100% - 118px)); max-height: 360px; padding: 7px; }
.agent-mention-menu button[data-reference-tone] { min-height: 58px; border: 1px solid transparent; padding: 9px; }
.agent-mention-menu button[data-reference-tone]:hover,
.agent-mention-menu button[data-reference-tone].is-active {
  border-color: var(--reference-border);
  background: var(--reference-soft);
  box-shadow: inset 3px 0 0 var(--reference-accent);
}
.agent-mention-menu button[data-reference-tone] .agent-mention-type {
  min-height: 34px;
  border-color: var(--reference-border);
  background: var(--reference-soft);
  color: var(--reference-accent);
}
.agent-mention-menu button[data-reference-tone] em,
.agent-mention-menu button[data-reference-tone] > i { color: var(--reference-accent); }

.agent-conversation { position: relative; }
.agent-reference-picker {
  position: absolute;
  z-index: 24;
  left: 50%;
  bottom: 92px;
  width: min(780px, calc(100% - 48px));
  height: min(560px, calc(100% - 126px));
  min-height: 390px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #34494a;
  border-top-color: var(--reference-border, #46706b);
  border-radius: 8px;
  background: #111819;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .025);
  transform: translateX(-50%);
}
.agent-reference-picker > header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #293637;
  background: #0f1516;
  padding: 10px 14px;
}
.agent-reference-picker-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.agent-reference-picker-identity > span {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--reference-border);
  border-radius: 50%;
  background: var(--reference-soft);
  color: var(--reference-accent);
  font-size: 10px;
  font-weight: 800;
}
.agent-reference-picker-identity > div { min-width: 0; }
.agent-reference-picker-identity strong,
.agent-reference-picker-identity small { display: block; }
.agent-reference-picker-identity strong { color: #e0e9e7; font-size: 13px; }
.agent-reference-picker-identity small { color: #748783; font-size: 9px; margin-top: 3px; }
.agent-reference-picker-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #283536;
  padding: 9px 14px;
}
.agent-reference-search {
  min-width: 0;
  width: min(430px, 100%);
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #344748;
  border-radius: 6px;
  background: #0d1314;
  color: #6f8581;
  padding: 0 10px;
}
.agent-reference-search:focus-within { border-color: var(--reference-border); box-shadow: 0 0 0 2px color-mix(in srgb, var(--reference-accent) 12%, transparent); }
.agent-reference-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #d6e1df; font-size: 10px; }
.agent-reference-search input::placeholder { color: #60736f; }
.agent-reference-picker-toolbar > div { display: flex; gap: 6px; }
.agent-reference-picker-toolbar button,
.agent-reference-pagination button {
  min-height: 30px;
  border: 1px solid #354849;
  border-radius: 5px;
  background: #172021;
  color: #9badab;
  padding: 0 9px;
  font-size: 8px;
}
.agent-reference-picker-toolbar button:hover,
.agent-reference-pagination button:hover:not(:disabled) { border-color: var(--reference-border); color: var(--reference-accent); }
.agent-reference-picker-list { min-height: 0; flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 5px; padding: 10px 14px; }
.agent-reference-option {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 18px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #283637;
  border-radius: 6px;
  background: #131b1c;
  padding: 8px 10px;
  cursor: pointer;
}
.agent-reference-option:hover { border-color: #405556; background: #162021; }
.agent-reference-option.is-selected { border-color: var(--reference-border); background: var(--reference-soft); box-shadow: inset 3px 0 0 var(--reference-accent); }
.agent-reference-option input { width: 15px; height: 15px; accent-color: var(--reference-accent); }
.agent-reference-file-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #344647; border-radius: 5px; background: #192324; color: #849894; font-size: 7px; font-weight: 800; }
.agent-reference-option.is-selected .agent-reference-file-icon { border-color: var(--reference-border); color: var(--reference-accent); }
.agent-reference-option > span:nth-of-type(2) { min-width: 0; }
.agent-reference-option strong,
.agent-reference-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-reference-option strong { color: #cdd9d7; font-size: 10px; }
.agent-reference-option small { color: #71827f; font-size: 8px; margin-top: 4px; }
.agent-reference-option > i { color: #637572; font-size: 8px; font-style: normal; }
.agent-reference-option.is-selected > i { color: var(--reference-accent); }
.agent-reference-picker-empty { min-height: 190px; display: grid; place-content: center; justify-items: center; color: #6d807c; text-align: center; }
.agent-reference-picker-empty strong { color: #b7c5c2; font-size: 11px; }
.agent-reference-picker-empty span { font-size: 9px; margin-top: 5px; }
.agent-reference-picker > footer {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid #293637;
  background: #0f1516;
  padding: 9px 14px;
}
.agent-reference-pagination { min-width: 0; display: flex; align-items: center; gap: 8px; }
.agent-reference-pagination span { color: #788a86; font-size: 8px; }
.agent-reference-picker > footer > span { color: var(--reference-accent); font-size: 9px; font-weight: 750; white-space: nowrap; }
.agent-reference-picker > footer > div:last-child { display: flex; gap: 7px; }

.workpaper-pool-stats { grid-template-columns: repeat(4, 74px); }
.material-row-readonly { grid-template-columns: 38px minmax(0, 1fr) 150px 94px 80px; }
.material-row-readonly .material-readonly-type { color: #50636a; font-size: 9px; font-weight: 750; }
.material-row-readonly .material-actions { width: 80px; }
.workpaper-stage-strip { grid-template-columns: auto minmax(0, 1fr); }

@media (max-width: 1080px) {
  .material-row-readonly { grid-template-columns: 38px minmax(0, 1fr) 120px 82px 78px; }
  .workpaper-pool-stats { grid-template-columns: repeat(2, 82px); }
}

@media (max-width: 740px) {
  .nav-group:nth-child(2) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item-agent .agent-unread { margin-left: 3px; }
  .agent-reference-picker {
    position: fixed;
    top: 116px;
    left: 10px;
    right: 10px;
    bottom: 78px;
    width: auto;
    height: auto;
    min-height: 0;
    transform: none;
  }
  .agent-reference-picker-toolbar { align-items: stretch; flex-direction: column; }
  .agent-reference-search { width: 100%; }
  .agent-reference-picker-toolbar > div { justify-content: flex-end; }
  .agent-reference-picker > footer { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .agent-reference-picker > footer > span { grid-column: 2; grid-row: 1; }
  .agent-reference-picker > footer > div:last-child { grid-column: 1 / -1; }
  .agent-reference-picker > footer > div:last-child .button { flex: 1; }
  .agent-reference-option { grid-template-columns: 17px 34px minmax(0, 1fr); }
  .agent-reference-option > i { display: none; }
  .agent-reference-file-icon { width: 34px; height: 34px; }
  .agent-mention-menu { left: 4px; width: calc(100% - 8px); }
  .material-row-readonly { grid-template-columns: 34px minmax(0, 1fr) 72px; }
  .material-row-readonly .material-readonly-type { display: none; }
  .material-row-readonly > .status-pill { display: none; }
  .material-row-readonly .material-actions { width: 72px; }
  .issue-dimension-options,
  .issue-dimension-group:last-child .issue-dimension-options { grid-template-columns: 1fr; }
  .project-issue-dimensions { padding: 15px; }
  .project-issue-dimensions > header,
  .project-issue-dimensions > footer { align-items: stretch; flex-direction: column; }
  .project-issue-dimensions > footer .button { width: 100%; }
  .research-selection-action { align-items: stretch; flex-direction: column; }
  .research-selection-action .button { width: 100%; }
}

/* Durable archive and folder import status, also visible after refresh. */
.material-imports { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.material-imports:empty { display: none; }
.material-import-job { padding: 10px 12px; border: 1px solid var(--border, #dce3eb); border-radius: 8px; background: var(--surface, #fff); min-width: 0; }
.material-import-job > div:first-child { display: flex; gap: 12px; justify-content: space-between; }
.material-import-job strong, .material-import-job small { overflow-wrap: anywhere; }
.material-import-job small { display: block; margin: 5px 0; }
.material-import-job .button { padding: 4px 8px; font-size: 12px; }
.material-import-details { max-height: 200px; overflow: auto; font-size: 12px; }
.material-import-job { color: var(--ink); border-color: var(--line); }
.agent-attachment-menu .material-import-job { color: #d6e3df; background: #172223; border-color: #344b49; }
.agent-attachment-menu .material-import-job strong { color: #e0eeea; }
.agent-attachment-menu .material-import-job small { color: #9fb8b0; }
.agent-attachment-menu .material-import-job .button { display: inline-block; width: auto; margin: 4px 6px 4px 0; border: 1px solid #42615c; border-radius: 5px; background: #203532; color: #e0eeea; }
.agent-attachment-menu .material-import-job .button:hover { background: #2b4943; }
.agent-attachment-menu .material-import-job .error-text { color: #ffb4ad; }
/* Project-owned indicator editor and compact agent commands. */
.agent-preset-row { display:flex; flex-wrap:wrap; gap:6px; padding:4px 0 8px; }
.agent-preset-row button { font:inherit; font-size:12px; line-height:1.4; color:#c9d4d1; background:#15201f; border:1px solid #36524d; border-radius:4px; padding:5px 8px; cursor:pointer; }
.agent-preset-row button:hover { border-color:#66aa9d; background:#203c35; }
.agent-response-mode-row { justify-content:space-between; gap:8px; }
.agent-indicator-tools { display:inline-flex; flex:none; align-items:center; gap:6px; height:30px; margin:0; padding:3px 5px 3px 8px; border:1px solid #34423f; border-radius:5px; background:#151c1b; }
.agent-indicator-tools > strong { font-size:11px; font-weight:500; color:#a8b9b1; white-space:nowrap; }
.agent-indicator-tools .agent-preset-row { padding:0; }
.agent-indicator-tools button { font-size:11px; line-height:1.2; padding:4px 6px; color:#cad8d1; background:#1d2925; border-color:#3c5549; white-space:nowrap; }
.agent-indicator-tools button:hover { color:#e6efe9; background:#2a3a31; border-color:#61806d; }
.agent-indicator-search-dialog { width:min(500px,calc(100% - 32px)); max-height:calc(100dvh - 32px); margin:auto; border:1px solid #d9e0e4; border-radius:8px; overflow:auto; color:var(--ink); }
.agent-indicator-search-dialog::backdrop { background:rgba(18,32,44,.58); }
.agent-indicator-search-dialog .modal-kicker { color:#9b782b; letter-spacing:0; }
.agent-indicator-search-dialog textarea { min-height:156px; font:inherit; font-size:13px; line-height:1.7; }
.agent-indicator-search-dialog textarea:focus { outline:2px solid #e0c577; outline-offset:1px; }
.agent-indicator-import-action { margin:10px 0; }
.agent-indicator-import-action .button { color:#cbded5; background:#1e3029; border-color:#405b4d; }
.indicator-import-dialog { width:min(860px,calc(100% - 24px)); max-height:calc(100dvh - 24px); padding:0; margin:auto; overflow:hidden; border:1px solid #cdd8de; border-radius:8px; color:var(--ink); background:#fff; }
.indicator-import-dialog::backdrop { background:rgba(18,32,44,.58); }
.indicator-import-dialog > header { display:flex; justify-content:space-between; align-items:flex-start; padding:18px 22px 14px; border-bottom:1px solid #dce4e8; }
.indicator-import-dialog h2 { margin:4px 0; font-size:20px; }
.indicator-import-dialog header p { margin:6px 0 0; color:#65757e; font-size:12px; overflow-wrap:anywhere; }
.indicator-import-body { overflow:auto; max-height:calc(100dvh - 230px); padding:16px 22px; }
.indicator-import-body [hidden], .indicator-import-dialog [hidden] { display:none !important; }
.indicator-import-dialog > footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 22px; border-top:1px solid #dce4e8; background:#f5f8fa; }
.indicator-import-dialog > footer > span { font-size:12px; color:#60727b; }
.indicator-import-dialog > footer > div { display:flex; flex-wrap:wrap; gap:8px; }
.indicator-import-dialog .button { font-size:12px; }
.indicator-import-sources { border-bottom:1px solid #dce4e8; padding-bottom:12px; }
.indicator-import-sources summary { display:flex; align-items:center; gap:10px; cursor:pointer; font-size:13px; font-weight:600; }
.indicator-import-sources summary span { color:#6a7d87; font-weight:400; }
.indicator-import-sources > div { max-height:220px; overflow:auto; margin:10px 0; }
.indicator-import-source { display:flex; align-items:flex-start; gap:10px; padding:9px 0; border-bottom:1px solid #edf1f3; font-size:12px; }
.indicator-import-source > input { flex:none; margin-top:3px; }
.indicator-import-source > span { min-width:0; }
.indicator-import-source a, .indicator-import-links a { color:#25725e; overflow-wrap:anywhere; }
.indicator-import-source small { display:block; margin-top:5px; color:#74828a; line-height:1.6; overflow-wrap:anywhere; }
.indicator-import-candidate-heading { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; margin-top:16px; font-size:13px; }
.indicator-import-candidate-heading label { display:flex; gap:6px; align-items:center; color:#687b85; font-size:12px; }
.indicator-import-note, .indicator-import-status { color:#687b85; font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.indicator-import-error, .indicator-import-success { padding:10px 12px; margin:0 0 12px; font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.indicator-import-error { color:#a53734; background:#fff1ef; }
.indicator-import-success { color:#28654c; background:#edf8f1; }
.indicator-import-candidate { display:grid; grid-template-columns:18px minmax(0,1fr); gap:10px; padding:12px 0; border-bottom:1px solid #e2e8ec; }
.indicator-import-check { align-self:start; width:18px; height:18px; margin:5px 0 0; padding:0; }
.indicator-import-candidate summary { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; list-style:none; }
.indicator-import-candidate summary > span:first-child { min-width:0; }
.indicator-import-candidate summary strong { display:block; font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.indicator-import-candidate summary small { display:block; margin-top:2px; color:#73828a; font-size:11px; }
.indicator-import-badge { flex:none; color:#7d6b3e; background:#fff7df; padding:3px 6px; border-radius:3px; font-size:11px; }
.indicator-import-candidate fieldset { min-width:0; margin:12px 0 0; padding:0; border:0; }
.indicator-import-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.indicator-import-fields > label { display:flex; flex-direction:column; min-width:0; gap:5px; font-size:12px; color:#536b77; }
.indicator-import-fields .indicator-import-wide { grid-column:1 / -1; }
.indicator-import-fields input:not([type="checkbox"]), .indicator-import-fields textarea, .indicator-import-fields select, .indicator-import-batches select { box-sizing:border-box; width:100%; min-width:0; border:1px solid #ced9df; border-radius:4px; background:#fff; color:#223d4a; padding:8px; font:inherit; font-size:12px; }
.indicator-import-fields textarea { min-height:66px; resize:vertical; line-height:1.7; }
.indicator-import-fields .indicator-core { flex-direction:row; align-items:center; }
.indicator-import-links { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; font-size:11px; }
.indicator-import-batches { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; font-size:12px; }
.indicator-import-batches select { width:auto; max-width:100%; }
@media (max-width:600px) {
  .indicator-import-dialog > header, .indicator-import-body, .indicator-import-dialog > footer { padding-left:14px; padding-right:14px; }
  .indicator-import-fields { grid-template-columns:minmax(0,1fr); }
  .indicator-import-dialog > footer { flex-wrap:wrap; }
  .indicator-import-dialog > footer > div { width:100%; justify-content:flex-end; }
  .indicator-import-body { max-height:calc(100dvh - 250px); }
}
.agent-template-kind-row, .agent-file-classification { display:flex; gap:8px; align-items:center; padding:5px 0; }
.agent-template-kind-row select, .agent-file-classification select { max-width:100%; min-width:0; font:inherit; font-size:11px; color:#c9d4d1; background:#15201f; border:1px solid #36524d; border-radius:4px; padding:4px; }
.agent-template-kind-row { font-size:11px; color:#c9d4d1; }
.agent-pool-file-list .agent-pool-file-row { min-height:76px; height:auto; }
.agent-pool-file-list .agent-file-classification { flex-wrap:wrap; gap:5px; }
.project-indicators-view { max-width:none; }
.project-indicators-view [hidden] { display:none !important; }
.project-indicators-view .section-toolbar { align-items:center; flex-wrap:wrap; gap:12px; padding-bottom:14px; border-bottom:1px solid #dde4e7; margin-bottom:0; }
.indicator-toolbar > div:first-child { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; }
.indicator-toolbar > div:first-child > strong { font-size:13px; color:#33434b; }
.indicator-version { font-size:11px; color:#64747d; background:#edf1f3; padding:4px 8px; border-radius:4px; }
.project-indicators-view .toolbar-actions { display:flex; flex-wrap:wrap; gap:8px; }
.indicator-overview { display:grid; grid-template-columns:minmax(150px,1.15fr) minmax(170px,1.4fr) minmax(100px,1fr) minmax(105px,1fr); gap:20px; align-items:start; padding:20px 0; }
.indicator-overview > div, .indicator-project-type { display:flex; flex-direction:column; gap:7px; min-width:0; }
.indicator-overview span { font-size:11px; color:#677781; }
.indicator-overview strong { font-size:20px; line-height:1.3; font-variant-numeric:tabular-nums; font-weight:650; color:#243640; }
.indicator-overview small { font-size:11px; font-weight:400; color:#78848a; }
.indicator-score-overview strong { color:#267765; }
.indicator-project-type select { width:100%; min-width:0; height:34px; padding:5px 9px; font:inherit; font-size:13px; border:1px solid #ced8dc; border-radius:4px; color:#263c46; background:#fff; }
.indicator-type-actions { display:flex; gap:8px; flex-wrap:wrap; padding:0 0 14px; }
.indicator-type-editor { border-top:1px solid #dce5e6; padding:14px 0 18px; display:grid; gap:12px; }
.indicator-type-editor-heading, .indicator-type-editor-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.indicator-type-editor-heading strong { font-size:13px; color:#283b42; }
.indicator-type-editor label { display:flex; flex-direction:column; gap:5px; font-size:11px; color:#596c73; min-width:0; }
.indicator-type-editor input { box-sizing:border-box; width:100%; max-width:300px; height:34px; border:1px solid #cad6d9; border-radius:4px; padding:5px 8px; color:#283b42; background:#fff; font:inherit; font-size:13px; }
.indicator-type-weight-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.indicator-type-editor-actions span { font-size:12px; color:#4c625c; font-variant-numeric:tabular-nums; }
.indicator-settings { border-top:1px solid #e1e7e9; border-bottom:1px solid #e1e7e9; margin-bottom:20px; }
.indicator-settings > summary { cursor:pointer; padding:11px 0; font-size:12px; color:#364f59; }
.indicator-settings > summary > span { margin-left:14px; font-size:11px; color:#829099; }
.indicator-scheme-fields, .indicator-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 16px; padding:4px 0 16px; }
.indicator-scheme-fields label, .indicator-fields label { display:flex; flex-direction:column; gap:5px; min-width:0; font-size:12px; color:#4f6470; }
.indicator-field-wide { grid-column:1 / -1; }
.indicator-scheme-fields input, .indicator-scheme-fields textarea, .indicator-fields input:not([type=checkbox]), .indicator-fields textarea { box-sizing:border-box; width:100%; min-width:0; padding:8px 10px; font:inherit; font-size:13px; line-height:1.6; border:1px solid #ccd8dd; border-radius:4px; background:#fff; color:#24343d; }
.indicator-fields textarea, .indicator-scheme-fields textarea { resize:vertical; min-height:74px; }
.project-indicators-view input:focus, .project-indicators-view textarea:focus, .project-indicators-view select:focus { outline:2px solid #a8d4c6; outline-offset:1px; }
.indicator-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-bottom:1px solid #cad7dc; gap:0; }
.indicator-tabs button { appearance:none; font:inherit; min-width:0; min-height:88px; display:grid; grid-template-columns:auto 1fr; align-content:center; gap:6px 10px; padding:12px 16px; color:#5b6d77; background:transparent; border:0; border-bottom:3px solid transparent; cursor:pointer; text-align:left; }
.indicator-tabs button > span { font-size:14px; font-weight:600; }
.indicator-tabs button > strong { text-align:right; font-size:15px; font-variant-numeric:tabular-nums; }
.indicator-tabs button > small { grid-column:1 / -1; font-size:11px; color:#7b8c93; }
.indicator-tabs button:hover { background:#f1f5f6; }
.indicator-tabs button[aria-selected=true] { color:#236d5c; border-bottom-color:#3b8a74; background:#edf5f1; }
.indicator-tabs button:focus-visible { outline:2px solid #3b8a74; outline-offset:-3px; }
.indicator-primary { padding:20px 0 0; }
.indicator-primary > header, .indicator-secondary > header { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.indicator-primary > header { padding:0 0 14px; }
.indicator-primary h3 { margin:0; font-size:15px; color:#314b57; }
.indicator-primary > header > span { font-size:11px; color:#7c8b92; }
.indicator-primary header > strong { margin-left:auto; font-size:13px; color:#405963; }
.indicator-secondary { padding:0 0 14px; }
.indicator-secondary h4 { margin:0; font-size:12px; font-weight:600; }
.indicator-secondary > header { padding:8px 10px; background:#edf1f4; color:#53636d; border-bottom:1px solid #e0e6e9; }
.indicator-secondary > header > span { margin-left:auto; font-size:12px; font-variant-numeric:tabular-nums; color:#637780; }
.indicator-secondary > header > button { font-size:11px; padding:4px 7px; background:transparent; }
.indicator-tertiary { border-bottom:1px solid #e2e8eb; }
.indicator-tertiary > summary { cursor:pointer; display:flex; align-items:center; gap:8px; min-height:48px; padding:10px; font-size:13px; line-height:1.5; list-style:none; }
.indicator-tertiary > summary::-webkit-details-marker { display:none; }
.indicator-tertiary > summary::before { content:""; width:6px; height:6px; flex:none; margin:0 5px 0 1px; border-right:1.5px solid #738791; border-bottom:1.5px solid #738791; transform:rotate(-45deg); }
.indicator-tertiary[open] > summary::before { transform:rotate(45deg); }
.indicator-tertiary > summary:hover { background:#f2f6f7; }
.indicator-tertiary[open] > summary { background:#f1f7f4; }
.indicator-row-name { min-width:0; flex:1; overflow-wrap:anywhere; color:#2c4551; }
.indicator-tertiary > summary > strong { flex:none; min-width:52px; text-align:right; font-size:12px; font-variant-numeric:tabular-nums; color:#267765; }
.indicator-row-status, .indicator-core-badge { flex:none; font-size:10px; white-space:nowrap; }
.indicator-row-status { color:#9c7b32; }
.indicator-core-badge { padding:2px 5px; border-radius:3px; background:#e4eef5; color:#54788a; }
.indicator-fields { padding:16px 14px; background:#f8fafb; border-top:1px solid #e3eeea; }
.indicator-editor-footer { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding-top:2px; }
.indicator-fields .indicator-core { flex-direction:row; align-items:center; font-size:12px; gap:6px; }
.indicator-editor-footer > div { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.indicator-editor-footer a { font-size:12px; }
.indicator-editor-footer .button { color:#975c55; font-size:11px; }
.indicator-history { margin-top:10px; padding:12px 0; border-top:1px solid #d6e0e5; font-size:12px; color:#667a84; }
.indicator-history > summary { cursor:pointer; color:#485f6b; }
.indicator-history > div { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid #e5e7eb; }
.indicator-history > div > span { min-width:0; overflow-wrap:anywhere; }
@media (max-width:700px) {
  .indicator-overview { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 16px; padding:16px 0; }
  .indicator-project-type { grid-column:1 / -1; }
  .indicator-type-weight-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .project-indicators-view .section-toolbar { align-items:flex-start; }
  .indicator-toolbar .toolbar-actions { width:100%; }
  .indicator-toolbar .toolbar-actions > button { flex:1; }
  .indicator-tabs button { grid-template-columns:minmax(0,1fr); min-height:94px; gap:4px; padding:9px 7px; }
  .indicator-tabs button > strong { text-align:left; font-size:14px; }
  .indicator-tabs button > span { font-size:13px; }
  .indicator-tabs button > small { font-size:10px; }
  .indicator-scheme-fields, .indicator-fields { grid-template-columns:minmax(0,1fr); }
  .indicator-settings > summary > span { display:block; margin:5px 0 0 16px; }
  .indicator-secondary > header { gap:6px 8px; padding:8px; }
  .indicator-tertiary > summary { padding:10px 5px; gap:5px; }
  .indicator-fields { padding:12px 9px; }
  .indicator-row-status { font-size:9px; }
  .agent-preset-row button { font-size:11px; padding:4px 6px; }
  .agent-file-classification { flex-wrap:wrap; }
  .indicator-history > div { flex-wrap:wrap; }
}
.auth-checking #app, .auth-active #app { display: none; }
.auth-checking { background: #142325; }
.auth-active { overflow: hidden; }
.auth-screen { position: fixed; inset: 0; z-index: 250; display: flex; background: #f7f9f8; }
.auth-screen.is-hidden, .token-prompt-dialog.is-hidden { display: none; }
.auth-visual { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; padding: clamp(28px, 4vw, 64px); overflow: hidden; color: #e7f1eb; background: #172725; }
.auth-visual::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 39px, rgba(163, 210, 190, .06) 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(163, 210, 190, .06) 40px); }
.auth-visual::after { content: ""; position: absolute; width: 34%; height: 1px; top: 0; left: -34%; background: #c5a46b; box-shadow: 0 0 35px #c5a46b; animation: auth-rule 8s linear infinite; }
@keyframes auth-rule { to { left: 100%; } }
.auth-visual-brand, .auth-visual-center, .auth-visual-bottom { position: relative; z-index: 1; }
.auth-visual-brand { display: flex; align-items: center; gap: 13px; font-weight: 750; font-size: 19px; }
.auth-brand-mark { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border: 1px solid #8bd1ae; border-radius: 4px; color: #162623; background: #8bd1ae; font-weight: 800; font-size: 23px; }
.auth-visual-brand small { display: block; margin-top: 2px; color: #90a99c; font-size: 9px; font-weight: 600; }
.auth-visual-center { width: min(100%, 670px); margin: auto; }
.auth-visual-heading > span { color: #dbb978; font-size: 11px; font-weight: 700; }
.auth-visual-heading strong { display: block; margin-top: 18px; font-size: clamp(32px, 3.4vw, 52px); line-height: 1.34; font-weight: 550; }
.auth-chart { margin-top: clamp(34px, 6vh, 72px); height: clamp(190px, 28vh, 290px); border-top: 1px solid rgba(169, 213, 189, .26); border-bottom: 1px solid rgba(169, 213, 189, .26); }
.auth-chart canvas { display: block; width: 100%; height: calc(100% - 34px); }
.auth-chart-axis { display: flex; justify-content: space-between; padding: 5px 9px 0; color: #aec7b8; font-size: 11px; }
.auth-visual-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; color: #b6cbc0; font-size: 11px; }
.auth-visual-footer span:first-child { color: #e0b778; font-weight: 700; }
.auth-visual-bottom { display: flex; gap: 10px; color: #d5b373; font-weight: 800; font-size: 12px; }
.auth-visual-bottom span { color: #99b1a4; font-weight: 400; }
.auth-panel { flex: 0 0 clamp(430px, 38%, 580px); display: grid; place-items: center; min-width: 0; overflow-y: auto; background: #f8faf9; }
.auth-panel-inner { width: min(100%, 420px); padding: 36px; }
.auth-mobile-brand { display: none; }
.auth-mobile-signal { display: none; }
.auth-form { display: grid; gap: 19px; }
.auth-form.is-hidden { display: none; }
.auth-heading { margin-bottom: 21px; }
.auth-eyebrow { color: #327362; font-size: 12px; font-weight: 700; }
.auth-form h1 { margin: 12px 0 8px; color: #1d2d29; font-size: 31px; font-weight: 650; }
.auth-form p { margin: 0; color: #687972; font-size: 14px; }
.auth-form label:not(.auth-remember), .token-account-form label { display: grid; gap: 8px; color: #384d45; font-size: 13px; font-weight: 600; }
.auth-form label:not(.auth-remember) input { width: 100%; height: 47px; border: 1px solid #cedbd4; border-radius: 5px; padding: 0 14px; outline: 0; color: #1c3028; background: #fff; font-size: 14px; font-weight: 400; transition: border-color .18s, box-shadow .18s; }
.auth-form label:not(.auth-remember) input:focus { border-color: #37886f; box-shadow: 0 0 0 3px rgba(55, 136, 111, .13); }
.auth-form input::placeholder { color: #9aa9a1; }
.auth-remember { display: inline-flex; align-items: center; width: max-content; gap: 8px; margin-top: -2px; color: #53665b; font-size: 13px; cursor: pointer; }
.auth-remember input { width: 16px; height: 16px; margin: 0; accent-color: #28775d; }
.auth-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 49px; border: 1px solid #226b55; border-radius: 5px; padding: 0 17px; color: #fff; background: #256e58; font-size: 15px; font-weight: 650; transition: background .2s, transform .2s; }
.auth-submit:hover { background: #185841; transform: translateY(-1px); }
.auth-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.auth-submit span { font-size: 21px; font-weight: 400; }
.auth-footer-link { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 2px; color: #83928a; font-size: 13px; }
.auth-switch { border: 0; padding: 3px; background: transparent; color: #196d52; cursor: pointer; font: inherit; font-weight: 650; }
.auth-switch:hover { text-decoration: underline; }
.auth-panel-bottom { margin-top: clamp(40px, 8vh, 90px); color: #a0ada6; text-align: center; font-size: 11px; }
#login-error, #register-error { min-height: 18px; color: #b3261e; font-size: 13px; }
.auth-status { min-height: 18px; color: #176b67; font-size: 13px; }
.auth-status:empty, #login-error:empty, #register-error:empty { display: none; }
.token-account-form input, .token-owner-list select { min-height: 38px; border: 1px solid #cdd7dd; border-radius: 5px; padding: 7px 10px; background: #fff; color: #21313b; }
.token-prompt-dialog { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: rgba(24, 33, 42, .58); padding: 20px; }
@media (max-width: 850px) {
  .auth-visual { padding: 30px; }
  .auth-panel { flex-basis: 420px; }
  .auth-visual-heading strong { font-size: 32px; }
}
@media (max-width: 700px) {
  .auth-screen { display: block; overflow-y: auto; background: #f8faf9; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100dvh; display: grid; place-items: center; }
  .auth-panel-inner { width: min(100%, 430px); padding: 28px 26px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; color: #213c31; font-size: 18px; }
  .auth-mobile-brand .auth-brand-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 20px; }
  .auth-mobile-signal { display: flex; align-items: center; justify-content: space-between; gap: 5px; height: 35px; margin-bottom: clamp(25px, 5vh, 42px); border-top: 1px solid #d7e5dc; border-bottom: 1px solid #d7e5dc; color: #56836c; font-size: 9px; font-weight: 600; }
  .auth-mobile-signal i { flex: 1; height: 2px; background: #8fbea2; transform-origin: left; animation: auth-signal 2.6s ease-in-out infinite alternate; }
  .auth-mobile-signal i:nth-of-type(2) { animation-delay: .4s; background: #d9b270; }
  .auth-mobile-signal i:nth-of-type(3) { animation-delay: .8s; }
}
@keyframes auth-signal { from { transform: scaleX(.5); opacity: .5; } to { transform: scaleX(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .auth-visual::after, .auth-mobile-signal i { animation: none; } .auth-submit { transition: none; } }
.token-board-view { color: #1e302d; }
.token-admin-badge { display:inline-block; margin-left:8px; padding:4px 9px; border:1px solid #c7dbd1; border-radius:6px; color:#38705b; background:#edf5f0; font-size:11px; font-weight:600; vertical-align:middle; white-space:nowrap; }
.token-tabs { display:flex; gap:4px; width:fit-content; padding:4px; border:1px solid #dce7e1; border-radius:9px; background:#eaf0ed; }
.token-main-tabs { margin-bottom:22px; }
.token-tabs button { border:0; border-radius:6px; background:transparent; padding:9px 18px; color:#61736a; font:inherit; font-size:13px; cursor:pointer; }
.token-tabs button[aria-selected="true"] { background:#fff; color:#24583f; box-shadow:0 1px 4px #1f493415; font-weight:700; }
.token-tabs b { display:inline-block; margin-left:7px; border-radius:10px; padding:1px 6px; background:#f6e2bd; color:#785222; font-size:11px; }
.token-admin-card { border:1px solid #dce7e1; padding:22px; border-radius:12px; background:#fff; margin-bottom:18px; }
.token-admin-card label, .token-account-form label { display:grid; gap:7px; color:#61736a; font-size:12px; }
.token-account-form input, .token-account-form select, .token-detail-toolbar select, .token-account-row select, .member-invite-form select { border:1px solid #d4e1d9; border-radius:6px; background:#fff; padding:9px 11px; color:#2e473b; max-width:100%; }
.token-account-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:10px; }
.token-account-row, .member-row { display:flex; align-items:center; gap:12px; padding:13px; border:1px solid #e4ece7; border-radius:8px; }
.token-account-row > div, .member-row > div { flex:1; min-width:0; }
.token-account-row strong, .member-row strong { display:block; overflow-wrap:anywhere; font-size:13px; }
.token-account-row small, .member-row small { display:block; color:#87958d; margin-top:3px; font-size:11px; }
.member-avatar { display:grid; place-items:center; width:32px; height:32px; flex:0 0 32px; background:#e8f1eb; color:#427759; border-radius:9px; font-size:13px; }
.token-account-ranking { max-height:210px; overflow:auto; }
.token-account-ranking > div { display:flex; justify-content:space-between; gap:15px; border-bottom:1px solid #edf2ef; padding:10px 0; font-size:13px; }
.token-account-ranking small { display:block; color:#8b9891; font-size:11px; margin-top:3px; }
.token-account-ranking b { color:#30684d; }
.token-project-totals { display:flex; flex-wrap:wrap; align-items:center; gap:12px 24px; padding:14px 0; font-size:12px; color:#788b7f; }
.token-project-totals b { color:#285c43; margin-left:7px; font-size:17px; }
.token-account-costs { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin:8px 0 20px; }
.token-account-costs > div { display:grid; gap:5px; border:1px solid #e4ece7; padding:12px 15px; border-radius:8px; background:#f7faf8; font-size:12px; }
.token-account-costs strong { color:#2d6248; font-size:18px; }
.token-account-costs small { color:#85978b; }
.token-detail-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin:18px 0; }
.token-detail-toolbar label { display:flex; align-items:center; gap:8px; }
.token-prompt-list { display:grid; gap:10px; }
.token-prompt-card { border:1px solid #dfe9e2; border-radius:9px; overflow:hidden; }
.token-prompt-card summary { display:flex; align-items:center; gap:18px; padding:16px; cursor:pointer; background:#f8faf9; font-size:12px; list-style:none; }
.token-prompt-card summary::before { content:"›"; color:#7b9887; font-size:20px; transition:transform .15s; }
.token-prompt-card[open] summary::before { transform:rotate(90deg); }
.token-prompt-card summary > div { flex:1; min-width:0; }
.token-prompt-card summary strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#2b4134; font-size:13px; }
.token-prompt-card summary small { display:block; margin-top:5px; color:#8a9a8e; }
.token-prompt-card summary > span, .token-prompt-card summary > b { flex-shrink:0; color:#476950; font-variant-numeric:tabular-nums; }
.token-prompt-body { padding:15px; }
.token-original-prompt { padding:12px 15px; background:#f5f8f6; border-radius:6px; margin-bottom:12px; }
.token-original-prompt pre { margin:0 0 8px; white-space:pre-wrap; overflow-wrap:anywhere; font:12px/1.7 inherit; color:#687c6d; }
.token-prompt-actors { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.token-prompt-actors span { padding:4px 9px; background:#edf4ef; color:#52765e; border-radius:5px; font-size:11px; }
.token-call-table { width:100%; min-width:690px; border-collapse:collapse; font-size:12px; text-align:left; }
.token-call-table td, .token-call-table th { padding:12px 10px; border-bottom:1px solid #e7eee9; }
.token-call-table th { font-weight:500; background:#f4f8f5; color:#77887d; }
.token-call-table small { display:block; font-size:10px; color:#8b998f; margin-top:5px; }
.token-cost-note { color:#87958b; font-size:11px; line-height:1.8; }
.project-collaboration-toolbar { display:flex; gap:8px; justify-content:flex-end; margin-bottom:12px; }
.project-members-content { overflow:auto; padding:20px; }
#project-members-dialog > div, #account-security-dialog > div { max-width:640px; }
.member-project-title { margin:0 0 8px; color:#2c4e3d; font-weight:700; }
.member-description { margin:8px 0 18px; font-size:12px; color:#859189; line-height:1.7; }
.member-list { display:grid; gap:8px; }
.member-role { background:#f1f4f2; color:#6a7c70; padding:5px 8px; border-radius:5px; font-size:11px; white-space:nowrap; }
.member-role.is-owner { background:#e6f2ea; color:#30714c; }
.member-invite-form { display:flex; gap:10px; align-items:end; margin-top:24px; }
.member-invite-form label { display:grid; gap:8px; flex:1; min-width:0; color:#6d8173; font-size:12px; }
.agent-prompt-cost { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:5px 10px; margin-top:10px; padding-top:8px; border-top:1px solid #c6d8cc70; color:inherit; opacity:.8; font-size:10px; }
.agent-project-usage { color:#859b8e !important; font-size:10px !important; margin-top:3px; }
.user-chip .avatar { border:0; cursor:pointer; }
@media (max-width:740px) {
  .token-admin-card { padding:14px; }
  .token-account-list { grid-template-columns:1fr; }
  .token-prompt-card summary { flex-wrap:wrap; gap:8px; padding:12px; }
  .token-prompt-card summary > div { flex-basis:calc(100% - 30px); }
  .token-detail-toolbar label { width:100%; }
  .token-account-row { flex-wrap:wrap; }
  .token-account-row select { width:100%; }
  .agent-panel-header { flex-wrap:wrap; gap:8px; }
  .agent-header-actions { flex-wrap:wrap; }
  .member-row { gap:8px; padding:10px; flex-wrap:wrap; }
}
.token-board-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 20px; }
.token-board-eyebrow { color: #598173; font-size: 10px; font-weight: 750; }
.token-board-heading h2 { margin: 5px 0 3px; font-size: 25px; font-weight: 700; }
.token-board-heading p, .token-section-title p { margin: 0; color: #75827d; font-size: 12px; }
.token-board-summary { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.token-board-summary > div { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 112px; border: 1px solid #dee8e1; border-radius: 6px; padding: 18px 20px; background: #fff; }
.token-board-summary > .token-summary-main { color: #e8f3ed; border-color: #235442; background: #235442; }
.token-board-summary span { color: #71847a; font-size: 12px; font-weight: 600; }
.token-board-summary strong { margin: 8px 0 5px; overflow-wrap: anywhere; color: #253a2e; font-size: 23px; font-weight: 750; line-height: 1.15; }
.token-board-summary small { color: #83938a; font-size: 10px; }
.token-summary-main span, .token-summary-main strong, .token-summary-main small { color: #e8f3ed; }
.token-summary-main strong { font-size: 29px; }
.token-summary-main small { color: #b9d9c9; }
.token-board-insights { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .85fr); gap: 10px; margin-bottom: 22px; }
.token-board-insights > .token-board-section { min-width: 0; border: 1px solid #dee8e1; border-radius: 6px; padding: 20px; background: #fff; }
.token-board-section { padding: 23px 0; border-top: 1px solid #dce6df; }
.token-section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 19px; }
.token-section-title h3 { margin: 0; color: #20382e; font-size: 16px; font-weight: 700; }
.token-section-title > span { flex: 0 0 auto; color: #87958d; font-size: 11px; }
.token-empty { margin: 0; padding: 18px 0; color: #84928b; font-size: 13px; }
.token-rank-list { display: grid; gap: 14px; }
.token-rank-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.token-rank-index { color: #879d8f; font-size: 11px; font-weight: 650; }
.token-rank-row > div { min-width: 0; }
.token-rank-row strong { display: block; overflow: hidden; color: #354940; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.token-rank-row b { color: #2b5c45; font-size: 12px; font-weight: 700; }
.token-rank-track, .token-coverage-track { height: 5px; overflow: hidden; border-radius: 3px; background: #eaf0eb; }
.token-rank-track { margin-top: 6px; }
.token-rank-track > span, .token-coverage-track > span { display: block; height: 100%; border-radius: inherit; background: #53a980; }
.token-rank-row:nth-child(even) .token-rank-track > span { background: #d7a25c; }
.token-coverage-value { display: flex; align-items: baseline; gap: 10px; margin: 3px 0 19px; }
.token-coverage-value strong { color: #247459; font-size: 36px; line-height: 1; }
.token-coverage-value span { color: #61766b; font-size: 12px; }
.token-coverage-track { height: 8px; }
.token-coverage-meta { display: flex; justify-content: space-between; gap: 15px; margin-top: 18px; }
.token-coverage-meta div { display: grid; gap: 2px; }
.token-coverage-meta strong { font-size: 16px; }
.token-coverage-meta span, .token-board-coverage p { color: #819087; font-size: 11px; }
.token-board-coverage p { margin: 16px 0 0; }
.token-board-section .project-table { min-width: 850px; }
.token-board-section .project-table th { color: #6e8176; background: #f4f8f5; }
.token-board-section .project-table td { vertical-align: middle; }
.token-board-section .project-table td strong { color: #283f32; }
.token-board-section .project-table td small { display: block; color: #8a9890; }
.token-user-line { display: flex; justify-content: space-between; gap: 12px; max-width: 220px; color: #65776d; font-size: 11px; }
.token-user-line b { color: #3a604b; font-weight: 600; }
.token-money { color: #257357 !important; }
.token-unpriced { display: inline-grid; place-items: center; min-width: 23px; height: 23px; border-radius: 4px; color: #936a25; background: #fff3dc; font-weight: 700; font-size: 11px; }
.token-board-detail { scroll-margin-top: 24px; }
.token-detail-header { align-items: center; }
.token-detail-header .token-board-eyebrow { display: block; margin-bottom: 5px; }
.token-account-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.token-owner-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; max-height: 350px; overflow-y: auto; }
.token-owner-list label { display: grid; gap: 5px; font-size: 12px; }
.token-pending-users { display: flex; flex-wrap: wrap; gap: 8px; }
.token-pending-users > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 230px; padding: 10px 12px; border: 1px solid #dce4e8; border-radius: 5px; background: #fff; }
.token-pending-users p { margin: 0; color: #66757e; }
.token-prompt-dialog > div { width: min(100%, 980px); max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 6px; overflow: hidden; }
.token-prompt-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #dce4e8; }
.token-prompt-dialog pre { margin: 0; padding: 18px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
@media (max-width: 1100px) {
  .token-board-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .token-board-insights { grid-template-columns: 1fr; }
  .token-board-section .project-table { min-width: 0; }
  .token-board-section .project-table tbody td:nth-child(7) { grid-column: 2; grid-row: 1 / span 4; display: flex; align-items: end; }
  .token-board-heading { align-items: center; }
  .token-board-summary > div { min-height: 98px; padding: 14px; }
  .token-board-summary strong { font-size: 19px; }
  .token-summary-main strong { font-size: 23px; }
}
@media (max-width: 500px) {
  .token-board-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .token-board-summary small { line-height: 1.4; }
  .token-board-section .project-table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  .token-section-title { flex-wrap: wrap; }
}
.indicator-register-heading { display:flex; align-items:center; gap:12px; margin:22px 0 12px; }
.indicator-register-heading strong { flex:1; font-size:16px; }
.indicator-table-navigation { display:none; gap:6px; }
.indicator-register-scroll { overflow:auto; border:1px solid #dfe5e6; border-radius:10px; background:#fff; }
.project-indicators-view .indicator-register-scroll { max-height:min(75vh, 780px); }
.indicator-register-table { width:100%; min-width:1480px; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.indicator-register-table th { padding:12px 8px; text-align:left; background:#f2f6f5; color:#315653; border-bottom:1px solid #d3dfdc; }
.project-indicators-view .indicator-register-table thead th { position:sticky; top:0; z-index:3; }
.indicator-register-table td { padding:8px; vertical-align:top; border:1px solid #e7eceb; }
.indicator-register-table th:nth-child(1),.indicator-register-table th:nth-child(2) { width:90px; }
.indicator-register-table th:nth-child(4),.indicator-register-table th:nth-child(8) { width:74px; }
.indicator-register-table th:nth-child(3) { width:190px; }
.indicator-register-table th:nth-child(6) { width:265px; }
.project-indicators-view .indicator-register-table [data-indicator-col="score_explanation"] { width:205px; position:sticky; right:0; background:#fff; z-index:2; }
.project-indicators-view .indicator-register-table [data-indicator-col="score"] { position:sticky; right:205px; background:#fff; z-index:2; box-shadow:-5px 0 8px -8px #415a56; }
.project-indicators-view .indicator-register-table th[data-indicator-col="score"],
.project-indicators-view .indicator-register-table th[data-indicator-col="score_explanation"] { background:#eaf3ef; z-index:4; }
.project-indicators-view .indicator-register-table tbody tr:hover [data-indicator-col="score"],
.project-indicators-view .indicator-register-table tbody tr:hover [data-indicator-col="score_explanation"] { background:#fbfdfc; }
.indicator-register-table textarea,.indicator-register-table input[type=number] { width:100%; box-sizing:border-box; border:1px solid transparent; border-radius:5px; background:transparent; padding:6px; font:inherit; line-height:1.65; color:#263c3a; }
.indicator-register-table textarea { min-height:94px; resize:vertical; }
.indicator-register-table textarea:focus,.indicator-register-table input:focus { outline:2px solid #8fc4b9; background:#fff; }
.indicator-register-table tbody tr:hover { background:#fbfdfc; }
.indicator-parent-cell { color:#43605c; font-weight:600; padding-top:16px!important; }
.indicator-cell-actions { display:flex; gap:6px; align-items:center; }
.indicator-cell-actions button { margin-left:auto; border:1px solid #dde5e2; border-radius:4px; cursor:pointer; background:#fff; }
.indicator-cell-actions button+button { margin-left:0; }
.indicator-row-options { margin-top:8px; font-size:11px; color:#667d77; }
.indicator-row-options label { display:block; margin-top:8px; }
@media (max-width:700px) {
  .indicator-register-heading { flex-wrap:wrap; }
  .indicator-register-heading strong { flex-basis:100%; }
  .indicator-table-navigation { display:flex; margin-right:auto; }
  .project-indicators-view .indicator-register-table td[data-indicator-col="score"],
  .project-indicators-view .indicator-register-table td[data-indicator-col="score_explanation"] { position:static; box-shadow:none; }
  .project-indicators-view .indicator-register-table th[data-indicator-col="score"],
  .project-indicators-view .indicator-register-table th[data-indicator-col="score_explanation"] { right:auto; }
  .project-indicators-view .indicator-register-table td[data-indicator-col="score_explanation"]::before { content:attr(data-indicator-name); display:block; color:#526b65; font-size:11px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
}
.indicator-print-frame { position:fixed; right:0; bottom:0; width:0; height:0; border:0; }
.indicator-discussion-proposal { margin: 16px 0; }
.indicator-discussion-proposal summary { cursor: pointer; font-weight: 600; }
.indicator-discussion-proposal td { padding: 9px; white-space: pre-wrap; line-height: 1.6; }
.indicator-discussion-sources a { display: block; margin: 8px 0; overflow-wrap: anywhere; }
.indicator-discussion-web { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; }
.indicator-discussion-web input { width: auto; }
#indicator-discussion-status { font-size: 13px; color: #82602c; min-height: 20px; }
.indicator-secondary-weights, .indicator-discussion-empty, #indicator-discussion-project { font-size: 13px; color: #65737a; line-height: 1.7; }
@media(max-width:600px) { #agent-indicator-search-dialog .modal-actions { flex-wrap: wrap; } }

/* Indicator proposals live in the Agent conversation. */
#agent-indicator-search-dialog { width: min(640px, calc(100vw - 32px)); max-width: none; }
#agent-indicator-search-prompt { min-height: 112px; }
.indicator-chat-message { min-width: 0; }
.indicator-chat-message.assistant .agent-message-copy { width: 100%; max-width: 100%; padding: 16px; border: 1px solid #354943; border-radius: 12px; background: #14201e; }
.indicator-chat-heading { display: flex; justify-content: space-between; gap: 12px; color: #e6cf8b; font-weight: 600; font-size: 12px; }
.indicator-chat-heading time { color: #8b9f98; font-weight: 400; font-size: 11px; }
.indicator-chat-text { white-space: pre-wrap; margin: 10px 0; }
.indicator-chat-weights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.indicator-chat-weights span { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 7px; background: #1c2c27; color: #a1b9ae; }
.indicator-chat-weights strong { font-size: 15px; margin-top: 2px; }
.indicator-chat-message .indicator-secondary-weights { color: #9aaca5; }
.indicator-chat-message .indicator-register-scroll { margin-top: 12px; max-height: 460px; overflow: auto; border-radius: 6px; background: #fff; color: #273d37; }
.indicator-chat-message .indicator-register-table { min-width: 1480px; }
.indicator-chat-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #2c3f38; }
.indicator-chat-synced { color: #88c7a6; font-size: 12px; }
.indicator-chat-progress { padding: 12px 16px; border-left: 2px solid #b59d5c; color: #beccbf; font-size: 12px; }
.indicator-discussion-composer:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; padding: 7px 10px; border-radius: 6px; background: #2d2c1d; color: #ddca8c; font-size: 11px; }
.indicator-discussion-composer label { display: inline-flex; align-items: center; gap: 5px; }
.indicator-discussion-composer input { width: auto; accent-color: #d1b864; }
.indicator-discussion-composer button { margin-left: auto; padding: 2px 0; border: 0; background: transparent; color: #b7bba4; font-size: 11px; cursor: pointer; }
@media(max-width:600px) { .indicator-chat-weights { grid-template-columns: repeat(2,minmax(0,1fr)); } .indicator-chat-message.assistant .agent-message-copy { padding: 12px; } }

.indicator-source-banner { display:flex; flex-wrap:wrap; gap:8px 18px; margin:12px 0; padding:14px 18px; background:#eef6f2; border:1px solid #d2e3da; border-radius:10px; color:#315448; }
.indicator-source-banner small { flex-basis:100%; color:#60766d; }
.indicator-onboarding-next { margin:4px 0 16px; }
.indicator-file-dialog { width:min(1120px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); overflow:auto; border:1px solid #d2e3da; outline:none; font:inherit; }
.indicator-file-dialog header,.indicator-file-dialog footer { display:flex; align-items:center; gap:12px; }
.indicator-file-dialog header { justify-content:space-between; }
.indicator-file-dialog footer { justify-content:flex-end; margin-top:18px; }
.indicator-file-dialog p { color:#61746b; line-height:1.7; }
.indicator-file-picker { display:block; position:relative; margin:18px 0 8px; padding:18px; text-align:center; color:#315448; background:#f4f8f6; border:1px dashed #96b4a6; border-radius:8px; cursor:pointer; }
.indicator-file-picker:focus-within { outline:2px solid #458268; outline-offset:2px; }
.indicator-file-picker input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.indicator-file-status { padding:12px 0; color:#986521; }
.indicator-file-dialog .indicator-register-scroll { max-height:48vh; overflow:auto; }
.indicator-file-dialog td { padding:9px; white-space:pre-wrap; }
