:root {
  --bg:        #f7f8fa;
  --bg2:       #eef0f4;
  --surface:   #ffffff;
  --surface2:  #f2f4f7;
  --border:    #dde1e8;
  --border2:   #c8cdd7;
  --accent:    #2563eb;
  --accent-lt: #eff4ff;
  --accent-hv: #1d4ed8;
  --teal:      #0d9488;
  --teal-lt:   #f0fdfa;
  --amber:     #d97706;
  --amber-lt:  #fffbeb;
  --danger:    #dc2626;
  --danger-lt: #fef2f2;
  --success:   #16a34a;
  --success-lt:#f0fdf4;
  --text:      #111827;
  --text2:     #374151;
  --muted:     #6b7280;
  --muted2:    #9ca3af;
  --mono:      'DM Mono', monospace;
  --sans:      'DM Sans', sans-serif;
  --radius:    10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.09), 0 4px 8px rgba(0,0,0,0.05);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Pages ─── */
.page { display: none; min-height: 100vh; position: relative; }
.page.active { display: flex; }

/* ─── Auth page ─── */
#auth-page {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f7f8fa 50%, #f0fdfa 100%);
  min-height: 100vh;
}

.auth-box {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  position: relative;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  max-height: 95vh;
  box-shadow: var(--shadow-lg);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

.logo-sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.auth-tabs {
  display: flex;
  background: var(--surface2);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 1.75rem;
  gap: 2px;
}

.auth-tab {
  flex: 1;
  padding: 0.55rem 1rem;
  text-align: center;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  border: none;
  border-radius: 6px;
  background: transparent;
  transition: all 0.18s ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-tab:hover:not(.active) { color: var(--text2); }

.form-group { margin-bottom: 1.125rem; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.4rem;
}

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.875rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  border-radius: 7px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input::placeholder, textarea::placeholder { color: var(--muted2); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: 7px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

.btn-primary:hover  { background: var(--accent-hv); box-shadow: 0 3px 8px rgba(37,99,235,0.35); }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border2); color: var(--text2); background: var(--surface2); }

.btn-danger { background: var(--danger); color: #fff; }

.error-msg {
  background: var(--danger-lt);
  border: 1px solid #fca5a5;
  color: var(--danger);
  padding: 0.7rem 0.875rem;
  border-radius: 7px;
  font-size: 0.83rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.success-msg {
  background: var(--success-lt);
  border: 1px solid #86efac;
  color: var(--success);
  padding: 0.7rem 0.875rem;
  border-radius: 7px;
  font-size: 0.83rem;
  margin-bottom: 1rem;
}

/* ─── Dashboard ─── */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.75rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.topbar-logo {
  display: flex;
  align-items: center;
}

.topbar-logo .logo-dot {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 1px 4px rgba(37,99,235,0.2);
}

.topbar-logo .wordmark { font-weight: 600; }
.topbar-logo .tagline {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
  padding: 0.2rem 0.5rem;
  background: var(--surface2);
  border-radius: 4px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.user-badge {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
}

.user-badge strong { color: var(--text2); font-weight: 500; }

.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
}

/* ─── Prompt area ─── */
.prompt-area {
  padding: 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg);
}

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

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

.prompt-input-wrap { position: relative; }

#prompt-textarea {
  resize: none;
  min-height: 170px;
  line-height: 1.7;
  background: var(--surface);
  font-family: var(--sans);
  font-size: 0.92rem;
  border-radius: 8px;
  padding-bottom: 2.25rem;
}

.char-count {
  position: absolute;
  bottom: 0.7rem;
  right: 0.875rem;
  font-family: var(--mono);
  font-size: 0.67rem;
  color: var(--muted2);
}

/* ─── Config panel ─── */
.config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

/* ─── Action row ─── */
.action-row { display: flex; gap: 0.75rem; }

.btn-relay {
  flex: 1;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.8rem 1.25rem;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.btn-relay:hover  { background: var(--accent-hv); box-shadow: 0 3px 10px rgba(37,99,235,0.35); }
.btn-relay:active { transform: scale(0.985); }
.btn-relay:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-preview {
  background: var(--surface);
  color: var(--teal);
  border: 1.5px solid #99f6e4;
  padding: 0.8rem 1.25rem;
}
.btn-preview:hover { background: var(--teal-lt); border-color: var(--teal); }

/* ─── Cards ─── */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: none;
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.result-card.visible { display: block; }

.result-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
}

.result-header h3 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.model-badge {
  font-family: var(--mono);
  font-size: 0.67rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-lt);
  border: 1px solid #bfdbfe;
  color: var(--accent);
  border-radius: 5px;
  font-weight: 500;
}

