/* =============================================================================
   Growth Coach — customer dashboard
   -----------------------------------------------------------------------------
   Aesthetic: Studio Press × Stripe. White substrate, hairline rules, Geist
   for UI/body, Fraunces for editorial display, JetBrains Mono for receipts
   and meta. Persimmon for accent — used as ink, not as fills.

   No drop shadows. No paper grain. No italic-by-default page titles. No
   pill buttons. Colour is restraint.

   Class contracts (kanban-card, chat-bubble, install-banner, etc.) are
   stable so the JS view modules keep working without changes.
   ============================================================================= */

:root {
  /* ── Substrate ────────────────────────────────────────────────────── */
  --paper:       #FFFFFF;
  --paper-warm:  #FAFAF7;
  --paper-veil:  #F5F4EE;

  /* Field-Journal aliases (kept for any inline style refs) */
  --paper-soft:  var(--paper-warm);
  --paper-deep:  var(--paper-veil);
  --paper-cream: var(--paper-warm);
  --paper-bone:  var(--paper);

  /* ── Type ink ─────────────────────────────────────────────────────── */
  --ink:        #0A0A0B;
  --ink-soft:   #3D3D42;
  --ink-faded:  #6B6B72;
  --ink-ghost:  #A4A4AB;

  /* ── Brand: persimmon ─────────────────────────────────────────────── */
  --persimmon:        #E55A3C;
  --persimmon-deep:   #C04421;
  --persimmon-soft:   #FCEBE3;

  /* ── Supporting (semantic) ────────────────────────────────────────── */
  --copper:   #B5713B;
  --success:  #2E7A5A;
  --warning:  #C99A2E;
  --info:     #2D4159;
  --danger:   #C04421;

  /* ── Borders / hairlines ──────────────────────────────────────────── */
  --rule:        rgba(10, 10, 11, 0.08);
  --rule-strong: rgba(10, 10, 11, 0.16);
  --rule-soft:   rgba(10, 10, 11, 0.04);
  --border:        var(--rule);
  --border-soft:   var(--rule-soft);
  --border-strong: var(--rule-strong);

  /* ── Sunrise gradient (used SPARINGLY) ────────────────────────────── */
  --gradient-sunrise: linear-gradient(135deg, #E55A3C 0%, #F39C5C 38%, #F5C792 70%, #FAEFE0 100%);

  /* ── Type ─────────────────────────────────────────────────────────── */
  --font-display: 'Fraunces', 'GT Sectra', Georgia, serif;
  --font-body:    'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ── Radii ────────────────────────────────────────────────────────── */
  --radius-xs:  3px;
  --radius-sm:  4px;
  --radius:     6px;
  --radius-lg:  10px;
  --radius-xl:  14px;

  /* ── Shadows — none. Tokens kept so JS-injected styles don't break. ── */
  --shadow-xs: 0 0 0 0 transparent;
  --shadow-sm: 0 0 0 0 transparent;
  --shadow-md: 0 0 0 0 transparent;
  --shadow-lg: 0 0 0 0 transparent;
  --shadow-stamp: 0 0 0 0 transparent;
  --shadow-glow-primary: 0 0 0 3px rgba(229, 90, 60, 0.18);

  /* ── Layout ───────────────────────────────────────────────────────── */
  --sidebar-w:    240px;
  --chat-w:       340px;
  --topnav-h:     60px;
  --content-max:  1200px;

  /* ── Motion ───────────────────────────────────────────────────────── */
  --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-page: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 140ms;
  --t-base: 280ms;
  --t-slow: 420ms;

  /* ── Backwards-compatibility aliases — DO NOT REMOVE ──────────────── */
  --oxblood:        var(--persimmon);
  --oxblood-deep:   var(--persimmon-deep);
  --oxblood-soft:   var(--persimmon-soft);
  --mustard:        var(--warning);
  --mustard-deep:   #856712;
  --mustard-soft:   #FAEFD2;
  --verdigris:      var(--success);
  --verdigris-deep: #1F4F3A;
  --verdigris-soft: #DCEBE3;
  --inkblue:        var(--info);
  --inkblue-soft:   #DCE1E7;

  /* Semantic name aliases used by view JS */
  --primary:       var(--persimmon);
  --primary-hover: var(--persimmon-deep);
  --primary-soft:  var(--persimmon-soft);
  --primary-text:  var(--persimmon-deep);
  --accent:        var(--persimmon);
  --accent-soft:   var(--persimmon-soft);
  --accent-deep:   var(--persimmon-deep);
  --success-soft:  var(--verdigris-soft);
  --warning-soft:  var(--mustard-soft);
  --danger-soft:   var(--persimmon-soft);

  --bg:          var(--paper);
  --bg-elevated: var(--paper);
  --bg-soft:     var(--paper-warm);
  --bg-tinted:   var(--paper-veil);
  --bg-ink:      var(--ink);
  --fg:          var(--ink);
  --fg-muted:    var(--ink-soft);
  --fg-light:    var(--ink-faded);
  --fg-on-ink:   var(--paper);

  /* Old colour aliases, mapped */
  --cream:         var(--paper);
  --cream-dark:    var(--paper-warm);
  --orange:        var(--persimmon);
  --orange-light:  var(--persimmon-soft);
  --orange-muted:  #F7D8CD;
  --green:         var(--success);
  --green-light:   var(--verdigris-soft);
  --yellow:        var(--warning);
  --yellow-light:  var(--mustard-soft);
  --red:           var(--danger);
  --red-light:     var(--persimmon-soft);
  --text:          var(--ink);
  --text-muted:    var(--ink-soft);
  --text-light:    var(--ink-faded);
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }

body {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01";
}

/* Editorial display — Fraunces, NOT italic by default. */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.05;
  font-style: normal;
}
h1 { font-size: clamp(32px, 5.4vw, 44px); }
h2 { font-size: clamp(24px, 3.2vw, 32px); }
h3 { font-size: clamp(19px, 2vw, 22px); font-weight: 500; }

