/* ===================================================
   StageOne — Design System  |  v2  (Light + Dark)
   Light theme (default) — extracted from joinstageone.vercel.app
   Dark  theme — [data-theme="dark"]
   =================================================== */

/* ─────────────────────────────────────────────────
   LIGHT THEME  (default)
───────────────────────────────────────────────── */
:root {
  --primary:          #008586;
  --primary-hover:    #009495;
  --primary-dark:     #006b6c;
  --primary-fg:       #ffffff;
  --primary-faint:    rgba(0, 133, 134, 0.08);
  --primary-glow:     rgba(0, 133, 134, 0.12);

  --bg:               #fdfdfd;
  --bg-alt:           #f3f5f9;
  --surface:          #ffffff;
  --surface-raised:   #f9fafb;
  --muted:            #f0f2f5;
  --navbar-bg:        rgba(253, 253, 253, 0.88);
  --glass:            rgba(255, 255, 255, 0.75);
  --glass-border:     rgba(227, 229, 232, 0.60);

  --text:             #090b0f;
  --text-secondary:   #1f2227;
  --text-muted:       #606369;
  --text-faint:       #9da3ae;

  --border:           #e3e5e8;
  --border-light:     #e3e5e8;

  --success:          #00a544;
  --success-bg:       rgba(0, 165, 68,  0.09);
  --warning:          #b75000;
  --warning-bg:       rgba(183, 80,   0, 0.09);
  --error:            #cc272e;
  --error-bg:         rgba(204, 39,  46, 0.09);
  --info:             #008586;
  --info-bg:          rgba(0, 133, 134, 0.09);

  --accent:           #d6e9e9;
  --accent-fg:        #004647;

  --shadow-sm:        0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:           0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg:        0 12px 40px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-glow:      0 0 28px rgba(0, 133, 134, 0.14);

  --radius-sm:        8px;
  --radius:           12px;
  --radius-lg:        16px;
  --radius-xl:        24px;
  --transition:       all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  /* scrollbar */
  --scrollbar-thumb:  #cbd5e1;
  --scrollbar-hover:  #94a3b8;
}

/* ─────────────────────────────────────────────────
   DARK THEME  [data-theme="dark"]
───────────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:          #009495;
  --primary-hover:    #00b5b5;
  --primary-dark:     #007a7b;
  --primary-fg:       #020306;
  --primary-faint:    rgba(0, 148, 149, 0.10);
  --primary-glow:     rgba(0, 148, 149, 0.22);

  --bg:               #05070b;
  --bg-alt:           #0b0d12;
  --surface:          #0b0d12;
  --surface-raised:   #111318;
  --muted:            #181b1f;
  --navbar-bg:        rgba(5, 7, 11, 0.88);
  --glass:            rgba(11, 13, 18, 0.75);
  --glass-border:     rgba(43, 46, 51, 0.50);

  --text:             #f0f2f5;
  --text-secondary:   #dcdee1;
  --text-muted:       #8c8f95;
  --text-faint:       #4a5565;

  --border:           #1f2227;
  --border-light:     #1f2227;

  --success:          #00c758;
  --success-bg:       rgba(0, 199, 88,  0.10);
  --warning:          #f99c00;
  --warning-bg:       rgba(249, 156,  0, 0.10);
  --error:            #b32228;
  --error-bg:         rgba(179,  34, 40, 0.10);
  --info:             #009495;
  --info-bg:          rgba(0, 148, 149, 0.10);

  --accent:           #0e2626;
  --accent-fg:        #00b5b5;

  --shadow-sm:        0 1px 3px rgba(0,0,0,0.40), 0 1px 2px rgba(0,0,0,0.30);
  --shadow:           0 4px 16px rgba(0,0,0,0.50), 0 1px 4px rgba(0,0,0,0.40);
  --shadow-lg:        0 12px 40px rgba(0,0,0,0.60), 0 4px 8px rgba(0,0,0,0.40);
  --shadow-glow:      0 0 28px rgba(0, 148, 149, 0.18);

  --scrollbar-thumb:  #1f2227;
  --scrollbar-hover:  #2e3238;
}

/* ─────────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}
[data-theme="dark"] { color-scheme: dark; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ─────────────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ─────────────────────────────────────────────────
   GRADIENT UTILITIES
───────────────────────────────────────────────── */
.gradient-bg  { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); }
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─────────────────────────────────────────────────
   THEME TOGGLE BUTTON
