/* Axiom workspace v2. Tokens only (tokens.css). Hierarchy through type, spacing and surface, not boxes.
   Radii: 8 controls · 12 panels · 16 composer/dialogs. Shadows only on elevated things (menus, dialogs, composer). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fw-regular) var(--fs-body)/var(--lh-body) var(--font-sans);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-semibold); letter-spacing: -0.015em; color: var(--text); }
h1 { font-size: var(--fs-h1); line-height: 38px; text-wrap: balance; }
h2 { font-size: var(--fs-h2); line-height: 28px; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); line-height: 24px; letter-spacing: -0.005em; }
p { margin: 0 0 var(--s-3); }
code, .mono { font-family: var(--font-mono); font-size: 12.5px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-small); line-height: var(--lh-small); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; }
svg.i-sm { width: 16px; height: 16px; }
[hidden] { display: none !important; }

/* =============================================================== shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--dur-base) var(--ease); }
html[data-sidebar="collapsed"] .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
.sb { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); background: var(--surface-2); overflow: hidden; }
.sb-top { display: flex; align-items: center; gap: var(--s-2); height: 44px; padding-inline: var(--s-2); }
.sb-top .brand { flex: 1; min-width: 0; display: flex; align-items: center; color: var(--text); }
.sb-top .brand:hover { text-decoration: none; }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.brand-lockup .brand-mark { height: 20px; width: auto; display: block; }
.brand-lockup .brand-wordmark { height: 11px; width: auto; display: block; }
.sb-section { display: flex; flex-direction: column; gap: 2px; }
.sb-label { font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--text-2); padding: var(--s-4) var(--s-3) var(--s-1); white-space: nowrap; }
.sb-link { display: flex; align-items: center; gap: var(--s-3); height: 36px; padding-inline: var(--s-3); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; white-space: nowrap; min-width: 0;
  transition: background var(--dur-fast) var(--ease); }
.sb-link:hover { background: var(--surface-hover); text-decoration: none; }
.sb-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-medium); }
.sb-link svg { color: var(--text-2); }
.sb-link[aria-current="page"] svg { color: var(--accent); }
.sb-link .t { overflow: hidden; text-overflow: ellipsis; }
.sb-link.recent { height: 32px; font-size: 13px; color: var(--text-2); }
.sb-link.recent:hover { color: var(--text); }
.sb-scroll { flex: 1; min-height: 0; overflow-y: auto; margin-inline: calc(var(--s-3) * -1); padding-inline: var(--s-3); }
.sb-bottom { padding-top: var(--s-2); border-top: 1px solid var(--border); }
.org-switch { width: 100%; }
.org-switch > summary { display: flex; align-items: center; gap: var(--s-3); height: 48px; padding-inline: var(--s-2); border-radius: var(--radius-sm); cursor: pointer; list-style: none; }
.org-switch > summary::-webkit-details-marker { display: none; }
.org-switch > summary:hover { background: var(--surface-hover); }
.org-switch .name { flex: 1; min-width: 0; font-weight: var(--fw-medium); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-switch .role { display: block; font-size: var(--fs-caption); color: var(--text-2); font-weight: var(--fw-regular); }
.initial { width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font-weight: var(--fw-semibold); font-size: 14px; }
.initial.lg { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
.initial.neutral { background: var(--surface-sunken); color: var(--text-2); }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-text); font-size: 12px; font-weight: var(--fw-semibold); }
html[data-sidebar="collapsed"] .sb .t, html[data-sidebar="collapsed"] .sb .sb-label, html[data-sidebar="collapsed"] .sb .name,
html[data-sidebar="collapsed"] .sb .brand .brand-wordmark, html[data-sidebar="collapsed"] .sb .hide-collapsed { display: none; }
html[data-sidebar="collapsed"] .sb-link, html[data-sidebar="collapsed"] .org-switch > summary { justify-content: center; padding-inline: 0; }
html[data-sidebar="collapsed"] .sb-top { flex-direction: column; height: auto; gap: var(--s-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.ctx-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-3); height: var(--header-h); padding-inline: var(--s-8);
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); }
.ctx-header.lined { border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font-size: 14px; color: var(--text-2); }
.crumbs a { color: var(--text-2); white-space: nowrap; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { color: var(--text-3); }
.crumbs .current { color: var(--text); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-header .spacer { flex: 1; }

.page { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s-6) var(--s-8) var(--s-16); }
.page.narrow { max-width: var(--content-narrow); }
.page-title { display: flex; align-items: flex-end; gap: var(--s-4); margin-bottom: var(--s-8); }
.page-title .grow { flex: 1; min-width: 0; }
.page-title .eyebrow { font-size: 13px; color: var(--text-2); margin-bottom: var(--s-2); display: flex; align-items: center; gap: var(--s-2); }
.page-title .meta { margin-top: var(--s-2); color: var(--text-2); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-4); }
.actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.section { margin-top: var(--s-10); }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); }
.section-head h2 { flex: 1; font-size: 17px; line-height: 24px; }
.section-head .caption { font-size: 13px; }
@media (max-width: 900px) {
  .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .sb .t, .sb .sb-label, .sb .name, .sb .brand .brand-wordmark, .sb .hide-collapsed { display: none; }
  .sb-top #sb-toggle { display: none; }   /* the sidebar is already collapsed here; the button would sit on the logo */
  .sb-top .brand { justify-content: center; }
  .sb-link, .org-switch > summary { justify-content: center; padding-inline: 0; }
  .page, .ctx-header { padding-inline: var(--s-5); }
  .page-title { flex-direction: column; align-items: flex-start; }
}

/* =============================================================== controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: var(--control-h); padding-inline: var(--s-4); border-radius: var(--radius-sm);
  font: var(--fw-medium) 14px/1 var(--font-sans); cursor: pointer; white-space: nowrap; border: 0; background: var(--surface-sunken); color: var(--text);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.btn:hover { background: color-mix(in srgb, var(--surface-sunken) 70%, var(--border)); text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { color: var(--error-text); }
.btn-sm { height: var(--control-h-sm); padding-inline: var(--s-3); font-size: 13px; }
.btn-lg { height: 44px; padding-inline: var(--s-5); font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.sm { width: 32px; height: 32px; }

.field { display: block; margin-bottom: var(--s-5); }
.field > .label, .label { display: block; font-size: 14px; font-weight: var(--fw-medium); margin-bottom: var(--s-2); color: var(--text); }
.field > .hint, .hint { display: block; color: var(--text-2); font-size: 13px; line-height: 18px; margin-top: var(--s-2); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=url], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: var(--control-h); padding: 9px var(--s-3); font: 15px/22px var(--font-sans); color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

/* segmented choice (radio) */
.choice { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: flex; flex-direction: column; justify-content: center; min-height: 36px; padding: 6px var(--s-3); border-radius: var(--radius-sm); font-size: 14px; font-weight: var(--fw-medium); color: var(--text-2); cursor: pointer; text-align: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.choice label small { font-weight: var(--fw-regular); font-size: 12px; color: var(--text-2); }
.choice input:checked + label { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.choice input:focus-visible + label { box-shadow: var(--focus-ring); }
.choice input:disabled + label { opacity: .5; cursor: not-allowed; }

/* toggle pill (checkbox) */
.toggle { position: relative; display: inline-flex; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding-inline: 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: var(--fw-medium); color: var(--text-2); cursor: pointer; user-select: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.toggle span:hover { background: var(--surface-hover); color: var(--text); }
.toggle input:checked + span { background: var(--accent-soft); color: var(--accent); }
.toggle input:focus-visible + span { box-shadow: var(--focus-ring); }
.toggle input:disabled + span { opacity: .45; cursor: not-allowed; }

/* =============================================================== popovers, menus, dialogs */
.pop { position: relative; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; z-index: 50; min-width: 240px; padding: 6px; background: var(--surface-raised); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); border: 1px solid var(--border); }
.menu.up { bottom: calc(100% + 8px); left: 0; }
.menu.down { top: calc(100% + 6px); left: 0; }
.menu.right { right: 0; left: auto; }
.menu-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 38px; padding: 6px 10px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text);
  font: 14px/1.3 var(--font-sans); text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--surface-hover); text-decoration: none; }
.menu-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.menu-item .grow { flex: 1; min-width: 0; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-note { padding: var(--s-2) 10px; font-size: 13px; color: var(--text-2); line-height: 19px; }
.menu-note dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.menu-note dt { color: var(--text-2); } .menu-note dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
dialog.dlg { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-overlay); }
dialog.dlg::backdrop { background: rgba(24, 24, 27, .32); }
dialog.dlg[open] { animation: dlg-in var(--dur-base) var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.dlg-body { padding: var(--s-6) var(--s-6) var(--s-2); }
.dlg-body h2 { margin-bottom: var(--s-2); }
.dlg-body > p { color: var(--text-2); margin-bottom: var(--s-5); }
.dlg-actions { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-6) var(--s-6); }

