/* ── Theme tokens (dark default · light via data-theme="light") ── */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --deep: #0a0e14;
  --deeper: #070a0e;
  --filters-bg: #0f141a;
  --panel-grad-top: #121820;
  --hover: #121a24;
  --row-hover: #121820;
  --border: #30363d;
  --accent: #58a6ff;
  --text: #e6edf3;
  --muted: #8b949e;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --chip: #1f6feb33;
  --primary-btn-fg: #0d1117;
  --spectral-track: #21262d;
  --sig-track: rgba(230, 237, 243, 0.06);
  --theme-toggle-icon: "☀";
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface2: #eef1f4;
  --deep: #e8ecf0;
  --deeper: #dfe4ea;
  --filters-bg: #e9eef3;
  --panel-grad-top: #f8fafc;
  --hover: #e8f0fe;
  --row-hover: #f0f4f8;
  --border: #c9d1d9;
  --accent: #0969da;
  --text: #1f2328;
  --muted: #656d76;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #cf222e;
  --chip: #ddf4ff;
  --primary-btn-fg: #0d1117;
  --spectral-track: #d0d7de;
  --sig-track: rgba(31, 35, 40, 0.06);
  --theme-toggle-icon: "☾";
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════
   DESIGN PRINCIPLE — TEXT CONTAINMENT
   All headings, titles, and body copy MUST live inside their own
   dedicated div container (.t-box / .t-title / .t-body / .t-meta).
   Never place bare text as an unconstrained flex/grid child.
   Containers own: min-width:0, max-width:100%, wrap, and overflow.
   ═══════════════════════════════════════════════════════════════ */
.t-box,
.t-title,
.t-body,
.t-meta,
.t-list,
.t-item {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
}
.t-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 8px;
}
.t-title.lg {
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text);
  margin-bottom: 6px;
}
.t-title.md {
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text);
  margin-bottom: 6px;
}
.t-body {
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.t-body.muted,
.t-meta {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.t-meta {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.t-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.t-item {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--deep);
  border: 1px solid var(--border);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text);
}
.t-item .t-item-code {
  display: block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-item .t-item-text {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.t-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  min-width: 0;
}

/* Layout children that hold text must shrink, not spill */
.panel,
.persona-card,
.kpi,
.radar-card,
.page-help,
.journey-prose .step,
.detail-section,
.grid-2 > *,
.persona-grid > *,
.journey-split > * {
  min-width: 0;
  max-width: 100%;
}
.panel > *,
.persona-card > *,
.kpi > * {
  min-width: 0;
  max-width: 100%;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
/* Brand lockup: character mark + wordmark */
.brand,
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}
.brand-link:hover .brand-title,
.brand-link:focus-visible .brand-title {
  opacity: 0.92;
}
.brand-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
.brand-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  /* ToneHalo lockup (square pad + wordmark); height-capped for header */
}
.brand-title,
header h1 {
  font-size: 15px;
  letter-spacing: 0.04em;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  line-height: 1.2;
}
header h1 span,
.brand-title span { color: var(--accent); }
/* Studio BRAND_GRADIENT — #7c3aed → #6d9ef7 → #4fc3f7 */
.brand-grad-text {
  background-image: linear-gradient(90deg, #7c3aed, #6d9ef7, #4fc3f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}
.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.brand-sub { letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }
.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nav-brand-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  margin-bottom: 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;
}
@media (max-width: 520px) {
  .header-desktop-only { display: none; }
  #status-pill, #cell-count { font-size: 10px; padding: 3px 7px; }
  .brand-logo { height: 32px; max-width: 110px; }
  .brand-title,
  header h1 { font-size: 13px; }
  /* On very narrow screens keep mark + short wordmark */
  .brand { gap: 8px; }
}

/* ── Hamburger (desktop + iPhone) ── */
.hamburger-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
}
.hamburger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
body.nav-open .hamburger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.nav-open .hamburger-icon span:nth-child(2) {
  opacity: 0;
}
body.nav-open .hamburger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.nav-backdrop[hidden] { display: none !important; }

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  max-width: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  overflow: auto;
  overscroll-behavior: contain;
  transform: translateX(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s ease, visibility 0.22s;
}
.nav-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.nav-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.nav-drawer-section {
  padding: 14px 16px 6px;
  margin: 0;
}
.nav-drawer-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px 12px;
}
.nav-item.tab {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: none !important;
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  white-space: normal;
  min-height: 44px;
  touch-action: manipulation;
}
.nav-item.tab:hover {
  background: var(--hover);
  color: var(--text);
}
.nav-item.tab.active {
  background: linear-gradient(90deg, #7c3aed22, #4fc3f722);
  color: var(--text);
  box-shadow: inset 3px 0 0 #7c3aed;
  border-bottom-color: transparent !important;
}
.nav-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.nav-drawer-actions .nav-action {
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
  text-align: left;
}
.nav-drawer-actions .theme-toggle {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
}
body.nav-open {
  overflow: hidden;
}

/* ── Support chat FAB (bottom-right, desktop + phone) ── */
.support-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  min-width: 52px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--primary-btn-fg);
  background: linear-gradient(90deg, #7c3aed, #6d9ef7, #4fc3f7);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.support-fab:hover { filter: brightness(1.06); }
.support-fab-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(13, 17, 23, 0.15);
  font-size: 14px;
  font-weight: 700;
}
.support-fab-label { font-size: 13px; }
@media (max-width: 420px) {
  .support-fab-label { display: none; }
  .support-fab { padding: 14px; border-radius: 50%; }
}