───────────────────────────────────────────────── */
.btn-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-theme-toggle:hover {
  background: var(--muted);
  color: var(--primary);
  border-color: var(--primary);
}
/* Light mode: show moon (to switch to dark) */
.btn-theme-toggle .icon-sun  { display: none; }
.btn-theme-toggle .icon-moon { display: block; }
/* Dark mode: show sun (to switch to light) */
[data-theme="dark"] .btn-theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .btn-theme-toggle .icon-moon { display: none; }

/* ─────────────────────────────────────────────────
   NAVBAR
───────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.0625rem;
  flex-shrink: 0;
}
.nav-brand:hover { color: var(--text); }

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-fg);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
}

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--muted); }
.nav-link.active { color: var(--primary); background: var(--primary-faint); }

.nav-actions { display: flex; align-items: center; gap: 0.625rem; }
.nav-notification { position: relative; }

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.25rem;
}

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 0.5rem 0 1rem;
  border-top: 1px solid var(--border);
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-link {
  padding: 0.75rem 0;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.nav-mobile-link:hover { color: var(--primary); }

/* ─────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 2px 10px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--primary-fg);
  box-shadow: 0 4px 18px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-raised); color: var(--text); border-color: var(--text-faint); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--muted); color: var(--text); }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); color: #fff; transform: translateY(-1px); }

.btn-success { background: var(--success); color: var(--primary-fg); }
.btn-success:hover { filter: brightness(1.08); color: var(--primary-fg); transform: translateY(-1px); }

.btn-sm   { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn-lg   { padding: 0.875rem 1.75rem;  font-size: 0.9375rem; }
.btn-full { width: 100%; }

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--muted); color: var(--primary); }

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
}
.btn-text:hover { color: var(--primary-hover); }

.btn-linkedin { background: #0077b5; color: #fff; gap: 0.75rem; }
.btn-linkedin:hover { background: #006097; color: #fff; transform: translateY(-1px); }

.btn-google {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-google:hover { background: var(--muted); color: var(--text); }

/* ─────────────────────────────────────────────────
   CARDS
───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.card-glass {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
}

.card-body   { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg-alt); }

/* ─────────────────────────────────────────────────
   REFERRER CARD
───────────────────────────────────────────────── */
.referrer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
  cursor: pointer;
}
.referrer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}

.referrer-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.referrer-avatar img { width: 100%; height: 100%; object-fit: cover; filter: blur(8px); transform: scale(1.1); }
.referrer-avatar.revealed img { filter: none; transform: none; }

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--primary-faint);
  color: var(--primary);
  border: 1px solid rgba(0, 133, 134, 0.22);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
[data-theme="dark"] .verified-badge { border-color: rgba(0, 148, 149, 0.25); color: var(--primary-hover); }