/* =============================================================== lists & rows */
.rows { display: flex; flex-direction: column; }
.row-item { position: relative; display: flex; align-items: center; gap: var(--s-4); min-height: 64px; padding: var(--s-3) var(--s-4); margin-inline: calc(var(--s-4) * -1); border-radius: var(--radius-md); color: var(--text);
  transition: background var(--dur-fast) var(--ease); }
a.row-item:hover, .row-item.clickable:hover { background: var(--surface-2); text-decoration: none; }
.row-item + .row-item::before { content: ""; position: absolute; top: 0; left: var(--s-4); right: var(--s-4); height: 1px; background: var(--border); }
a.row-item:hover::before, a.row-item:hover + .row-item::before { opacity: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { display: block; font-weight: var(--fw-medium); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .sub { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.row-item .chev { color: var(--text-3); transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
a.row-item:hover .chev { color: var(--text-2); transform: translateX(2px); }
.row-item .end { display: flex; align-items: center; gap: var(--s-4); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.empty { padding: var(--s-10) var(--s-4); text-align: center; color: var(--text-2); }
.empty h3 { color: var(--text); margin-bottom: var(--s-2); }
.empty p { max-width: 460px; margin-inline: auto; }
.empty .btn { margin-top: var(--s-3); }

/* =============================================================== badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding-inline: 8px; border-radius: 6px; font-size: 12px; font-weight: var(--fw-medium); white-space: nowrap;
  color: var(--text-2); background: var(--surface-2); }
.badge.accent { color: var(--accent); background: var(--accent-soft); }
.badge.warning { color: var(--warning-text); background: var(--warning-soft); }
.badge.error { color: var(--error-text); background: var(--error-soft); }
.badge.plain { background: transparent; padding-inline: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.pulse { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* =============================================================== tabs */
.tabs { display: flex; gap: var(--s-6); border-bottom: 1px solid var(--border); margin-bottom: var(--s-6); overflow-x: auto; }
.tab { position: relative; padding: var(--s-3) 0; color: var(--text-2); font-weight: var(--fw-medium); font-size: 14px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tab .count { margin-inline-start: 6px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: var(--fw-regular); }

/* =============================================================== tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
.table th { position: sticky; top: var(--header-h); z-index: 1; text-align: start; font-weight: var(--fw-medium); font-size: 13px; color: var(--text-2); background: var(--bg); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: end; }
.table .row-link { color: var(--text); font-weight: var(--fw-medium); }
.table tr[data-href] { cursor: pointer; }
.table td:first-child, .table th:first-child { padding-inline-start: 4px; }

/* =============================================================== evidence states */
.ev { display: inline; font-variant-numeric: tabular-nums; }
.ev .v { color: var(--text); }
.ev .mk { display: inline-block; vertical-align: -2px; margin-inline-end: 6px; }
.ev .mk svg { display: block; }
.ev-provisional .v { text-decoration: underline dotted var(--text-3); text-underline-offset: 4px; }
.ev-provisional .mk { color: var(--text-3); }
.ev-approved .mk { color: var(--accent); }
.ev-conflict .mk, .ev-conflict .v { color: var(--warning-text); }
.ev-unknown .v { color: var(--text-2); font-style: italic; }
.ev-rejected .v { color: var(--text-2); text-decoration: line-through; }
.ev-rejected .mk { color: var(--error); }
.ev-computed .mk { color: var(--text-2); font-family: var(--font-mono); font-size: 11px; }
.ev .period, .ev .cur { color: var(--text-2); font-size: 12px; margin-inline-start: 6px; white-space: nowrap; }

/* =============================================================== matrix */
.matrix-wrap { position: relative; overflow: auto; max-height: calc(100vh - 240px); margin-inline: -4px; }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--border); padding: 0; text-align: start; }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 12px 14px; color: var(--text-2); font-weight: var(--fw-medium); font-size: 13px; white-space: nowrap; vertical-align: bottom; }
.matrix thead th .unit { display: block; font-size: 12px; font-weight: var(--fw-regular); color: var(--text-3); margin-top: 2px; }
.matrix tbody th { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--bg); padding: 14px; font-weight: var(--fw-medium); color: var(--text); white-space: nowrap; min-width: 170px; }
.matrix thead th:first-child { inset-inline-start: 0; z-index: 3; }
.matrix tbody tr:hover th, .matrix tbody tr:hover td { background: var(--surface-2); }
.matrix td a.cell { display: block; padding: 12px 14px; min-width: 150px; min-height: 58px; color: inherit; border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease); }
.matrix td a.cell:hover { background: var(--surface-sunken); text-decoration: none; }
.matrix td a.cell:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.matrix td.st-conflict a.cell { box-shadow: inset 3px 0 0 var(--warning); }
.matrix td.st-rejected a.cell { box-shadow: inset 3px 0 0 var(--error); }
.matrix td.st-approved a.cell { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.matrix .src { display: block; margin-top: 3px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 24ch; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: 13px; color: var(--text-2); }
.legend .ev { font-size: 13px; white-space: nowrap; }
.table-foot { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) 0; color: var(--text-2); font-size: 13px; }

/* =============================================================== progress stepper */
.stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; margin: var(--s-2) 0 var(--s-8); }
.step-x { position: relative; padding-right: var(--s-3); }
.step-x .ln { position: absolute; top: 11px; left: 28px; right: 4px; height: 2px; background: var(--border); border-radius: 2px; }
.step-x:last-child .ln { display: none; }
.step-x.done .ln { background: var(--accent); }
.step-x .ic { position: relative; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.step-x.done .ic { background: var(--accent); color: #fff; }
.step-x.active .ic { background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.step-x.failed .ic { background: var(--error-soft); color: var(--error-text); }
.step-x .nm { margin-top: var(--s-2); font-size: 14px; font-weight: var(--fw-medium); }
.step-x.pending .nm { color: var(--text-2); }
.step-x .dt { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================================== metrics */
.stats { display: flex; flex-wrap: wrap; gap: var(--s-8) var(--s-10); padding: var(--s-2) 0 var(--s-6); }
.stat .k { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.stat .k abbr { text-decoration: underline dotted var(--text-3); text-underline-offset: 3px; cursor: help; }
.stat .val { font-size: 24px; line-height: 32px; font-weight: var(--fw-semibold); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .val small { font-size: 14px; color: var(--text-2); font-weight: var(--fw-regular); margin-inline-start: 3px; letter-spacing: 0; }

/* =============================================================== evidence reader */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-10); align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.rail { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: var(--s-8); }
.rail h3 { font-size: 14px; margin-bottom: var(--s-3); }
.value-hero { font-size: 26px; line-height: 34px; font-weight: var(--fw-semibold); letter-spacing: -0.01em; margin-top: var(--s-3); }
.value-hero .ev .mk { margin-inline-end: 10px; } .value-hero .period, .value-hero .cur { font-size: 15px; font-weight: var(--fw-regular); }
.source-line { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.source-line .grow { flex: 1; min-width: 0; }
.source-line .title { font-weight: var(--fw-medium); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s-6); font-size: 14px; margin: var(--s-5) 0 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }
.passage { font-size: var(--fs-read); line-height: var(--lh-read); padding: var(--s-5) var(--s-6); background: var(--surface-2); border-radius: var(--radius-md); white-space: pre-wrap; }
.passage mark { background: var(--accent-soft); color: var(--text); padding: 2px 3px; border-radius: 4px; box-shadow: inset 0 -2px 0 var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--s-4) var(--s-6); }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text-3); }
.timeline li.approve::after { border-color: var(--accent); background: var(--accent); }
.timeline li.reject::after { border-color: var(--error); }
.decision { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; margin-bottom: var(--s-4); }
.decision input { position: absolute; opacity: 0; pointer-events: none; }
.decision label { display: flex; align-items: center; justify-content: center; height: 36px; border-radius: var(--radius-sm); font-size: 14px; font-weight: var(--fw-medium); color: var(--text-2); cursor: pointer; }
.decision input:checked + label { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.decision input:focus-visible + label { box-shadow: var(--focus-ring); }

/* =============================================================== summary (synthesis) */
.synth { font-size: var(--fs-read); line-height: 28px; max-width: var(--read-max); }
.synth p { margin-bottom: var(--s-4); }
.cite { display: inline-flex; align-items: center; height: 18px; min-width: 18px; justify-content: center; padding-inline: 5px; margin-inline-start: 3px; border-radius: 5px; background: var(--surface-2);
  color: var(--text-2); font: 11px/1 var(--font-mono); vertical-align: 2px; }
.cite:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.flagged { border-inline-start: 3px solid var(--warning); padding-inline-start: var(--s-3); color: var(--text-2); }

/* =============================================================== notices */
.notice { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--radius-md); background: var(--surface-2); font-size: 14px; }
.notice.warning { background: var(--warning-soft); color: var(--warning-text); }
.notice.error { background: var(--error-soft); color: var(--error-text); }
.notice.info { background: var(--accent-soft); color: var(--text); }
.notice svg { margin-top: 2px; }

/* =============================================================== auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6); background: var(--surface-2); }
.auth-card { width: 100%; max-width: 400px; background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); padding: var(--s-10) var(--s-8) var(--s-8); }
.auth-card .brand { display: flex; justify-content: center; margin-bottom: var(--s-8); }
.auth-card .brand .brand-mark { height: 30px; } .auth-card .brand .brand-wordmark { height: 17px; }
.auth-card .brand-lockup { gap: 12px; }
.auth-card h1 { font-size: 24px; line-height: 32px; text-align: center; }
.auth-card .lede { text-align: center; color: var(--text-2); margin: var(--s-2) 0 var(--s-8); }
.divider { display: flex; align-items: center; gap: var(--s-3); color: var(--text-2); font-size: 12px; margin: var(--s-6) 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { text-align: center; margin-top: var(--s-6); font-size: 13px; color: var(--text-2); }

/* =============================================================== workspace selector */
.ws-list { max-width: 640px; }
.ws-list .row-item { min-height: 72px; }

/* =============================================================== brief builder */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-12); align-items: start; }
@media (max-width: 1100px) { .builder { grid-template-columns: 1fr; } .brief-summary { display: none; } }
.bsec { padding: var(--s-8) 0; border-top: 1px solid var(--border); }
.bsec:first-child { border-top: 0; padding-top: 0; }
.bsec-head { display: flex; gap: var(--s-4); margin-bottom: var(--s-5); }
.bsec-head .no { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: var(--fw-semibold); }
.bsec-head h2 { font-size: 18px; line-height: 28px; }
.bsec-head p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.bsec-body { padding-left: 44px; }
@media (max-width: 700px) { .bsec-body { padding-left: 0; } }
textarea.question { font-size: 17px; line-height: 26px; min-height: 84px; padding: var(--s-3) var(--s-4); }
.chips-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 48px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); cursor: text;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.chips-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chips-input input { flex: 1; min-width: 160px; border: 0 !important; box-shadow: none !important; padding: 6px 4px; min-height: 32px; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; font-weight: var(--fw-medium); }
.chip button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; }
.chip button:hover { background: var(--border); color: var(--text); }
.presets { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.preset { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding-inline: 10px 12px; border-radius: var(--radius-sm); border: 0; background: var(--surface-2); color: var(--text); font: var(--fw-medium) 13px/1 var(--font-sans); cursor: pointer;
  transition: background var(--dur-fast) var(--ease); }
.preset:hover { background: var(--surface-sunken); }
.preset[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.frows { display: flex; flex-direction: column; gap: var(--s-2); }
.frow { display: grid; grid-template-columns: minmax(0, 2fr) 120px 120px minmax(0, 2fr) 36px; gap: var(--s-2); align-items: center; }
.frow-head { font-size: 12px; color: var(--text-2); font-weight: var(--fw-medium); }
.frow input, .frow select { min-height: 38px; font-size: 14px; }
@media (max-width: 800px) { .frow { grid-template-columns: 1fr 1fr; } .frow-head { display: none; } }
.srcrows { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.srcrow { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) 36px; gap: var(--s-2); }
details.adv { margin-top: var(--s-6); }
details.adv > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--text-2); font-size: 14px; font-weight: var(--fw-medium); }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary svg { transition: transform var(--dur-fast) var(--ease); }
details.adv[open] > summary svg { transform: rotate(90deg); }
details.adv > .adv-body { margin-top: var(--s-5); }
.brief-summary { position: sticky; top: calc(var(--header-h) + 16px); background: var(--surface-2); border-radius: var(--radius-md); padding: var(--s-6); }
.brief-summary h3 { font-size: 14px; color: var(--text-2); font-weight: var(--fw-medium); margin-bottom: var(--s-3); }
.brief-summary .q { font-size: 16px; line-height: 24px; font-weight: var(--fw-medium); margin-bottom: var(--s-5); }
.brief-summary .q.empty-q { color: var(--text-3); font-weight: var(--fw-regular); }
.brief-summary dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 var(--s-5); font-size: 14px; }
.brief-summary dt { color: var(--text-2); } .brief-summary dd { margin: 0; font-variant-numeric: tabular-nums; }
.brief-summary .est { padding-top: var(--s-4); border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); margin-bottom: var(--s-5); }
.brief-summary .est b { color: var(--text); font-weight: var(--fw-semibold); font-size: 15px; }
.submit-bar { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-6) 0 0 44px; }
@media (max-width: 700px) { .submit-bar { padding-left: 0; } }

