@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
:root {
  /* Headronist bridge: harness vars carry headronist.css light values (:154). */
  --ground: #f5f6f8;
  --surface: #ffffff;
  --well: #eceef2;
  --line: #e1e4ea;
  --line-strong: #7f8796;
  --text: #07080a;
  --body: #262a33;
  --muted: #434957;
  --accent: #2446a8;
  --accent-soft: #eef1f7;
  --primary-bg: #2446a8;
  --primary-hover: #1c3a8e;
  --primary-fg: #ffffff;
  --pass: #0f5c3d;
  --pass-bg: #eaf6f0;
  --fail: #991f1f;
  --fail-bg: #fdeeee;
  --skip: #7a4600;
  --skip-bg: #fbf4e4;
  --chrome-top: #edf0f8;
  /* Select chevron in --muted; a data URI cannot read a var, so each theme pins its own. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23434957' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --track: #eef0f4;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --t-xs: 12px; --t-sm: 13px; --t-md: 14px; --t-lg: 15px; --t-xl: 17px; --t-2xl: 20px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  /* Headronist bridge: dark values from headronist.css:11-50. */
  --ground: #101216;
  --surface: #181b21;
  --well: #242930;
  --line: #303640;
  --line-strong: #6b768c;
  --text: #e8ebf1;
  --body: #d9dde6;
  --muted: #a7afbe;
  --accent: #a5bfff;
  --accent-soft: #232f48;
  --primary-bg: #3266dc;
  --primary-hover: #2959c5;
  --primary-fg: #ffffff;
  --pass: #3ecf7a;
  --pass-bg: #13291e;
  --fail: #ff9c8f;
  --fail-bg: #2e1717;
  --skip: #f5b83d;
  --skip-bg: #2b2110;
  --chrome-top: #1f2431;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a7afbe' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --track: #1d2025;
}