.size-text { font-variation-settings: "opsz" 14; }
.size-sub  { font-variation-settings: "opsz" 24; }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}
code {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

button { font-family: inherit; cursor: pointer; }
a {
  color: var(--persimmon);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover {
  color: var(--persimmon-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

::selection { background: var(--persimmon-soft); color: var(--persimmon-deep); }

/* ── Icons ────────────────────────────────────────────────────────────── */
.icon {
  width: 1.05em;
  height: 1.05em;
  display: inline-block;
  vertical-align: -0.18em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* ── Top nav ──────────────────────────────────────────────────────────── */
.topnav {
  height: var(--topnav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  flex-shrink: 0;
  z-index: 30;
  position: relative;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--ink);
  user-select: none;
}
.brand .brand-site { font-style: normal; }
.brand .brand-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--persimmon);
  margin: 0 4px;
  position: relative;
  top: -2px;
}
.brand .brand-coach {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: normal;
}

.site-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-soft);
  font-weight: 500;
}
.site-badge .live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(46, 122, 90, 0.45);
  animation: pulse 2.6s var(--ease-out) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 122, 90, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(46, 122, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 122, 90, 0); }
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  user-select: none;
}
.avatar:hover {
  border-color: var(--rule-strong);
  background: var(--paper-veil);
}

/* Mobile burger */
.nav-burger {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--rule);
  cursor: pointer;
  color: var(--ink);
  margin-right: 4px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.nav-burger:hover {
  background: var(--paper-warm);
  border-color: var(--rule-strong);
}

