/* ═══════════════════════════════════════════════════════════════════════
   NICKEL CALL COPILOT — "Trading-Desk Noir"
   Precision instrument aesthetic: deep ink navy, luminous glass panels,
   emerald signal accent, expanded-width display type + mono data type.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Color tokens ── */
  --bg: #04070d;
  --bg-raised: #080d17;
  --surface: rgba(13, 19, 33, 0.78);
  --surface-solid: #0d1321;
  --surface-2: rgba(20, 28, 46, 0.85);
  --surface-3: rgba(28, 38, 60, 0.9);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text: #eaf0f8;
  --text-dim: #a7b2c8;
  --text-faint: #71809c;

  --accent: #2ee596;
  --accent-strong: #19c47c;
  --accent-soft: rgba(46, 229, 150, 0.12);
  --accent-border: rgba(46, 229, 150, 0.35);
  --accent-glow: rgba(46, 229, 150, 0.24);

  --cyan: #56c8e8;
  --cyan-soft: rgba(86, 200, 232, 0.12);
  --cyan-border: rgba(86, 200, 232, 0.32);

  --amber: #f5b04b;
  --amber-soft: rgba(245, 176, 75, 0.12);
  --amber-border: rgba(245, 176, 75, 0.32);

  --steel: #8ba3d4;
  --steel-soft: rgba(139, 163, 212, 0.12);
  --steel-border: rgba(139, 163, 212, 0.32);

  --danger: #f26d5f;
  --danger-soft: rgba(242, 109, 95, 0.14);
  --danger-border: rgba(242, 109, 95, 0.4);

  /* ── Type ── */
  --font-ui: "Archivo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* ── Rhythm ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ── Motion ── */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --dur-fast: 160ms;
  --dur-med: 260ms;
  --dur-slow: 420ms;

  --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 12px 40px -12px rgba(0, 0, 0, 0.65);

  /* z-index scale */
  --z-rail: 10;
  --z-header: 20;
  --z-input: 40;
  --z-overlay: 100;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  /* Atmosphere: dual glow + micro grid */
  background-image:
    radial-gradient(1100px 520px at 8% -12%, rgba(46, 229, 150, 0.07), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(86, 154, 232, 0.08), transparent 55%),
    linear-gradient(rgba(148, 163, 184, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.028) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Film-grain overlay for depth */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

::selection {
  background: rgba(46, 229, 150, 0.28);
  color: #fff;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}
*::-webkit-scrollbar-track {
  background: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

/* ═══════════════════════════ SHELL LAYOUT ═══════════════════════════ */

.app-layout.command-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* ── Sidebar ── */
.command-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 15, 27, 0.9), rgba(6, 10, 18, 0.95));
  backdrop-filter: blur(14px);
  animation: slide-in-left var(--dur-slow) var(--ease-spring) both;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

a.sidebar-brand:hover .brand-mark {
  box-shadow: 0 0 0 1px rgba(46, 229, 150, 0.6), 0 10px 28px -6px var(--accent-glow);
}

.sidebar-brand strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  font-variation-settings: "wdth" 118;
  letter-spacing: 0.02em;
}

.sidebar-brand span {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.brand-mark {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  font-variation-settings: "wdth" 125;
  color: #03160c;
  background: linear-gradient(135deg, #46f0a8, #19c47c 70%);
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(46, 229, 150, 0.4), 0 8px 22px -6px var(--accent-glow);
}

.command-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.command-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  min-height: 40px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}

.command-nav-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.75;
  transition: opacity var(--dur-fast) ease;
}

.command-nav-btn:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.07);
}

.command-nav-btn:active {
  transform: scale(0.98);
}

.command-nav-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.command-nav-btn.active svg {
  opacity: 1;
}

.sidebar-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.04);
}

.sidebar-status span {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.sidebar-status strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

.sidebar-history-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 12px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.sidebar-history-link svg {
  width: 15px;
  height: 15px;
}

.sidebar-history-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.06);
}

/* ── Main column ── */
.main-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
}

/* ═══════════════════════════ TOP NAV ═══════════════════════════ */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(14px);
  z-index: var(--z-header);
  animation: fade-down var(--dur-slow) var(--ease-spring) both;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.top-nav .brand-mark {
  display: none;
}

.title-stack h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  font-variation-settings: "wdth" 120;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.title-stack span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.status-indicators {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Badges ── */
.badge,
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.06);
  white-space: nowrap;
  transition: all var(--dur-med) ease;
}

.badge::before,
.mode-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge.idle {
  color: var(--text-faint);
}

.badge.muted {
  color: var(--text-faint);
  border-style: dashed;
}

