

/* shadcn Preset b6Amd6NZdw */
/* critical:start */
:root {

  --preset-style: vega;
  --preset-base-color: zinc;
  --preset-theme: indigo;
  --preset-radius: 0.625rem;


  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.141 0.005 285.823);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.141 0.005 285.823);
  --primary: oklch(0.457 0.24 277.023);
  --primary-foreground: oklch(0.962 0.018 272.314);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --accent: oklch(0.967 0.001 286.375);
  --accent-foreground: oklch(0.21 0.006 285.885);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.705 0.015 286.067);
  --chart-1: oklch(0.785 0.115 274.713);
  --chart-2: oklch(0.585 0.233 277.117);
  --chart-3: oklch(0.511 0.262 276.966);
  --chart-4: oklch(0.457 0.24 277.023);
  --chart-5: oklch(0.398 0.195 277.366);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.141 0.005 285.823);
  --sidebar-primary: oklch(0.511 0.262 276.966);
  --sidebar-primary-foreground: oklch(0.962 0.018 272.314);
  --sidebar-accent: oklch(0.967 0.001 286.375);
  --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
  --sidebar-border: oklch(0.92 0.004 286.32);
  --sidebar-ring: oklch(0.705 0.015 286.067);



  --bg: var(--sidebar);
  --surface: var(--card);
  --surface-subtle: var(--secondary);
  --surface-hover: var(--accent);
  --ink: var(--foreground);
  --ink-secondary: oklch(0.37 0.013 285.805);
  --ink-muted: var(--muted-foreground);
  --border-strong: oklch(0.871 0.006 286.286);

  --control-border: #888b94;
  --accent-hover: oklch(0.457 0.24 277.023);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-ui: var(--font-sans);
  --font-heading: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  --accent-soft: oklch(0.962 0.018 272.314);
  --ok: #166534;
  --ok-soft: rgba(22, 101, 52, 0.09);
  --ok-border: rgba(22, 101, 52, 0.24);
  --warn: #92400e;
  --warn-soft: rgba(146, 64, 14, 0.1);
  --warn-border: rgba(146, 64, 14, 0.28);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.09);
  --danger-border: rgba(180, 35, 24, 0.25);
  --radius-control: calc(var(--radius) * 0.8);
  --radius-surface: calc(var(--radius) * 1.4);
  --polish-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04);
  --polish-shadow-md: 0 10px 28px rgb(0 0 0 / 0.10), 0 0 0 1px var(--border);
  --polish-primary-shadow: 0 1px 2px rgb(49 46 129 / 0.18);
  --component-inset: color-mix(in srgb, var(--surface) 76%, var(--surface-subtle));
  --component-hover: color-mix(in srgb, var(--surface) 48%, var(--surface-subtle));
  color-scheme: light;
}

.dark {
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.21 0.006 285.885);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.21 0.006 285.885);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.398 0.195 277.366);
  --primary-foreground: oklch(0.962 0.018 272.314);
  --secondary: oklch(0.274 0.006 286.033);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.274 0.006 286.033);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --accent: oklch(0.274 0.006 286.033);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.552 0.016 285.938);
  --chart-1: oklch(0.785 0.115 274.713);
  --chart-2: oklch(0.585 0.233 277.117);
  --chart-3: oklch(0.511 0.262 276.966);
  --chart-4: oklch(0.457 0.24 277.023);
  --chart-5: oklch(0.398 0.195 277.366);
  --sidebar: oklch(0.21 0.006 285.885);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.585 0.233 277.117);
  --sidebar-primary-foreground: oklch(0.962 0.018 272.314);
  --sidebar-accent: oklch(0.274 0.006 286.033);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.552 0.016 285.938);
  color-scheme: dark;
}
/* critical:end */

@font-face {
  font-family: "Gordita";
  src: url("/brand/Gordita-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/brand/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/brand/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
}

/* critical:start */
* {
  box-sizing: border-box;
  border-color: var(--border);
  outline-color: color-mix(in oklch, var(--ring) 50%, transparent);
}

html, body { margin: 0; padding: 0; }
html { font-family: var(--font-sans); }

body {
  color: var(--foreground);
  background: var(--background);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* critical:end */

h1, h2, h3 {
  font-family: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: 28px; line-height: 1.2; }
h1:focus, h2:focus, h3:focus { outline: none; }

.page-header { margin-bottom: 24px; }
.page-header .page-sub { color: var(--ink-secondary); font-size: 14px; margin: 8px 0 0; }

.section-label {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 600;
  margin: 0 0 8px;
}

a { color: var(--primary); }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  z-index: 40;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
}
.skip-link:focus { left: 8px; top: 8px; }

button, input, select, textarea { font-family: var(--font-ui); }
button:not(:disabled),
[role="button"]:not(:disabled) { cursor: pointer; }
input:not([type="checkbox"]),
select,
textarea { --border-strong: var(--control-border); }
.status, .posture, .nav-label { font-family: var(--font-ui); }

table { font-variant-numeric: tabular-nums lining-nums; }
table th { font-family: var(--font-ui); }
table td { font-family: var(--font-ui); font-size: 13.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 13px;
  font: inherit;
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  line-height: 1.2;
  transition: color 140ms ease, background-color 140ms ease,
    border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
a.btn { text-decoration: none; }
.btn.primary {
  background: var(--primary); color: #fff;
  border-color: color-mix(in srgb, var(--primary) 82%, #1c1464);
  box-shadow: var(--polish-primary-shadow);
}
a.btn.primary:hover { color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.btn.ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink-secondary);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(26, 23, 20, .04);
}
.btn.ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); border-color: var(--border-strong); }
.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-secondary);
  font-weight: 500;
  min-height: 32px;
  padding: 4px 8px;
}
.btn.quiet:hover:not(:disabled) { color: var(--ink); background: var(--surface-hover); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: 0 1px 2px rgba(26, 23, 20, .08); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }

.field { margin: 0 0 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  min-height: 40px;
  box-shadow: inset 0 1px 1px rgba(26, 23, 20, .025);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-error { color: var(--danger); font-size: 13px; margin: 8px 0 0; min-height: 18px; }
.form-ok { color: var(--ok); font-size: 13px; margin: 8px 0 0; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--ok); }
.status-warn { color: var(--warn); }
.status-danger { color: var(--danger); }
.status-accent { color: var(--primary); }
.status-muted { color: var(--ink-muted); }

.posture { font-size: 13px; white-space: nowrap; }
.posture-default { color: var(--ink); }
.posture-muted { color: var(--ink-muted); }
.posture-warn { color: var(--warn); }
.posture-ok { color: var(--ok); }
.posture-danger { color: var(--danger); }
.posture-accent { color: var(--primary); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  padding: 18px 20px;
  box-shadow: var(--polish-shadow-sm);
}
.panel + .panel { border-top: 1px solid var(--border); }

.hairline-list {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-surface); overflow: hidden;
  box-shadow: var(--polish-shadow-sm);
}
.hairline-list > * { border-bottom: 1px solid var(--border); }
.hairline-list > *:last-child { border-bottom: 0; }

.empty-note { color: var(--ink-muted); font-size: 13px; margin: 8px 0; }

.skeleton-group { display: flex; flex-direction: column; gap: 1px; }
.skeleton-row { height: 46px; background: var(--surface-subtle); }
@media (prefers-reduced-motion: no-preference) {
  .skeleton-row { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.55; } }
}

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

.rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 10px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 264px;
  height: 100vh;
  height: 100dvh;
  overflow: visible;
}

.rail > * { flex: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { display: block; width: 26px; height: 26px; flex: none; }
.brand-lockup { display: flex; flex-direction: column; min-width: 0; }
.wordmark {
  font-family: "Gordita", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.product-name {
  font-family: "Gordita", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.rail-firm {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
}
.firm-monogram {
  width: 28px; height: 28px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--bg);
  font-family: "Gordita", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.rail-firm .firm-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail-sessions { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }

.rail-session-list { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.rail-sessions ul {
  min-height: 0;
  flex: 1;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.rail-session-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
}
.rail-session-item:hover { background: var(--surface-hover); }
.rail-session-item--active {
  background: var(--surface-hover);
}
.rail-session-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 6px;
  text-decoration: none;
  color: var(--ink-secondary, var(--ink));
}
.rail-session-link:hover,
.rail-session-link[aria-current="page"] { color: var(--ink); }
.rail-session-link .title {
  font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-session-rename {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 3px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink-muted);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}
.rail-session-item:hover .rail-session-rename,
.rail-session-item:focus-within .rail-session-rename {
  opacity: 1;
  pointer-events: auto;
}
.rail-session-rename:hover {
  color: var(--primary);
  background: var(--surface);
  opacity: 1;
}
.rail-session-rename:focus-visible {
  color: var(--primary);
  opacity: 1;
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.rail-session-rename .nav-glyph { width: 14px; height: 14px; }
.rail-session-title-input {
  grid-column: 1 / -1;
  min-width: 0;
  width: auto;
  height: 24px;
  margin: 2px 4px 2px 6px;
  padding: 2px 6px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: 500 12.5px/1.4 var(--font-ui);
  outline: 2px solid var(--accent-soft);
}

.session-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.session-status-dot--working {
  background: var(--primary);
  animation: sessionStatusBlink 1.4s ease-in-out infinite;
}
.session-status-dot--steady { background: var(--primary); }
.session-status-dot--attention { background: #d6a21a; }
.session-status-dot--error { background: #c85b50; }
.session-status-dot--archived { background: #9b958c; }
@keyframes sessionStatusBlink {
  0% { opacity: 1; }
  50% { opacity: 0.22; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .session-status-dot--working {
    animation: none;
    opacity: 1;
  }
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  max-height: min(44vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.rail-nav a,
.rail-utility a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 500;
}
.rail-nav a:hover,
.rail-utility a:hover { background: var(--surface-hover); color: var(--ink); }
.rail-nav a[aria-current="page"],
.rail-utility a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-hover);
}
.nav-glyph { width: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.nav-glyph svg { width: 15px; height: 15px; }

.rail-utility {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: none;
  min-width: 0;
  border-top: 1px solid var(--border);
  padding-top: 5px;
}

.rail-signout {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  margin-top: 1px;
  border: 0;
  border-top: 0;
  background: transparent;
  font: inherit;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.rail-signout:hover { color: var(--ink); background: var(--surface-hover); }

.canvas {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  background: var(--surface);
  padding: 28px clamp(14px, 4vw, 40px) 48px;
  background: var(--surface);
}

.topbar { display: none; }

.topbar .brand { flex: none; }
.topbar .firm-name {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13.5px;
}
.rail .rail-close {
  display: none;
  align-self: flex-end;
  width: 32px;
  height: 32px;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.rail .rail-close .nav-glyph { width: 18px; height: 18px; }
.rail-collapse { display: none; }
.rail-backdrop { display: none; }

@media (min-width: 720px) {
  .rail-collapse {
    position: absolute;
    right: -13px;
    bottom: 18px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-muted);
    box-shadow: var(--polish-shadow-sm);
  }
  .rail-collapse:hover { color: var(--ink); background: var(--surface-hover); }
  .rail-collapse .nav-glyph { width: 15px; height: 15px; }
  .shell--rail-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
  .shell--rail-collapsed .rail { width: 56px; padding: 18px 8px; align-items: center; }
  .shell--rail-collapsed .rail-sessions,
  .shell--rail-collapsed .rail .nav-label,
  .shell--rail-collapsed .rail .btn-label,
  .shell--rail-collapsed .rail .brand-lockup,
  .shell--rail-collapsed .rail .rail-firm .firm-name { display: none; }
  .shell--rail-collapsed .rail-firm {
    justify-content: center;
    padding: 4px 0;
    border-bottom: 0;
  }
  .shell--rail-collapsed .rail-nav,
  .shell--rail-collapsed .rail-utility,
  .shell--rail-collapsed .rail-signout { border-top: 0; }
  .shell--rail-collapsed .rail-nav a,
  .shell--rail-collapsed .rail-utility a,
  .shell--rail-collapsed .rail .rail-new,
  .shell--rail-collapsed .rail-signout {
    position: relative;
    justify-content: center;
    width: 40px;
    padding: 9px 0;
  }
  .shell--rail-collapsed .rail-collapse .nav-glyph { transform: scaleX(-1); }
  .shell--rail-collapsed .rail-nav a:hover .nav-label,
  .shell--rail-collapsed .rail-nav a:focus-visible .nav-label,
  .shell--rail-collapsed .rail-utility a:hover .nav-label,
  .shell--rail-collapsed .rail-utility a:focus-visible .nav-label,
  .shell--rail-collapsed .rail-signout:hover .nav-label,
  .shell--rail-collapsed .rail-signout:focus-visible .nav-label,
  .shell--rail-collapsed .rail .rail-new:hover .btn-label,
  .shell--rail-collapsed .rail .rail-new:focus-visible .btn-label {
    display: block;
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    padding: 3px 9px;
    background: var(--ink);
    color: var(--bg);
    font-size: 12px;
    white-space: nowrap;
  }
}

@media (max-width: 1079px) and (min-width: 720px) {
  .shell:not(.shell--chat) { grid-template-columns: 56px minmax(0, 1fr); }
  .shell:not(.shell--chat) .rail { width: 56px; padding: 14px 8px; align-items: center; }
  .shell:not(.shell--chat) .rail .rail-sessions,
  .shell:not(.shell--chat) .rail .nav-label,
  .shell:not(.shell--chat) .rail .btn-label,
  .shell:not(.shell--chat) .rail .brand-lockup,
  .shell:not(.shell--chat) .rail .rail-firm .firm-name { display: none; }
  .shell:not(.shell--chat) .rail .rail-firm {
    border-bottom: 0; padding: 4px 0; justify-content: center;
  }
  .shell:not(.shell--chat) .rail-nav,
  .shell:not(.shell--chat) .rail-utility,
  .shell:not(.shell--chat) .rail-signout { border-top: 0; }
  .shell:not(.shell--chat) .rail-nav a,
  .shell:not(.shell--chat) .rail-utility a,
  .shell:not(.shell--chat) .rail .btn,
  .shell:not(.shell--chat) .rail-signout {
    position: relative; justify-content: center; width: 40px; padding: 9px 0;
  }
  .shell:not(.shell--chat) .rail-nav a:hover .nav-label,
  .shell:not(.shell--chat) .rail-nav a:focus-visible .nav-label,
  .shell:not(.shell--chat) .rail-utility a:hover .nav-label,
  .shell:not(.shell--chat) .rail-utility a:focus-visible .nav-label,
  .shell:not(.shell--chat) .rail-signout:hover .nav-label,
  .shell:not(.shell--chat) .rail-signout:focus-visible .nav-label,
  .shell:not(.shell--chat) .rail .btn:hover .btn-label,
  .shell:not(.shell--chat) .rail .btn:focus-visible .btn-label {
    display: block;
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink);
    color: var(--bg);
    padding: 3px 9px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 30;
  }
}

@media (max-width: 719px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .rail { display: none; }
  .rail.open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 40;
    width: min(320px, 100vw);
    height: 100vh;
    border-right: 1px solid var(--border-strong);
    box-shadow: 8px 0 28px rgba(26, 23, 20, 0.18);
  }
  .rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(26, 23, 20, 0.38);
    cursor: default;
  }
  .rail-backdrop[hidden] { display: none; }
  .rail .rail-close { display: inline-flex; }
  body.nav-drawer-open .topbar {
    z-index: 50;
    pointer-events: none;
    background: transparent;
    border-color: transparent;
  }
  body.nav-drawer-open .topbar > :not(#menuToggle) { visibility: hidden; }
  body.nav-drawer-open #menuToggle { pointer-events: auto; }
  .canvas { grid-column: 1; padding: 18px 14px 40px; }
}

.banner {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  color: var(--ink-secondary);
  font-size: 13px;
  padding: 8px 16px;
  text-align: center;
}

.notice { border: 1px solid var(--border); background: var(--surface); padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }
.notice-ok { border-color: var(--ok-border); background: var(--ok-soft); color: var(--ok); }
.notice-danger { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger); }

.login-wrap {

  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px;
  gap: 24px;
  overflow: hidden;
  isolation: isolate;
}
.login-wrap::before {

  content: "";
  position: absolute;
  z-index: -1;
  width: 620px;
  height: 620px;
  left: 50%;
  top: 42%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.075), transparent 68%);
  transform: translate(-50%, -50%);
  animation: login-breathe 8s ease-in-out infinite;
  pointer-events: none;
}
.brand-login {
  flex-direction: column;
  gap: 14px;
  text-align: center;
  margin-top: auto;
}
.login-wrap .login-note { margin-bottom: auto; }
.brand-login .brand-mark {

  width: 56px;
  height: 56px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--polish-shadow-sm);
  animation: login-mark-idle 4s ease-in-out infinite;
}
.brand-login .brand-lockup { align-items: center; }
.brand-login .wordmark { font-size: 17px; }
.login-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  padding: 30px 28px 24px;
  box-shadow: var(--polish-shadow-md);
}
.login-panel::before {

  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--primary);
  transform-origin: left;
}
.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.login-kicker::before {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
}
.login-panel h1 {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}
.login-panel .sub { color: var(--ink-secondary); font-size: 13.5px; margin: 0 0 18px; }
.login-panel .btn.primary {
  width: 100%;
  margin-top: 4px;
  border-color: rgba(32, 26, 137, 0.42);
  box-shadow: var(--polish-primary-shadow);
  transition: color 140ms ease, background-color 140ms ease,
    border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.login-panel .btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 3px rgba(28, 20, 100, 0.18), 0 7px 18px rgba(79, 70, 229, 0.22);
}
.login-panel .btn.primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.10);
}
.login-panel .btn.primary:disabled { transform: none; box-shadow: none; }
.mode-toggle {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-secondary);
  text-align: center;
}
.mode-toggle button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
}
.login-note { color: var(--ink-muted); font-size: 13px; }