/* ── Layout ───────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--paper-warm);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 20;
  padding: 12px 0;
}

.sidebar-section {
  padding: 18px 18px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faded);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 8px;
  padding: 7px 12px 7px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--radius);
  position: relative;
  transition: color var(--t-fast), background var(--t-fast);
  user-select: none;
}
.nav-item:hover {
  background: var(--paper-veil);
  color: var(--ink);
}
.nav-item.active {
  color: var(--persimmon);
  background: var(--paper);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: var(--persimmon);
  border-radius: 2px;
}

.nav-icon {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink-faded);
}
.nav-item.active .nav-icon { color: var(--persimmon); }
.nav-icon .icon { width: 17px; height: 17px; }

.nav-badge {
  margin-left: auto;
  background: var(--persimmon);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-faded);
  font-family: var(--font-mono);
}

/* Drawer scrim — visible only on mobile. */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 11, 0.42);
  z-index: 19;
  opacity: 0;
  transition: opacity var(--t-base);
}
.scrim.open {
  display: block;
  opacity: 1;
}

/* ── Main column ──────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 56px clamp(24px, 5vw, 64px) 96px;
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--paper);
}
.main > .page {
  max-width: var(--content-max);
  margin: 0 auto;
}

.page { display: none; }
.page.active {
  display: block;
  animation: pageIn 320ms var(--ease-page) both;
}
@keyframes pageIn {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Editorial kicker — small uppercase mono in persimmon. No leading rule. */
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--persimmon);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-style: normal;
  font-size: clamp(34px, 5.6vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 12px;
}

.page-sub {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 36px;
  max-width: 64ch;
  line-height: 1.55;
}

.page-sub.lead {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
  max-width: 60ch;
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: border-color var(--t-fast);
}
.card.is-hoverable:hover { border-color: var(--rule-strong); }
.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 36;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  font-style: normal;
}

/* Stats row — connected hairline cells */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-bottom: 32px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat-card {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  border-radius: 0;
  padding: 20px 22px;
  transition: background var(--t-fast);
}
.stat-card:last-child { border-right: 0; }
.stat-card:hover { background: var(--paper-warm); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faded);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  margin-bottom: 10px;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-style: normal;
  font-size: clamp(32px, 3.6vw, 40px);
  line-height: 1.0;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
}
.stat-delta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  margin-top: 8px;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--persimmon-deep); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast);
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}
.btn:hover {
  background: var(--paper-warm);
  border-color: var(--ink-faded);
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-glow-primary);
}

/* Primary — persimmon fill, no shadow */
.btn-primary, .btn.primary, button.primary {
  background: var(--persimmon);
  color: #fff;
  border-color: var(--persimmon);
  font-weight: 500;
}
.btn-primary:hover, .btn.primary:hover, button.primary:hover {
  background: var(--persimmon-deep);
  border-color: var(--persimmon-deep);
}

.btn-warm {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}
.btn-warm:hover { background: #A87E1E; border-color: #A87E1E; }

.btn-ghost, .btn.ghost, button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover, .btn.ghost:hover, button.ghost:hover {
  background: var(--paper-warm);
  color: var(--ink);
  border-color: var(--rule);
}

.btn-danger, .btn.danger, button.danger {
  background: var(--paper);
  color: var(--persimmon-deep);
  border-color: var(--persimmon);
}
.btn-danger:hover, .btn.danger:hover, button.danger:hover {
  background: var(--persimmon);
  color: #fff;
  border-color: var(--persimmon);
}
.btn.danger.ghost, button.danger.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--persimmon-deep);
}
.btn.danger.ghost:hover, button.danger.ghost:hover {
  background: var(--persimmon-soft);
  color: var(--persimmon-deep);
  border-color: var(--persimmon-soft);
}

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-icon {
  padding: 6px;
  min-width: 32px; min-height: 32px;
  justify-content: center;
}

/* Toggle */
.toggle {
  display: inline-flex;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 2px;
  gap: 0;
}
.toggle-btn {
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink-faded);
  border: 0;
  background: transparent;
  font-weight: 500;
  transition: all var(--t-fast);
}
.toggle-btn:hover { color: var(--ink); }
.toggle-btn.active {
  background: var(--paper);
  color: var(--persimmon);
  font-weight: 600;
  border: 1px solid var(--rule);
}