.badge.live {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.badge.live::before {
  animation: pulse-dot 1.6s ease-in-out infinite;
  box-shadow: 0 0 8px var(--accent);
}

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

.badge.error {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.mode-badge.listen {
  color: var(--cyan);
  border-color: var(--cyan-border);
  background: var(--cyan-soft);
}

.mode-badge.listen::before {
  animation: pulse-dot 2s ease-in-out infinite;
}

.mode-badge.ai-paused {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-soft);
}

/* ═══════════════════════════ BUTTONS ═══════════════════════════ */

.primary-btn,
.secondary-btn,
.ghost-btn,
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  transition:
    transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur-med) ease,
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease;
}

.primary-btn svg,
.secondary-btn svg,
.action-btn svg {
  width: 15px;
  height: 15px;
}

.primary-btn {
  padding: 10px 18px;
  min-height: 40px;
  color: #03160c;
  background: linear-gradient(135deg, #46f0a8, #19c47c 80%);
  border: 1px solid rgba(46, 229, 150, 0.55);
  box-shadow: 0 8px 24px -8px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.primary-btn:hover:not(:disabled) {
  box-shadow: 0 10px 32px -6px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
  transform: translateY(-1px);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.secondary-btn {
  padding: 10px 16px;
  min-height: 40px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(242, 109, 95, 0.22);
  transform: translateY(-1px);
}

.secondary-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.ghost-btn {
  padding: 8px 14px;
  min-height: 34px;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
}

.ghost-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.1);
}

.ghost-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.ghost-btn.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.sm-btn {
  padding: 7px 13px;
  font-size: 12.5px;
  min-height: 32px;
}

.action-btn {
  padding: 10px 20px;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.action-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.listen-btn:not(:disabled) {
  color: var(--cyan);
  border-color: var(--cyan-border);
  background: var(--cyan-soft);
}

.listen-btn:hover:not(:disabled) {
  background: rgba(86, 200, 232, 0.2);
}

.done-btn:not(:disabled) {
  color: #03160c;
  background: linear-gradient(135deg, #46f0a8, #19c47c 80%);
  border-color: rgba(46, 229, 150, 0.55);
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}

.done-btn:hover:not(:disabled) {
  box-shadow: 0 10px 32px -6px var(--accent-glow);
}

.history-link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

/* ═══════════════════════════ COMMAND TOOLBAR ═══════════════════════════ */

.command-toolbar {
  display: flex;
  align-items: stretch;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: rgba(8, 13, 23, 0.5);
  animation: fade-down var(--dur-slow) var(--ease-spring) 60ms both;
}

.command-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.segmented-control button {
  padding: 6px 13px;
  min-height: 30px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 9px;
  transition: color var(--dur-fast) ease, background var(--dur-med) var(--ease-spring), box-shadow var(--dur-med) ease;
}

.segmented-control button:hover {
  color: var(--text);
}

.segmented-control button.active {
  color: #03160c;
  background: linear-gradient(135deg, #46f0a8, #22cd85);
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}

/* ── Signal strip ── */
.command-signal-strip {
  display: flex;
  gap: var(--space-3);
  margin-left: auto;
  min-width: 0;
  flex: 1 1 380px;
  justify-content: flex-end;
}

.signal-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 16px;
  min-width: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.signal-tile > span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
}

.signal-tile > strong {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.next-move-tile {
  flex: 0 1 380px;
  min-width: 0;
}

.next-move-tile > strong {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.score-track {
  width: 100%;
  height: 4px;
  margin-top: 2px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.score-track i {
  display: block;
  height: 100%;
  width: 52%;
  border-radius: 99px;
  background: linear-gradient(90deg, #19c47c, #46f0a8);
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 700ms var(--ease-spring);
}

/* ═══════════════════════════ CENTER GRID ═══════════════════════════ */

.command-center-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 324px;
  gap: var(--space-4);
  flex: 1;
  min-height: 0;
  padding: var(--space-4) var(--space-5);
  overflow: hidden;
}

.command-workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
}

.dual-panel-area {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-4);
  width: 100%;
  min-height: 0;
}

/* ── Panels ── */
.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  animation: rise-in var(--dur-slow) var(--ease-spring) both;
}

.client-panel {
  animation-delay: 100ms;
}

.ai-panel {
  animation-delay: 160ms;
  position: relative;
}

.ai-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.03);
}

.panel-header h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  font-variation-settings: "wdth" 120;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.panel-header .subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.board-nav-btn {
  width: 32px;
  padding: 7px 0;
}

.board-nav-btn svg {
  width: 13px;
  height: 13px;
}

.board-page-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════ CLIENT STREAM ═══════════════════════════ */

.client-box {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4);
  font-size: 14px;
  line-height: 1.65;
  scroll-behavior: smooth;
}

.placeholder-text {
  display: block;
  padding: var(--space-5);
  color: var(--text-faint);
  font-size: 13.5px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.client-block-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 10px 12px;
  margin-bottom: var(--space-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--cyan-border);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.04);
  animation: rise-in var(--dur-med) var(--ease-spring) both;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.client-block-row:hover {
  background: rgba(148, 163, 184, 0.07);
  border-color: var(--border-strong);
}

