:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --brand: #027a48;
  --brand-hover: #05603a;
  --brand-soft: #ecfdf3;
  --brand-border: #abefc6;
  --blue: #1d4ed8;
  --blue-soft: #eff6ff;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --purple: #6d28d9;
  --purple-soft: #f5f3ff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Auth Screen */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, #ecfdf3 0%, #f8fafc 55%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.auth-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 6px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
}

.auth-sub {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Top Header & Nav */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px 0;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 10px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-subtle);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
}

.tabs-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 0;
}

.tab-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 700;
}

.badge-cnt {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-border);
}

.badge-cnt.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #fde68a;
}

/* Main Container */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.card-sub {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.kpi-val {
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.kpi-foot {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s;
}

.btn:hover {
  background: var(--surface-alt);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-warn {
  background: var(--amber-soft);
  border-color: #fcd34d;
  color: var(--amber);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--brand);
  border-color: var(--brand);
}

/* Status Pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.pill-green { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-border); }
.pill-blue { background: var(--blue-soft); color: var(--blue); border: 1px solid #bfdbfe; }
.pill-amber { background: var(--amber-soft); color: var(--amber); border: 1px solid #fde68a; }
.pill-purple { background: var(--purple-soft); color: var(--purple); border: 1px solid #ddd6fe; }
.pill-gray { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }

/* Miro-Style Interactive Waterfall Canvas */
.miro-shell {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background-color: #f8fafc;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: hidden;
  height: 670px;
  user-select: none;
  cursor: grab;
}

.miro-shell:active {
  cursor: grabbing;
}

.miro-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-strong);
  padding: 6px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.miro-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1620px;
  height: 920px;
  transform-origin: 0 0;
}

.miro-lane {
  position: absolute;
  left: 24px;
  width: 1570px;
  border-radius: 12px;
  border: 1.5px dashed;
  padding: 10px 16px;
}

.miro-lane-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.miro-node {
  position: absolute;
  width: 245px;
  background: #ffffff;
  border: 2px solid var(--border-strong);
  border-radius: 11px;
  padding: 11px 13px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.miro-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.miro-node.selected {
  border-color: #0f172a !important;
  box-shadow: 0 0 0 3px rgba(2, 122, 72, 0.25);
}

.miro-node-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.miro-node-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 4px;
}

.miro-node-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.38;
}

.miro-inspector {
  margin-top: 14px;
  background: #ffffff;
  border: 1.5px solid var(--brand-border);
  border-radius: 12px;
  padding: 16px 20px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-strong);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tr:hover td {
  background: #f8fafc;
}

/* 3-Step Niche Track Cards */
.niche-track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
}

.run-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.run-step-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  background: #fcfcfd;
}

.run-step-box.done {
  border-color: var(--brand-border);
  background: #f6fef9;
}

.run-step-box.ready {
  border-color: #fde68a;
  background: #fffdf5;
}

/* 7x7 GeoGrid Heatmap */
.geogrid-7x7 {
  display: grid;
  grid-template-columns: repeat(7, 42px);
  gap: 5px;
  padding: 14px;
  background: var(--surface-alt);
  border-radius: 12px;
  border: 1px solid var(--border);
  width: fit-content;
}

