/* Application styles */

/* Figtree + DM Mono loaded via <link> in layouts/application.html.erb */

:root {
  --bg:       #0e0f0f;
  --surface:  #161717;
  --border:   #252626;
  --border-hi:#333535;
  --muted:    #4a4d4d;
  --text:     #d4d6d6;
  --text-hi:  #f0f2f2;
  --amber:    #f59e0b;
  --amber-dim:#92610a;
  --amber-bg: #1a1508;
  --green:    #22c55e;
  --green-bg: #091710;
  --red:      #ef4444;
  --red-bg:   #170909;
  --blue:     #60a5fa;
  --blue-bg:  #090f1a;

  --nav-hover: rgba(255, 255, 255, 0.03);
  --table-row-hover: rgba(255, 255, 255, 0.025);
  --table-th-bg: rgba(255, 255, 255, 0.01);
  --draft-card-header-bg: rgba(255, 255, 255, 0.015);
  --btn-ghost-hover: rgba(255, 255, 255, 0.05);
  --form-focus-ring: rgba(245, 158, 11, 0.12);
  --form-focus-ring-strong: rgba(245, 158, 11, 0.14);
  --login-glow: rgba(245, 158, 11, 0.07);
  --lp-nav-bg: rgba(14, 15, 15, 0.85);
  --lp-hero-glow: rgba(245, 158, 11, 0.10);
  --lp-pain-bg: rgba(255, 255, 255, 0.01);
  --lp-section-glow: rgba(245, 158, 11, 0.07);
  --overlay-backdrop: rgba(0, 0, 0, 0.6);
  --badge-border-green: #145c2f;
  --badge-border-red: #5c1414;
  --badge-border-blue: #143b5c;
  --btn-amber-hover-bg: #d97706;
  --btn-danger-hover-bg: #220d0d;
  --btn-success-hover-bg: #0c2318;
  --waitlist-input-bg: rgba(255, 255, 255, 0.04);
  --waitlist-input-error-bg: rgba(239, 68, 68, 0.06);
  --thread-avatar-cust-bg: #1e2433;
  --thread-avatar-cust-fg: #7aa3e5;
  --thread-avatar-cust-border: #2a3550;
  --thread-bubble-inbound-bg: #131516;
  --thread-bubble-outbound-bg: #091525;
  --thread-bubble-outbound-border: #1a3055;
  --thread-bubble-pending-bg: #0f0d02;
  --thread-sender-venue: #60a5fa;
  --thread-body-outbound: #a8c8f8;
  --draft-actions-border: rgba(245, 158, 11, 0.15);
}

html[data-theme="light"] {
  --bg:       #ebeded;
  --surface:  #f6f7f7;
  --border:   #d5d8d8;
  --border-hi:#bfc3c3;
  --muted:    #5f6565;
  --text:     #232626;
  --text-hi:  #121414;
  --amber:    #b45309;
  --amber-dim:#92400e;
  --amber-bg: #fff7ed;
  --green:    #15803d;
  --green-bg: #ecfdf3;
  --red:      #b91c1c;
  --red-bg:   #fef2f2;
  --blue:     #1d4ed8;
  --blue-bg:  #eff6ff;

  --nav-hover: rgba(0, 0, 0, 0.04);
  --table-row-hover: rgba(0, 0, 0, 0.03);
  --table-th-bg: rgba(0, 0, 0, 0.025);
  --draft-card-header-bg: rgba(0, 0, 0, 0.03);
  --btn-ghost-hover: rgba(0, 0, 0, 0.05);
  --form-focus-ring: rgba(180, 83, 9, 0.2);
  --form-focus-ring-strong: rgba(180, 83, 9, 0.22);
  --login-glow: rgba(180, 83, 9, 0.12);
  --lp-nav-bg: rgba(235, 237, 237, 0.92);
  --lp-hero-glow: rgba(180, 83, 9, 0.14);
  --lp-pain-bg: rgba(0, 0, 0, 0.02);
  --lp-section-glow: rgba(180, 83, 9, 0.1);
  --overlay-backdrop: rgba(15, 23, 42, 0.45);
  --badge-border-green: #86efac;
  --badge-border-red: #fca5a5;
  --badge-border-blue: #93c5fd;
  --btn-amber-hover-bg: #c2410c;
  --btn-danger-hover-bg: #fecaca;
  --btn-success-hover-bg: #bbf7d0;
  --waitlist-input-bg: rgba(0, 0, 0, 0.04);
  --waitlist-input-error-bg: rgba(239, 68, 68, 0.08);
  --thread-avatar-cust-bg: #e2e8f5;
  --thread-avatar-cust-fg: #334d84;
  --thread-avatar-cust-border: #b8c6e8;
  --thread-bubble-inbound-bg: #eef1f3;
  --thread-bubble-outbound-bg: #e8f1fc;
  --thread-bubble-outbound-border: #93c5fd;
  --thread-bubble-pending-bg: #fffbeb;
  --thread-sender-venue: #1d4ed8;
  --thread-body-outbound: #1e3a5f;
  --draft-actions-border: rgba(180, 83, 9, 0.22);
}