.client-block-main {
  min-width: 0;
  flex: 1;
}

.client-block-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.client-block-text {
  color: var(--text);
  word-break: break-word;
}

.client-block-edit-btn {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}

.client-block-row:hover .client-block-edit-btn,
.client-block-edit-btn:focus-visible {
  opacity: 1;
}

/* Flash when a new line commits */
.client-box-flash {
  animation: box-flash 900ms var(--ease-out);
}

@keyframes box-flash {
  0% {
    box-shadow: inset 0 0 0 1px var(--accent-border), inset 0 0 34px -12px var(--accent-glow);
  }
  100% {
    box-shadow: inset 0 0 0 0 transparent;
  }
}

/* Live caption line */
.live-caption-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  animation: rise-in var(--dur-med) var(--ease-spring) both;
}

.live-caption-line.waiting {
  border-style: dashed;
  background: rgba(46, 229, 150, 0.05);
}

.live-caption-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #03160c;
  background: linear-gradient(135deg, #46f0a8, #22cd85);
  border-radius: 6px;
  animation: pulse-soft 2s ease-in-out infinite;
}

.live-typing {
  color: var(--text);
  word-break: break-word;
}

.muted-text {
  color: var(--text-faint);
}

.cursor-blink {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.05s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

/* Edit-line panel */
.edit-last-chunk-panel {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--amber-border);
  background: var(--amber-soft);
  animation: fade-down var(--dur-med) var(--ease-spring) both;
}

.edit-last-chunk-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber);
}

.edit-last-chunk-textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  resize: vertical;
}

.edit-last-chunk-textarea:focus {
  border-color: var(--amber);
  outline: none;
}

.edit-last-chunk-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ═══════════════════════════ RESPONSE BOARD ═══════════════════════════ */

.messenger-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.answer-mode-bar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.mode-chip {
  padding: 3px 11px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.mode-chip-direct {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.mode-chip-probe {
  color: var(--cyan);
  border-color: var(--cyan-border);
  background: var(--cyan-soft);
}

.mode-chip-proof {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-soft);
}

.mode-chip-guardrail {
  color: var(--steel);
  border-color: var(--steel-border);
  background: var(--steel-soft);
}

.messenger-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4);
}

.history-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: var(--space-6);
  color: var(--text-faint);
  font-size: 13.5px;
  text-align: center;
  line-height: 1.7;
}

/* ── Chat turn ── */
.chat-turn {
  animation: rise-in var(--dur-slow) var(--ease-spring) both;
}

.chat-question {
  position: relative;
  padding: 10px 14px 10px 34px;
  margin-bottom: var(--space-3);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.05);
  word-break: break-word;
}

.chat-question::before {
  content: "“";
  position: absolute;
  left: 12px;
  top: 4px;
  font-size: 24px;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1.2;
}

/* Refining chip (fast board being upgraded by the playbook model) */
.refining-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-3);
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber-border);
  border-radius: 99px;
  background: var(--amber-soft);
}

.refining-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse-dot 1.1s ease-in-out infinite;
}

/* Analysis strip */
.analysis-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.analysis-strip span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.04);
}

.analysis-strip strong {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  flex-shrink: 0;
}

.thinking-strip strong {
  color: var(--amber);
}

/* ── Card grid ── */
.response-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-3);
}

.response-card {
  --card-color: var(--accent);
  --card-border: var(--accent-border);
  --card-soft: var(--accent-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-top: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--card-soft), transparent 46%), var(--surface-2);
  box-shadow: var(--shadow-panel);
  animation: card-in var(--dur-slow) var(--ease-spring) both;
  transition: transform var(--dur-med) var(--ease-spring), border-color var(--dur-fast) ease, box-shadow var(--dur-med) ease;
}

.response-card:nth-child(1) { animation-delay: 40ms; }
.response-card:nth-child(2) { animation-delay: 110ms; }
.response-card:nth-child(3) { animation-delay: 180ms; }
.response-card:nth-child(4) { animation-delay: 250ms; }

.response-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-border);
  box-shadow: var(--shadow-pop);
}

.response-card-probe {
  --card-color: var(--cyan);
  --card-border: var(--cyan-border);
  --card-soft: var(--cyan-soft);
}

.response-card-proof {
  --card-color: var(--amber);
  --card-border: var(--amber-border);
  --card-soft: var(--amber-soft);
}

.response-card-guardrail {
  --card-color: var(--steel);
  --card-border: var(--steel-border);
  --card-soft: var(--steel-soft);
}

.response-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.response-mode {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--card-color);
}

