/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg:           #0D0D13;
  --bg-card:      #16161F;
  --border:       #2A2A3D;
  --input-bg:     #0A0A10;
  --accent:       #8B5CF6;
  --accent-hover: #7C3AED;
  --accent-soft:  #A78BFA;
  --text:         #F4F4F8;
  --text-2:       #A0A0B0;
  --text-muted:   #6B6B7E;
  --success:      #10B981;
  --error:        #EF4444;
  --warning:      #F59E0B;
  --radius-card:  9px;
  --radius-btn:   6px;
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent); }

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,19,.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: .02em;
}

.navbar-brand svg { flex-shrink: 0; }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  position: relative;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color .3s cubic-bezier(.4,0,.2,1),
              background .3s cubic-bezier(.4,0,.2,1),
              transform .22s cubic-bezier(.34,1.56,.64,1);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  border-radius: 8px;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
  transform: translateY(-1px);
}
.nav-link:active {
  transform: translateY(0);
  transition-duration: .08s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7C3AED, #A78BFA, #7C3AED);
  border-radius: 2px;
  opacity: 0;
  transition: width .35s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
}
.nav-link:hover::after {
  width: 35%;
  opacity: .4;
}
.nav-link.nav-active {
  color: var(--accent-soft);
  font-weight: 600;
}
.nav-link.nav-active::after {
  animation: nav-underline-in .55s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes nav-underline-in {
  0%   { width: 0;   opacity: 0; }
  50%  { opacity: 1; }
  100% { width: 65%; opacity: 1; }
}
.nav-link-logout {
  line-height: normal;
}

/* Page-level fade-in on every navigation */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-body {
  animation: page-fade-in .4s cubic-bezier(.4,0,.2,1) both;
}

.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(139,92,246,.18);
  border: 1px solid rgba(139,92,246,.35);
  color: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  padding: 20px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ── Page wrapper ─────────────────────────────────────────────────────── */
.page { flex: 1; padding: 32px 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.page-narrow { max-width: 480px; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.card + .card { margin-top: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon { color: var(--accent); font-size: 16px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s, color .15s, opacity .15s;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: #fff; }

.btn-secondary {
  background: rgba(139,92,246,.12);
  color: var(--accent-soft);
  border: 1px solid rgba(139,92,246,.3);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(139,92,246,.22);
  color: var(--accent-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-soft);
  font-size: 13px;
  padding: 5px 10px;
}
.btn-ghost:hover { background: rgba(139,92,246,.1); color: var(--accent-soft); }

.btn-danger {
  background: rgba(239,68,68,.12);
  color: var(--error);
  border: 1px solid rgba(239,68,68,.25);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.22); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Glow generate button */
.generate-glow-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}
.generate-glow-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius-btn) + 3px);
  background: var(--accent-soft);
  opacity: .25;
  filter: blur(8px);
  transition: opacity .2s;
}
.generate-glow-wrap:hover::before { opacity: .45; }

.btn-generate {
  position: relative;
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background .15s;
  font-family: var(--font);
}
.btn-generate:hover:not(:disabled) { background: var(--accent-hover); }
.btn-generate:disabled { opacity: .55; cursor: not-allowed; }

.btn-preview {
  width: 100%;
  padding: 10px;
  background: rgba(139,92,246,.1);
  color: var(--accent-soft);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 12px;
  font-family: var(--font);
  transition: background .15s;
}
.btn-preview:hover:not(:disabled) { background: rgba(139,92,246,.2); }
.btn-preview:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 120px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B6B7E' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ── Sliders ──────────────────────────────────────────────────────────── */
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
}

.slider-label .slider-value {
  color: var(--accent-soft);
  font-weight: 600;
  min-width: 48px;
  text-align: right;
}

.slider-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(139,92,246,.2);
  transition: box-shadow .15s;
}
input[type=range]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(139,92,246,.3);
}
input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.reset-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.reset-btn:hover {
  color: var(--accent-soft);
  border-color: var(--accent);
  background: rgba(139,92,246,.08);
}