.result-body {
  padding: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text2);
  max-height: 480px;
  overflow-y: auto;
}

/* PII summary pills */
.pii-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.pii-pill {
  font-family: var(--mono);
  font-size: 0.67rem;
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  background: var(--teal-lt);
  border: 1px solid #99f6e4;
  color: var(--teal);
  font-weight: 500;
}

/* Preview card */
.preview-card {
  background: var(--surface);
  border: 1px solid #99f6e4;
  border-radius: 8px;
  display: none;
  animation: fadeUp 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.preview-card.visible { display: block; }

.preview-text {
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
  color: var(--text2);
}

.preview-text .token {
  background: var(--amber-lt);
  border: 1px solid #fcd34d;
  color: var(--amber);
  border-radius: 4px;
  padding: 0 3px;
  font-size: 0.85em;
  font-weight: 500;
}

/* ─── Sidebar (history) ─── */
.sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.history-item {
  padding: 0.75rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 7px;
  margin-bottom: 0.3rem;
  cursor: pointer;
  transition: all 0.13s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-item:hover {
  background: var(--surface2);
  border-color: var(--border);
}

.history-item-body {
  flex: 1;
  min-width: 0; /* allow text-overflow to work inside flex */
}

.history-item-prompt {
  font-size: 0.8rem;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.25rem;
  font-weight: 400;
}

.history-item-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted2);
}

.history-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.7rem;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.13s ease, background 0.13s ease, color 0.13s ease;
}

.history-item:hover .history-delete-btn {
  opacity: 1;
}

.history-delete-btn:hover {
  background: #fee2e2;
  color: var(--danger);
}

.history-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted2);
  line-height: 1.6;
}

/* ─── Loading overlay ─── */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(247,248,250,0.88);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  flex-direction: column;
  gap: 1.25rem;
}

.loading-overlay.visible { display: flex; }

.loading-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
}

.loading-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.loading-step {
  font-size: 0.85rem;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: color 0.25s;
}

.loading-step.done  { color: var(--teal); }
.loading-step.active { color: var(--text); font-weight: 500; }

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.25s;
}

.loading-step.done  .step-dot { background: var(--teal); }
.loading-step.active .step-dot { background: var(--accent); animation: pulse 1s infinite; }

.loading-text {
  display: none; /* title replaces this */
}

/* ─── API note ─── */
.api-note {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.6rem 0.875rem;
  background: var(--accent-lt);
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  line-height: 1.6;
}

.api-note strong { color: var(--accent); font-weight: 500; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .config-row { grid-template-columns: 1fr; }
}

/* ─── Footer ─── */
.app-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted2);
  z-index: 50;
  letter-spacing: 0.02em;
}

.footer-sep { color: var(--border2); }

.footer-version {
  color: var(--accent);
  font-weight: 500;
}

/* Offset page content so footer doesn't overlap */
.main-layout {
  max-height: calc(100vh - 58px - 36px);
}

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