/* =============================================================== artifacts */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-6) var(--s-5); }
.doc-card { display: flex; flex-direction: column; gap: var(--s-3); color: var(--text); }
.doc-card:hover { text-decoration: none; }
.art-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px var(--border); transition: box-shadow var(--dur-fast) var(--ease); }
.doc-card:hover .art-thumb, a.art-thumb:hover { box-shadow: 0 0 0 1px var(--border), var(--shadow-overlay); }
.art-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.art-thumb.doc { background: var(--surface-2); padding: 16px 18px; box-shadow: none; }
.doc-lines { display: flex; flex-direction: column; gap: 7px; }
.doc-lines b { font-size: 12px; line-height: 16px; font-weight: var(--fw-semibold); color: var(--text); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-lines i { display: block; height: 5px; border-radius: 3px; background: var(--border); }
.doc-lines i.short { width: 60%; }
.md-tag { position: absolute; bottom: 10px; right: 10px; font: 600 10px/1 var(--font-mono); color: var(--text-2); background: var(--bg); border-radius: 5px; padding: 4px 6px; }
.doc-meta { display: flex; flex-direction: column; gap: 3px; }
.art-title { font-weight: var(--fw-medium); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.warn-text { color: var(--warning-text); }
.deck-frame { position: relative; aspect-ratio: 16 / 9; width: 100%; max-height: calc(100vh - 240px); border-radius: var(--radius-md); overflow: hidden; background: #18181B; }
.deck-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.deck-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-4); }
.prose { max-width: var(--read-max); font-size: var(--fs-read); line-height: var(--lh-read); }
.prose h1 { font-size: 28px; line-height: 36px; margin: 0 0 var(--s-5); }
.prose h2 { font-size: 20px; margin: var(--s-10) 0 var(--s-3); }
.prose h3 { margin: var(--s-6) 0 var(--s-2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s-4); }
.prose blockquote { margin: 0 0 var(--s-5); padding: var(--s-4) var(--s-5); background: var(--warning-soft); border-radius: var(--radius-md); color: var(--text); }
.prose blockquote p:last-child { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 0 0 var(--s-4); font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: start; vertical-align: top; }
.prose th { color: var(--text-2); font-weight: var(--fw-medium); font-size: 13px; }
.prose code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.prose .footnote { font-size: 13px; color: var(--text-2); word-break: break-word; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-10) 0 var(--s-5); }

/* =============================================================== assistant */
.asst { display: flex; flex-direction: column; height: calc(100vh - var(--header-h)); min-height: 0; }
.asst-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.thread { max-width: var(--read-max); margin: 0 auto; padding: var(--s-8) var(--s-6) var(--s-6); display: flex; flex-direction: column; gap: var(--s-6); }
.welcome { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: var(--s-8) var(--s-6) 12vh; }
.welcome h1 { font-size: var(--fs-display); line-height: 46px; letter-spacing: -0.025em; text-align: center; margin-bottom: var(--s-3); }
.welcome .lede { color: var(--text-2); text-align: center; margin-bottom: var(--s-8); font-size: 16px; }
.welcome .composer-wrap { width: 100%; max-width: var(--read-max); padding: 0; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-top: var(--s-5); }
.quick button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding-inline: 14px 16px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--text); font: var(--fw-medium) 14px/1 var(--font-sans); cursor: pointer;
  transition: background var(--dur-fast) var(--ease); }