/* ── Toggle switch ────────────────────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background .2s;
}
.toggle input:checked ~ .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Generator layout ─────────────────────────────────────────────────── */
.generator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 780px) {
  .generator-grid { grid-template-columns: 1fr; }
}

/* ── Preset buttons ───────────────────────────────────────────────────── */
.preset-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.preset-btn {
  flex: 1;
  min-width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.preset-btn small { font-size: 11px; color: var(--text-muted); }
.preset-btn:hover {
  border-color: var(--accent);
  background: rgba(139,92,246,.08);
  color: var(--accent-soft);
}
.preset-btn.active {
  border-color: var(--accent);
  background: rgba(139,92,246,.18);
  color: var(--accent-soft);
}
.preset-btn.active small { color: var(--accent-soft); }

/* ── Layer settings (collapsible) ─────────────────────────────────────── */
.layer-settings { margin-top: 16px; }
.layer-settings.hidden { display: none; }

/* ── Progress ─────────────────────────────────────────────────────────── */
.progress-section { margin-top: 16px; }
.progress-section.hidden { display: none; }
.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 999px;
  width: 0%;
  transition: width .4s ease;
}
.progress-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Success banner ───────────────────────────────────────────────────── */
.success-banner {
  margin-top: 16px;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: var(--radius-card);
  padding: 24px;
  text-align: center;
}
.success-banner.hidden { display: none; }
.success-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(16,185,129,.2);
  border: 2px solid var(--success);
  color: var(--success);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-weight: 700;
}
.success-banner p { color: var(--success); font-weight: 600; margin-bottom: 14px; }

/* ── Error/warning banners ────────────────────────────────────────────── */
.alert {
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  margin-top: 12px;
}
.alert.hidden { display: none; }
.alert-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: var(--error);
}
.alert-warning {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  color: var(--warning);
}
.alert-warning a { color: var(--warning); text-decoration: underline; }

