:root {
  --app-rail: var(--fx-layout-sidebar);
  --topbar-height: 4rem;
  --panel-border: #e6e9f0;
  --navy-950: #0b1220;
  --navy-900: #101827;
  --navy-800: #172237;
  --indigo-500: #5b63e8;
  --indigo-600: #4b53d5;
  --indigo-50: #f0f1ff;
  --canvas: #f5f7fb;
  --ink: #172033;
  --muted: #657086;
  --quiet: #929caf;
  --positive: #159766;
  --positive-soft: #e9f8f1;
  --warning: #bd7707;
  --warning-soft: #fff7e8;
  --critical: #c73b55;
  --critical-soft: #fff0f3;
  --surface: #fff;
  --rail-surface: var(--fx-color-sidebar);
  --rail-border: #e1e6ef;
  --rail-ink: #263247;
  --rail-muted: #69758a;
  --rail-subtle: #8c97aa;
  --rail-hover: #f0f3f8;
  --rail-selected: #eceefe;
  --radius: 12px;
  --shadow-popover: 0 18px 48px rgba(15, 23, 42, 0.16);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--fx-font-sans);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--fx-focus-ring);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 300;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transform: translateY(-150%);
  transition: transform var(--fx-motion-control) var(--fx-motion-easing);
}
.skip-link:focus { transform: translateY(0); }

body:not([data-auth-state="authenticated"]) .skip-link,
body:not([data-auth-state="authenticated"]) .app-shell,
body:not([data-auth-state="authenticated"]) .mobile-scrim,
body:not([data-auth-state="authenticated"]) .source-popover,
body:not([data-auth-state="authenticated"]) .app-dialog,
body:not([data-auth-state="authenticated"]) .toast-stack { display: none; }

.auth-gate {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 16%, rgba(91, 99, 232, .12), transparent 32%),
    radial-gradient(circle at 82% 86%, rgba(21, 151, 102, .08), transparent 28%),
    #f5f7fb;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: min(410px, 100%);
  padding: 34px;
  border: 1px solid #e1e5ed;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .14);
}
.auth-brand { display: grid; width: 72px; height: 72px; place-items: center; margin-bottom: 24px; border-radius: 18px; background: var(--indigo-50); }
.auth-brand img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 7px 16px rgba(41, 52, 79, .18)); }
.auth-heading .eyebrow { margin: 0 0 7px; color: var(--indigo-600); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.auth-heading h1 { margin: 0; color: var(--navy-900); font-size: 26px; font-weight: 680; letter-spacing: -.035em; line-height: 1.1; }
.auth-heading > p:last-child { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.auth-form { display: grid; gap: 14px; margin-top: 24px; }
.auth-form label { display: grid; gap: 6px; }
.auth-form label > span { color: #59667c; font-size: 11px; font-weight: 620; }
.auth-form input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dfe3eb; border-radius: 9px; outline: 0; background: #fff; color: var(--ink); }
.auth-form input:focus { border-color: #aeb3ff; box-shadow: var(--fx-focus-ring); }
.auth-error { min-height: 18px; margin: -2px 0 -4px; color: var(--critical); font-size: 11px; }
.auth-submit { width: 100%; min-height: 42px; font-size: 12px; }
.auth-hint { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #edf0f4; color: var(--quiet); font-size: 10px; text-align: center; }
body[data-auth-state="checking"] .auth-form { opacity: .56; pointer-events: none; }
body[data-auth-state="authenticating"] .auth-submit { cursor: wait; opacity: .68; }

.app-shell {
  display: grid;
  grid-template-columns: var(--app-rail) minmax(0, 1fr);
  min-height: 100vh;
}

.app-rail {
  position: relative;
  z-index: 40;
  display: flex;
  min-width: 0;
  height: 100vh;
  flex-direction: column;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--rail-border);
  overflow: hidden;
  background: var(--rail-surface);
  color: var(--rail-ink);
  box-shadow: 8px 0 28px rgba(28, 39, 61, .035);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  height: 50px;
  margin: 0 4px 24px;
  border-radius: 10px;
}
.brand img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(41, 52, 79, .14)); }
.brand-copy { display: grid; min-width: 0; line-height: 1.16; }
.brand-copy strong { color: #202b3d; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.brand-copy small { margin-top: 4px; color: var(--rail-subtle); font-size: 10px; letter-spacing: 0.015em; }

.primary-nav, .utility-nav { display: grid; gap: 4px; }
.primary-nav a, .utility-nav a {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  gap: 11px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--rail-muted);
  font-size: 13px;
  font-weight: 520;
  transition: color var(--fx-motion-instant) ease, background var(--fx-motion-control) ease, border-color var(--fx-motion-control) ease, transform var(--fx-motion-instant) ease;
}
.primary-nav a .ph, .utility-nav a .ph { font-size: 19px; }
.primary-nav a small, .utility-nav a small {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef1f6;
  color: #7b8699;
  font-size: 9px;
  font-weight: 620;
}
.primary-nav a:hover, .utility-nav a:hover { background: var(--rail-hover); color: var(--rail-ink); transform: translateX(1px); }
.primary-nav a[aria-current="page"], .utility-nav a[aria-current="page"] {
  border-color: rgba(91, 99, 232, .18);
  background: var(--rail-selected);
  color: #3940a7;
}
.primary-nav a[aria-current="page"]::before, .utility-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--indigo-500);
}
.primary-nav a[aria-current="page"] small, .utility-nav a[aria-current="page"] small { background: rgba(91, 99, 232, .10); color: #555cca; }
.rail-spacer { flex: 1; }
.utility-nav { margin-bottom: 8px; padding-top: 8px; border-top: 1px solid var(--rail-border); }
.utility-nav small[data-tone="running"] { background: var(--positive-soft); color: var(--positive); }
.utility-nav small[data-tone="blocked"], .utility-nav small[data-tone="failed"], .utility-nav small[data-tone="unavailable"] { background: var(--warning-soft); color: var(--warning); }

.rail-profile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  gap: 9px;
  padding: 9px 8px;
  border: 0;
  border-top: 1px solid var(--rail-border);
  background: transparent;
  color: #536076;
  text-align: left;
  cursor: pointer;
}
.rail-profile:hover { color: var(--rail-ink); }
.rail-profile > span:nth-child(2) { display: grid; min-width: 0; }
.rail-profile strong { overflow: hidden; font-size: 11px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.rail-profile small { color: var(--rail-subtle); font-size: 9px; }
.profile-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #d9deea;
  border-radius: 50%;
  background: #eef0ff;
  color: #4a51bd;
  font-size: 10px;
  font-weight: 680;
}

main { min-width: 0; height: 100vh; overflow: hidden; background: var(--canvas); }