/* Harness v2: one surface, hairline sections, dense tables. No shadows,
   gradients, glows or pills. Every interactive target is >= 44px. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
[data-theme="dark"] .theme-moon,
:root:not([data-theme="dark"]) .theme-sun { display: none; }
html, body {
  margin: 0;
  max-width: 100%;
  height: 100%;
  overflow-x: clip;
  overscroll-behavior: none;
  background: var(--surface);
  color: var(--text);
  font: var(--t-md)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.92em; overflow-wrap: anywhere; }
/* No line ends on one word or a split letter: headings balance, prose pretty. */
h1, h2, h3, h4, summary, label, button, .btn { text-wrap: balance; }
p, li, dd, td, .lead { text-wrap: balance; hyphens: manual; }
svg.i { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono, .u-mono16 { font-family: var(--mono); }
.u-mono16, .u-fs16 { font-size: var(--t-lg); }
.u-ic24 { width: 20px; height: 20px; }
.u-measure { max-width: 72ch; }
.u-p0 { padding: 0; }
.u-pad-inset { padding: 0 0 8px; }
.u-tap { min-height: 44px; }
.u-tap-inline { display: inline-flex; align-items: center; min-height: 44px; }
.u-flat-pb { padding: 0; border: 0; background: none; }
.u-subhead { font-size: var(--t-md); font-weight: 600; }
.u-meta { font-size: var(--t-xs); color: var(--muted); }
.u-stack16 { display: flex; flex-direction: column; gap: 16px; }
.sub-gap { margin-top: 16px; }
.txt-line, .txt-chunk { display: inline; }

/* Access (signed-out) */
.access { height: 100%; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: var(--surface); color: var(--text); }
.access-rail { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.access-rail .access-exit { margin-left: auto; }
.access-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-weight: 600; text-decoration: none; }
.access-brand svg { width: 24px; height: 24px; }
.access-main { display: grid; place-items: center; padding: 32px 20px; min-height: 0; overflow-y: auto; }
.access-panel { width: min(100%, 960px); }
.access-label { color: var(--muted); font-size: var(--t-sm); font-weight: 500; margin-bottom: 8px; }
.access h1 { font-size: var(--t-2xl); line-height: 1.15; letter-spacing: -0.02em; }
.access-intro { margin-top: 12px; color: var(--body); font-size: var(--t-lg); }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.access-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; }
.access-exit { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: var(--t-sm); font-weight: 500; cursor: pointer; }
.access-exit:hover { background: var(--well); color: var(--text); }
.access-actions .access-primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.access-actions .access-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.access-docs { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--t-lg); }
.access-docs a { display: inline-flex; align-items: center; min-height: 44px; }
.access-state { color: var(--muted); }
.access-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 48px; align-items: center; }
.access-pillars { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.access-pillars li { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--t-md); color: var(--body); }
.access-pillars b { color: var(--text); font-weight: 600; }
.access-card { padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.access-card h2 { font-size: var(--t-xl); font-weight: 600; margin-bottom: 16px; }
.access-providers { display: grid; gap: 8px; }
.access-provider { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.access-provider:hover { background: var(--well); }
.access-provider:first-child { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.access-provider:first-child:hover { background: var(--primary-hover); }
.access-providers-empty { color: var(--muted); font-size: var(--t-md); }
.access-card .access-actions { margin-top: 16px; }
.access-actions .access-secondary { border-color: var(--line); color: var(--body); font-weight: 500; }

/* Workspace rail. The phone drawer uses the same navigation. */
.harness-frame { container: harness / inline-size; height: 100dvh; min-width: 0; overflow: hidden; }
.app { position: relative; --rail-width: 224px; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); height: 100%; width: 100%; min-height: 0; }
.app[data-compact="true"] { --rail-width: 68px; }
.app > main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ground); }
.topbar { display: flex; flex-direction: column; min-height: 0; gap: 28px; padding: 14px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.rail-toggle { flex: none; display: grid; place-items: center; min-height: 44px; width: 44px; background: none; color: var(--muted); border: 0; border-radius: 6px; cursor: pointer; }
.mobile-nav { display: none; }
#nav-drawer { margin: 0; inset: 0 auto 0 0; width: min(288px, 86vw); height: 100dvh; max-height: none; padding: 8px 12px 24px; border: 0; border-right: 1px solid var(--line); color: var(--text); background: var(--surface); }
#nav-drawer::backdrop { background: rgb(0 0 0 / 44%); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding-left: 12px; margin-bottom: 20px; }
@container harness (max-width: 360px) { .brand #brand-mode-sub { display: none; } }
.rail-toggle:hover { color: var(--text); background: var(--well); }
.brand { display: flex; flex: none; align-items: center; gap: 10px; min-height: 44px; padding-right: 4px; color: var(--text); text-decoration: none; }
.brand svg { flex: none; width: 24px; height: 24px; }
.brand div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.brand b { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.01em; }
.brand small { color: var(--muted); font-size: var(--t-xs); }
.brand small.is-plan { align-self: center; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; letter-spacing: 0.02em; }
.topnav, .topnav .menu { display: grid; align-content: start; gap: 2px; min-width: 0; }
.topnav { gap: 22px; overflow-y: auto; }
.topnav .menu-heading { padding: 0 12px 4px; color: var(--muted); font-size: var(--t-xs); font-weight: 500; }
.nav-btn { display: flex; align-items: center; text-align: left; gap: 12px; min-height: 44px; min-width: 0; padding: 0 12px; border: 0; border-radius: 7px; color: var(--body); background: none; font: 500 var(--t-md) var(--sans); cursor: pointer; }
.topbar .brand { padding: 0 8px; }
.topbar .brand svg { width: 28px; height: 28px; }
.topbar .brand div { align-items: start; flex-direction: column; gap: 1px; line-height: 1.25; }
.app[data-compact="true"] .brand div, .app[data-compact="true"] .menu-heading { display: none; }
.app[data-compact="true"] .nav-btn { justify-content: center; gap: 0; font-size: 0; }
.app[data-compact="true"] .topbar-right { flex-direction: column; }

.nav-btn svg.i { color: currentColor; }
.nav-btn:hover { background: var(--well); color: var(--text); }
.nav-btn.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-btn.on svg.i { color: var(--accent); }
.avatar { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--text); font: 600 var(--t-xs) var(--sans); }
.avatar:empty::before { content: "H"; color: var(--accent); font-weight: 600; }
#top-avatar { width: 44px; height: 44px; font-size: var(--t-md); cursor: pointer; }
#top-avatar:hover { border-color: var(--accent); }
.topbar-right { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; display: flex; flex-shrink: 0; align-items: center; gap: 6px; }

.pagebar { --gutter: max(32px, calc((100% - 1200px) / 2)); flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; min-height: 48px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-head { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; }
.topbar-title { font-size: var(--t-md); font-weight: 600; white-space: nowrap; }
.topbar-sep { flex: none; width: 1px; height: 14px; background: var(--line-strong); }
.topbar-context { color: var(--muted); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtabs { display: flex; margin-left: auto; align-self: stretch; }
.subtabs[hidden], .subtab-group[hidden] { display: none; }
.subtab-group { display: flex; gap: 4px; }
.subtab { min-height: 47px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 500 var(--t-sm)/1 var(--sans); cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.subtab:hover { color: var(--text); }
.subtab[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.theme-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.theme-btn:hover { background: var(--well); color: var(--text); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.site-language { position: relative; }
.site-language summary { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 8px; color: var(--muted); font-size: var(--t-sm); font-weight: 600; list-style: none; cursor: pointer; }
.site-language summary:hover { background: var(--well); color: var(--text); }
.site-language summary::-webkit-details-marker { display: none; }
.site-language-menu { position: absolute; bottom: 100%; left: 0; z-index: 20; width: 200px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.site-language-menu p { margin: 4px 8px; color: var(--muted); font-size: var(--t-xs); }
.site-language-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--text); text-decoration: none; }
.site-language-menu a:hover { background: var(--well); }
.site-language:not([open]) .site-language-menu { display: none; }

.body { flex: 1 1 0%; min-height: 0; width: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 28px; padding: 32px max(28px, calc((100% - 960px) / 2)) 56px; scrollbar-width: thin; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.body > * { min-width: 0; }
.body a:not(.btn) { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.framebar { flex: none; display: flex; align-items: center; gap: 12px; min-height: 28px; padding: 0 max(32px, calc((100% - 1200px) / 2)); border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: var(--t-xs); }
.framebar-state { color: var(--text); font-weight: 500; }
.framebar-build { margin-left: auto; font-family: var(--mono); font-size: var(--t-xs); }

/* View head: title + state on one line */
.view-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.view-head > div { min-width: 0; }
.view-head h2 { font-size: var(--t-2xl); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.view-lead { margin-top: 2px; color: var(--muted); font-size: var(--t-md); }
.state-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 500 var(--t-xs) var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums; }
.state-label::before { content: ""; width: 6px; height: 6px; background: var(--line-strong); }
.plan-tag { color: var(--muted); font: 500 var(--t-xs) var(--sans); font-variant-numeric: tabular-nums; }

/* Sections: hairline rule + heading row, no boxes */
.surface-block, .surface-flush, .pipeline-card, .advanced-details, .empty-state, .signin-gate, .detail-pane, .master-pane { min-width: 0; }
.surface-block, .pipeline-card { display: grid; gap: 10px; align-content: start; }
.surface-flush { display: grid; }
.surface-block + .surface-block, .surface-flush + .surface-block, .surface-block + .surface-flush, .surface-flush + .surface-flush { padding-top: 24px; border-top: 1px solid var(--line); }
.section-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 44px; }
.section-bar h3, .section-bar h4 { font-size: var(--t-lg); font-weight: 600; }
.acct-section-title, .step-title, .run-title { font-size: var(--t-lg); font-weight: 600; line-height: 1.35; }
h4.acct-section-title { font-size: var(--t-md); }
.acct-section-desc { color: var(--muted); font-size: var(--t-lg); }
.step-lead, .meta-note, .key-status, .connect-note, .detail-sub, .acct-note { color: var(--muted); font-size: var(--t-sm); }
.step-lead + .code-wrap { margin-top: 4px; }
.acct-note { font-size: var(--t-sm); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions, .acct-actions, .free-actions, .toolbar, .filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-bar { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Buttons */
.btn, .table-action, .copy-btn, .btn-connect, .btn-plan-flip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: var(--t-sm); font-weight: 500; line-height: 1.2; transition: background 0.15s, border-color 0.15s, color 0.15s; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover, .table-action:hover, .copy-btn:hover, .btn-connect:hover, .btn-plan-flip:hover { background: var(--well); border-color: var(--line-strong); }
.btn.primary, .btn-connect.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.btn.primary:hover, .btn-connect.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--well); color: var(--text); }
.btn.danger { border-color: var(--fail); color: var(--fail); }
.btn.danger:hover { background: var(--fail-bg); border-color: var(--fail); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; cursor: not-allowed; }
#receipts-pagination .btn[aria-disabled="true"] { pointer-events: none; }
.table-action { min-width: 44px; padding: 0 10px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font-size: var(--t-sm); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; cursor: pointer; }
.copy-btn { min-width: 64px; padding: 0 10px; }

/* Inputs */
.search-input, .select-input, .pair-input { min-height: 44px; width: 100%; max-width: 360px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: var(--t-md); }
.pair-input { max-width: 200px; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
/* One select treatment: the native arrow sat at the OS's own inset and
   ignored our padding, so it drifted off-centre in 44px boxes. Draw it. */
.select-input, .chat-field select, .chat-runtime { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: var(--select-chevron); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; text-overflow: ellipsis; }
@media (forced-colors: active) { .select-input, .chat-field select, .chat-runtime { appearance: auto; -webkit-appearance: auto; background-image: none; padding-right: 12px; } }
.pair-row, .pair-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Tabs: underline, not pills */
.seg-tabs, .ws-mode-tabs { display: flex; flex-wrap: wrap; gap: 0 4px; max-width: 100%; border-bottom: 1px solid var(--line); }
.ws-mode-tabs { margin: 4px 0 8px; }
.seg-tab, .ws-mode-tab { min-width: 44px; min-height: 44px; margin-bottom: -1px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: var(--t-sm); font-weight: 500; white-space: nowrap; cursor: pointer; }
.seg-tab:hover, .ws-mode-tab:hover { color: var(--text); }
.seg-tab.active, .ws-mode-tab.active { border-bottom-color: var(--text); color: var(--text); font-weight: 600; }
.ws-mode-tabs.agent-tabs { gap: 4px; border: 0; }
.agent-tabs .ws-mode-tab { margin: 0; padding-inline: 12px; border: 1px solid transparent; border-radius: 6px; }
.agent-tabs .ws-mode-tab.active { background: var(--accent-soft); color: var(--accent); }
.ws-mode-tabs.kind-tabs { max-width: 320px; }
.ws-mode-tabs.kind-tabs .ws-mode-tab { flex: 1 1 0; }
.ws-mode-tab { min-width: 0; text-align: center; }
.plan-flip-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.plan-flip-label { color: var(--muted); font-size: var(--t-sm); }
.plan-flip-buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.btn-plan-flip.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }

/* Tables */
.rtable-wrap { width: 100%; overflow: hidden; border-top: 1px solid var(--line); }
.rtable, .data-table, .check-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.rtable th, .data-table th, .check-table th { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--t-xs); font-weight: 500; text-align: left; white-space: nowrap; }
.rtable td, .data-table td, .check-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); color: var(--body); vertical-align: middle; overflow-wrap: break-word; }
.rtable tr:last-child td, .data-table tr:last-child td, .check-table tr:last-child td { border-bottom: 0; }
.rtable tbody tr:hover td, .data-table tbody tr:hover td { background: var(--ground); }
.row-link { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font-family: inherit; font-size: var(--t-sm); font-weight: 600; text-align: left; cursor: pointer; }
.row-link:hover { color: var(--accent, var(--text)); text-decoration: underline; text-underline-offset: 3px; }
.row-link:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 2px; border-radius: 2px; }
.row-sub { display: block; color: var(--muted); font-size: var(--t-xs); }
.data-table td.num { font-variant-numeric: tabular-nums; }

/* Verdicts: colored mono text, no pill */
.verdict-text, .receipt-row .u, .cap-state, .app-status-badge { font: 600 var(--t-xs) var(--sans); letter-spacing: 0.02em; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.pass { color: var(--pass); }
.fail { color: var(--fail); }
.skip { color: var(--skip); }
.neutral { color: var(--muted); }

/* Summary strip: inline stats */
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-cell { display: grid; gap: 2px; padding: 10px 16px 10px 0; min-width: 0; }
.summary-cell + .summary-cell { padding-left: 16px; border-left: 1px solid var(--line); }
.summary-cell dt { color: var(--muted); font-size: var(--t-xs); }
.summary-cell dd { margin: 0; color: var(--text); font: 600 var(--t-xl) var(--mono); }

/* Notices and empty states: one line + one action */
.notice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-left: 2px solid var(--line-strong); background: var(--ground); color: var(--body); font-size: var(--t-sm); }
.notice-bar.error, .error { border-left-color: var(--fail); }
.notice-bar.error { background: var(--fail-bg); color: var(--text); }
.empty-state, .signin-gate, .artifact-empty { display: grid; gap: 6px; justify-items: start; padding: 20px 0; color: var(--muted); font-size: var(--t-md); }
.empty-state h3, .empty-state h4 { font-size: var(--t-lg); font-weight: 600; }
.empty-state .actions { margin-top: 6px; }
.signin-gate { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; padding: 8px 0; }
.signin-gate a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Disclosure */
.advanced-details { border-top: 1px solid var(--line); overflow-x: clip; }
.advanced-details:not([open]) > :not(summary) { display: none !important; }
.advanced-summary { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-size: var(--t-md); font-weight: 600; list-style: none; cursor: pointer; }
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary svg.i { color: var(--muted); }
.advanced-details[open] > .advanced-summary svg.i { transform: rotate(90deg); }
.advanced-content { padding: 4px 0 16px; }

/* Code */
.code-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); }
.code-wrap pre { margin: 0; padding: 6px 0; min-width: 0; color: var(--text); font: var(--t-xs)/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-cmd { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.agent-cmd + .agent-cmd { margin-top: 12px; }
.key-reveal { font: var(--t-xs) var(--mono); overflow-wrap: anywhere; }

/* Master/detail */
.split-inspector { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 24px; align-items: start; }
.master-pane { border-top: 1px solid var(--line); }
.detail-pane { padding-top: 12px; border-top: 1px solid var(--line); }
.receipt-rows { display: grid; }
.receipt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; width: 100%; min-height: 52px; padding: 8px 8px 8px 8px; border: 0; border-left: 2px solid transparent; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.receipt-row:hover { background: var(--ground); }
.receipt-row.is-selected { background: var(--accent-soft); border-left-color: var(--accent); }
.rr-t { color: var(--text); font-size: var(--t-md); font-weight: 600; overflow-wrap: break-word; }
.rr-sub { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-xs); }
.rr-source { color: var(--body); font-weight: 500; }
.topo-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.topo-cell { display: grid; gap: 2px; align-content: start; padding: 10px 16px 10px 0; min-width: 0; }
.topo-cell + .topo-cell { padding-left: 16px; border-left: 1px solid var(--line); }
.topo-cell dt { color: var(--muted); font-size: var(--t-xs); }
.topo-val { margin: 0; color: var(--text); font-size: var(--t-lg); font-weight: 600; line-height: 1.35; }
.topo-meta { margin: 0; color: var(--muted); font-size: var(--t-xs); overflow-wrap: anywhere; }
.receipt-detail-card, .detail-head, .detail-foot { display: grid; gap: 8px; }
.detail-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.detail-foot { padding-top: 10px; border-top: 1px solid var(--line); }
.detail-tally { color: var(--body); font: var(--t-sm) var(--sans); font-variant-numeric: tabular-nums; }
.detail-decision { color: var(--text); font-size: var(--t-md); font-weight: 600; }
.detail-meta-grid, .acct-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: 6px 20px; margin: 0; font-size: var(--t-sm); }
.detail-meta-grid dt, .acct-grid dt { color: var(--muted); }
.detail-meta-grid dd, .acct-grid dd { margin: 0; color: var(--text); overflow-wrap: break-word; }
.detail-meta-list, .acct-list, .free-plans { margin: 0; padding: 0; list-style: none; }
.detail-meta-list li, .acct-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.acct-list li > div { display: grid; gap: 2px; min-width: 0; }
.acct-list li small { color: var(--muted); }
.breaker-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); }


