/* ============================================================
   rearranger.ai — Warm Noir Design System
   Dark theme with warm gold accents
   ============================================================ */

/* ── 1. Reset + Design Tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #1A1A1A;
  --bg-tertiary: #141414;
  --bg-card: #1E1E1E;
  --text-primary: #F5F0EB;
  --text-secondary: #A8A29E;
  --text-muted: #6B6560;
  --accent: #C9A96E;
  --accent-hover: #D4B87D;
  --accent-dim: rgba(201,169,110,0.12);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.14);
  --green: #4ADE80;
  --green-dim: rgba(74,222,128,0.12);
  --amber: #FBBF24;
  --amber-dim: rgba(251,191,36,0.12);
  --red: #F87171;
  --red-dim: rgba(248,113,113,0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --font: 'Inter', system-ui, sans-serif;
}

/* ── 2. Base ── */
html {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  font-size: 14px;
  line-height: 1.5;
}
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* Focus visible for keyboard a11y */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.drop-zone:focus-visible { border-color: var(--accent); background: var(--accent-dim); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

.hidden { display: none !important; }

/* ── 3. Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: 14px;
  padding: 12px 28px;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent); color: var(--bg-primary);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}

.btn-danger {
  background: var(--red-dim); color: var(--red);
  border: none;
}
.btn-danger:hover { background: rgba(248,113,113,0.18); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn-loading {
  position: relative; color: transparent !important; pointer-events: none;
}
.btn-loading::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── 4. Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-primary); font-family: var(--font); font-size: 14px;
  transition: border-color .15s; outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { font-size: 12px; color: var(--red); }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent);
}

.form-input.error, .form-select.error { border-color: var(--red); }

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

/* ── 6. Alerts ── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px;
}
.alert-success { background: var(--green-dim); color: var(--green); }
.alert-warning { background: var(--amber-dim); color: var(--amber); }
.alert-error { background: var(--red-dim); color: var(--red); }

/* ── 7. Tables ── */
.table-wrap {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; }
.table th {
  background: var(--bg-secondary); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
  padding: 10px 16px; text-align: left;
}
.table td {
  padding: 12px 16px; font-size: 13px; color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
.table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── 8. Tabs ── */
.tab-bar {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
}
.tab-item {
  padding: 10px 20px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: color .15s;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: var(--font);
}
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active {
  color: var(--accent); border-bottom-color: var(--accent);
}

/* ── 9. Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer; transition: all .15s; background: transparent;
  font-family: var(--font);
}
.chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
.chip.active {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
}
.chip.chip-green { background: var(--green-dim); border-color: rgba(74,222,128,0.3); color: var(--green); }
.chip.chip-amber { background: var(--amber-dim); border-color: rgba(251,191,36,0.3); color: var(--amber); }
.chip.chip-red   { background: var(--red-dim);   border-color: rgba(248,113,113,0.3); color: var(--red); }

/* ── 10. Modals ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn .2s ease;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 520px; width: calc(100% - 40px);
  animation: modalIn .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── 11. Toasts ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 1100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: 13px; color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toastIn .2s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.toast-warning { border-left: 3px solid var(--amber); }
.toast.toast-error { border-left: 3px solid var(--red); }
.toast.toast-success { border-left: 3px solid var(--green); }

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

/* ── 12. Wizard / Stepper ── */
.wizard {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 16px 0;
}
.wizard-step {
  display: flex; align-items: center; gap: 10px;
  transition: opacity .2s;
}
.wizard-step:not(.active):not(.completed) { opacity: 0.45; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  border: 2px solid var(--border); color: var(--text-muted);
  transition: all .2s ease-out;
}
.step-label {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: color .2s;
}
.wizard-step.active .step-num {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201,169,110,0.1);
  font-weight: 700;
}
.wizard-step.active .step-label { color: var(--text-primary); font-weight: 600; }
.wizard-step.completed .step-num {
  background: var(--green-dim); border-color: var(--green); color: var(--green);
  cursor: pointer;
}
.wizard-step.completed .step-label { color: var(--green); }
.wizard-step.completed:hover .step-num {
  background: rgba(74,222,128,0.2); box-shadow: 0 0 0 3px rgba(74,222,128,0.1);
}
.step-divider {
  flex: 0 0 56px; height: 2px; border-radius: 1px;
  background: var(--border); margin: 0 14px;
  transition: background .2s ease-out;
}

/* ── Wizard panel fade transitions ── */
.wizard-panel {
  opacity: 0; transition: opacity .15s ease-out;
}
.wizard-panel-visible { opacity: 1; }

/* ── Review sticky action bar ── */
.review-action-bar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.review-action-bar-left {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); min-width: 0;
}
.review-action-bar-right {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* ── Drop zone format pills ── */
.drop-zone-formats {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px;
}
.format-pill {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 8px; font-size: 11px; color: var(--text-secondary);
}
.drop-zone-limit { font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.drop-zone-icon { color: var(--accent); margin-bottom: 14px; }

/* ── Processing icon pulse ── */
.processing-icon {
  margin: 0 auto 20px; width: 48px; height: 48px;
  animation: procPulse 2s ease-in-out infinite;
}
.processing-context {
  font-size: 13px; color: var(--text-muted); margin-bottom: 24px;
}
@keyframes procPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── 13. Skeleton / Loading ── */
.skeleton {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  position: relative; overflow: hidden;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--bg-tertiary) 50%, transparent 100%);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 14. Language Switcher ── */
.lang-switcher { position: relative; }
.lang-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px; min-width: 140px;
  z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.lang-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border-radius: 4px; cursor: pointer;
  transition: all .15s;
}
.lang-item:hover {
  color: var(--text-primary); background: rgba(255,255,255,0.04);
}
.lang-item.active { color: var(--accent); }

/* ── 15. Public Navbar ── */
.pub-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 60px;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-links a:not(.btn) {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: color .15s;
}
.nav-links a:not(.btn):hover { color: var(--text-primary); }
.nav-cta { /* use .btn .btn-primary .btn-sm on the element */ }