.welcome-wrap {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.welcome-brand {
  position: absolute;
  top: 24px;
  left: 24px;
}
.welcome-main {
  width: 100%;
  display: grid;
  place-items: center;
}
.welcome-panel::before { content: none; }
.welcome-panel h1 { margin-bottom: 22px; }
@media (max-width: 479px) {
  .welcome-brand { top: 16px; left: 16px; }
}
@media (max-height: 480px) {
  .welcome-wrap { align-items: start; padding-top: 76px; }
}

.login-arrive .brand-login,
.login-arrive .login-panel,
.login-arrive .login-note {
  animation: login-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.login-arrive .login-panel { animation-delay: 90ms; }
.login-arrive .login-note { animation-delay: 200ms; }
.login-arrive .login-panel::before {
  animation: login-rule-in 560ms cubic-bezier(0.22, 1, 0.36, 1) 300ms backwards;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-rule-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes login-breathe {
  0%, 100% { opacity: 0.72; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
@keyframes login-mark-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-wrap::before,
  .brand-login .brand-mark,
  .login-arrive .brand-login,
  .login-arrive .login-panel,
  .login-arrive .login-note,
  .login-arrive .login-panel::before {
    animation: none;
  }
}

.home-focus {
  max-width: 820px;
  margin: 0 auto;
  padding-top: clamp(4px, 8vh, 88px);
}
.home-header { margin-bottom: 26px; }
.home-header .sub { color: var(--ink-secondary); font-size: 14px; margin: 8px 0 0; }

.session-composer {
  flex: none;
  border: 1px solid var(--border-strong, #cfc7b8); border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: var(--polish-shadow-sm, 0 1px 2px rgba(26, 23, 20, .07));
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.session-composer:focus-within {
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(79, 70, 229, 0.09));
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .session-composer { transition: none; }
}
.session-composer textarea {
  display: block; width: 100%; border: 0; background: transparent; resize: none;
  padding: 12px 16px 4px; min-height: 40px;
  font-family: var(--font-ui, inherit); font-size: 14.5px; line-height: 1.5;
  color: var(--ink, #1a1714);
}
.session-composer textarea::placeholder { color: var(--ink-muted, #8a8279); }
.session-composer textarea:focus { outline: none; }
.chat-comp-bottom { display: flex; align-items: center; gap: 8px; padding: 6px 10px 9px; }
.chat-comp-attach {
  width: 28px; height: 28px; flex: none; border: 0; border-radius: 50%;
  background: var(--surface-subtle, #f3ede4); color: var(--ink-secondary, #5c5650);
  font-family: var(--font-ui, inherit); font-size: 17px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.chat-comp-attach:hover:not(:disabled) { background: var(--surface-hover, #ede8e0); color: var(--ink, #1a1714); }
.chat-comp-attach:disabled { cursor: default; opacity: 0.6; }
.chat-comp-spacer { flex: 1; }

.chat-attach-note { margin: 0; font-size: 12px; }

.composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.composer-row .spacer { flex: 1; }
.attach-note { font-size: 12.5px; color: var(--ok); font-weight: 500; }

.home-starters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.home-starters .example-chip { cursor: pointer; }

.home-recent { margin-top: 28px; }
.home-recent > .section-label { margin-bottom: 8px; }
.home-recent-list { display: grid; gap: 2px; }
.home-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  color: var(--ink);
  text-decoration: none;
}
.home-recent-row:hover { background: var(--surface-hover); }
.home-recent-row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}
.home-recent-row .title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.home-recent-row .meta { flex: none; color: var(--ink-muted); font-size: 12px; }

@media (max-width: 520px) {
  .home-recent-row { align-items: flex-start; flex-direction: column; gap: 2px; }
}

.home-templates {
  margin-top: 24px;
  border: 0;
}
.home-templates > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: var(--radius-control);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.home-templates > summary:hover { background: var(--surface-hover); color: var(--ink); }
.home-templates > summary::-webkit-details-marker { display: none; }
.home-templates > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 120ms ease;
}
.home-templates[open] > summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.home-template-body { padding: 4px 0 14px; }
.home-template-body > .empty-note { margin: 10px 2px 0; }
.home-template-body > .form-error:empty { display: none; }

.session-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 16px;
  text-decoration: none;
  color: var(--ink);
}
.session-row:hover { background: var(--surface-hover); color: var(--ink); }

.session-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.session-row .session-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.session-row .title {
  font-weight: 600;
  font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-row .meta {
  display: flex; gap: 6px; align-items: baseline; min-width: 0;
  font-size: 12.5px; color: var(--ink-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-row .meta .source { color: var(--ink-muted); flex: none; }
.session-row .meta .sep { color: var(--ink-muted); flex: none; }
.session-row .meta .outcome { overflow: hidden; text-overflow: ellipsis; }
.session-row .session-side {
  flex: none;
  display: flex; align-items: center; gap: 14px;
}
.session-row .when {
  font-size: 12px; color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  min-width: 56px; text-align: right;
}
@media (max-width: 719px) {
  .session-row { flex-wrap: wrap; gap: 6px 16px; }
  .session-row .session-side { width: 100%; justify-content: space-between; }
  .session-row .when { min-width: 0; }
}

.starter-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  background: var(--surface);
  border: 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.starter-task:hover { background: var(--surface-hover); }
.starter-task .go { color: var(--primary); font-weight: 600; white-space: nowrap; }

.provider-mark {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.provider-mark svg { display: block; width: 100%; height: 100%; }

.home-section { margin-bottom: 26px; }

.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  gap: 0 24px;
  align-items: start;
}
.session-layout.with-surface { grid-template-columns: minmax(0, 1fr) minmax(320px, 44%); }
@media (max-width: 1079px) {
  .session-layout.with-surface { grid-template-columns: minmax(0, 1fr); }
}

.session-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.session-title-row h1 { font-size: 21px; min-width: 0; overflow-wrap: anywhere; }
.session-title-row input {
  font: inherit; font-size: 21px;
  border: 1px solid var(--border-strong);
  padding: 2px 8px;
  min-width: 0;
  flex: 1;
}

.source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  font-size: 13px;
}
.source-row .name { font-weight: 500; overflow-wrap: anywhere; }
.source-row .detail { color: var(--ink-muted); }

.source-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); margin-bottom: 18px; }
@media (max-width: 719px) { .source-choices { grid-template-columns: 1fr; } }
.source-choice {
  background: var(--surface);
  padding: 18px 16px;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
.source-choice + .source-choice { border-left: 1px solid var(--border); }
@media (max-width: 719px) { .source-choice + .source-choice { border-left: 0; border-top: 1px solid var(--border); } }
.source-choice:hover { background: var(--surface-hover); }
.source-choice.over { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--accent-soft); }
.source-choice .head { font-weight: 600; display: block; margin-bottom: 3px; }
.source-choice .sub { color: var(--ink-secondary); font-size: 13px; }

.feed { display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--surface); margin-bottom: 18px; }
.feed > * { border-bottom: 1px solid var(--border); }
.feed > *:last-child { border-bottom: 0; }
.feed-instruction { background: var(--surface-subtle); padding: 12px 16px; }
.feed-instruction .who { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); font-weight: 600; margin-bottom: 3px; }
.feed-run { padding: 14px 16px; }
.guided-chat-card { display: grid; gap: 14px; }
.guided-chat-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.guided-chat-card h3, .guided-chat-card h4, .guided-chat-card p { margin: 0; }
.guided-eyebrow { color: var(--ink-muted); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.guided-progress { flex: none; padding: 5px 8px; border: 1px solid var(--border); background: var(--surface-subtle); color: var(--ink-secondary); font-size: 12px; }
.guided-goal { padding: 12px; border-left: 3px solid var(--primary); background: var(--accent-soft); }
.guided-goal p { margin-top: 4px; }
.guided-chat-card details > summary { cursor: pointer; font-weight: 650; padding: 8px 0; }
.guided-group { margin-top: 10px; border: 1px solid var(--border); }
.guided-group.is-collapsed { padding-bottom: 10px; }
.guided-collapsed-note, .guided-approval-state { color: var(--ink-secondary); font-size: 12px; margin: 8px 12px; }
.guided-load-error { margin: 12px 0; padding: 12px; border: 1px solid var(--danger); background: var(--surface); }
.guided-load-error p { margin: 0 0 8px; }
.guided-group-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px; background: var(--surface-subtle); }
.guided-group-head p, .guided-help { color: var(--ink-secondary); font-size: 12.5px; }
.guided-question { padding: 14px 12px; border-top: 1px solid var(--border); }
.guided-question fieldset { margin: 0; padding: 0; border: 0; }
.guided-question legend { font-weight: 650; }
.guided-options { display: grid; gap: 7px; margin: 10px 0; }
.guided-option { display: flex; gap: 9px; align-items: flex-start; padding: 9px; border: 1px solid var(--border); cursor: pointer; }
.guided-option:has(input:checked) { border-color: var(--primary); background: var(--accent-soft); }
.guided-option small { display: block; margin-top: 2px; color: var(--ink-secondary); }
.guided-context { display: grid; gap: 5px; color: var(--ink-secondary); font-size: 12.5px; }
.guided-context textarea { min-height: 62px; resize: vertical; padding: 8px; border: 1px solid var(--border-strong); font: inherit; }
.guided-actions { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.guided-mutation-state { flex-basis: 100%; margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--primary); background: var(--surface-subtle); }
.guided-mutation-state[role="alert"] { border-left-color: var(--danger); }
.guided-mutation-state [data-guided-mutation-retry] { margin-left: 8px; }
.guided-response-state { margin-left: auto; color: var(--ink-muted); font-size: 12px; text-transform: capitalize; }
.guided-tasks { list-style: none; display: grid; gap: 8px; margin: 8px 0; padding: 0; }
.guided-task { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 11px; border: 1px solid var(--border); }
.guided-task-mark { font-weight: 750; color: var(--ink-muted); }
.guided-task.status-complete .guided-task-mark { color: var(--ok); }
.guided-task.status-blocked .guided-task-mark, .guided-blockers { color: var(--danger); }
.guided-task-status { margin-left: 8px; color: var(--ink-muted); font-size: 12px; }
.guided-task p { margin-top: 4px; color: var(--ink-secondary); font-size: 12.5px; }
.guided-task dl { display: flex; gap: 16px; margin: 8px 0 0; }
.guided-task dl div { display: flex; gap: 5px; }
.guided-task dt { color: var(--ink-muted); font-size: 12px; }
.guided-task dd { margin: 0; font-size: 12px; font-weight: 600; }
.guided-blockers, .guided-approval, .guided-required-approvals, .guided-availability { margin-top: 8px; font-size: 12px; }
.guided-blockers ul, .guided-required-approvals ul { margin: 4px 0 0; padding-left: 18px; }
.guided-availability { color: var(--ink-muted); }
@media (max-width: 719px) {
  .guided-chat-card > header, .guided-group-head { flex-direction: column; }
  .guided-progress { align-self: flex-start; }
  .guided-task dl { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .guided-chat-card *, .guided-chat-card *::before, .guided-chat-card *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.chat-run-title { margin: 0; font-size: 15px; font-weight: 650; }

.chat-run-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.chat-run-download { margin-top: 12px; }
.chat-run-details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--ink-secondary);
}
.chat-run-details > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
}
.chat-run-details-body { margin-top: 10px; }

.plan-block { padding: 2px 0; }
.plan-block ol { margin: 8px 0 12px; padding-left: 22px; }
.plan-block li { margin: 4px 0; color: var(--ink-secondary); }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stage-list { list-style: none; margin: 10px 0; padding: 0; }
.stage-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
}
.stage-list li .glyph { width: 14px; text-align: center; flex: none; }
.stage-list li .stage-label { font-weight: 500; min-width: 118px; }
.stage-list li .state-word { font-size: 12px; }
.stage-list li.waiting { color: var(--ink-muted); }
.stage-list li.active { border-left-color: var(--primary); color: var(--ink); }
.stage-list li.active .state-word { color: var(--primary); }
.stage-list li.done .glyph { color: var(--ok); }
.stage-list li.done .state-word { color: var(--ink-muted); }
.stage-list li.failed { border-left-color: var(--danger); }
.stage-list li.failed .state-word, .stage-list li.failed .glyph { color: var(--danger); }
.stage-detail { color: var(--ink-secondary); overflow-wrap: anywhere; }
.stage-list details { display: inline; }
.stage-list summary { cursor: pointer; color: var(--primary); font-size: 12px; list-style: none; }
.stage-list summary::-webkit-details-marker { display: none; }
.stage-data { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-secondary); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto; background: var(--surface-subtle); padding: 8px 10px; }

.headline-stat { font-weight: 500; margin: 10px 0 8px; }

.tier-list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--border); }
.tier-list li { display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.tier-list li:last-child { border-bottom: 0; }
.tier-list .cellref { font-variant-numeric: tabular-nums; color: var(--ink-secondary); min-width: 110px; }
.tier-list .val { font-variant-numeric: tabular-nums; }

.verified-group summary {
  cursor: pointer;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--ok);
  font-weight: 500;
  border: 1px solid var(--border);
  border-top: 0;
  background: var(--surface);
}

.outputs-scroll { overflow-x: auto; margin: 10px 0 12px; }
.outputs-scroll > .outputs-table { margin: 0; }
.outputs-table { width: 100%; border-collapse: collapse; margin: 10px 0 12px; font-size: 13.5px; }
.outputs-table th, .outputs-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.outputs-table th { background: var(--surface-subtle); color: var(--ink-secondary); font-weight: 600; font-size: 12.5px; }
.outputs-table td.num, .outputs-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}
.outputs-table tr.expandable td:first-child { cursor: pointer; color: var(--primary); }
@media (max-width: 719px) {

  .outputs-table { width: max-content; min-width: 100%; }
}
.trace-drawer { background: var(--surface-subtle); font-size: 12.5px; color: var(--ink-secondary); }
.trace-drawer td { padding: 8px 12px; }

.cellref-link {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 0; margin: 0;
  font: inherit; font-variant-numeric: tabular-nums;
  color: var(--primary); cursor: pointer; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px; min-width: 110px; text-align: left;
}
.cellref-link:hover { text-decoration-color: currentColor; }
.cellref-link .chev { font-size: 12px; transition: transform 160ms ease; }
.cellref-link[aria-expanded="true"] .chev { transform: rotate(90deg); }
.tier-list .audit-drawer {
  display: block; background: var(--surface-subtle);
  border-left: 3px solid var(--primary); padding: 10px 14px;
}
.audit-drawer-head {
  margin: 0 0 6px; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-secondary);
}
.audit-steps { list-style: none; margin: 0 0 8px; padding: 0; }
.audit-step {
  position: relative; display: flex; align-items: baseline; gap: 8px;
  padding: 4px 0 4px 16px; font-size: 12.5px; color: var(--ink-secondary);
}
.audit-step::before {
  content: ""; position: absolute; left: 3px; top: 10px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: 0.55;
}
.audit-step + .audit-step::after {
  content: ""; position: absolute; left: 6px; top: -8px; height: 14px;
  border-left: 1px solid var(--border);
}
.audit-step-text { flex: 1; min-width: 0; }
.audit-kind {
  flex: none; padding: 2px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em;
}
.audit-kind-agent { background: var(--accent-soft, #eef); color: var(--primary); }
.audit-kind-engine { background: var(--ok-soft, #e9f5ee); color: var(--ok, #1f6f4a); }
.audit-kind-write { background: rgba(92, 86, 80, 0.1); color: var(--ink-secondary); }
.audit-scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(26, 23, 20, 0.35);
}
.audit-slideover {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(440px, 92vw); background: var(--surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: -18px 0 48px rgba(26, 23, 20, 0.18);
  padding: 18px 20px; overflow-y: auto;
}
.audit-slideover-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.audit-slideover-head h2 { margin: 0; font-size: 17px; }
.audit-tier-chips { display: flex; gap: 6px; margin: 12px 0 14px; flex-wrap: wrap; }
.audit-tier-chip {
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px;
  font-weight: 600; color: var(--ink-secondary); cursor: pointer;
}
.audit-tier-chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: var(--surface);
}
.audit-events { list-style: none; margin: 0; padding: 0; }
.audit-events li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.audit-event-name { font-weight: 600; }
.audit-event-meta { flex-basis: 100%; font-size: 12px; color: var(--ink-muted); }

.outcome-line { display: flex; align-items: baseline; gap: 8px; margin: 8px 0; flex-wrap: wrap; }

.artifact {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 14px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}
.artifact .filetype {
  width: 38px; height: 44px; flex: none;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--ok);
  background: var(--surface);
}
.artifact .info { min-width: 0; flex: 1; }
.artifact .fname { font-weight: 600; overflow-wrap: anywhere; }
.artifact .meta { color: var(--ink-muted); font-size: 12.5px; }
.deliverable-copy { color: var(--ink-secondary); font-size: 12.5px; margin: 8px 0 0; }

.fail-panel {
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  padding: 12px 14px;
  margin: 8px 0;
}
.fail-panel .head { color: var(--danger); font-weight: 600; }
.fail-panel p { margin: 6px 0; font-size: 13.5px; }
.fail-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.session-composer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 14px;
}
.session-composer .composer-row { border-top: 0; padding-top: 8px; }
.disabled-reason { font-size: 12.5px; color: var(--ink-muted); }
.example-chip {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-secondary);
  padding: 3px 10px;
  cursor: pointer;
  border-radius: var(--radius-control);
}
.example-chip:hover { background: var(--surface-hover); color: var(--ink); }

.work-surface {
  border: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
@media (max-width: 1079px) { .work-surface { position: static; max-height: none; margin-top: 18px; } }
.work-surface-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.work-surface-head .caption { font-size: 12.5px; color: var(--ink-secondary); }
.work-surface-head .close { margin-left: auto; }
.sheet-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.sheet-tabs button {
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  padding: 7px 14px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.sheet-tabs button[aria-selected="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
  background: var(--accent-soft);
}
.work-surface-body { overflow: auto; padding: 10px 12px; }

.grid-scroll { overflow-x: auto; }
table.grid { border-collapse: collapse; font-size: 12.5px; }
table.grid th, table.grid td {
  border: 1px solid var(--border);
  padding: 3px 8px;
  text-align: left;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.grid th { background: var(--surface-subtle); color: var(--ink-muted); font-weight: 500; font-size: 11.5px; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
table.grid td.edited { background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok-border); }
.edited-marker {
  display: inline-block;
  margin-left: 6px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ok);
  font-weight: 700;
}

.surface-modes { background: var(--surface-subtle); }
.evidence-search { margin: 0 0 10px; }
.evidence-search input { width: 100%; }
.evidence-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); }
.evidence-list li { border-bottom: 1px solid var(--border); }
.evidence-list li:last-child { border-bottom: 0; }
.evidence-row {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 0;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  flex-wrap: wrap;
}
.evidence-row:hover { background: var(--surface-hover); }
.evidence-row .ev-amount { margin-left: auto; }
.ev-amount { font-variant-numeric: tabular-nums lining-nums; }
.evidence-chain { margin-top: 10px; }
.evidence-chain .ev-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.evidence-chain section { border-top: 1px solid var(--border); padding: 10px 0; }
.evidence-chain section p { margin: 0 0 4px; font-size: 13px; }
.evidence-chain h3 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 600;
  margin: 0 0 6px;
}
.evidence-inputs, .evidence-upstream { list-style: none; margin: 0; padding: 0; }
.evidence-inputs li { padding: 3px 0; font-size: 13px; }
.evidence-upstream li { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; font-size: 13px; }
.evidence-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: left;
}
.evidence-link:hover { color: var(--accent-hover); }
.ev-note { font-size: 12px; color: var(--ink-muted); margin: 6px 0 0; }