.confidence-pill {
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.06);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.response-answer {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.response-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.response-card-footer > span {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}

.response-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.micro-copy-btn {
  padding: 4px 10px;
  min-height: 26px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: all var(--dur-fast) ease;
}

.micro-copy-btn:hover {
  color: var(--card-color, var(--accent));
  border-color: var(--card-border, var(--accent-border));
  background: var(--card-soft, var(--accent-soft));
}

.micro-copy-btn:active {
  transform: scale(0.94);
}

.chat-time {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: right;
}

/* ── Thinking skeleton ── */
.thinking-card {
  border-top-color: var(--amber-border);
}

.thinking-card .response-answer {
  color: var(--text-faint);
  font-size: 12.5px;
}

.skeleton-line {
  height: 11px;
  width: 70%;
  border-radius: 99px;
  background: linear-gradient(
    100deg,
    rgba(148, 163, 184, 0.09) 30%,
    rgba(148, 163, 184, 0.24) 50%,
    rgba(148, 163, 184, 0.09) 70%
  );
  background-size: 220% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.skeleton-line.wide {
  width: 94%;
}

@keyframes shimmer {
  0% {
    background-position: 130% 0;
  }
  100% {
    background-position: -90% 0;
  }
}

/* Plain answer (no board) */
.plain-answer-turn .chat-answer-wrap {
  margin-bottom: var(--space-2);
}

.chat-answer {
  padding: var(--space-4);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface-2);
  word-break: break-word;
}

.live-answer {
  border-style: dashed;
}

/* ═══════════════════════════ INTELLIGENCE RAIL ═══════════════════════════ */

.intelligence-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  z-index: var(--z-rail);
}

.rail-panel {
  flex-shrink: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-panel);
  animation: slide-in-right var(--dur-slow) var(--ease-spring) both;
}

.rail-panel:nth-child(1) { animation-delay: 120ms; }
.rail-panel:nth-child(2) { animation-delay: 180ms; }
.rail-panel:nth-child(3) { animation-delay: 240ms; }
.rail-panel:nth-child(4) { animation-delay: 300ms; }
.rail-panel:nth-child(5) { animation-delay: 360ms; }

.rail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.rail-panel-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  font-variation-settings: "wdth" 120;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail-panel-header span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.rail-panel-header > div > span {
  display: block;
  margin-top: 2px;
}

/* Profile grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin: 0;
}

.profile-grid > div {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.04);
}

.profile-grid dt {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.profile-grid dd {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* Playbook search */
.playbook-search {
  position: relative;
  margin-bottom: var(--space-3);
}

.playbook-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  pointer-events: none;
}

.playbook-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  min-height: 38px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.playbook-search input::placeholder {
  color: var(--text-faint);
}

.playbook-search input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(46, 229, 150, 0.12);
}

.playbook-results {
  max-height: 220px;
  overflow-y: auto;
  font-size: 12.5px;
  color: var(--text-faint);
}

.playbook-results > p {
  margin: 0;
  padding: var(--space-2) 0;
}

.playbook-result {
  padding: 10px 12px;
  margin-bottom: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.04);
  animation: rise-in var(--dur-med) var(--ease-spring) both;
}

.playbook-result strong {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 3px;
}

.playbook-result p {
  margin: 0 0 4px;
  color: var(--text-dim);
  line-height: 1.5;
}

.playbook-result span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* Deal meter */
.deal-meter {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: var(--space-2);
}

.deal-meter strong {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px var(--accent-glow);
  line-height: 1.1;
}

.deal-meter span {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.rail-panel > p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

/* Post-call desk */
.post-call-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.post-call-grid article {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.04);
}

.mini-label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.post-call-grid p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

.post-call-grid pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.stats-grid > div {
  padding: 10px 6px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.04);
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}

.stats-grid > div:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.stats-grid strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stats-grid span {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.top-concern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
}

.top-concern span {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.top-concern strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--amber);
}

/* ═══════════════════════════ INPUT AREA ═══════════════════════════ */

.input-area {
  border-top: 1px solid var(--border);
  background: rgba(6, 10, 18, 0.82);
  backdrop-filter: blur(16px);
  z-index: var(--z-input);
  animation: fade-up var(--dur-slow) var(--ease-spring) 200ms both;
}

.controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
}

.controls-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.manual-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.manual-input-wrapper textarea {
  flex: 1;
  padding: 11px 14px;
  min-height: 44px;
  max-height: 130px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  resize: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.manual-input-wrapper textarea::placeholder {
  color: var(--text-faint);
}

.manual-input-wrapper textarea:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(46, 229, 150, 0.12);
}

.manual-input-wrapper .primary-btn {
  min-height: 44px;
}

/* Workflow stepper */
.control-strip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.workflow-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.workflow-step i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  background: var(--accent-soft);
}