.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(280px, 560px) auto;
  align-items: center;
  min-width: 0;
  height: var(--topbar-height);
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255,255,255,.96);
}
.topbar-title { display: grid; min-width: 0; line-height: 1.15; }
.topbar-title h1 { margin: 0; font-size: 17px; font-weight: 660; letter-spacing: -0.018em; }
.topbar-title span { margin-top: 4px; overflow: hidden; color: var(--quiet); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.global-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  height: 36px;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid #e1e5ed;
  border-radius: 9px;
  background: #f7f8fb;
  color: var(--quiet);
  transition: border-color var(--fx-motion-control) ease, background var(--fx-motion-control) ease, box-shadow var(--fx-motion-control) ease;
}
.global-search[hidden] { display: none; }
.global-search:focus-within { border-color: #aeb3ff; background: #fff; box-shadow: var(--fx-focus-ring); }
.global-search .ph { font-size: 16px; }
.global-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.global-search input::placeholder { color: #9aa3b4; }
.global-search kbd { padding: 2px 6px; border: 1px solid #dfe3eb; border-radius: 5px; background: #fff; color: #8c96a8; font-family: inherit; font-size: 9px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid #e1e5ed;
  border-radius: 9px;
  background: #fff;
  color: #697489;
  cursor: pointer;
  transition: color var(--fx-motion-instant) ease, border-color var(--fx-motion-instant) ease, background var(--fx-motion-instant) ease, transform var(--fx-motion-instant) ease;
}
.icon-button:hover { border-color: #cfd4df; background: #f7f8fb; color: var(--ink); }
.icon-button:active { transform: scale(.96); }
.icon-button .ph { font-size: 17px; }
.mobile-menu-trigger { display: none; }

.freshness-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #e1e5ed;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}
.freshness-trigger:hover { border-color: #cfd4df; color: var(--ink); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a3abba; box-shadow: 0 0 0 3px rgba(163,171,186,.12); }
.freshness-trigger[data-tone="positive"] .status-dot { background: var(--positive); box-shadow: 0 0 0 3px rgba(21,151,102,.12); }
.freshness-trigger[data-tone="warning"] .status-dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(189,119,7,.12); }
.freshness-trigger[data-tone="critical"] .status-dot { background: var(--critical); box-shadow: 0 0 0 3px rgba(199,59,85,.12); }

.view-root { height: calc(100vh - var(--topbar-height)); min-width: 0; overflow: auto; }
.initial-loader { display: flex; width: min(420px, calc(100% - 32px)); align-items: center; gap: 14px; margin: 20vh auto 0; padding: 18px; border: 1px solid var(--panel-border); border-radius: 14px; background: #fff; box-shadow: var(--fx-shadow-surface); }
.initial-loader img { animation: loader-pulse 1.7s ease-in-out infinite; }
.initial-loader div { display: grid; }
.initial-loader strong { font-size: 14px; }
.initial-loader small { margin-top: 4px; color: var(--muted); font-size: 11px; }
@keyframes loader-pulse { 50% { opacity: .58; transform: scale(.96); } }

.screen { min-height: 100%; animation: screen-in var(--fx-motion-route) var(--fx-motion-easing) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px 14px;
}
.workspace-head h2 { margin: 0; font-size: 24px; font-weight: 660; letter-spacing: -0.032em; line-height: 1.1; }
.workspace-head p { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.workspace-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.primary-button,
.secondary-button,
.quiet-button,
.text-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 580;
  cursor: pointer;
  transition: transform var(--fx-motion-instant) ease, background var(--fx-motion-control) ease, border-color var(--fx-motion-control) ease, color var(--fx-motion-control) ease;
}
.primary-button { border: 1px solid var(--indigo-500); background: var(--indigo-500); color: #fff; }
.primary-button:hover { border-color: var(--indigo-600); background: var(--indigo-600); }
.secondary-button { border: 1px solid #dfe3eb; background: #fff; color: #445067; }
.secondary-button:hover { border-color: #cbd1dd; background: #f8f9fb; color: var(--ink); }
.quiet-button { border: 1px solid transparent; background: transparent; color: var(--muted); }
.quiet-button:hover { background: #f1f3f7; color: var(--ink); }
.text-button { min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--indigo-600); }
.primary-button:active, .secondary-button:active, .quiet-button:active { transform: scale(.975); }
.primary-button:disabled, .secondary-button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.primary-button .ph, .secondary-button .ph, .quiet-button .ph { font-size: 15px; }

.pipeline-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) repeat(3, minmax(118px, .55fr)) auto;
  align-items: center;
  min-height: 66px;
  margin: 0 26px 14px;
  overflow: hidden;
  border: 1px solid #e2e6ee;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(15,23,42,.025);
}
.pipeline-stage { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 14px; }
.pipeline-stage-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--indigo-50); color: var(--indigo-600); }
.pipeline-stage-icon .ph { font-size: 17px; }
.pipeline-copy { display: grid; min-width: 0; }
.pipeline-copy strong { overflow: hidden; font-size: 11px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-copy span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-progress { grid-column: 1 / -1; height: 3px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #e9ebf2; }
.pipeline-progress span { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: var(--indigo-500); transition: width var(--fx-motion-chart) var(--fx-motion-easing); }
.pipeline-stat { display: grid; min-height: 42px; align-content: center; padding: 0 16px; border-left: 1px solid #edf0f4; }
.pipeline-stat strong { font-size: 15px; font-weight: 660; font-variant-numeric: tabular-nums; line-height: 1.05; }
.pipeline-stat span { margin-top: 4px; color: var(--quiet); font-size: 9px; }
.pipeline-stat.is-warning strong { color: var(--warning); }
.pipeline-details { margin-right: 10px; }

.partial-data-banner,
.bounded-slice-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 26px 10px;
  padding: 10px 12px;
  border: 1px solid #ead7aa;
  border-radius: 9px;
  background: #fffaf0;
  color: #6d5b35;
  font-size: 11px;
}
.bounded-slice-banner { border-color: #d9ddf2; background: #f7f8ff; color: #515b7a; }
.partial-data-banner > .ph, .bounded-slice-banner > .ph { flex: 0 0 auto; align-self: flex-start; margin-top: 2px; font-size: 16px; }
.partial-data-banner > div, .bounded-slice-banner > div { display: grid; min-width: 0; gap: 2px; }
.partial-data-banner strong, .bounded-slice-banner strong { font-size: 11px; }
.partial-data-banner p, .bounded-slice-banner p { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.partial-data-actions { display: flex !important; flex: 1 0 100%; flex-wrap: wrap; gap: 5px !important; }
.partial-data-actions button { min-height: 28px; padding: 0 8px; border: 1px solid #d9c590; border-radius: 7px; background: #fff; color: #67552f; font-size: 10px; cursor: pointer; }
.partial-data-actions button:disabled { opacity: .55; cursor: wait; }
.source-popover .partial-data-banner { margin: 0 0 10px; }

.list-tabs {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 4px;
  margin: 0 26px;
  overflow-x: auto;
  border-bottom: 1px solid var(--panel-border);
  scrollbar-width: none;
}
.list-tabs::-webkit-scrollbar { display: none; }
.list-tab {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.list-tab span { min-width: 20px; padding: 1px 5px; border-radius: 8px; background: #eef0f4; color: #788397; font-size: 9px; text-align: center; }
.list-tab[aria-selected="true"] { color: var(--indigo-600); font-weight: 620; }
.list-tab[aria-selected="true"]::after { content: ""; position: absolute; right: 8px; bottom: -1px; left: 8px; height: 2px; border-radius: 2px 2px 0 0; background: var(--indigo-500); }
.list-tab[aria-selected="true"] span { background: var(--indigo-50); color: var(--indigo-600); }

.filter-toolbar {
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 8px;
  padding: 8px 26px;
}
.filter-select,
.filter-input {
  display: inline-flex;
  min-width: 0;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #dfe3eb;
  border-radius: 8px;
  background: #fff;
  color: #536077;
  font-size: 10px;
}
.filter-select select, .filter-input input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.filter-select select { max-width: 130px; }
.filter-input { flex: 1; max-width: 250px; }
.filter-spacer { flex: 1; }
.filter-basis-note { max-width: 220px; color: var(--quiet); font-size: 9px; line-height: 1.35; }
.active-filter-count { display: inline-grid; min-width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--indigo-500); color: #fff; font-size: 9px; }

.selection-toolbar {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin: 0 26px 8px;
  padding: 5px 8px 5px 12px;
  border: 1px solid #cfd3ff;
  border-radius: 9px;
  background: var(--indigo-50);
  color: #3f469f;
  animation: toolbar-in var(--fx-motion-surface) var(--fx-motion-easing) both;
}
.selection-toolbar strong { margin-right: auto; font-size: 10px; }
@keyframes toolbar-in { from { opacity: 0; transform: translateY(-5px); } }

.table-card {
  margin: 0 26px 24px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(15,23,42,.025);
}
.table-scroll { min-width: 0; overflow: auto; }
.procurement-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.procurement-table col.check { width: 42px; }
.procurement-table col.title { width: 34%; }
.procurement-table col.buyer { width: 19%; }
.procurement-table col.region { width: 12%; }
.procurement-table col.amount { width: 13%; }
.procurement-table col.deadline { width: 12%; }
.procurement-table col.status { width: 130px; }
.procurement-table col.actions { width: 50px; }
.procurement-table th {
  height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid #e9ecf2;
  background: #fafbfc;
  color: #818b9d;
  font-size: 9px;
  font-weight: 610;
  letter-spacing: .025em;
  text-align: left;
  text-transform: uppercase;
}
.procurement-table td { height: 56px; padding: 7px 10px; border-bottom: 1px solid #edf0f4; color: #445067; font-size: 10px; vertical-align: middle; }
.procurement-table tbody tr { transition: background var(--fx-motion-control) ease, box-shadow var(--fx-motion-control) ease; }
.procurement-table tbody tr:hover { background: #fafbff; }
.procurement-table tbody tr[data-selected="true"] { background: #f3f4ff; box-shadow: inset 2px 0 0 var(--indigo-500); }
.procurement-table tbody tr:last-child td { border-bottom: 0; }
.row-title { display: grid; min-width: 0; gap: 3px; }
.row-title button { max-width: 100%; overflow: hidden; padding: 0; border: 0; background: transparent; color: #202a3c; font-size: 11px; font-weight: 610; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.row-title button:hover { color: var(--indigo-600); }
.row-title span, .table-muted { overflow: hidden; color: #8b95a7; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.amount-cell { color: #242d3d !important; font-weight: 630; font-variant-numeric: tabular-nums; }
.deadline-cell { font-variant-numeric: tabular-nums; }
.deadline-cell.is-soon { color: var(--warning); }
.status-chip, .scope-chip, .boundary-chip, .source-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  overflow: hidden;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-chip[data-tone="positive"] { background: var(--positive-soft); color: #12764f; }
.status-chip[data-tone="warning"] { background: var(--warning-soft); color: #99600a; }
.status-chip[data-tone="muted"] { background: #f0f2f5; color: #6f7b8e; }
.boundary-chip { border: 1px solid #dde0ff; background: #f5f5ff; color: #555cc1; }
.source-chip { background: #eef4ff; color: #4365bd; }

.check-control { position: relative; display: inline-grid; width: 17px; height: 17px; place-items: center; }
.check-control input { position: absolute; width: 17px; height: 17px; margin: 0; opacity: 0; cursor: pointer; }
.check-control span { display: grid; width: 15px; height: 15px; place-items: center; border: 1px solid #cbd1dd; border-radius: 4px; background: #fff; color: #fff; transition: background var(--fx-motion-control) ease, border-color var(--fx-motion-control) ease, transform var(--fx-motion-control) var(--fx-motion-easing); }
.check-control input:checked + span { border-color: var(--indigo-500); background: var(--indigo-500); transform: scale(1.04); }
.check-control span .ph { font-size: 10px; opacity: 0; }
.check-control input:checked + span .ph { opacity: 1; }
.check-control input:focus-visible + span { box-shadow: var(--fx-focus-ring); }

.table-action { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #8a94a5; cursor: pointer; }
.table-action:hover { background: #eef0f5; color: var(--ink); }

.pagination {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #edf0f4;
}
.pagination-copy { margin-right: auto; color: var(--quiet); font-size: 9px; }
.page-button { display: grid; min-width: 28px; height: 28px; place-items: center; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #687489; font-size: 10px; cursor: pointer; }
.page-button:hover:not(:disabled) { background: #f1f3f7; color: var(--ink); }
.page-button[aria-current="page"] { border-color: #cfd3ff; background: var(--indigo-50); color: var(--indigo-600); font-weight: 650; }
.page-button:disabled { opacity: .35; cursor: not-allowed; }
.page-size { height: 28px; padding: 0 7px; border: 1px solid #dfe3eb; border-radius: 7px; background: #fff; color: #687489; font-size: 9px; }

.state-panel { display: grid; place-items: center; min-height: 260px; padding: 38px; text-align: center; }
.state-panel .ph { margin-bottom: 12px; color: #9da6b6; font-size: 30px; }
.state-panel strong { font-size: 14px; }
.state-panel p { max-width: 460px; margin: 7px auto 0; color: var(--muted); font-size: 11px; }

.collector-screen {
  height: 100%;
  padding: 22px 26px 26px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 84% 4%, rgba(91,99,232,.075), transparent 30%),
    var(--canvas);
}
.collector-hero {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 230px;
  align-items: center;
  min-height: 150px;
  gap: 18px;
  padding: 21px 24px;
  overflow: hidden;
  border: 1px solid #dfe3ef;
  border-radius: 15px;
  background: linear-gradient(112deg, #fff 0%, #fbfbff 56%, #f0f1ff 100%);
  box-shadow: 0 12px 32px rgba(27,38,67,.055);
}
.collector-hero::after { content: ""; position: absolute; width: 230px; height: 230px; right: -80px; top: -135px; border: 1px solid rgba(91,99,232,.12); border-radius: 50%; }
.collector-orbit { position: relative; display: grid; width: 68px; height: 68px; place-items: center; border: 1px solid rgba(91,99,232,.18); border-radius: 50%; background: rgba(255,255,255,.72); color: var(--indigo-600); }
.collector-orbit::before, .collector-orbit::after { content: ""; position: absolute; inset: 7px; border: 1px dashed rgba(91,99,232,.25); border-radius: 50%; animation: collector-spin 12s linear infinite; }
.collector-orbit::after { inset: -7px; border-style: solid; border-color: transparent rgba(91,99,232,.17); animation-duration: 7s; animation-direction: reverse; }
.collector-orbit > span { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--indigo-500); box-shadow: 0 0 0 5px rgba(91,99,232,.1); animation: collector-breathe 1.8s ease-in-out infinite; }
.collector-orbit > span:first-child { top: 7px; right: 10px; }
.collector-orbit > span:nth-child(2) { bottom: 10px; left: 4px; animation-delay: -.8s; }
.collector-orbit .ph { font-size: 27px; }
.collector-screen:not([data-status="running"]) .collector-orbit::before,
.collector-screen:not([data-status="running"]) .collector-orbit::after,
.collector-screen:not([data-status="running"]) .collector-orbit > span { animation-play-state: paused; }
@keyframes collector-spin { to { transform: rotate(360deg); } }
@keyframes collector-breathe { 50% { opacity: .4; transform: scale(.72); } }
.collector-hero-copy { min-width: 0; }
.collector-status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.live-pill, .collector-env { display: inline-flex; min-height: 22px; align-items: center; gap: 6px; padding: 0 8px; border-radius: 99px; font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.live-pill[data-tone="positive"] { background: var(--positive-soft); color: var(--positive); }
.live-pill[data-tone="warning"] { background: var(--warning-soft); color: var(--warning); }
.live-pill[data-tone="critical"] { background: var(--critical-soft); color: var(--critical); }
.live-pill[data-tone="neutral"] { background: #eef0f4; color: var(--muted); }
.live-pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; }
.collector-screen[data-status="running"] .live-pulse { animation: live-pulse 1.5s ease-out infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 6px transparent; } }
.collector-env { border: 1px solid #dfe2ff; color: #656bd0; }
.collector-hero h2 { margin: 0; color: #161f31; font-size: 24px; font-weight: 680; letter-spacing: -.028em; }
.collector-hero-copy > p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.collector-policy-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.collector-policy-row span { display: inline-flex; min-height: 25px; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid #e4e7ef; border-radius: 7px; background: rgba(255,255,255,.78); color: #687489; font-size: 8px; }
.collector-policy-row .ph { color: var(--indigo-500); font-size: 12px; }
.collector-cycle-progress { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 14px; border: 1px solid rgba(212,216,239,.9); border-radius: 11px; background: rgba(255,255,255,.72); }
.collector-cycle-progress > div { display: grid; gap: 2px; }
.collector-cycle-progress span { color: var(--quiet); font-size: 8px; }
.collector-cycle-progress strong { font-size: 17px; font-weight: 670; font-variant-numeric: tabular-nums; }
.collector-progress-track { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 99px; background: #e6e8f1; }
.collector-progress-track span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7b82f1, #4d55d7); transition: width .5s var(--fx-motion-easing); }
.collector-alert { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; margin-top: 10px; padding: 11px 14px; border: 1px solid; border-radius: 10px; }
.collector-alert.is-warning { border-color: #f1d7a7; background: var(--warning-soft); color: #85550d; }
.collector-alert.is-critical { border-color: #f1c8d1; background: var(--critical-soft); color: #9a3146; }
.collector-alert > .ph { margin-top: 1px; font-size: 20px; }
.collector-alert div { display: grid; gap: 2px; }
.collector-alert strong { font-size: 10px; }
.collector-alert span { font-size: 9px; }
.collector-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.collector-metric { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--panel-border); border-radius: 10px; background: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.025); }
.collector-metric-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: var(--indigo-50); color: var(--indigo-600); }
.collector-metric-icon .ph { font-size: 16px; }
.collector-metric div { display: grid; min-width: 0; }
.collector-metric div > span { color: var(--muted); font-size: 8px; }
.collector-metric strong { margin-top: 1px; overflow: hidden; font-size: 17px; font-weight: 670; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.collector-metric small { overflow: hidden; color: var(--quiet); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.collector-grid { display: grid; grid-template-columns: minmax(350px, .8fr) minmax(480px, 1.2fr); gap: 10px; margin-top: 10px; }
.collector-lanes, .collector-feed { min-width: 0; padding: 15px; border: 1px solid var(--panel-border); border-radius: 12px; background: #fff; box-shadow: 0 3px 14px rgba(15,23,42,.025); }
.collector-section-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.collector-section-head .eyebrow { margin: 0 0 2px; color: var(--indigo-600); font-size: 7px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.collector-section-head h3 { margin: 0; font-size: 13px; font-weight: 660; }
.collector-section-head > span { color: var(--quiet); font-size: 8px; }
.collector-lane { display: grid; grid-template-columns: 38px minmax(120px, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e7e9f0; border-radius: 10px; background: #fbfcfd; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.collector-lane.is-active { border-color: #cfd3ff; background: linear-gradient(90deg, #f7f7ff, #fff); transform: translateX(2px); box-shadow: inset 2px 0 0 var(--indigo-500); }
.lane-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; background: #eef0ff; color: #555ccb; }
.lane-icon .ph { font-size: 17px; }
.lane-copy { display: grid; min-width: 0; }
.lane-copy > span { color: var(--indigo-600); font-size: 7px; font-weight: 720; letter-spacing: .08em; }
.lane-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.lane-copy small { color: var(--quiet); font-size: 8px; }
.lane-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 10px; }
.lane-stats span { display: grid; color: var(--quiet); font-size: 7px; text-align: right; }
.lane-stats strong { color: #303b50; font-size: 11px; font-variant-numeric: tabular-nums; }
.lane-connector { display: grid; grid-template-columns: 26px 1fr; align-items: center; min-height: 30px; gap: 10px; padding-inline: 16px; }
.lane-connector span { justify-self: center; width: 1px; height: 100%; background: #dfe2eb; }
.lane-connector small { color: var(--quiet); font-size: 7px; }
.collector-boundary { display: grid; grid-template-columns: 15px minmax(0,1fr); gap: 7px; margin: 12px 1px 0; color: var(--muted); font-size: 8px; }
.collector-boundary .ph { color: var(--indigo-500); font-size: 13px; }
.collector-feed { min-height: 290px; }
.collector-card-list { display: grid; max-height: 430px; gap: 7px; overflow-y: auto; padding-right: 3px; }
.collector-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 11px 12px; border: 1px solid #e7e9ef; border-radius: 9px; background: #fff; animation: collector-card-in .35s var(--fx-motion-easing) both; animation-delay: var(--delay); }
@keyframes collector-card-in { from { opacity: 0; transform: translateY(6px); } }
.collector-card:hover { border-color: #d3d7f6; background: #fcfcff; }
.collector-card-head { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; }
.collector-card-head time { color: var(--quiet); font-size: 7px; }
.collector-card-title { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.collector-card > p { grid-column: 1; margin: 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.collector-card > a { grid-row: 2 / 4; grid-column: 2; display: inline-flex; align-items: center; gap: 4px; color: var(--indigo-600); font-size: 8px; }
.collector-card-facts { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.collector-card-facts span { display: inline-flex; align-items: center; gap: 4px; color: #7c879a; font-size: 7px; }
.collector-card-facts .ph { color: #636bd1; font-size: 10px; }
.collector-empty { display: grid; min-height: 220px; place-items: center; align-content: center; padding: 24px; text-align: center; }
.collector-empty > .ph { margin-bottom: 8px; color: #a6adbd; font-size: 28px; }
.collector-empty strong { font-size: 11px; }
.collector-empty p { max-width: 300px; margin: 4px 0 0; color: var(--muted); font-size: 8px; }

.map-screen { display: flex; height: 100%; flex-direction: column; overflow: hidden; }
.map-screen .workspace-head { flex: 0 0 auto; padding-bottom: 10px; }
.map-screen .pipeline-bar { flex: 0 0 auto; margin-bottom: 10px; }
.map-filter-row { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 0 26px 10px; }
.map-filter-row .filter-input { max-width: none; }
.map-layout { display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(0, 1fr) 326px; margin: 0 26px 22px; overflow: hidden; border: 1px solid var(--panel-border); border-radius: 12px; background: #fff; box-shadow: 0 6px 22px rgba(15,23,42,.05); }
.map-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #e9edf2; }
.map-canvas { position: absolute; inset: 0; }
.map-canvas iframe { width: 100%; height: 100%; border: 0; filter: saturate(.82) contrast(.96); }
.map-toolbar { position: absolute; z-index: 3; top: 12px; left: 12px; display: flex; gap: 6px; }
.map-toolbar .secondary-button { min-height: 32px; background: rgba(255,255,255,.96); box-shadow: 0 4px 12px rgba(15,23,42,.08); }
.map-summary { position: absolute; z-index: 3; right: 12px; bottom: 12px; display: grid; min-width: 215px; gap: 3px; padding: 10px 12px; border: 1px solid rgba(220,225,234,.92); border-radius: 9px; background: rgba(255,255,255,.96); box-shadow: 0 6px 18px rgba(15,23,42,.1); }
.map-summary strong { font-size: 11px; }
.map-summary span { color: var(--muted); font-size: 9px; }
.map-mode-note { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: grid; max-width: 380px; gap: 2px; padding: 8px 10px; border: 1px solid rgba(220,225,234,.94); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.map-mode-note strong { font-size: 9px; }
.map-mode-note span { color: var(--muted); font-size: 8px; }

.organization-screen { height: 100%; overflow-y: auto; padding-bottom: 22px; }
.organization-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 24px 10px;
}
.organization-kpis article {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.organization-kpis span { color: var(--muted); font-size: 9px; }
.organization-kpis strong { overflow: hidden; font-size: 18px; font-weight: 660; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.organization-kpis small { color: var(--quiet); font-size: 8px; }
.organization-toolbar {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 8px;
  margin: 0 24px 10px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: #fff;
}
.organization-toolbar .quiet-button { margin-left: auto; }
.organization-table-card { margin-top: 0; }
.organization-table { min-width: 860px; table-layout: auto; }
.organization-table th:first-child { width: 32%; }
.organization-table td { height: 62px; }
.organization-detail { display: grid; gap: 16px; }
.detail-section { display: grid; gap: 8px; }
.detail-section h3 { margin: 0; color: #687489; font-size: 9px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.network-list { display: grid; gap: 6px; }
.network-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  background: #fafbfc;
}
.network-list article > div { display: grid; min-width: 0; gap: 2px; }
.network-list strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.network-list span { color: var(--quiet); font-size: 8px; }
.map-inspector { min-width: 0; overflow: auto; border-left: 1px solid var(--panel-border); background: #fff; }
.inspector-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 14px; border-bottom: 1px solid var(--panel-border); }
.inspector-head strong { font-size: 11px; }
.inspector-body { padding: 16px; }
.inspector-body h3 { margin: 12px 0 8px; font-size: 14px; line-height: 1.3; letter-spacing: -.015em; }
.inspector-body > p { margin: 0; color: var(--muted); font-size: 10px; }
.inspector-facts { display: grid; gap: 0; margin: 16px 0; border-top: 1px solid #edf0f4; }
.inspector-fact { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; padding: 9px 0; border-bottom: 1px solid #edf0f4; }
.inspector-fact span { color: var(--quiet); font-size: 9px; }
.inspector-fact strong { min-width: 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 560; }
.inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.map-equivalent { margin-top: 14px; }
.map-equivalent h4 { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 620; letter-spacing: .03em; text-transform: uppercase; }
.map-list { display: grid; gap: 4px; }
.map-list button { display: grid; width: 100%; gap: 3px; padding: 8px 9px; overflow: hidden; border: 1px solid transparent; border-radius: 8px; background: #f8f9fb; text-align: left; cursor: pointer; }
.map-list button:hover { border-color: #dfe3eb; background: #fff; }
.map-list button[aria-pressed="true"] { border-color: #cfd3ff; background: var(--indigo-50); }
.map-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.map-list span { color: var(--quiet); font-size: 12px; }
.map-list-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: #6d788b; font-size: 12px; }
.map-list-pagination button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #dfe3eb; border-radius: 7px; background: #fff; color: #59657a; cursor: pointer; }
.map-list-pagination button:disabled { opacity: .45; cursor: default; }

.assistant-screen { position: relative; display: flex; height: 100%; flex-direction: column; overflow: hidden; }
.assistant-screen > .partial-data-banner { flex: 0 0 auto; margin-top: 10px; }
.assistant-layout { display: grid; min-height: 0; flex: 1; grid-template-columns: 280px minmax(440px, 1fr) 340px; background: #fff; }
.project-rail { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border-right: 1px solid var(--panel-border); background: #f7f8fa; }
.project-rail-head { display: grid; gap: 8px; padding: 14px 12px 12px; border-bottom: 1px solid var(--panel-border); }
.new-chat-button { width: 100%; justify-content: flex-start; }
.project-scroll { min-height: 0; flex: 1; overflow-y: auto; padding: 12px 8px 18px; }
.project-section-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 7px 8px; color: #7c8799; font-size: 10px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.project-section-head button { width: 24px; height: 24px; border: 0; background: transparent; color: #7c8799; cursor: pointer; }
.project-group { margin-bottom: 8px; }
.project-row, .chat-row {
  display: grid;
  width: 100%;
  min-width: 0;
  align-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: #4d586c;
  text-align: left;
  cursor: pointer;
}
.project-row { grid-template-columns: 20px minmax(0, 1fr) 22px; min-height: 38px; gap: 7px; padding: 0 7px; border-radius: 8px; font-size: 12px; font-weight: 620; }
.chat-row { grid-template-columns: 16px minmax(0, 1fr); min-height: 34px; gap: 6px; margin-top: 1px; padding: 0 8px 0 29px; border-radius: 7px; color: #6a7588; font-size: 11px; }
.project-row:hover, .chat-row:hover { background: #eef0f4; color: var(--ink); }
.project-row[aria-expanded="true"] { color: #2f394c; }
.chat-row[aria-pressed="true"] { border-color: #d9dcff; background: #eceeff; color: #3f469f; }
.project-row span, .chat-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row .ph, .chat-row .ph { font-size: 14px; }
.project-boundary { margin: 8px 7px 0; padding: 10px; border: 1px solid #e3e6ec; border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; line-height: 1.5; }
.assistant-panel-mobile-head, .assistant-projects-trigger, .assistant-context-trigger, .assistant-panel-close, .assistant-panel-scrim { display: none; }

.chat-workspace { display: flex; min-width: 0; flex-direction: column; overflow: hidden; background: #fff; }
.chat-header { display: flex; min-height: 64px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--panel-border); }
.chat-title { display: grid; min-width: 0; gap: 3px; }
.chat-title strong { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.chat-title span { overflow: hidden; color: var(--quiet); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-actions { display: flex; align-items: center; gap: 6px; }
.assistant-report-trigger {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #cfd3ff;
  border-radius: 9px;
  background: #f5f5ff;
  color: #4951b4;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--fx-motion-control) ease, background var(--fx-motion-control) ease, color var(--fx-motion-control) ease, transform var(--fx-motion-instant) ease;
}
.assistant-report-trigger:hover { border-color: #abb0ff; background: #fff; color: #343da7; }
.assistant-report-trigger:active { transform: scale(.975); }
.assistant-report-trigger:disabled { border-color: #e2e5eb; background: #f7f8fa; color: #a2a9b6; cursor: not-allowed; transform: none; }
.assistant-report-trigger .ph { font-size: 16px; }
.chat-thread { min-height: 0; flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.chat-thread-inner { width: min(780px, calc(100% - 40px)); min-height: 100%; margin: 0 auto; padding: 30px 0 170px; }
.chat-empty { display: grid; min-height: 54vh; place-items: center; text-align: center; }
.chat-empty-content { width: min(680px, 100%); }
.agent-mark { display: grid; width: 42px; height: 42px; place-items: center; margin: 0 auto 13px; border: 1px solid #dfe2ff; border-radius: 13px; background: var(--indigo-50); color: var(--indigo-600); }
.agent-mark .ph { font-size: 21px; }
.chat-empty h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.025em; }
.chat-empty p { max-width: 500px; margin: 10px auto 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.assistant-experiment-chip { margin: 0 auto 9px; font-size: 12px; }
.dossier-anatomy { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; margin: 0 0 12px; text-align: left; }
.dossier-anatomy article { display: grid; min-width: 0; gap: 4px; padding: 10px; border: 1px solid #e0e4ed; border-radius: 10px; background: #fafbfe; }
.dossier-anatomy article > span { color: #7a83d8; font-family: var(--fx-font-mono); font-size: 12px; }
.dossier-anatomy strong { color: #354054; font-size: 12px; }
.dossier-anatomy small { color: #6f7a8e; font-size: 12px; line-height: 1.45; }
.chat-empty .assistant-phase-boundary { max-width: none; margin: 0 0 14px; padding: 10px 12px; border-left: 3px solid #d8a249; border-radius: 0 8px 8px 0; background: #fffaf0; color: #6f5b38; font-size: 12px; text-align: left; }
.starter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.starter-card { min-height: 76px; padding: 12px 13px; border: 1px solid #e1e5ec; border-radius: 11px; background: #fff; color: #4e5a6f; font-size: 12px; line-height: 1.5; text-align: left; cursor: pointer; transition: transform var(--fx-motion-control) var(--fx-motion-easing), border-color var(--fx-motion-control) ease, background var(--fx-motion-control) ease; }
.starter-card:hover { border-color: #cfd3ff; background: #fafaff; color: var(--ink); }
.starter-card:hover { transform: translateY(-1px); }
.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; margin-bottom: 28px; animation: none; }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } }
.message-avatar { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #e0e4eb; border-radius: 10px; background: #fff; color: #657086; font-size: 11px; font-weight: 650; }
.message[data-role="assistant"] .message-avatar { border-color: #dfe1ff; background: var(--indigo-50); color: var(--indigo-600); }
.message-avatar.is-live { box-shadow: 0 0 0 5px rgba(91,99,232,.07); }
.message-content { min-width: 0; padding-top: 3px; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 6px; }
.message-meta strong { font-size: 12px; }
.message-meta span { color: var(--quiet); font-size: 10px; }
.message-meta .boundary-chip { font-size: 12px; }
.message-meta .boundary-chip[data-readiness="needs_evidence"] { border-color: #ead7aa; background: #fffaf0; color: #7b6434; }
.message-meta .boundary-chip[data-readiness="ready_for_human"] { border-color: #c9dfd2; background: #f3faf6; color: #39714f; }
.message-meta .boundary-chip[data-readiness="out_of_scope"] { border-color: #dfe3eb; background: #f6f7f9; color: #667186; }
.message-content > p { margin: 0 0 8px; color: #374256; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.markdown-body { min-width: 0; color: #313d52; font-size: 13px; line-height: 1.72; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 1.35em 0 .55em; color: #202b3f; font-weight: 670; line-height: 1.3; letter-spacing: -.018em; }
.markdown-body h1 { font-size: 1.55em; }
.markdown-body h2 { font-size: 1.35em; }
.markdown-body h3 { font-size: 1.17em; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1em; }
.markdown-body p { margin: 0 0 .9em; }
.markdown-body ul, .markdown-body ol { margin: .45em 0 1em; padding-left: 1.45em; }
.markdown-body li { margin: .28em 0; padding-left: .15em; }
.markdown-body li::marker { color: #6f76cf; font-weight: 650; }
.markdown-body .markdown-task { display: flex; align-items: flex-start; gap: 8px; margin-left: -1.25em; list-style: none; }
.markdown-task input { width: 15px; height: 15px; flex: 0 0 auto; margin: .27em 0 0; accent-color: var(--indigo-500); }
.markdown-body blockquote { margin: 1em 0; padding: 10px 14px; border-left: 3px solid #9da5ff; border-radius: 0 9px 9px 0; background: #f6f7ff; color: #4e5872; }
.markdown-body blockquote .markdown-body { color: inherit; }
.markdown-body a { display: inline-flex; align-items: baseline; gap: 3px; color: #475bc3; text-decoration: underline; text-decoration-color: rgba(71,91,195,.35); text-underline-offset: 2px; }
.markdown-body a:hover { text-decoration-color: currentColor; }
.markdown-body a .ph { font-size: .85em; }
.markdown-body :not(pre) > code { padding: .12em .36em; border: 1px solid #e1e4ec; border-radius: 5px; background: #f4f5f8; color: #3c4760; font-family: var(--fx-font-mono); font-size: .88em; }
.markdown-body hr { height: 1px; margin: 1.4em 0; border: 0; background: #e4e7ed; }
.markdown-code { margin: 1em 0; overflow: hidden; border: 1px solid #252b3a; border-radius: 11px; background: #151923; color: #e8ecf5; }
.markdown-code-head { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 10px 0 13px; border-bottom: 1px solid #2b3243; background: #1b202c; color: #9fa9bb; font-family: var(--fx-font-mono); font-size: 10px; }
.code-copy-button { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: #bac4d7; font-size: 10px; cursor: pointer; }
.code-copy-button:hover { background: #272e3d; color: #fff; }
.markdown-code pre { max-height: 440px; margin: 0; padding: 14px 16px; overflow: auto; tab-size: 2; }
.markdown-code code { font-family: var(--fx-font-mono); font-size: 11px; line-height: 1.65; white-space: pre; }
.markdown-table-wrap { max-width: 100%; margin: 1em 0; overflow: auto; border: 1px solid #e0e4eb; border-radius: 10px; }
.markdown-table-wrap table { width: 100%; min-width: 440px; border-collapse: collapse; background: #fff; font-size: 11px; }
.markdown-table-wrap th, .markdown-table-wrap td { padding: 9px 11px; border-right: 1px solid #e7eaf0; border-bottom: 1px solid #e7eaf0; text-align: left; vertical-align: top; }
.markdown-table-wrap th { background: #f6f7fa; color: #59657a; font-size: 10px; font-weight: 680; }
.markdown-table-wrap tr:last-child td { border-bottom: 0; }
.markdown-table-wrap th:last-child, .markdown-table-wrap td:last-child { border-right: 0; }
.markdown-body.is-compact { font-size: 12px; line-height: 1.55; }
.markdown-body.is-compact h1, .markdown-body.is-compact h2, .markdown-body.is-compact h3 { font-size: 1.08em; }
.markdown-body.is-compact .markdown-code pre { max-height: 180px; padding: 9px; }
.live-draft { animation: message-in var(--fx-motion-surface) var(--fx-motion-easing) both; }
.live-draft-caret { width: 7px; height: 14px; border-radius: 2px; background: var(--indigo-500); animation: draft-caret 900ms steps(2, end) infinite; }
@keyframes draft-caret { 50% { opacity: .15; } }
.citation-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.citation-row a { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border: 1px solid #dbe3f2; border-radius: 7px; background: #f6f8fc; color: #4e68a8; font-size: 12px; }
.citation-row .source-chip, .evidence-rail .boundary-chip { min-height: 26px; font-size: 12px; }
.citation-more { padding: 5px 7px; border: 1px solid #dbe3f2; border-radius: 7px; background: #fff; color: #4e68a8; font-size: 12px; cursor: pointer; }
.run-activity { display: grid; gap: 12px; padding: 14px; border: 1px solid #e1e4ed; border-radius: 13px; background: linear-gradient(145deg, #fff, #fafbfe); box-shadow: 0 8px 24px rgba(28,39,61,.045); }
.run-activity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #e8eaf0; }
.run-activity-head > div { display: grid; gap: 2px; }
.run-activity-head strong { font-size: 12px; }
.run-activity-head > div > span { color: var(--quiet); font-size: 10px; }
.run-timeline { display: grid; }
.timeline-step { position: relative; display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 9px; min-height: 56px; padding: 4px 0 10px; }
.timeline-step:last-child { animation: timeline-step-in var(--fx-motion-control) var(--fx-motion-easing) both; }
@keyframes timeline-step-in { from { opacity: .25; transform: translateY(4px); } }
.timeline-marker { position: relative; z-index: 2; display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #cdd2ff; border-radius: 50%; background: #f1f2ff; color: #555dce; }
.timeline-marker .ph { font-size: 12px; }
.timeline-step[data-status="running"] .timeline-marker, .timeline-step[data-status="queued"] .timeline-marker { animation: timeline-pulse 1.8s ease-in-out infinite; }
@keyframes timeline-pulse { 50% { box-shadow: 0 0 0 6px rgba(91,99,232,.08); } }
.timeline-step[data-status="completed"] .timeline-marker { border-color: #b9e4ce; background: #edf9f3; color: var(--positive); }
.timeline-step[data-status="failed"] .timeline-marker { border-color: #f0c8d0; background: var(--critical-soft); color: var(--critical); }
.timeline-line { position: absolute; z-index: 1; top: 25px; bottom: -3px; left: 10px; width: 1px; background: #dfe2e9; }
.timeline-copy { display: grid; gap: 3px; padding-top: 1px; }
.timeline-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timeline-title strong { color: #354054; font-size: 11px; }
.timeline-title span, .timeline-copy small { color: var(--quiet); font-family: var(--fx-font-mono); font-size: 9px; }
.timeline-copy p { margin: 0; color: #6a7588; font-size: 10px; line-height: 1.48; }
.timeline-history { border: 1px solid #e7e9ef; border-radius: 8px; background: #fafbfc; }
.timeline-history summary { padding: 7px 9px; color: #687489; font-size: 10px; cursor: pointer; }
.timeline-history-list { display: grid; max-height: 140px; gap: 4px; padding: 0 9px 8px; overflow: auto; color: var(--quiet); font-size: 9px; }
.timeline-empty { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 8px; padding: 10px; color: var(--muted); font-size: 10px; }
.run-resume-card { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 11px; margin: -15px 0 28px 46px; padding: 12px; border: 1px solid #d9ddf1; border-radius: 11px; background: linear-gradient(135deg, #f8f8ff, #fff); }
.run-resume-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #eceeff; color: var(--indigo-600); }
.run-resume-card > div { display: grid; gap: 3px; }
.run-resume-card strong { color: #354054; font-size: 11px; }
.run-resume-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.run-reconnect-card { border-color: #efd1d7; background: linear-gradient(135deg, #fff8f9, #fff); }
.run-reconnect-card .run-resume-icon { background: var(--critical-soft); color: var(--critical); }
.artifact-list { display: grid; gap: 6px; margin-top: 10px; }
.artifact-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #dce2f0; border-radius: 9px; background: #f7f9fd; color: #435b94; text-decoration: none; transition: transform var(--fx-motion-control) var(--fx-motion-easing), border-color var(--fx-motion-control) ease, background var(--fx-motion-control) ease; }
.artifact-card:hover { border-color: #becaf0; background: #fff; transform: translateY(-1px); }
.artifact-card.is-pending { border-style: dashed; background: #fafaff; color: #656bb9; }
.artifact-card.is-pending:hover { transform: none; }
.artifact-card.is-pending .artifact-download { animation: artifact-breathe 1.5s ease-in-out infinite; }
.artifact-card.is-failed { border-color: #efd1d7; background: #fff8f9; color: #a34859; }
.artifact-card.is-failed:hover { border-color: #efd1d7; background: #fff8f9; transform: none; }
@keyframes artifact-breathe { 50% { opacity: .4; transform: scale(.88); } }
.artifact-kind { display: grid !important; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: #eef1fb; }
.artifact-kind.is-pdf { background: #fff0f2; color: #c44557; }
.artifact-kind.is-docx { background: #edf3ff; color: #3d69bd; }
.artifact-kind.is-xlsx { background: #edf9f2; color: #258358; }
.artifact-kind .ph { font-size: 17px; }
.artifact-card span { display: grid; min-width: 0; gap: 2px; }
.artifact-card strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.artifact-card small { color: var(--quiet); font-size: 12px; }
.artifact-card code { color: #6f798b; font-family: var(--fx-font-mono); font-size: 12px; overflow-wrap: anywhere; }
.artifact-provenance { display: flex !important; flex-wrap: wrap; gap: 3px 8px !important; padding-top: 3px; }
.artifact-provenance small { color: #65718a; overflow-wrap: anywhere; }
.artifact-download { color: #7885a2; font-size: 15px; }
.message-limitations { width: fit-content; max-width: 100%; margin-top: 9px; color: #777770; font-size: 10px; }
.message-limitations summary { padding: 4px 0; color: #777770; cursor: pointer; }
.message-limitations ul { margin: 4px 0 0; padding: 8px 12px 8px 26px; border: 1px solid #e4e4df; border-radius: 8px; background: #fafaf8; color: #666660; line-height: 1.55; }
.message-limitations li + li { margin-top: 3px; }

.composer-wrap { position: absolute; right: 340px; bottom: 0; left: 280px; z-index: 4; padding: 18px 24px 16px; background: #fff; box-shadow: 0 -12px 28px rgba(255,255,255,.96); }
.composer { width: min(780px, 100%); margin: 0 auto; padding: 8px; border: 1px solid #daddE7; border-radius: 14px; background: #fff; box-shadow: 0 9px 30px rgba(15,23,42,.08); transition: border-color var(--fx-motion-control) ease, box-shadow var(--fx-motion-control) ease; }
.composer:focus-within { border-color: #aeb3ff; box-shadow: 0 9px 30px rgba(15,23,42,.08), var(--fx-focus-ring); }
.composer textarea { display: block; width: 100%; min-height: 48px; max-height: 180px; resize: none; padding: 8px 9px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; line-height: 1.55; }
.composer textarea::placeholder { color: #9aa3b4; }
.composer-attachments { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 7px; }
.attachment-chip { display: inline-flex; max-width: 210px; align-items: center; gap: 5px; padding: 4px 6px; border: 1px solid #dfe2ff; border-radius: 6px; background: #f6f6ff; color: #5057b1; font-size: 8px; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { display: grid; width: 16px; height: 16px; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0; }
.composer-left { display: flex; min-width: 0; align-items: center; gap: 4px; }
.composer-file-boundary { overflow: hidden; color: var(--quiet); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.send-button { border-radius: 9px; }
.stop-button { display: inline-flex; min-height: 34px; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid #efc9bf; border-radius: 9px; background: #fff7f5; color: #a04432; font-size: 9px; font-weight: 650; cursor: pointer; }
.stop-button:hover { border-color: #dba99c; background: #fff; }
.composer-note { margin: 7px auto 0; color: #8e98aa; font-size: 9px; text-align: center; }

.evidence-rail { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border-left: 1px solid var(--panel-border); background: #fafbfc; }
.evidence-head { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--panel-border); background: rgba(255,255,255,.72); }
.evidence-head > div:first-child { display: grid; gap: 2px; }
.evidence-head strong { font-size: 12px; }
.evidence-head > div:first-child span { color: var(--quiet); font-size: 12px; }
.evidence-head-actions { display: flex; align-items: center; gap: 5px; }
.evidence-scroll { min-height: 0; overflow-y: auto; padding: 15px; scroll-behavior: smooth; }
.evidence-section { margin-bottom: 24px; }
.evidence-section h3 { margin: 0 0 9px; color: #737f94; font-size: 12px; font-weight: 670; letter-spacing: .04em; text-transform: uppercase; }
.evidence-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.evidence-section-title h3 { margin: 0; }
.evidence-answer-identity { margin: -3px 0 9px; color: #788397; font-family: var(--fx-font-mono); font-size: 10px; overflow-wrap: anywhere; }
.evidence-section-title button { display: inline-flex; min-height: 30px; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid #e0e4eb; border-radius: 7px; background: #fff; color: #5a667c; font-size: 12px; cursor: pointer; }
.evidence-section-title button:hover { border-color: #cdd2ff; color: #4b53b8; }
.evidence-card { margin-bottom: 7px; padding: 11px; border: 1px solid #e0e4eb; border-radius: 9px; background: #fff; }
.evidence-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.evidence-card strong { display: block; color: #354054; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.evidence-card > p { margin: 6px 0 0; color: var(--quiet); font-size: 12px; }
.evidence-card > small { display: block; margin-top: 7px; color: #737f94; font-size: 12px; }
.evidence-card button { border: 0; background: transparent; color: #8d96a6; cursor: pointer; }
.evidence-group { border: 1px solid #e0e4eb; border-radius: 9px; background: #f6f8fb; }
.evidence-group > summary { padding: 10px 11px; color: #4d5a70; font-size: 12px; font-weight: 650; cursor: pointer; }
.evidence-list { padding: 0 7px 7px; }
.evidence-source { display: grid; min-width: 0; gap: 2px; }
.evidence-source > span, .evidence-index { color: #737f94; font-size: 12px; overflow-wrap: anywhere; }
.evidence-claim { margin-top: 8px; }
.evidence-url { display: flex; align-items: flex-start; gap: 5px; margin-top: 8px; color: #455eb0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.evidence-url.is-missing { color: #7d8798; }
.evidence-meta { line-height: 1.45; }
.evidence-trace-refs { color: #68758b !important; font-family: var(--fx-font-mono); overflow-wrap: anywhere; }
.evidence-metadata { margin-top: 8px; border-top: 1px solid #e8ebf0; }
.evidence-metadata summary { padding-top: 8px; color: #59667b; font-size: 12px; font-weight: 620; cursor: pointer; }
.evidence-metadata pre { max-height: 180px; margin: 7px 0 0; padding: 8px; overflow: auto; border-radius: 7px; background: #f4f6f9; color: #48556b; font-family: var(--fx-font-mono); font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.instruction-card { padding: 11px; border: 1px solid #dfe2ee; border-radius: 10px; background: linear-gradient(145deg, #fff, #f8f8fe); }
.instruction-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.instruction-card > small { display: block; margin-top: 9px; padding-top: 8px; border-top: 1px solid #e6e8f0; color: #737f94; font-size: 12px; line-height: 1.5; }
.memory-list { display: grid; gap: 8px; }
.memory-card { position: relative; padding: 11px; overflow: hidden; border: 1px solid #dfe3eb; border-radius: 10px; background: #fff; box-shadow: 0 4px 14px rgba(25,36,57,.035); }
.memory-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: linear-gradient(#7f86ec, #b0b5ff); }
.memory-card-head { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; margin-bottom: 8px; }
.memory-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: #f0f1ff; color: var(--indigo-600); }
.memory-icon .ph { font-size: 15px; }
.memory-card-head > div { display: grid; min-width: 0; gap: 2px; }
.memory-card-head strong { overflow: hidden; color: #354054; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.memory-card-head small, .memory-card time { color: var(--quiet); font-size: 12px; }
.memory-card time { display: block; margin-top: 7px; }
.memory-evidence-count { margin: 8px 0 0; color: #69758b; font-size: 12px; line-height: 1.45; }
.memory-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.memory-tags span { padding: 3px 5px; border-radius: 5px; background: #f0f2f6; color: #727d90; font-size: 12px; }
.rail-loading { display: flex; align-items: center; gap: 7px; padding: 10px; color: var(--muted); font-size: 10px; }
.rail-loading .ph { animation: collector-spin 1s linear infinite; }
.rail-error { margin: 6px 0; padding: 8px; border: 1px solid #f1d5db; border-radius: 8px; background: var(--critical-soft); color: #a34859; font-size: 9px; line-height: 1.45; }
.tool-group { margin-bottom: 6px; border: 1px solid #e2e5eb; border-radius: 9px; background: #fff; }
.tool-group summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; color: #536076; font-size: 10px; font-weight: 630; cursor: pointer; text-transform: capitalize; }
.tool-group summary small { color: var(--quiet); font-size: 9px; }
.tool-list { display: grid; gap: 5px; padding: 0 7px 7px; }
.tool-card { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: start; gap: 8px; padding: 8px; border: 1px solid #e8eaf0; border-radius: 8px; background: #fafbfc; }
.tool-card[data-enabled="false"] { opacity: .55; filter: saturate(.65); }
.tool-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: #eef0ff; color: #575fca; }
.tool-icon .ph { font-size: 14px; }
.tool-card > div { display: grid; min-width: 0; gap: 3px; }
.tool-card strong { overflow: hidden; font-family: var(--fx-font-mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.tool-card p { display: -webkit-box; margin: 0; overflow: hidden; color: #778195; font-size: 9px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tool-card > div > span { color: #8c96a8; font-size: 8px; }
.tool-policy-list { display: grid; max-height: 210px; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; padding: 7px; overflow: auto; border: 1px solid #e1e4eb; border-radius: 9px; background: #f8f9fb; }
.tool-policy-list[data-mode="all"] { opacity: .72; }
.tool-policy-row { display: grid; grid-template-columns: 16px minmax(0,1fr); align-items: center; gap: 7px; padding: 7px; border: 1px solid #e5e7ed; border-radius: 7px; background: #fff; }
.tool-policy-row > span { display: grid; min-width: 0; gap: 2px; }
.tool-policy-row strong { overflow: hidden; font-family: var(--fx-font-mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.tool-policy-row small { color: var(--quiet); font-size: 8px; }
.form-hint { margin: -4px 0 0; color: #7c8799; font-size: 9px; line-height: 1.5; }
.fact-list { display: grid; gap: 0; border-top: 1px solid #e8ebf0; }
.fact-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid #e8ebf0; }
.fact-row span { color: var(--quiet); font-size: 12px; }
.fact-row strong { overflow-wrap: anywhere; font-size: 12px; font-weight: 570; }
.task-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 8px 0; color: #566277; font-size: 12px; }
.task-row .ph { margin-top: 2px; color: #6c7890; font-size: 14px; }
.task-row > span { display: grid; gap: 2px; }
.task-row strong { font-size: 12px; font-weight: 620; }
.task-row small { color: #737f94; font-size: 12px; }

.source-popover {
  position: fixed;
  z-index: 100;
  top: 58px;
  right: 18px;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100vh - 76px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #dfe3eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-popover);
  animation: popover-in var(--fx-motion-surface) var(--fx-motion-easing) both;
}
.source-popover[hidden] { display: none; }
@keyframes popover-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
.popover-heading, .dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.popover-heading h2, .dialog-heading h2 { margin: 2px 0 0; font-size: 15px; font-weight: 650; }
.eyebrow { margin: 0; color: #8791a4; font-size: 8px; font-weight: 640; letter-spacing: .06em; text-transform: uppercase; }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.source-grid div { padding: 9px; border: 1px solid #e6e9ef; border-radius: 8px; background: #fafbfc; }
.source-grid span { display: block; color: var(--quiet); font-size: 12px; }
.source-grid strong { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: 12px; font-weight: 620; }
.truth-callout { display: flex; gap: 7px; margin: 11px 0 0; padding: 9px; border: 1px solid #e1e4ff; border-radius: 8px; background: #f7f7ff; color: #5c629e; font-size: 12px; line-height: 1.45; }
.truth-callout .ph { flex: 0 0 auto; margin-top: 1px; font-size: 13px; }

.app-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 1px solid #dfe3eb; border-radius: 14px; background: #fff; box-shadow: var(--shadow-popover); }
.app-dialog::backdrop { background: rgba(11,18,32,.4); backdrop-filter: blur(2px); }
.app-dialog[open] { animation: dialog-in var(--fx-motion-surface) var(--fx-motion-easing) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dialog-shell { display: flex; max-height: calc(100vh - 32px); flex-direction: column; }
.dialog-heading { flex: 0 0 auto; padding: 16px 17px 13px; border-bottom: 1px solid var(--panel-border); }
.dialog-body { min-height: 0; overflow-y: auto; padding: 16px 17px; }
.dialog-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 8px; padding: 11px 17px; border-top: 1px solid var(--panel-border); background: #fafbfc; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: grid; gap: 5px; }
.form-field.is-wide { grid-column: 1 / -1; }
.form-field > span { color: #687489; font-size: 9px; font-weight: 590; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid #dfe3eb; border-radius: 8px; outline: 0; background: #fff; color: var(--ink); font-size: 10px; }
.form-field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #aeb3ff; box-shadow: var(--fx-focus-ring); }
.assistant-report-form { gap: 14px; }
.assistant-report-form textarea { min-height: 132px; font-size: 12px; line-height: 1.55; }
.report-source-card { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid #d9ddf7; border-radius: 10px; background: linear-gradient(135deg, #f7f7ff, #fff); }
.report-source-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; background: #e9ebff; color: #4b53bd; }
.report-source-icon .ph { font-size: 18px; }
.report-source-card > div { display: grid; min-width: 0; gap: 3px; }
.report-source-card strong { color: #354054; font-size: 12px; }
.report-source-card span, .report-source-card code { overflow-wrap: anywhere; }
.report-source-card > div > span { color: #69758a; font-size: 10px; line-height: 1.45; }
.report-source-card code { color: #7b8495; font-family: var(--fx-font-mono); font-size: 9px; }
.decision-brief-guide { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid #e0e4ed; border-radius: 9px; background: #fafbfe; }
.decision-brief-guide > div { display: grid; gap: 3px; }
.decision-brief-guide strong { color: #3f4a60; font-size: 12px; }
.decision-brief-guide p { margin: 0; color: #6f7a8e; font-size: 12px; line-height: 1.45; }
.decision-brief-button { flex: 0 0 auto; min-height: 32px; padding: 0 10px; border: 1px solid #ccd1ff; border-radius: 8px; background: #f4f5ff; color: #4e56b7; font-size: 12px; font-weight: 620; cursor: pointer; }
.decision-brief-button:hover { border-color: #aeb4f1; background: #fff; }
.memory-evidence-picker { border: 1px solid #e0e4eb; border-radius: 8px; background: #fafbfc; }
.memory-evidence-picker > summary { padding: 9px; color: #536076; font-size: 12px; font-weight: 620; cursor: pointer; }
.memory-evidence-picker > div { display: grid; max-height: 220px; gap: 5px; padding: 0 8px 8px; overflow: auto; }
.memory-evidence-option { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: start; gap: 7px; padding: 8px; border: 1px solid #e5e7ed; border-radius: 7px; background: #fff; }
.memory-evidence-option input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--indigo-500); }
.memory-evidence-option > span { display: grid; min-width: 0; gap: 2px; }
.memory-evidence-option strong { color: #455168; font-size: 12px; overflow-wrap: anywhere; }
.memory-evidence-option small { display: -webkit-box; overflow: hidden; color: #717d91; font-size: 12px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compare-card { padding: 11px; border: 1px solid #e1e5ec; border-radius: 9px; }
.compare-card h3 { margin: 0 0 9px; font-size: 11px; }

.toast-stack { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; width: min(330px, calc(100vw - 28px)); gap: 8px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; padding: 10px 12px; border: 1px solid #dfe3eb; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.14); color: #4f5a6d; font-size: 9px; animation: toast-in var(--fx-motion-surface) var(--fx-motion-easing) both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } }
.toast .ph { color: var(--positive); font-size: 15px; }

.mobile-scrim { display: none; }

@media (max-width: 1180px) {
  :root { --app-rail: 78px; }
  .app-rail { padding-inline: 9px; }
  .brand { justify-content: center; margin-inline: 0; }
  .brand-copy, .primary-nav a span, .primary-nav a small, .utility-nav a span, .utility-nav a small, .rail-profile > span:nth-child(2), .rail-profile > .ph { display: none; }
  .primary-nav a, .utility-nav a { display: grid; grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .primary-nav a[aria-current="page"]::before, .utility-nav a[aria-current="page"]::before { left: -9px; }
  .rail-profile { grid-template-columns: 1fr; justify-items: center; }
  .assistant-layout { grid-template-columns: 244px minmax(380px, 1fr) 300px; }
  .composer-wrap { right: 300px; left: 244px; }
  .pipeline-bar { grid-template-columns: minmax(210px, 1fr) repeat(2, minmax(100px, .5fr)) auto; }
  .pipeline-stat:nth-of-type(4) { display: none; }
  .collector-grid { grid-template-columns: minmax(330px, .9fr) minmax(410px, 1.1fr); }
  .collector-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 940px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 0 14px; }
  .mobile-menu-trigger { display: inline-grid; }
  .topbar-title { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .app-rail { position: fixed; inset: 0 auto 0 0; width: 250px; padding: 18px 12px 14px; transform: translateX(-102%); box-shadow: 16px 0 44px rgba(0,0,0,.2); transition: transform var(--fx-motion-route) var(--fx-motion-easing); }
  body[data-menu-open="true"] .app-rail { transform: translateX(0); }
  .brand { justify-content: flex-start; margin-inline: 4px; }
  .brand-copy, .primary-nav a span, .primary-nav a small, .utility-nav a span, .utility-nav a small, .rail-profile > span:nth-child(2), .rail-profile > .ph { display: grid; }
  .primary-nav a, .utility-nav a { grid-template-columns: 22px minmax(0, 1fr) auto; justify-items: initial; padding: 0 12px; }
  .rail-profile { grid-template-columns: 34px minmax(0,1fr) 18px; justify-items: initial; }
  .mobile-scrim { position: fixed; z-index: 35; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: rgba(11,18,32,.38); }
  .mobile-scrim[hidden] { display: none; }
  .workspace-head { padding-inline: 16px; }
  .pipeline-bar { margin-inline: 16px; grid-template-columns: minmax(200px, 1fr) repeat(2, minmax(90px, .5fr)) auto; }
  .list-tabs { margin-inline: 16px; }
  .filter-toolbar { padding-inline: 16px; overflow-x: auto; }
  .selection-toolbar, .table-card { margin-inline: 16px; }
  .organization-kpis, .organization-toolbar { margin-inline: 16px; }
  .map-filter-row { padding-inline: 16px; }
  .map-layout { grid-template-columns: minmax(0, 1fr) 286px; margin-inline: 16px; }
  .assistant-layout { grid-template-columns: minmax(0,1fr); }
  .assistant-projects-trigger, .assistant-context-trigger { display: inline-grid; }
  .assistant-panel-close { display: inline-grid; }
  .assistant-panel-mobile-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
  .project-rail, .evidence-rail {
    position: fixed;
    z-index: 86;
    top: var(--topbar-height);
    bottom: 0;
    display: flex;
    width: min(340px, calc(100vw - 40px));
    box-shadow: 0 18px 54px rgba(15,23,42,.2);
    transition: transform var(--fx-motion-route) var(--fx-motion-easing), visibility var(--fx-motion-route) step-end;
    visibility: hidden;
  }
  .project-rail { left: 0; transform: translateX(-104%); }
  .evidence-rail { right: 0; border-left: 1px solid var(--panel-border); transform: translateX(104%); }
  body[data-assistant-panel="projects"] .project-rail { transform: translateX(0); visibility: visible; transition: transform var(--fx-motion-route) var(--fx-motion-easing), visibility 0s; }
  body[data-assistant-panel="context"] .evidence-rail { transform: translateX(0); visibility: visible; transition: transform var(--fx-motion-route) var(--fx-motion-easing), visibility 0s; }
  .assistant-panel-scrim { position: fixed; z-index: 85; inset: var(--topbar-height) 0 0; width: 100%; height: auto; border: 0; background: rgba(12,18,30,.28); backdrop-filter: blur(1px); }
  body[data-assistant-panel="projects"] .assistant-panel-scrim, body[data-assistant-panel="context"] .assistant-panel-scrim { display: block; }
  .composer-wrap { right: 0; left: 0; }
  .collector-screen { padding-inline: 16px; }
  .collector-hero { grid-template-columns: 64px minmax(0,1fr); }
  .collector-cycle-progress { grid-column: 1 / -1; }
  .collector-grid { grid-template-columns: 1fr; }
  .collector-card-list { max-height: none; }
}

@media (max-width: 700px) {
  body { overflow: auto; }
  main { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { position: sticky; top: 0; height: 56px; }
  .global-search kbd { display: none; }
  .global-search { height: 34px; }
  .freshness-trigger { width: auto; max-width: 148px; min-height: 34px; justify-content: center; padding: 0 8px; }
  .freshness-trigger #source-trigger-text { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .view-root { height: auto; min-height: calc(100vh - 56px); overflow: visible; }
  .workspace-head { display: grid; padding: 18px 14px 10px; }
  .workspace-head h2 { font-size: 21px; }
  .workspace-actions { justify-content: flex-start; }
  .pipeline-bar { grid-template-columns: 1fr auto; margin: 0 14px 10px; }
  .partial-data-banner, .bounded-slice-banner { margin: 0 14px 10px; }
  .pipeline-stat { display: none; }
  .pipeline-details { margin-right: 7px; }
  .list-tabs { margin: 0 14px; }
  .filter-toolbar { padding: 8px 14px; }
  .filter-basis-note { flex: 0 0 210px; }
  .filter-select { flex: 0 0 auto; }
  .filter-input { min-width: 200px; }
  .selection-toolbar { margin: 0 14px 8px; overflow-x: auto; }
  .selection-toolbar strong { flex: 0 0 auto; }
  .table-card { margin: 0 14px 18px; }
  .organization-kpis { grid-template-columns: 1fr; margin-inline: 14px; }
  .organization-toolbar { margin-inline: 14px; overflow-x: auto; }
  .organization-toolbar .quiet-button { flex: 0 0 auto; margin-left: 0; }
  .organization-table { min-width: 860px; }
  .table-scroll { overflow: visible; }
  .organization-table-card .table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
  .procurement-table:not(.organization-table) { display: block; min-width: 0; }
  .procurement-table:not(.organization-table) colgroup, .procurement-table:not(.organization-table) thead { display: none; }
  .procurement-table:not(.organization-table) tbody { display: grid; gap: 10px; padding: 10px; }
  .procurement-table:not(.organization-table) tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, .45fr);
    gap: 0 14px;
    padding: 12px 12px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: #fff;
  }
  .procurement-table:not(.organization-table) tbody tr[data-selected="true"] { border-color: #bec2ff; box-shadow: inset 3px 0 0 var(--indigo-500); }
  .procurement-table:not(.organization-table) td {
    display: grid;
    min-width: 0;
    height: auto;
    min-height: 44px;
    align-content: start;
    gap: 5px;
    padding: 8px 0;
    border-bottom: 1px solid #edf0f4;
    font-size: 12px;
  }
  .procurement-table:not(.organization-table) td::before { content: attr(data-label); color: #7a8497; font-size: 10px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; }
  .procurement-table:not(.organization-table) .mobile-title-cell { grid-column: 1 / -1; padding-top: 4px; padding-right: 34px; }
  .procurement-table:not(.organization-table) .mobile-title-cell .row-title button { overflow: visible; font-size: 14px; line-height: 1.35; white-space: normal; }
  .procurement-table:not(.organization-table) .mobile-title-cell .row-title span { font-size: 11px; }
  .procurement-table:not(.organization-table) .mobile-select-cell { position: absolute; z-index: 1; top: 10px; right: 10px; display: block; min-height: 0; padding: 0; border: 0; }
  .procurement-table:not(.organization-table) .mobile-select-cell::before { display: none; }
  .procurement-table:not(.organization-table) .mobile-action-cell { align-content: center; justify-items: end; }
  .procurement-table:not(.organization-table) tbody tr:last-child td { border-bottom: 1px solid #edf0f4; }
  .procurement-table:not(.organization-table) tbody tr td:last-child { border-bottom: 0; }
  .procurement-table:not(.organization-table) .row-title span, .procurement-table:not(.organization-table) .table-muted { overflow: visible; font-size: 11px; line-height: 1.35; white-space: normal; }
  .procurement-table:not(.organization-table) .status-chip { width: fit-content; font-size: 11px; }
  .pagination { min-width: 0; flex-wrap: wrap; }
  .pagination-copy { flex: 1 0 100%; }
  .map-screen { height: auto; min-height: calc(100vh - 56px); overflow: visible; }
  .map-filter-row { padding: 0 14px 10px; overflow-x: auto; }
  .map-layout { grid-template-columns: 1fr; margin: 0 14px 18px; overflow: visible; }
  .map-stage { min-height: 58vh; }
  .map-inspector { border-top: 1px solid var(--panel-border); border-left: 0; }
  .assistant-screen { height: calc(100vh - 56px); }
  .assistant-layout { grid-template-columns: 1fr; }
  .composer-wrap { right: 0; bottom: 0; left: 0; padding-inline: 12px; }
  .chat-thread-inner { width: calc(100% - 24px); }
  .dossier-anatomy { grid-template-columns: 1fr 1fr; }
  .starter-grid { grid-template-columns: 1fr; }
  .chat-header { min-height: 58px; gap: 8px; padding-inline: 10px; }
  .chat-title span { display: none; }
  .chat-header-actions { gap: 2px; }
  .chat-header-actions .boundary-chip { display: none; }
  .assistant-report-trigger { width: 34px; padding: 0; justify-content: center; }
  .assistant-report-trigger > span { display: none; }
  .assistant-screen { min-height: calc(100dvh - 56px); height: calc(100dvh - 56px); }
  .project-rail, .evidence-rail { top: 56px; width: min(360px, calc(100vw - 24px)); }
  .assistant-panel-scrim { inset: 56px 0 0; }
  .evidence-scroll { padding-bottom: 24px; }
  .composer { border-radius: 12px; }
  .composer-file-boundary { display: none; }
  .markdown-body { font-size: 12px; }
  .markdown-code { border-radius: 8px; }
  .run-resume-card { grid-template-columns: 34px minmax(0,1fr); margin-left: 0; }
  .run-resume-card .primary-button { grid-column: 1 / -1; justify-content: center; }
  .tool-policy-list { grid-template-columns: 1fr; }
  .source-popover { top: 52px; right: 8px; }
  .form-grid, .compare-grid { grid-template-columns: 1fr; }
  .decision-brief-guide { align-items: stretch; flex-direction: column; }
  .collector-screen { min-height: calc(100vh - 56px); padding: 14px; overflow: visible; }
  .collector-hero { grid-template-columns: 48px minmax(0,1fr); gap: 12px; min-height: 0; padding: 16px; }
  .collector-orbit { width: 46px; height: 46px; }
  .collector-orbit .ph { font-size: 20px; }
  .collector-hero h2 { font-size: 19px; }
  .collector-policy-row { gap: 5px; }
  .collector-policy-row span { padding-inline: 6px; }
  .collector-cycle-progress { padding: 11px; }
  .collector-metrics { grid-template-columns: 1fr 1fr; gap: 7px; }
  .collector-metric { grid-template-columns: 28px minmax(0,1fr); gap: 7px; padding: 10px; }
  .collector-metric-icon { width: 28px; height: 28px; }
  .collector-metric strong { font-size: 14px; }
  .collector-lanes, .collector-feed { padding: 12px; }
  .collector-lane { grid-template-columns: 34px minmax(0,1fr); }
  .lane-stats { grid-column: 1 / -1; justify-content: space-between; }
  .collector-card { grid-template-columns: 1fr; }
  .collector-card > a { grid-row: auto; grid-column: 1; }
}

/* Codex-inspired assistant workspace: quiet chrome, one project rail, one focused canvas. */
body[data-current-view="assistant"] {
  --app-rail: 60px;
  --topbar-height: 48px;
  --assistant-project-rail: 236px;
}
body[data-current-view="assistant"] .app-rail {
  padding: 10px 8px 12px;
  border-right-color: #e5e5e2;
  background: #f3f3f1;
  box-shadow: none;
}
body[data-current-view="assistant"] .brand {
  justify-content: center;
  height: 42px;
  margin: 0 0 14px;
}
body[data-current-view="assistant"] .brand img { width: 32px; height: 32px; filter: none; }
body[data-current-view="assistant"] .brand-copy,
body[data-current-view="assistant"] .primary-nav a span,
body[data-current-view="assistant"] .primary-nav a small,
body[data-current-view="assistant"] .utility-nav a span,
body[data-current-view="assistant"] .utility-nav a small,
body[data-current-view="assistant"] .rail-profile > span:nth-child(2),
body[data-current-view="assistant"] .rail-profile > .ph { display: none; }
body[data-current-view="assistant"] .primary-nav,
body[data-current-view="assistant"] .utility-nav { gap: 3px; }
body[data-current-view="assistant"] .primary-nav a,
body[data-current-view="assistant"] .utility-nav a {
  display: grid;
  min-height: 38px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #6f6f6b;
}
body[data-current-view="assistant"] .primary-nav a:hover,
body[data-current-view="assistant"] .utility-nav a:hover { background: #e9e9e6; color: #20201e; transform: none; }
body[data-current-view="assistant"] .primary-nav a[aria-current="page"],
body[data-current-view="assistant"] .utility-nav a[aria-current="page"] { border: 0; background: #e5e5e2; color: #20201e; }
body[data-current-view="assistant"] .primary-nav a[aria-current="page"]::before,
body[data-current-view="assistant"] .utility-nav a[aria-current="page"]::before { display: none; }
body[data-current-view="assistant"] .primary-nav a .ph,
body[data-current-view="assistant"] .utility-nav a .ph { font-size: 18px; }
body[data-current-view="assistant"] .utility-nav { border-top-color: #dededb; }
body[data-current-view="assistant"] .rail-profile { grid-template-columns: 1fr; justify-items: center; padding: 9px 0 0; border-top-color: #dededb; }
body[data-current-view="assistant"] .profile-avatar { width: 30px; height: 30px; border-color: #d4d4d0; background: #e8e8e5; color: #4d4d49; }
body[data-current-view="assistant"] main,
body[data-current-view="assistant"] .view-root { background: #fff; }
body[data-current-view="assistant"] .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  height: 48px;
  gap: 12px;
  padding: 0 14px;
  border-bottom-color: #e9e9e6;
  background: #fff;
}
body[data-current-view="assistant"] .topbar-title { display: block; }
body[data-current-view="assistant"] .topbar-title h1 { font-size: 13px; font-weight: 590; letter-spacing: -.01em; }
body[data-current-view="assistant"] .topbar-title span { display: none; }
body[data-current-view="assistant"] .topbar-actions { gap: 4px; }
body[data-current-view="assistant"] .freshness-trigger {
  min-height: 30px;
  padding-inline: 8px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  color: #777772;
  font-size: 9px;
}
body[data-current-view="assistant"] .freshness-trigger:hover { border-color: transparent; background: #f4f4f2; }
body[data-current-view="assistant"] .topbar .icon-button { width: 30px; height: 30px; border-color: transparent; background: transparent; }
body[data-current-view="assistant"] .topbar .icon-button:hover { background: #f4f4f2; }

body[data-current-view="assistant"] .assistant-screen { background: #fff; }
body[data-current-view="assistant"] .assistant-layout { grid-template-columns: var(--assistant-project-rail) minmax(0, 1fr); background: #fff; }
body[data-current-view="assistant"] .project-rail {
  border-right-color: #e5e5e2;
  background: #f7f7f5;
}
body[data-current-view="assistant"] .project-rail-head { gap: 0; padding: 10px 8px 8px; border-bottom: 0; }
body[data-current-view="assistant"] .project-rail-actions { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 4px; }
body[data-current-view="assistant"] .new-chat-button {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #30302d;
  font-size: 11px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}
body[data-current-view="assistant"] .new-chat-button:hover { background: #e9e9e6; }
body[data-current-view="assistant"] .new-chat-button .ph { font-size: 16px; }
body[data-current-view="assistant"] .new-project-button { width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; }
body[data-current-view="assistant"] .new-project-button:hover { border: 0; background: #e9e9e6; }
body[data-current-view="assistant"] .project-scroll { padding: 8px 7px 16px; }
body[data-current-view="assistant"] .project-section-head { padding: 9px 7px 5px; color: #8a8a85; font-size: 9px; font-weight: 620; letter-spacing: .02em; text-transform: none; }
body[data-current-view="assistant"] .project-group { margin-bottom: 3px; }
body[data-current-view="assistant"] .project-row { min-height: 32px; border: 0; border-radius: 7px; color: #4e4e49; font-size: 11px; font-weight: 560; }
body[data-current-view="assistant"] .chat-row { min-height: 30px; margin-top: 0; padding-left: 28px; border: 0; border-radius: 7px; color: #74746f; font-size: 10px; }
body[data-current-view="assistant"] .project-row:hover,
body[data-current-view="assistant"] .chat-row:hover { background: #e9e9e6; color: #252522; }
body[data-current-view="assistant"] .chat-row[aria-pressed="true"] { border: 0; background: #e4e4e1; color: #242421; }
body[data-current-view="assistant"] .project-boundary { margin: 6px 7px 0; padding: 8px 0; border: 0; border-top: 1px solid #e4e4e1; border-radius: 0; background: transparent; color: #8a8a85; font-size: 9px; line-height: 1.5; }

body[data-current-view="assistant"] .chat-header { min-height: 50px; gap: 12px; padding: 0 14px; border-bottom-color: #ececea; }
body[data-current-view="assistant"] .chat-title { gap: 1px; }
body[data-current-view="assistant"] .chat-title strong { color: #2c2c29; font-size: 12px; font-weight: 590; }
body[data-current-view="assistant"] .chat-title span { color: #92928d; font-size: 9px; }
body[data-current-view="assistant"] .chat-header-actions { gap: 3px; }
body[data-current-view="assistant"] .assistant-runtime-status { display: inline-flex; align-items: center; gap: 5px; padding: 0 5px; color: #898984; font-size: 9px; white-space: nowrap; }
body[data-current-view="assistant"] .assistant-runtime-status > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #a0a09b; }
body[data-current-view="assistant"] .chat-header .icon-button { width: 30px; height: 30px; border-color: transparent; border-radius: 7px; background: transparent; }
body[data-current-view="assistant"] .chat-header .icon-button:hover { border-color: transparent; background: #f3f3f1; }
body[data-current-view="assistant"] .assistant-report-trigger {
  min-height: 30px;
  padding: 0 8px;
  border-color: #dededa;
  border-radius: 7px;
  background: #fff;
  color: #4c4c48;
  font-size: 10px;
  font-weight: 560;
}
body[data-current-view="assistant"] .assistant-report-trigger:hover { border-color: #cacac5; background: #f7f7f5; color: #242421; }
body[data-current-view="assistant"] .assistant-report-trigger:disabled { border-color: transparent; background: transparent; color: #b0b0aa; }
body[data-current-view="assistant"] .assistant-context-trigger { display: inline-grid; }

body[data-current-view="assistant"] .chat-thread-inner { width: min(760px, calc(100% - 48px)); padding: 34px 0 148px; }
body[data-current-view="assistant"] .chat-empty { min-height: calc(100vh - 250px); }
body[data-current-view="assistant"] .chat-empty-content { width: min(650px, 100%); }
body[data-current-view="assistant"] .agent-mark { width: 42px; height: 42px; margin-bottom: 13px; border: 0; border-radius: 0; background: transparent; color: inherit; }
body[data-current-view="assistant"] .agent-mark img { width: 32px; height: 32px; object-fit: contain; filter: grayscale(1) contrast(.9); opacity: .88; }
body[data-current-view="assistant"] .chat-empty h2 { color: #242421; font-size: 22px; font-weight: 590; letter-spacing: -.035em; }
body[data-current-view="assistant"] .chat-empty p { max-width: 540px; margin: 10px auto 12px; color: #777772; font-size: 12px; line-height: 1.55; }
body[data-current-view="assistant"] .assistant-experiment-chip { margin: 0 auto 9px; border-color: #e4e4e0; background: #fafaf8; color: #858580; font-size: 9px; }
body[data-current-view="assistant"] .starter-grid { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
body[data-current-view="assistant"] .starter-card {
  min-height: 46px;
  padding: 8px 10px;
  border-color: #e5e5e1;
  border-radius: 9px;
  background: #fff;
  color: #575752;
  font-size: 10px;
  line-height: 1.42;
}
body[data-current-view="assistant"] .starter-card:hover { border-color: #cfcfca; background: #f8f8f6; color: #292926; transform: none; }
body[data-current-view="assistant"] .dossier-anatomy { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid #e8e8e4; border-bottom: 1px solid #e8e8e4; }
body[data-current-view="assistant"] .dossier-anatomy article { grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 3px; padding: 7px 8px; border: 0; border-right: 1px solid #e8e8e4; border-radius: 0; background: transparent; }
body[data-current-view="assistant"] .dossier-anatomy article:last-child { border-right: 0; }
body[data-current-view="assistant"] .dossier-anatomy article > span { color: #9a9a95; font-size: 8px; }
body[data-current-view="assistant"] .dossier-anatomy strong { color: #4d4d48; font-size: 9px; font-weight: 590; }
body[data-current-view="assistant"] .dossier-anatomy small { display: none; }
body[data-current-view="assistant"] .chat-empty .assistant-phase-boundary { max-width: 620px; margin: 0 auto 10px; padding: 7px 9px; border: 0; border-radius: 7px; background: #f7f7f5; color: #868681; font-size: 9px; line-height: 1.4; text-align: center; }

body[data-current-view="assistant"] .message { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin-bottom: 24px; }
body[data-current-view="assistant"] .message-avatar { width: 28px; height: 28px; border-color: #e2e2de; border-radius: 8px; background: #f7f7f5; color: #686863; font-size: 9px; }
body[data-current-view="assistant"] .message[data-role="assistant"] .message-avatar { border-color: #e2e2de; background: #f1f1ef; color: #4e4e49; }
body[data-current-view="assistant"] .message-meta strong { font-size: 11px; font-weight: 590; }
body[data-current-view="assistant"] .message-meta span { font-size: 9px; }
body[data-current-view="assistant"] .markdown-body { color: #333330; font-size: 12px; line-height: 1.68; }

body[data-current-view="assistant"] .composer-wrap { right: 0; left: var(--assistant-project-rail); padding: 12px 28px 14px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 24%, #fff); box-shadow: none; }
body[data-current-view="assistant"] .composer { width: min(760px, 100%); padding: 7px; border-color: #d5d5d0; border-radius: 17px; box-shadow: 0 4px 18px rgba(28,28,26,.08); }
body[data-current-view="assistant"] .composer:focus-within { border-color: #aaa9a3; box-shadow: 0 4px 18px rgba(28,28,26,.08), 0 0 0 3px rgba(70,70,65,.1); }
body[data-current-view="assistant"] .composer textarea { min-height: 50px; padding: 8px 10px; color: #2d2d2a; font-size: 12px; }
body[data-current-view="assistant"] .composer textarea::placeholder { color: #a0a09b; }
body[data-current-view="assistant"] .composer-note { margin-top: 6px; color: #a0a09b; font-size: 8px; }
body[data-current-view="assistant"] .send-button { border-color: #2f2f2c; background: #2f2f2c; }
body[data-current-view="assistant"] .send-button:hover { border-color: #181816; background: #181816; }

body[data-current-view="assistant"] .evidence-rail {
  position: fixed;
  z-index: 86;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  display: flex;
  width: min(360px, calc(100vw - 40px));
  border-left: 1px solid #dfdfdb;
  background: #fafaf8;
  box-shadow: -18px 0 50px rgba(30,30,28,.12);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform var(--fx-motion-route) var(--fx-motion-easing), visibility var(--fx-motion-route) step-end;
}
body[data-current-view="assistant"][data-assistant-panel="context"] .evidence-rail { transform: translateX(0); visibility: visible; transition: transform var(--fx-motion-route) var(--fx-motion-easing), visibility 0s; }
body[data-current-view="assistant"] .evidence-rail .assistant-panel-close { display: inline-grid; }
body[data-current-view="assistant"] .assistant-panel-scrim { position: fixed; z-index: 85; inset: var(--topbar-height) 0 0; width: 100%; height: auto; border: 0; background: rgba(20,20,18,.16); backdrop-filter: blur(1px); }
body[data-current-view="assistant"][data-assistant-panel="context"] .assistant-panel-scrim { display: block; }

@media (max-width: 940px) {
  body[data-current-view="assistant"] { --app-rail: 0px; --topbar-height: 56px; --assistant-project-rail: 0px; }
  body[data-current-view="assistant"] .app-shell { grid-template-columns: 1fr; }
  body[data-current-view="assistant"] .app-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    padding: 18px 12px 14px;
    background: #f7f7f5;
    box-shadow: 16px 0 44px rgba(0,0,0,.16);
    transform: translateX(-102%);
  }
  body[data-current-view="assistant"][data-menu-open="true"] .app-rail { transform: translateX(0); }
  body[data-current-view="assistant"] .brand { justify-content: flex-start; margin: 0 4px 24px; }
  body[data-current-view="assistant"] .brand-copy,
  body[data-current-view="assistant"] .primary-nav a span,
  body[data-current-view="assistant"] .primary-nav a small,
  body[data-current-view="assistant"] .utility-nav a span,
  body[data-current-view="assistant"] .utility-nav a small,
  body[data-current-view="assistant"] .rail-profile > span:nth-child(2),
  body[data-current-view="assistant"] .rail-profile > .ph { display: grid; }
  body[data-current-view="assistant"] .primary-nav a,
  body[data-current-view="assistant"] .utility-nav a { grid-template-columns: 22px minmax(0, 1fr) auto; justify-items: initial; padding: 0 12px; }
  body[data-current-view="assistant"] .rail-profile { grid-template-columns: 34px minmax(0, 1fr) 18px; justify-items: initial; padding: 9px 8px; }
  body[data-current-view="assistant"] .topbar { grid-template-columns: auto minmax(0, 1fr) auto; height: 56px; padding-inline: 12px; }
  body[data-current-view="assistant"] .topbar-title { display: none; }
  body[data-current-view="assistant"] .assistant-layout { grid-template-columns: minmax(0, 1fr); }
  body[data-current-view="assistant"] .composer-wrap { right: 0; left: 0; }
  body[data-current-view="assistant"] .project-rail,
  body[data-current-view="assistant"] .evidence-rail { top: 56px; }
  body[data-current-view="assistant"] .assistant-panel-scrim { inset: 56px 0 0; }
}

@media (max-width: 700px) {
  body[data-current-view="assistant"] .chat-thread-inner { width: calc(100% - 24px); padding-top: 22px; }
  body[data-current-view="assistant"] .chat-empty { min-height: auto; padding: 24px 0 36px; }
  body[data-current-view="assistant"] .chat-empty h2 { font-size: 19px; }
  body[data-current-view="assistant"] .starter-grid { grid-template-columns: 1fr; }
  body[data-current-view="assistant"] .dossier-anatomy { display: none; }
  body[data-current-view="assistant"] .assistant-runtime-status { display: none; }
  body[data-current-view="assistant"] .composer-wrap { padding: 10px 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .live-draft-caret { opacity: .65; }
}

@media (prefers-contrast: more) {
  .table-card, .pipeline-bar, .map-layout, .app-dialog, .source-popover, .collector-hero, .collector-metric, .collector-lanes, .collector-feed, .run-activity, .memory-card, .tool-card, .artifact-card { border-color: var(--fx-color-line-contrast); }
  .procurement-table td, .procurement-table th { border-bottom-color: var(--fx-color-line-contrast); }
}

::view-transition-old(root) { animation: 140ms ease both fade-out; }
::view-transition-new(root) { animation: 260ms var(--fx-motion-easing) both fade-in; }
@keyframes fade-out { to { opacity: 0; transform: translateY(-3px); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