/* ── Form controls ────────────────────────────────────────────────────── */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
textarea,
select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  line-height: 1.4;
}
.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--ink-ghost);
}
.input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--persimmon);
  box-shadow: var(--shadow-glow-primary);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faded);
  margin-bottom: 6px;
}

/* ── Tables ───────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13.5px;
  background: var(--paper);
}
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faded);
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper-warm);
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  color: var(--ink);
}
.data-table tr { transition: background var(--t-fast); }
.data-table tr:hover td {
  background: var(--paper-warm);
  cursor: pointer;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child,
.data-table th:first-child { padding-left: 22px; }
.data-table td:last-child,
.data-table th:last-child { padding-right: 22px; }

/* Pills used in tables */
.bounce-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  border: 1px solid;
}
.bounce-high { background: var(--persimmon-soft); color: var(--persimmon-deep); border-color: rgba(192, 68, 33, 0.18); }
.bounce-med  { background: var(--mustard-soft);  color: var(--mustard-deep);   border-color: rgba(133, 103, 18, 0.18); }
.bounce-low  { background: var(--verdigris-soft); color: var(--verdigris-deep); border-color: rgba(31, 79, 58, 0.18); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper-warm);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.badge.success { background: var(--verdigris-soft); color: var(--verdigris-deep); border-color: rgba(31, 79, 58, 0.18); }
.badge.warning { background: var(--mustard-soft);   color: var(--mustard-deep);   border-color: rgba(133, 103, 18, 0.18); }
.badge.info    { background: var(--inkblue-soft);   color: var(--info);           border-color: rgba(45, 65, 89, 0.18); }
.badge.danger  { background: var(--persimmon-soft); color: var(--persimmon-deep); border-color: rgba(192, 68, 33, 0.18); }

/* ── Kanban ───────────────────────────────────────────────────────────── */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
  min-height: 480px;
}
.kanban-col {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: background var(--t-base), border-color var(--t-base);
  position: relative;
}
.kanban-col::before {
  /* Hairline accent at top of each column */
  content: "";
  position: absolute;
  top: -1px; left: 14px;
  width: 28px; height: 2px;
  background: var(--ink-ghost);
  border-radius: 2px;
}
.kanban-col:nth-child(1)::before { background: var(--persimmon); }
.kanban-col:nth-child(2)::before { background: var(--warning); }
.kanban-col:nth-child(3)::before { background: var(--success); }
.kanban-col:nth-child(4)::before { background: var(--info); }

.kanban-col.drag-over {
  background: var(--paper-warm);
  border-color: var(--persimmon);
  border-style: dashed;
}

.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}
.kanban-col-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.kanban-col-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faded);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.kanban-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 80px;
}

/* Kanban cards — clean slip with hairline. No rotation, no dog-ear. */
.kanban-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px 11px;
  cursor: grab;
  transition: border-color var(--t-fast), background var(--t-fast),
              transform var(--t-fast);
}
.kanban-card:hover {
  border-color: var(--rule-strong);
  background: var(--paper-warm);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging {
  opacity: 0.55;
  cursor: grabbing;
  border-color: var(--persimmon);
}
.kanban-card.drop-target {
  border-color: var(--persimmon);
  border-style: dashed;
}

.kanban-card-title {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.4;
}
.kanban-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faded);
  flex-wrap: wrap;
  letter-spacing: 0.04em;
}

.priority-pill {
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: 1px solid;
}
.priority-1 { background: var(--persimmon-soft); color: var(--persimmon-deep); border-color: rgba(192, 68, 33, 0.20); }
.priority-2 { background: var(--mustard-soft);   color: var(--mustard-deep);   border-color: rgba(133, 103, 18, 0.18); }
.priority-3 { background: var(--paper-warm);     color: var(--ink-faded);      border-color: var(--rule); }