.workflow-step:not(:last-child)::after {
  content: "";
  width: 26px;
  height: 1px;
  margin-left: var(--space-2);
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ═══════════════════════════ FOCUS MODES ═══════════════════════════ */

/* Focus Mode: hide the rail + sidebar, pure live-call handling */
body.focus-mode .intelligence-rail,
body.focus-mode .command-sidebar {
  display: none;
}

body.focus-mode .app-layout.command-shell {
  grid-template-columns: 1fr;
}

body.focus-mode .command-center-grid {
  grid-template-columns: 1fr;
}

/* Board Focus: hide transcript, give the whole width to the Response Board */
body.board-focus .client-panel {
  display: none;
}

body.board-focus .dual-panel-area {
  grid-template-columns: 1fr;
}

body.board-focus .response-board-grid,
body.focus-mode.board-focus .response-board-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ═══════════════════════════ LOG ENTRIES (hidden sink) ═══════════════════ */

.log-entry {
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-dim);
}

.log-entry strong {
  color: var(--accent);
  margin-right: 8px;
}

/* ═══════════════════════════ HISTORY PAGE ═══════════════════════════ */

.history-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100dvh;
  overflow: hidden;
  transition: grid-template-columns var(--dur-med) var(--ease-spring);
}

.history-layout.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.history-layout.sidebar-collapsed .history-sidebar {
  overflow: hidden;
  border-right: none;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
}

.history-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 15, 27, 0.9), rgba(6, 10, 18, 0.95));
  backdrop-filter: blur(14px);
  transition: opacity var(--dur-med) ease;
  animation: slide-in-left var(--dur-slow) var(--ease-spring) both;
}

.history-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.history-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  white-space: nowrap;
}

.history-sidebar-logo svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.history-new-call-btn {
  padding: 7px 13px;
  min-height: 32px;
  font-size: 12px;
  font-weight: 700;
  color: #03160c;
  background: linear-gradient(135deg, #46f0a8, #19c47c 80%);
  border: 1px solid rgba(46, 229, 150, 0.55);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-med) ease;
}

.history-new-call-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -8px var(--accent-glow);
}

.history-search-wrap {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.history-search {
  width: 100%;
  padding: 9px 13px;
  min-height: 38px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.history-search::placeholder {
  color: var(--text-faint);
}

.history-search:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(46, 229, 150, 0.12);
}

.history-sidebar-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
}

.history-session-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.history-session-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) ease;
}

.history-session-item:hover {
  background: rgba(148, 163, 184, 0.06);
}

.history-session-item.selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.history-session-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: inherit;
}

.history-session-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-session-item.selected .history-session-title {
  color: var(--accent);
}

.history-session-preview {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

.history-session-rename {
  align-self: center;
  flex-shrink: 0;
  margin-right: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  opacity: 0;
  transition: all var(--dur-fast) ease;
}

.history-session-item:hover .history-session-rename,
.history-session-rename:focus-visible {
  opacity: 1;
}

.history-session-rename:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.08);
}

.history-sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}

.history-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  min-height: 38px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}

.history-clear-btn svg {
  width: 14px;
  height: 14px;
}

.history-clear-btn:hover {
  background: rgba(242, 109, 95, 0.24);
}

.history-clear-btn:active {
  transform: scale(0.98);
}

.history-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
}

.history-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(14px);
  animation: fade-down var(--dur-slow) var(--ease-spring) both;
}

.history-top-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--dur-fast) ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.1);
}

.history-title-block {
  min-width: 0;
}

.history-title-block h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.history-conversation-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.history-empty-state {
  margin: auto;
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
  line-height: 1.7;
  animation: rise-in var(--dur-slow) var(--ease-spring) both;
}

.history-empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto var(--space-3);
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.history-empty-icon svg {
  width: 24px;
  height: 24px;
}

.history-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(620px, 82%);
  animation: rise-in var(--dur-med) var(--ease-spring) both;
}

.history-msg.customer {
  align-self: flex-start;
}

.history-msg.assistant {
  align-self: flex-end;
  align-items: flex-end;
}

.history-msg-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.history-msg.assistant .history-msg-label {
  color: var(--accent);
}

.history-msg-bubble {
  padding: 12px 15px;
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  word-break: break-word;
}

.history-msg.customer .history-msg-bubble {
  border-left: 2px solid var(--cyan-border);
  border-top-left-radius: 4px;
}

.history-msg.assistant .history-msg-bubble {
  border: 1px solid var(--accent-border);
  border-top-right-radius: 4px;
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface-2);
}

.history-msg-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* ═══════════════════════════ KEYFRAMES ═══════════════════════════ */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

/* ═══════════════════════════ RESPONSIVE ═══════════════════════════ */