/* ── Landing ──────────────────────────────────────────────────────────── */
.landing-hero {
  text-align: center;
  padding: 80px 24px 56px;
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 320px;
  background: radial-gradient(ellipse at center, rgba(139,92,246,.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.landing-hero > * { position: relative; z-index: 1; }
.landing-hero .logo-large {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.logo-large svg {
  filter: drop-shadow(0 0 20px rgba(139,92,246,.5));
}
.landing-hero h1 {
  font-size: clamp(30px, 5.5vw, 52px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 35%, var(--accent-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 18px;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.landing-hero p {
  font-size: 17px;
  color: var(--text-2);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.65;
}
.landing-hero .cta-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.cta-group .btn { min-width: 170px; font-size: 15px; padding: 13px 26px; }

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 24px 48px;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover {
  border-color: rgba(139,92,246,.5);
  transform: translateY(-2px);
}
.feature-card .icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: block;
  width: 48px; height: 48px;
  background: rgba(139,92,246,.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-2); line-height: 1.55; }

/* How it works */
.how-section {
  padding: 0 24px 64px;
  max-width: 900px;
  margin: 0 auto;
}
.how-section h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  position: relative;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-card h3 { font-size: 15px; font-weight: 600; }
.step-card p  { font-size: 13px; color: var(--text-2); line-height: 1.55; }

/* ── Landing pricing ──────────────────────────────────────────────────────── */
.landing-pricing-section {
  padding: 0 24px 64px;
  max-width: 900px;
  margin: 0 auto;
}
.landing-pricing-section h2,
.faq-section h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.landing-section-sub {
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 32px;
}
.landing-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.landing-pack-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  text-align: center;
  position: relative;
  transition: border-color .2s, transform .2s;
}
.landing-pack-card:hover {
  border-color: rgba(139,92,246,.5);
  transform: translateY(-2px);
}
.landing-pack-popular {
  border-color: rgba(139,92,246,.6) !important;
}

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-section {
  padding: 0 24px 80px;
  max-width: 760px;
  margin: 0 auto;
}
.faq-section h2 { margin-bottom: 28px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item.open { border-color: rgba(139,92,246,.45); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: color .15s;
}
.faq-q:hover { color: var(--accent-soft); }
.faq-item.open .faq-q { color: var(--accent-soft); }
.faq-icon {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 400;
  color: var(--accent-soft);
  line-height: 1;
}
.faq-a {
  display: none;
  padding: 0 20px 18px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  border-top: 1px solid var(--border);
}
.faq-item.open .faq-a { display: block; }
.faq-a strong { color: var(--accent-soft); }
.faq-a em { color: var(--text-muted); font-style: normal; }

/* ── Auth pages ───────────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px;
}
.auth-card h2 { font-size: 22px; margin-bottom: 24px; font-weight: 700; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-2); }

/* ── Checkout ─────────────────────────────────────────────────────────── */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.pack-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
  position: relative;
}
.pack-card:hover { border-color: var(--accent); background: rgba(139,92,246,.05); transform: translateY(-2px); }
.pack-card.selected {
  border-color: var(--accent);
  background: rgba(139,92,246,.12);
  box-shadow: 0 0 24px rgba(139,92,246,.18);
}
.pack-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px; left: 12px;
  width: 22px; height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pack-card .pack-credits { font-size: 36px; font-weight: 800; color: var(--accent-soft); }
.pack-card .pack-label { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }
.pack-card .pack-price { font-size: 24px; font-weight: 700; color: var(--text); }
.pack-card .pack-per { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pack-badge {
  position: absolute;
  top: -1px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0 0 6px 6px;
  letter-spacing: .04em;
}
.pack-popular {
  border-color: rgba(139,92,246,.6) !important;
}
.pack-popular-badge {
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
  white-space: nowrap;
  letter-spacing: .04em;
}

.payment-methods { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.payment-method-btn {
  flex: 1;
  min-width: 140px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  transition: border-color .15s, background .15s, color .15s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.payment-method-btn:hover { border-color: var(--accent); background: rgba(139,92,246,.06); color: var(--text); }
.payment-method-btn.selected { border-color: var(--accent); background: rgba(139,92,246,.12); color: var(--accent-soft); }
.payment-method-btn .pm-icon { font-size: 22px; }

.demo-banner {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--warning);
  margin-bottom: 20px;
}

/* ── Dashboard ────────────────────────────────────────────────────────── */
.audios-table { width: 100%; border-collapse: collapse; }
.audios-table th, .audios-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.audios-table th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.audios-table tr:hover td { background: rgba(255,255,255,.02); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.status-queued    { background: rgba(107,107,126,.15); color: var(--text-muted); }
.status-processing{ background: rgba(245,158,11,.15);  color: var(--warning); }
.status-ready     { background: rgba(16,185,129,.15);  color: var(--success); }
.status-failed    { background: rgba(239,68,68,.15);   color: var(--error); }

/* ── Payment result ───────────────────────────────────────────────────── */
@keyframes pop-in {
  0%   { transform: scale(.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}
.result-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}
.result-card {
  text-align: center;
  max-width: 440px;
  padding: 48px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 24px;
}
.result-icon {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
  animation: pop-in .45s cubic-bezier(.34,1.56,.64,1) forwards;
}
.result-card h2 { font-size: 26px; margin-bottom: 12px; font-weight: 800; }
.result-card p { color: var(--text-2); margin-bottom: 28px; font-size: 15px; }

/* ── Mini player ──────────────────────────────────────────────────────── */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(22,22,31,.97);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 200;
}
.mini-player.hidden { display: none; }
.mini-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
  max-width: 260px;
}
.mini-player-icon { font-size: 20px; flex-shrink: 0; }
.mini-player-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-player-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.mini-player-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
#mini-audio { accent-color: var(--accent); }
@media (max-width: 600px) {
  .mini-player-info { max-width: 120px; }
}

/* ── Utilities ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* voice row two selects side by side on wider screens */
.voice-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 400px) {
  .voice-selects { grid-template-columns: 1fr; }
}

/* ── Language switcher ────────────────────────────────────────────────── */
.lang-select {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.lang-select:hover { border-color: var(--accent); color: var(--accent-soft); }
.lang-select option { background: var(--bg-card); color: var(--text); }

/* ── Home page ────────────────────────────────────────────────────────── */
@keyframes orb-pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(139,92,246,.2), inset 0 0 28px rgba(139,92,246,.05); }
  50%       { box-shadow: 0 0 70px rgba(139,92,246,.35), inset 0 0 40px rgba(139,92,246,.1); }
}
.home-hero {
  display: flex;
  justify-content: center;
  padding: 40px 0 28px;
}
.credits-orb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(139,92,246,.25), rgba(139,92,246,.06));
  border: 2px solid rgba(139,92,246,.4);
  animation: orb-pulse 3s ease-in-out infinite;
  gap: 4px;
  cursor: default;
  transition: transform .2s;
}
.credits-orb:hover { transform: scale(1.03); }
.credits-orb-num {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #A78BFA, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.credits-orb-label {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}
@media (max-width: 500px) {
  .home-actions { grid-template-columns: 1fr; }
}

.home-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--text-2);
  transition: border-color .15s, background .15s, color .15s, transform .15s;
  cursor: pointer;
}
.home-action-card:hover {
  border-color: var(--accent);
  background: rgba(139,92,246,.06);
  color: var(--text);
  transform: translateY(-2px);
}
.home-action-card.home-action-primary {
  border-color: rgba(139,92,246,.5);
  background: rgba(139,92,246,.08);
}
.home-action-card.home-action-primary:hover {
  background: rgba(139,92,246,.16);
  border-color: var(--accent);
}
.home-action-icon { font-size: 32px; }
.home-action-label {
  font-size: 15px;
  font-weight: 600;
  color: inherit;
}

.recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.recent-row:last-child { border-bottom: none; }
.recent-info { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.recent-date { font-size: 12px; color: var(--text-muted); }

/* ── Background tabs (noise / music) ─────────────────────────────────── */
.bg-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.bg-tab {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.bg-tab:hover {
  border-color: var(--accent);
  background: rgba(139,92,246,.08);
  color: var(--accent-soft);
}
.bg-tab.active {
  border-color: var(--accent);
  background: rgba(139,92,246,.15);
  color: var(--accent-soft);
}

/* ── Music upload area ────────────────────────────────────────────────── */
.music-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.music-upload-area:hover {
  border-color: var(--accent);
  background: rgba(139,92,246,.05);
}
.music-upload-area.music-ready {
  border-color: var(--success);
  background: rgba(16,185,129,.06);
  border-style: solid;
}
.music-upload-area.music-dragover {
  border-color: var(--accent);
  background: rgba(139,92,246,.08);
  border-style: solid;
}
.music-upload-icon { font-size: 28px; }
.music-upload-area span:last-child { font-size: 13px; color: var(--text-2); }

/* ── Admin / settings page ───────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.pill-demo {
  background: rgba(245,158,11,.15);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,.35);
}
.pill-live {
  background: rgba(16,185,129,.15);
  color: var(--success);
  border: 1px solid rgba(16,185,129,.35);
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.admin-guide {
  background: rgba(139,92,246,.06);
  border-color: rgba(139,92,246,.2);
}
.alert-success {
  background: rgba(16,185,129,.12);
  color: var(--success);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}

/* ── Recent audio name ───────────────────────────────────────────────── */
.recent-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* ── Admin stats grid ────────────────────────────────────────────────── */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 500px) {
  .admin-stats-grid { grid-template-columns: 1fr; }
}
.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  text-align: center;
}
.admin-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}
.admin-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Provider breakdown cards ────────────────────────────────────────── */
.provider-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.provider-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
}
.provider-stat-card .provider-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.provider-stat-card .provider-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.provider-stat-card .provider-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Chart range buttons ─────────────────────────────────────────────── */
.chart-range-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.chart-range-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chart-range-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ── Delete payment button ───────────────────────────────────────────── */
.delete-payment-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
  line-height: 1;
}
.delete-payment-btn:hover {
  color: var(--danger);
  background: rgba(239,68,68,.1);
}