.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text-primary); padding: 8px;
}

.mobile-nav {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-primary); padding: 80px 32px 32px;
  display: flex; flex-direction: column; gap: 24px;
}
.mobile-nav a {
  font-size: 20px; font-weight: 600; color: var(--text-primary);
}
.mobile-nav .close-nav {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-primary);
  cursor: pointer; padding: 8px;
}

/* ── 16. App Shell ── */
.app-shell { display: flex; min-height: calc(100vh - 60px); }

/* Admin page — no pub-nav, sidebar starts at top */
.admin-page .app-sidebar { top: 0; }
.admin-page .app-shell { min-height: 100vh; }
.admin-page .app-topbar { top: 0; }
.admin-page .app-content { padding-top: 52px; }
.admin-page .panel { display: none; }
.admin-page .panel.active { display: block; }

/* Sidebar */
.app-sidebar {
  width: 260px; background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed;
  top: 60px; bottom: 0; left: 0; z-index: 50;
  overflow-y: auto;
}

/* When sidebar is injected on public pages, shift all page content right */
body.has-sidebar > .section,
body.has-sidebar > section,
body.has-sidebar > footer { margin-left: 260px; }
body.has-sidebar > .pub-nav { z-index: 100; }
.sb-logo {
  padding: 20px 20px 16px; font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}
.sb-logo span { color: var(--accent); }
.sb-section {
  padding: 16px 20px 6px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted);
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); transition: all .15s; cursor: pointer;
  text-decoration: none;
}
.sb-item:hover { background: rgba(255,255,255,0.04); }
.sb-item.active {
  background: var(--accent-dim); color: var(--accent);
}
.sb-item i, .sb-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sb-footer {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  overflow: hidden;
}
.sb-footer > div { min-width: 0; overflow: hidden; }
.sb-user-name, .sb-user-plan { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sb-user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.sb-user-plan { font-size: 11px; color: var(--text-muted); }

/* Topbar */
.app-topbar {
  position: sticky; top: 60px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 52px;
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 15px; font-weight: 600; }
.app-topbar-title { font-size: 15px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* App main (pages using app-main instead of app-content) */
.app-main { margin-left: 260px; flex: 1; min-height: 100vh; }

/* Content area */
.app-content {
  margin-left: 260px; flex: 1; padding: 32px;
  min-height: 100vh;
}
.app-main .app-content {
  margin-left: 0;
}

/* ── 17. Auth Pages ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary); padding: 20px;
}
.auth-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  width: 100%; max-width: 420px;
}
.auth-card .logo {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  text-align: center; margin-bottom: 32px;
}
.auth-card .logo span { color: var(--accent); }
.auth-card h1 {
  font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px;
}
.auth-card .subtitle {
  font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 28px;
}
.auth-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 24px 0; color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 12px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-primary); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s; font-family: var(--font);
}
.google-btn:hover {
  border-color: var(--border-hover); background: rgba(255,255,255,0.04);
}
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .auth-link {
  display: block; text-align: center; margin-top: 20px;
  font-size: 13px; color: var(--text-muted);
}
.auth-card .auth-link a { color: var(--accent); font-weight: 500; }
.auth-card .auth-link a:hover { color: var(--accent-hover); }

/* ── 18. Section / Layout Utilities ── */
.section { padding: 80px 0; }
.section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent); margin-bottom: 10px;
}
.section-title {
  font-size: clamp(28px, 4vw, 40px); font-weight: 700;
  letter-spacing: -0.5px; margin-bottom: 48px;
}
.section-sub {
  font-size: 15px; color: var(--text-secondary); max-width: 520px;
  line-height: 1.6; margin-bottom: 24px;
}
.container {
  max-width: 1100px; margin: 0 auto; padding: 0 48px;
}
.container-sm {
  max-width: 780px; margin: 0 auto; padding: 0 48px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── 19. Pricing ── */
.pricing-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.pricing-card {
  background: var(--bg-card); padding: 32px;
  display: flex; flex-direction: column;
}
.pricing-card.featured { background: var(--bg-tertiary); }
.pricing-card .tier-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--accent);
  background: var(--accent-dim); padding: 4px 10px;
  border-radius: 20px; display: inline-block; margin-bottom: 12px;
  width: fit-content;
}
.pricing-card .tier-name {
  font-size: 18px; font-weight: 700; margin-bottom: 4px;
}
.pricing-card .tier-price {
  font-size: 36px; font-weight: 800; margin-bottom: 4px;
}
.pricing-card .tier-price span {
  font-size: 14px; font-weight: 400; color: var(--text-muted);
}
.pricing-card .tier-desc {
  font-size: 13px; color: var(--text-muted); margin-bottom: 24px;
}
.pricing-card .tier-features {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 24px; flex: 1;
}
.pricing-card .tier-features li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.pricing-card .tier-features li i,
.pricing-card .tier-features li svg {
  width: 14px; height: 14px; color: var(--accent); flex-shrink: 0;
}

/* Pricing page — alternate class names */
.pricing-tier { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pricing-price { font-size: 36px; font-weight: 800; margin-bottom: 4px; }
.pricing-price sup { font-size: 18px; font-weight: 500; vertical-align: super; }
.pricing-period { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.pricing-features {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 24px; flex: 1; padding: 0;
}
.pricing-features li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.pricing-features li::before {
  content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0;
}
.pricing-features li.na { color: var(--text-muted); opacity: 0.5; }
.pricing-features li.na::before { content: '—'; color: var(--text-muted); }

/* Toggle switch (billing period) */
.toggle-wrap {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  margin-bottom: 48px; font-size: 14px; font-weight: 500; color: var(--text-secondary);
}
.toggle-switch { position: relative; width: 44px; height: 24px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border-hover); border-radius: 100px;
  cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.annual-badge {
  background: var(--green-dim); color: var(--green); border: 1px solid rgba(74,222,128,0.3);
  border-radius: 100px; padding: 2px 9px; font-size: 12px; font-weight: 700;
}

/* Comparison table */
.compare-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow-x: auto; margin-top: 48px;
}
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-table th {
  padding: 12px 16px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); background: var(--bg-secondary);
  border-bottom: 1px solid var(--border); text-align: center;
}
.compare-table th:first-child { text-align: left; }
.compare-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  text-align: center; color: var(--text-secondary);
}
.compare-table td:first-child { text-align: left; }
.compare-table td.check { color: var(--green); font-weight: 600; }
.compare-table td.dash { color: var(--text-muted); }
.compare-table td.highlight {
  background: var(--accent-dim); color: var(--accent); font-weight: 600;
}