@media (max-width: 1280px) {
  .command-center-grid {
    grid-template-columns: minmax(0, 1fr) 288px;
  }

  .dual-panel-area {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 1080px) {
  .app-layout.command-shell {
    grid-template-columns: 1fr;
  }

  .command-sidebar {
    display: none;
  }

  body {
    overflow: auto;
  }

  .main-content {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .command-center-grid {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .dual-panel-area {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 380px;
    max-height: 66dvh;
  }

  .intelligence-rail {
    overflow: visible;
  }

  .command-signal-strip {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .top-nav {
    flex-wrap: wrap;
    padding: var(--space-3) var(--space-4);
  }

  .nav-left {
    flex-wrap: wrap;
  }

  .command-toolbar,
  .controls-wrapper,
  .command-center-grid {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .segmented-control {
    flex-wrap: wrap;
  }

  .segmented-control button {
    min-height: 40px;
  }

  .response-board-grid,
  body.board-focus .response-board-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .control-strip {
    display: none;
  }

  .history-layout {
    grid-template-columns: 1fr;
  }

  .history-sidebar {
    display: none;
  }

  .history-layout.sidebar-collapsed .history-sidebar {
    display: flex;
    position: fixed;
    inset: 0 20% 0 0;
    z-index: var(--z-overlay);
    opacity: 1;
    padding: 0;
  }
}

/* ═══════════════════════ SANDLER STRATEGY + ROLE ═══════════════════════ */

.role-control button {
  min-width: 46px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Sandler on/off switch */
.sandler-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 8px;
  min-height: 36px;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.sandler-switch-track {
  position: relative;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.2);
  transition: background var(--dur-med) ease;
}

.sandler-switch-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform var(--dur-med) var(--ease-spring), background var(--dur-med) ease;
}

.sandler-switch-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sandler-switch.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.sandler-switch.active .sandler-switch-track {
  background: rgba(46, 229, 150, 0.32);
}

.sandler-switch.active .sandler-switch-track i {
  transform: translateX(16px);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Sandler coach panel */
.sandler-panel {
  border-color: var(--accent-border);
  background:
    linear-gradient(180deg, rgba(46, 229, 150, 0.07), transparent 42%),
    var(--surface);
}

.sandler-coach-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sandler-idle,
.sandler-goal {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-faint);
}

.sandler-goal strong {
  color: var(--accent);
}

.sandler-whisper {
  padding: 11px 13px;
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.sandler-whisper-tag {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.sandler-whisper p {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}

.sandler-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.sandler-cell {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.04);
}

.sandler-cell dt {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sandler-cell dd {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.sandler-cell dd.ok {
  color: var(--accent);
}

.sandler-cell dd.warn {
  color: var(--amber);
}

.sandler-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pain-meter {
  display: inline-flex;
  gap: 3px;
}

.pain-meter i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.25);
}

.pain-meter i.on {
  background: var(--amber);
  box-shadow: 0 0 5px rgba(245, 176, 75, 0.6);
}

.sandler-line {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.035);
}

.sandler-line > span {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sandler-line p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

.sandler-line.question,
.sandler-line.reverse,
.sandler-line.objection {
  position: relative;
  padding-bottom: 38px;
}

.sandler-line.question {
  border-left: 2px solid var(--cyan-border);
}

.sandler-line.question > span,
.sandler-line.reverse > span {
  color: var(--cyan);
}

.sandler-line.reverse {
  border-left: 2px solid var(--cyan-border);
}

.sandler-line.objection {
  border-left: 2px solid var(--amber-border);
}

.sandler-line.objection > span {
  color: var(--amber);
}

.sandler-line.question p,
.sandler-line.reverse p,
.sandler-line.objection p {
  color: var(--text);
  font-weight: 500;
}

.sandler-line .micro-copy-btn {
  position: absolute;
  bottom: 9px;
  left: 11px;
}

.sandler-line.landmines {
  border-left: 2px solid var(--danger-border);
}

.sandler-line.landmines > span {
  color: var(--danger);
}

.sandler-rules {
  padding: 10px 12px;
  border: 1px solid var(--steel-border);
  border-left: 2px solid var(--steel);
  border-radius: var(--radius-sm);
  background: var(--steel-soft);
}

.sandler-rules > span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--steel);
}

.sandler-rules ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sandler-rules li {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.sandler-rules b {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--steel);
  margin-right: 5px;
}

.sandler-rules em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.sandler-goalcheck {
  padding: 10px 12px;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
}

.sandler-goalcheck.met {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.sandler-goalcheck > span {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber);
}

.sandler-goalcheck.met > span {
  color: var(--accent);
}

.sandler-goalcheck p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}

.sandler-goalcheck ul {
  margin: 7px 0 0;
  padding-left: 16px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.sandler-thinking {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.03);
}

.sandler-thinking summary {
  padding: 8px 11px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--dur-fast) ease;
}

.sandler-thinking summary:hover {
  color: var(--text);
}

.sandler-thinking ol {
  margin: 0;
  padding: 0 13px 11px 28px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-dim);
}

.sandler-thinking li {
  margin-bottom: 4px;
}

/* ═══════════════════════════ SETTINGS MODAL ═══════════════════════════ */

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(2, 4, 9, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}

/* CRITICAL: author display:grid beats the hidden attribute's display:none —
   without this rule the invisible overlay covers the page and blocks ALL clicks. */
.settings-overlay[hidden] {
  display: none !important;
}

.settings-overlay.open {
  opacity: 1;
}