/* Policy gate simulator & Mind workbench */
.workbench-shell, .workbench-form, .workbench-fields { display: grid; gap: 12px; min-width: 0; }
.workbench-quick { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.workbench-quick .search-input { flex: 1 1 220px; min-width: 0; }
.workbench-tabs { flex-wrap: wrap; }
.workbench-fields textarea.search-input { min-height: 92px; padding: 10px 12px; font-family: var(--mono); font-size: var(--t-sm); resize: vertical; }
.workbench-fields input[type="file"] { max-width: 100%; min-height: 44px; font-size: var(--t-sm); }
.policy-sim-result pre { margin: 8px 0 0; max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-xs); }
.policy-sim-group { display: grid; gap: 8px; margin-top: 12px; }
.policy-sim-label { color: var(--muted); font-size: var(--t-xs); font-weight: 500; }
.policy-sim-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.policy-check-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font: 500 var(--t-sm) var(--sans); color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.policy-check-pill[aria-pressed="true"] { border-color: var(--text); background: transparent; color: var(--text); font-weight: 600; }
.policy-sim-result { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--well); display: grid; gap: 8px; }
.policy-sim-gates { display: flex; flex-wrap: wrap; gap: 6px; }
.policy-sim-gate { padding: 0; border: 0; background: none; font: 500 var(--t-xs) var(--sans); font-variant-numeric: tabular-nums; color: var(--text); }