.support-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(80px, calc(16px + env(safe-area-inset-bottom) + 56px));
  z-index: 71;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.support-panel[hidden] { display: none !important; }
.support-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-grad-top);
}
.support-messages {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  background: var(--bg);
}
.support-msg { display: flex; flex-direction: column; gap: 4px; max-width: 100%; min-width: 0; }
.support-msg.user { align-items: flex-end; }
.support-msg.bot { align-items: flex-start; }
.support-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.support-msg.user .support-bubble {
  background: linear-gradient(90deg, #7c3aed33, #4fc3f733);
  border: 1px solid #7c3aed55;
}
.support-msg.bot .support-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
}
.support-meta { padding: 0 4px; font-size: 10px; }
.support-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  align-items: end;
}
.support-input-wrap { margin: 0; }
.support-form textarea {
  resize: none;
  min-height: 44px;
  max-height: 96px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Spectral 5-axis (ToneThread Studio AXIS_COLORS) ── */
:root {
  --axis-warmth: #d8567f;
  --axis-certainty: #7c3aed;
  --axis-intensity: #e07b3a;
  --axis-coherence: #2c9e80;
  --axis-resonance: #4a93cf;
  --brand-grad: linear-gradient(90deg, #7c3aed, #6d9ef7, #4fc3f7);
}
.axes-mini {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) 2.2rem;
  gap: 4px 8px;
  align-items: center;
  margin-top: 8px;
  font-family: ui-monospace, "DM Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  min-width: 0;
}
.axes-mini .ax-label {
  color: var(--muted);
  text-align: right;
  min-width: 0;
}
.axes-mini .ax-val {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.axes-mini .bar {
  height: 7px;
  border-radius: 999px;
  background: var(--deep);
}
.axes-mini .bar > i {
  border-radius: 999px;
  /* fill color set inline from AXIS_COLORS */
}
.spectral-sig {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}
.spectral-meters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin-top: 8px;
}
.spectral-meter-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 2rem;
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-family: ui-monospace, "DM Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.spectral-meter-track {
  height: 7px;
  border-radius: 999px;
  background: var(--spectral-track);
  overflow: hidden;
  min-width: 0;
}
.spectral-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 0;
}
.spectral-meter-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.radar-card .spectral-sig {
  margin: 4px auto;
}