.quick button:hover { background: var(--surface-sunken); }
.quick button svg { color: var(--text-2); }
.msg-user { align-self: flex-end; max-width: 85%; background: var(--surface-2); border-radius: 18px 18px 6px 18px; padding: 10px 16px; font-size: 15px; line-height: 23px; white-space: pre-wrap; }
.msg-user .modes { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.msg-user-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mode-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.msg-ai { font-size: var(--fs-read); line-height: var(--lh-read); }
.msg-ai p { margin: 0 0 var(--s-3); } .msg-ai p:last-child { margin: 0; }
.msg-ai ul { margin: 0 0 var(--s-3); padding-inline-start: var(--s-5); } .msg-ai li { margin-bottom: 2px; }
.msg-foot { display: flex; align-items: center; gap: 2px; margin-top: var(--s-2); color: var(--text-2); }
.cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.cite-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; max-width: 100%;
  transition: background var(--dur-fast) var(--ease); }
.cite-chip:hover { background: var(--accent-soft); text-decoration: none; }
.cite-chip svg { color: var(--text-2); } .cite-chip.web svg { color: var(--accent); }
.cite-chip .num { color: var(--text-2); }
.steps { display: flex; flex-direction: column; gap: 2px; }
.step { font-size: 13px; color: var(--text-2); }
.step > summary { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; list-style: none; border-radius: 6px; padding-inline: 4px; margin-inline: -4px; }
.step > summary:hover { color: var(--text); }
.step > summary::-webkit-details-marker { display: none; }
.step > summary svg { color: var(--text-3); }
.step.ok > summary svg { color: var(--accent); }
.step .t-ms { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.step pre { font: 11.5px/17px var(--font-mono); background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s-2) var(--s-3); margin: 4px 0 var(--s-2); white-space: pre-wrap; word-break: break-all; }
.step ul { margin: 4px 0 var(--s-2); padding-inline-start: var(--s-6); }
.error-text { color: var(--error-text); }
.thinking { font-size: 14px; color: var(--text-2); }
.thinking > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: var(--fw-medium); min-height: 28px; }
.thinking > summary::-webkit-details-marker { display: none; }
.thinking ol { margin: var(--s-2) 0 0; padding-inline-start: var(--s-6); line-height: 22px; }
.action-card { border-radius: var(--radius-md); background: var(--surface-2); padding: var(--s-4) var(--s-5); }
.action-card.pending { background: var(--warning-soft); }
.action-head { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; }
.action-card.pending .action-head svg { color: var(--warning); }
.action-card.confirmed .action-head svg { color: var(--accent); }
.action-card.cancelled .action-head svg, .action-card.failed .action-head svg { color: var(--text-2); }
.action-head .caption { margin-inline-start: auto; }
.action-summary { margin: var(--s-2) 0 var(--s-4); font-size: 15px; }
.action-buttons { display: flex; gap: var(--s-2); }
.art-card { display: grid; grid-template-columns: 220px 1fr; gap: var(--s-5); align-items: start; }
.art-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.art-actions { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
@media (max-width: 700px) { .art-card { grid-template-columns: 1fr; } }
.notice-line { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 13px; color: var(--text-2); }
.live { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 15px; }
.live .tabular { font-size: 13px; }
.composer-wrap { padding: 0 var(--s-6) var(--s-5); }
.composer { max-width: var(--read-max); margin: 0 auto; background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-composer); border: 1px solid var(--border);
  transition: box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease); }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.composer textarea { display: block; border: 0 !important; box-shadow: none !important; background: transparent; resize: none; min-height: 60px; max-height: 240px; padding: var(--s-4) var(--s-5) var(--s-2);
  font-size: 16px; line-height: 24px; }
.composer-bar { display: flex; align-items: center; gap: 4px; padding: 0 var(--s-2) var(--s-2) var(--s-3); }
.composer-bar .spacer { flex: 1; }
.send { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--primary); color: var(--primary-text); cursor: pointer; transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.send:hover { background: var(--primary-hover); }
.send:disabled { opacity: .3; cursor: not-allowed; }
.send.stop { background: var(--surface-sunken); color: var(--text); }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--s-3) var(--s-4) 0; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.composer-hint { max-width: var(--read-max); margin: var(--s-2) auto 0; text-align: center; font-size: 12px; color: var(--text-2); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.status-pill .dot { color: var(--accent); }
.ctx-select { height: 32px; min-height: 32px; padding: 0 32px 0 10px; font-size: 13px; width: auto; max-width: 320px; border-color: transparent; background-color: var(--surface-2); }
.ctx-select:hover { background-color: var(--surface-sunken); }

/* =============================================================== assistant panel */
:root { --panel-w: 440px; }
html[data-panel="open"] .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--panel-w); }
html[data-panel="open"][data-sidebar="collapsed"] .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr) var(--panel-w); }
.ap { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--border); animation: ap-in var(--dur-base) var(--ease); }
@keyframes ap-in { from { opacity: 0; transform: translateX(12px); } }
.ap-head { display: flex; align-items: center; gap: 4px; height: var(--header-h); padding: 0 var(--s-3) 0 var(--s-4); border-bottom: 1px solid var(--border); }
.ap-head .spacer { flex: 1; }
.ap-title { display: inline-flex; align-items: center; gap: 8px; font-weight: var(--fw-semibold); font-size: 15px; }
.ap iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
html[data-panel="open"] .asst-toggle { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 1180px) {
  html[data-panel="open"] .app, html[data-panel="open"][data-sidebar="collapsed"] .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .ap { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--panel-w), 100vw); z-index: 60; box-shadow: var(--shadow-overlay); }
}
/* embedded conversation inside the panel */
.embed { display: flex; flex-direction: column; height: 100vh; }
.embed-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.embed-bar form:first-child, .embed-bar > .status-pill:first-child { flex: 1; min-width: 0; }
.embed-bar .ctx-select { max-width: none; width: 100%; }
.embed .asst { height: auto; flex: 1; min-height: 0; }
.embed .thread { padding: var(--s-5) var(--s-4) var(--s-4); gap: var(--s-5); }
.embed .welcome { padding: var(--s-6) var(--s-4) var(--s-8); justify-content: flex-end; }
.embed .welcome h1 { font-size: 26px; line-height: 32px; }
.embed .welcome .lede { font-size: 14px; margin-bottom: var(--s-5); }
.embed .quick { justify-content: flex-start; }
.embed .quick button { height: 34px; font-size: 13px; }
.embed .composer-wrap { padding: 0 var(--s-3) var(--s-3); }
.embed .composer textarea { font-size: 15px; padding: var(--s-3) var(--s-4) var(--s-1); min-height: 52px; }
.embed .msg-ai { font-size: 15px; line-height: 24px; }
.embed .art-card { grid-template-columns: 1fr; gap: var(--s-3); }
.embed .menu { min-width: 220px; }