.btn-delete-audio {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  line-height: 1;
  flex-shrink: 0;
}
.btn-delete-audio:hover {
  color: var(--error);
  background: rgba(239,68,68,.1);
}

/* ── Password show/hide ───────────────────────────────────────────────── */
.pw-field { position: relative; }
.pw-field .form-control { padding-right: 42px; }
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
  transition: color .15s;
  user-select: none;
}
.pw-toggle:hover { color: var(--accent-soft); }

/* ── Mobile responsive ────────────────────────────────────────────────── */

/* Scrollable table card */
.card-table { padding: 0; overflow: hidden; }

/* ── Hamburger button (hidden on desktop) ─────────────────────────────── */
.navbar-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 6px;
  border-radius: 6px;
  transition: background .25s cubic-bezier(.4,0,.2,1);
}
.navbar-hamburger:hover { background: rgba(139,92,246,.1); }
.navbar-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: background .25s, transform .25s cubic-bezier(.34,1.56,.64,1), width .25s cubic-bezier(.4,0,.2,1);
}
.navbar-hamburger:hover span { background: var(--accent-soft); }
.navbar-hamburger:hover span:nth-child(1) { transform: translateY(-1px) scaleX(1.08); }
.navbar-hamburger:hover span:nth-child(2) { transform: scaleX(.75); }
.navbar-hamburger:hover span:nth-child(3) { transform: translateY(1px) scaleX(1.08); }