/* Credit packs */
.credits-section { margin-top: 64px; }
.pack-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.pack-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center;
}
.pack-card.best { border-color: var(--accent); }
.pack-credits { font-size: 42px; font-weight: 800; color: var(--text-primary); }
.pack-price { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.pack-per { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* FAQ section */
.faq-section { margin-top: 64px; }
.faq-category { margin-bottom: 40px; }
.faq-category-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.faq-category-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* Accordion chevron (text-based fallback) */
.accordion-chevron {
  font-size: 18px; color: var(--text-muted); transition: transform .2s;
  line-height: 1;
}
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-question { flex: 1; }
.accordion-body {
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
  padding: 0 20px; font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}
.accordion-item.open .accordion-body { max-height: 300px; padding-bottom: 20px; }

/* Button variants */
.btn-dark {
  background: var(--text-primary); color: var(--bg-primary);
  border: 1px solid var(--text-primary);
}
.btn-dark:hover { background: #E5E0DB; }
.btn-xl { padding: 14px 32px; font-size: 16px; font-weight: 600; }

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

/* ── 20. Feature Grid ── */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.feature-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon i, .feature-icon svg {
  width: 20px; height: 20px; color: var(--accent);
}
.feature h3 {
  font-size: 15px; font-weight: 600; margin-bottom: 6px;
}
.feature p {
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}

/* ── 21. Hero / Video ── */
.hero {
  position: relative; min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-video-wrap {
  position: absolute; inset: 0; z-index: 0;
}
.hero-video {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: rgba(10,10,10,0.7);
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center; max-width: 620px; padding: 40px 20px;
}
.hero-title {
  font-size: clamp(34px, 5vw, 52px); font-weight: 800;
  letter-spacing: -1.5px; margin-bottom: 12px;
}
.hero-sub {
  font-size: 15px; color: var(--text-secondary); margin-bottom: 32px;
}
.hero-formats {
  font-size: 12px; color: var(--text-muted); margin-top: 16px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 48px 32px; text-align: center;
  transition: all .15s; cursor: pointer;
}
.drop-zone.dragover, .drop-zone:hover {
  border-color: var(--accent); background: var(--accent-dim);
}
.drop-zone.error { border-color: var(--red); }
.drop-icon {
  width: 40px; height: 40px; color: var(--text-muted);
  margin: 0 auto 12px;
}
.drop-text {
  font-size: 14px; color: var(--text-secondary);
}
.drop-browse {
  background: none; border: none; color: var(--accent);
  font-weight: 600; cursor: pointer; font-family: var(--font);
  font-size: 14px; text-decoration: underline;
}
.drop-browse:hover { color: var(--accent-hover); }
.drop-error {
  font-size: 13px; color: var(--red); margin-top: 10px;
}

/* ── 22. Batch Operations ── */
.floating-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 80;
  animation: floatUp .2s ease;
}
@keyframes floatUp {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.floating-bar span {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap;
}

.conv-check {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}

/* ── 23. Accordion ── */
.accordion-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-primary); background: none; border: none;
  width: 100%; text-align: left; font-family: var(--font);
  transition: color .15s;
}
.accordion-header:hover { color: var(--accent); }
.accordion-header i, .accordion-header svg {
  width: 16px; height: 16px; color: var(--text-muted);
  transition: transform .2s;
}
.accordion-item.open .accordion-header i,
.accordion-item.open .accordion-header svg { transform: rotate(180deg); }
.accordion-body {
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
}
.accordion-body-inner {
  padding: 0 20px 20px; font-size: 13px; color: var(--text-secondary);
  line-height: 1.6;
}

/* ── 24. Responsive ── */
@media (max-width: 900px) {
  .pub-nav { padding: 0 20px; }
  .nav-links { display: none; }
  .hamburger { display: block; }
  .container { padding: 0 20px; }

  .app-sidebar { display: none; }
  .app-sidebar.open { display: flex; }
  .app-content { margin-left: 0; padding: 20px; }
  .app-main { margin-left: 0; }
  .app-topbar { padding: 0 20px; top: 60px; }
  .app-topbar .hamburger { display: block; }
  body.has-sidebar > .section,
  body.has-sidebar > section,
  body.has-sidebar > footer { margin-left: 0; }

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

@media (max-width: 600px) {
  .section { padding: 48px 0; }
  .section-title { margin-bottom: 32px; }

  .pricing-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }

  .hero { min-height: 70vh; }
  .hero-content { padding: 32px 16px; }

  .auth-card { padding: 28px 20px; }
  .modal { padding: 24px; }

  .wizard .step-label { font-size: 11px; }
  .step-num { width: 28px; height: 28px; font-size: 12px; }
  .step-divider { flex: 0 0 24px; margin: 0 6px; }
  .wizard-step { gap: 6px; }
  .review-action-bar { padding: 8px 12px; }
  .review-action-bar-left { font-size: 12px; }

  .footer .container { flex-direction: column; gap: 12px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }

  .floating-bar { left: 16px; right: 16px; transform: none; }
}

/* ── 25. Accessibility ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Footer ── */
.footer { padding: 32px 0; border-top: 1px solid var(--border); }
.footer .container { display: flex; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--text-muted); transition: color .15s; }
.footer-links a:hover { color: var(--text-secondary); }
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 20px; gap: 12px;
  text-align: center;
}
.empty-state h3 { font-size: 18px; font-weight: 600; }
.empty-state p { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }

/* ── How It Works Steps ── */
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.step-card {
  text-align: center; padding: 32px 24px;
}
.step-card .step-number {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; margin: 0 auto 16px;
}
.step-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.step-card p { font-size: 13px; color: var(--text-secondary); }

/* ── How It Works — Steps List (vertical timeline) ── */
.steps-list {
  display: flex; flex-direction: column; gap: 0;
  position: relative; padding-left: 32px;
}
.steps-list::before {
  content: ''; position: absolute; left: 19px; top: 28px; bottom: 28px;
  width: 2px; background: var(--border);
}
.step-item {
  display: flex; gap: 20px; padding: 20px 0; position: relative;
}
.step-item .step-num {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  background: var(--accent-dim); color: var(--accent);
  border: 2px solid var(--accent); position: relative; z-index: 1;
  margin-left: -32px;
}
.step-content { flex: 1; }
.step-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.step-body { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ── How It Works — Pass Grid ── */
.pass-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.pass-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px 24px;
}
.pass-num {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); margin-bottom: 8px;
}
.pass-name { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); }
.pass-body { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ── How It Works — Confidence Examples ── */
.conf-example {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.conf-eg {
  display: flex; gap: 14px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; flex: 1; min-width: 200px;
}
.conf-eg-pct { font-size: 28px; font-weight: 800; flex-shrink: 0; }
.conf-eg-lbl { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

@media (max-width: 768px) {
  .pass-grid { grid-template-columns: 1fr; }
  .conf-example { flex-direction: column; }
}

/* ── Tutorials ── */
.tut-section { margin-bottom: 56px; }
.tut-section:last-child { margin-bottom: 0; }
.tut-section-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.tut-section-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }

.video-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.video-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.video-card:hover {
  border-color: var(--accent); box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.video-thumb {
  position: relative; overflow: hidden; border-radius: 12px 12px 0 0;
}
.duration-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.75); color: white; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
}
.video-info { padding: 16px; }
.video-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); line-height: 1.4; }
.video-badges { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* ── CTA Band ── */
.cta-band {
  background: var(--bg-secondary); padding: 64px 40px; text-align: center;
}
.cta-band-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.cta-band-sub { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; }
.cta-band-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Quality Badges (converter) ── */
.q-maj { color: var(--green); }
.q-min { color: var(--amber); }
.q-sev { color: var(--red); }

/* ── Status Colors ── */
.status-complete { color: var(--green); }
.status-processing { color: var(--amber); }
.status-failed { color: var(--red); }
.status-pending { color: var(--text-muted); }

/* ── Meter / Progress ── */
.meter {
  height: 6px; background: var(--border); border-radius: 3px;
  overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 3px; background: var(--accent);
  transition: width .3s ease;
}

/* ── Credit Pack Grid ── */
.credit-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 600px) {
  .credit-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
}

/* ── Utility classes ── */
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 12px; }
.btn-xs  { padding: 5px 10px;  font-size: 12px; }
.btn-md  { padding: 10px 20px; font-size: 14px; }

/* ── Tab panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Pills / badges ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.pill-blue   { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(201,169,110,0.3); }
.pill-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(74,222,128,0.3); }
.pill-amber  { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(251,191,36,0.3); }
.pill-red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(248,113,113,0.3); }
.pill-gray   { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }
.pill-dark   { background: var(--bg-primary); color: var(--text-primary); }
.pill-warn   { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(251,191,36,0.3); }

/* ── Alert ── */
.alert-info {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(201,169,110,0.25); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px;
}

/* ── Note chip ── */
.note-chip {
  display: inline-block; background: var(--bg-secondary); color: var(--text-primary);
  border-radius: 4px; padding: 2px 6px; font-size: 11.5px; font-family: monospace;
  font-weight: 600; white-space: nowrap;
}

/* ── Drop zone details ── */
.drop-zone-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.drop-zone-sub   { font-size: 13.5px; color: var(--text-muted); }

/* ── Progress bar ── */
.progress-bar-wrap { background: var(--border); border-radius: 100px; overflow: hidden; height: 8px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--accent)); border-radius: 100px; transition: width .5s ease; }

/* ── Processing step ── */
.processing-wrap   { text-align: center; padding: 48px 24px; }
.processing-status { font-size: 16px; font-weight: 500; color: var(--text-primary); margin: 20px 0 8px; }
.processing-sub    { font-size: 13.5px; color: var(--text-muted); margin-bottom: 24px; }


/* ── Empty state ── */
.empty      { text-align: center; padding: 56px 32px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }

/* ── Table header ── */
.table-header {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Review sections ── */
.review-section       { margin-bottom: 28px; }
.review-section-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* ── Category tabs (level 1) ── */
.cat-tab-bar {
  display: flex; gap: 0; flex-wrap: wrap;
  border-bottom: 2px solid var(--border); margin-bottom: 16px;
}
.cat-tab {
  padding: 9px 20px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; cursor: pointer; transition: color .12s, border-color .12s;
  white-space: nowrap; letter-spacing: .01em;
}
.cat-tab:hover  { color: var(--text-primary); }
.cat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.cat-tab.absent { color: var(--text-muted); opacity: 0.38; cursor: not-allowed; }
.cat-tab.absent:hover { color: var(--text-muted); border-bottom-color: transparent; }
.cat-panel        { display: none; }
.cat-panel.active { display: block; }

/* ── Slot chips (level 2) ── */
.slot-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.slot-chip {
  padding: 5px 14px; font-size: 12px; font-weight: 500;
  border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; transition: all .1s;
}
.slot-chip:hover  { border-color: var(--accent); color: var(--accent); }
.slot-chip.active { background: var(--accent); border-color: var(--accent); color: #0A0A0A; font-weight: 600; }
.slot-chip.absent { opacity: 0.38; cursor: not-allowed; }
.slot-chip.absent:hover { border-color: var(--border); color: var(--text-muted); background: var(--bg-card); }
.cat-slot-panel        { display: none; }
.cat-slot-panel.active { display: block; }

/* ── Quality tabs (level 3) ── */
.quality-tab-row {
  display: flex; gap: 6px; margin-bottom: 16px;
}
.quality-tab {
  padding: 4px 14px; font-size: 12px; font-weight: 600; border-radius: 4px;
  border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; transition: all .1s;
}
.quality-tab:hover { border-color: var(--text-secondary); color: var(--text-secondary); }
.quality-tab.maj.active { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.4); color: #93C5FD; }
.quality-tab.min.active { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.4); color: #C4B5FD; }
.quality-tab.sev.active { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.4); color: #FBBF24; }
.quality-panel        { display: none; }
.quality-panel.active { display: block; }

.quality-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
}
.quality-maj { background: rgba(59,130,246,0.15); color: #93C5FD; }
.quality-min { background: rgba(139,92,246,0.15); color: #C4B5FD; }
.quality-sev { background: rgba(251,191,36,0.15); color: #FBBF24; }

/* ── Section key card ── */
.section-key-card {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px 24px; margin-bottom: 20px;
}
.section-key-big {
  font-size: 48px; line-height: 1; font-weight: 700;
  color: var(--text-primary); min-width: 60px; text-align: center;
}
.section-key-meta     { flex: 1; }
.section-key-meta-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }

/* ── Channel assignments ── */
.ch-assignments-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 10px;
}
.acc-toggle {
  display: inline-flex; border: 1.5px solid var(--border); border-radius: 6px;
  overflow: hidden; margin-bottom: 14px;
}
.acc-toggle-btn {
  padding: 5px 14px; font-size: 12px; font-weight: 500; background: none;
  border: none; color: var(--text-muted); cursor: pointer; transition: all .12s;
}
.acc-toggle-btn.active { background: var(--accent); color: #0A0A0A; font-weight: 600; }

/* ── Channel rows ── */
.channel-list {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: visible;
}
.channel-list > .ch-row:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.channel-list > .ch-row:last-child  { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.ch-row {
  display: grid; grid-template-columns: 36px 160px 1fr;
  gap: 8px; padding: 9px 14px; align-items: center;
  font-size: 13px; border-bottom: 1px solid var(--border); background: var(--bg-card);
}
.ch-row:last-child { border-bottom: none; }
.ch-row:hover      { background: var(--bg-secondary); }
.ch-row.drums-row  { background: var(--bg-tertiary); }
.ch-icon { font-size: 15px; text-align: center; }
.ch-name { font-weight: 500; color: var(--text-primary); }
.ch-key  { color: var(--text-muted); font-size: 12.5px; }

/* ── Drum table ── */
.drum-col-heads {
  display: grid;
  grid-template-columns: 52px 52px 170px 24px 52px 52px 170px 1fr;
  gap: 6px; padding: 9px 14px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); background: var(--bg-secondary);
}
.drum-row-new {
  display: grid;
  grid-template-columns: 52px 52px 170px 24px 52px 52px 170px 1fr;
  gap: 6px; padding: 9px 14px;
  align-items: center; font-size: 12.5px; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.drum-row-new:last-child { border-bottom: none; }
.drum-row-new:hover      { background: var(--bg-secondary); }
.arrow-cell { color: var(--text-muted); text-align: center; font-size: 12px; }

select.map-sel {
  font-size: 12px; padding: 4px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary);
  max-width: 100%;
}
select.map-sel:focus   { outline: none; border-color: var(--accent); }
select.map-sel.flagged { border-color: var(--amber); background: var(--amber-dim); }

/* ── Channel tooltips ── */
.ch-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text-muted); font-size: 11px; font-weight: 600;
  cursor: help; position: relative; flex-shrink: 0;
}
.ch-info-btn:hover { border-color: var(--accent); color: var(--accent); }
.ch-info-btn .ch-tooltip {
  display: none; position: absolute; top: calc(100% + 8px); right: -8px;
  width: 240px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  font-size: 12px; font-weight: 400; line-height: 1.5;
  color: var(--text-secondary); z-index: 100; text-align: left;
  pointer-events: none;
}
.ch-info-btn:hover .ch-tooltip { display: block; }
.ch-tooltip dt { font-weight: 600; color: var(--text-primary); margin-top: 6px; }
.ch-tooltip dt:first-child { margin-top: 0; }
.ch-tooltip dd { margin: 0 0 2px; }

.ch-flag-pill { cursor: help; position: relative; }
.ch-flag-pill .ch-tooltip {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); width: 220px; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--bg-card);
  border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  font-size: 12px; font-weight: 400; line-height: 1.4;
  color: var(--text-secondary); z-index: 100; text-align: left;
  white-space: normal; pointer-events: none;
}
.ch-flag-pill:hover .ch-tooltip { display: block; }

/* ── Language switcher dropdown ── */
.lang-option {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; font-size: 13px; font-weight: 500;
  color: var(--text-primary); background: none; border: none;
  border-radius: 4px; cursor: pointer; transition: all .15s;
}
.lang-option:hover  { background: rgba(255,255,255,0.06); color: var(--accent); }
.lang-option.active { color: var(--accent); font-weight: 600; }