/* ── Theme toggle (used in topbar, landing nav, floating on auth pages) ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: var(--btn-ghost-hover);
  border-color: var(--border-hi);
}

.theme-toggle__svg {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: var(--text);
}

.theme-toggle__svg svg {
  display: block;
}

.theme-toggle--floating {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
}

.topbar .theme-toggle {
  margin-left: 4px;
}

.lp-nav .theme-toggle {
  border-color: var(--border-hi);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout shell ── */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 48px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Topbar ── */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Figtree', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.topbar-logo .toast-icon {
  width: 22px;
  height: 22px;
  background: var(--amber);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.topbar-sep { flex: 1; }

.topbar-user {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user a {
  color: var(--muted);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
}

.topbar-user a:hover { color: var(--text); border-color: var(--border-hi); }

/* ── Sidebar ── */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  padding: 14px 16px 5px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
  margin-bottom: 1px;
}

.nav-link:hover { color: var(--text); background: var(--nav-hover); }

.nav-link.active {
  color: var(--amber);
  border-left-color: var(--amber);
  background: var(--amber-bg);
}

.nav-link .icon { font-size: 14px; width: 16px; text-align: center; opacity: 0.8; }

.sidebar-section--admin {
  border-top: 1px solid var(--amber-dim);
  color: var(--amber-dim);
  margin-left: 12px;
  margin-right: 12px;
  padding-left: 4px;
}

.nav-link--admin { color: var(--amber-dim); }
.nav-link--admin:hover { color: var(--amber); background: var(--amber-bg); }
.nav-link--admin.active { color: var(--amber); border-left-color: var(--amber); background: var(--amber-bg); }

/* ── Main content ── */
.main {
  overflow-y: auto;
  padding: 28px 32px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: 'Figtree', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
}

.page-subtitle { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Status badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pending   { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-dim); }
.badge-pending::before   { background: var(--amber); }
.badge-confirmed { background: var(--green-bg); color: var(--green); border: 1px solid var(--badge-border-green); }
.badge-confirmed::before { background: var(--green); }
.badge-reviewing { background: var(--blue-bg);  color: var(--blue);  border: 1px solid var(--badge-border-blue); }
.badge-reviewing::before { background: var(--blue); }
.badge-rejected,
.badge-cancelled { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--badge-border-red); }
.badge-rejected::before,
.badge-cancelled::before { background: var(--red); }
.badge-active    { background: var(--green-bg); color: var(--green); border: 1px solid var(--badge-border-green); }
.badge-active::before    { background: var(--green); box-shadow: 0 0 4px var(--green); }
.badge-inactive  { background: var(--surface);  color: var(--muted); border: 1px solid var(--border); }
.badge-inactive::before  { background: var(--muted); }
.badge-archived  { background: var(--surface);  color: var(--muted); border: 1px solid var(--border); }
.badge-archived::before  { background: var(--muted); }
.badge-qualified  { background: var(--green-bg); color: var(--green); border: 1px solid var(--badge-border-green); }
.badge-qualified::before  { background: var(--green); }
.badge-in_progress { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-dim); }
.badge-in_progress::before { background: var(--amber); }
.badge-not_a_fit  { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--badge-border-red); }
.badge-not_a_fit::before  { background: var(--red); }
.badge-needs_review { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--badge-border-blue); }
.badge-needs_review::before { background: var(--blue); }

/* ── Card / table ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--table-th-bg);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--table-row-hover); }
.data-table a { color: inherit; text-decoration: none; display: block; }

/* ── Detail grid ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.detail-cell {
  background: var(--surface);
  padding: 14px 16px;
}

.detail-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.detail-value {
  font-size: 13px;
  color: var(--text-hi);
  font-weight: 500;
}

/* ── Draft card ── */
.draft-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.draft-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--draft-card-header-bg);
  padding: 14px;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.75;
}