.settings-dialog {
  width: min(680px, 100%);
  max-height: 86dvh;
  overflow-y: auto;
  padding: var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: var(--shadow-pop);
  transform: translateY(10px) scale(0.97);
  transition: transform var(--dur-med) var(--ease-spring);
}

.settings-overlay.open .settings-dialog {
  transform: translateY(0) scale(1);
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.settings-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  font-variation-settings: "wdth" 118;
}

.settings-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 46ch;
}

.provider-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.provider-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: var(--space-4);
  text-align: left;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(148, 163, 184, 0.04);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}

.provider-card:hover {
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.08);
}

.provider-card:active {
  transform: scale(0.99);
}

.provider-card.active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-border), 0 10px 30px -14px var(--accent-glow);
}

.provider-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.provider-card-top strong {
  font-size: 15px;
  font-weight: 700;
  font-variation-settings: "wdth" 112;
}

.provider-card.active .provider-card-top strong {
  color: var(--accent);
}

.provider-badge {
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.06);
  white-space: nowrap;
}

.provider-badge.free {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.provider-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.provider-card code {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.provider-availability {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.provider-availability.missing {
  color: var(--amber);
}

/* Claude model picker. Cards rather than a <select> so the cost and the
   trade-off are visible at the moment of choosing, not one click away. */
.model-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2, rgba(0, 0, 0, 0.2));
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.model-option:hover {
  border-color: var(--accent);
}

.model-option.active {
  border-color: var(--accent);
  background: rgba(47, 129, 247, 0.08);
}

.model-option input {
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.model-option-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.model-option-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.model-cost {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.model-option-blurb {
  font-size: 12px;
  color: var(--muted, #8b95a1);
  line-height: 1.45;
}

.model-option-call {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted, #6e7885);
}

.prefetch-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.prefetch-switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* The sign-out control is an <a>, so it needs the button's text treatment. */
.settings-head-actions a.ghost-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* Optional OpenAI key entry. Sits below the engine cards because it is an
   escape hatch, not a normal part of choosing an engine. */
.openai-key-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.openai-key-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.openai-key-controls input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  background: var(--panel-2, rgba(0, 0, 0, 0.25));
  border: 1px solid var(--border);
  border-radius: 6px;
}

.openai-key-controls input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ═══════════════════════════ LANDING PAGE ═══════════════════════════ */

.landing-body {
  overflow-x: hidden;
  overflow-y: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 10px 16px;
  font-weight: 700;
  color: #03160c;
  background: var(--accent);
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  left: 0;
}

.landing-shell {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ── Landing nav ── */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  animation: fade-down var(--dur-slow) var(--ease-spring) both;
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.landing-nav-title strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  font-variation-settings: "wdth" 120;
}

.landing-nav-title span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.landing-nav-links > a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.landing-nav-links > a:hover {
  color: var(--text);
}

/* Higher specificity than .landing-nav-links > a so the dark-on-green text
   stays readable (was being overridden to pale gray/green). */
.landing-nav-links > a.landing-nav-cta,
.landing-nav-links > a.landing-nav-cta:hover {
  color: #03160c;
}

.landing-nav-cta svg {
  width: 13px;
  height: 13px;
}

/* ── Hero ── */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: var(--space-6);
  padding: 72px 0 88px;
}

.hero-copy {
  animation: rise-in var(--dur-slow) var(--ease-spring) 80ms both;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  margin-bottom: var(--space-5);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 99px;
  background: var(--accent-soft);
}

.hero-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.hero-copy h1 {
  margin: 0 0 var(--space-4);
  font-size: clamp(38px, 5.4vw, 62px);
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.hero-copy h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #46f0a8 10%, #56c8e8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 46ch;
  margin: 0 0 var(--space-5);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.hero-cta {
  min-height: 48px;
  padding: 12px 26px;
  font-size: 15px;
  text-decoration: none;
}

.hero-cta-ghost {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 14px;
  text-decoration: none;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  max-width: 560px;
}

.hero-metric {
  padding: 14px 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  transition: transform var(--dur-med) var(--ease-spring), border-color var(--dur-fast) ease;
}

.hero-metric:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
}

.hero-metric strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.hero-metric span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Hero preview mock ── */
.hero-preview {
  position: relative;
  animation: rise-in var(--dur-slow) var(--ease-spring) 200ms both;
}

.preview-glow {
  position: absolute;
  inset: 12% -8% -8% -8%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(46, 229, 150, 0.14), transparent 75%);
  filter: blur(8px);
  pointer-events: none;
}

.preview-window {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  transform: rotate(1.2deg);
  transition: transform var(--dur-slow) var(--ease-spring);
}

.preview-window:hover {
  transform: rotate(0deg) translateY(-3px);
}

.preview-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.04);
}

.preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.28);
}

.preview-dot:first-child {
  background: rgba(242, 109, 95, 0.6);
}

.preview-title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.preview-caption {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: var(--space-3) var(--space-3) 0;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.preview-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--space-3);
}