/* ─────────────────────────────────────────────────
   FORMS
───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }

.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.form-label.required::after { content: ' *'; color: var(--error); }

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
[data-theme="dark"] .form-control { background: var(--bg-alt); }
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-faint);
}
.form-control:disabled { background: var(--muted); color: var(--text-muted); opacity: 0.6; }
.form-control.is-invalid { border-color: var(--error); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--error-bg); }

select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  padding-right: 2.5rem;
}
[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238c8f95' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}
select.form-control option { background: var(--surface); color: var(--text); }

textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint  { font-size: 0.8125rem; color: var(--text-muted); }
.form-error { font-size: 0.8125rem; color: var(--error); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field-validation-error { font-size: 0.8125rem; color: var(--error); margin-top: 0.25rem; display: block; }

/* ─────────────────────────────────────────────────
   STATUS BADGES
───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-pending      { background: var(--warning-bg); color: var(--warning); }
.badge-viewed       { background: var(--primary-faint); color: var(--primary); }
.badge-accepted     { background: var(--success-bg); color: var(--success); }
.badge-rejected     { background: var(--error-bg); color: var(--error); }
.badge-referred     { background: var(--info-bg); color: var(--info); }
.badge-interviewing { background: rgba(49,121,166,0.10); color: #3179a6; }
.badge-hired        { background: var(--success-bg); color: var(--success); }
[data-theme="dark"] .badge-interviewing { color: #5ba3cb; }

/* ─────────────────────────────────────────────────
   PAGE LAYOUTS
───────────────────────────────────────────────── */
.main-content { min-height: calc(100vh - 64px - 60px); }

.page-container  { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-narrow     { max-width: 640px;  margin: 0 auto; padding: 2rem 1.5rem; }
.page-header     { margin-bottom: 2rem; }

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.page-subtitle { font-size: 0.9375rem; color: var(--text-muted); margin-top: 0.375rem; }
.section-title  { font-size: 1.0625rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }

/* ─────────────────────────────────────────────────
   GRIDS
───────────────────────────────────────────────── */
.grid-2    { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4    { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* ─────────────────────────────────────────────────
   HERO (landing)
───────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%,  rgba(0,133,134,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 80% 95%,  rgba(0,148,149,0.05) 0%, transparent 60%);
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%,  rgba(0,148,149,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 80% 95%,  rgba(0,181,181,0.06) 0%, transparent 60%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-faint);
  border: 1px solid rgba(0, 133, 134, 0.22);
  color: var(--primary);
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
[data-theme="dark"] .hero-eyebrow { color: var(--primary-hover); border-color: rgba(0,148,149,0.30); }

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1.1;
  max-width: 800px;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 2.5rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 4rem;
}

.hero-features { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; justify-content: center; }
.hero-feature  { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.875rem; }
.hero-feature svg { color: var(--primary); flex-shrink: 0; }

/* ─────────────────────────────────────────────────
   HOW IT WORKS
───────────────────────────────────────────────── */
.steps-section { padding: 5rem 1.5rem; background: var(--bg-alt); }

.steps-grid {
  max-width: 900px;
  margin: 3rem auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.step-card { text-align: center; padding: 1.5rem 1rem; }

.step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  margin: 0 auto 1rem;
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ─────────────────────────────────────────────────
   STATS ROW
───────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-glow); }

.stat-number { font-size: 1.625rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; line-height: 1; margin-bottom: 0.375rem; }
.stat-label  { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; }

/* ─────────────────────────────────────────────────
   AUDIO RECORDER
───────────────────────────────────────────────── */
.audio-recorder {
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}
.audio-recorder.recording { border-color: var(--error); background: var(--error-bg); }
.audio-recorder.complete  { border-color: var(--primary); background: var(--primary-faint); border-style: solid; }

.recorder-status { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 1.5rem; }

.recorder-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--error); animation: pulse 1s infinite; }
.recorder-pulse.idle { background: var(--text-faint); animation: none; }
.recorder-pulse.done { background: var(--primary); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.recorder-timer { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -2px; line-height: 1; margin-bottom: 0.75rem; }
.recorder-timer.warning { color: var(--warning); }
.recorder-timer.limit   { color: var(--error); }

.recorder-progress { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 1.5rem; overflow: hidden; }
.recorder-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-hover)); border-radius: 2px; transition: width 0.5s linear; }

.recorder-hint { font-size: 0.875rem; color: var(--text-muted); font-style: italic; margin-bottom: 1.5rem; min-height: 1.5em; }
.recorder-controls { display: flex; gap: 1rem; justify-content: center; }