/* Library tab buttons */
.tab-btn {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-faded);
  border: 0;
  background: transparent;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--persimmon);
  border-bottom-color: var(--persimmon);
  font-weight: 600;
}

/* ── Coach chat panel ─────────────────────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 18px; right: 18px;
  width: var(--chat-w);
  max-height: min(70vh, 600px);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 60;
  overflow: hidden;
  transition: max-height var(--t-base) var(--ease-out);
}
.chat-panel.collapsed { max-height: 50px; }
.chat-panel.collapsed .chat-body,
.chat-panel.collapsed .chat-input-row { display: none; }

.chat-header {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  background: var(--paper);
  user-select: none;
  position: relative;
}
.chat-header::before {
  /* the only place the sunrise gradient shows up: a 2px accent strip */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-sunrise);
}
.chat-header-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 36;
  font-size: 16px;
  color: var(--ink);
  flex: 1;
  letter-spacing: -0.01em;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  background: var(--paper);
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: bubbleIn 240ms var(--ease-out) both;
}
.chat-msg.user      { align-items: flex-end; }
.chat-msg.assistant { align-items: flex-start; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg.user .chat-bubble {
  background: var(--persimmon-soft);
  color: var(--persimmon-deep);
  border: 1px solid rgba(192, 68, 33, 0.15);
  border-bottom-right-radius: 3px;
}
.chat-msg.assistant .chat-bubble {
  background: var(--paper-warm);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-bottom-left-radius: 3px;
}
.chat-tool {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--mustard-soft);
  color: var(--mustard-deep);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 500;
  border: 1px solid rgba(133, 103, 18, 0.18);
  transition: background var(--t-fast);
}
.chat-tool:hover {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.chat-input-row {
  border-top: 1px solid var(--rule);
  padding: 10px;
  display: flex;
  gap: 8px;
  background: var(--paper);
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--paper);
  outline: none;
  resize: none;
  max-height: 100px;
  min-height: 38px;
  line-height: 1.4;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.chat-input:focus {
  border-color: var(--persimmon);
  box-shadow: var(--shadow-glow-primary);
}
.chat-input::placeholder {
  color: var(--ink-ghost);
}

@media (max-width: 720px) {
  .chat-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-width: 420px;
  }
  .chat-panel.collapsed {
    width: auto;
    height: 44px;
    max-height: 44px;
    border-radius: var(--radius);
    background: var(--persimmon);
    color: #fff;
    border-color: var(--persimmon);
  }
  .chat-panel.collapsed .chat-header {
    background: transparent;
    border: 0;
    height: 44px;
    padding: 0 16px;
  }
  .chat-panel.collapsed .chat-header::before { display: none; }
  .chat-panel.collapsed .chat-header-title { color: #fff; font-size: 14px; }
  .chat-panel.collapsed #chat-toggle { color: #fff; }
}

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 11, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: fadeIn 200ms var(--ease-out);
}
.modal-backdrop.open { display: flex; }
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1200px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 280ms var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--paper);
}
.modal-body { flex: 1; overflow: auto; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--paper);
}

/* ── Replay ───────────────────────────────────────────────────────────── */
.replay-stage {
  position: relative;
  background: #0A0A0B;
  min-height: 480px;
  width: 100%;
  overflow: hidden;
}
.replay-frame {
  position: absolute;
  top: 0; left: 0;
  border: 0;
  transform-origin: top left;
  pointer-events: none;
  background: #fff;
}
.replay-cursor {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--persimmon);
  z-index: 4;
  pointer-events: none;
  display: none;
  transform: translate(-7px, -7px);
  transition: left 80ms linear, top 80ms linear;
}
.replay-click-ring {
  position: absolute;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--persimmon);
  z-index: 5;
  pointer-events: none;
  display: none;
  transform: translate(-14px, -14px);
}
@keyframes clickRing {
  from { opacity: 1; transform: translate(-14px,-14px) scale(0.4); }
  to   { opacity: 0; transform: translate(-14px,-14px) scale(2.2); }
}
.replay-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
}
.replay-scrubber {
  flex: 1;
  appearance: none;
  height: 2px;
  background: var(--rule-strong);
  border-radius: 0;
  outline: none;
}
.replay-scrubber::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--persimmon);
  cursor: pointer;
  border: 2px solid var(--paper);
}
.replay-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faded);
  min-width: 70px;
  text-align: right;
}