/* ── My Conversions table ── */
.conv-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.conv-select-all { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.conv-actions-bar {
  display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap;
}
.conv-row-head {
  display: grid;
  grid-template-columns: 36px 1fr 110px 130px 200px 240px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.conv-row {
  display: grid;
  grid-template-columns: 36px 1fr 110px 130px 200px 240px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.conv-row:hover { background: var(--bg-secondary); }
.conv-cell { padding: 10px 14px; font-size: 13px; }
.conv-head-cell {
  padding: 9px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
}
.conv-filename { font-weight: 500; color: var(--text-primary); }
.conv-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.pager {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; font-size: 13px; color: var(--text-muted);
}

@media (max-width: 900px) {
  .conv-row, .conv-row-head {
    grid-template-columns: 36px 1fr 110px 130px 180px;
  }
  .conv-cell:nth-child(5), .conv-head-cell:nth-child(5) { display: none; }
  .app-main { margin-left: 0; }
}
@media (max-width: 640px) {
  .conv-row, .conv-row-head {
    grid-template-columns: 36px 1fr 110px 180px;
  }
  .conv-cell:nth-child(4), .conv-head-cell:nth-child(4) { display: none; }
}

/* ── Drum Map Editor ── */

/* Split-panel layout */
.dm-split { flex: 1; display: flex; overflow: hidden; }
.dm-left {
  width: 256px; flex-shrink: 0; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card);
}
.dm-left-btns { padding: 12px; display: flex; flex-direction: column; gap: 7px; border-bottom: 1px solid var(--border); }
.dm-left-scroll { flex: 1; overflow-y: auto; }
.dm-right { flex: 1; overflow: auto; display: flex; flex-direction: column; }

/* Map list items */
.map-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; cursor: pointer; transition: background .1s;
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary);
}
.map-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.map-item.active { background: var(--accent-dim); color: var(--accent); }
.map-item-icon { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.map-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.map-item-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 100px;
  background: var(--amber-dim); color: var(--amber);
}
/* ── Admin sidebar ────────────────────── */
.app-sb-top {
  padding: 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.app-sb-logo {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.sb-logo-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}
.admin-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 100px;
  background: var(--accent-dim); color: var(--accent);
}
.app-sb-section {
  padding: 14px 14px 6px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted);
}
.app-sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  font-family: var(--font); transition: background .15s;
}
.app-sb-item:hover { background: rgba(255,255,255,0.04); }
.app-sb-item.active { background: var(--accent-dim); color: var(--accent); }
.app-sb-item i, .app-sb-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.app-sb-icon { display: flex; align-items: center; justify-content: center; width: 16px; flex-shrink: 0; }
.app-sb-item.coming { opacity: 0.4; cursor: default; }
.coming-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 100px; margin-left: auto;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
}
.app-sb-footer {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.app-sb-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.app-sb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.app-sb-user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.app-sb-user-email { font-size: 11px; color: var(--text-muted); }
.app-sb-logout {
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  padding: 6px 0; transition: color .15s;
}
.app-sb-logout:hover { color: var(--text-primary); }

/* ── Admin dashboard ─────────────────── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.kpi-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.kpi-icon-wrap i, .kpi-icon-wrap svg { width: 18px; height: 18px; }
.kpi-icon-wrap.blue   { background: rgba(59,130,246,0.12); color: #3b82f6; }
.kpi-icon-wrap.green  { background: rgba(34,197,94,0.12);  color: #22c55e; }
.kpi-icon-wrap.amber  { background: rgba(251,191,36,0.12); color: #fbbf24; }
.kpi-icon-wrap.purple { background: rgba(168,85,247,0.12); color: #a855f7; }
.kpi-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.kpi-delta { font-size: 12px; color: var(--green); margin-top: 4px; }
.kpi-delta.down { color: var(--red); }

.dash-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px;
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
}
.table-title { font-size: 15px; font-weight: 600; }
.table-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.activity-feed { padding: 16px 20px; }
.activity-item {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0;
}
.activity-dot.green  { background: var(--green); }
.activity-dot.blue   { background: #3b82f6; }
.activity-dot.amber  { background: var(--amber); }
.activity-dot.purple { background: #a855f7; }
.activity-time { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.plan-dist { padding: 16px 20px; }
.plan-bar {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.plan-bar-seg {
  height: 8px; border-radius: 4px; min-width: 4px;
}
.plan-legend {
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted);
}
.plan-legend-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
}

/* Admin tables & filters */
.admin-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 10px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  text-align: left; border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border);
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px; font-size: 13px; color: var(--text-muted);
}

/* Admin page header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Stats row */
.stats-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}

/* User search & filters */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-wrap {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 10px; color: var(--text-muted); pointer-events: none;
  display: flex; align-items: center;
}
.search-icon svg, .search-icon i { width: 14px; height: 14px; }
.search-input {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 13px; padding: 7px 12px 7px 32px;
  font-family: var(--font); outline: none; min-width: 200px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }
.form-select-sm {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 12px; padding: 7px 10px;
  font-family: var(--font); outline: none; cursor: pointer;
}
.form-select-sm:focus { border-color: var(--accent); }

/* Bulk action bar */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 14px;
}
.bulk-bar.hidden { display: none; }
.bulk-count { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-right: 8px; }
.btn-bulk {
  font-size: 12px; padding: 5px 12px; border-radius: var(--radius);
  cursor: pointer; border: 1px solid var(--border); font-family: var(--font);
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-bulk-white { background: var(--bg-card); color: var(--text-primary); }
.btn-bulk-white:hover { background: var(--bg-secondary); }
.btn-bulk-danger { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.2); }
.btn-bulk-danger:hover { background: rgba(239,68,68,0.2); }