.connection-row { padding: 14px; }
.connection-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.connection-head .name { font-weight: 600; }
.connection-head .company { color: var(--ink-secondary); font-size: 13px; }

.connection-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.connection-foot:empty { display: none; }
.connection-foot .action { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 719px) { .connection-foot .action { margin-left: 0; width: 100%; } }
.connection-body { margin: 8px 0 0 38px; font-size: 13px; color: var(--ink-secondary); }
@media (max-width: 719px) { .connection-body { margin-left: 0; } }
.connection-body details { margin-top: 6px; }
.connection-body summary { cursor: pointer; color: var(--primary); font-size: 13px; }
.connection-body ul { margin: 6px 0; padding-left: 20px; }
.dataset-picker { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.dataset-picker label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-secondary); }
.connection-facts { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--ink-muted); }
.connection-facts span { white-space: nowrap; }
.import-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.connection-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.connection-fields .field { margin-bottom: 0; min-width: 0; }
.connection-fields .connection-field-wide { grid-column: 1 / -1; }
.connection-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.connection-form-actions .btn { min-width: 180px; }
.dataset-details { margin-top: 12px; }
.dataset-details > summary { font-weight: 600; }
.xero-datasets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
  max-height: 260px;
  overflow: auto;
  padding: 8px 2px;
}
.xero-datasets label { align-items: flex-start; min-width: 0; }
.xero-datasets input { margin-top: 3px; accent-color: var(--primary); }
.report-contacts { margin-top: 12px; }
.import-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.danger-text { color: var(--danger); }
.xero-setup-steps { display: flex; gap: 8px; padding: 0; margin: 14px 0; list-style: none; color: var(--ink-muted); font-size: 12px; }
.xero-setup-steps li { padding: 4px 8px; border-radius: 999px; background: var(--surface-hover); }
.xero-setup-steps .is-current { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-weight: 650; }
.xero-organisations { display: grid; gap: 7px; }
.xero-organisation { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; padding: 10px 12px; color: var(--ink); text-align: left; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.xero-organisation:hover, .xero-organisation.is-selected { border-color: var(--primary); background: var(--surface-hover); }
.xero-organisation span { color: var(--ink-muted); font-size: 12px; }
.xero-setup-stage { margin: 10px 0; }
.xero-setup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.xero-revert { display: block; margin: 16px 0 0 auto; }
.xero-review { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-hover); }
.xero-review p { margin: 4px 0; }
@media (max-width: 719px) {
  .connection-head .connection-actions { width: 100%; }
  .connection-fields { grid-template-columns: 1fr; }
  .xero-datasets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xero-setup-steps { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .xero-datasets { grid-template-columns: 1fr; }
}

.members-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.members-table th, .members-table td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: left; }
.members-table th { color: var(--ink-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.members-table td { overflow-wrap: anywhere; }

.seat-meter { margin: 4px 0 12px; }
.seat-meter .bar { height: 4px; background: var(--surface-subtle); border: 1px solid var(--border); margin-top: 5px; }
.seat-meter .fill { height: 100%; background: var(--primary); }

.invite-row { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-row input { flex: 1; min-width: 0; font-size: 12.5px; }
.team-add-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.team-add-row .field { flex: 1; min-width: 200px; margin: 0; }
.bulk-reason { color: var(--ink-muted); font-size: 12.5px; margin-left: 6px; }

.def-list { margin: 0; display: flex; flex-direction: column; }
.def-list > div {
  display: flex;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.def-list > div:last-child { border-bottom: 0; }
.def-list dt { color: var(--ink-muted); min-width: 120px; font-weight: 500; flex: none; }
.def-list dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }

.voice-preview { max-width: 640px; }

.acting-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--accent-soft);
}
.acting-banner-text { font-weight: 600; font-size: 14px; color: var(--ink); }
.interview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 980px) {
  .interview-layout { grid-template-columns: 1fr; }
}
.interview-pane .transcript { max-height: 480px; overflow-y: auto; }
.interview-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border: 1px solid var(--border);
  border-top: 0;
  background: var(--surface);
  padding: 10px 12px;
}
.interview-composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  resize: vertical;
  min-height: 44px;
}
.interview-composer textarea:focus { outline: none; }
.turn-note { color: var(--ink-secondary); font-size: 12.5px; margin-top: 8px; min-height: 18px; }
.voice-gate { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; flex-wrap: wrap; }
.voice-gate-note { color: var(--ink-muted); font-size: 13px; }
.brain-pane .panel { padding: 14px 16px; }
.brain-count { color: var(--ink-secondary); font-size: 13px; margin: 0 0 10px; }
.brain-pane .section-label { margin-top: 14px; }
.brain-fact { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.brain-fact:last-child { border-bottom: 0; }
.brain-fact .prov { display: block; color: var(--ink-muted); font-size: 12px; margin-top: 2px; }
.slot-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.slot-row:last-child { border-bottom: 0; }
.slot-row .slot-name { overflow-wrap: anywhere; }

.kb-header .page-sub { max-width: 660px; }
.kb-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1180px; margin: 0 0 16px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.kb-summary > div { display: grid; gap: 2px; padding: 13px 16px; border-right: 1px solid var(--border); }
.kb-summary > div:last-child { border-right: 0; }
.kb-summary strong { font-family: var(--font-ui); font-size: 20px; line-height: 1.1; }
.kb-summary span { color: var(--ink-muted); font-size: 11.5px; }
.capacity-card {
  max-width: 1180px; margin: 0 0 16px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  box-shadow: var(--polish-shadow-sm);
}
.capacity-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.capacity-head h2 { margin: 1px 0 0; font-size: 17px; }
.capacity-head p { margin: 3px 0 0; color: var(--ink-muted); font-size: 12px; }
.capacity-head .capacity-eyebrow {
  margin: 0; color: var(--ink-secondary); font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.capacity-data-label {
  flex: none; padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--ink-muted); font-size: 10px; white-space: nowrap;
}
.capacity-head-actions { display: flex; align-items: center; gap: 8px; }
.team-import-panel { padding: 16px 18px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.team-import-head, .team-import-unavailable, .team-import-success {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.team-import-head h3, .team-import-unavailable h3, .team-import-success h3 { margin: 2px 0 3px; font-size: 15px; }
.team-import-head p, .team-import-unavailable p, .team-import-success p { margin: 0; color: var(--ink-muted); font-size: 11px; }
.team-import-head .capacity-eyebrow { margin: 0; color: var(--ink-secondary); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.team-import-boundary { margin: 12px 0 10px; padding: 9px 11px; border: 1px solid var(--ok-border); border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-size: 10.5px; line-height: 1.45; }
.team-import-list { max-height: 320px; margin: 0; padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); list-style: none; }
.team-import-list li { border-bottom: 1px solid var(--border); }
.team-import-list li:last-child { border-bottom: 0; }
.team-import-list label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 11px; }
.team-import-list span { display: grid; min-width: 0; gap: 1px; }
.team-import-list strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.team-import-list small { color: var(--ink-muted); font-size: 9.5px; }
.team-import-list em { color: var(--ok); font-size: 9.5px; font-style: normal; text-align: right; }
.team-import-list .is-duplicate em, .team-import-list .is-possible_duplicate em { color: var(--ink-muted); }
.team-import-list .is-duplicate, .team-import-list .is-possible_duplicate { background: var(--surface-subtle); }
.team-import-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.team-import-actions p { margin: 0; color: var(--ink-muted); font-size: 10px; }
.team-import-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-import-empty p { margin: 0; color: var(--ink-muted); font-size: 11px; }
.team-import-loading { min-height: 120px; }
.capacity-body { padding: 14px 18px 16px; }
.capacity-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 15px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.capacity-metrics > div { display: grid; gap: 1px; padding: 10px 12px; border-right: 1px solid var(--border); }
.capacity-metrics > div:last-child { border-right: 0; }
.capacity-metrics strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.capacity-metrics span { color: var(--ink-muted); font-size: 10.5px; }
.capacity-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(240px, .75fr); gap: 18px; }
.capacity-grid h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .045em; }
.capacity-demand, .capacity-people { list-style: none; margin: 0; padding: 0; }
.capacity-demand {
  max-height: 460px;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.capacity-demand-row { padding: 11px 0 12px 10px; border-top: 1px solid var(--border); border-left: 3px solid var(--border-strong); }
.capacity-demand-row:first-child { border-top: 0; }
.capacity-demand-row.is-high { border-left-color: var(--danger); }
.capacity-demand-row.is-medium { border-left-color: var(--warn); }
.capacity-demand-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.capacity-demand-title { display: grid; gap: 1px; min-width: 0; }
.capacity-demand-title strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.capacity-demand-title > span { color: var(--ink-muted); font-size: 10.5px; }
.capacity-demand-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.capacity-demand-tags span { padding: 2px 6px; border-radius: 999px; background: var(--surface-subtle); color: var(--ink-secondary); font-size: 9.5px; }
.capacity-demand-tags .is-boundary { background: var(--ok-soft); color: var(--ok); }
.capacity-demand-tags .is-sample { background: var(--warn-soft); color: var(--warn); }
.capacity-demand-tags .is-risk { border: 1px solid var(--warn-border); background: var(--warn-soft); color: var(--warn); }
.capacity-demand-row.is-high .capacity-demand-tags .is-risk { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger); }
.capacity-demand-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 0; }
.capacity-demand-meta div { min-width: 0; }
.capacity-demand-meta dt { color: var(--ink-muted); font-size: 9.5px; }
.capacity-demand-meta dd { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 10.5px; }
.capacity-demand-meta small { color: var(--ink-muted); font-size: 9px; }
.capacity-demand-meta .is-gap { color: var(--warn); }
.capacity-candidates { margin: 7px 0 0; color: var(--ink-muted); font-size: 10px; }
.capacity-people { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.capacity-people li { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.capacity-people li:last-child { border-bottom: 0; }
.capacity-people span { display: grid; min-width: 0; }
.capacity-people strong { font-size: 11px; }
.capacity-people small { color: var(--ink-muted); font-size: 9.5px; }
.capacity-people em { color: var(--ink-secondary); font-size: 9.5px; font-style: normal; text-align: right; }
.capacity-grid aside > p, .capacity-assumption-note { color: var(--ink-muted); font-size: 9.5px; line-height: 1.45; }
.capacity-grid aside > p { margin: 7px 2px 0; }
.capacity-assumption-note { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.capacity-empty { padding: 12px; border-radius: 8px; background: var(--surface-subtle); color: var(--ink-muted); font-size: 11px; }
.capacity-empty-state {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface-subtle);
}
.capacity-empty-state h3 { margin: 0 0 6px; font-size: 15px; }
.capacity-empty-state p { max-width: 62ch; margin: 0; color: var(--ink-muted); font-size: 12px; line-height: 1.55; }
.kb-workspace {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .75fr);
  gap: 16px; max-width: 1180px; align-items: stretch;
}
.kb-map-card, .kb-directory {
  min-width: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); box-shadow: var(--polish-shadow-sm);
}
.kb-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 18px 13px; border-bottom: 1px solid var(--border);
}
.kb-card-head h2, .kb-directory-head h2 { margin: 0; font-size: 15px; }
.kb-card-head p { margin: 3px 0 0; color: var(--ink-muted); font-size: 12px; }
.kb-live-key { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-muted); font-size: 10.5px; white-space: nowrap; }
.kb-live-key i { width: 7px; height: 7px; border-radius: 50%; background: #2e8b57; box-shadow: 0 0 0 3px rgba(46,139,87,.11); }
.kb-graph { height: 540px; width: 100%; overflow: hidden; background: var(--surface-subtle); }
.kb-map-card > .form-error { margin: 10px 16px 14px; }
.kb-map-card #kbGraphTree:focus-within {
  position: absolute; z-index: 20; width: min(360px, calc(100vw - 32px)); height: auto;
  margin: 10px 16px; padding: 12px; overflow: auto; clip: auto; white-space: normal;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  box-shadow: var(--polish-shadow-lg);
}
.kb-map-card .cb-person-action {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 2px 4px;
  border: 0; border-radius: 4px; background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.kb-map-card .cb-person-action:hover { background: var(--surface-hover); }
.kb-directory { display: flex; flex-direction: column; height: auto; min-height: 0; }
.kb-directory-head { display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); }
.kb-directory-head input {
  width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit;
}
.kb-directory-head input:focus { outline: 2px solid var(--accent-soft); border-color: var(--primary); }
.kb-people-list { max-height: none; overflow: visible; border-bottom: 1px solid var(--border); }
.kb-person-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center;
  gap: 9px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--ink); text-align: left; cursor: pointer;
}
.kb-person-row:last-child { border-bottom: 0; }
.kb-person-row:hover { background: var(--surface-hover); }
.kb-person-row.is-active { background: var(--surface-subtle); box-shadow: inset 3px 0 0 var(--ink); }
.kb-person-row-avatar, .kb-person-avatar {
  display: grid; place-items: center; border-radius: 9px; background: var(--surface-subtle);
  color: var(--ink-secondary); font-family: var(--font-ui); font-size: 11px; font-weight: 700;
}
.kb-person-row-avatar { width: 30px; height: 30px; }
.kb-person-row > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }
.kb-person-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.kb-person-row small { overflow: hidden; color: var(--ink-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.kb-person-row em { color: var(--ink-muted); font-size: 10.5px; font-style: normal; }
.kb-person-panel { flex: 1; min-height: 0; padding: 16px; overflow: visible; }
.kb-person-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.kb-person-avatar { flex: none; width: 38px; height: 38px; font-size: 13px; }
.kb-person-heading h3 { margin: 0; font-size: 16px; }
.kb-person-heading p { margin: 2px 0 0; color: var(--ink-muted); font-size: 11.5px; }
.kb-person-meta { display: grid; gap: 6px; margin: 0 0 15px; }
.kb-person-meta > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; font-size: 11.5px; }
.kb-person-meta dt { color: var(--ink-muted); }
.kb-person-meta dd { margin: 0; overflow-wrap: anywhere; }
.kb-responsibilities { margin: 0 0 16px; }
.kb-responsibilities h4, .kb-knowledge-head h4 { margin: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .045em; }
.kb-responsibilities ul { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 7px 0 0; padding: 0; }
.kb-responsibilities li { padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink-secondary); font-size: 10.5px; }
.kb-knowledge-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 7px; }
.kb-knowledge-head span, .kb-fact-limit { color: var(--ink-muted); font-size: 10.5px; }
.kb-fact-list { list-style: none; margin: 0; padding: 0; }
.kb-fact-list li { padding: 9px 0; border-top: 1px solid var(--border); }
.kb-fact-list p { margin: 0 0 4px; font-size: 11.5px; line-height: 1.45; }
.kb-fact-meta { color: var(--ink-muted); font-size: 10px; }
.kb-fact-meta.is-confirmed, .kb-fact-meta.is-corroborated { color: #287449; }
.kb-fact-meta.is-disputed { color: var(--warn); }
.kb-fact-list details { margin-top: 6px; color: var(--ink-muted); font-size: 10.5px; }
.kb-fact-list summary { cursor: pointer; }
.kb-citation-list, .kb-relationship-list, .kb-active-work {
  display: grid; gap: 6px; list-style: none; margin: 7px 0 14px; padding: 0;
}
.kb-citation-list li, .kb-relationship-list li, .kb-active-work li {
  display: grid; gap: 2px; padding: 7px 8px; border: 1px solid var(--border);
  border-radius: 7px; color: var(--ink-secondary); font-size: 10.5px;
}
.kb-citation-list code { overflow-wrap: anywhere; color: var(--ink); font-size: 10px; }
.kb-citation-list small, .kb-relationship-list small { color: var(--ink-muted); }
.kb-active-work li { grid-template-columns: minmax(0, 1fr) auto; }
.kb-active-work span { color: var(--ink-muted); text-transform: capitalize; }
.kb-node-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.kb-knowledge-empty { margin: 0; padding: 12px; border-radius: 8px; background: var(--surface-subtle); color: var(--ink-muted); font-size: 11.5px; }
.kb-source-note { max-width: 1180px; margin: 10px 2px 0; color: var(--ink-muted); font-size: 10.5px; }
.kb-operations-section {
  max-width: 1180px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.kb-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.kb-section-head .section-label { margin-bottom: 2px; }
.kb-section-head h2 { font-size: 20px; }
.kb-section-head p { max-width: 66ch; margin: 5px 0 0; color: var(--ink-muted); font-size: 12px; line-height: 1.5; }
.kb-operations-section .capacity-card { max-width: none; }
@media (max-width: 900px) {
  .capacity-grid { grid-template-columns: 1fr; }
  .kb-workspace { grid-template-columns: 1fr; }
  .kb-directory { height: auto; min-height: 0; }
  .kb-people-list, .kb-person-panel { max-height: none; }
}
@media (max-width: 560px) {
  .capacity-head { flex-direction: column; }
  .kb-section-head { align-items: flex-start; flex-direction: column; }
  .capacity-head-actions { width: 100%; justify-content: space-between; }
  .capacity-data-label { white-space: normal; }
  .capacity-metrics { grid-template-columns: 1fr; }
  .capacity-metrics > div { grid-template-columns: 86px 1fr; align-items: baseline; border-right: 0; border-bottom: 1px solid var(--border); }
  .capacity-metrics > div:last-child { border-bottom: 0; }
  .capacity-demand-main { display: grid; }
  .capacity-demand-tags { justify-content: flex-start; }
  .capacity-demand-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-import-head, .team-import-unavailable, .team-import-success, .team-import-actions { display: grid; }
  .team-import-list label { grid-template-columns: auto minmax(0, 1fr); }
  .team-import-list em { grid-column: 2; text-align: left; }
  .kb-summary { grid-template-columns: 1fr; }
  .kb-summary > div { grid-template-columns: 64px 1fr; align-items: baseline; border-right: 0; border-bottom: 1px solid var(--border); }
  .kb-summary > div:last-child { border-bottom: 0; }
  .kb-graph { height: 430px; }
  .kb-live-key { display: none; }
}

.coverage-progress { color: var(--ink-secondary); font-size: 13px; margin: 0 0 6px; }
.coverage-bar {
  height: 6px; border-radius: 999px; background: var(--surface-2, rgba(127,127,127,0.15));
  overflow: hidden;
}
.coverage-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

.interview-pane .section-label { margin-top: 14px; }
.interview-pane > .section-label:first-child,
.brain-pane > .section-label:first-child { margin-top: 0; margin-bottom: 8px; }

.transcript { border: 1px solid var(--border); background: var(--surface); }
.transcript > div { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.transcript > div:last-child { border-bottom: 0; }
.transcript .who { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); font-weight: 600; margin-bottom: 3px; }
.transcript .interviewer { background: var(--surface-subtle); }
.voice-flow-arrow { text-align: center; color: var(--ink-muted); padding: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

:root {
  --destructive: #6e211c;
  --destructive-soft: rgba(110, 33, 28, 0.07);
  --destructive-border: rgba(110, 33, 28, 0.38);
}

.settings-header { margin-bottom: 22px; }
.settings-summary { color: var(--ink-secondary); font-size: 13.5px; margin: 6px 0 14px; }

.settings-layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  max-width: 860px;
}
@media (max-width: 899px) { .settings-layout { grid-template-columns: 1fr; } }

.settings-anchors {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
@media (max-width: 899px) { .settings-anchors { position: static; flex-direction: row; flex-wrap: wrap; gap: 2px 14px; } }
.settings-anchors a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid transparent;
}
.settings-anchors a:hover { color: var(--ink); background: var(--surface-hover); }

.settings-section { margin-bottom: 26px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-title { font-size: 17px; }
.settings-section .settings-summary { margin: 4px 0 14px; }
.settings-note { color: var(--ink-secondary); font-size: 13.5px; line-height: 1.65; margin: 4px 0 0; }

.fact-list {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: baseline;
  row-gap: 9px;
  column-gap: 14px;
  margin: 0 0 14px;
  font-size: 13.5px;
}
.fact-list dt { color: var(--ink-muted); }
.fact-list dd { margin: 0; overflow-wrap: anywhere; }
.fact-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.settings-hint { color: var(--ink-muted); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
.org-kind-toggle { display: flex; gap: 18px; flex-wrap: wrap; }
.org-kind-option { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.org-kind-option input { accent-color: var(--primary); }

.org-name-edit { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-name-edit input { min-height: 34px; max-width: 280px; padding: 6px 10px; }
.mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums lining-nums;
}

.ledger-table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.65; }
.ledger-table th, .ledger-table td {
  border-bottom: 1px solid var(--border);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}
.ledger-table th {
  color: var(--ink-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.ledger-table td { font-variant-numeric: tabular-nums lining-nums; }
.ledger-table tr:last-child td { border-bottom: 0; }

.settings-members th, .settings-members td { padding-right: 12px; }
.settings-members .member-action { text-align: right; white-space: nowrap; }
.remove-confirm { display: inline-flex; gap: 6px; }

.btn.destructive {
  background: var(--surface);
  border-color: var(--destructive-border);
  color: var(--destructive);
  font-weight: 500;
}
.btn.destructive:hover:not(:disabled) { background: var(--destructive-soft); }

.confirm-block {
  border: 1px solid var(--destructive-border);
  background: var(--surface);
  padding: 12px 14px;
  margin: 10px 0;
  max-width: 560px;
}
.confirm-block .confirm-head { font-weight: 600; color: var(--destructive); margin: 0 0 6px; }
.confirm-block p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-secondary); }
.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.guide-page { max-width: 1120px; margin: 0 auto; padding-bottom: 56px; }
.guide-crumb { font-size: 13px; color: var(--ink-muted); margin: 0 0 10px; }
.guide-crumb a { text-decoration: none; }
.guide-deck {
  max-width: 62ch;
  margin: 9px 0 0;
  color: var(--ink-secondary);
  font-size: 14px;
}

.guide-page > .guide-note {
  margin: -4px 0 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.guide-page > .guide-note > summary {
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.guide-page > .guide-note > summary::-webkit-details-marker { display: none; }
.guide-page > .guide-note > .integration-policy-summary {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--ink-muted);
  font-size: 11.5px;
}
.guide-page > .guide-note dl { margin: 0; border-top: 1px solid var(--border); }
.guide-page > .guide-note dl > div {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(0, 1.7fr);
  gap: 18px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.guide-page > .guide-note dl > div:last-child { border-bottom: 0; }
.guide-page > .guide-note dt {
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 650;
}
.guide-page > .guide-note dd {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.guide-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.guide-rail {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
}
.guide-nav {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 12px 12px;
}
.guide-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.guide-nav-link {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  padding: 6px 10px;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  color: var(--ink-secondary);
  cursor: pointer;
}
.guide-nav-link:hover { color: var(--ink); background: var(--surface-hover); }
.guide-nav-link[aria-current="location"] {
  color: var(--ink);
  background: var(--surface-hover);
  font-weight: 600;
}

.guide-account {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  margin: 0;
}
.guide-account .empty-note { margin-bottom: 0; }

.guide-body { min-width: 0; font-size: 14.5px; }
.guide-body > p:first-child {
  margin-top: 0;
  padding: 14px 16px;
  border-left: 2px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink-secondary);
}
.guide-section {
  border: 1px solid var(--border);
  background: var(--surface);
  margin-top: 16px;
  padding: 20px 22px 22px;
}
.guide-section h2 { font-size: 20px; margin: 0 0 14px; }
.guide-subsection { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.guide-subsection h3 { font-size: 16.5px; font-weight: 600; margin: 0 0 8px; }
.guide-body p { margin: 10px 0; }
.guide-list { margin: 10px 0; padding-left: 24px; }
.guide-list li { margin: 6px 0; }
.guide-list li > p:first-child { margin-top: 0; }
.guide-list li > p:last-child { margin-bottom: 0; }
.guide-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

.guide-note {
  border-left: 2px solid var(--border-strong);
  background: var(--surface-subtle);
  margin: 12px 0;
  padding: 10px 14px;
  color: var(--ink-secondary);
}
.guide-note p { margin: 0; }

.guide-codeblock {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 12px;
  margin: 12px 0;
}
.guide-codeblock pre { margin: 0; min-width: 0; overflow-x: auto; }
.guide-codeblock code { background: none; border: 0; padding: 0; }

.copy-chip { display: inline-flex; align-items: baseline; gap: 6px; }
.copy-btn {
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 1px 7px;
  cursor: pointer;
  flex: none;
}
.copy-btn:hover { border-color: var(--primary); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok-border); background: var(--ok-soft); }

.guide-table-scroll { overflow-x: auto; margin: 12px 0; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.guide-table th, .guide-table td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.guide-table th { background: var(--surface-subtle); color: var(--ink-secondary); font-weight: 600; font-size: 12.5px; }
.guide-table td { min-width: 140px; }

@media (max-width: 880px) {
  .guide-layout { grid-template-columns: 1fr; gap: 20px; }
  .guide-rail { position: static; }
  .guide-nav ol { display: flex; flex-wrap: wrap; gap: 4px; }
  .guide-nav-link { width: auto; }
}
@media (max-width: 620px) {
  .guide-page > .guide-note dl > div { grid-template-columns: 1fr; gap: 3px; }
  .guide-section { padding: 17px 16px 19px; }
}

.legal-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px 64px; }
.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.legal-back { font-size: 13.5px; }
.legal-top .brand-mark {

  width: 44px;
  height: 44px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--polish-shadow-sm);
}

.legal-doc {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 44px 48px 36px;
  box-shadow: var(--polish-shadow-md);
  animation: login-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 60ms backwards;
}
.legal-doc::before {

  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--primary);
}
@media (prefers-reduced-motion: reduce) {
  .legal-doc { animation: none; }
}
.legal-header { border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.legal-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  font-weight: 600;
  margin: 0 0 10px;
}
.legal-doc h1 { font-size: 27px; }
.legal-summary { color: var(--ink-secondary); font-size: 14.5px; margin: 10px 0 0; max-width: 56ch; }
.legal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--ink-muted);
  font-size: 13px;
  margin: 14px 0 0;
}
.legal-flag {
  display: inline-block;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 1px 7px;
}

.legal-section { border-bottom: 1px solid var(--border); padding: 22px 0; }
.legal-section:last-of-type { border-bottom: 0; }
.legal-section h2 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 8px; }
.legal-section p, .legal-section li { color: var(--ink-secondary); font-size: 14px; line-height: 1.7; }
.legal-section p { margin: 8px 0 0; }
.legal-section ul { margin: 8px 0 0; padding-left: 20px; }
.legal-section li { margin: 6px 0; }
.legal-section li strong, .legal-section p strong { color: var(--ink); font-weight: 600; }
.legal-section code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--surface-subtle);
  padding: 1px 4px;
}
.legal-section.integration-access-policy dl { margin: 12px 0 0; }
.legal-section.integration-access-policy dl > div {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(0, 1.8fr);
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.legal-section.integration-access-policy dl > div:last-child { border-bottom: 0; }
.legal-section.integration-access-policy dt {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}
.legal-section.integration-access-policy dd {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 13.5px;
  line-height: 1.65;
}
@media (max-width: 620px) {
  .legal-section.integration-access-policy dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.legal-table-scroll { overflow-x: auto; margin-top: 12px; }
.legal-table { min-width: 620px; }
.legal-table td { font-variant-numeric: normal; }
.legal-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }

.legal-footer {
  border-top: 1px solid var(--border-strong);
  margin-top: 8px;
  padding-top: 16px;
  color: var(--ink-muted);
  font-size: 13px;
}
.legal-footer p { margin: 6px 0 0; }
.legal-cross { text-align: center; color: var(--ink-muted); font-size: 13px; margin-top: 20px; }

@media (max-width: 640px) {
  .legal-doc { padding: 26px 20px; }
  .legal-wrap { padding: 24px 12px 48px; }
}

.scope-consent-dialog {
  padding: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  max-width: 480px;
  width: calc(100vw - 32px);
  box-shadow: 0 24px 60px rgba(26, 23, 20, 0.22);
}
.scope-consent-dialog::backdrop { background: rgba(26, 23, 20, 0.42); }

.scope-consent { padding: 22px 24px 20px; margin: 0; }
.scope-consent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.scope-consent-head h2 {
  font-size: 18px;
  line-height: 1.25;
  flex: 1 1 220px;
  min-width: 0;
}
.scope-consent-close { margin-left: auto; }

.scope-consent-intro { font-size: 13.5px; color: var(--ink-secondary); margin: 0 0 14px; }
.scope-consent-gate {
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  padding: 8px 12px;
  margin: 0 0 14px;
}

.scope-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.scope-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border);
}
.scope-row-focus { background: var(--accent-soft); }
.scope-toggle { display: flex; align-items: center; gap: 11px; flex: 1; cursor: pointer; }
.scope-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.scope-toggle-track {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.scope-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.28);
  transition: transform 0.12s ease;
}
.scope-toggle input:checked + .scope-toggle-track {
  background: var(--primary);
  border-color: var(--primary);
}
.scope-toggle input:checked + .scope-toggle-track .scope-toggle-knob { transform: translateX(16px); }
.scope-toggle input:focus-visible + .scope-toggle-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.scope-toggle input:disabled + .scope-toggle-track { opacity: 0.5; }
.scope-toggle input:disabled ~ .scope-label { color: var(--ink-muted); }
.scope-toggle:has(input:disabled) { cursor: default; }
.scope-label { font-size: 14px; }
.scope-state { flex: none; }