/* =============================================================== connections */
span.spin:empty { display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; }
.page-narrow { max-width: var(--content-narrow); }
.cx-steps { display: flex; gap: var(--s-6); list-style: none; padding: 0; margin: 0 0 var(--s-6); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.cx-steps li { display: flex; align-items: center; gap: var(--s-2); }
.cx-steps li a { display: inline-flex; align-items: center; gap: var(--s-2); color: inherit; }
.cx-steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: var(--fw-medium); }
.cx-steps li[aria-current] { color: var(--text); font-weight: var(--fw-medium); }
.cx-steps li[aria-current] span { background: var(--primary); color: var(--primary-text); }
.cx-steps li.done span { background: var(--accent-soft); color: var(--accent); }
.cx-filter { display: flex; gap: var(--s-3); align-items: center; margin-bottom: var(--s-8); }
.cx-filter input { max-width: 420px; }
.cx-filter .choice { flex: 0 0 auto; }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-3); }
.cx-card { display: flex; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.cx-card:hover { border-color: color-mix(in srgb, var(--border) 40%, var(--text-2)); background: var(--surface-2); text-decoration: none; }
.cx-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cx-card.disabled { opacity: .55; cursor: not-allowed; }
.cx-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cx-title { display: flex; align-items: center; gap: var(--s-2); font-weight: var(--fw-semibold); font-size: 15px; }
.cx-title .badge { height: 20px; font-size: 11px; }
.cx-desc { color: var(--text-2); font-size: 13px; line-height: 18px; }
.cx-auth { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cx-auth span { font-size: 11.5px; line-height: 18px; padding: 0 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); }
.cx-card:hover .cx-auth span { background: var(--bg); }
.cx-logo { flex: 0 0 auto; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.cx-logo .i { width: 18px; height: 18px; }
.cx-logo.sm { width: 26px; height: 26px; border-radius: 7px; }
.cx-logo.sm .i { width: 14px; height: 14px; }
.cx-logo.lg { width: 48px; height: 48px; border-radius: 12px; }
.cx-logo.lg .i { width: 22px; height: 22px; }
.empty .cx-logo.lg { margin-bottom: var(--s-4); }
.page-title .cx-logo.lg { align-self: center; }
.cx-name { display: inline-flex; align-items: center; gap: var(--s-3); }
.cx-sec { margin-bottom: var(--s-8); }
.cx-sec > h2 { font-size: 17px; line-height: 24px; margin-bottom: var(--s-4); }
.cx-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-3); }
.cx-method { position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--s-4) var(--s-4) var(--s-4) 44px; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.cx-method input { position: absolute; left: 16px; top: 18px; }
.cx-method:hover { background: var(--surface-2); }
.cx-method:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cx-method:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.cx-mhead { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-weight: var(--fw-medium); font-size: 14px; }
.cx-mhead .badge { height: 20px; font-size: 11px; background: var(--bg); }
.cx-mdesc { color: var(--text-2); font-size: 13px; line-height: 18px; }
.cx-mfields { border: 0; padding: 0; margin: 0; min-width: 0; }
.cx-mfields[hidden] { display: none; }
.cx-adv { margin: 0 0 var(--s-5); }
.cx-adv > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; font-weight: var(--fw-medium); color: var(--text-2); list-style: none; padding: 4px 0; }
.cx-adv > summary::-webkit-details-marker { display: none; }
.cx-adv > summary .i { transition: transform var(--dur-fast) var(--ease); }
.cx-adv[open] > summary .i { transform: rotate(90deg); }
.cx-adv > div { padding-top: var(--s-4); }
.cx-lock { display: inline-flex; vertical-align: -2px; color: var(--text-2); }
.cx-errs { margin: 4px 0 0; padding-left: 18px; }
.cx-actions { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.cx-actions .spacer { flex: 1; }
.cx-result { font-size: 14px; color: var(--text-2); max-width: 520px; }
.cx-result.ok { color: var(--accent); }
.cx-result.bad { color: var(--error-text); }
textarea.mono { font-family: var(--font-mono); font-size: 13px; line-height: 19px; }
.cx-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; gap: var(--s-8); align-items: start; }
@media (max-width: 1280px) { .cx-layout { grid-template-columns: 260px minmax(0, 1fr); } .cx-side { grid-column: 1 / -1; } }
@media (max-width: 800px) { .cx-layout { grid-template-columns: 1fr; } }
.cx-browse input { margin-bottom: var(--s-3); }
.cx-res { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow: auto; }
.cx-res li.muted, .cx-res li.cx-err { padding: var(--s-2) var(--s-2); font-size: 14px; }
.cx-res li.cx-err { color: var(--error-text); }
.cx-resbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.cx-resbtn:hover { background: var(--surface-hover); }
.cx-resbtn[aria-current] { background: var(--accent-soft); color: var(--accent); }
.cx-resbtn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cx-rname { word-break: break-all; }
.cx-query { margin-bottom: var(--s-6); }
.cx-query textarea { margin-bottom: var(--s-2); }
.cx-pv { min-height: 120px; }
.cx-tablewrap { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: var(--radius-md); }
.cx-rows { font-size: 13px; }
.cx-rows th { top: 0; background: var(--surface-2); }
.cx-rows td { padding: 8px 12px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.cx-doc { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--s-3); overflow: hidden; }
.cx-dochead { display: flex; flex-wrap: wrap; gap: 4px var(--s-3); align-items: baseline; padding: var(--s-3) var(--s-4); background: var(--surface-2); }
.cx-dochead a { word-break: break-all; }
.cx-text { margin: 0; padding: var(--s-3) var(--s-4); max-height: 320px; overflow: auto; white-space: pre-wrap; font: 13px/20px var(--font-sans); color: var(--text); }
.cx-side .kv { margin: 0 0 var(--s-5); grid-template-columns: max-content minmax(0, 1fr); font-size: 13px; }
.cx-val { word-break: break-all; }
.cx-secret { display: inline-flex; align-items: center; gap: 4px; margin-right: var(--s-2); color: var(--text-2); }
.src-adds { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.srcrow.connrow { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.8fr) minmax(0, 1.2fr) 36px; }
@media (max-width: 700px) { .srcrow.connrow { grid-template-columns: 1fr 36px; } }

/* =============================================================== AI models */
.md-policy { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; }
.md-policy input { margin-top: 3px; flex: 0 0 auto; }
.md-policy:has(input:checked) { border-color: var(--warning); background: var(--warning-soft); }
.md-list { display: flex; flex-direction: column; gap: var(--s-4); margin-bottom: var(--s-3); }
.md-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--s-4); }
.md-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.md-head form { display: inline; }
.md-head .grow { flex: 1; min-width: 200px; }
.md-models { margin-top: var(--s-3); font-size: 13px; }
.md-models th { position: static; }
.md-test { font-size: 14px; margin-top: 8px; color: var(--text-2); }
.md-test:empty { display: none; }
.md-test.ok { color: var(--accent); }
.md-test.bad { color: var(--error-text); }
.md-avail { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 180px; overflow: auto; }
.md-avail .chip { font: 12px var(--font-mono); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.md-avail .chip[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.status-pill.cloud .dot { background: var(--warning); }

/* =============================================================== workflows */
.wf-canvas { position: relative; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); min-height: 260px;
  background-color: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--text-3) 45%, transparent) 1px, transparent 1px); background-size: 20px 20px; }
.wf-inner { position: relative; min-width: 100%; }
.wf-edges { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.wf-edges marker path { fill: var(--text-3); }
.wf-edge { fill: none; stroke: var(--text-3); stroke-width: 1.75; }
.wf-edge.flowed { stroke: var(--accent); }
.wf-edge.sel { stroke: var(--primary); stroke-width: 2.5; }
.wf-edge.temp { stroke: var(--accent); stroke-dasharray: 5 4; }
.wf-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.wf-node { position: absolute; width: 224px; height: 76px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; box-sizing: border-box;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); cursor: pointer; user-select: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.wf-node:hover { border-color: color-mix(in srgb, var(--border) 30%, var(--text-2)); }
.wf-node:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.wf-node.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.wf-node.dragging { cursor: grabbing; box-shadow: var(--shadow-overlay); z-index: 3; }
.wf-node.has-err { border-color: var(--error); }
.wf-ic { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--text); }
.wf-ic .i { width: 17px; height: 17px; }
.t-agent .wf-ic { background: var(--accent-soft); color: var(--accent); }
.t-review_gate .wf-ic { background: var(--warning-soft); color: var(--warning-text); }
.wf-nt { display: flex; flex-direction: column; min-width: 0; line-height: 17px; }
.wf-type { font-size: 11.5px; color: var(--text-2); }
.wf-name { font-size: 14px; font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.wf-meta { font-size: 11.5px; color: var(--text-2); }
.wf-st { position: absolute; top: -9px; right: 12px; font-size: 11px; font-weight: var(--fw-medium); padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.st-running { border-color: var(--accent); }
.st-running .wf-st { background: var(--accent-soft); color: var(--accent); border-color: transparent; animation: pulse 1.4s ease-in-out infinite; }
.st-done .wf-st { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.st-failed, .st-rejected { border-color: var(--error); }
.st-failed .wf-st, .st-rejected .wf-st { background: var(--error-soft); color: var(--error-text); border-color: transparent; }
.st-waiting { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.st-waiting .wf-st { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.st-skipped { opacity: .55; }
.wf-port { position: absolute; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text-3); }
.wf-port.in { top: -7px; }
.wf-port.out { bottom: -7px; cursor: crosshair; }
.wf-port.out:hover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.25); }
.wf-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-size: 14px; padding: 24px; text-align: center; }
@keyframes pulse { 50% { opacity: .55; } }

.wf-builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-5); align-items: start; }
@media (max-width: 1000px) { .wf-builder { grid-template-columns: 1fr; } }
.wf-builder .wf-canvas { height: calc(100vh - 300px); min-height: 420px; }
.wf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.wf-toolbar .wf-add { width: auto; padding: 5px 10px 5px 6px; font-size: 13.5px; }
.wf-tgroup { font-size: 12px; color: var(--text-2); margin: 0 2px 0 4px; }
.wf-tsep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
.wf-palette { display: flex; flex-direction: column; gap: 6px; }
.wf-palette h3 { font-size: 12px; color: var(--text-2); font-weight: var(--fw-medium); margin: 10px 0 2px; text-transform: none; }
.wf-add { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: start; }
.wf-add:hover { background: var(--surface-2); }
.wf-add .wf-ic { width: 28px; height: 28px; }
.wf-inspector { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--s-4); max-height: calc(100vh - 300px); overflow: auto; }
.wf-inspector h2 { font-size: 16px; margin-bottom: 4px; }
.wf-inspector .field { margin-bottom: var(--s-4); }
.wf-inputs { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-inputs .chip { height: 28px; font-size: 13px; }
.wf-top { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-4); }
.wf-top input[name=wf-name] { font-size: 20px; font-weight: var(--fw-semibold); border-color: transparent; background: transparent; padding-left: 4px; max-width: 520px; }
.wf-top input[name=wf-name]:hover { border-color: var(--border); }
.wf-top input[name=wf-name]:focus { border-color: var(--accent); }
.wf-top .spacer { flex: 1; }
.wf-save-state { font-size: 13px; color: var(--text-2); }
.wf-problems { margin: 0 0 var(--s-4); }
.wf-problems ul { margin: 4px 0 0; padding-left: 18px; }
.wf-settings { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-4); }
@media (max-width: 900px) { .wf-settings { grid-template-columns: 1fr; } }
.wf-run { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--s-5); align-items: start; }
@media (max-width: 1100px) { .wf-run { grid-template-columns: 1fr; } }
.wf-run .wf-canvas { height: calc(100vh - 260px); min-height: 380px; }
.wf-panel { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--s-4); max-height: calc(100vh - 260px); overflow: auto; }
.wf-panel h2 { font-size: 17px; margin-bottom: 2px; }
.wf-text { white-space: pre-wrap; font-size: 15px; line-height: 23px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.wf-items { list-style: none; margin: 8px 0 0; padding: 0; }
.wf-items li { border-top: 1px solid var(--border); padding: 8px 0; font-size: 13.5px; line-height: 19px; }
.wf-items .lbl { display: flex; gap: 6px; align-items: baseline; font-weight: var(--fw-medium); font-size: 13px; }
.wf-items .lbl .mono { color: var(--text-2); font-weight: 400; }
.wf-cite { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin: 0 4px 4px 0; }
.wf-cites { margin-top: 6px; }
.wf-cites details { border-top: 1px solid var(--border); padding: 6px 0; font-size: 13px; }
.wf-cites summary { cursor: pointer; }
.wf-review { background: var(--warning-soft); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.wf-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-8); }
.wf-tpl { display: flex; flex-direction: column; gap: 6px; text-align: start; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg);
  font: inherit; color: var(--text); cursor: pointer; }