/* Table footer */
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* Entry table */
.col-heads, .entry-row {
  display: grid;
  grid-template-columns: 72px 150px 150px 28px 200px 90px 80px 60px;
  gap: 8px; padding: 9px 20px; align-items: center;
}
.col-heads {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.entry-row {
  font-size: 13px; border-bottom: 1px solid var(--border); transition: background .1s;
}
.entry-row:last-child { border-bottom: none; }
.entry-row:hover { background: var(--bg-secondary); }
.entry-row.flagged { background: var(--amber-dim); }
.entry-row.flagged:hover { background: rgba(251,191,36,0.18); }
.row-actions { display: flex; gap: 4px; }

/* Stats strip */
.stats-strip {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.stat-chip {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 14px;
  display: flex; align-items: center; gap: 9px;
}
.stat-num { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-lbl { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }

/* Table header bar */
.table-bar {
  padding: 10px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: var(--bg-card); position: sticky; top: 0; z-index: 10;
}

/* Filter buttons */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 12px; border-radius: 100px; font-size: 12.5px; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--bg-card); cursor: pointer;
  color: var(--text-secondary); transition: all .12s; font-family: var(--font);
}
.filter-btn:hover        { border-color: var(--accent); color: var(--accent); }
.filter-btn.active       { background: var(--accent); border-color: var(--accent); color: #0A0A0A; }
.filter-btn.amber.active { background: var(--amber); border-color: var(--amber); color: #0A0A0A; }

/* Topbar pills & actions */
.topbar-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.dm-topbar-actions { display: flex; gap: 8px; align-items: center; }

/* Import preview table */
.preview-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: auto; max-height: 220px; margin-top: 10px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.preview-table th {
  padding: 6px 10px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  font-weight: 700; text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); white-space: nowrap;
}
.preview-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
.preview-table tr:last-child td { border-bottom: none; }
.preview-error { color: var(--red); font-size: 12px; }

/* Import drop zone */
.import-drop {
  border: 2px dashed var(--border-hover); border-radius: var(--radius-sm);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: all .15s; background: var(--bg-secondary);
}
.import-drop:hover, .import-drop.dragover { border-color: var(--accent); background: var(--accent-dim); }
.import-drop input { display: none; }

/* ── Batch Upload List ── */
.batch-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.batch-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.batch-header a { font-size: 13px; color: var(--text-muted); cursor: pointer; }
.batch-header a:hover { color: var(--text-primary); }

.batch-global-target {
  margin-bottom: 16px;
}

.batch-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.batch-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.batch-table td {
  padding: 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.batch-table tr.invalid td { opacity: 0.5; }
.batch-table .batch-file-name {
  font-weight: 500; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.batch-table .batch-file-size { color: var(--text-muted); white-space: nowrap; }
.batch-table .batch-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 4px 8px;
}
.batch-table .batch-remove:hover { color: var(--red, #e53e3e); }
.batch-table .batch-error {
  font-size: 11px; color: var(--red, #e53e3e); margin-top: 2px;
}

.batch-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; gap: 12px; flex-wrap: wrap;
}
.batch-footer .batch-quota { font-size: 12.5px; color: var(--text-muted); }
.batch-footer .batch-quota.warning { color: var(--amber, #d69e2e); }

/* ── Cookie consent banner ───────────────── */
.cookie-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 9998; pointer-events: none;
}
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 20px 28px; display: flex; align-items: center; gap: 20px;
}
.cookie-icon { font-size: 28px; flex-shrink: 0; }
.cookie-text { flex: 1; }
.cookie-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cookie-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.cookie-desc a { color: var(--accent); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-category { padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.cookie-category:last-of-type { border-bottom: none; }
.cookie-cat-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cookie-cat-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cookie-cat-desc { font-size: 12.5px; color: var(--text-muted); }
.cookie-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.cookie-toggle input { opacity: 0; width: 0; height: 0; }
.cookie-slider {
  position: absolute; inset: 0; background: rgba(255,255,255,0.1);
  border-radius: 11px; cursor: pointer; transition: 0.15s;
}
.cookie-slider:before {
  content: ""; position: absolute; width: 16px; height: 16px;
  left: 3px; bottom: 3px; background: var(--text-muted);
  border-radius: 50%; transition: 0.15s;
}
.cookie-toggle input:checked + .cookie-slider { background: rgba(201,169,110,0.4); }
.cookie-toggle input:checked + .cookie-slider:before { transform: translateX(18px); background: var(--accent); }

/* ── Account page ────────────────────────── */
.account-layout {
  display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px);
}
.account-sidebar {
  display: flex; flex-direction: column;
  background: #0F0F0F; border-right: 1px solid var(--border); padding: 24px 0;
}
.account-sidebar .sb-title { padding: 12px 24px 20px; font-size: 15px; font-weight: 600; }
.account-sidebar .sb-item {
  padding: 10px 24px; font-size: 13.5px; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; gap: 10px; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font);
}
.account-sidebar .sb-item:hover { color: var(--text-primary); }
.account-sidebar .sb-item.active {
  color: var(--accent); background: rgba(201,169,110,0.08);
  border-right: 2px solid var(--accent);
}
.account-content { padding: 32px; overflow-y: auto; }
.account-tab { display: none; }
.account-tab.active { display: block; }

/* Account page sections */
.account-section { margin-bottom: 32px; }
.account-section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.account-section-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* Avatar */
.avatar-circle {
  width: 72px; height: 72px; border-radius: 50%; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 600; color: var(--accent); overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

/* Form grid for account page */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .form-group.full { grid-column: 1 / -1; }

/* Usage bar */
.usage-bar-wrap { margin: 12px 0; }
.usage-bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.usage-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.usage-bar-fill.green { background: var(--green); }
.usage-bar-fill.amber { background: var(--amber); }
.usage-bar-fill.red { background: var(--red); }

/* Credit packs grid */
.credit-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0; }
.credit-pack {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer; transition: 0.15s;
}
.credit-pack:hover { border-color: var(--accent); }
.credit-pack .pack-credits { font-size: 24px; font-weight: 700; color: var(--accent); }
.credit-pack .pack-price { font-size: 14px; margin-top: 4px; }
.credit-pack .pack-unit { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.credit-pack .pack-badge {
  display: inline-block; margin-top: 8px; padding: 2px 8px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  background: var(--accent-dim); color: var(--accent); border-radius: 4px;
}

/* Plan cards grid */
.plan-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 16px 0; }
.plan-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer; transition: 0.15s; position: relative;
}
.plan-card:hover { border-color: var(--border-hover); }
.plan-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-card.current::after {
  content: "Current"; position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  background: var(--accent-dim); color: var(--accent); padding: 2px 8px; border-radius: 4px;
}
.plan-card .plan-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.plan-card .plan-price { font-size: 24px; font-weight: 700; color: var(--accent); }
.plan-card .plan-period { font-size: 12px; color: var(--text-muted); }
.plan-card .plan-quota { font-size: 13px; margin-top: 8px; color: var(--text-secondary); }

/* Consent toggle rows */
.consent-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.consent-row:last-child { border-bottom: none; }
.consent-label { font-size: 13.5px; }
.consent-label .consent-note { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* Danger zone */
.danger-zone {
  background: rgba(248,113,113,0.04); border: 1px solid rgba(248,113,113,0.15);
  border-radius: var(--radius); padding: 24px;
}
.danger-zone .danger-title { font-size: 15px; font-weight: 600; color: var(--red); margin-bottom: 6px; }
.danger-zone .danger-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
.btn-danger {
  background: transparent; color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: 0.15s;
}
.btn-danger:hover { background: var(--red-dim); }

/* Billing period toggle */
.period-toggle {
  display: inline-flex; background: var(--bg-secondary); border-radius: var(--radius-sm);
  padding: 3px; gap: 2px;
}
.period-toggle button {
  padding: 6px 16px; border: none; background: transparent;
  color: var(--text-muted); font-size: 13px; border-radius: 4px;
  cursor: pointer; transition: 0.15s; font-family: var(--font);
}
.period-toggle button.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.period-toggle .save-badge {
  font-size: 10px; font-weight: 600; color: var(--green);
  margin-left: 4px;
}

@media (max-width: 768px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar { display: flex; overflow-x: auto; padding: 0; border-right: none; border-bottom: 1px solid var(--border); }
  .account-sidebar .sb-title { display: none; }
  .account-sidebar .sb-item { white-space: nowrap; border-right: none; border-bottom: 2px solid transparent; }
  .account-sidebar .sb-item.active { border-right: none; border-bottom-color: var(--accent); }
  .cookie-banner { flex-direction: column; text-align: center; }
  .cookie-actions { width: 100%; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .credit-packs { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tag pills ── */
.tag-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px; font-size: 11px;
  font-weight: 500; line-height: 1.4; white-space: nowrap;
  background: color-mix(in srgb, var(--tag-color) 15%, transparent);
  color: var(--tag-color);
}
.tag-pill-remove {
  cursor: pointer; opacity: .6; font-size: 13px; line-height: 1;
}
.tag-pill-remove:hover { opacity: 1; }
.tag-overflow { color: var(--text-muted); font-size: 11px; cursor: pointer; }

/* ── Toolbar search/sort/filter ── */
.conv-search {
  flex: 1; min-width: 140px; max-width: 260px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px 6px 30px;
  color: var(--text-primary); font-size: 13px; font-family: var(--font);
  outline: none; transition: border-color .15s;
}
.conv-search:focus { border-color: var(--accent); }
.conv-search-wrap {
  position: relative; display: flex; align-items: center;
}
.conv-search-icon {
  position: absolute; left: 9px; color: var(--text-muted); pointer-events: none;
  width: 14px; height: 14px;
}
.conv-sort {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
  color: var(--text-secondary); font-size: 12px; font-family: var(--font);
  cursor: pointer; outline: none;
}
.conv-sort:focus { border-color: var(--accent); }
.conv-filter-tags { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.conv-filter-add {
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  padding: 3px 8px; border-radius: 12px; font-size: 11px;
  cursor: pointer; border: none; font-family: var(--font);
}
.conv-filter-add:hover { background: rgba(255,255,255,0.1); }

.conv-tag-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 2px; border-radius: 4px; opacity: 0; transition: opacity .15s;
  vertical-align: middle; margin-left: 4px;
}
.conv-row:hover .conv-tag-btn { opacity: 1; }
.conv-tag-btn:hover { color: var(--accent); background: var(--accent-dim); }

/* ── Tag popover ── */
.tag-popover {
  position: absolute; z-index: 100; top: 100%; left: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.tag-popover-search {
  width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 8px; color: var(--text-primary);
  font-size: 12px; font-family: var(--font); margin-bottom: 6px; outline: none;
}
.tag-popover-list { max-height: 180px; overflow-y: auto; }
.tag-popover-item {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px;
  border-radius: 4px; cursor: pointer; font-size: 12px;
  color: var(--text-primary);
}
.tag-popover-item:hover { background: rgba(255,255,255,0.04); }
.tag-popover-swatch {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.tag-popover-footer {
  border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px;
  text-align: center;
}
.tag-popover-footer a {
  font-size: 11px; color: var(--text-muted); cursor: pointer;
}
.tag-popover-footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .conv-search { max-width: 100%; min-width: 0; }
  .conv-toolbar { flex-wrap: wrap; }
}

/* ── Support tickets ───────────────────── */
.support-table {
  width: 100%;
}
.support-table .conv-row-head,
.support-table .conv-row {
  grid-template-columns: 1fr 120px 110px 110px;
}

.ticket-messages {
  display: flex; flex-direction: column; gap: 12px;
}
.ticket-msg {
  max-width: 75%; padding: 12px 16px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5;
}
.ticket-msg-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 12px;
}
.ticket-msg-body {
  white-space: pre-wrap; word-break: break-word;
}

/* ── AI Chat ─────────────────────────────────── */
#chat-messages {
  scroll-behavior: smooth;
}
#chat-tool-status {
  display: flex; align-items: center; gap: 6px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── Legal pages (Privacy, Terms) ────────────── */
.legal-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}
.legal-content h1, .legal-content h2, .legal-content h3 {
  color: var(--text-primary);
}
.legal-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.legal-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.legal-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 12px;
}
.legal-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
}
.legal-content p {
  margin-bottom: 12px;
}
.legal-content ul {
  margin: 0 0 12px 20px;
  padding: 0;
}
.legal-content li {
  margin-bottom: 4px;
}
.legal-content a {
  color: var(--accent);
}
.legal-content strong {
  color: var(--text-primary);
}

/* ── Product admin panel ──────────────────────────────────── */
.product-tab-panel { display: none; }
.product-tab-panel.active { display: block; }

.provider-status-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; vertical-align: middle;
}
.price-card {
  flex: 1; min-width: 200px; padding: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