.scope-consent-error:empty { display: none; }
.scope-consent-foot { margin-top: 14px; }
.scope-consent-foot .empty-note { margin: 0; }

@media (max-width: 640px) {
  .scope-consent { padding: 18px 16px 16px; }
}

.people-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.people-monogram {
  width: 22px; height: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.people-joined-at { color: var(--ink-muted); font-size: 12px; margin-left: 6px; }

.people-processes { color: var(--ink-secondary); }
.people-active { color: var(--ink-muted); margin-left: 6px; }
.membership { font-family: var(--font-ui); }
.membership-ok { color: var(--ok); }
.membership-pending { color: var(--ink-secondary); }
.membership-muted { color: var(--ink-muted); }

.person-actions { text-align: right; }
.person-menu { position: relative; display: inline-block; }
.person-actions-toggle {
  list-style: none;
  cursor: pointer;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-secondary);
  font-weight: 700;
  user-select: none;
}
.person-actions-toggle::-webkit-details-marker { display: none; }
.person-menu[open] .person-actions-toggle { border-color: var(--primary); color: var(--ink); }
.person-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(26, 23, 20, 0.12);
  padding: 4px;
}
.person-menu-list a,
.person-menu-list button {
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
}
.person-menu-list a:hover,
.person-menu-list button:hover { background: var(--accent-soft); color: var(--ink); }
.role-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.role-edit select { font: inherit; max-width: 180px; }
.star-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-muted);
  cursor: pointer;
}
.star-toggle svg { fill: none; }
.star-toggle:hover { color: var(--ink); border-color: var(--border); }
.star-toggle[aria-pressed="true"] { color: var(--primary); }
.star-toggle[aria-pressed="true"] svg { fill: currentColor; }
.star-toggle:disabled { opacity: 0.6; cursor: default; }

.team-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 980px;
}

.roster-card {
  min-width: 0;

  position: relative;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.roster-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}
.roster-card-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.roster-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}
.roster-card-note { color: var(--ink-muted); font-size: 12.5px; }
.roster-card > .members-table { min-width: 520px; }
.roster-card .members-table th {
  padding: 10px 12px;
  font-size: 11.5px;
  letter-spacing: 0.065em;
}
.roster-card .members-table td {
  height: 56px;
  padding: 8px 12px;
  color: var(--ink-secondary);
  font-size: 13px;
}
.roster-card .members-table tbody tr:last-child td { border-bottom: 0; }
.roster-card .empty-note { margin: 12px 16px; }
.roster-card > .form-error { margin: 8px 16px 12px; }
.roster-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.roster-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.035em;
}
.roster-person-name { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.roster-card .people-table { min-width: 720px; }
@media (max-width: 1079px) {

  .roster-card .people-table { min-width: 640px; }
}
.roster-card .people-monogram {
  width: 32px;
  height: 32px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.cb-tree-panel { padding: 14px 16px 4px; }
.cb-tree-panel .skeleton-row { margin: 8px 0; }
.cb-tree {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cb-tree .cb-tree {
  margin: 4px 0 4px 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}
.cb-team-children {
  margin: 4px 0 8px 10px;
  padding: 0 0 0 12px;
  list-style: none;
  border-left: 1px solid var(--border);
}
.cb-team { margin: 0 0 6px; }
.cb-team-name {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.cb-team-count {
  margin-left: 8px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: var(--ink-muted);
}
.cb-person {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 22px;
  padding: 2px 0;
}
.cb-person-name { font-size: 13px; color: var(--ink); }
.cb-role { font-size: 11.5px; color: var(--ink-muted); }
.cb-unassigned { margin-top: 12px; }
.cb-unassigned-title {
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.cb-empty {
  margin: 0;
  padding: 26px 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

.cb-graph-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px 24px 32px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  text-align: center;
}
.cb-graph-empty-art {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.cb-graph-empty-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.cb-graph-empty-dot:nth-child(2) { width: 16px; height: 16px; }
.cb-graph-empty-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}
.cb-graph-empty-body {
  margin: 0;
  max-width: 44ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
}
.cb-graph-empty-action { margin-top: 6px; }

.iv-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.iv-topline .page-header { margin-bottom: 0; min-width: 0; }
.iv-topline .voice-gate { margin: 4px 0 0; justify-content: flex-end; }
.iv-topline + .interview-layout { margin-top: 22px; }
.iv-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
  margin-bottom: 10px;
}
.iv-stage-head .section-label { margin: 0; }
.iv-mode {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(92, 86, 80, 0.07);
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.iv-mode.live { color: var(--primary); background: var(--accent-soft); }
.iv-session-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 16px;
}
.iv-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.iv-idline { display: flex; flex-direction: column; min-width: 0; }
.iv-name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.iv-role { font-size: 12.5px; color: var(--ink-muted); }

.iv-session-head + .transcript { border-top: 0; }
.interview-pane .transcript > div { font-size: 13.5px; line-height: 1.62; color: var(--ink-secondary); }
.interview-pane .transcript > div:not(.interviewer) { color: var(--ink); }
.voice-gate .btn {
  min-height: 38px;
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink-secondary);
  font-weight: 500;
}

.brain-pane .brain-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  margin: 0 0 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(92, 86, 80, 0.07);
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.brain-pane .brain-fact { font-size: 13px; line-height: 1.55; color: var(--ink); }
.brain-pane .brain-fact .prov { font-size: 11.5px; margin-top: 3px; }

.slot-row .slot-state {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.slot-row .slot-state-mapped { color: var(--primary); }

.connections-view,
.settings-view {

  --polish-shadow-sm: 0 1px 2px rgba(26, 23, 20, .07), 0 4px 12px rgba(26, 23, 20, .04);
  --polish-shadow-md: 0 8px 24px rgba(26, 23, 20, .09);
  --polish-primary-shadow: 0 1px 2px rgba(28, 20, 100, .20), 0 5px 14px rgba(79, 70, 229, .18);
}

.provider-tile {
  display: grid;
  place-items: center;
  flex: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.provider-tile .logo-img {
  width: 68%;
  height: 68%;
  border-radius: 5px;
  object-fit: contain;
  background: #fff;
  display: block;
}
.provider-tile svg { width: 62%; height: 62%; display: block; }
.provider-tile .tile-monogram {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-secondary);
}

.connections-view .btn,
.settings-view .btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}
.connections-view .btn.primary,
.settings-view .btn.primary {
  border-color: rgba(32, 26, 137, .42);
  box-shadow: var(--polish-primary-shadow);
}
.connections-view .btn.primary:hover:not(:disabled),
.settings-view .btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 3px rgba(28, 20, 100, .18), 0 7px 18px rgba(79, 70, 229, .22);
}
.connections-view .btn.ghost,
.settings-view .btn.ghost {
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(26, 23, 20, .04);
}
.connections-view .btn.ghost:hover:not(:disabled),
.settings-view .btn.ghost:hover:not(:disabled),
.connections-view .btn.quiet:hover:not(:disabled),
.settings-view .btn.quiet:hover:not(:disabled) {
  border-color: #bdb4a5;
  transform: translateY(-1px);
}
.connections-view .btn:active:not(:disabled),
.settings-view .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(26, 23, 20, .10);
}
.connections-view .btn:disabled,
.settings-view .btn:disabled { transform: none; box-shadow: none; }
.connections-view .btn.small,
.settings-view .btn.small { min-height: 32px; padding: 6px 11px; font-size: 13.5px; }
.connections-view .btn.quiet,
.settings-view .btn.quiet {
  min-height: 32px;
  padding: 4px 8px;
  border-color: transparent;
  box-shadow: none;
}
.connections-view .btn.quiet:hover:not(:disabled),
.settings-view .btn.quiet:hover:not(:disabled) { border-color: transparent; }

.connections-view .field input,
.connections-view .field select,
.connections-view .field textarea,
.settings-view .field input,
.settings-view .field select,
.settings-view .field textarea { border-radius: 8px; }
.connections-view .field input:focus,
.connections-view .field select:focus,
.connections-view .field textarea:focus,
.settings-view .field input:focus,
.settings-view .field select:focus,
.settings-view .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.connections-view { max-width: 1280px; margin: 0 auto; padding-bottom: 56px; }
.connections-view .page-sub { max-width: 680px; font-size: 15px; }
.connections-view [hidden] { display: none !important; }

.connections-view .connections-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: end;
  gap: 28px;
}
.connections-view .connection-search {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink-muted);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.connections-view .connection-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}
.connections-view .connection-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-family: var(--font-ui);
}
.connections-view .connection-search input::placeholder { color: var(--ink-muted); }
.connections-view .search-glyph {
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
  flex: none;
}
.connections-view .search-glyph::after {
  content: "";
  width: 6px;
  height: 1.5px;
  position: absolute;
  right: -5px;
  bottom: -2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
  border-radius: 2px;
}
.connections-view .connection-empty {
  padding: 38px 20px;
  text-align: center;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}