/* ── Library / setup / settings sections ──────────────────────────────── */
.lib-section {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.lib-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.lib-section-header:hover { background: var(--paper-warm); }
.lib-section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 36;
  font-style: normal;
  font-size: 17px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.01em;
}
.lib-section-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faded);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.lib-section-body { padding: 0 20px 20px; display: none; }
.lib-section.open .lib-section-body { display: block; }

.connector-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper);
  margin-bottom: 10px;
  transition: border-color var(--t-fast);
}
.connector-card:hover { border-color: var(--rule-strong); }
.connector-logo {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  flex-shrink: 0;
}
.connector-info { flex: 1; min-width: 0; }
.connector-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.connector-status {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-faded);
  margin-top: 5px;
}
.connector-status.connected { color: var(--success); }
.connector-status.error     { color: var(--persimmon-deep); }
.connector-extra {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faded);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.property-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--paper-warm);
  border-radius: var(--radius);
  border: 1px dashed var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

/* Install banner — coloured side rule for status */
.install-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-ghost);
  margin-bottom: 20px;
}
.install-banner:has(.install-dot.ok)      { border-left-color: var(--success); }
.install-banner:has(.install-dot.waiting) { border-left-color: var(--warning); }

.install-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.install-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--verdigris-soft);
  animation: pulse 2.4s var(--ease-out) infinite;
}
.install-dot.waiting {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--mustard-soft);
  animation: pulse 2.4s var(--ease-out) infinite;
}
.install-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.install-label.muted {
  font-weight: 400;
  color: var(--ink-faded);
}
.install-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--paper-warm);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule);
}

/* ── Toasts ───────────────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--persimmon);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink);
  max-width: 360px;
  animation: slideIn 280ms var(--ease-out);
  pointer-events: auto;
}
.toast.error   { border-left-color: var(--persimmon-deep); }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Empty states ─────────────────────────────────────────────────────── */
.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-faded);
  font-family: var(--font-body);
}
.empty-state .display {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-style: normal;
  font-size: clamp(24px, 3.4vw, 32px);
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.empty-state p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-faded);
}

/* ── Utility ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.muted  { color: var(--ink-faded); }
.spacer { flex: 1; }

.row         { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.gap-sm  { gap: 8px; }
.row.gap-md  { gap: 14px; }
.row.gap-lg  { gap: 22px; }
.col         { display: flex; flex-direction: column; gap: 10px; }
.flex-1      { flex: 1; }
.text-mono   { font-family: var(--font-mono); }
.text-italic { font-style: italic; }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11.5px; }

/* ── Scrollbars ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 999px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faded); }

/* ── Login overlay ────────────────────────────────────────────────────── */
.sc-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sc-login-overlay.active {
  display: flex;
  animation: fadeIn 320ms var(--ease-out);
}
.sc-login-overlay::before {
  /* small sunrise marquee at the very top */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-sunrise);
}