.draft-card-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}

.btn-amber   { background: var(--amber); color: #000; border-color: var(--amber); }
.btn-amber:hover   { background: var(--btn-amber-hover-bg); border-color: var(--btn-amber-hover-bg); }
.btn-ghost   { background: transparent; color: var(--text); border-color: var(--border-hi); }
.btn-ghost:hover   { background: var(--btn-ghost-hover); }
.btn-danger  { background: var(--red-bg);   color: var(--red);   border-color: var(--badge-border-red); }
.btn-danger:hover  { background: var(--btn-danger-hover-bg); }
.btn-success { background: var(--green-bg); color: var(--green); border-color: var(--badge-border-green); }
.btn-success:hover { background: var(--btn-success-hover-bg); }

.btn:active,
.lp-waitlist-btn:active {
  transform: scale(0.98);
}

.btn:focus-visible,
.lp-waitlist-btn:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-topbar-signout {
  padding: 3px 9px;
  font-size: 11px;
}

/* ── Forms ── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 11px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-hi);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--form-focus-ring);
}

.form-input::placeholder { color: var(--muted); }

.form-hint {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}

.auth-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.auth-link:hover { color: var(--text); }

/* ── Flash ── */
.flash {
  position: fixed;
  top: 58px;
  right: 20px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 5px;
  font-size: 12px;
  border: 1px solid;
  animation: flash-in 0.18s ease;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.flash-notice { background: var(--green-bg); color: var(--green); border-color: var(--badge-border-green); }
.flash-alert  { background: var(--red-bg);   color: var(--red);   border-color: var(--badge-border-red); }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  color: var(--muted);
  font-size: 12px;
  gap: 10px;
  text-align: center;
}

.empty-icon { font-size: 28px; opacity: 0.25; }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

/* ── Section heading ── */
.section-heading {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Login ── */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background: radial-gradient(ellipse 55% 45% at 50% 0%, var(--login-glow) 0%, transparent 70%);
}

.login-box { width: 100%; max-width: 360px; padding: 40px; }

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.login-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--amber);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
}

.login-logo-text {
  font-family: 'Figtree', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-hi);
  letter-spacing: -0.02em;
}

.login-eyebrow {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* ── Utility ── */
.hi  { color: var(--text-hi); }
.dim { color: var(--muted); }

/* ── Onboarding ── */
.onboarding-step-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
}

.onboarding-step {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: var(--border);
  transition: background 0.2s;
}

.onboarding-step--active { background: var(--amber); }
.onboarding-step--done   { background: var(--amber-dim); }

.onboarding-lead {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── Shell without sidebar (logged-out) ── */
.shell--no-sidebar {
  grid-template-columns: 1fr;
}

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: opacity 0.15s, transform 0.2s;
}

/* ── Sidebar drawer / overlay ── */
.sidebar-close-row {
  display: none;
  justify-content: flex-end;
  padding: 8px 12px 4px;
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}

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

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-backdrop);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s;
}

.sidebar-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Scrollable table wrapper ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.booking-request-thread-link {
  --booking-request-thread-font-size: 11px;
  --booking-request-thread-link-max-width: 220px;
  font-size: var(--booking-request-thread-font-size);
  display: block;
  max-width: var(--booking-request-thread-link-max-width);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Mobile breakpoint ── */
@media (max-width: 768px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 48px 1fr;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .nav-toggle {
    display: flex;
  }

  .sidebar-close-row {
    display: flex;
  }

  .sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }

  .sidebar-drawer--open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .main {
    padding: 16px;
    grid-column: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .topbar-email {
    display: none;
  }

  .card {
    overflow-x: auto;
  }

  .data-table {
    min-width: 520px;
  }

  .booking-requests-table {
    min-width: 0;
  }

  .booking-requests-table .booking-requests-col--secondary {
    display: none;
  }

  .booking-requests-table .booking-request-thread-link {
    --booking-request-thread-link-max-width: 140px;
  }

  body.nav-open {
    overflow: hidden;
  }

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

  .draft-card-actions {
    flex-direction: column;
  }

  .draft-card-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .flash {
    top: 54px;
    right: 12px;
    left: 12px;
  }
}

/* ══════════════════════════════════════
   Landing page
   ══════════════════════════════════════ */

.lp {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: relative;
}

.lp::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Nav ── */
.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--lp-nav-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.lp-nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Figtree', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-hi);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.lp-nav-icon {
  width: 26px;
  height: 26px;
  background: var(--amber);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
  flex-shrink: 0;
}