.wf-tpl:hover { background: var(--surface-2); }
.wf-tpl strong { font-size: 15px; }
.wf-tpl span { color: var(--text-2); font-size: 13px; line-height: 18px; }
.wf-mini { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.wf-mini .wf-ic { width: 22px; height: 22px; border-radius: 6px; }
.wf-mini .wf-ic .i { width: 13px; height: 13px; }
.wf-mini .arr { color: var(--text-3); font-size: 12px; }

/* sidebar settings group */
.sb-group > summary { list-style: none; cursor: pointer; }
.sb-group > summary::-webkit-details-marker { display: none; }
.sb-group .sb-chev { margin-left: auto; display: inline-flex; transition: transform var(--dur-fast) var(--ease); }
.sb-group[open] .sb-chev { transform: rotate(90deg); }
.sb-link.sb-sub { padding-left: 34px; font-size: 14px; }
:root[data-sidebar="collapsed"] .sb-link.sb-sub { padding-left: 0; }

/* =============================================================== slide themes */
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-4); }
.th-card { display: flex; flex-direction: column; gap: 4px; cursor: pointer; position: relative; }
.th-card input { position: absolute; opacity: 0; }
.th-prev { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--border, #ddd);
  box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: box-shadow var(--dur-fast) var(--ease); color: var(--text); font-family: var(--body); }
.th-card.sel .th-prev { box-shadow: 0 0 0 2px var(--app-bg, #fff), 0 0 0 4px #176B68; }
.th-card input:focus-visible + .th-prev { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #176B68; }
.th-prev .th-k { position: absolute; left: 10%; top: 38%; font-size: 7px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); font-weight: 700; }
.th-prev .th-h { position: absolute; left: 10%; top: 46%; font-family: var(--head); font-weight: var(--hw); font-size: 17px; letter-spacing: -.01em; }
.th-prev .th-l { position: absolute; left: 10%; top: 64%; width: 44%; height: 4px; border-radius: 2px; background: var(--text-2); opacity: .5; }
.th-prev .th-l.short { top: 70%; width: 30%; }
.th-prev .th-bars { position: absolute; right: 8%; bottom: 12%; width: 30%; display: flex; flex-direction: column; gap: 4px; }
.th-prev .th-bars i { display: block; height: 7px; border-radius: 2px; background: var(--bar); }
.th-prev .th-bars i:first-child { background: var(--accent); }
.th-prev.cv-split .th-art { position: absolute; right: 0; top: 0; bottom: 0; width: 26%; background: linear-gradient(160deg, var(--accent-raw) 60%, var(--accent2) 60%); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
.th-prev.cv-split .th-bars { right: 32%; }
.th-prev.cv-fullbleed, .th-prev.cv-gradient { background: var(--cover-bg); color: var(--on-cover); }
.th-prev.cv-gradient { background: linear-gradient(135deg, var(--cover-bg), color-mix(in srgb, var(--accent-raw) 70%, var(--cover-bg))); }
.th-prev.cv-fullbleed .th-k, .th-prev.cv-gradient .th-k { color: var(--accent2); }
.th-prev.cv-fullbleed .th-l, .th-prev.cv-gradient .th-l { background: var(--on-cover); }
.th-prev.cv-fullbleed .th-art { position: absolute; left: 10%; right: 10%; top: 22%; height: 2px; background: var(--accent2); }
.th-prev.cv-gradient .th-bars i { background: color-mix(in srgb, var(--on-cover) 55%, transparent); }
.th-prev.cv-gradient .th-bars i:first-child { background: var(--accent2); }
.th-prev.cv-minimal .th-art { position: absolute; right: 8%; top: 12%; width: 18%; aspect-ratio: 1; background: var(--accent-raw); }
.th-prev.cv-rule .th-art { position: absolute; left: 0; top: 0; bottom: 0; width: 4%; background: var(--accent-raw); }
.th-prev.cv-editorial .th-art { position: absolute; left: 8%; right: 8%; top: 12%; height: 6px; border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); }
.th-prev.cv-editorial .th-h { font-size: 21px; }
.th-prev.cv-band .th-art { position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: var(--accent-raw); border-radius: 50% 50% 0 0 / 40% 40% 0 0; box-shadow: 0 -5px 0 var(--accent2) inset; }
.th-prev.cv-band .th-bars { bottom: 30%; }
.th-name { font-weight: var(--fw-semibold); font-size: 14.5px; margin-top: 6px; }
.th-vibe { font-size: 12.5px; color: var(--text-2, #71717A); line-height: 17px; }
.clr { display: flex; gap: 8px; align-items: center; }
.clr input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); }
.clr input[type=text] { font-family: var(--font-mono); max-width: 140px; }
.logo-prev { display: inline-flex; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.logo-prev img { height: 32px; width: auto; }
.dlg.wide { width: min(1040px, calc(100vw - 32px)); }
.dlg .th-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); max-height: 60vh; overflow: auto; padding: 4px; }

/* add-node panel, rows editor, code */
.wf-addbar { display: flex; align-items: center; gap: var(--s-4); margin-bottom: 10px; flex-wrap: wrap; }
.wf-addwrap { position: relative; }
.wf-addpanel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 420px; max-height: 70vh; display: flex; flex-direction: column;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-overlay); padding: 10px; }
.wf-addpanel input[type=search] { margin-bottom: 8px; }
.wf-addlist { overflow: auto; }
.wf-addgrp { font-size: 12px; color: var(--text-2); font-weight: var(--fw-medium); padding: 10px 6px 4px; }
.wf-additem { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; text-align: start; font: inherit; color: var(--text); cursor: pointer; }
.wf-additem:hover, .wf-additem:focus-visible { background: var(--surface-hover); outline: none; }
.wf-additem .wf-ic { width: 30px; height: 30px; flex: 0 0 auto; }
.wf-addtx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wf-addtx strong { font-size: 14px; font-weight: var(--fw-medium); }
.wf-addtx span { font-size: 12.5px; color: var(--text-2); line-height: 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wf-addfoot { border-top: 1px solid var(--border); padding: 8px 6px 2px; margin-top: 6px; }
.wf-rows { display: flex; flex-direction: column; gap: 6px; }
.wf-row { display: grid; grid-template-columns: 1fr 1fr 1fr 32px; gap: 6px; align-items: center; }
.wf-row input, .wf-row select { min-height: 34px; padding: 5px 8px; font-size: 13.5px; }
.wf-row select { padding-right: 26px; background-position: right 6px center; }
.wf-code { font-size: 12.5px; line-height: 18px; tab-size: 4; white-space: pre; }
.t-code .wf-ic, .t-http_request .wf-ic { background: var(--surface-sunken); }
.t-filter .wf-ic, .t-sort .wf-ic, .t-limit .wf-ic, .t-edit_fields .wf-ic, .t-dedupe .wf-ic, .t-summarize .wf-ic, .t-merge .wf-ic, .t-template .wf-ic { background: #EEF2FF; color: #3730A3; }
.t-extract_fields .wf-ic { background: var(--accent-soft); color: var(--accent); }
.t-if .wf-ic { background: var(--warning-soft); color: var(--warning-text); }
.t-presentation .wf-ic, .t-export_csv .wf-ic { background: var(--accent-soft); color: var(--accent); }
:root[data-theme="dark"] .t-filter .wf-ic, :root[data-theme="dark"] .t-sort .wf-ic { background: #1E2140; color: #A5B4FC; }
.wf-row.p4 { grid-template-columns: 1fr 1.2fr 1fr 110px 32px; }

/* =============================================================== axioms */
.ax-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-3); margin-bottom: var(--s-6); }
@media (max-width: 900px) { .ax-stats { grid-template-columns: repeat(2, 1fr); } }
.ax-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); background: var(--bg); }
.ax-stat:hover { background: var(--surface-2); text-decoration: none; }
.ax-stat .v { font-size: 30px; font-weight: var(--fw-semibold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ax-stat .k { font-size: 14px; font-weight: var(--fw-medium); }
.ax-stat .s { font-size: 12.5px; color: var(--text-2); }
.ax-stat.warn { border-color: var(--warning); background: var(--warning-soft); }
.ax-search { display: flex; gap: 8px; margin-bottom: 18px; max-width: 520px; }
.ax-co { margin-bottom: 26px; }
.ax-co h2 a { color: var(--text); }
.ax-table td.ax-val { font-weight: var(--fw-medium); }
.ax-list { display: flex; flex-direction: column; gap: 10px; }
.ax-dispute, .ax-stale { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); }
.ax-dispute:hover { background: var(--surface-2); text-decoration: none; }
.ax-dispute .grow, .ax-stale .grow { flex: 1; min-width: 0; }
.ax-vs { display: flex; gap: 22px; margin: 4px 0; font-size: 14px; }
.ax-changes { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; line-height: 24px; }
.ax-changes li { margin-bottom: 4px; }
.ax-bigscore { display: flex; align-items: baseline; gap: 14px; margin: 14px 0 22px; }
.ax-bigscore .v { font-size: 44px; font-weight: var(--fw-semibold); }
.ax-bigscore .k { color: var(--text-2); }
.ax-bar { display: inline-block; vertical-align: middle; width: 220px; height: 10px; border-radius: 5px; background: var(--surface-sunken); overflow: hidden; margin-right: 10px; }
.ax-bar i { display: block; height: 100%; background: var(--accent); }
.ax-bar i.low { background: var(--warning); }
.ax-pct { font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); }
.ax-head { padding: 22px 26px; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 26px; background: linear-gradient(180deg, var(--accent-soft), var(--bg) 70%); }
.ax-value { font-size: 40px; font-weight: var(--fw-semibold); letter-spacing: -.02em; margin: 6px 0 10px; line-height: 1.1; }
.ax-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.ax-chain { list-style: none; margin: 0; padding: 0; position: relative; }
.ax-chain::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px; background: var(--border); }
.ax-chain li { position: relative; display: flex; gap: 16px; padding: 0 0 22px; }
.ax-chain li > div { min-width: 0; font-size: 14.5px; line-height: 22px; }
.ax-dot { position: relative; z-index: 1; flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.ax-dot.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.ax-h { font-weight: var(--fw-semibold); margin-bottom: 2px; }
.ax-quote, .ax-corr blockquote, .ax-cmp blockquote { margin: 6px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 15px; }
.ax-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ax-corr, .ax-uses, .ax-hist { padding-left: 18px; margin: 0; font-size: 14.5px; line-height: 24px; }
.ax-corr li, .ax-uses li { margin-bottom: 10px; }
.ax-hist li.cur a { font-weight: var(--fw-semibold); }
.ax-disp { border: 1px solid var(--warning); background: var(--warning-soft); border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 26px; }
.ax-disp h2 { font-size: 17px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.ax-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 12px 0 16px; }
.ax-cmp .v { font-size: 24px; font-weight: var(--fw-semibold); margin: 4px 0; }
.ax-resolve .field { max-width: 560px; }
.ax-panel { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 18px; margin: 0 0 20px; }
.ax-panel.warn { border-color: var(--warning); background: var(--warning-soft); }
.ax-panel summary { cursor: pointer; font-weight: var(--fw-medium); }
.ax-panel ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; line-height: 24px; }