/* Account */
.acct-head { display: flex; align-items: center; gap: 12px; }
.acct-head .avatar { width: 44px; height: 44px; font-size: var(--t-lg); }
.acct-plan-line { color: var(--muted); font-size: var(--t-sm); }
.acct-cap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.acct-cap-name { color: var(--text); font-size: var(--t-md); font-weight: 500; }
.acct-cap-note { flex-basis: 100%; color: var(--muted); font-size: var(--t-xs); }
.capabilities-list { display: grid; }
.mind-key-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.free-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.free-plans li { display: grid; gap: 2px; padding: 10px 16px 10px 0; }
.free-plans li + li { padding-left: 16px; border-left: 1px solid var(--line); }
.free-plans b, .free-plans span, .free-plans strong { white-space: nowrap; }
.free-plans span { color: var(--muted); font-size: var(--t-xs); }
.plan-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: var(--t-sm); }

/* Connect */
#direct-setup > .grid-2, #direct-setup > .stack { margin-top: 12px; }
#direct-setup > .grid-2:has(#direct-setup-key[hidden]) { grid-template-columns: minmax(0, 1fr); }
/* One type scale: browser defaults (small 0.83em, code 0.92em, bare h2/h3) drift off it. */
.body small { font-size: var(--t-xs); }
.body code { font-size: inherit; }
.body h3:not([class]) { font-size: var(--t-lg); }
.body h2:not([class]) { font-size: var(--t-2xl); }
.body h2:not([class]), .body h3:not([class]), .body h4:not([class]) { font-weight: 600; }
.connect-more > .advanced-content { gap: 12px; padding-top: 12px; }
.connect-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px 16px; margin: 12px 0 0; padding: 0; list-style: none; }
.connect-tools li { display: grid; gap: 2px; min-width: 0; }
.connect-tools code { font-size: var(--t-sm); font-weight: 600; overflow-wrap: anywhere; }
.connect-tools span { color: var(--muted); font-size: var(--t-xs); line-height: 1.4; }
#direct-setup > h4.acct-section-title { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.connect-catalog, .connect-rows, .connect-group { display: grid; align-content: start; min-width: 0; }
.connect-catalog { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px 32px; margin-top: 8px; }
.connect-group-label { padding-bottom: 4px; color: var(--muted); font-size: var(--t-xs); font-weight: 500; }
.connect-row { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 56px; padding: 12px 0; border-top: 1px solid var(--line); }
.connect-row-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); }
.connect-row-icon svg, .connect-row-icon img { width: 20px; height: 20px; }
.connect-row-main { flex: 1 1 auto; display: grid; gap: 1px; min-width: 0; }
.connect-row-title { color: var(--text); font-size: var(--t-md); font-weight: 600; }
.connect-row-desc, .connect-row-meta { color: var(--muted); font-size: var(--t-xs); }
.connect-row-actions { flex: none; display: flex; gap: 6px; }
.app-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.app-gallery > * { min-width: 0; }
.app-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.app-card-top { display: grid; min-width: 0; gap: 2px; }
.app-card-header { flex-wrap: wrap; }
.app-card-header, .app-card-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-card-icon { flex: none; display: grid; place-items: center; width: 24px; height: 24px; }
.app-card-icon svg, .app-card-icon img { width: 20px; height: 20px; }
.app-card-title { color: var(--text); font-size: var(--t-md); font-weight: 600; }
.body .app-card-desc { margin: 0 0 0 34px; color: var(--muted); font-size: var(--t-sm); }
#view-agents .app-status-badge { display: none; }
#view-agents > .surface-block { background: none; border: 0; padding: 0; border-radius: 0; }
#agents-view-list { padding: 0; margin: 0; }
#agents-view-list li > div { flex: 1 1 230px; min-width: 0; overflow-wrap: anywhere; }
#agents-view-list small { display: block; color: var(--muted); }
.app-card .app-card-actions > * { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.app-card .app-card-actions > *:hover { background: var(--well); }
@container harness (max-width: 740px) {
  #view-agents .app-card-desc { display: none; }
  .app-card-brand { gap: 8px; }
  .app-card .app-card-actions > * { padding: 0 8px; }
}
.app-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.outlet-stack { display: grid; gap: 0; }
.outlet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }
.outlet-card { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.chip { display: inline; color: var(--muted); font: 500 var(--t-xs) var(--sans); font-variant-numeric: tabular-nums; }
.chip + .chip::before { content: " · "; }

/* Container breakpoints */

@container harness (max-width: 1040px) {
  .split-inspector { grid-template-columns: minmax(0, 1fr); }
}
@container harness (max-width: 1020px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .rtable tr:last-child { border-bottom: 0; }
  .rtable td { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 8px; padding: 0; border: 0; }
  .rtable td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: var(--t-xs); }
  .rtable td .table-action, .rtable td .text-link { justify-self: start; }
}
@container harness (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .topo-strip { grid-template-columns: minmax(0, 1fr); }
  .topo-cell, .topo-cell + .topo-cell { padding-left: 0; border-left: 0; }
  .topo-cell + .topo-cell { border-top: 1px solid var(--line); }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-cell:nth-child(3) { padding-left: 0; border-left: 0; }
  .summary-cell:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@container harness (max-width: 600px) {
  .body { gap: 16px; padding: 16px 16px 24px; }
  .body p { font-size: max(15px, 1em); }
  .app, .app[data-compact="true"] { display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
  .app > main { flex: 1 1 auto; }
  .topbar { flex: none; flex-direction: row; align-items: center; justify-content: space-between; padding: 4px 12px; border: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  .topbar .brand div, .app[data-compact="true"] .brand div { display: flex; flex-direction: row; align-items: baseline; gap: 6px; }
  .topbar-right, .app[data-compact="true"] .topbar-right { flex-direction: row; margin: 0; padding: 0; border: 0; }
  .topbar > .topnav, #rail-toggle { display: none; }
  .rail-toggle.mobile-nav { display: grid; }
  .topbar .brand { margin-right: auto; padding: 0; }
  #nav-drawer .menu-heading { display: block; }
  #nav-drawer .nav-btn { justify-content: start; gap: 12px; font-size: var(--t-md); }
  .site-language-menu { top: 100%; bottom: auto; left: auto; right: 0; }
  .pagebar { padding: 0 16px; min-height: 0; }
  .topbar-head { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .pagebar:has(> .subtabs[hidden]) { border-bottom: 0; }
  .subtabs { margin-left: 0; flex: 1 1 100%; }
  .subtab-group { flex: 1 1 100%; }
  .subtab { flex: 1 1 0; }
  .framebar { display: none; }
  .connect-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .connect-row-actions { width: 100%; }
  .connect-row-actions .btn-connect { width: 100%; }
  .free-plans { grid-template-columns: minmax(0, 1fr); }
  .free-plans li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@container harness (max-width: 460px) {
  .summary-strip { grid-template-columns: minmax(0, 1fr); }
  .summary-cell, .summary-cell + .summary-cell { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .summary-cell:first-child { border-top: 0; }
  .rtable td { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .acct-actions .btn { width: 100%; }
  .code-wrap { grid-template-columns: minmax(0, 1fr); padding: 4px 12px 8px; }
  .copy-btn { width: 100%; }
  .detail-meta-grid, .acct-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .detail-meta-grid dd, .acct-grid dd { padding-bottom: 6px; }
}
/* Sections share one reading column and a clearly defined data surface. */
.body > .view-head { align-items: center; border: 0; padding: 0 0 4px; }
.body > .surface-block, .body > .surface-flush, .body > .pipeline-card,
.connect-pair-row > .surface-block {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: clamp(14px, 2vw, 22px); gap: 12px;
}
.view-lead, .acct-section-desc { max-width: 68ch; }
.body p, .body li { text-wrap: pretty; }
#view-chats { padding-block: 14px 28px; }
@container harness (min-width: 601px) {
  .app[data-compact="true"] .site-language-menu { left: 0; }
  .pagebar { padding: 0 20px; gap: 4px 12px; min-height: 58px; background: var(--ground); }
  .rail-toggle { margin-left: -6px; }
}
@container harness (min-width: 601px) and (max-width: 920px) {
  .app { --rail-width: 170px; }
  .body { padding-inline: 20px; }
}


@media (max-width: 900px) {
  .access-split { grid-template-columns: 1fr; gap: 28px; }
  .access-card { order: -1; padding: 20px; }
}
@media (max-width: 700px) {
  .access-rail { padding: 0 16px; }
  .access h1 { font-size: var(--t-2xl); }
}

html.session-presumed #access-screen { display: none !important; }
html.session-presumed #workspace-frame { display: flex !important; }
html.session-presumed #top-signin-btn, html.session-presumed #overview-signin-btn { display: none !important; }