.lp-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lp-nav-signin {
  font-size: 11px;
  padding: 4px 14px;
}

/* ── Hero ── */
.lp-hero {
  position: relative;
  padding: 72px 40px 88px;
  overflow: hidden;
}

.lp-hero-glow {
  position: absolute;
  top: -80px;
  right: 0;
  width: min(720px, 90vw);
  height: 480px;
  background: radial-gradient(ellipse 55% 50% at 70% 25%, var(--lp-hero-glow) 0%, transparent 72%);
  pointer-events: none;
}

.lp-hero-grid {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 48px;
  align-items: center;
}

.lp-hero-copy {
  text-align: left;
}

.lp-headline {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--text-hi);
  margin-bottom: 20px;
  text-wrap: balance;
}

.lp-headline-accent {
  color: var(--amber);
}

.lp-sub {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 42ch;
  margin: 0 0 28px;
}

.lp-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.lp-hero-cta {
  padding: 12px 28px;
  font-size: 12px;
}

.lp-hero-signin {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.lp-hero-signin-link {
  color: var(--text-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lp-hero-signin-link:hover {
  color: var(--amber);
}

.lp-hero-preview {
  min-width: 0;
}

.lp-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px 14px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] .lp-preview-card {
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.lp-preview-card .thread-timeline {
  margin-bottom: 0;
}

.lp-preview-card .thread-row {
  margin-bottom: 10px;
}

.lp-preview-card .thread-row:last-child {
  margin-bottom: 0;
}

.lp-preview-card .draft-card-actions .btn {
  pointer-events: none;
  cursor: default;
}

/* ── Pain section ── */
.lp-pain {
  border-top: 1px solid var(--border);
  padding: 64px 40px;
  background: var(--lp-pain-bg);
}

.lp-pain-inner {
  max-width: 720px;
  margin: 0 auto;
}

.lp-pain-title {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-hi);
  margin-bottom: 28px;
  text-wrap: balance;
}

.lp-pain-grid {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lp-pain-item {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  padding-left: 16px;
  border-left: 2px solid var(--amber-dim);
}

/* ── Steps ── */
.lp-steps {
  border-top: 1px solid var(--border);
  padding: 80px 40px;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

.lp-steps-heading {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-hi);
  text-align: center;
  text-wrap: balance;
}

.lp-steps-list {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.lp-step-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.lp-step-copy {
  min-width: 0;
}

.lp-step-title {
  font-family: 'Figtree', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.lp-step-body {
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 40ch;
}

.lp-step-aside {
  display: flex;
  justify-content: flex-end;
}

.lp-step-row--flip .lp-step-copy {
  order: 2;
}

.lp-step-row--flip .lp-step-aside {
  order: 1;
  justify-content: flex-start;
}

.lp-step-panel {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lp-step-panel--accent {
  border-color: var(--amber-dim);
  background: var(--amber-bg);
}

.lp-step-panel-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lp-step-panel-value {
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.lp-step-panel-status {
  font-size: 11px;
  color: var(--amber);
}

/* ── Footer ── */
.lp-footer {
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.lp-footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Figtree', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.01em;
}

.lp-footer-icon {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.lp-footer-copy {
  font-size: 11px;
  color: var(--muted);
}

/* ── Waitlist form (shared) ── */
.lp-waitlist-form {
  width: 100%;
}

.lp-waitlist-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}

.lp-waitlist-row {
  display: flex;
  gap: 12px;
}

.lp-waitlist-field-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lp-waitlist-field-block--submit {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.lp-waitlist-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.lp-waitlist-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-hi);
  border-radius: 7px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-waitlist-field:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--form-focus-ring-strong);
}

.lp-waitlist-row .lp-waitlist-input {
  width: 100%;
  border: 1px solid var(--border-hi);
  border-radius: 5px;
}

.lp-waitlist-row .lp-waitlist-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--form-focus-ring-strong);
  outline: none;
}

.lp-waitlist-input {
  flex: 1;
  background: var(--waitlist-input-bg);
  border: none;
  outline: none;
  padding: 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-hi);
  min-width: 0;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-waitlist-input::placeholder { color: var(--muted); }

.lp-waitlist-input--error { background: var(--waitlist-input-error-bg); }

.lp-waitlist-btn {
  background: var(--amber);
  color: #000;
  border: none;
  padding: 10px 18px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.lp-waitlist-btn:hover { background: var(--btn-amber-hover-bg); }

.lp-waitlist-error {
  font-size: 11px;
  color: var(--red);
  margin-top: 8px;
  text-align: center;
}

/* ── Waitlist success state ── */
.lp-waitlist-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  animation: wl-in 0.3s ease;
}

@keyframes wl-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lp-waitlist-success-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-bg);
  border: 1px solid var(--badge-border-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 4px;
}

.lp-waitlist-success-headline {
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.01em;
}

.lp-waitlist-success-sub {
  font-size: 11px;
  color: var(--muted);
}

/* ── Dedicated waitlist section ── */
.lp-waitlist-section {
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.lp-waitlist-section-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 50% 100%, var(--lp-section-glow) 0%, transparent 65%);
  pointer-events: none;
}

.lp-waitlist-section-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 88px 40px;
  text-align: center;
  position: relative;
}