.connections-view .connection-empty strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 3px;
}
.connections-view .connection-load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: -18px 0 30px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  color: var(--ink-secondary);
  font-size: 12.5px;
}
.connections-view .connection-load-error strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 650;
}
@media (max-width: 820px) {
  .connections-view .connections-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 18px;
  }
}

.connections-view .connection-section + .connection-section { margin-top: 34px; }
.connections-view .connection-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.connections-view .connection-section-head h2 { font-size: 18px; line-height: 1.25; }
.connections-view .connection-section-head p { margin: 3px 0 0; color: var(--ink-muted); font-size: 13px; }
.connections-view .slack-client-scope {
  max-width: 320px;
  margin: 16px 0;
}
.connections-view .slack-identity-link,
.connections-view .slack-channel-access {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.connections-view .slack-manual-link { margin-top: 10px; }
.connections-view .slack-manual-link summary {
  width: fit-content;
  color: var(--ink-secondary);
  cursor: pointer;
}
.connections-view .slack-manual-link .field { margin: 10px 0; }
.connections-view .slack-channel-access .connection-section-head {
  align-items: center;
  margin-bottom: 10px;
}
.connections-view .slack-channel-access h3 {
  margin: 0;
  font-size: 14px;
}
.connections-view .slack-channel-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
.connections-view .slack-channel-option label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  cursor: pointer;
}
.connections-view .slack-channel-option select {
  width: min(220px, 44%);
}
.connections-view .slack-channel-option input { margin: 0; }
@media (max-width: 620px) {
  .connections-view .slack-channel-option {
    align-items: stretch;
    flex-direction: column;
  }
  .connections-view .slack-channel-option select { width: 100%; }
}
.connections-view .connection-section-unavailable {
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.connections-view .connection-section-unavailable .connections-grid {
  background: transparent;
}
.connections-view .connection-section-unavailable .connection-row {
  background: var(--surface-subtle);
}
.connections-view .result-count,
.settings-view .section-count {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 20px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(92, 86, 80, .08);
  border: 1px solid rgba(92, 86, 80, .12);
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* A composed first paint prevents a slow catalog read from turning this page
   into an empty white canvas. The skeleton mirrors the final tile geometry so
   the page does not jump when the catalog arrives. */
.connections-view .connections-loading-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.connections-view .connection-loading-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.connections-view .connection-loading-mark,
.connections-view .connection-loading-copy span {
  display: block;
  background: linear-gradient(90deg, #eee9e2 20%, #f8f5f0 50%, #eee9e2 80%);
  background-size: 220% 100%;
  animation: connection-loading-shimmer 1.25s ease-in-out infinite;
}
.connections-view .connection-loading-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
}
.connections-view .connection-loading-copy {
  display: grid;
  flex: 1;
  gap: 7px;
}
.connections-view .connection-loading-copy span {
  width: min(150px, 72%);
  height: 10px;
  border-radius: 999px;
}
.connections-view .connection-loading-copy span:last-child {
  width: min(96px, 48%);
  height: 7px;
  opacity: .76;
}
@keyframes connection-loading-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .connections-view .connection-loading-mark,
  .connections-view .connection-loading-copy span { animation: none; }
}
@media (max-width: 1099px) {
  .connections-view .connections-loading-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
  .connections-view .connections-loading-grid { grid-template-columns: minmax(0, 1fr); }
  .connections-view .connection-load-error { align-items: flex-start; flex-direction: column; }
}
.connections-view .connections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  padding: 0;
  background: transparent;
  border: 0;
}
.connections-view .connections-grid > * { border-bottom: 0; }
.connections-view .connections-grid .connection-tile {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background-color 140ms ease;
}
.connections-view .connections-grid .connection-tile:hover {
  background: var(--surface-hover);
}
.connections-view .connections-grid .connection-tile:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.connections-view .connections-grid .connection-tile .name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-tile-state {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink-muted);
}
.connection-tile-state[data-conn-state="connected"] { background: #2e8b57; }
.connection-tile-state[data-conn-state="available"] { background: #b9b3ab; }
.connection-tile-state[data-conn-state="attention"] { background: #c2691f; }
.connection-tile-state[data-conn-state="unconfigured"] {
  background: transparent;
  border: 1px solid var(--border-strong, #cfc8bf);
}

.connection-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--polish-shadow-md, 0 18px 48px rgba(40, 34, 28, .22));
  overflow: hidden;
}
.connection-modal[open] {
  display: flex;
  flex-direction: column;
}
.connection-modal::backdrop { background: rgba(40, 34, 28, .38); }

html:has(.connection-modal[open]) { overflow: hidden; }
.connection-modal-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px 15px 20px;
  border-bottom: 1px solid var(--border);
  background: #fffdfa;
}
.connection-modal-title { min-width: 0; flex: 1 1 auto; }
.connection-modal-title > span {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.3;
  text-transform: uppercase;
}
.connection-modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
}
.connection-modal-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 9px;
}
.connection-modal-client {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
}
.connection-modal-client > span {
  flex: none;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.connection-modal-client select {
  min-width: 180px;
  max-width: 260px;
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}
.connection-modal-client select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.connection-modal-client strong {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}
.connection-modal-close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
}
.connection-modal-close:hover { background: rgba(92, 86, 80, .08); color: var(--ink); }
.connection-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.connection-modal .connection-card { padding: 0; border: 0; background: transparent; }
.connection-modal .connection-head { display: none; }
.connections-view .connection-modal .connection-body { margin: 0; }
.connection-modal .connection-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.connection-section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.connection-assignment-error { margin: 12px 0 0; }
.connection-sample-box {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.connection-sample-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}
.connection-sample-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 650;
}
.connection-sample-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.sample-data-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 10px;
}
.sample-data-toolbar label { min-width: min(310px, 70%); }
.sample-data-toolbar label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 650;
}
.sample-data-toolbar select {
  width: 100%;
  min-height: 34px;
  padding: 6px 28px 6px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.sample-data-toolbar > span {
  padding-bottom: 7px;
  color: var(--ink-muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.sample-data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sample-data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 11px;
}
.sample-data-table th,
.sample-data-table td {
  max-width: 210px;
  padding: 8px 9px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sample-data-table th:last-child,
.sample-data-table td:last-child { border-right: 0; }
.sample-data-table tbody tr:last-child td { border-bottom: 0; }
.sample-data-table th {
  background: #fbf8f4;
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
}
.connection-lane {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbf8f4;
}
.connection-lane h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 650;
}
.connection-lane span {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}
@media (max-width: 1099px) {
  .connections-view .connections-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
  .connections-view .connections-grid { grid-template-columns: minmax(0, 1fr); }
  .connection-modal { width: calc(100vw - 20px); }
  .connection-modal-head { padding-left: 16px; }
  .connection-modal-client { align-items: flex-start; flex-direction: column; gap: 4px; width: 100%; }
  .connection-modal-client select { width: 100%; max-width: none; }
  .sample-data-toolbar { align-items: stretch; flex-direction: column; gap: 4px; }
  .sample-data-toolbar label { min-width: 0; width: 100%; }
  .sample-data-toolbar > span { padding-bottom: 0; }
}
.connections-view .connection-head .name {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.connections-view .connection-body { margin: 10px 0 0 50px; font-size: 12.5px; }
.connections-view .connection-body .form-error:empty,
.connections-view .connection-body .form-ok:empty { display: none; }
.connections-view .connection-intro {
  max-width: 58ch;
  color: var(--ink-secondary);
  line-height: 1.55;
}
.connections-view .connection-access-note {
  max-width: 62ch;
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.connections-view .connection-access-note strong {
  color: var(--ink-secondary);
  font-weight: 600;
}
.connections-view .connection-setup {
  max-width: 760px;
  margin-top: 14px;
  border: 1px solid var(--border);
  background: #fbf8f4;
}
.connections-view .connection-setup-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 11px 14px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
}
.connections-view .connection-setup-meta {
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.connections-view .setup-steps-rich {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}
.connections-view .setup-steps-rich li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.connections-view .setup-steps-rich li:last-child { border-bottom: 0; }
.connections-view .setup-step-number {
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}
.connections-view .setup-steps-rich strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}
.connections-view .setup-steps-rich small {
  display: block;
  margin-top: 2px;
  color: var(--ink-secondary);
  font-size: 11.5px;
  line-height: 1.5;
}
.connections-view .connection-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  font-family: var(--font-ui);
}
.connections-view .connection-help-label {
  flex: none;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}
.connections-view .connection-help-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 18px;
  min-width: 0;
}
.connections-view .connection-help a {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.connections-view .connection-help a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}
.connections-view .connection-help a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.connections-view .connection-setup-action {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.connections-view .connection-setup-action > :first-child { margin-top: 0; }
.connections-view .connection-setup-action > :last-child { margin-bottom: 0; }

@media (max-width: 520px) {
  .connections-view .connection-help {
    align-items: flex-start;
    flex-direction: column;
  }
  .connections-view .connection-help-links {
    justify-content: flex-start;
    width: 100%;
  }
}

.connections-view .connection-choice-group {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.connections-view .connection-choice-group legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 650;
}
.connections-view .connection-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.connections-view .connection-choice-group legend { grid-column: 1 / -1; }
.connections-view .connection-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.connections-view .connection-choice:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.connections-view .connection-choice input { margin: 3px 0 0; }
.connections-view .connection-choice strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}
.connections-view .connection-choice small {
  display: block;
  margin-top: 2px;
  color: var(--ink-secondary);
  font-size: 11.5px;
  line-height: 1.45;
}
@media (max-width: 719px) {
  .connections-view .connection-body { margin-left: 0; }
  .connections-view .connection-choice-group { grid-template-columns: 1fr; }

  .connections-view .connection-facts span { white-space: normal; }
}

.settings-view { max-width: 1180px; margin: 0 auto; padding-bottom: 44px; }
.settings-view .settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 18px;
  padding-bottom: 0;
}
.settings-view .settings-heading { min-width: 0; }
.settings-view .settings-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.settings-view .settings-header h1 {
  font-size: clamp(30px, 3.5vw, 42px);
  letter-spacing: -.035em;
  line-height: 1.05;
}
.settings-view .settings-header .settings-summary {
  max-width: 660px;
  font-size: 14.5px;
  margin: 6px 0 0;
}
.settings-view .settings-workspace-card {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 330px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--polish-shadow-sm);
}
.settings-view .settings-workspace-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(79, 70, 229, .18);
}
.settings-view .settings-workspace-name {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}
.settings-view .settings-workspace-name strong {
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-view .settings-workspace-name span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11.5px;
}
.settings-view .workspace-plan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
}
.settings-view .workspace-plan .plan-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.settings-view .settings-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 76%, var(--surface-subtle));
  box-shadow: 0 1px 2px rgba(26, 23, 20, .035);
}
.settings-view .settings-overview-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 13px 16px 14px;
  border-right: 1px solid var(--border);
}
.settings-view .settings-overview-item:last-child { border-right: 0; }
.settings-view .settings-overview-item > span {
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.settings-view .settings-overview-item strong {
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-view .settings-overview-item small {
  overflow: hidden;
  color: var(--ink-secondary);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-view .settings-layout {
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  max-width: none;
}
.settings-view .settings-sections { min-width: 0; display: grid; gap: 16px; }
.settings-view .settings-section { margin-bottom: 0; }

.settings-view .settings-anchors {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 2px;
  padding: 7px 0;
}
.settings-view .settings-anchors-label {
  padding: 2px 11px 9px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.settings-view .settings-anchors a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 140ms ease, background-color 140ms ease;
}
.settings-view .settings-anchors a:hover {
  color: var(--ink);
  background: var(--surface-hover);
}
.settings-view .settings-anchors a[aria-current="location"] {
  color: var(--ink);
  background: var(--surface-subtle);
  border-color: var(--border);
  font-weight: 600;
  box-shadow: none;
}

.settings-view .settings-card {
  scroll-margin-top: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(26, 23, 20, .045), 0 9px 28px rgba(26, 23, 20, .035);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.settings-view .settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
}
.settings-view .settings-card-head .settings-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.settings-view .settings-card-head .settings-summary {
  margin: 4px 0 0;
  color: var(--ink-secondary);
  font-size: 13px;
}
.settings-view .settings-card-body { padding: 0 22px 20px; }
.settings-view .settings-card-body > :first-child { margin-top: 0; }
.settings-view .settings-account-body { max-width: 720px; }
.settings-view #profileNameForm { margin: 0; }
.settings-view .settings-account-name { max-width: 520px; margin-bottom: 0; }
.settings-view .settings-account-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.settings-view .settings-account-name-row .btn { min-width: 64px; }
.settings-view .settings-account-name-row .btn:disabled {
  color: var(--ink-muted);
  background: var(--surface-subtle);
  border-color: var(--border);
  opacity: 1;
}
.settings-view .settings-account-facts {
  grid-template-columns: 120px minmax(0, 1fr);
  margin: 20px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.settings-view .settings-account-sessions { padding-top: 20px; }
.settings-view .settings-account-sessions > .section-label { margin: 0 0 8px; }
.settings-view .settings-account-session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 64px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.settings-view .settings-account-session-row:last-child { border-bottom: 0; }
.settings-view .settings-account-session-name {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}
.settings-view .settings-account-session-note {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.settings-view .settings-account-revoke { min-width: 0; }
.settings-view .settings-account-revoke > .confirm-block { margin: 0; }
.settings-view .settings-account-revoke > .form-error { text-align: right; }
.settings-view .manage-link {
  flex: none;
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 140ms ease, transform 140ms ease;
}
.settings-view .manage-link:hover {
  color: var(--accent-hover);
  transform: translateX(2px);
}

.settings-view .settings-members { font-size: 13px; }
.settings-view .settings-members th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  padding: 10px 8px;
}
.settings-view .settings-members td { padding: 10px 8px; vertical-align: middle; }
.settings-view .settings-members tbody tr { transition: background-color 160ms ease; }
.settings-view .settings-members tbody tr:hover { background: var(--surface-hover); }
.settings-view .settings-members tbody tr:last-child td { border-bottom: 0; }

.settings-view .seat-meter {
  max-width: 320px;
  margin: 14px 0 16px;
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 12.5px;
}
.settings-view .seat-meter .bar {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--border);
}
.settings-view .seat-meter .fill { border-radius: inherit; }

.settings-view .connection-head .name {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
}
.settings-view .hairline-list { border-radius: 9px; overflow: hidden; }

.settings-view .ledger-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  font-size: 12.5px;
}
.settings-view .ledger-table th {
  background: var(--surface-subtle);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .055em;
  padding: 8px 10px;
}
.settings-view .ledger-table td { padding: 8px 10px; }

.settings-view .confirm-block { border-radius: 9px; }

@media (max-width: 620px) {
  .settings-view .settings-account-name-row,
  .settings-view .settings-account-session-row { grid-template-columns: 1fr; }
  .settings-view .settings-account-name-row .btn { justify-self: start; }
  .settings-view .settings-account-session-row { gap: 10px; align-items: start; }
  .settings-view .settings-account-session-row > .btn,
  .settings-view .settings-account-revoke > .btn { justify-self: start; }
  .settings-view .settings-account-revoke > .form-error { text-align: left; }
}
.settings-view .byok-list { list-style: none; margin: 0 0 14px; padding: 0; }
.settings-view .byok-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.settings-view .byok-row:last-child { border-bottom: 0; }
.settings-view .byok-provider { font-weight: 600; min-width: 170px; }
.settings-view .byok-status.muted, .settings-view .byok-status .muted { color: var(--ink-muted); }
.settings-view .byok-fallback { border: 0; margin: 14px 0 0; padding: 0; }
.settings-view .radio-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 6px 0;
  font-size: 13px;
  color: var(--ink-secondary);
}
.settings-view .radio-row input { margin-top: 3px; accent-color: var(--primary); }

@media (max-width: 980px) {
  .settings-view .settings-layout { grid-template-columns: 1fr; }
  .settings-view .settings-anchors {
    position: static;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }
  .settings-view .settings-anchors-label { display: none; }
  .settings-view .settings-anchors a { flex: none; white-space: nowrap; }
}
@media (max-width: 760px) {
  .settings-view .settings-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .settings-view .settings-workspace-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    width: 100%;
    min-width: 0;
  }
  .settings-view .settings-overview { grid-template-columns: 1fr; }
  .settings-view .settings-overview-item {
    grid-template-columns: minmax(100px, .6fr) minmax(0, 1fr);
    align-items: baseline;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .settings-view .settings-overview-item:last-child { border-bottom: 0; }
  .settings-view .settings-overview-item small { grid-column: 2; }
}
@media (max-width: 719px) {

  .settings-view .settings-card-body { overflow-x: auto; }
}
@media (max-width: 520px) {
  .settings-view .settings-card-head,
  .settings-view .settings-card-body { padding-left: 15px; padding-right: 15px; }
  .settings-view .settings-card-head { flex-direction: column; gap: 9px; }
}

:root {

  --polish-shadow-sm: 0 1px 2px rgba(26, 23, 20, .07), 0 4px 12px rgba(26, 23, 20, .04);
  --polish-shadow-md: 0 8px 24px rgba(26, 23, 20, .09);
  --polish-primary-shadow: 0 1px 2px rgba(28, 20, 100, .20), 0 5px 14px rgba(79, 70, 229, .18);
}

@keyframes prep-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes prep-row-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes prep-cell-pop {
  0% { background: rgba(22, 101, 52, 0.28); }
  100% { background: var(--ok-soft); }
}

.home-focus .btn,
.session-page .btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}
.home-focus .btn.primary,
.session-page .btn.primary {
  border-color: rgba(32, 26, 137, .42);
  box-shadow: var(--polish-primary-shadow);
}
.home-focus .btn.primary:hover:not(:disabled),
.session-page .btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 3px rgba(28, 20, 100, .18), 0 7px 18px rgba(79, 70, 229, .22);
}
.home-focus .btn.ghost,
.session-page .btn.ghost {
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(26, 23, 20, .04);
}
.home-focus .btn.ghost:hover:not(:disabled),
.session-page .btn.ghost:hover:not(:disabled),
.home-focus .btn.quiet:hover:not(:disabled),
.session-page .btn.quiet:hover:not(:disabled) {
  border-color: #bdb4a5;
  transform: translateY(-1px);
}
.home-focus .btn:active:not(:disabled),
.session-page .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(26, 23, 20, .10);
}
.home-focus .btn:disabled,
.session-page .btn:disabled {
  transform: none;
  box-shadow: none;
}
.home-focus .btn.small,
.session-page .btn.small {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 13.5px;
}
.session-page .btn svg { width: 12px; height: 12px; flex: none; display: block; }