/* sidebar groups */
.sb-nav { display: flex; flex-direction: column; }
.sb-nav .sb-label { padding-top: var(--s-4); }
.sb-scroll .sb-label:first-child { padding-top: var(--s-5); }
.sb-scroll { border-top: 1px solid var(--border); margin-top: var(--s-4); }
.sb-settings { margin-bottom: 4px; }
html[data-sidebar="collapsed"] .sb-scroll { border-top: 0; }

/* impact */
.imp-filter { display: flex; gap: var(--s-2); align-items: center; }
.imp-filter select { width: auto; }
.imp-h2 { font-size: 15px; font-weight: var(--fw-semibold); margin: var(--s-8) 0 var(--s-2); }
.imp-how { margin-top: var(--s-8); color: var(--text-2); font-size: 14px; max-width: 760px; }
.imp-how summary { cursor: pointer; color: var(--text); font-weight: var(--fw-medium); }
.imp-how p { margin: var(--s-3) 0 0; }
.imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-4); }
.imp-money { display: flex; gap: var(--s-2); }
@media (max-width: 560px) { .imp-grid { grid-template-columns: 1fr; } .imp-filter { flex-wrap: wrap; } }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.imp-scroll { overflow-x: auto; }
.imp-scroll .table th { position: static; }
@media (max-width: 560px) { .imp-hide-sm { display: none; }
  /* phone header: buttons show their icon only (the text stays as their accessible name); the title keeps some room */
  .ctx-header > .btn, .ctx-header > .pop > summary.btn { font-size: 0; gap: 2px; padding-inline: 8px; }
  .ctx-header .crumbs { min-width: 72px; }
  .roi-costs .roi-bands { grid-template-columns: 1fr; }
  .roi-costs .roi-band { grid-template-columns: minmax(0, 1fr) 72px 72px; }
  .roi-costs .roi-band input { min-width: 0; width: 100%; }
  /* the run's "where it ran" menu opens leftwards so it stays on screen */
  .page-title .pop > .menu.down { left: auto; right: 0; max-width: calc(100vw - 32px); } }
.subject-pick select { width: auto; min-width: 220px; }

/* cross-check */
.xc-ok { color: var(--text-2); }
.xc-diff { color: var(--warning-text); font-weight: var(--fw-medium); }
.xc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.xc-list li { line-height: 1.4; }
.xc-list .caption { margin-top: 2px; }

/* matrix bar and currency conversion */
.matrix-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: 12px; }
.fx-pick { display: flex; align-items: center; gap: var(--s-2); }
.fx-pick select { width: auto; height: 32px; padding-block: 0; }
.fx-orig { font-style: normal; }
.check.reuse { margin: 0 0 12px; font-size: 13px; color: var(--text-2); align-items: flex-start; }

/* web search status */
.ws-now { display: flex; gap: var(--s-3); align-items: flex-start; margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--radius-md); background: var(--accent-soft); }
.ws-now.warn { background: var(--warning-soft); }
.ws-now svg { margin-top: 3px; }
.ws-adv > summary { cursor: pointer; font-weight: var(--fw-medium); }
.plan-row { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); flex-wrap: wrap; }