.lp-waitlist-section-heading {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-hi);
  margin: 20px 0 20px;
}

.lp-waitlist-section-sub {
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 36px;
}

.lp-waitlist-form--lg .lp-waitlist-field {
  max-width: 480px;
  border-radius: 7px;
}

.lp-waitlist-input--lg {
  padding: 13px 16px;
  font-size: 13px;
}

.lp-waitlist-btn--lg {
  padding: 13px 24px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.lp-waitlist-section-note {
  margin-top: 16px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Landing responsive ── */
@media (max-width: 768px) {
  .lp-nav {
    padding: 0 20px;
  }

  .lp-hero {
    padding: 48px 20px 56px;
  }

  .lp-hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .lp-hero-copy {
    text-align: left;
  }

  .lp-pain {
    padding: 48px 20px;
  }

  .lp-steps {
    padding: 56px 20px;
  }

  .lp-step-row,
  .lp-step-row--flip {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .lp-step-row--flip .lp-step-copy,
  .lp-step-row--flip .lp-step-aside {
    order: unset;
  }

  .lp-step-aside {
    justify-content: flex-start;
  }

  .lp-step-panel {
    max-width: none;
  }

  .lp-footer {
    padding: 24px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .lp-waitlist-section-inner {
    padding: 64px 20px;
  }

  .lp-waitlist-row {
    flex-direction: column;
  }

  .lp-waitlist-field {
    flex-direction: column;
    border: none;
    overflow: visible;
    gap: 8px;
  }

  .lp-waitlist-field:focus-within {
    box-shadow: none;
  }

  .lp-waitlist-input,
  .lp-waitlist-input--lg {
    border: 1px solid var(--border-hi);
    border-radius: 5px;
    width: 100%;
  }

  .lp-waitlist-input:focus,
  .lp-waitlist-input--lg:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px var(--form-focus-ring-strong);
  }

  .lp-waitlist-btn,
  .lp-waitlist-btn--lg {
    border-radius: 5px;
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-waitlist-success {
    animation: none;
  }
}

/* ── Thread timeline ── */
.thread-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.thread-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.thread-row--inbound  { justify-content: flex-start; }
.thread-row--outbound { justify-content: flex-end;   }
.thread-row--pending  { justify-content: flex-end;   }

.thread-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.thread-avatar--customer {
  background: var(--thread-avatar-cust-bg);
  color: var(--thread-avatar-cust-fg);
  border: 1px solid var(--thread-avatar-cust-border);
}

.thread-avatar--venue {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-dim);
}

.thread-bubble {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  max-width: 72%;
  position: relative;
}

.thread-bubble--inbound {
  background: var(--thread-bubble-inbound-bg);
  border-color: var(--border);
  border-bottom-left-radius: 4px;
}

.thread-bubble--outbound {
  background: var(--thread-bubble-outbound-bg);
  border-color: var(--thread-bubble-outbound-border);
  border-bottom-right-radius: 4px;
}

.thread-bubble--pending {
  background: var(--thread-bubble-pending-bg);
  border: 1px dashed var(--amber-dim);
  border-bottom-right-radius: 4px;
}

.thread-bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.thread-sender {
  font-family: 'Figtree', sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-hi);
}

.thread-sender--venue  { color: var(--thread-sender-venue); }
.thread-sender--pending { color: var(--amber); }

.thread-timestamp {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
}

.thread-subject {
  font-size: 10px;
  color: var(--muted);
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.thread-bubble-body {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-bubble-body--outbound { color: var(--thread-body-outbound); }

.thread-bubble--pending .draft-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--draft-actions-border);
}

@media (max-width: 640px) {
  .thread-bubble {
    max-width: 88%;
  }
}