.home-focus .status,
.session-page .status {
  min-height: 20px;
  padding: 3px 8px;
  border: 1px solid rgba(92, 86, 80, .14);
  border-radius: 999px;
  background: rgba(92, 86, 80, .07);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}
.home-focus .status-ok,
.session-page .status-ok { border-color: var(--ok-border); background: var(--ok-soft); }
.home-focus .status-warn,
.session-page .status-warn { border-color: var(--warn-border); background: var(--warn-soft); }
.home-focus .status-danger,
.session-page .status-danger { border-color: var(--danger-border); background: var(--danger-soft); }
.home-focus .status-accent,
.session-page .status-accent { border-color: rgba(79, 70, 229, .20); background: var(--accent-soft); }

.home-focus { animation: prep-rise 0.45s cubic-bezier(0.22, 0.8, 0.28, 1) both; }

.home-focus .composer {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px 16px;
  box-shadow: var(--polish-shadow-sm);
}
.home-focus .composer:focus-within { border-color: var(--border); outline: none; }
.home-focus .composer textarea {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 8px 11px;
  min-height: 64px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, min-height 160ms ease;
}
.home-focus .composer textarea::placeholder { color: var(--ink-muted); }
.home-focus .composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
  min-height: 88px;
}
.home-focus .composer-row {
  border-top: 0;
  padding-top: 0;
  margin-top: 10px;
}
.home-focus .composer .btn.primary { min-height: 38px; padding: 8px 16px; }

.home-focus .hairline-list {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--polish-shadow-sm);
}
.home-focus .session-row { transition: background 0.3s ease; }
.home-focus .session-row:hover { background: var(--surface-hover); }
.home-focus .starter-task { transition: background 0.3s ease; }
.home-focus .starter-task:hover { background: var(--surface-hover); }
.home-focus .session-row .title { font-family: var(--font-ui); }
.home-focus .session-row .when { font-family: var(--font-ui); }

.session-page { max-width: 1560px; margin: 0 auto; }
.canvas:has(> .session-page) { padding: 18px clamp(12px, 2vw, 24px) 36px; }
.session-page .convo { min-width: 0; animation: prep-rise 0.5s 0.06s cubic-bezier(0.22, 0.8, 0.28, 1) both; }
.session-page .work-surface { animation: prep-rise 0.5s 0.12s cubic-bezier(0.22, 0.8, 0.28, 1) both; }

.session-page .session-title-row { margin-bottom: 4px; }
.session-page .session-title-row input { border-radius: 8px; }

.session-page .source-row {
  border-radius: 8px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.04);
}
.session-page .source-row .name { font-weight: 600; }
.session-page .source-row .detail { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.session-page .source-choices {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.05), 0 8px 22px rgba(26, 23, 20, 0.06);
  animation: prep-rise 0.3s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}
.session-page .notice { border-radius: 8px; }

.session-page .tier-list { border-radius: 8px; overflow: hidden; }
.session-page .tier-list li { transition: background 0.3s ease; }
.session-page .tier-list li:hover { background: var(--surface-hover); }
.session-page .cellref-link {
  gap: 5px;
  font-size: 13px;
  min-width: 118px;
  text-decoration: none;
}
.session-page .cellref-link:hover { color: var(--accent-hover); text-decoration: underline; }
.session-page .cellref-link .chev { transition: transform 0.3s ease; flex: none; opacity: 0.75; }
.session-page .verified-group summary { border-radius: 0 0 8px 8px; }
.session-page .verified-group[open] summary { border-radius: 0; }

.session-page .tier-list .audit-drawer {
  border-left: 0;
  padding: 14px 16px 14px 18px;
  box-shadow: none;
}
.session-page .tier-list .audit-drawer:hover { background: var(--surface-hover); }
.session-page .audit-drawer-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.session-page .audit-drawer-head .runid {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.session-page .audit-step {
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0 5px 32px;
  font-size: 13px;
  color: var(--ink);
}
.session-page .audit-step::before {
  content: none;
}
.session-page .audit-step + .audit-step::after {
  content: none;
}
.session-page .audit-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 26px;
  bottom: -8px;
  height: auto;
  width: 1.5px;
  border-left: 0;
  background: var(--border-strong);
}
.session-page .evt-avatar {
  position: absolute;
  left: 0;
  top: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  flex: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.06);
}
.session-page .evt-avatar img { width: 12px; height: 12px; display: block; }
.session-page .audit-step-text { color: var(--ink); }
.session-page .audit-kind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
}
.session-page .audit-kind::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.session-page .audit-kind-agent {
  background: var(--accent-soft);
  border-color: rgba(79, 70, 229, 0.28);
  color: var(--primary);
}
.session-page .audit-kind-engine {
  background: var(--ok-soft);
  border-color: var(--ok-border);
  color: var(--ok);
}
.session-page .audit-kind-write {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
  color: var(--ink-secondary);
}
.session-page [data-audit-log] {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  padding: 5px 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.session-page [data-audit-log]:hover {
  background: var(--accent-soft);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.14);
}