/* ─── Body variants ─── */
body.landing-body {
  background: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

body.app-body {
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── Nav ─── */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4rem;
  height: 64px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.landing-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.panel-logo-img {
  height: 72px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.83rem;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 6rem 2rem 5rem;
  background: linear-gradient(160deg, #eff6ff 0%, #ffffff 55%, #f0fdfa 100%);
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-lt);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 580px;
  margin: 0 auto 2.25rem;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; align-items: center; margin-bottom: 2.5rem; }
.hero-actions-divider { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.hero-signin-stack { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }

.btn-lg {
  padding: 0.8rem 1.75rem;
  font-size: 0.95rem;
}

.hero-providers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.providers-label {
  font-size: 0.78rem;
  color: var(--muted2);
  margin-right: 0.25rem;
}

.provider-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text2);
}

/* ─── Sections ─── */
.section {
  padding: 5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-alt {
  max-width: 100%;
  background: var(--bg);
  padding: 5rem 4rem;
}

.section-alt > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

/* ─── Steps grid ─── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}

.step-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.step-number {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted2);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.step-icon {
  font-size: 1.6rem;
  margin-bottom: 0.875rem;
}

.step-card h3 {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── Features grid ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 0.875rem;
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.feature-icon.accent { background: var(--accent-lt); }
.feature-icon.teal   { background: var(--teal-lt); }
.feature-icon.amber  { background: var(--amber-lt); }

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── CTA section ─── */
.cta-section {
  text-align: center;
  padding: 5rem 2rem 4rem;
  border-top: 1px solid var(--border);
  max-width: 100%;
  background: linear-gradient(160deg, #f9fafb 0%, #eff6ff 100%);
}

.cta-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.cta-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ─── Landing footer ─── */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted2);
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH SLIDE PANEL
   ═══════════════════════════════════════════════════════════════════════ */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.auth-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.auth-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.1);
  z-index: 201;
  padding: 2.25rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-panel.open {
  transform: translateX(0);
}

.auth-panel-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px; height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.auth-panel-close:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .steps-grid    { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .landing-nav   { padding: 0 1.5rem; }
  .section       { padding: 3.5rem 1.5rem; }
  .section-alt   { padding: 3.5rem 1.5rem; }
}

@media (max-width: 600px) {
  .steps-grid    { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .auth-panel    { width: 100vw; }
  .hero          { padding: 4rem 1.25rem 3rem; }
  .landing-nav-actions .btn-ghost { display: none; }
}

/* Nav buttons — equal width */
.landing-nav-actions .btn-sm {
  min-width: 110px;
  text-align: center;
  justify-content: center;
}

/* ─── FAQ page ─────────────────────────────────────────────────────────────── */
.faq-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.faq-hero {
  text-align: center;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.faq-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text1);
  margin: 0.75rem 0 1rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.faq-subtitle {
  font-size: 1rem;
  color: var(--text2);
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto;
}

.faq-section {
  margin-bottom: 3.5rem;
}

.faq-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text1);
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* General FAQ accordion items */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.faq-q {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text1);
  cursor: pointer;
  background: var(--surface);
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.13s ease;
}

.faq-q::after {
  content: '+';
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-q {
  background: var(--surface2);
}

.faq-item.open .faq-q::after {
  transform: rotate(45deg);
}

.faq-a {
  display: none;
  padding: 0 1.25rem 1rem;
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.7;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.faq-item.open .faq-a {
  display: block;
}

/* Provider cards */
.faq-provider-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.faq-provider-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.faq-provider-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  border: 1px solid;
  flex-shrink: 0;
}

.faq-provider-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text1);
  flex: 1;
}

.faq-provider-model {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.faq-provider-body {
  padding: 1.25rem;
  background: var(--surface);
}

.faq-steps {
  margin: 0 0 1rem 0;
  padding-left: 1.4rem;
}

.faq-steps li {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 0.4rem;
}

.faq-steps li a {
  color: var(--accent);
  text-decoration: none;
}

.faq-steps li a:hover {
  text-decoration: underline;
}

.faq-provider-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.faq-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--accent);
  text-decoration: none;
  background: var(--surface2);
  transition: background 0.13s ease, border-color 0.13s ease;
}

.faq-link:hover {
  background: var(--accent-lt);
  border-color: #bfdbfe;
}

.inline-code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--text1);
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.13s ease;
}

.footer-link:hover {
  color: var(--text2);
}

/* ─── Hamburger button ──────────────────────────────────────────────────────── */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.13s ease;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: var(--surface2);
}

.hamburger-btn span {
  display: block;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: background 0.13s ease;
}

/* ─── Menu overlay & slide panel ───────────────────────────────────────────── */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.1);
  z-index: 201;
  padding: 2.25rem 1.75rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-panel.open {
  transform: translateX(0);
}