.recorder-waveform { display: flex; align-items: center; justify-content: center; gap: 3px; height: 40px; margin-bottom: 1rem; }
.waveform-bar { width: 3px; background: var(--primary); border-radius: 2px; animation: wave 0.8s ease-in-out infinite; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { animation-delay: 0.3s; }
.waveform-bar:nth-child(7) { animation-delay: 0.2s; }
.waveform-bar:nth-child(8) { animation-delay: 0.1s; }
@keyframes wave { 0%, 100% { height: 8px; } 50% { height: 32px; } }

/* ─────────────────────────────────────────────────
   AUDIO PLAYER
───────────────────────────────────────────────── */
.audio-player { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.audio-player audio { flex: 1; min-width: 0; height: 36px; }

/* ─────────────────────────────────────────────────
   CHAT
───────────────────────────────────────────────── */
.chat-messages { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--bg); }

.chat-bubble { max-width: 72%; padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.9375rem; line-height: 1.55; word-break: break-word; }
.chat-bubble.mine   { background: var(--primary); color: var(--primary-fg); align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { background: var(--surface); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); }

.chat-input-area { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg-alt); display: flex; gap: 0.75rem; align-items: flex-end; }
.chat-input { flex: 1; resize: none; max-height: 120px; }

/* ─────────────────────────────────────────────────
   NOTIFICATIONS
───────────────────────────────────────────────── */
.notification-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--error);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-dropdown { position: absolute; right: 0; top: calc(100% + 0.5rem); width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: none; z-index: 200; overflow: hidden; }
.notification-dropdown.open { display: block; }

.notif-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 0.9375rem; color: var(--text); }