/* fact-check */
.fc-upload { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s-5); margin-bottom: var(--s-8); }
.fc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 4px; vertical-align: baseline; }
.fc-counts { font-size: 13px; color: var(--text-2); display: inline-flex; gap: 10px; align-items: center; }
.v-verified { --fc: var(--accent); } .v-contradicted { --fc: var(--error-text); } .v-explained { --fc: var(--warning-text); }
.v-not_found { --fc: var(--text-3); } .v-forecast { --fc: var(--text-2); }
.fc-dot { background: var(--fc); }
.fc-split { grid-template-columns: minmax(0, 1fr) 380px; }
.fc-doc { font-size: 15px; line-height: 1.7; max-width: 72ch; }
.fc-doc p { margin: 0 0 var(--s-4); }
.fc-mark { color: inherit; text-decoration: none; border-bottom: 2px solid var(--fc); background: color-mix(in srgb, var(--fc) 9%, transparent); border-radius: 2px; }
.fc-mark:hover { background: color-mix(in srgb, var(--fc) 18%, transparent); text-decoration: none; }
.fc-mark sup { font-size: 10px; color: var(--fc); font-weight: var(--fw-semibold); margin-inline-start: 2px; }
.fc-rail { display: flex; flex-direction: column; gap: var(--s-3); position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
.fc-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--s-3); scroll-margin-top: 90px; }
.fc-card:target { border-color: var(--accent); }
.fc-head { display: flex; align-items: center; gap: 8px; }
.fc-no { font-size: 12px; color: var(--text-2); min-width: 18px; }
.fc-badge { color: var(--fc); background: color-mix(in srgb, var(--fc) 10%, transparent); }
.fc-ev { margin: 6px 0 0; padding: 6px 10px; border-inline-start: 2px solid var(--border); font-size: 13px; color: var(--text-2); }
.fc-ev.agrees { border-color: var(--accent); } .fc-ev.differs { border-color: var(--warning-text); }
.fc-ev div { margin-top: 2px; }
@media (max-width: 1000px) { .fc-split { grid-template-columns: 1fr; } .fc-rail { position: static; max-height: none; } }
.v-unchecked { --fc: var(--text-3); }
.fc-mark.v-unchecked { border-bottom-style: dashed; background: transparent; }
.fc-more { margin-top: 6px; } .fc-more summary { cursor: pointer; }
.fc-mark { padding: 0 1px; font-weight: var(--fw-medium); }
.translation { margin: 8px 0 0; font-size: 14px; color: var(--text-2); }
.translation .badge { margin-inline-end: 6px; }

/* ---- Check: front door and model check (D47) ---- */
.ck-zone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 24px; border: 1.5px dashed var(--border-strong, var(--border)); border-radius: var(--radius-lg); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.ck-zone:hover, .ck-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.ck-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ck-zone:focus-within { box-shadow: var(--focus-ring); }
.ck-icon .i { width: 28px; height: 28px; color: var(--accent); }
.ck-main { font-weight: var(--fw-semibold); font-size: 16px; }
.ck-sub { color: var(--text-2); font-size: 13px; max-width: 520px; }
.ck-row { display: flex; gap: 8px; margin-top: 12px; }
.ck-row input { flex: 1; min-width: 0; }
.mc-verdict { font-size: 17px; line-height: 27px; max-width: 820px; margin: 0 0 20px; }
.mc-h3 { font-size: 14px; margin: 24px 0 4px; color: var(--text-2); font-weight: var(--fw-medium); }
.mc-table { margin-top: 8px; font-size: 13px; }
.mc-table summary { cursor: pointer; color: var(--text-2); }
.mc-whatif { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.mc-sim .mc-whatif { width: 96px; }
.mc-infl { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.mc-infl span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.mc-scbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.mc-scbar input[type=text] { width: 260px; max-width: 100%; }
.mc-th { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.mc-notes { margin: 0; padding-left: 18px; color: var(--text-2); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; }
.linkish:focus-visible { box-shadow: var(--focus-ring); border-radius: 6px; }
.ev-proven { color: var(--success); background: var(--success-soft); }
.ev-contradicted { color: var(--error-text); background: var(--error-soft); }
.ev-assumption { color: var(--warning-text); background: var(--warning-soft); }
.ev-unchecked { color: var(--text-2); background: var(--surface-2); }
.t-up { color: var(--success); } .t-down { color: var(--error-text); } .t-error { color: var(--error-text); }
.chart { width: 100%; max-width: 760px; height: auto; display: block; font-family: inherit; }
.chart .ch-label { font-size: 12px; fill: var(--text); }
.chart .ch-val { font-size: 11px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.chart .ch-muted { font-size: 11px; fill: var(--text-2); }
.chart .ch-lo, .ch-legend .ch-lo { fill: #8C98A8; background: #8C98A8; }
.chart .ch-hi, .ch-legend .ch-hi { fill: var(--accent); background: var(--accent); }
.chart .ch-base { stroke: var(--text); stroke-width: 1.5; }
.chart .ch-bar { fill: var(--accent); opacity: .85; }
.chart .ch-axis { stroke: var(--border); }
.chart .ch-mark { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ch-threshold { stroke: var(--error); stroke-width: 1.5; }
.chart rect:hover { opacity: 1; filter: brightness(1.08); }
.ch-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin: 4px 0 8px; }
.ch-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 640px) { .ck-row { flex-direction: column; } .mc-whatif { width: 84px; } }
#issues .row-item .title { white-space: normal; overflow: visible; text-overflow: clip; }
.ch-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .ctx-header .crumbs { overflow: hidden; flex: 1 1 auto; }
  .ctx-header .crumbs a, .ctx-header .crumbs .sep { display: none; }
  .ctx-header { padding-inline: var(--s-4); gap: var(--s-2); }
  .ch-scroll .chart { min-width: 560px; }
}
.mc-verify { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.mc-verify input[type=text] { width: 320px; max-width: 100%; }
.mc-verify .caption { flex-basis: 100%; }
.mc-evnote { max-width: 280px; margin-top: 4px; }
.ck-about { margin-top: 16px; }
.ck-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.ck-actions .btn { max-width: 100%; }
.ck-actions .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .ck-actions .btn { width: 100%; justify-content: center; } }
.ws-fns { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 6px 0 4px; }
.eng-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.eng-add .grow { flex: 1 1 320px; }
.eng-add .btn { margin-bottom: 16px; }
.eng-wrap { white-space: normal; }
.eng-cmp { max-width: 720px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.roi-people tr.roi-detail td { padding-top: 0; border-top: 0; }
.roi-people tr.roi-detail summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.roi-tip { display: flex; gap: 6px; align-items: flex-start; color: var(--warning-text); max-width: 760px; }
.roi-ex { margin: 0; padding-left: 0; list-style: none; font-size: 13px; }
.roi-ex li { margin: 4px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.roi-notice { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px;
  max-width: min(720px, calc(100% - 32px)); padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--surface-raised, var(--bg));
  border: 1px solid var(--border); box-shadow: var(--shadow-overlay); font-size: 13px; color: var(--text-2); }
.roi-notice a { color: var(--accent); }
.roi-rng { display: block; font-size: 12px !important; color: var(--text-2); font-weight: var(--fw-regular); margin: 0 !important; letter-spacing: 0; }
.roi-stats .val small.roi-rng { margin-inline-start: 0; }
.roi-evidence { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 13px; color: var(--text-2); padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; margin: 4px 0 8px; }
.roi-evidence .i { vertical-align: -2px; }
.roi-note { margin: 0 0 16px; }
.roi-g-measured { color: var(--success); background: var(--success-soft); }
.roi-g-calibrated { color: var(--accent); background: var(--accent-soft); }
.roi-g-reported { color: var(--warning-text); background: var(--warning-soft); }
.roi-g-assumed { color: var(--text-2); background: var(--surface-2); }
.roi-bands { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px 16px; align-items: end; }
.roi-band { display: grid; grid-template-columns: minmax(120px, 1fr) 92px 92px; gap: 8px; }
.roi-json { max-width: 280px; word-break: break-word; }
.roi-match { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.roi-match select { width: auto; max-width: 340px; }
.roi-study { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 8px; }
.roi-study .grow { flex: 1 1 260px; }
.roi-study .btn { margin-bottom: 16px; }
.roi-study.running { align-items: center; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); margin-bottom: 16px; }
.roi-study.running .btn { margin-bottom: 0; }
.roi-clock { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: var(--fw-semibold); min-width: 70px; color: var(--accent); }
.roi-ask { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: min(440px, calc(100% - 32px)); padding: 16px 40px 14px 16px; border-radius: 14px;
  background: var(--surface-raised, var(--bg)); border: 1px solid var(--border); box-shadow: var(--shadow-overlay); }
.roi-ask-q { font-weight: var(--fw-medium); margin-bottom: 10px; line-height: 1.4; }
.roi-ask-row { display: flex; flex-wrap: wrap; gap: 6px; }
.roi-ask-x { position: absolute; top: 8px; right: 8px; font-size: 18px; }
.roi-trend { display: flex; align-items: flex-end; gap: 6px; height: 130px; margin: 8px 0 12px; flex-wrap: wrap; }
.roi-trend .caption { flex-basis: 100%; margin: 0; }
.roi-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 40px; height: 110px; font-size: 11px; color: var(--text-2); }
.roi-bar span { width: 26px; background: var(--accent); border-radius: 4px 4px 0 0; }
.roi-bar em { font-style: normal; margin-top: 4px; }
.roi-key { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); user-select: all; word-break: break-all; }
.roi-code { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 12px; overflow-x: auto; }
