/* ═══════════════════════════════════════════════════════════════════
   Blue Wavez – Design System
   Themes: [data-theme="light"] / [data-theme="dark"]
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --accent:         #1a5fff;
  --accent-hover:   #0040dd;
  --accent-light:   #4a88ff;
  --accent-subtle:  rgba(26, 95, 255, .13);
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --sidebar-w:      220px;
  --topbar-h:       60px;
  --transition:     .18s ease;
}

/* ── Light theme ─────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-sidebar:    #ffffff;
  --bg-main:       #f1f5f9;
  --bg-card:       #ffffff;
  --bg-hero:       #eff6ff;
  --bg-input:      #f8fafc;
  --text-primary:  #0f172a;
  --text-secondary:#334155;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.04);
  --shadow-card:   0 2px 8px rgba(0,0,0,.07);
  --topbar-bg:     #ffffff;
  --topbar-border: #e2e8f0;
  --pill-bg:       #f1f5f9;
  --pill-active:   #ffffff;
}

/* ── Dark theme ──────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-sidebar:    #05091a;
  --bg-main:       #070c1e;
  --bg-card:       #0c1530;
  --bg-hero:       #0a1840;
  --bg-input:      #05091a;
  --text-primary:  #ffffff;
  --text-secondary:#a8c4f0;
  --text-muted:    #5a7faa;
  --border:        #14213d;
  --shadow:        0 1px 4px rgba(0,0,0,.6), 0 1px 10px rgba(0,10,50,.4);
  --shadow-card:   0 2px 12px rgba(0,8,40,.55);
  --topbar-bg:     #05091a;
  --topbar-border: #0c1530;
  --pill-bg:       #0c1530;
  --pill-active:   #14213d;
}

/* ── Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9375rem;
  color: var(--text-primary);
  background: var(--bg-main);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════════════
   LAYOUT SHELL
   ══════════════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition), background var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

[data-theme="dark"] .sidebar-logo-icon {
  filter: drop-shadow(0 0 6px rgba(0, 170, 255, 0.55));
}

.sidebar-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: .95rem;
}

.sidebar-link:hover {
  background: var(--accent-subtle);
  color: var(--accent-light);
}

.sidebar-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

[data-theme="dark"] .sidebar-link.active { color: var(--accent-light); }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-username {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-plan {
  font-size: .72rem;
  color: var(--accent-light);
  font-weight: 500;
}

.sidebar-logout {
  color: var(--text-muted);
  font-size: .85rem;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition);
  text-decoration: none;
}
.sidebar-logout:hover { color: var(--text-primary); }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
}

/* ── Main wrapper ─────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background var(--transition);
}

.topbar-center { flex: 1; }

.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: color var(--transition);
}
.sidebar-toggle:hover { color: var(--text-primary); }

/* Theme pill */
.theme-pill {
  display: flex;
  background: var(--pill-bg);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.theme-pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 100px;
  border: none;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.theme-pill-btn.active {
  background: var(--pill-active);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.topbar-upload {
  font-size: .82rem;
  border-radius: 100px;
  padding: 6px 16px;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  cursor: default;
}

/* Flash messages */
.flash-container { width: 100%; }

/* Main content */
.main-content {
  flex: 1;
  padding: 28px 28px 48px;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════════════════════════════ */
.hero {
  background: var(--bg-hero);
  border-radius: var(--radius-lg);
  padding: 40px 40px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  overflow: hidden;
  position: relative;
  transition: background var(--transition);
}

.hero-text { max-width: 380px; }

.hero-title {
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -.03em;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 0;
}

.hero-wave {
  flex-shrink: 0;
  opacity: .85;
}

/* ══════════════════════════════════════════════════════════════════
   UPLOAD ZONE
   ══════════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color var(--transition), background var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* ══════════════════════════════════════════════════════════════════
   TOOL CARDS
   ══════════════════════════════════════════════════════════════════ */
.tool-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              transform .15s, box-shadow var(--transition);
  text-align: left;
  user-select: none;
  box-shadow: var(--shadow-card);
}

.tool-card:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .14);
}