.sc-login-card {
  width: 420px;
  max-width: 100%;
  padding: 44px 38px 36px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  position: relative;
  animation: modalIn 360ms var(--ease-out);
}
.sc-login-card h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-style: normal;
  font-size: 44px;
  margin: 0;
  text-align: center;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.sc-login-card h1 .accent {
  color: var(--persimmon);
  font-style: normal;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--persimmon);
  margin: 0 4px;
  position: relative;
  top: -7px;
  text-indent: -9999px;
  overflow: hidden;
}
.sc-login-sub {
  text-align: center;
  color: var(--ink-faded);
  margin: 8px 0 28px;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.sc-login-field { margin-bottom: 14px; }
.sc-login-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-faded);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.sc-login-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.sc-login-field input:focus {
  outline: none;
  border-color: var(--persimmon);
  box-shadow: var(--shadow-glow-primary);
}
.sc-login-btn {
  width: 100%;
  padding: 11px;
  background: var(--persimmon);
  color: #fff;
  border: 1px solid var(--persimmon);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.sc-login-btn:hover {
  background: var(--persimmon-deep);
  border-color: var(--persimmon-deep);
}
.sc-login-btn:active { transform: translateY(0.5px); }
.sc-login-btn:disabled { opacity: 0.5; cursor: wait; }
.sc-login-error {
  color: var(--persimmon-deep);
  font-size: 13px;
  margin-bottom: 10px;
  min-height: 18px;
  text-align: center;
  font-family: var(--font-body);
}
.sc-login-btn-google {
  width: 100%;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.sc-login-btn-google:hover {
  background: var(--paper-warm);
  border-color: var(--ink-faded);
}
.sc-login-btn-google .g-icon {
  display: inline-flex;
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.sc-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--ink-faded);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}
.sc-login-divider::before, .sc-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

body.sc-login-active .topnav,
body.sc-login-active .layout,
body.sc-login-active .chat-panel,
body.sc-login-active .nav-burger { display: none !important; }

/* ── Impersonation banner ─────────────────────────────────────────────── */
.sc-impersonation-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  background: var(--mustard-soft);
  color: var(--mustard-deep);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.sc-impersonation-banner strong {
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
}
.sc-impersonation-banner em {
  font-style: normal;
  color: var(--mustard-deep);
}
.sc-impersonation-banner button {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 5px 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background var(--t-fast);
}
.sc-impersonation-banner button:hover { background: var(--persimmon-deep); }
body.sc-impersonation-active { padding-top: 36px; }

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .main { padding: 44px 32px 96px; }
  .stats-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

@media (max-width: 900px) {
  .nav-burger { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: var(--topnav-h);
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 280ms var(--ease-out);
    box-shadow: 0 8px 32px rgba(10, 10, 11, 0.10);
  }
  body.sc-impersonation-active .sidebar {
    top: calc(var(--topnav-h) + 36px);
  }
  .sidebar.open { transform: translateX(0); }

  .main { padding: 32px 22px 96px; }
  .page-title { font-size: clamp(30px, 7vw, 40px); }
}

@media (max-width: 720px) {
  :root { --topnav-h: 56px; }

  .topnav { padding: 0 14px; gap: 10px; }
  .brand { font-size: 19px; }
  .site-badge { display: none; }

  .main { padding: 28px 18px 110px; }
  .page-title { font-size: clamp(28px, 9vw, 38px); }
  .page-sub   { font-size: 14.5px; margin-bottom: 26px; }
  .page-sub.lead { font-size: 17px; }
  .kicker { font-size: 10px; }

  .stats-row {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rule);
    overflow: hidden;
  }
  .stat-card {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .stat-card:last-child { border-bottom: 0; }
  .stat-value { font-size: 32px; }

  .kanban {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
  }
  .kanban-col { padding: 12px; }
  .kanban-list { min-height: 40px; }

  .modal-header { padding: 14px 18px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }

  .replay-stage { min-height: 320px; }

  .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }

  .toasts { top: 12px; right: 12px; left: 12px; }
  .toast { max-width: none; }

  .sc-login-card { padding: 32px 24px; }
  .sc-login-card h1 { font-size: 36px; }
}

@media (max-width: 460px) {
  .row.between { flex-wrap: wrap; }
  .nav-right .btn-sm { display: 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;
  }
}