.menu-panel-header {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

/* ─── Menu navigation items ─────────────────────────────────────────────────── */
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.menu-nav-item,
a.menu-nav-item {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text1);
  cursor: pointer;
  text-align: left;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.menu-nav-item:hover,
a.menu-nav-item:hover {
  background: var(--surface2);
  border-color: var(--border);
}

.menu-nav-item--danger {
  color: var(--danger);
  margin-top: 0.5rem;
}

.menu-nav-item--danger:hover {
  background: #fee2e2;
  border-color: #fecaca;
}

.menu-nav-item:disabled,
.menu-nav-item[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.menu-nav-icon {
  font-size: 1.2rem;
  width: 1rem;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
  color: var(--accent);
}

.menu-nav-item--danger .menu-nav-icon {
  color: var(--danger);
}

/* ─── Menu views (profile etc.) ─────────────────────────────────────────────── */
.menu-view-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text1);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.menu-back-btn {
  display: inline-block;
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.13s ease;
}

.menu-back-btn:hover {
  color: var(--text2);
}

@media (max-width: 600px) {
  .menu-panel { width: 100vw; }
}

/* ─── Selection anonymization popup ────────────────────────────────────────── */
.selection-popup {
  position: fixed;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  animation: fadeUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.selection-popup-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--sans);
  padding-right: 0.2rem;
}

.selection-popup-btn {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease, border-color 0.13s ease;
}

.selection-popup-btn--confirm {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.selection-popup-btn--confirm:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.selection-popup-btn--cancel {
  background: var(--surface2);
  color: var(--text2);
  border-color: var(--border);
}

.selection-popup-btn--cancel:hover {
  background: var(--border);
  color: var(--text1);
}

/* ─── Removable user token in preview ──────────────────────────────────────── */
.token-user {
  cursor: pointer;
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
  padding-right: 0.2rem;
  transition: background 0.13s ease, border-color 0.13s ease;
}

.token-user:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
}

.token-remove {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.65em;
  opacity: 0.6;
  vertical-align: middle;
  line-height: 1;
}

.token-user:hover .token-remove {
  opacity: 1;
}

/* ─── Password rule checker ─────────────────────────────────────────────────── */
.pw-rules {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pw-rule {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.pw-rule-icon {
  font-size: 0.75rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.pw-rule--pass {
  color: #16a34a;
}

.pw-rule--pass .pw-rule-icon {
  color: #16a34a;
}

.pw-rule--fail {
  color: var(--muted);
}

/* ─── Disabled register button ──────────────────────────────────────────────── */
#btn-register:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Disabled change password button ──────────────────────────────────────── */
#btn-change-password:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Email verification step ───────────────────────────────────────────────── */
.verify-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.verify-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.verify-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text1);
  margin: 0 0 0.5rem;
}

.verify-sub {
  font-size: 0.83rem;
  color: var(--text2);
  line-height: 1.6;
  margin: 0;
}

.verify-resend {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  display: inline;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover {
  color: #1d4ed8;
}

.btn-link:disabled {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

/* ─── Disabled reset password button ───────────────────────────────────────── */
#btn-reset-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Contact page ──────────────────────────────────────────────────────────── */
.contact-wrap {
  max-width: 560px;
  margin: 0 auto 4rem;
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.contact-success {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.contact-success-icon {
  width: 52px;
  height: 52px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.contact-success h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text1);
  margin: 0 0 0.5rem;
}

.contact-success p {
  font-size: 0.88rem;
  color: var(--text2);
  margin: 0;
  line-height: 1.6;
}

/* ─── Subscription banners ──────────────────────────────────────────────────── */
/* sub-banner and sub-manage-bar both inherit .api-note base styles */
.sub-banner {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--muted);
}

.sub-banner strong {
  color: #1e40af;
  font-weight: 500;
}

/* sub-manage-bar inherits .api-note styles and adds a warm amber tint */
.sub-manage-bar {
  background: #fffcf0;
  border-color: #fde68a;
  color: var(--muted);
}

.sub-manage-bar strong {
  color: #92400e;
  font-weight: 500;
}

#btn-relay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── Thank-you overlay (post-Stripe checkout) ──────────────────────────────── */
.thankyou-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  backdrop-filter: blur(2px);
}

.thankyou-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 2rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: thankyou-in 0.2s ease;
}

@keyframes thankyou-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

.thankyou-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.thankyou-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text1);
  margin: 0 0 0.6rem;
}

.thankyou-body {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.65;
  margin: 0 0 1.25rem;
}