.notif-item { padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.notif-item:hover  { background: var(--muted); }
.notif-item.unread { background: var(--primary-faint); border-left: 2px solid var(--primary); }
.notif-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.notif-msg   { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.125rem; }
.notif-time  { font-size: 0.75rem; color: var(--text-faint); margin-top: 0.25rem; }
.notif-empty { padding: 2rem 1.25rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* ─────────────────────────────────────────────────
   TOASTS
───────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }

.toast { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem 1.25rem; box-shadow: var(--shadow-lg); font-size: 0.875rem; font-weight: 500; color: var(--text); max-width: 360px; pointer-events: all; animation: slideInRight 0.25s ease; display: flex; align-items: center; gap: 0.75rem; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.info    { border-left: 3px solid var(--primary); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─────────────────────────────────────────────────
   TABLES
───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; background: var(--surface); }

th { background: var(--bg-alt); padding: 0.875rem 1.25rem; text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap; border-bottom: 1px solid var(--border); }

td { padding: 1rem 1.25rem; border-top: 1px solid var(--border); color: var(--text); }

tr:hover td { background: var(--primary-faint); }

/* ─────────────────────────────────────────────────
   SEARCH BAR
───────────────────────────────────────────────── */
.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap svg { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search-input { padding-left: 2.75rem; }

/* ─────────────────────────────────────────────────
   PRICING / WALLET
───────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; padding-top: 1rem; }

.pricing-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; cursor: pointer; transition: var(--transition); position: relative; overflow: visible; }
.pricing-card:hover  { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.pricing-card.popular { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-glow); }
.pricing-card.selected { border-color: var(--primary); background: var(--accent); }

.pricing-popular-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--primary); color: var(--primary-fg); font-size: 0.6875rem; font-weight: 700; padding: 0.2rem 0.75rem; border-radius: 20px; white-space: nowrap; }

.pricing-tokens  { font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: -1px; line-height: 1; }
.pricing-label   { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.pricing-price   { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.pricing-per     { font-size: 0.8125rem; color: var(--text-muted); }
.pricing-savings { display: inline-block; background: var(--success-bg); color: var(--success); font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 4px; margin-top: 0.5rem; }

/* ─────────────────────────────────────────────────
   ALERTS
───────────────────────────────────────────────── */
.alert { padding: 0.875rem 1.25rem; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 1.25rem; display: flex; align-items: flex-start; gap: 0.75rem; }
.alert-info    { background: var(--info-bg);    border: 1px solid rgba(0,133,134,0.25); color: var(--info); }
.alert-success { background: var(--success-bg); border: 1px solid rgba(0,165,68, 0.25); color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(183,80,  0, 0.25); color: var(--warning); }
.alert-error   { background: var(--error-bg);   border: 1px solid rgba(204,39, 46, 0.25); color: var(--error); }
[data-theme="dark"] .alert-info    { border-color: rgba(0,148,149,0.30); }
[data-theme="dark"] .alert-success { border-color: rgba(0,199,88, 0.25); }
[data-theme="dark"] .alert-warning { border-color: rgba(249,156,0,0.25); }
[data-theme="dark"] .alert-error   { border-color: rgba(179,34, 40,0.30); color: #e05a60; }

/* ─────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-icon  { width: 64px; height: 64px; background: var(--muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; color: var(--text-faint); }
.empty-title { font-size: 1.125rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-desc  { font-size: 0.9375rem; max-width: 360px; margin: 0 auto 1.5rem; }

/* ─────────────────────────────────────────────────
   TOKEN BALANCE
───────────────────────────────────────────────── */
.token-balance { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--primary-faint); color: var(--primary); border: 1px solid rgba(0,133,134,0.20); padding: 0.375rem 0.875rem; border-radius: 20px; font-weight: 700; font-size: 0.875rem; }
[data-theme="dark"] .token-balance { color: var(--primary-hover); border-color: rgba(0,148,149,0.20); }

/* ─────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────── */
.footer       { border-top: 1px solid var(--border); padding: 1.25rem 1.5rem; background: var(--bg-alt); text-align: center; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.375rem 0.75rem; font-size: 0.8125rem; color: var(--text-faint); }
.footer-sep   { user-select: none; }
.footer-link  { color: var(--text-muted); }
.footer-link:hover { color: var(--primary); }

/* ─────────────────────────────────────────────────
   LANDING PAGE FOOTER
───────────────────────────────────────────────── */
.lp-footer        { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 3rem 1.5rem 1.5rem; }
.lp-footer-inner  { max-width: 1100px; margin: 0 auto; }
.lp-footer-grid   { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.lp-footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.75rem; text-align: center; }

/* ─────────────────────────────────────────────────
   AVATAR
───────────────────────────────────────────────── */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-placeholder { background: var(--accent); color: var(--accent-fg); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 1rem; }

/* ─────────────────────────────────────────────────
   LOADING
───────────────────────────────────────────────── */
.spinner { width: 20px; height: 20px; border: 2px solid var(--primary-faint); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9999; }

/* ─────────────────────────────────────────────────
   MISC
───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

.text-center { text-align: center; }   .text-right { text-align: right; }
.text-sm  { font-size: 0.875rem; }     .text-xs { font-size: 0.8125rem; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-primary { color: var(--primary); }
.font-bold    { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }   .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }   .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }  .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.w-full { width: 100%; }

/* ─────────────────────────────────────────────────
   SIGN IN DROPDOWN
───────────────────────────────────────────────── */
.nav-signin-wrap { position: relative; }

.nav-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.nav-signin-btn svg { transition: transform 0.18s ease; }
.nav-signin-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.signin-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.625rem);
  width: 248px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 300;
  overflow: hidden;
  animation: dropIn 0.15s ease;
}
.signin-menu.open { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.signin-menu-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}
.signin-menu-item:hover { background: var(--muted); color: var(--text); }

.signin-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-faint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.signin-menu-icon--free { background: var(--success-bg); color: var(--success); }

.signin-menu-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.signin-menu-sub   { font-size: 0.775rem; color: var(--text-muted); margin-top: 0.15rem; }
.signin-menu-sub--free { color: var(--success); font-weight: 500; }

.signin-menu-divider { height: 1px; background: var(--border); margin: 0; }

/* mobile */
.nav-mobile-signin-group { padding: 0.25rem 0; }
.nav-mobile-signin-label {
  display: block;
  padding: 0.625rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}
.nav-mobile-link--sub {
  padding-left: 0.75rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.signin-free-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 20px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────
   CHAT CONTAINER
───────────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 64px - 60px);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ─────────────────────────────────────────────────
   ACCESS DENIED / FULL-PAGE CENTRE
───────────────────────────────────────────────── */
.page-center {
  min-height: calc(100vh - 64px - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ─────────────────────────────────────────────────
   PRICING CARD — feature list check colours
───────────────────────────────────────────────── */
.pricing-feature-check { color: var(--primary); }

/* ─────────────────────────────────────────────────
   RESPONSIVE — TABLET  ≤ 768 px
───────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* ── Navbar ── */
  .nav-links                      { display: none; }
  .nav-mobile-toggle              { display: flex; }
  .nav-brand                      { margin-right: auto; }
  .nav-container                  { gap: 0.75rem; }
  .nav-actions .btn-primary,
  .nav-actions .btn-ghost         { display: none; }
  .notification-dropdown          { width: calc(100vw - 2rem); right: -1rem; }

  /* ── Grids ── */
  .grid-2, .grid-3, .grid-4       { grid-template-columns: 1fr; }
  .form-row                       { grid-template-columns: 1fr; }
  .steps-grid                     { grid-template-columns: repeat(2, 1fr); }
  .stats-row                      { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .pricing-grid                   { grid-template-columns: 1fr; }

  /* ── Typography ── */
  .hero-title                     { font-size: 2.25rem; }
  .page-title                     { font-size: 1.5rem; }
  .stat-number                    { font-size: 1.75rem; }

  /* ── Spacing ── */
  .page-container, .page-narrow   { padding: 1.25rem 1rem; }
  .hero                           { padding: 3rem 1.25rem; }
  .hero-features                  { gap: 1.25rem; }
  .audio-recorder                 { padding: 1.25rem 1rem; }
  .card-header                    { padding: 1rem 1.25rem; }
  .card-body                      { padding: 1.25rem; }

  /* ── Tables ── */
  th, td                          { padding: 0.75rem 1rem; }

  /* ── Search ──
  .search-bar                     { flex-wrap: wrap; }
  .search-bar .search-input-wrap  { flex-basis: 100%; }

  /* ── Footer ── */
  .footer                         { padding: 1rem 1.25rem; }
  .footer-inner                   { justify-content: center; }

  /* ── Landing footer ── */
  .lp-footer                      { padding: 2.5rem 1.25rem 1.25rem; }
  .lp-footer-grid                 { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* ─────────────────────────────────────────────────
   RESPONSIVE — MOBILE  ≤ 480 px
───────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* ── Grids ── */
  .steps-grid                     { grid-template-columns: 1fr; }
  .stats-row                      { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }

  /* ── Hero ── */
  .hero                           { padding: 2.5rem 1rem; }
  .hero-actions                   { flex-direction: column; width: 100%; }
  .hero-actions .btn              { width: 100%; }
  .hero-features                  { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  /* ── Typography ── */
  .page-title                     { font-size: 1.375rem; }
  .stat-number                    { font-size: 1.5rem; }
  .page-subtitle                  { font-size: 0.875rem; }

  /* ── Spacing ── */
  .page-container, .page-narrow   { padding: 1rem 0.875rem; }
  .chat-input-area                { padding: 0.75rem; }
  .chat-bubble                    { max-width: 88%; }

  /* ── Toast ── */
  .toast-container                { right: 0; left: 0; bottom: 0; }
  .toast                          { max-width: 100%; border-radius: 0; }

  /* ── Footer ── */
  .footer                         { padding: 0.875rem 1rem; }
  .footer-inner                   { flex-direction: column; align-items: center; gap: 0.375rem; }
  .footer-sep                     { display: none; }

  /* ── Landing footer ── */
  .lp-footer                      { padding: 2rem 1rem 1rem; }
  .lp-footer-grid                 { grid-template-columns: 1fr; gap: 1.5rem; }
  .lp-footer-bottom               { justify-content: center; text-align: center; }
}