/* ── Nav drawer overlay ───────────────────────────────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 149;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
}
.nav-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease, visibility 0s linear 0s;
}

/* ── Nav drawer ───────────────────────────────────────────────────────── */
.nav-drawer {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 150;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform .4s cubic-bezier(.34,1.05,.64,1);
  overflow-y: auto;
}
.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.nav-drawer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.nav-drawer-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.nav-drawer-close:hover { color: var(--text); border-color: var(--text-muted); }

.nav-drawer-credits {
  margin: 20px 20px 8px;
  padding: 16px;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 9px;
  text-align: center;
}
.nav-drawer-credits-num {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #A78BFA, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.nav-drawer-credits-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

.nav-drawer-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 12px;
  gap: 2px;
}
.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  text-align: left;
  transition: background .25s cubic-bezier(.4,0,.2,1),
              color .25s cubic-bezier(.4,0,.2,1),
              transform .25s cubic-bezier(.34,1.56,.64,1);
}
.nav-drawer-link:hover {
  background: rgba(139,92,246,.1);
  color: var(--accent-soft);
  transform: translateX(4px);
}
.nav-drawer-link-active {
  background: rgba(139,92,246,.15);
  color: var(--accent-soft);
  border-left: 3px solid var(--accent);
  transform: translateX(3px);
}
.nav-drawer-link-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.nav-drawer-link:hover .nav-drawer-link-icon { transform: scale(1.25); }
.nav-drawer-register {
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.3);
  color: var(--accent-soft);
  margin-top: 4px;
}
.nav-drawer-register:hover { background: rgba(139,92,246,.22); }
.nav-drawer-logout { color: var(--text-muted); }
.nav-drawer-logout:hover { background: rgba(239,68,68,.08); color: var(--error); }
.nav-drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.nav-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.nav-drawer-footer .lang-select { width: 100%; padding: 8px 12px; font-size: 14px; }