.pill {
  border: 1px solid var(--border);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
}
.pill.muted { color: var(--muted); }
.pill.ok { border-color: #238636; color: var(--ok); }
.pill.bad { border-color: #da3633; color: var(--bad); }

/* Legacy horizontal tabs removed — navigation lives in .nav-drawer */
.tabs { display: none; }
.tab {
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--filters-bg);
  align-items: end;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.filters select, .filters input {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  min-width: 120px;
}

.btn {
  font: inherit;
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.btn.primary {
  background: linear-gradient(90deg, #7c3aed, #6d9ef7, #4fc3f7);
  border-color: #6d9ef7;
  color: var(--primary-btn-fg);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 2.5rem;
  justify-content: center;
}
.theme-toggle .theme-icon {
  font-size: 14px;
  line-height: 1;
}
.theme-toggle .theme-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 720px) {
  .theme-toggle .theme-label { display: none; }
}
.btn.ghost { background: var(--surface2); color: var(--text); }
.btn:hover { filter: brightness(1.08); }

main { flex: 1; padding: 20px; max-width: 1200px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* Plain-English About + Page Context on every tab */
.page-help {
  background: linear-gradient(180deg, var(--panel-grad-top) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.page-help > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 14px;
  user-select: none;
}
.page-help > summary::-webkit-details-marker { display: none; }
.page-help > summary::before {
  content: "▸";
  color: var(--accent);
  margin-right: 8px;
  display: inline-block;
  transition: transform 0.12s ease;
}
.page-help[open] > summary::before {
  transform: rotate(90deg);
}
.page-help-title {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.page-help-hint {
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}
.page-help-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.page-help-col {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.page-help-col .t-body {
  max-width: 52ch;
}
@media (max-width: 720px) {
  .page-help-body {
    grid-template-columns: 1fr;
  }
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.kpi .k { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi .v { font-size: 22px; margin-top: 6px; color: var(--text); }
.kpi .v.ok { color: var(--ok); }
.kpi .v.bad { color: var(--bad); }
.kpi .v.warn { color: var(--warn); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  overflow: hidden;
}
/* Prefer .t-title; bare h2 still constrained */
.panel h2,
.panel .t-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Metric rows: label | track | value — never overlay text on bars */
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(48px, 1.4fr) auto;
  gap: 10px 12px;
  align-items: center;
  margin: 8px 0;
  font-size: 12px;
  min-width: 0;
}
.bar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  line-height: 1.3;
}
.bar-label.sub {
  color: var(--muted);
  padding-left: 8px;
  font-size: 11px;
}
.bar-val {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 2.5rem;
}
.bar {
  height: 8px;
  min-width: 0;
  width: 100%;
  background: var(--deep);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
}
.bar > i {
  display: block;
  height: 100%;
  max-width: 100%;
  background: linear-gradient(90deg, #1f6feb, #58a6ff);
  border-radius: 999px;
}
.bar > i.warn { background: linear-gradient(90deg, #9a6700, #d29922); }
.bar > i.bad { background: linear-gradient(90deg, #a40e26, #f85149); }
.bar > i.ok { background: linear-gradient(90deg, #1a7f37, #3fb950); }

/* Stacked layout when labels are long / nested stance groups */
.bar-group {
  margin-bottom: 14px;
  min-width: 0;
}
.bar-group > .bar-group-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  word-break: break-word;
}
.bar-group .bar-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(40px, 1.2fr) auto;
}

/* Bars inside table cells: keep track on its own line */
td .bar-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
  max-width: 160px;
}
td .bar-inline .bar {
  width: 100%;
}
td .bar-inline .bar-val {
  text-align: left;
  font-size: 11px;
}

@media (max-width: 640px) {
  .bar-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label val"
      "bar bar";
    gap: 4px 10px;
  }
  .bar-label { grid-area: label; white-space: normal; }
  .bar-val { grid-area: val; }
  .bar-row .bar { grid-area: bar; }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th, td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
td .t-box, td .muted, td strong {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
th { color: var(--muted); font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
tr:hover td { background: var(--row-hover); }

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
}
.badge.pass { color: var(--ok); border-color: #23863655; background: #23863622; }
.badge.fail { color: var(--bad); border-color: #da363355; background: #da363322; }
.badge.na { color: var(--muted); }

.empty {
  color: var(--muted);
  padding: 28px 8px;
  text-align: center;
  line-height: 1.6;
}
.empty code { color: var(--accent); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}
.muted { color: var(--muted); }

/* Clickable run rows */
tr.run-row { cursor: pointer; }
tr.run-row:hover td { background: #152033; }
tr.run-row:focus-within td { outline: 1px solid var(--accent); }
.btn-open-run {
  font: inherit;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.btn-open-run:hover { border-color: var(--accent); }

/* Run Detail drill-down */
.detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.stage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.stage-chip {
  font: inherit;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
}
.stage-chip.active {
  border-color: #3fb950;
  color: var(--ok);
  background: #23863622;
}
.stage-chip.focus {
  border-color: var(--accent);
  color: #fff;
  background: #1f6feb55;
  box-shadow: 0 0 0 1px var(--accent);
}
.stage-chip:hover { filter: brightness(1.1); }

.journey-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.35fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}
@media (max-width: 960px) {
  .journey-split { grid-template-columns: 1fr; }
}

.journey-prose {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.journey-prose .step {
  border-left: 3px solid var(--border);
  padding: 8px 0 8px 12px;
  margin: 0 0 10px;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
}
.journey-prose .step:hover,
.journey-prose .step.focus {
  border-left-color: var(--accent);
  background: var(--hover);
}
.journey-prose .step.active-path {
  border-left-color: #3fb950;
}
.journey-prose .step .t-title.md {
  margin-bottom: 4px;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.journey-prose .step .t-body {
  margin: 0;
  color: var(--text);
}
.journey-prose .link-node {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
}
.journey-prose .link-node:hover { color: #79b8ff; }

.mermaid-panel {
  position: sticky;
  top: 12px;
  max-height: min(82vh, 960px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--deep);
}
.mermaid-panel h2 {
  background: var(--surface);
  z-index: 2;
  padding-bottom: 8px;
  flex-shrink: 0;
}
.mermaid-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.mermaid-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 6px;
}
.btn-zoom {
  min-width: 30px;
  padding: 4px 8px !important;
  font-size: 16px !important;
  line-height: 1;
  font-weight: 600;
}
.btn-zoom-text {
  padding: 4px 8px !important;
  font-size: 11px !important;
}
.mermaid-zoom-label {
  min-width: 3.2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text);
}
.mermaid-hint {
  font-size: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.mermaid-viewport-shell {
  flex: 1;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--deeper);
}
.mermaid-viewport {
  width: 100%;
  height: min(58vh, 640px);
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: none;
}
.mermaid-viewport.dragging {
  cursor: grabbing;
}
.mermaid-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.mermaid-canvas .mermaid {
  display: block;
}
.mermaid-canvas svg {
  max-width: none !important;
  height: auto;
}
/* Pulse focused node after click-through zoom */
.mermaid-canvas .mermaid-node-pulse {
  filter: drop-shadow(0 0 6px #58a6ff) drop-shadow(0 0 14px #1f6feb88);
}
.mermaid-canvas .mermaid-node-pulse rect,
.mermaid-canvas .mermaid-node-pulse polygon,
.mermaid-canvas .mermaid-node-pulse circle,
.mermaid-canvas .mermaid-node-pulse path {
  stroke: #fff !important;
  stroke-width: 2.5px !important;
}
.mermaid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.mermaid-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.mermaid-legend .lg-active::before { background: #3fb950; }
.mermaid-legend .lg-focus::before { background: #1f6feb; }

/* Legacy host alone (if any) */
.mermaid-wrap {
  overflow: auto;
  min-height: 280px;
}
.mermaid-wrap .mermaid {
  display: flex;
  justify-content: center;
}

.starter-box {
  white-space: pre-wrap;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
}
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.persona-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}
.persona-card .pv {
  font-size: 12px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1.45;
  color: var(--text);
  max-height: 140px;
  overflow: auto;
  margin-top: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.persona-card .kv {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}
.persona-card .kv > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.detail-section {
  scroll-margin-top: 16px;
  overflow: hidden;
}
.audit-list {
  list-style: none;
  max-height: 240px;
  overflow: auto;
  font-size: 11px;
  min-width: 0;
}
.audit-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.audit-list li strong { color: var(--text); }
.report-md {
  white-space: pre-wrap;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  max-height: 420px;
  overflow: auto;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.starter-box {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Courtroom polish — pipeline, desks, seal */
.court-timeline-panel { overflow: hidden; }
.court-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  min-width: 0;
}
.court-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 11px;
  min-width: 0;
  max-width: 100%;
}
.court-stage-n {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 1.1rem;
}
.court-stage-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9rem;
}
.court-stage.done {
  border-color: #23863688;
  background: #23863622;
  color: var(--ok);
}
.court-stage.done .court-stage-n { color: var(--ok); }
.court-stage.current {
  border-color: #7c3aed;
  background: linear-gradient(90deg, #7c3aed33, #4fc3f733);
  color: var(--text);
  box-shadow: 0 0 0 1px #7c3aed55;
}
.court-stage.current .court-stage-n { color: #a78bfa; }
.court-stage.pending { opacity: 0.55; }
.court-stage.failed {
  border-color: #da3633aa;
  background: #da363322;
  color: var(--bad);
}
.court-stage-sep {
  color: var(--muted);
  font-size: 11px;
  opacity: 0.5;
  user-select: none;
}
.highlight-desk {
  border-color: #7c3aed88 !important;
  box-shadow: 0 0 0 1px #7c3aed33;
}
.court-desk .t-title::before {
  content: "⚖ ";
  opacity: 0.85;
}
.clarif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.clarif-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--deep);
}
.seal-box {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #7c3aed55;
  background: linear-gradient(135deg, #7c3aed14, #4fc3f714);
  min-width: 0;
}
.seal-ok { color: var(--ok) !important; }
.seal-bad { color: var(--bad) !important; }
.report-md-pretty {
  border-left: 3px solid #7c3aed;
}

/* Admin area */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.admin-tab {
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}
.admin-input {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
textarea.admin-input {
  resize: vertical;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.admin-table-wrap { overflow: auto; max-width: 100%; }
.admin-table { min-width: 720px; }
.admin-table .admin-input { font-size: 11px; padding: 4px 6px; }
.admin-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.builtin-persona-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.builtin-persona-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  overflow: hidden;
  min-width: 0;
}
.builtin-persona-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  user-select: none;
}
.builtin-persona-summary::-webkit-details-marker { display: none; }
.builtin-persona-summary::before {
  content: "▸";
  color: var(--accent);
  margin-right: 8px;
  display: inline-block;
  transition: transform 0.12s ease;
}
.builtin-persona-card[open] > .builtin-persona-summary::before {
  transform: rotate(90deg);
}
.builtin-persona-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.json-view {
  display: block;
  margin: 0;
  padding: 10px 12px;
  max-height: 320px;
  overflow: auto;
  font-family: ui-monospace, "DM Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}
@media (max-width: 720px) {
  .admin-form { grid-template-columns: 1fr; }
}

/* By LLM — plain-English provider profiles */
.llm-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
.llm-summary-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.llm-summary-card .t-title.md {
  color: var(--accent);
  margin-bottom: 6px;
}
.llm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.llm-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #30363d;
  background: var(--bg);
  color: var(--muted);
}
.llm-summary-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
  line-height: 1.55;
}
.llm-summary-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.llm-mini-radar {
  flex-shrink: 0;
  opacity: 0.95;
}

/* Radar / sparkline */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.radar-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.radar-card .meta {
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.4;
}
.radar-card canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}
.sparkline {
  display: inline-block;
  vertical-align: middle;
}
.sparkline svg { display: block; }

/* Run suite panel */
.run-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.run-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.run-form select, .run-form input {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 8px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}
.chip input { accent-color: var(--accent); }
.progress-wrap {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--deep);
}
.progress-track {
  height: 10px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 8px 0;
}
.progress-track > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1f6feb, #58a6ff);
  transition: width 0.25s ease;
}
.event-log {
  max-height: 200px;
  overflow: auto;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}
.event-log .ev-ok { color: var(--ok); }
.event-log .ev-err { color: var(--bad); }

.axes-mini {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 8px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  min-width: 120px;
}
.axes-mini .bar { height: 5px; }

/* ── SpectralHash auth pages ─────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 90%, rgba(79, 195, 247, 0.08), transparent 50%),
    var(--bg);
}
.auth-shell {
  width: 100%;
  max-width: 420px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.auth-brand {
  margin-bottom: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-brand .t-title {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.auth-logo {
  width: min(200px, 70vw);
  height: auto;
  max-height: 140px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
}
.auth-logo-sm {
  width: min(160px, 55vw);
  max-height: 120px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-form .t-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-form input {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 10px 14px;
  font-weight: 600;
}
.auth-error {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.auth-msg {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.auth-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.auth-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}
.auth-links a:hover { text-decoration: underline; }
.auth-theme { font-size: 12px; }
.auth-foot {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
}
.auth-axes {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.axes-fingerprint { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ax-row {
  display: grid;
  grid-template-columns: 72px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.ax-track {
  height: 6px;
  background: var(--spectral-track);
  border-radius: 999px;
  overflow: hidden;
}
.ax-track > i { display: block; height: 100%; border-radius: 999px; }
.ax-val { text-align: right; font-variant-numeric: tabular-nums; }

/* Session chip in nav */
.session-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  margin: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--deep);
  min-width: 0;
}
.session-chip .sess-uid {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-chip .sess-meta {
  font-size: 10px;
  color: var(--muted);
}
.session-chip .sess-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
#session-pill {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#tenant-pill {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-color: color-mix(in srgb, #7c3aed 40%, var(--border));
}
.tenant-switch-wrap {
  margin-top: 6px;
}
.tenant-switch-wrap select {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}

/* ── Tonal fingerprint (Studio-branded 5-axis graph) ── */
.tonal-fingerprint {
  --tf-track: var(--spectral-track);
  display: block;
  min-width: 0;
  margin-top: 8px;
  padding: 10px 12px 9px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.tf-eyebrow {
  font-family: ui-monospace, "DM Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.tf-meta { letter-spacing: 0.06em; text-transform: none; opacity: 0.8; }
.tf-rows {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) 2.6rem;
  gap: 7px 10px;
  align-items: center;
  min-width: 0;
  font-family: ui-monospace, "DM Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.tf-label { color: var(--muted); text-transform: uppercase; }
.tf-track {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--tf-track);
  overflow: hidden;
  min-width: 0;
}
.tf-fill { display: block; height: 100%; border-radius: 999px; min-width: 6px; }
.tf-val { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.tonal-fingerprint.tf--mini { padding: 0; border: 0; background: transparent; margin-top: 6px; }
.tonal-fingerprint.tf--mini .tf-rows { gap: 4px 8px; font-size: 10px; grid-template-columns: 1.7rem minmax(0, 1fr) 2.2rem; }
.tonal-fingerprint.tf--mini .tf-track { height: 5px; }

/* ?kiosk=1 presentation mode */
.kiosk #session-pill { display: none; }

/* A2 — New review wizard */
.packs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 8px; margin-top: 8px; }
.pack-card { text-align: left; font: inherit; color: var(--text); background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.pack-card:hover { border-color: var(--accent); }
.pack-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pack-id { font-family: ui-monospace, "DM Mono", Menlo, monospace; font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.pack-name { font-weight: 600; margin: 2px 0; }
.pack-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pack-meta { font-family: ui-monospace, "DM Mono", Menlo, monospace; font-size: 10px; color: var(--muted); margin-top: 6px; }
.nr-label { display: block; font-family: ui-monospace, "DM Mono", Menlo, monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
.nr-input { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.nr-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.nr-input { font-family: ui-monospace, "DM Mono", Menlo, monospace; font-size: 12px; line-height: 1.5; resize: vertical; }
.nr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.nr-personas { display: flex; flex-wrap: wrap; gap: 6px; }
.nr-chip { display: inline-flex; align-items: center; gap: 4px; font-family: ui-monospace, "DM Mono", Menlo, monospace; font-size: 11px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); cursor: pointer; }
.nr-chip input { margin: 0; }