.session-page .plan-block { padding: 5px 4px; animation: prep-rise 0.3s cubic-bezier(0.22, 0.8, 0.28, 1) both; }
.session-page .plan-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.session-page .plan-card-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.session-page .plan-task-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.28);
  color: var(--primary);
}
.session-page .plan-note { color: var(--ink-muted); font-size: 12.5px; margin: 0 0 15px; }
.session-page .plan-block ol {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  counter-reset: plan;
}
.session-page .plan-block li {
  position: relative;
  padding: 0 0 0 30px;
  margin: 0 0 11px;
  font-size: 13.5px;
  counter-increment: plan;
}
.session-page .plan-block li:last-child { margin-bottom: 0; }
.session-page .plan-block li::before {
  content: counter(plan);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.session-page .session-composer {
  margin-top: 18px;
  padding: 14px 16px 16px;
  border-radius: 8px;
  box-shadow: var(--polish-shadow-sm);
}
.session-page .session-composer .field { margin-bottom: 0; }
.session-page .session-composer .field label {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.session-page .session-composer textarea {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 8px 11px;
  resize: vertical;
  min-height: 64px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.session-page .session-composer textarea::placeholder { color: var(--ink-muted); }
.session-page .session-composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.session-page .session-composer .composer-row { margin-top: 10px; padding-top: 0; }
.session-page .session-composer .disabled-reason { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.session-page .session-composer #runBtn { margin-left: auto; min-width: 92px; flex: none; }
.session-page .example-chip { border-radius: 999px; }

.session-page .artifact { border-radius: 8px; box-shadow: var(--polish-shadow-sm); }
.session-page .artifact .filetype { border-radius: 5px; }
.session-page .artifact .fname { font-size: 13.5px; }
.session-page .artifact .meta { font-variant-numeric: tabular-nums; }
.session-page .fail-panel { border-radius: 8px; }

.session-page .work-surface-head { justify-content: space-between; row-gap: 6px; }
.session-page .work-surface-head .caption {
  flex: 1 1 160px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.session-page .surface-mode {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  margin-left: auto;
  flex: none;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.session-page .surface-mode button {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 13px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.session-page .surface-mode button:hover { color: var(--ink); }
.session-page .surface-mode button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.10);
}
.session-page .work-surface table.grid { width: 100%; }
.session-page .work-surface table.grid td { min-width: 84px; }
.session-page .work-surface table.grid td.edited { animation: prep-cell-pop 0.6s ease both; }

.session-page .evidence-pane { animation: prep-rise 0.3s cubic-bezier(0.22, 0.8, 0.28, 1) both; }
.session-page .evidence-search { margin-bottom: 8px; }
.session-page .evidence-search input {
  font-size: 13px;
  padding: 6px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.session-page .evidence-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.session-page .evidence-list { border: 0; }
.session-page .evidence-row {
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 6px;
  transition: background 0.14s ease;
}
.session-page .evidence-row:hover { background: var(--surface-hover); }
.session-page .evidence-row .ev-label { flex: 1; min-width: 0; font-weight: 500; }
.session-page .evidence-row .ev-amount { color: var(--ink-secondary); }

.session-page .audit-slideover {
  width: min(480px, 94vw);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 48px rgba(26, 23, 20, 0.14);
  padding: 16px 18px;
}
.session-page .audit-scrim { background: rgba(26, 23, 20, 0.34); }
.session-page .audit-slideover-head h2 { font-size: 16px; }
.session-page .audit-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 12px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.session-page .audit-tier-chip:hover { background: var(--surface-hover); }
.session-page .audit-tier-chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .home-focus,
  .session-page .convo,
  .session-page .work-surface,
  .session-page .plan-block,
  .session-page .source-choices,
  .session-page .evidence-pane {
    animation: none;
    opacity: 1;
  }
}

/* critical:start */
.boot-skeleton { min-height: 100vh; background: var(--bg, #faf6ef); }
.boot-skeleton .bs-bit { background: var(--surface-subtle); border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .boot-skeleton .bs-bit { animation: bs-pulse 1.4s ease-in-out infinite; }
  @keyframes bs-pulse { 50% { opacity: 0.55; } }
}
.boot-skeleton .bs-line { height: 13px; margin: 10px 0; }
.boot-skeleton .bs-w60 { width: 60%; }
.boot-skeleton .bs-w40 { width: 40%; }
.boot-skeleton .bs-mark { width: 26px; height: 26px; margin-bottom: 14px; }
.boot-skeleton .bs-title { height: 22px; width: 34%; margin: 6px 0 12px; }
.boot-skeleton .bs-button { height: 34px; margin: 12px 0; }
.boot-skeleton .bs-block { height: 46px; margin: 12px 0; }
.boot-skeleton .bs-panel { height: 132px; margin: 16px 0; }
.boot-skeleton .bs-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.boot-skeleton .bs-card {
  width: min(360px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 26px 28px;
}
.boot-skeleton .bs-workspace { display: none; }
.boot-skeleton.bs-authed .bs-login { display: none; }
.boot-skeleton.bs-authed .bs-workspace {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}
.boot-skeleton .bs-rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
}
.boot-skeleton .bs-rail-gap { flex: 1 1 auto; min-height: 40px; }
.boot-skeleton .bs-canvas { padding: 28px 32px; }
@media (max-width: 719px) {
  .boot-skeleton.bs-authed .bs-workspace { grid-template-columns: minmax(0, 1fr); }
  .boot-skeleton .bs-rail { display: none; }
}
/* critical:end */

.session-composer .btn.chat-send {
  width: 34px; height: 34px; min-height: 0; flex: none;
  border: 0; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary, #4f46e5); color: #fff; cursor: pointer;
  box-shadow: var(--polish-primary-shadow, 0 1px 2px rgba(28, 20, 100, .20));
}
.session-composer .btn.chat-send svg { width: 15px; height: 15px; flex: none; }
.session-composer .btn.chat-send:hover:not(:disabled) { background: var(--accent-hover, #4338ca); }
.session-composer .btn.chat-send:disabled {
  background: var(--surface-subtle, #f3ede4); color: var(--ink-muted, #8a8279);
  box-shadow: none; cursor: default; opacity: 1;
}

.home-focus .session-composer textarea { overflow: hidden; }

.client-picker { flex: 1 1 auto; min-width: 0; display: block; }
.topbar .client-picker { flex: 1 1 auto; text-align: right; }
.client-picker-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 3px 22px 3px 6px;
  margin: -3px -6px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  position: relative;
}
.topbar .client-picker-trigger { align-items: flex-end; }
.client-picker-trigger:hover { background: var(--surface-hover); }
.client-picker-trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.client-picker-trigger .firm-name {
  font-weight: 600;
  font-size: 13.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-picker-current {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--ink-secondary);
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}
.client-picker-chevron {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  color: var(--ink-muted);
}

.client-picker-dialog {
  position: fixed;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow: hidden;
  box-shadow: 0 20px 52px rgba(26, 23, 20, 0.2), 0 2px 8px rgba(26, 23, 20, 0.08);
}

.client-picker-dialog::backdrop { background: rgba(26, 23, 20, 0.12); }
.client-picker-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 12px 16px;
  border-bottom: 1px solid var(--border);
}
.client-picker-dialog-head h2 {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.client-picker-dialog-head p {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.client-picker-dialog-close {
  flex: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.client-picker-dialog-close:hover { background: var(--surface-hover); color: var(--ink); }
.client-picker-dialog-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.client-picker-dialog-body {
  max-height: min(56vh, 430px);
  padding: 7px;
  overflow-y: auto;
  overflow-x: hidden;
}
.client-option-list, .client-entity-list { list-style: none; margin: 0; padding: 0; }
.client-option-list { display: grid; gap: 2px; }
.client-option-row { display: flex; align-items: center; gap: 2px; }
.client-option-toggle {
  flex: none;
  width: 30px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  margin-right: 2px;
  border-radius: 7px;
}
.client-option-toggle:hover { background: var(--surface-hover); color: var(--ink); }
.client-option-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.client-option-chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 120ms ease;
}
.client-option-toggle[aria-expanded="true"] .client-option-chevron { transform: rotate(90deg); }
.client-option {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.client-option:hover { background: var(--surface-hover); }
.client-option:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.client-option[aria-current="true"] { background: var(--accent-soft); font-weight: 600; }

.client-option-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.client-option-meta {
  flex: none;
  font-size: 10.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.client-option-check {
  flex: none;
  width: 14px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.client-entity-list {
  margin: 2px 8px 4px 18px;
  border-left: 1px solid var(--border);
  padding-left: 5px;
}
.client-option--entity { font-size: 12px; color: var(--ink-secondary); }

.staff-ops-card {
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface, #fff);
  overflow: hidden;
}
.staff-ops-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 18px;
}
.staff-ops-head h2, .staff-section-title h3 { margin: 0; }
.staff-ops-head p:not(.capacity-eyebrow), .staff-section-title p {
  margin: 5px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}
.staff-sandbox-badge {
  flex: none;
  padding: 7px 10px;
  border: 1px solid #b7d9ca;
  border-radius: 999px;
  background: #f2faf6;
  color: #27654c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
}
.staff-ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 26px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.staff-ops-metrics > div { padding: 14px 16px; border-right: 1px solid var(--border); }
.staff-ops-metrics > div:last-child { border-right: 0; }
.staff-ops-metrics strong { display: block; font-size: 20px; line-height: 1.1; }
.staff-ops-metrics span { display: block; margin-top: 4px; color: var(--ink-muted); font-size: 11px; }
.staff-ops-tabs {
  display: flex;
  gap: 4px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
}
.staff-ops-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 11px 12px 10px;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.staff-ops-tabs button:hover { color: var(--ink); }
.staff-ops-tabs button.is-active { color: var(--ink); border-bottom-color: #3f7661; }
.staff-ops-panel { padding: 22px 26px 26px; }
.staff-ops-panel[hidden] { display: none; }
.staff-ops-error {
  margin: 16px 26px 0;
  padding: 10px 12px;
  border: 1px solid #e6b8b5;
  border-radius: 9px;
  background: #fff7f6;
  color: #8b302a;
  font-size: 12px;
}
.staff-ops-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr); gap: 24px; }
.staff-ops-columns > aside { padding-left: 24px; border-left: 1px solid var(--border); }
.staff-section-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.staff-section-title h3 { font-size: 14px; }
.staff-create-card {
  margin-bottom: 14px;
  border: 1px dashed #b7c7c0;
  border-radius: 10px;
  background: #fafcfb;
}
.staff-create-card summary { padding: 11px 13px; cursor: pointer; font-size: 12px; font-weight: 700; }
.staff-create-card[open] summary { border-bottom: 1px solid var(--border); }
.staff-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  padding: 14px;
}
.staff-form-grid.is-single { grid-template-columns: 1fr; padding: 0; }
.staff-form-grid label, .staff-inline-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 650;
}
.staff-form-grid input, .staff-form-grid select,
.staff-inline-form input, .staff-inline-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px 9px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.staff-form-grid .is-wide { grid-column: span 2; }
.staff-form-grid > button { align-self: end; justify-self: start; }
.staff-assignment-list, .staff-time-list, .staff-payroll-list { display: grid; gap: 9px; }
.staff-assignment-row, .staff-time-list article, .staff-payroll-row {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  padding: 13px;
}
.staff-row-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.staff-row-title > div > strong, .staff-row-title > div > span { display: block; }
.staff-row-title > div > strong { font-size: 13px; }
.staff-row-title > div > span { margin-top: 2px; color: var(--ink-muted); font-size: 11px; }
.staff-status {
  display: inline-flex;
  border-radius: 999px;
  background: #f1f3f2;
  padding: 4px 7px;
  color: var(--ink-secondary);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  text-transform: capitalize;
}
.staff-status.is-approved, .staff-status.is-reconciled, .staff-status.is-completed { background: #edf7f1; color: #286246; }
.staff-status.is-needs_attention, .staff-status.is-failed, .staff-status.is-rejected { background: #fff0ee; color: #95372f; }
.staff-status.is-submitted, .staff-status.is-ready_for_review { background: #fff7e5; color: #795812; }
.staff-inline-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.staff-inline-actions { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: 6px; }
.staff-inline-actions .is-danger { color: #923b34; }
.staff-ops-empty { padding: 14px; border: 1px dashed var(--border); border-radius: 9px; color: var(--ink-muted); font-size: 12px; }
.staff-declarations { list-style: none; margin: 14px 0 0; padding: 0; }
.staff-declarations li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.staff-declarations strong { font-size: 11px; }
.staff-assumption { margin: 13px 0 0; color: var(--ink-muted); font-size: 10.5px; line-height: 1.55; }
.staff-time-list article { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.staff-time-list article > div:first-child > * { display: block; }
.staff-time-list article > div:first-child span, .staff-time-list article > div:first-child small { margin-top: 3px; color: var(--ink-muted); font-size: 11px; }
.staff-time-list article > div:last-child { display: flex; align-items: center; gap: 6px; }
.staff-utilization-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.staff-utilization-list span > *, .staff-utilization-list em > * { display: block; }
.staff-utilization-list strong { font-size: 12px; }
.staff-utilization-list small { margin-top: 3px; color: var(--ink-muted); font-size: 10px; }
.staff-utilization-list em { color: #27654c; font-size: 15px; font-style: normal; font-weight: 750; text-align: right; }
.staff-utilization-list em.is-missing { color: var(--ink-muted); font-size: 11px; }
.staff-payroll-boundary {
  display: flex;
  gap: 10px;
  margin-bottom: 13px;
  padding: 11px 13px;
  border: 1px solid #b7d9ca;
  border-radius: 10px;
  background: #f4faf7;
  color: #315c4a;
  font-size: 12px;
}
.staff-payroll-boundary strong { flex: none; }
.staff-roster-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.staff-roster-actions > span { margin-right: auto; font-size: 12px; font-weight: 700; }
.staff-payroll-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.staff-payroll-totals span { padding: 8px 9px; border-radius: 8px; background: #f7f8f7; color: var(--ink-muted); font-size: 10px; }
.staff-payroll-totals strong { display: block; margin-top: 2px; color: var(--ink); font-size: 12px; }
.staff-receipt-line { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0; color: var(--ink-muted); font-size: 10.5px; }
.staff-control-blockers { margin: 10px 0; padding: 9px 11px; border-radius: 8px; background: #fff3f1; color: #87362f; font-size: 11px; }
.staff-control-blockers ul { margin: 5px 0 0; padding-left: 18px; }
.staff-readback-ok { color: #286246; font-size: 11px; font-weight: 700; }
.staff-waiting { color: var(--ink-muted); font-size: 11px; font-weight: 650; }

@media (max-width: 900px) {
  .staff-ops-metrics { grid-template-columns: repeat(2, 1fr); }
  .staff-ops-metrics > div:nth-child(2) { border-right: 0; }
  .staff-ops-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .staff-ops-columns { grid-template-columns: 1fr; }
  .staff-ops-columns > aside { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .staff-form-grid, .staff-inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .staff-ops-head { display: grid; padding: 20px; }
  .staff-ops-metrics { margin-inline: 20px; }
  .staff-ops-tabs { overflow-x: auto; padding-inline: 16px; }
  .staff-ops-tabs button { white-space: nowrap; }
  .staff-ops-panel { padding: 18px 20px 22px; }
  .staff-form-grid, .staff-inline-form { grid-template-columns: 1fr; }
  .staff-form-grid .is-wide { grid-column: auto; }
  .staff-time-list article, .staff-payroll-boundary, .staff-receipt-line { align-items: flex-start; flex-direction: column; }
  .staff-payroll-totals { grid-template-columns: 1fr; }
}

.rail-session-item,
.rail-nav a,
.rail-signout {
  border-left: 0;
  border-radius: 9px;
}
.rail-session-item { margin: 1px 0; overflow: hidden; }
.rail-session-item--active,
.rail-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.rail-session-link { padding: 6px 8px; }
.rail-nav a,
.rail-signout { min-height: 34px; padding: 6px 9px; }
.firm-monogram,
.roster-avatar { border-radius: 9px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  border-radius: var(--radius-control);
}
.connection-search,
.evidence-search input,
.kb-directory-head input,
.rail-session-title-input {
  border-radius: var(--radius-control) !important;
}

.roster-card,
.capacity-card,
.kb-map-card,
.staff-ops-card,
.confirm-block,
.guide-page > .guide-note,
.guide-nav,
.guide-account,
.guide-section,
.legal-doc,
.scope-consent-dialog,
.settings-view .settings-card,
.settings-view .settings-overview,
.settings-view .settings-workspace-card,
.connection-empty,
.connection-sample-box,
.connection-lane,
.staff-create-card,
.staff-assignment-row,
.staff-time-list article,
.staff-payroll-row {
  border-radius: var(--radius-surface);
  box-shadow: var(--polish-shadow-sm);
}
.roster-card,
.capacity-card,
.kb-map-card,
.staff-ops-card,
.guide-page > .guide-note,
.guide-nav,
.guide-account,
.guide-section,
.legal-doc,
.scope-consent-dialog {
  overflow: hidden;
}
.roster-card-head,
.settings-view .settings-overview,
.connection-lane,
.staff-create-card,
.guide-body > p:first-child,
.guide-note {
  background: color-mix(in srgb, var(--surface) 66%, var(--surface-subtle));
}
.roster-card tbody tr,
.members-table tbody tr,
.ledger-table tbody tr,
.guide-table tbody tr,
table.grid tbody tr { transition: background-color 140ms ease; }
.roster-card tbody tr:hover,
.members-table tbody tr:hover,
.ledger-table tbody tr:hover,
.guide-table tbody tr:hover,
table.grid tbody tr:hover { background: var(--surface-hover); }

.guide-table-scroll,
.sample-data-table-wrap,
.settings-view .ledger-table,
table.grid {
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(26, 23, 20, .045);
}
.guide-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
}
.guide-table th,
.guide-table td { border-width: 0 0 1px 0; }
.guide-table tr:last-child td { border-bottom: 0; }
table.grid th,
.guide-table th,
.members-table th,
.ledger-table th,
.sample-data-table th {
  background: color-mix(in srgb, var(--surface) 58%, var(--surface-subtle));
  text-transform: none;
  letter-spacing: .02em;
}

.connection-modal,
.scope-consent-dialog,
.client-picker-dialog,
.audit-slideover,
.wf-embed-modal {
  border-color: var(--border);
  border-radius: 16px;
  box-shadow: var(--polish-shadow-md);
}
.connection-modal::backdrop,
.scope-consent-dialog::backdrop,
.client-picker-dialog::backdrop,
.wf-embed-modal::backdrop {
  background: rgba(26, 23, 20, .32);
}
.connection-modal-head,
.wf-embed-head {
  background: var(--surface);
}
.connection-modal-body {
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-subtle));
}
.connection-modal .connection-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(26, 23, 20, .04);
}
.connection-modal-close,
.client-picker-dialog-close,
.scope-consent-close { border-radius: 9px; }

.connections-view .connections-grid .connection-tile {
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(26, 23, 20, .035);
}
.provider-tile { border-radius: 10px; box-shadow: 0 1px 2px rgba(26, 23, 20, .04); }

.settings-view .settings-card { border-radius: var(--radius-surface); }
.settings-view .settings-anchors a {
  border: 0;
  border-radius: 9px;
}
.settings-view .settings-anchors a[aria-current="location"] {
  border: 0;
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.guide-nav-link {
  margin: 1px 0;
  border-left: 0;
  border-radius: 8px;
}
.guide-nav-link:hover { border-left-color: transparent; background: var(--surface-hover); }
.guide-nav-link[aria-current="location"] {
  border-left-color: transparent;
  box-shadow: inset 0 -2px 0 var(--primary);
}
.guide-body > p:first-child,
.guide-note { border-left: 0; border-radius: 10px; }
.guide-codeblock { border-radius: 10px; background: var(--surface-subtle); }
.copy-btn { min-height: 26px; border-radius: 7px; }

.session-composer {
  border-radius: 15px;
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--polish-shadow-sm);
}
.home-focus .composer,
.session-page .session-composer {
  border-radius: 15px;
}
.home-focus .composer textarea,
.session-page .session-composer textarea {
  border-color: transparent;
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 55%, var(--surface-subtle));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 74%, transparent);
}
.home-focus .composer textarea:focus,
.session-page .session-composer textarea:focus {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 3px var(--accent-soft);
}
.session-composer .btn.chat-send {
  width: 34px; height: 34px;
  border-radius: 9px;
}
.session-page .source-row,
.session-page .source-choices,
.session-page .notice,
.session-page .tier-list,
.session-page .artifact,
.session-page .fail-panel,
.session-page .work-surface,
.session-page .chat-card { border-radius: 12px; }
.session-page .source-choices,
.session-page .artifact,
.session-page .work-surface { box-shadow: var(--polish-shadow-sm); }

.session-page .surface-mode,
.mode-toggle,
.sheet-tabs {
  border-radius: 10px;
  padding: 3px;
}
.session-page .surface-mode button,
.mode-toggle button,
.sheet-tabs button { border-radius: 7px; }

@media (pointer: coarse) {
  .btn:not(.small):not(.quiet) { min-height: 44px; }
}

.btn,
.home-focus .btn,
.session-page .btn,
.connections-view .btn,
.settings-view .btn {
  border-radius: 8px;
  box-shadow: none;
  transform: none;
  transition: background-color 150ms ease, color 150ms ease,
    border-color 150ms ease, transform 150ms ease;
}
.btn:hover:not(:disabled),
.home-focus .btn:hover:not(:disabled),
.session-page .btn:hover:not(:disabled),
.connections-view .btn:hover:not(:disabled),
.settings-view .btn:hover:not(:disabled) { transform: none; }
.btn:active:not(:disabled),
.home-focus .btn:active:not(:disabled),
.session-page .btn:active:not(:disabled),
.connections-view .btn:active:not(:disabled),
.settings-view .btn:active:not(:disabled) { transform: scale(.96); }

.session-composer,
.home-focus .session-composer,
.session-page .session-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--polish-shadow-sm);
}
.session-composer:focus-within,
.home-focus .session-composer:focus-within,
.session-page .session-composer:focus-within {
  border-color: var(--border-strong);
  outline: none;
  box-shadow: var(--polish-shadow-sm);
}
.prompt-bar-controls {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 28px;
  align-items: end;
  column-gap: 4px;
  row-gap: 6px;
  min-width: 0;
}
.prompt-bar-controls .chat-plus-holder,
.prompt-bar-controls > .chat-comp-attach { grid-column: 1; }
.prompt-bar-controls textarea,
.home-focus .prompt-bar-controls textarea,
.session-page .prompt-bar-controls textarea {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  max-height: 100px;
  padding: 5px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: 500 13px/18px var(--font-ui);
  resize: none;
  overflow-wrap: anywhere;
}
.prompt-bar-controls textarea:focus,
.home-focus .prompt-bar-controls textarea:focus,
.session-page .prompt-bar-controls textarea:focus {
  min-height: 28px;
  border: 0;
  outline: none;
  box-shadow: none;
}
.prompt-bar-controls textarea::placeholder { color: var(--ink-muted); }
.prompt-bar-select {
  grid-column: 3;
  align-self: center;
  max-width: 126px;
  height: 28px;
  min-height: 28px;
  padding: 3px 22px 3px 7px;
  border: 0;
  border-radius: 8px;
  background-color: transparent;
  color: var(--ink-secondary);
  font: 600 12px/1 var(--font-ui);
}
.prompt-bar-controls .chat-send,
.prompt-bar-controls .chat-stop,
.session-composer .prompt-bar-controls .btn.chat-send {
  grid-column: 4;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}
.prompt-bar-controls .chat-send:active:not(:disabled),
.prompt-bar-controls .chat-stop:active:not(:disabled) { transform: scale(.94); }
.prompt-bar-controls .chat-comp-attach,
.prompt-bar-controls .chat-plus-holder > .chat-comp-attach {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  box-shadow: none;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.prompt-bar-controls .chat-comp-attach:hover:not(:disabled) {
  background: var(--component-hover);
  color: var(--ink);
}
.prompt-bar-controls .chat-comp-attach:active:not(:disabled) { transform: scale(.94); }
.prompt-bar-note {
  display: block;
  min-height: 0;
  margin: 0 6px 2px;
  color: var(--ink-muted);
  font: 500 11px/1.35 var(--font-ui);
}
.prompt-bar-note:empty { display: none; }

.chat-plus-menu {
  bottom: calc(100% + 8px);
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--polish-shadow-md);
}
.chat-plus-menu button {
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 6px;
}
.chat-plus-menu button:hover,
.chat-plus-menu button:focus-visible { background: var(--component-hover); }
.chat-plus-icon {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-secondary);
}
.chat-plus-menu .chat-plus-copy {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.chat-plus-menu .chat-plus-title { font-weight: 600; }
.chat-plus-menu .chat-plus-description {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-plus-menu .chat-plus-footer {
  margin: 4px 4px 0;
  padding: 6px 8px 5px;
  border-top: 1px solid var(--border);
  color: var(--ink-muted);
  font: 500 11px/1.3 var(--font-ui);
}

.rail .rail-new {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  border-color: var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  font-size: 13px;
}
.rail .rail-new:hover,
.rail .rail-new[aria-current="page"] { background: var(--component-hover); color: var(--ink); }
.rail-nav a,
.rail-utility a,
.rail-signout,
.rail-session-item { border-radius: 7px; box-shadow: none; }
.rail-signout { border-top: 0; }
.rail-nav a:hover,
.rail-utility a:hover,
.rail-signout:hover,
.rail-session-item:hover { background: var(--surface-hover); }
.rail-nav a[aria-current="page"],
.rail-utility a[aria-current="page"],
.rail-session-item--active {
  color: var(--ink);
  background: var(--surface-hover);
  box-shadow: none;
}

.settings-view .settings-anchors a[aria-current="location"],
.guide-nav-link[aria-current="location"],
.rail-session-item--active,
.rail-nav a[aria-current="page"],
.rail-utility a[aria-current="page"],
.rail .rail-new[aria-current="page"] {
  border-color: transparent;
  background: var(--surface-hover);
  box-shadow: none;
}
.client-picker-trigger { padding-right: 6px; }
.client-picker-chevron { display: none; }

.rail-session-link[hidden],
.rail-session-rename[hidden] { display: none !important; }
.rail-session-title-input {
  grid-column: 1 / -1;
  width: calc(100% - 8px);
  height: 30px;
  margin: 3px 4px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong) !important;
  border-radius: 7px !important;
  outline: 0;
  box-shadow: none;
}
.rail-session-title-input:focus {
  border-color: var(--ink-muted) !important;
  outline: 0;
  box-shadow: none;
}

.panel,
.hairline-list,
.settings-view .settings-card,
.settings-view .settings-overview,
.settings-view .settings-workspace-card,
.connections-view .connections-grid .connection-tile,
.roster-card,
.guide-section,
.guide-nav,
.guide-account,
.guide-page > .guide-note,
.capacity-card,
.kb-map-card,
.staff-ops-card {
  border-radius: 10px;
  box-shadow: var(--polish-shadow-sm);
}
.connection-modal,
.scope-consent-dialog,
.client-picker-dialog,
.wf-embed-modal {
  border-radius: 10px;
  box-shadow: var(--polish-shadow-md);
}
.connection-modal-body { background: var(--component-inset); }
.connection-modal .connection-card { border-radius: 10px; box-shadow: var(--polish-shadow-sm); }
.home-focus .hairline-list { border-radius: 10px; }
.home-focus .session-row:hover { background: var(--surface-hover); }

@media (max-width: 620px) {
  .prompt-bar-controls { grid-template-columns: 28px minmax(0, 1fr) 28px; }
  .prompt-bar-select { display: none; }
  .prompt-bar-controls .chat-send,
  .prompt-bar-controls .chat-stop,
  .session-composer .prompt-bar-controls .btn.chat-send { grid-column: 3; }
}

button:focus-visible,
[role="button"]:focus-visible,
[role="menuitem"]:focus-visible,
.btn:focus-visible,
.chat-comp-attach:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.chat-comp-attach:focus-visible,
.chat-comp-attach[aria-expanded="true"] {
  background: var(--component-hover);
  color: var(--ink);
  box-shadow: none;
}
.settings-view .settings-anchors a:focus-visible,
.rail-nav a:focus-visible,
.session-row:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(26, 23, 20, .055);
}

.examples-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.examples-eyebrow { margin: 0 0 4px; color: var(--ink-muted); font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.examples-section-head { margin: 26px 0 12px; }
.examples-section-head h2 { margin: 0; font-size: 17px; }
.examples-section-head p { margin: 3px 0 0; color: var(--ink-muted); font-size: 12px; }
.example-profile-grid, .example-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.example-profile-card, .example-card, .example-detail { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.example-profile-card { padding: 16px; }
.example-profile-card > div > span, .example-card > div > span { color: var(--ink-muted); font-size: 10.5px; font-weight: 700; }
.example-profile-card h3, .example-card h3 { margin: 4px 0; font-size: 14px; }
.example-profile-card p, .example-card > p { margin: 4px 0; color: var(--ink-secondary); font-size: 12px; }
.example-profile-card dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px 0 0; }
.example-profile-card dl div { padding-top: 9px; border-top: 1px solid var(--border); }
.example-profile-card dt { color: var(--ink-muted); font-size: 9.5px; }
.example-profile-card dd { margin: 2px 0 0; font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.example-card { display: flex; min-height: 190px; flex-direction: column; padding: 17px; }
.example-card > div > p { margin: 0; color: var(--ink-muted); font-size: 10.5px; }
.example-card .btn { align-self: flex-start; margin-top: auto; }
.examples-empty { border: 1px dashed var(--border-strong); padding: 20px; background: var(--surface); }
.examples-empty h3, .examples-empty p { margin: 0; }
.examples-empty p { color: var(--ink-muted); font-size: 12px; }
.example-detail { margin-top: 22px; padding: 24px; scroll-margin-top: 20px; }
.example-detail > header { display: flex; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.example-detail h2 { margin: 3px 0; font-size: 23px; }
.example-detail header p:not(.examples-eyebrow) { max-width: 680px; margin: 4px 0 0; color: var(--ink-secondary); }
.example-detail-meta { min-width: 170px; color: var(--ink-muted); font-size: 10.5px; text-align: right; }
.example-detail-meta span { display: block; }
.example-truth { margin: 14px 0; border-left: 3px solid var(--warn); padding: 9px 12px; background: var(--warn-soft); color: var(--ink-secondary); font-size: 12px; }
.example-detail section { margin-top: 22px; }
.example-detail h3 { margin: 0 0 8px; font-size: 14px; }
.example-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.example-detail ul, .example-detail ol { margin: 0; padding-left: 20px; color: var(--ink-secondary); font-size: 12px; }
.example-capabilities { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 0 !important; list-style: none; }
.example-capabilities li { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--border); padding: 9px 10px; }
.example-capabilities span > * { display: block; }
.example-capabilities small { color: var(--ink-muted); }
.example-capabilities em { color: var(--ink-muted); font-size: 10.5px; font-style: normal; text-align: right; }
.example-capabilities em.is-unavailable { color: var(--danger); }
.example-capabilities em.is-live_verified { color: var(--ok); }
.example-steps { display: grid; gap: 8px; padding: 0 !important; list-style: none; counter-reset: walkthrough; }
.example-steps li { counter-increment: walkthrough; position: relative; padding: 11px 12px 11px 43px; border: 1px solid var(--border); }
.example-steps li::before { content: counter(walkthrough); position: absolute; left: 13px; top: 12px; width: 19px; height: 19px; border: 1px solid var(--border-strong); border-radius: 50%; text-align: center; line-height: 18px; font-size: 10px; }
.example-steps p { margin: 2px 0; }
.example-steps small { color: var(--ink-muted); }
.example-sources { display: grid; gap: 8px; padding: 0 !important; list-style: none; }
.example-source { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 14px; align-items: center; border: 1px solid var(--border); padding: 11px; }
.example-source div > * { display: block; }
.example-source div span, .example-source small { color: var(--ink-muted); }
.example-source code { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--ink-muted); font-size: 9.5px; }
.example-source a:not(.btn) { font-size: 11px; }
.example-source .example-source-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.example-source .example-source-actions > * { display: inline-flex; }
.example-file-note { margin: 8px 0 0; color: var(--ink-muted); font-size: 10.5px; }
.example-prompts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 0 !important; list-style: none; }
.example-prompts li { display: flex; flex-direction: column; border: 1px solid var(--border); padding: 11px; }
.example-prompts p { margin: 0 0 10px; }
.example-prompts .btn { align-self: flex-start; margin-top: auto; }
.example-detail footer { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 14px; font-size: 12px; }
@media (max-width: 800px) {
  .example-profile-grid, .example-card-grid, .example-detail-grid, .example-capabilities, .example-prompts { grid-template-columns: 1fr; }
  .example-detail > header, .examples-header { display: grid; }
  .example-detail-meta { text-align: left; }
}

.btn,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0 0.625rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) * 0.8);
  background-clip: padding-box;
  box-shadow: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  white-space: nowrap;
  user-select: none;
  transition: all 150ms ease;
  transform: none;
}

.btn.primary,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.primary {
  color: var(--primary-foreground);
  background: var(--primary);
  border-color: transparent;
  box-shadow: none;
}
.btn.primary:hover:not(:disabled),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.primary:hover:not(:disabled) {
  color: var(--primary-foreground);
  background: color-mix(in oklch, var(--primary) 80%, transparent);
  transform: none;
}

.btn.ghost,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.ghost {
  color: var(--foreground);
  background: var(--background);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}
.btn.ghost:hover:not(:disabled),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.ghost:hover:not(:disabled),
.btn.quiet:hover:not(:disabled),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.quiet:hover:not(:disabled) {
  color: var(--foreground);
  background: var(--muted);
  border-color: var(--border);
}

.btn.quiet,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.quiet {
  min-height: 2.25rem;
  padding: 0 0.625rem;
  color: var(--foreground);
  background: transparent;
  border-color: transparent;
}
.btn.secondary,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.secondary {
  color: var(--secondary-foreground);
  background: var(--secondary);
  border-color: transparent;
}
.btn.secondary:hover:not(:disabled),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.secondary:hover:not(:disabled) {
  color: var(--secondary-foreground);
  background: color-mix(in oklch, var(--secondary), var(--foreground) 5%);
}
.btn.destructive,
.btn.danger,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.destructive,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.danger {
  color: var(--destructive);
  background: color-mix(in oklch, var(--destructive) 10%, transparent);
  border-color: transparent;
}
.btn.destructive:hover:not(:disabled),
.btn.danger:hover:not(:disabled),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.destructive:hover:not(:disabled),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.danger:hover:not(:disabled) {
  background: color-mix(in oklch, var(--destructive) 20%, transparent);
}
.btn.small,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn.small {
  gap: 0.25rem;
  min-height: 2rem;
  padding: 0 0.625rem;
  font-size: 0.875rem;
}
.btn:active:not(:disabled):not([aria-haspopup]),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn:active:not(:disabled):not([aria-haspopup]) {
  transform: translateY(1px);
}
.btn[aria-haspopup]:active:not(:disabled),
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn[aria-haspopup]:active:not(:disabled) {
  transform: none;
}
.btn:disabled,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}
.btn:focus-visible,
:is(.home-focus, .session-page, .connections-view, .settings-view, .login-panel, .session-composer) .btn:focus-visible {
  border-color: var(--ring);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

.canvas > :where(.page-header, .connections-view, .settings-view, .view,
  .examples-header, .examples-profiles, .evidence-page, .kb-header,
  .kb-workspace, .kb-operations-section, .kb-source-note, .templates-view,
  .guide-page) { max-width: 1120px; margin-inline: auto; }

.canvas > .page-header,
.canvas > :where(.connections-view, .settings-view, .view, .evidence-page,
  .templates-view, .guide-page) { padding-top: 8px; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: clamp(30px, 3.2vw, 36px); line-height: 1.12; letter-spacing: -.035em; }
.page-header .page-sub { max-width: 68ch; margin-top: 9px; font-size: 15px; line-height: 1.55; }
.page-header .section-label,
.examples-eyebrow { font-size: 10px; letter-spacing: .08em; }

.panel, .hairline-list, .settings-view .settings-card,
.connections-view .connections-grid .connection-tile,
.evidence-state, .evidence-run-list, .evidence-table-wrap,
.guide-section, .guide-nav, .guide-account { box-shadow: none; }

.connections-view { max-width: 1120px; }
.connections-view .connections-header { align-items: flex-end; gap: 20px; }
.connections-view .connection-section + .connection-section { margin-top: 26px; }
.connections-view .connection-section-head { margin-bottom: 10px; }
.connections-view .connection-section-head h2 { font-size: 17px; }
.connections-view .connections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; }
.connections-view .connections-grid .connection-tile { min-height: 0; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.connections-view .connection-section-unavailable { margin-top: 16px; }
.connections-view .connection-section-unavailable .connection-section-head { opacity: .75; }
.connection-disclosure-cue { margin-left: auto; color: var(--ink-muted); font-size: 11px; }

.examples-header { max-width: 1120px; }
.examples-section-head { margin-top: 30px; }
.example-profile-grid, .example-card-grid { gap: 10px; }
.example-profile-card, .example-card { border-radius: 10px; box-shadow: none; }
.example-card { min-height: 0; padding: 15px; }
.example-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 12px; }
.example-card-meta > div { min-width: 0; padding-top: 8px; border-top: 1px solid var(--border); }
.example-card-meta dt { color: var(--ink-muted); font-size: 10px; }
.example-card-meta dd { margin: 3px 0 0; overflow: hidden; color: var(--ink-secondary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.example-card-availability { margin: 0 0 12px !important; color: var(--warn) !important; font-size: 11px !important; }

.evidence-page { max-width: 1120px; }
.evidence-header { align-items: flex-start; margin-bottom: 22px; }
.evidence-header h1 { font-size: 34px; }
.evidence-state { padding: 34px 24px; border-radius: 12px; }
.evidence-state h2 { font-size: 19px; }
.evidence-how { margin-top: 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.evidence-how summary { padding: 13px 2px; color: var(--ink-secondary); font-size: 12px; font-weight: 600; cursor: pointer; }
.evidence-how p { max-width: 72ch; margin: 0 2px 12px; color: var(--ink-muted); font-size: 12px; line-height: 1.5; }

.kb-header { max-width: 1120px; }
.kb-header h1 { font-size: 34px; }
.kb-route-error { max-width: 1120px; margin: 0 auto 16px; }
.kb-workspace { grid-template-columns: minmax(0, 1fr) minmax(300px, .65fr); }
.kb-operations-section { margin-top: 28px; padding-top: 20px; }
.kb-summary { display: none; }
.kb-operations-disclosure { max-width: 1120px; margin: 24px auto 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kb-operations-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; color: var(--ink-secondary); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.kb-operations-disclosure > summary::-webkit-details-marker { display: none; }
.kb-operations-disclosure > summary small { margin-left: auto; color: var(--ink-muted); font-size: 11px; font-weight: 400; }
.kb-operations-disclosure .kb-operations-section { margin-top: 0; }

.settings-view { max-width: 1120px; }
.settings-view .settings-header { margin-bottom: 18px; }
.settings-view .settings-header h1 { font-size: 34px; }
.settings-view .settings-workspace-card { padding: 10px 12px; box-shadow: none; }
.settings-view .settings-overview { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 18px; box-shadow: none; }
.settings-view .settings-overview-item { flex: 1 1 180px; min-height: 0; padding: 10px 14px; }
.settings-view .settings-overview-item strong { font-size: 13px; }
.settings-view .settings-overview-item small { font-size: 10px; }
.settings-view .settings-layout { grid-template-columns: 172px minmax(0, 1fr); gap: 20px; }
.settings-view .settings-anchors { position: sticky; top: 16px; align-self: start; }
.settings-view .settings-card { border-radius: 10px; }

.review-workspace-header { padding-bottom: 10px; }
.review-workspace-header h1 { font-size: 30px; }
.review-eyebrow { display: none; }
.review-workspace-stats { display: none; }
.review-status-tabs { border: 1px solid var(--border); border-radius: 8px; }
.review-filter-bar { border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 10px 0; }
.review-app { border-radius: 10px; box-shadow: none; }

.audit-page, .templates-view, .guide-page { max-width: 1120px; }
.audit-page-header h1 { font-size: 34px; }
.audit-page-filters { border-radius: 10px; background: var(--surface-subtle); }
.templates-view .settings-sections { max-width: 820px; }

@media (max-width: 760px) {
  .canvas { padding: 22px 16px 34px; }
  .canvas > :where(.page-header, .connections-view, .settings-view, .view, .evidence-page, .templates-view, .guide-page) { padding-top: 0; }
  .page-header h1, .settings-view .settings-header h1, .evidence-header h1, .kb-header h1, .audit-page-header h1 { font-size: 30px; }
  .connections-view .connections-header { align-items: stretch; }
  .connections-view .connection-search { width: 100%; }
  .connections-view .connections-grid { grid-template-columns: 1fr; }
  .example-profile-grid, .example-card-grid { grid-template-columns: 1fr; }
  .kb-workspace { grid-template-columns: 1fr; }
  .kb-directory { order: -1; height: auto; }
  .settings-view .settings-layout { grid-template-columns: 1fr; }
  .settings-view .settings-anchors { position: static; display: flex; overflow-x: auto; padding: 4px; border: 1px solid var(--border); border-radius: 9px; }
  .settings-view .settings-anchors a { flex: none; white-space: nowrap; }
  .review-root { height: auto; min-height: 0; }
  .review-app { display: block; }
  .review-pane { max-height: none; border-left: 0; border-top: 1px solid var(--border); }
  .review-exceptions { border-top: 0; }
  .review-filter-bar { grid-template-columns: 1fr; }
  .review-filter-bar .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.view.session-view.chat-view { max-width: none; }
.view.session-view.chat-view .convo { max-width: none; margin-inline: 0; }
.view.session-view.chat-view .session-title-row { min-height: 48px; padding: 10px 20px; }
.view.session-view.chat-view .session-title-row h1 { font-size: 15px; }
.view.session-view.chat-view .feed { padding-block: 18px 10px; }
.view.session-view.chat-view .feed > .chat-msg,
.view.session-view.chat-view .feed > .chat-day,
.view.session-view.chat-view .feed > .chat-card {
  width: auto;
  min-width: 0;
  margin-inline: var(--chat-gutter);
}
.view.session-view.chat-view .chat-msg-body { max-width: 68ch; font-size: 15px; line-height: 1.6; }
.view.session-view.chat-view .session-composer {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  width: auto;
  min-width: 0;
  margin: 18px var(--chat-gutter);
}
.view.session-view.chat-view .chat-plus-menu { max-width: min(390px, calc(100vw - 32px)); }
.view.session-view.chat-view .chat-client-lock { max-width: 220px; }

.connections-view .connection-section-unavailable > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.connections-view .connection-section-unavailable > summary::-webkit-details-marker { display: none; }
.connections-view .connection-section-summary > :is([data-section-summary], span:first-child) { flex: 1; color: var(--ink); font-size: 17px; font-weight: 650; }
.connections-view .connection-section-description { margin: 8px 0 12px; color: var(--ink-muted); font-size: 12px; }
.connections-view .connection-section-unavailable > summary::after { content: "⌄"; color: var(--ink-muted); }
.connections-view .connection-section-unavailable[open] > summary::after { transform: rotate(180deg); }

@media (max-width: 760px) {
  .view.session-view.chat-view .convo { max-width: none; }
  .view.session-view.chat-view .session-composer { bottom: 8px; }
}

/* Knowledge Base: responsive list-first browser composed from existing tokens. */
.canvas > .kb-browser-shell { max-width: 1120px; margin-inline: auto; }
.kb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.kb-header > div { min-width: 0; }
.kb-header > .btn { flex: none; margin-top: 4px; }
.kb-browser-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface);
  box-shadow: var(--polish-shadow-sm);
}
.kb-browser-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.kb-search-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.kb-search-field input:focus {
  border-color: var(--primary);
  outline: 2px solid var(--accent-soft);
}
.kb-view-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
}
.kb-view-toggle button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.kb-view-toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--polish-shadow-sm);
}
.kb-type-filters {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.kb-type-filters button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.kb-type-filters button:hover { background: var(--surface-hover); color: var(--ink); }
.kb-type-filters button[aria-pressed="true"] { background: var(--accent-soft); color: var(--primary); }
.kb-type-filters span { color: inherit; font-size: 10px; font-variant-numeric: tabular-nums; }
.kb-workspace {
  display: grid;
  grid-template-columns: minmax(250px, .62fr) minmax(0, 1.38fr);
  gap: 0;
  max-width: none;
  align-items: stretch;
}
.kb-workspace[hidden], .kb-map-view[hidden] { display: none; }
.kb-directory {
  display: block;
  min-width: 0;
  min-height: 460px;
  height: auto;
  overflow: visible;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.kb-directory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.kb-directory-head h2 { font-size: 15px; }
.kb-directory-head span { color: var(--ink-muted); font-size: 11px; }
.kb-people-list {
  max-height: none;
  overflow: visible;
  border-bottom: 0;
}
.kb-person-row { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 11px 14px; }
.kb-person-row.is-active { background: var(--surface-hover); box-shadow: none; }
.kb-person-row em { white-space: nowrap; }
.kb-person-panel {
  min-width: 0;
  min-height: 460px;
  max-height: none;
  padding: 22px 24px 28px;
  overflow: visible;
}
.kb-person-heading { align-items: flex-start; margin-bottom: 16px; }
.kb-person-heading > div { min-width: 0; }
.kb-person-heading .btn { flex: none; margin-left: auto; }
.kb-person-heading .kb-person-heading-actions {
  display: flex;
  flex: none;
  gap: 7px;
  margin-left: auto;
}
.kb-person-heading .kb-person-heading-actions .btn { margin-left: 0; }
.kb-person-heading h3 { font-size: 19px; }
.kb-person-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.kb-person-meta > div { grid-template-columns: auto minmax(0, 1fr); }
.kb-detail-section + .kb-detail-section { margin-top: 24px; }
.kb-knowledge-head { margin-bottom: 9px; }
.kb-knowledge-head h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .045em; }
.kb-inline-editor {
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface-subtle);
}
.kb-inline-editor > p { margin: 0; color: var(--ink-muted); font-size: 12px; }
.kb-inline-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.kb-inline-editor-head h4 { margin: 0; font-size: 13px; }
.kb-inline-editor-head p { max-width: 58ch; margin: 3px 0 0; color: var(--ink-muted); font-size: 11px; line-height: 1.45; }
.kb-edit-action {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.kb-edit-action:hover { text-decoration: underline; }
.kb-fact-actions { display: flex; gap: 12px; margin-top: 7px; }
.kb-edit-form { display: grid; gap: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.kb-edit-form[hidden] { display: none; }
.kb-edit-form label { display: grid; gap: 5px; color: var(--ink-secondary); font-size: 11px; font-weight: 600; }
.kb-edit-form input, .kb-edit-form textarea {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  resize: vertical;
}
.kb-edit-form input:focus, .kb-edit-form textarea:focus { border-color: var(--primary); outline: 2px solid var(--accent-soft); }
.kb-edit-form-actions { display: flex; gap: 7px; }
.kb-empty-dossier {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface-subtle);
}
.kb-empty-dossier h4 { margin: 0; color: var(--ink); font-size: 15px; }
.kb-empty-dossier p { max-width: 56ch; margin: 0 0 4px; color: var(--ink-muted); font-size: 12px; line-height: 1.55; }
.kb-map-view { padding: 16px; }
.kb-map-view .kb-map-card { border-radius: var(--radius-surface); box-shadow: none; }
.kb-source-note { max-width: 1120px; margin: 10px auto 0; }

@media (max-width: 760px) {
  .kb-header { gap: 16px; }
  .kb-browser-toolbar { grid-template-columns: 1fr; }
  .kb-view-toggle { justify-self: start; }
  .kb-workspace { grid-template-columns: 1fr; }
  .kb-directory {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .kb-person-panel { min-height: 0; padding: 20px 16px 24px; }
  .kb-person-meta { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .kb-header { display: grid; }
  .kb-header > .btn { justify-self: start; margin-top: 0; }
  .kb-person-heading { flex-wrap: wrap; }
  .kb-person-heading .kb-person-heading-actions { width: 100%; margin-left: 0; }
  .kb-person-heading .kb-person-heading-actions .btn { width: auto; }
  .kb-inline-editor-head { display: grid; }
  .kb-map-view { padding: 10px; }
}