.geo-pin {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.geo-pin.rank-top3 { background: #16a34a; color: #fff; }
.geo-pin.rank-mid { background: #f59e0b; color: #fff; }
.geo-pin.rank-low { background: #ef4444; color: #fff; }
.geo-pin.rank-out { background: #e2e8f0; color: #475569; }

/* Run Explorer Split Layout */
.explorer-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
}

@media (max-width: 960px) {
  .explorer-layout { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.route-list-item {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
}

.route-list-item:hover { background: var(--surface-alt); }
.route-list-item.active { background: var(--brand-soft); border-left: 3px solid var(--brand); }

/* Modal Viewer for Vault TOC */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-window {
  width: 100%;
  max-width: 1240px;
  height: 88vh;
  background: #ffffff;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}

.modal-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-body {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.md-rendered {
  padding: 28px 36px;
  max-width: 960px;
  margin: 0 auto;
  font-size: 14.5px;
  line-height: 1.65;
}

.md-rendered h1, .md-rendered h2, .md-rendered h3 {
  margin-top: 22px;
  margin-bottom: 8px;
}

.md-rendered pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12.5px;
}

.md-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}

.md-rendered th, .md-rendered td {
  border: 1px solid var(--border-strong);
  padding: 8px 10px;
  text-align: left;
}

.md-rendered th { background: var(--surface-alt); }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
  font-size: 13px;
}

.check-row.excluded {
  opacity: 0.55;
  background: #fef2f2;
  text-decoration: line-through;
}

/* ONYX Web V2 — shared workspace foundation */
:root {
  --sidebar-width: 264px;
  --brand: #047857;
  --brand-hover: #065f46;
  --brand-soft: #ecfdf5;
  --brand-border: #a7f3d0;
  --shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
html { scroll-padding-top: 90px; }
body { font-size: 16px; letter-spacing: -.012em; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--brand); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #34d399;
  outline-offset: 3px;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); flex-shrink: 0; width: 17px; height: 17px; margin-top: 3px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.65; }
select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
}
svg { vertical-align: middle; }
pre { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; }
summary { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.boot-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--text-subtle); font-size: 14px; }
.boot-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--text); color: #34d399; font-weight: 800; font-size: 22px; }

/* Persistent workspace shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 60;
  display: flex; flex-direction: column; padding: 0 16px; background: #0f172a; color: #cbd5e1;
  border-right: 1px solid #1e293b;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 94px; padding: 16px 9px 20px; color: #f8fafc; }
.brand-symbol { width: 36px; height: 40px; display: grid; place-items: center; flex: 0 0 36px; color: #34d399; font-size: 28px; font-weight: 750; letter-spacing: -.07em; }
.brand-symbol svg { width: 36px; height: 36px; }
.sidebar-brand .brand-title, .sidebar-brand strong { font-size: 21px; letter-spacing: .045em; font-weight: 750; }
.sidebar-brand .brand-sub, .sidebar-brand small { display: block; color: #94a3b8; font-size: 12px; letter-spacing: .02em; margin-top: 2px; }
.sidebar nav { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; padding: 0 0 20px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-section { margin: 10px 0 24px; }
.nav-group-label { font-size: 12px; letter-spacing: .12em; font-weight: 650; color: #94a3b8; padding: 0 12px; margin: 0 0 9px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
  border: 1px solid transparent; border-radius: 8px; padding: 11px 12px; margin: 4px 0;
  color: #b6c2d3; background: transparent; text-align: left; font-size: 14px; line-height: 1.45;
  font-weight: 500; cursor: pointer; text-decoration: none; transition: background .15s, color .15s;
}
.nav-item:hover { color: #f8fafc; background: #1e293b; }
.nav-item.active { background: #f8fafc; color: #0f172a; font-weight: 650; box-shadow: 0 1px 3px #0002; }
.nav-item.active .nav-icon { color: #047857; }
.nav-icon { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 19px; color: #94a3b8; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.65; }
.nav-text { flex: 1; min-width: 0; }
.nav-badge { border-radius: 5px; padding: 1px 6px; background: #334155; color: #cbd5e1; min-width: 22px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-badge { background: #d1fae5; color: #047857; }
.sidebar-footer { display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: center; gap: 9px; margin-top: auto; padding: 18px 5px 20px; border-top: 1px solid #263247; }
.sidebar-profile, .profile-row { display: flex; align-items: center; gap: 11px; }
.profile-avatar { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 35px; border: 1px solid #475569; border-radius: 50%; background: #27344a; color: #e2e8f0; font-size: 12px; font-weight: 650; }
.profile-copy { min-width: 0; flex: 1; font-size: 14px; }
.profile-copy strong { display: block; color: #f8fafc; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-copy small, .profile-copy span { display: block; color: #94a3b8; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-signout { display: flex; align-items: center; justify-content: center; gap: 8px; grid-column: 1 / -1; width: 100%; min-height: 32px; padding: 6px 10px; margin-top: 5px; color: #cbd5e1; font-size: 14px; font-weight: 500; border: 1px solid #334155; border-radius: 7px; background: transparent; cursor: pointer; }
.sidebar-signout:hover { color: #fff; border-color: #64748b; background: #1e293b; }
.workspace { margin-left: var(--sidebar-width); min-width: 0; }
.workspace-header { position: sticky; top: 0; z-index: 35; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 32px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.header-context { flex: 1; min-width: 0; }
.header-title { font-size: 14px; font-weight: 650; color: #1e293b; line-height: 1.35; margin: 0; }
.header-subtitle { font-size: 12px; color: #64748b; line-height: 1.35; margin: 2px 0 0; }
.engine-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 500; padding: 4px 8px; color: #047857; background: #ecfdf5; border: 1px solid #d1fae5; border-radius: 6px; }
.engine-status::before { content: ""; width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #10b981; }
.engine-status > span { display: none; }
.header-title .engine-status { margin-left: 10px; vertical-align: middle; }
.engine-status.offline, .engine-status.warning, .engine-status.disconnected { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.engine-status.offline::before, .engine-status.warning::before, .engine-status.disconnected::before { background: #d97706; }
.preview-control { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 58%; min-width: 0; }
.preview-label { font-size: 12px; color: #64748b; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding-right: 3px; line-height: 1; }
.preview-pills { display: flex; padding: 2px; gap: 2px; border: 1px solid #e2e8f0; border-radius: 7px; background: #f1f5f9; max-width: 100%; overflow-x: auto; }
.preview-pill { padding: 3px 9px; border: 0; border-radius: 4px; background: transparent; color: #64748b; white-space: nowrap; font-size: 14px; font-weight: 550; line-height: 1.2; cursor: pointer; }
.preview-pill:hover { color: #0f172a; }
.preview-pill.active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px #0f172a1a; }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }
.workspace-content { width: 100%; max-width: 1800px; padding: 32px; margin: 0 auto; min-height: calc(100vh - 60px); }
.workspace-content > * { min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow, .page-kicker { color: #64748b; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 7px; }
.page-title, .page-heading h1 { font-size: clamp(24px, 2.2vw, 30px); letter-spacing: -.04em; font-weight: 650; line-height: 1.25; margin: 0; color: #0f172a; }
.page-description, .page-heading p { font-size: 14px; color: #64748b; line-height: 1.6; margin: 7px 0 0; max-width: 680px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; flex-shrink: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.empty-state { padding: 56px 24px; background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; text-align: center; color: #64748b; }
.empty-state h2, .empty-state h3 { color: #334155; margin: 12px 0 6px; font-size: 18px; font-weight: 650; }
.empty-state p { font-size: 14px; max-width: 480px; margin: 8px auto 20px; }
.error-banner { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; border-radius: 9px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px; overflow-wrap: anywhere; }
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 160; display: grid; gap: 10px; max-width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: #0f172a; color: #f8fafc; padding: 14px 18px; border-radius: 10px; box-shadow: 0 8px 32px #0f172a26; font-size: 14px; line-height: 1.5; pointer-events: auto; }
.toast.error { background: #881337; }

/* Shared surfaces and controls; legacy capabilities retain their selectors. */
.card { padding: 24px; margin-bottom: 20px; }
.card-header { margin-bottom: 18px; }
.card-title { font-weight: 650; font-size: 18px; letter-spacing: -.025em; line-height: 1.4; }
.card-sub { font-size: 14px; line-height: 1.65; color: #64748b; max-width: 960px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 > *, .grid-3 > *, .explorer-layout > *, .form-grid > * { min-width: 0; }
.btn { min-height: 38px; padding: 9px 14px; border-color: #dbe2ea; border-radius: 7px; font-size: 14px; font-weight: 550; line-height: 1.45; letter-spacing: -.01em; box-shadow: 0 1px 2px #0f172a06; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: #b8c5d4; background: #f8fafc; }
.btn-primary { color: #fff; background: #047857; border-color: #047857; }
.btn-primary:hover { color: #fff; background: #065f46; border-color: #065f46; box-shadow: 0 2px 4px #04785722; }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 14px; }
.btn-danger { color: #be123c; border-color: #fecdd3; background: #fff; }
.btn-danger:hover { color: #9f1239; background: #fff1f2; border-color: #fda4af; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: #64748b; }
.input, textarea, select { min-height: 42px; border-color: #d7e0ea; border-radius: 7px; padding: 10px 12px; font-size: 14px; box-shadow: 0 1px 2px #0f172a03; transition: border-color .15s, box-shadow .15s; }
.input::placeholder, textarea::placeholder { color: #94a3b8; font-weight: 400; }
.input:focus, textarea:focus, select:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px #10b9811a; }
.input:disabled, textarea:disabled, select:disabled { background-color: #f8fafc; color: #64748b; }
.field, .intake-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .form-label, .field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #334155; font-size: 14px; font-weight: 550; line-height: 1.45; }
.field small, .field-hint, .intake-field small { color: #64748b; font-size: 12px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.full-width { grid-column: 1 / -1; }
.pill { font-weight: 550; font-size: 14px; padding: 3px 9px; line-height: 1.45; }
.kpi-grid { gap: 14px; }
.kpi-box, .kpi-card { padding: 18px 20px; border: 1px solid var(--border); background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.kpi-label { text-transform: none; letter-spacing: -.01em; font-size: 14px; font-weight: 500; }
.kpi-val, .kpi-value { font-family: inherit; font-size: 30px; font-weight: 600; letter-spacing: -.04em; margin: 7px 0 0; color: #0f172a; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12px; margin-top: 6px; }
.data-table { font-size: 14px; }
.data-table th { background: #f8fafc; border-bottom-color: #e2e8f0; color: #64748b; font-size: 14px; font-weight: 550; padding: 13px 14px; }
.data-table td { padding: 16px 14px; line-height: 1.5; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table th:first-child, .data-table td:first-child { padding-left: 18px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 18px; }
.niche-track-card { border-radius: 12px; padding: 22px; }
.run-step-box { padding: 17px; border-radius: 9px; }
.run-steps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.explorer-layout { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 20px; }
.route-list-item { padding: 13px 14px; font-size: 14px; overflow-wrap: anywhere; }
.route-list-item.active { border-left-width: 3px; background: #ecfdf5; }
.geogrid-7x7 { max-width: 100%; grid-template-columns: repeat(7, minmax(0, 42px)); }
.geo-pin { width: 100%; }
.geo-pin.rank-mid { color: #451a03; background: #fbbf24; }
.miro-shell { height: min(670px, 68vh); min-height: 400px; touch-action: none; }
.miro-inspector { border-width: 1px; box-shadow: var(--shadow); }
.miro-node { font: inherit; text-align: left; box-shadow: 0 3px 10px #0f172a0d; }
.miro-node-title { font-size: 14px; }
.miro-node-tag, .miro-node-desc { font-size: 12px; }
.md-rendered { font-size: 15px; line-height: 1.8; }
.md-rendered table { display: block; overflow-x: auto; }
.modal-window { max-height: calc(100dvh - 40px); }
.modal-head { padding: 18px 24px; }
.check-row { font-size: 14px; line-height: 1.5; padding: 12px 14px; gap: 10px; }
.team-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: start; gap: 20px; }
.team-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.team-table th { text-align: left; color: #64748b; font-size: 14px; font-weight: 500; padding: 12px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.team-table td { padding: 16px 12px; border-bottom: 1px solid var(--border); }

/* Quiet sign-in screen */
.auth-screen { background: #f8fafc; min-height: 100dvh; padding: 32px 20px; position: relative; }
.auth-card { max-width: 440px; padding: 40px; border-radius: 16px; border-color: #e2e8f0; box-shadow: 0 12px 40px #0f172a06, 0 2px 6px #0f172a03; }
.auth-card .brand-symbol, .auth-card .brand-dot { margin: 0 auto 24px; width: 48px; height: 48px; color: #34d399; background: #0f172a; border-radius: 13px; }
.auth-eyebrow { font-size: 12px; letter-spacing: .1em; margin-bottom: 10px; }
.auth-title { font-size: 27px; line-height: 1.25; letter-spacing: -.04em; font-weight: 650; }
.auth-sub { font-size: 14px; color: #64748b; line-height: 1.65; margin: 12px 0 25px; }
.auth-card .input { min-height: 46px; font-size: 16px; }
.auth-card .btn { min-height: 44px; }
.auth-card label { font-size: 14px; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: #64748b; font-size: 12px; margin: 24px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: #e2e8f0; }
.auth-footer { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 24px; line-height: 1.6; }

/* Client queue */
.onb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 18px; }
.queue-search { max-width: 390px; position: relative; }
.queue-search .input { padding-left: 38px; background: #fff; }
.queue-search > svg, .queue-search > span { position: absolute; top: 12px; left: 13px; width: 17px; height: 17px; color: #94a3b8; pointer-events: none; }
.filter-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.filter-pill { border: 1px solid #e2e8f0; background: #fff; padding: 7px 12px; font-size: 14px; font-weight: 500; color: #64748b; border-radius: 7px; min-height: 34px; cursor: pointer; transition: all .15s; }
.filter-pill:hover { background: #f1f5f9; color: #334155; }
.filter-pill.active { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.queue-list { display: flex; flex-direction: column; gap: 12px; }
.queue-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.2fr) auto; align-items: center; gap: 24px; padding: 22px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.queue-row:hover { border-color: #cbd5e1; box-shadow: 0 3px 10px #0f172a05; }
.queue-identity { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.client-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; font-weight: 600; letter-spacing: -.02em; color: #047857; background: #ecfdf5; border: 1px solid #d1fae5; }
.queue-identity h2, .queue-identity h3, .queue-identity strong { font-size: 15px; font-weight: 650; line-height: 1.5; color: #1e293b; margin: 0; }
.queue-identity p { margin: 3px 0; font-size: 14px; color: #64748b; }
.queue-source { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; font-weight: 500; color: #64748b; line-height: 1.45; margin-bottom: 7px; }
.queue-detail { font-size: 14px; line-height: 1.65; min-width: 0; }
.queue-detail strong { font-weight: 550; color: #334155; }
.queue-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; color: #64748b; font-size: 14px; }
.queue-meta > a { font-size: 14px; font-weight: 550; }
.queue-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.queue-actions .btn { white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid #e2e8f0; border-radius: 5px; background: #f8fafc; color: #475569; font-size: 14px; font-weight: 500; line-height: 1.4; vertical-align: middle; }
.status-pill.success { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.status-pill.warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.status-pill.info { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.status-pill.neutral { background: #f1f5f9; color: #64748b; }

/* Guided client cockpit */
.cockpit-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.cockpit-heading h1 { font-size: 28px; letter-spacing: -.035em; font-weight: 650; margin: 0; }
.client-switch { max-width: 330px; min-width: 230px; }
#onb-autosave-pill { display: inline-flex; align-items: center; min-height: 26px; font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.deal-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 16px 0; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 14px; box-shadow: var(--shadow); }
.deal-item { padding: 0 20px; border-right: 1px solid #e2e8f0; font-size: 14px; line-height: 1.55; min-width: 0; }
.deal-item:last-child { border-right: none; }
.deal-item small, .deal-item .deal-label { display: block; font-size: 12px; font-weight: 500; color: #64748b; margin-bottom: 6px; }
.deal-item .status-pill { font-size: 14px; border: 0; padding: 0; background: transparent; border-radius: 0; }
.prep-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 0 18px; margin-bottom: 2px; }
.prep-bar .status-pill { margin-left: auto; }
.trauma-card { background: #fffcf5; border: 1px solid #f0ddb1; border-radius: 12px; padding: 17px 20px; margin-bottom: 24px; }
.trauma-card label, .trauma-card h3 { font-size: 14px; font-weight: 600; color: #854d0e; margin: 0 0 9px; }
.trauma-card textarea { background: #fffefa; border-color: #e8d9b7; min-height: 76px; font-size: 14px; }
.onb-tabs { display: flex; gap: 24px; overflow-x: auto; border-bottom: 1px solid #dbe3ed; margin-bottom: 24px; }
.onb-tab { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 12px 1px 15px; border: 0; border-bottom: 2px solid transparent; background: none; color: #64748b; font-size: 14px; font-weight: 550; cursor: pointer; }
.onb-tab:hover { color: #334155; }
.onb-tab.active { color: #047857; border-bottom-color: #059669; }
.cockpit-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.cockpit-layout.rescue-open { grid-template-columns: minmax(0, 1fr) 320px; }
.cockpit-content { min-width: 0; }
.intake-step { border: 1px solid var(--border); border-radius: 14px; background: #fff; padding: 26px; margin-bottom: 20px; box-shadow: var(--shadow); }
.step-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.step-heading h2, .step-heading h3 { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.5; letter-spacing: -.02em; }
.step-heading p { margin: 3px 0 0; color: #64748b; font-size: 14px; line-height: 1.6; }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; color: #047857; background: #ecfdf5; border: 1px solid #d1fae5; border-radius: 7px; font-size: 12px; font-weight: 650; margin-top: 1px; }
.coaching-box { background: #f0fdf6; color: #14532d; border: 1px solid #bbf7d0; border-radius: 9px; padding: 18px 20px; line-height: 1.85; font-size: 16px; }
.coaching-box p { margin: 0 0 12px; }
.coaching-box p:last-child { margin-bottom: 0; }
.coaching-box strong { font-weight: 650; }
.intake-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 20px; }
.intake-field textarea { font-size: 16px; min-height: 105px; background: #fff; }
.intake-field input { font-size: 16px; }
.filled-badge { flex-shrink: 0; display: inline-flex; align-items: center; background: #ecfdf5; color: #047857; border: 1px solid #bbf7d0; border-radius: 5px; padding: 2px 6px; font-size: 12px; font-weight: 550; }
.share-diagram { max-width: 720px; margin: 22px auto; }
.share-diagram svg { width: 100%; height: auto; display: block; }
.gbp-path { display: flex; flex-wrap: wrap; gap: 6px; padding: 17px; border: 1px solid #dbeafe; background: #f8fbff; border-radius: 9px; font-size: 14px; line-height: 1.85; color: #334155; margin: 18px 0; }
.gbp-path li { margin: 4px 0; }
ol.gbp-path { display: block; padding-left: 38px; }
.access-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.access-checklist .check-row { margin: 0; background: #fcfdfe; }
.fallback-card { border: 1px solid #c7d2fe; border-radius: 9px; background: #f8faff; color: #334155; padding: 16px 18px; margin: 20px 0; font-size: 14px; line-height: 1.8; }
.fallback-card summary { color: #4338ca; font-weight: 550; font-size: 14px; }
.fallback-card[open] summary { margin-bottom: 14px; }
.fallback-card ol { padding-left: 22px; }
.rescue-drawer { position: sticky; top: 82px; max-height: calc(100dvh - 106px); overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; padding: 20px; box-shadow: 0 4px 20px #0f172a05; scrollbar-width: thin; }
.rescue-drawer h2 { font-size: 16px; margin: 0 0 7px; font-weight: 650; }
.rescue-drawer h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 24px 0 12px; font-weight: 650; }
.rescue-drawer > p { color: #64748b; font-size: 12px; line-height: 1.6; }
.rescue-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; margin-bottom: 10px; background: #fbfcfe; font-size: 16px; line-height: 1.75; }
.rescue-card h4, .rescue-card summary, .rescue-card strong { font-size: 14px; font-weight: 600; color: #334155; }
.rescue-card h4 { margin: 0 0 9px; }
.rescue-card p { margin: 10px 0 0; color: #475569; }

/* Recording upload and verbatim reader */
.upload-zone { display: flex; align-items: center; justify-content: center; flex-direction: column; width: 100%; padding: 54px 32px; border: 2px dashed #cbd5e1; border-radius: 14px; background: #fff; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone:hover, .upload-zone.dragover { background: #f0fdf7; border-color: #10b981; }
.upload-zone:focus-within { outline: 3px solid #a7f3d0; outline-offset: 3px; }
.upload-zone h2, .upload-zone h3 { margin: 20px 0 10px; font-size: 21px; font-weight: 600; letter-spacing: -.025em; line-height: 1.4; }
.upload-zone p { margin: 0 auto 18px; color: #64748b; max-width: 580px; font-size: 14px; line-height: 1.8; }
.upload-icon { width: 64px; height: 64px; border-radius: 18px; color: #059669; background: #ecfdf5; border: 1px solid #d1fae5; display: grid; place-items: center; font-size: 28px; }
.upload-icon svg { width: 29px; height: 29px; }
.upload-progress { margin: 22px 0; padding: 22px; background: #fff; border: 1px solid #a7f3d0; border-radius: 12px; }
.upload-progress p, .upload-progress label { display: block; font-size: 14px; font-weight: 550; line-height: 1.6; color: #334155; }
.progress-track { height: 12px; background: #e2e8f0; overflow: hidden; border-radius: 20px; margin: 12px 0; }
.progress-fill { height: 100%; background: #10b981; border-radius: inherit; transition: width .3s; }
.recordings-list { display: grid; gap: 20px; margin-top: 24px; }
.recording-card { padding: 24px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.recording-card h3 { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.recording-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: #64748b; margin: 8px 0 14px; font-size: 12px; }
.recording-status { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.recording-player { display: block; width: 100%; max-height: 550px; aspect-ratio: 16 / 9; background: #0f172a; border: 1px solid #1e293b; border-radius: 9px; margin: 16px 0; }
.transcript-panel { border-top: 1px solid #e2e8f0; margin-top: 18px; padding-top: 16px; }
.transcript-panel > summary { font-size: 14px; color: #334155; font-weight: 550; }
.transcript-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }
.transcript-toolbar .input { flex: 1; min-width: 180px; }
.transcript-reader { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.85; max-height: 420px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; background: #f8fafc; white-space: pre-wrap; overflow-wrap: anywhere; color: #334155; }
.transcript-reader mark { background: #fef08a; color: #713f12; border-radius: 2px; padding: 1px; }

/* Phase 1 handoff */
.dossier-hero { padding: 30px; border: 1px solid #a7f3d0; border-radius: 14px; background: #f0fdf7; margin-bottom: 22px; }
.dossier-hero h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.03em; font-weight: 650; color: #064e3b; }
.dossier-hero p { font-size: 14px; color: #4b6357; margin: 0 0 20px; line-height: 1.75; max-width: 680px; }
.dossier-hero .btn { min-height: 46px; padding: 12px 20px; }
.dossier-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.scorecard { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 24px; }
.scorecard h3 { font-size: 16px; font-weight: 600; margin: 0 0 18px; }
.score-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; font-size: 14px; border-bottom: 1px solid #f1f5f9; }
.score-item:last-child { border: 0; padding-bottom: 0; }
.blocker-list { margin: 0; padding-left: 20px; color: #92400e; font-size: 14px; line-height: 1.8; }
.blocker-list li { margin: 7px 0; }
.intake-summary { margin-top: 22px; padding: 24px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.intake-summary h3 { font-size: 16px; font-weight: 600; margin: 0 0 18px; }
.intake-summary dl { display: grid; grid-template-columns: minmax(160px, .4fr) minmax(0, 1fr); margin: 0; gap: 0; }
.intake-summary dt, .intake-summary dd { margin: 0; padding: 14px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; line-height: 1.7; }
.intake-summary dt { padding-right: 20px; color: #64748b; font-weight: 500; }
.intake-summary dd { color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; }
.onb-modal { width: 100%; max-width: 600px; max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid #e2e8f0; border-radius: 16px; padding: 28px; background: #fff; box-shadow: 0 24px 64px #02061733; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.modal-header h2 { font-size: 22px; letter-spacing: -.025em; font-weight: 650; margin: 0; }
.modal-header p { font-size: 14px; color: #64748b; margin: 7px 0 0; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; margin-top: 22px; border-top: 1px solid #e2e8f0; }

.brand-version { font-size: 12px; letter-spacing: .12em; color: #64748b; margin-left: 6px; }
.skip-link:focus { clip: auto; width: auto; height: auto; top: 10px; left: 12px; z-index: 200; padding: 10px 16px; border-radius: 8px; background: #fff; color: #047857; box-shadow: 0 2px 12px #0f172a33; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #64748b; margin-bottom: 28px; }
.auth-brand strong { color: #334155; font-weight: 650; }
.auth-card .auth-brand .brand-symbol { margin: 0; width: 37px; height: 37px; flex-basis: 37px; font-size: 22px; border-radius: 10px; }
.auth-card form .field-label { margin-bottom: 7px; }
.auth-footnote { font-size: 12px; color: #64748b; line-height: 1.65; margin: 22px 0 0; }
.google-btn-slot { display: flex; justify-content: center; max-width: 100%; overflow: hidden; }
.text-muted { color: #64748b; font-size: 14px; line-height: 1.7; }
.kpi-hint { font-size: 12px; color: #64748b; margin-top: 5px; line-height: 1.5; }
.queue-card { padding: 24px 24px 0; }
.queue-card .filter-pills { padding-bottom: 22px; }
.queue-card .queue-list { gap: 0; }
.queue-card .queue-row { border: 0; border-top: 1px solid #e2e8f0; border-radius: 0; box-shadow: none; padding: 23px 0; }
.queue-card .queue-row:hover { box-shadow: none; background: #fff; }
.queue-card .empty-state { margin-bottom: 24px; }
.queue-deal-pills { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 9px 0; }
.queue-meta > strong { font-size: 14px; }
.queue-footnote { font-size: 12px; margin: 16px 0 0; color: #64748b; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 14px; color: #94a3b8; background: #f1f5f9; font-size: 27px; }
.cockpit-heading > div > p { color: #64748b; font-size: 14px; margin: 8px 0 0; line-height: 1.7; }
.cockpit-heading > div > p > .status-pill { margin-left: 8px; }
.cockpit-heading .page-actions { flex-shrink: 1; justify-content: flex-end; max-width: 62%; }
.deal-item > span { display: block; color: #64748b; font-size: 12px; font-weight: 550; letter-spacing: .06em; margin-bottom: 7px; }
.deal-item > strong { display: block; color: #334155; font-weight: 550; font-size: 14px; }
.deal-item.success > strong { color: #047857; }
.deal-item.warning > strong { color: #92400e; }
.deal-item > small { margin-top: 5px; font-size: 12px; }
.prep-bar { justify-content: space-between; }
.prep-bar .page-actions { gap: 6px; }
.onb-tab-row { position: relative; margin-bottom: 20px; }
.onb-tab-row .onb-tabs { margin-bottom: 8px; }
.onb-tab-row > .autosave-pill { display: flex; justify-content: flex-end; }
.golden-rule { padding: 20px; border: 1px solid #a7f3d0; background: #ecfdf5; border-radius: 10px; margin-bottom: 20px; }
.golden-rule p { font-size: 14px; line-height: 1.7; margin: 7px 0 16px; color: #475569; }
.coaching-label { display: block; font-size: 12px; letter-spacing: .08em; font-weight: 650; color: #047857; margin-bottom: 8px; }
.copy-access-email { width: 100%; padding: 13px 18px; font-size: 14px; font-weight: 600; }
.share-diagram figcaption { text-align: center; font-size: 12px; color: #64748b; margin-top: 9px; line-height: 1.65; }
.gbp-instructions h3 { margin: 24px 0 0; font-size: 15px; font-weight: 600; }
.gbp-instructions + .fallback-card { margin-top: 16px; }
.coaching-box h3 { font-size: 15px; font-weight: 600; margin-top: 0; }
.coaching-box + .intake-field { margin-top: 22px; }
.step-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 22px; margin-top: 22px; border-top: 1px solid #f1f5f9; }
.rescue-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rescue-heading .btn { flex-shrink: 0; font-size: 17px; line-height: 1; }
.rescue-toggle { color: #7c4a11; border-color: #e8d9b7; background: #fffcf5; }
.rescue-toggle:hover { color: #713f12; background: #fef9ed; border-color: #d6bc88; }
.upload-zone > strong { display: block; margin: 20px 0 10px; font-size: 21px; font-weight: 600; letter-spacing: -.025em; line-height: 1.4; max-width: 600px; }
.upload-zone > span:not(.upload-icon):not(.btn) { display: block; color: #64748b; max-width: 580px; font-size: 14px; line-height: 1.8; margin-bottom: 22px; }
.upload-zone:disabled { opacity: .6; }
.upload-progress-heading, .recording-header, .recordings-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.upload-progress-heading { font-size: 14px; font-weight: 600; }
.upload-progress-heading strong { overflow-wrap: anywhere; }
.upload-progress-heading > span { font-size: 24px; font-weight: 600; color: #047857; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.upload-progress small { color: #64748b; font-size: 12px; }
.upload-error { padding: 14px 16px; margin-top: 16px; border: 1px solid #fecaca; background: #fff7f7; border-radius: 8px; font-size: 14px; }
.upload-error p { color: #9f1239; }
.upload-error .btn { margin: 4px 6px 0 0; }
.recording-header > div { min-width: 0; }
.recording-header > .btn { flex-shrink: 0; }
.recordings-heading { align-items: center; margin-top: 28px; }
.recordings-heading h2 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -.02em; }
.transcript-panel summary > span { color: #94a3b8; font-size: 12px; font-weight: 400; margin-left: 8px; }
.dossier-grid .card > h3, .cockpit-content > .card > h3 { margin: 0 0 18px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.dossier-grid .scorecard { padding: 0; border: 0; background: transparent; border-radius: 0; }
.dossier-hero > .coaching-box { margin-top: 20px; padding: 15px 18px; }
dl.intake-summary { margin: 0; padding: 0; border: 0; border-radius: 0; }
dl.intake-summary > div { display: grid; grid-template-columns: minmax(170px, .45fr) minmax(0, 1fr); border-bottom: 1px solid #f1f5f9; }
dl.intake-summary > div:last-child { border: 0; }
dl.intake-summary dt, dl.intake-summary dd { border: 0; }
dl.intake-summary dt > .filled-badge { display: flex; width: fit-content; margin-top: 5px; }
.onb-modal form > p { font-size: 14px; color: #64748b; line-height: 1.75; margin: -6px 0 22px; }
.onb-modal .form-grid > label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; color: #334155; font-weight: 500; }
.modal-error { color: #be123c; font-size: 14px; line-height: 1.6; margin-top: 16px; }
.modal-error:empty { display: none; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.team-table { min-width: 520px; }
.team-layout .form-grid { grid-template-columns: 1fr; margin-top: 22px; }
.muted { color: #64748b; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.card-header > div[style*="display:flex"], .card-header > div[style*="display: flex"] { flex-wrap: wrap; }
.queue-identity > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.intake-summary dt, .intake-summary dd, .score-item > span:first-child { overflow-wrap: anywhere; }

/* Focus remains visible on the pan/zoom board and narrow horizontal toolbars. */
.miro-node:focus-visible { outline: 4px solid #0f172a; outline-offset: 3px; }
.preview-pills:focus-within { box-shadow: 0 0 0 2px #a7f3d0; }
.preview-pill:focus-visible { outline-offset: -2px; }
.onb-tab:focus-visible { outline-offset: -3px; }

/* Tablet and mobile retain every workspace action. */
@media (min-width: 1600px) {
  .workspace-content { padding: 36px 44px; }
  .workspace-header { padding-left: 44px; padding-right: 44px; }
  .queue-row { grid-template-columns: minmax(260px, 1.2fr) minmax(280px, 1.4fr) auto; padding: 24px; }
}
@media (max-width: 1399px) {
  .workspace-content { padding: 28px 24px; }
  .workspace-header { padding-left: 24px; padding-right: 24px; gap: 12px; }
  .queue-row { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.2fr) auto; gap: 16px; }
  .cockpit-layout.rescue-open { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
  .cockpit-layout.rescue-open .intake-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .kpi-box, .kpi-card { padding: 16px; }
  .preview-pill { padding: 3px 7px; font-size: 14px; }
  #btn-refresh-hub span { display: none; }
  #btn-refresh-hub { padding: 6px 10px; }
}
@media (max-width: 1199px) {
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .workspace-header > .engine-status { display: none; }
  .preview-control { max-width: 59%; }
  .grid-3, .run-steps-grid { grid-template-columns: 1fr; }
  .team-layout { grid-template-columns: 1fr; }
  .team-layout > .card:last-child { max-width: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .explorer-layout { grid-template-columns: minmax(180px, .65fr) minmax(0, 1fr); }
  .cockpit-layout.rescue-open { grid-template-columns: 1fr; }
  .rescue-drawer { position: fixed; top: 76px; bottom: 20px; right: 20px; width: 350px; max-width: calc(100vw - 40px); z-index: 70; box-shadow: 0 10px 60px #0f172a26; }
  .deal-strip { grid-template-columns: 1fr; padding: 4px 18px; }
  .deal-item { border-right: 0; border-bottom: 1px solid #f1f5f9; padding: 12px 0; }
  .deal-item:last-child { border-bottom: 0; }
  .deal-item small, .deal-item .deal-label { display: inline; margin-right: 10px; }
}
@media (max-width: 1023px) {
  :root { --sidebar-width: 264px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 40px #02061720; }
  .workspace { margin-left: 0; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: #0f172a66; z-index: 50; border: 0; }
  .sidebar-toggle { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; background: #fff; border: 1px solid #e2e8f0; color: #475569; border-radius: 7px; cursor: pointer; padding: 6px; }
  .sidebar-toggle svg { width: 20px; height: 20px; }
  .workspace-header { gap: 12px; }
  .header-title { font-size: 14px; }
  .header-subtitle { font-size: 12px; }
  .queue-row { grid-template-columns: minmax(200px, 1.25fr) minmax(180px, 1fr) auto; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explorer-layout { grid-template-columns: 1fr; }
  .onb-tabs { gap: 20px; }
}
@media (max-width: 767px) {
  .workspace-header { padding: 12px 18px; flex-wrap: wrap; gap: 10px; }
  .header-context { flex: 1; }
  .sidebar-toggle { order: 0; }
  .header-context { order: 1; }
  #btn-refresh-hub { order: 2; }
  .preview-control { order: 3; }
  .header-title { font-size: 14px; }
  .header-subtitle { font-size: 12px; }
  .preview-control { flex: 1 1 100%; max-width: 100%; align-items: stretch; padding-top: 6px; }
  .preview-label { display: none; }
  .preview-pills { width: 100%; justify-content: space-between; }
  .preview-pill { flex: 1; padding: 7px 5px; font-size: 14px; text-align: center; }
  .workspace-content { padding: 24px 18px; }
  .page-heading { margin-bottom: 22px; gap: 14px; }
  .page-title, .page-heading h1, .cockpit-heading h1 { font-size: 25px; }
  .page-actions { width: 100%; }
  .page-actions .btn-primary { flex: 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card, .kpi-box { padding: 15px; }
  .kpi-value, .kpi-val { font-size: 27px; }
  .queue-search { max-width: none; width: 100%; }
  .filter-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -18px; padding-right: 18px; }
  .filter-pill { flex-shrink: 0; }
  .queue-row { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .queue-row > .queue-detail:nth-child(3), .queue-actions { grid-column: auto; grid-row: auto; }
  .queue-actions { flex-direction: row; padding-top: 15px; border-top: 1px solid #f1f5f9; }
  .queue-actions .btn { flex: 1; }
  .queue-meta { gap: 8px; }
  .card, .intake-step { padding: 20px; }
  .grid-2, .grid-3, .intake-grid, .form-grid, .dossier-grid { grid-template-columns: 1fr; }
  .intake-grid { gap: 20px; }
  .full-width { grid-column: auto; }
  .form-label, .field-label { flex-wrap: wrap; gap: 5px; }
  .cockpit-heading { margin-bottom: 18px; }
  .cockpit-heading .page-actions { width: 100%; max-width: none; justify-content: flex-start; }
  .client-switch { width: 100%; min-width: 0; max-width: none; }
  .cockpit-heading > div { min-width: 0; }
  .prep-bar { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .prep-bar .btn { width: 100%; }
  .prep-bar .status-pill { margin-left: 0; justify-self: start; }
  .prep-bar .page-actions { display: grid; grid-template-columns: 1fr; }
  .trauma-card { padding: 16px; }
  .onb-tabs { gap: 18px; margin-right: -18px; padding-right: 18px; }
  .onb-tab { font-size: 14px; }
  .step-heading { gap: 10px; margin-bottom: 18px; }
  .step-heading h2, .step-heading h3 { font-size: 16px; }
  .coaching-box { padding: 16px; font-size: 14px; }
  .access-checklist { grid-template-columns: 1fr; }
  .share-diagram { margin: 18px -8px; }
  .rescue-drawer { top: 20px; max-height: calc(100dvh - 40px); }
  .upload-zone { padding: 34px 20px; }
  .upload-zone h2, .upload-zone h3 { font-size: 19px; }
  .upload-zone > strong { font-size: 19px; }
  .upload-zone p { font-size: 14px; }
  .recording-card { padding: 18px; }
  .recording-meta { gap: 6px 12px; }
  .transcript-reader { padding: 14px; font-size: 14px; }
  .transcript-toolbar .btn { flex: 1; }
  .dossier-hero { padding: 24px 20px; }
  .dossier-hero .btn { width: 100%; }
  .dossier-hero h2 { font-size: 22px; }
  .intake-summary { padding: 20px; }
  .intake-summary dl { grid-template-columns: 1fr; }
  dl.intake-summary > div { grid-template-columns: 1fr; }
  .intake-summary dt { padding-bottom: 0; border: 0; }
  .intake-summary dd { padding-top: 5px; }
  .onb-modal { padding: 24px 20px; }
  .modal-backdrop { padding: 12px; }
  .modal-window { max-height: calc(100dvh - 24px); height: calc(100dvh - 24px); }
  .modal-head { padding: 16px; flex-wrap: wrap; }
  .md-rendered { padding: 20px; }
  .modal-actions .btn { flex: 1; }
  .auth-card { padding: 30px 25px; }
  .toast-stack { bottom: 16px; right: 16px; }
  .data-table { font-size: 14px; }
  .miro-shell { min-height: 370px; height: 55vh; }
  .miro-toolbar { max-width: calc(100% - 16px); top: 8px; right: 8px; }
  .miro-toolbar .btn { padding: 5px 8px; font-size: 14px; }
  .geogrid-7x7 { padding: 9px; gap: 4px; }
  .geo-pin { height: 35px; font-size: 12px; }
  /* Legacy key forms used fixed inline columns; allow safe small-screen wrapping. */
  #form-add-fathom-seat > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* DEC-104: Always-Visible Sticky Save Bar + General Brain-Dump Box in Live Onboarder Cockpit */
.cockpit-sticky-save-bar {
  position: sticky;
  bottom: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 18px;
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
}
.sticky-save-left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 550;
}
.sticky-save-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}
#onb-sticky-save-status[data-tone="saving"] { color: #fde68a; }
#onb-sticky-save-status[data-tone="error"] { color: #fca5a5; }
.sticky-save-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cockpit-sticky-save-bar .btn:not(.btn-primary) {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}
.cockpit-sticky-save-bar .btn:not(.btn-primary):hover {
  background: #334155;
  color: #ffffff;
}