@media (max-width: 640px) {
  /* ─ Navbar ─────────────────────────────────────────────────────────── */
  .navbar { padding: 0 16px; }
  .navbar-hamburger { display: flex; }
  #nav-links-desktop { display: none; }
  .nav-drawer { display: flex; }

  /* ─ Prevent horizontal overflow ─────────────────────────────────────── */
  body { overflow-x: hidden; }

  /* ─ Page ────────────────────────────────────────────────────────────── */
  .page { padding: 20px 14px; }

  /* ─ Cards ───────────────────────────────────────────────────────────── */
  .card { padding: 18px; }
  .card-header { flex-wrap: wrap; gap: 8px; }

  /* ─ Scrollable tables ───────────────────────────────────────────────── */
  .card-table { overflow-x: auto; }
  .audios-table { min-width: 520px; }
  .audios-table th:nth-child(1),
  .audios-table td:nth-child(1) { display: none; }

  /* ─ Auth ────────────────────────────────────────────────────────────── */
  .auth-page { padding: 16px; align-items: flex-start; padding-top: 32px; }
  .auth-card { padding: 24px 18px; }

  /* ─ Landing hero ────────────────────────────────────────────────────── */
  .landing-hero { padding: 40px 16px 28px; }
  .landing-hero p { font-size: 15px; }
  .cta-group .btn { min-width: 130px; padding: 11px 18px; }

  /* ─ Features grid: 2 columnas en mobile ─────────────────────────────── */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 14px 28px;
    gap: 10px;
  }
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .landing-packs-grid { grid-template-columns: 1fr; }
  .how-section { padding: 0 14px 36px; }
  .landing-pricing-section { padding: 0 14px 36px; }
  .faq-section { padding: 0 14px 48px; }
  .faq-q { font-size: 14px; padding: 14px 16px; }

  /* ─ Generator ───────────────────────────────────────────────────────── */
  .generator-grid { grid-template-columns: 1fr; }
  .voice-selects { grid-template-columns: 1fr; }

  /* ─ Checkout ────────────────────────────────────────────────────────── */
  .packs-grid { grid-template-columns: 1fr; }
  .payment-methods { flex-direction: column; }
  .payment-method-btn { min-width: unset; }

  /* ─ Home ────────────────────────────────────────────────────────────── */
  .home-actions { grid-template-columns: 1fr; }
  .credits-orb { width: 160px; height: 160px; }
  .credits-orb-num { font-size: 44px; }

  /* ─ Mini player ─────────────────────────────────────────────────────── */
  .mini-player { padding: 0 10px; gap: 8px; height: 58px; }
  .mini-player-info { max-width: 80px; }

  /* ─ Admin stats ─────────────────────────────────────────────────────── */
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* ─ Result card ─────────────────────────────────────────────────────── */
  .result-card { padding: 36px 20px; margin: 16px; }
  .result-card h2 { font-size: 22px; }
}

/* ── Support / Chat ───────────────────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  line-height: 1.6;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.chat-bubble-user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble-admin {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-time {
  font-size: 11px;
  margin-top: 4px;
  opacity: .6;
}

.chat-bubble-user .chat-time { text-align: right; }

.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-textarea {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 12px;
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 38px;
  max-height: 120px;
  transition: border-color .2s;
}
.chat-textarea:focus { border-color: var(--accent); }

.chat-send-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  align-self: flex-end;
}

/* Admin support panel */
.support-thread-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.support-thread {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background .15s;
}

.support-thread:hover { background: rgba(139,92,246,.08); }
.support-thread.active { background: rgba(139,92,246,.15); }

.support-thread-email {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-thread-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.support-unread-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.admin-chat-panel {
  display: flex;
  gap: 16px;
  height: 500px;
}

.admin-chat-sidebar {
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}

.admin-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
}

.admin-chat-empty {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .chat-bubble { max-width: 90%; }
  .admin-chat-panel { flex-direction: column; height: auto; }
  .admin-chat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 12px; max-height: 200px; }
  .admin-chat-main { min-height: 300px; }
}