.tool-card.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.tool-card-icon.teal   { background: rgba(6,182,212,.15);   color: #06b6d4; }
.tool-card-icon.orange { background: rgba(245,158,11,.15);  color: #f59e0b; }
.tool-card-icon.green  { background: rgba(16,185,129,.15);  color: #10b981; }
.tool-card-icon.purple { background: rgba(168,85,247,.15);  color: #a855f7; }

.tool-card h6 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tool-card p {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.tool-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: .7rem;
  margin-top: 12px;
  transition: background var(--transition);
}
.tool-card:hover .tool-card-arrow,
.tool-card.selected .tool-card-arrow { background: var(--accent); color: #fff; }

/* ══════════════════════════════════════════════════════════════════
   RECENT FILES TABLE
   ══════════════════════════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.section-link {
  font-size: .82rem;
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

.files-table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.files-table th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.files-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .86rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

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

.files-table tr:hover td { background: var(--accent-subtle); }

.file-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: none;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  cursor: pointer;
  transition: background var(--transition);
}
.file-play-btn:hover { background: var(--accent); color: #fff; }

.file-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: .875rem;
}

.fmt-badge {
  font-size: .67rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent-light);
  text-transform: uppercase;
  margin-left: 6px;
}

.file-meta-cell {
  font-weight: 500;
  font-size: .82rem;
  color: var(--text-muted);
}

.file-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition);
}
.file-menu-btn:hover { color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════════
   STAT CARDS (results page)
   ══════════════════════════════════════════════════════════════════ */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: background var(--transition);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .3rem;
}

/* ══════════════════════════════════════════════════════════════════
   GENERIC CARD OVERRIDES (Bootstrap .card)
   ══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  transition: background var(--transition), border-color var(--transition);
}

.card-header {
  background: transparent !important;
  border-bottom-color: var(--border) !important;
}

/* ══════════════════════════════════════════════════════════════════
   PROCESS BUTTON / INDICATORS
   ══════════════════════════════════════════════════════════════════ */
#processing-indicator { padding: 2.5rem 0; }

/* ══════════════════════════════════════════════════════════════════
   FILE INFO BAR
   ══════════════════════════════════════════════════════════════════ */
.file-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════════════
   SECTION DIVIDER
   ══════════════════════════════════════════════════════════════════ */
.bw-divider {
  border-color: var(--border);
  margin: 24px 0;
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE  (≤ 991px)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hero { flex-direction: column; gap: 16px; }
  .hero-wave { display: none; }
  .main-content { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 576px) {
  .hero { padding: 24px 18px 20px; }
  .hero-title { font-size: 1.5rem; }
  .stat-value { font-size: 1.4rem; }
  .theme-pill-btn span { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   BATCH MODE
   ══════════════════════════════════════════════════════════════════ */

/* Mode tabs */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: calc(var(--radius-md) - 3px);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.mode-tab:not(.active):hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.batch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
}
.mode-tab.active .batch-badge { background: rgba(255,255,255,.25); color: #fff; }
.mode-tab:not(.active) .batch-badge { background: var(--accent); color: #fff; }

/* Queue list */
.batch-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 6px;
  font-size: .83rem;
  transition: background var(--transition);
}

.batch-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-weight: 500;
}

.batch-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .8rem;
  flex-shrink: 0;
  transition: color var(--transition);
}
.batch-remove-btn:hover { color: #ef4444; }

/* Limit notice */
.batch-limit-notice {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.28);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: .82rem;
  color: #92400e;
}
[data-theme="dark"] .batch-limit-notice { color: #fbbf24; }

/* Batch result cards (inline, during processing) */
.batch-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: background var(--transition);
}

.brc-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

.brc-info { flex: 1; min-width: 0; }

.brc-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.brc-status {
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brc-status.waiting    { color: var(--text-muted); }
.brc-status.processing { color: var(--accent-light); }
.brc-status.done       { color: #10b981; }
.brc-status.failed     { color: #ef4444; }

.brc-action { flex-shrink: 0; }

.brc-download-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  padding: 5px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
}
.brc-download-btn:hover { background: var(--accent-hover); color: #fff; }

/* ── Batch results page (batch_results.html) ──────────────────────── */
.batch-summary-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.batch-summary-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.batch-stat-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  box-shadow: var(--shadow-card);
}

.chip-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.chip-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.batch-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}

.batch-result-card-static {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background var(--transition);
}

.batch-result-card-static.failed {
  border-color: rgba(239,68,68,.28);
  opacity: .85;
}

.brs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brs-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}
.brs-icon-wrap.teal   { background: rgba(6,182,212,.12);   color: #06b6d4; }
.brs-icon-wrap.orange { background: rgba(245,158,11,.12);  color: #f59e0b; }
.brs-icon-wrap.green  { background: rgba(16,185,129,.12);  color: #10b981; }

.brs-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brs-source {
  font-size: .76rem;
  color: var(--text-muted);
}

.brs-analysis {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.brs-chip {
  font-size: .74rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent-light);
}

.brs-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .batch-results-grid { grid-template-columns: 1fr; }
  .mode-tab { padding: 8px 10px; font-size: .8rem; }
}

/* ══════════════════════════════════════════════════════════════════
   EXPORT PRESET CHIPS (index page – format picker)
   ══════════════════════════════════════════════════════════════════ */
.export-preset-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.export-preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}
.export-preset-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Vocal-mode chips (same appearance as export-preset chips) ─── */
.vocal-mode-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.vocal-mode-chip:hover {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245,158,11,.08);
}
.vocal-mode-chip.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════════
   CREATOR MODE PANEL (results page – analyze tool)
   ══════════════════════════════════════════════════════════════════ */
.creator-mode-panel {
  background: linear-gradient(135deg, rgba(37,99,235,.05) 0%, rgba(124,58,237,.05) 100%);
  border: 1.5px solid rgba(37,99,235,.18);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
[data-theme="dark"] .creator-mode-panel {
  background: linear-gradient(135deg, rgba(37,99,235,.09) 0%, rgba(124,58,237,.09) 100%);
  border-color: rgba(96,165,250,.25);
}
.creator-panel-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 14px;
}
.creator-summary-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.creator-chip {
  background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.15);
  border-radius: 100px;
  padding: 4px 13px;
  font-size: .79rem;
  font-weight: 600;
  color: var(--accent-light);
}
[data-theme="dark"] .creator-chip {
  background: rgba(96,165,250,.1);
  border-color: rgba(96,165,250,.2);
}

/* ══════════════════════════════════════════════════════════════════
   HISTORY FILTER TABS (profile page)
   ══════════════════════════════════════════════════════════════════ */
.hist-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.hist-tab {
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .83rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color var(--transition), border-color var(--transition);
}
.hist-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.hist-tab:hover:not(.active) {
  color: var(--text-secondary);
}
.hist-count {
  font-size: .75em;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════
   FAVORITE STAR BUTTON (profile table)
   ══════════════════════════════════════════════════════════════════ */
.fav-star-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .95rem;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  transition: color var(--transition), transform 0.15s;
  line-height: 1;
}
.fav-star-btn:hover { color: #f59e0b; transform: scale(1.25); }
.fav-star-btn.active { color: #f59e0b; }

/* ══════════════════════════════════════════════════════════════════
   MINI AUDIO PLAYER (floating, triggered by Recent Files play btn)
   ══════════════════════════════════════════════════════════════════ */
#mini-audio-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  padding: 12px 14px;
  min-width: 240px;
  max-width: 300px;
  display: none;
  transition: background var(--transition);
}
#mini-audio-player.active { display: block; }
.mini-player-name {
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mini-player-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .8rem;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.mini-player-close:hover { color: var(--text-primary); }
.mini-player-audio { width: 100%; }

/* ══════════════════════════════════════════════════════════════════
   CSS WAVEFORM BARS (animated, shown next to playing track)
   ══════════════════════════════════════════════════════════════════ */
.waveform-bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  vertical-align: middle;
}
.waveform-bar {
  width: 3px;
  border-radius: 100px;
  background: var(--accent);
  animation: waveform-bounce 0.7s ease-in-out infinite alternate;
}
.waveform-bar:nth-child(1) { height: 35%; animation-delay: 0s; }
.waveform-bar:nth-child(2) { height: 80%; animation-delay: .12s; }
.waveform-bar:nth-child(3) { height: 55%; animation-delay: .24s; }
.waveform-bar:nth-child(4) { height: 95%; animation-delay: .36s; }
.waveform-bar:nth-child(5) { height: 45%; animation-delay: .48s; }
@keyframes waveform-bounce { to { height: 100%; opacity: .65; } }

/* ── Mood card minor-key visual treatment ════════════════════════════════════ */
.mood-minor {
  border-color: rgba(124, 58, 237, 0.35) !important;
  background: rgba(124, 58, 237, 0.06) !important;
}
[data-theme="dark"] .mood-minor {
  background: rgba(124, 58, 237, 0.1) !important;
}