.preview-card {
  --pc: var(--accent);
  --pcb: var(--accent-border);
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--pcb);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.preview-card-probe { --pc: var(--cyan); --pcb: var(--cyan-border); }
.preview-card-proof { --pc: var(--amber); --pcb: var(--amber-border); }
.preview-card-guardrail { --pc: var(--steel); --pcb: var(--steel-border); }

.preview-card-mode {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pc);
}

.preview-card p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

/* ── Sections ── */
.landing-section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.section-heading {
  max-width: 620px;
  margin-bottom: var(--space-6);
}

.section-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-heading h2 {
  margin: 0 0 var(--space-3);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-heading p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-dim);
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-card {
  position: relative;
  padding: var(--space-5) var(--space-4) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  transition: transform var(--dur-med) var(--ease-spring), border-color var(--dur-fast) ease;
}

.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
}

.step-num {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.16);
}

.step-card svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.step-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 700;
  font-variation-settings: "wdth" 112;
}

.step-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.feature-card {
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  transition: transform var(--dur-med) var(--ease-spring), border-color var(--dur-fast) ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.feature-icon svg {
  width: 19px;
  height: 19px;
}

.feature-icon-accent { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.feature-icon-cyan { color: var(--cyan); border-color: var(--cyan-border); background: var(--cyan-soft); }
.feature-icon-amber { color: var(--amber); border-color: var(--amber-border); background: var(--amber-soft); }
.feature-icon-steel { color: var(--steel); border-color: var(--steel-border); background: var(--steel-soft); }

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  font-variation-settings: "wdth" 112;
}

.feature-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
}

/* Final CTA */
.landing-cta {
  margin: 72px 0;
  padding: 64px var(--space-6);
  text-align: center;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(46, 229, 150, 0.12), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-panel);
}

.landing-cta h2 {
  margin: 0 0 var(--space-3);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.01em;
}

.landing-cta p {
  margin: 0 auto var(--space-5);
  max-width: 46ch;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-dim);
}

.landing-cta .hero-cta {
  display: inline-flex;
}

/* Footer */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-5) 0 var(--space-6);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.landing-footer-links {
  display: flex;
  gap: var(--space-4);
}

.landing-footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.landing-footer-links a:hover {
  color: var(--text);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms var(--ease-spring), transform 600ms var(--ease-spring);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.steps-grid .reveal:nth-child(2) { transition-delay: 70ms; }
.steps-grid .reveal:nth-child(3) { transition-delay: 140ms; }
.steps-grid .reveal:nth-child(4) { transition-delay: 210ms; }
.features-grid .reveal:nth-child(2) { transition-delay: 70ms; }
.features-grid .reveal:nth-child(3) { transition-delay: 140ms; }
.features-grid .reveal:nth-child(4) { transition-delay: 210ms; }

/* Landing responsive */
@media (max-width: 980px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 44px 0 56px;
  }

  .hero-preview {
    max-width: 560px;
  }

  .landing-nav-links > a:not(.landing-nav-cta) {
    display: none;
  }
}

@media (max-width: 640px) {
  .landing-shell {
    padding: 0 var(--space-4);
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-cards {
    grid-template-columns: 1fr;
  }

  .landing-section {
    padding: 52px 0;
  }

  .landing-cta {
    padding: 44px var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════ REDUCED MOTION ═══════════════════════════ */

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

/* ═══════════ 20-upgrade pack: board affordances ═══════════ */

/* Highest-confidence card leads the eye without moving positions. */
.response-card.top-fit {
  border-color: rgba(46, 229, 150, 0.55);
  box-shadow: 0 0 0 1px rgba(46, 229, 150, 0.35), 0 6px 24px rgba(46, 229, 150, 0.08);
}

/* Word-by-word Best Reply while the model is still typing. */
.type-cursor {
  display: inline-block;
  animation: cursor-blink 0.9s steps(1) infinite;
  color: var(--accent, #2ee596);
}
@keyframes cursor-blink { 50% { opacity: 0; } }
.response-answer.streaming-text { opacity: 0.92; }

/* Edit-in-place: double-click a reply to fix the wording. */
.response-answer.editing {
  outline: 1px dashed rgba(46, 229, 150, 0.6);
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text;
}
[data-editable-answer] { cursor: default; }

/* Slow-mode banner: honest status beats silent waiting. */
.slow-mode-banner {
  display: none;
  margin: 6px 16px 0;
  padding: 7px 12px;
  border: 1px solid rgba(240, 180, 41, 0.45);
  border-radius: 8px;
  background: rgba(240, 180, 41, 0.08);
  color: #f0b429;
  font-size: 12.5px;
}
.slow-mode-banner.show { display: block; }

/* Out-of-credit: red, outranks the amber slow-mode styling. */
.slow-mode-banner.credit {
  border-color: rgba(255, 92, 92, 0.55);
  background: rgba(255, 92, 92, 0.1);
  color: #ff7b7b;
}
