/* ==========================================================================
   JAMES MUSIC - CSS DESIGN SYSTEM & THEMES
   ========================================================================== */

/* 1. CLASSIC GOLD THEME (The Sheet Music Logo Aesthetic - Default) */
:root, [data-theme="gold"] {
  --bg-base: #06090e;
  --bg-surface: rgba(14, 20, 30, 0.85);
  --bg-surface-elevated: rgba(22, 30, 45, 0.9);
  --bg-surface-glass: rgba(16, 23, 34, 0.7);
  --accent-primary: #d4af37;
  --accent-primary-light: #f5df88;
  --accent-primary-dark: #aa8214;
  --accent-secondary: #2dd4bf; /* turquoise accent from logo */
  --accent-gradient: linear-gradient(135deg, #f5df88 0%, #d4af37 55%, #aa8214 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(45, 212, 191, 0.08));
  --accent-green: #2ecc71;
  --accent-red: #e74c3c;
  --text-main: #fcf9f2; /* sheet music warm cream */
  --text-muted: #9fa8b8;
  --text-gold: #e2c275;
  --border-subtle: rgba(212, 175, 55, 0.16);
  --border-focus: rgba(212, 175, 55, 0.55);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-card: 0 14px 36px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(212, 175, 55, 0.28);
  --font-brand: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. CYBER NEON THEME (Modern AI Neon Look) */
[data-theme="neon"] {
  --bg-base: #080d14;
  --bg-surface: rgba(18, 26, 38, 0.8);
  --bg-surface-elevated: rgba(28, 40, 58, 0.85);
  --bg-surface-glass: rgba(15, 23, 36, 0.65);
  --accent-primary: #00f2fe;
  --accent-primary-light: #4facfe;
  --accent-primary-dark: #0088cc;
  --accent-secondary: #00f076;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.1));
  --accent-green: #00f076;
  --accent-red: #ff4b4b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-gold: #00f2fe;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 242, 254, 0.45);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(0, 242, 254, 0.25);
  --font-brand: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
header.app-header {
  .header-icon-btn {
    width: 32px;
    height: 32px;
  }

  .header-icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .header-right {
    gap: 6px;
  }

  @media (max-width: 480px) {
    .user-name-text {
      display: none !important;
    }
  }

  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 9, 14, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.header-logo-emblem-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.header-logo-emblem-wrap:hover {
  transform: scale(1.08);
}

.header-logo-emblem {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.4));
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--border-focus);
}

.user-profile-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-btn:hover {
  border-color: var(--accent-primary);
  background: var(--accent-gradient-subtle);
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #06090e;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-name-text {
  font-size: 12px;
  color: var(--text-main);
}

/* ==========================================================================
   MAIN CONTENT & VIEWS
   ========================================================================== */
main.main-content {
  flex: 1;
  padding: 18px 18px 115px 18px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view.active {
  display: block;
}

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

/* ==========================================================================
   VIEW 0: HOME SCREEN
   ========================================================================== */
.home-hero-card {
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.home-hero-bg-emblem {
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 260px;
  height: 260px;
  background-image: url('/static/james_music_logo.jpg');
  background-size: cover;
  opacity: 0.12;
  filter: blur(1px);
  pointer-events: none;
  border-radius: 50%;
}

.home-hero-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
}

.home-hero-greeting {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.home-hero-title {
  font-family: var(--font-brand);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  margin-bottom: 2px;
}

.home-hero-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.home-hero-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.home-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Nav Hub Grid */
.nav-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.nav-hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-surface-elevated);
}

.nav-hub-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.nav-hub-icon-wrap.gold-glow {
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
}

.nav-hub-icon-wrap.turquoise-glow {
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.25);
}

.nav-hub-icon-wrap.warm-glow {
  box-shadow: 0 0 14px rgba(246, 211, 101, 0.25);
}

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

.nav-hub-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.nav-hub-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-hub-arrow {
  color: var(--accent-primary);
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.nav-hub-card:hover .nav-hub-arrow {
  transform: translateX(4px);
}

/* Recent Stations Row (Home) */
.recent-stations-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.home-station-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.home-station-chip:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
}

.home-station-info {
  min-width: 0;
}

.home-station-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-station-seed {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-featured-artists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

/* ==========================================================================
   VIEW 1: STATIONS & SEARCH
   ========================================================================== */
.station-search-box-wrap {
  position: relative;
  margin-bottom: 20px;
  z-index: 40;
}

.search-input-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.station-search-input {
  width: 100%;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 13px 40px 13px 44px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.station-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-surface-elevated);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

/* Search Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #0d131d;
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
  max-height: 420px;
  overflow-y: auto;
  z-index: 100;
  padding: 8px;
}

.search-group-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-primary);
  padding: 10px 12px 6px 12px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--bg-surface-elevated);
}

.search-result-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.search-result-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #141a24;
  flex-shrink: 0;
}

.search-result-info {
  min-width: 0;
}

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-station-start {
  background: var(--accent-gradient-subtle);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

/* Stations Grid */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.station-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.station-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  background: var(--bg-surface-elevated);
}

.station-card.active-playing {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.station-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.station-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.station-card-details {
  min-width: 0;
  flex: 1;
}

.station-card-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-card-seed {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.station-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-play-station {
  background: var(--accent-gradient);
  color: #06090e;
  font-weight: 700;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ==========================================================================
   NOW PLAYING FULL SCREEN SHEET / OVERLAY (SWIPE-UP & SLIDE-UP)
   ========================================================================== */
.now-playing-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 9, 14, 0.98);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 10px 18px 40px 18px;
}

.now-playing-sheet.expanded {
  transform: translateY(0);
}

.sheet-drag-handle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 14px 0;
  cursor: grab;
}

.sheet-drag-pill {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
}

.player-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.station-title-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary);
}

.player-hero-card {
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.album-art-wrap {
  width: 240px;
  height: 240px;
  margin: 0 auto 18px auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  background: #101620;
}

.album-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.track-reason {
  font-size: 11px;
  color: var(--accent-primary);
  margin-bottom: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Steering Controls */
.steering-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
}

.steer-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.steer-btn.thumb-up:hover, .steer-btn.thumb-up.active {
  background: rgba(46, 204, 113, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.steer-btn.thumb-down:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Transport Controls */
.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 16px;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.control-btn:active {
  transform: scale(0.92);
}

.play-pause-btn {
  width: 60px;
  height: 60px;
  background: var(--accent-gradient);
  border-radius: var(--radius-pill);
  color: #06090e;
  box-shadow: 0 4px 20px var(--border-focus);
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.progress-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  border-radius: var(--radius-pill);
}

/* Queue List */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease;
}

.queue-item:hover {
  background: var(--bg-surface-elevated);
}

.queue-item.current-track {
  border-color: var(--accent-primary);
  background: var(--accent-gradient-subtle);
}

.queue-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #141a24;
  flex-shrink: 0;
}

.queue-meta {
  min-width: 0;
}

.queue-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-artist {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-reason {
  font-size: 10px;
  color: var(--accent-primary);
  margin-top: 2px;
}

.queue-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   DOCKED BOTTOM MINI-PLAYER (COLLAPSIBLE WITH MICRO-PROGRESS)
   ========================================================================== */
.docked-mini-player {
  position: fixed;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  left: 8px;
  right: 8px;
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  z-index: 55;
  animation: slideUp 0.25s ease;
  overflow: hidden;
  cursor: pointer;
}

.mini-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
}

.mini-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
}

.mini-content-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
}

.mini-art {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #141a24;
  flex-shrink: 0;
}

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

.mini-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-ctrl-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.mini-ctrl-btn:hover {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   LIBRARY VIEW (GRID VS LIST & DRILL-DOWN)
   ========================================================================== */
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.flex-1 {
  flex: 1;
}

.view-toggle-group {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  flex-shrink: 0;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn.active {
  background: var(--accent-gradient);
  color: #06090e;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.library-container.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.library-container.list-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alphabet-section-header {
  grid-column: 1 / -1;
  width: 100%;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-primary);
  padding: 14px 4px 6px 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 10px;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

/* Artist Card - Grid */
.grid-mode .artist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.grid-mode .artist-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

.grid-mode .artist-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 10px;
  background: #141a24;
}

.grid-mode .artist-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.grid-mode .artist-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.grid-mode .card-action-bar {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.btn-card-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 0;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-action:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Artist Row - List */
.list-mode .artist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.list-mode .artist-card:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

.list-mode .artist-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.list-mode .artist-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #141a24;
  flex-shrink: 0;
}

.list-mode .artist-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-mode .artist-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.list-mode .card-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Artist & Album Hero Banners */
.artist-hero-card, .album-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.artist-hero-img, .album-hero-img {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  object-fit: cover;
  background: #141a24;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.artist-hero-info, .album-hero-info {
  flex: 1;
  min-width: 0;
}

.artist-hero-name, .album-hero-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.album-hero-artist {
  font-size: 15px;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.artist-hero-meta, .album-hero-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.artist-hero-actions, .album-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.album-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.album-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
}

.album-card-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  background: #141a24;
  margin-bottom: 8px;
}

.album-card-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tracklist */
.tracklist-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease;
}

.track-row:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

.track-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}

.track-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  width: 22px;
  text-align: right;
  flex-shrink: 0;
}

.track-info {
  min-width: 0;
}

.track-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.track-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.track-duration {
  font-size: 12px;
  color: var(--text-muted);
}

/* Missing Releases */
.missing-albums-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.missing-album-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.missing-album-title {
  font-size: 13px;
  font-weight: 600;
}

.missing-album-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS, BADGES, CARDS & UI ELEMENTS
   ========================================================================= */
.btn-primary {
  background: var(--accent-gradient);
  color: #06090e;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-primary-sm {
  background: var(--accent-gradient);
  color: #06090e;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  background: var(--accent-gradient-subtle);
  color: var(--accent-primary);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost-sm {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-icon-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-icon-sm:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
}

.btn-get-it {
  background: var(--accent-gradient);
  color: #06090e;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.badge-owned {
  font-size: 11px;
  color: var(--accent-green);
  background: rgba(46, 204, 113, 0.12);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 14px 0;
}

.section-title-wrap {
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-count {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* Bottom Nav */
nav.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(6, 9, 14, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 16px;
  transition: color 0.15s ease;
}

.nav-tab.active {
  color: var(--accent-primary);
}

.nav-tab svg {
  width: 22px;
  height: 22px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #0d131d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  margin-bottom: 14px;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent-primary);
}

/* Compact, High-DPI Sign-In Emblem (Scaled Down Tastefully) */
.auth-modal-box {
  max-width: 360px;
  width: 100%;
  text-align: center;
  border: 1.5px solid var(--accent-primary);
  box-shadow: var(--shadow-glow);
  padding: 22px 18px;
  margin: auto;
  max-height: 90vh;
  overflow-y: auto;
}

.auth-emblem-wrap {
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
  margin: 0 auto 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Clean transparent container - no circular clipping */
}

.auth-emblem-img {
  width: 96px;
  height: 96px;
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 18px rgba(212, 175, 55, 0.42));
}

.auth-brand-title {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.auth-brand-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 6px;
}

.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 16px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.remember-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.auth-input-group {
  text-align: left;
  margin-bottom: 12px;
}

.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.auth-error-banner {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* User Profile & Theme Settings */
.profile-card {
  text-align: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #06090e;
  font-size: 26px;
  font-weight: 800;
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
}

.profile-role {
  font-size: 12px;
  color: var(--accent-primary);
  text-transform: capitalize;
  margin-top: 2px;
}

.settings-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.settings-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.theme-selector-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-choice-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-choice-btn.active {
  border-color: var(--accent-primary);
  background: var(--accent-gradient-subtle);
  box-shadow: var(--shadow-glow);
}

.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gold-dot {
  background: linear-gradient(135deg, #f5df88, #d4af37);
  box-shadow: 0 0 6px #d4af37;
}

.neon-dot {
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  box-shadow: 0 0 6px #00f2fe;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 20, 30, 0.98);
  border: 1px solid var(--accent-primary);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  z-index: 300;
  display: none;
  white-space: nowrap;
}

/* Discover Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.media-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.media-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ==========================================================================
   MOBILE RESPONSIVE MEDIA QUERIES (320px - 640px)
   ========================================================================== */
@media (max-width: 640px) {
  header.app-header {
  .header-icon-btn {
    width: 32px;
    height: 32px;
  }

  .header-icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .header-right {
    gap: 6px;
  }

  @media (max-width: 480px) {
    .user-name-text {
      display: none !important;
    }
  }

    padding: 8px 12px;
    height: 52px;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-tagline {
    display: none; /* Hide tagline on mobile header so header buttons fit comfortably */
  }

  .user-name-text {
    max-width: 65px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-avatar-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .theme-toggle-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .main-content {
    padding: 12px 10px calc(120px + env(safe-area-inset-bottom, 0px)) 10px;
  }

  .home-hero-card {
    padding: 16px 14px;
    margin-bottom: 18px;
  }

  .home-hero-title {
    font-size: 24px;
  }

  .home-hero-tagline {
    font-size: 13px;
  }

  .home-hero-desc {
    font-size: 12px;
    margin-bottom: 14px;
    line-height: 1.4;
  }

  .home-hero-bg-emblem {
    display: none; /* Hide watermark on mobile so text is crystal clear */
  }

  .home-hero-actions {
    flex-direction: column;
    gap: 8px;
  }

  .home-hero-actions button {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  .nav-hub-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nav-hub-card {
    padding: 12px 14px;
  }

  .recent-stations-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-featured-artists-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .now-playing-sheet {
    padding: 8px 14px calc(24px + env(safe-area-inset-bottom, 0px)) 14px;
  }

  .player-hero-card {
    padding: 14px 12px;
    margin-bottom: 18px;
  }

  .album-art-wrap {
    width: 170px;
    height: 170px;
    max-width: 50vw;
    max-height: 50vw;
    margin: 0 auto 12px auto;
  }

  .track-title {
    font-size: 18px;
  }

  .track-artist {
    font-size: 13px;
  }

  .steering-bar {
    gap: 8px;
    margin-bottom: 12px;
  }

  .steer-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .play-pause-btn {
    width: 50px;
    height: 50px;
  }

  .bottom-nav {
    height: calc(52px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .nav-tab {
    font-size: 10px;
    gap: 2px;
  }

  .nav-tab svg {
    width: 20px;
    height: 20px;
  }

  .mini-content-inner {
    padding: 6px 10px;
    gap: 8px;
  }

  .mini-art {
    width: 34px;
    height: 34px;
  }

  .mini-title {
    font-size: 12px;
  }

  .mini-artist {
    font-size: 10px;
  }

  .mini-ctrl-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .header-logo-emblem-wrap {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  .header-logo-emblem {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 15px;
  }

  .auth-emblem-wrap {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
  }

  .auth-emblem-img {
    width: 84px;
    height: 84px;
  }

  .auth-brand-title {
    font-size: 20px;
  }
}

/* --- HEADER SEARCH BUTTON --- */
.header-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.header-icon-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* --- GLOBAL OMNIBAR SEARCH MODAL --- */
.global-search-dialog {
  max-width: 660px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  background: #0c121c;
  border: 1.5px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-lg);
  margin: auto;
}

.global-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #090e16;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.global-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.global-search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.global-omni-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  font-size: 15px;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.global-omni-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

.global-search-results-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

/* Quick Search Suggestion Chips */
.search-suggestions {
  text-align: left;
  padding: 10px 0 20px 0;
}

.search-hint-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* Search Group Containers */
.search-group {
  margin-bottom: 22px;
}

.search-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-group-count {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-muted);
}

/* Search Items List */
.search-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.search-item-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(212, 175, 55, 0.35);
  transform: translateX(2px);
}

.search-item-thumb {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #141a24;
}

.search-item-thumb.round {
  border-radius: 50%;
}

.search-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Row 1: Item Name and Type Badge (Full Width) */
.search-item-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.search-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Row 2: Subtitle & Action Buttons */
.search-item-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.search-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  margin: 0;
}

.search-item-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.search-item-actions .btn-get-it,
.search-item-actions .btn-card-action {
  height: 25px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  flex: none;
  border: none;
}

.search-item-actions .btn-card-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.search-item-actions .btn-card-action:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* "Available to Add" Unowned Cards */
.unowned-search-card {
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.unowned-search-card:hover {
  background: rgba(212, 175, 55, 0.09);
  border-color: var(--accent-primary);
}

.badge-discover-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.18);
  color: var(--accent-primary);
  margin-left: 6px;
}

/* --- GEMMA AI INSIGHTS & REVIEW PANELS --- */
.ai-insights-panel {
  background: linear-gradient(135deg, rgba(20, 28, 42, 0.95), rgba(12, 18, 28, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 18px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(212, 175, 55, 0.1);
  animation: fadeIn 0.3s ease;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fff;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(184, 134, 11, 0.4));
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.btn-ai-refresh {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ai-refresh:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.ai-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ai-meta-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-meta-label {
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.ai-meta-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.ai-bio-paragraph {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(240, 240, 240, 0.88);
  font-style: italic;
  margin: 0;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
}

.ai-loading-placeholder {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}

.ai-sparkle-spin {
  display: inline-block;
  animation: pulseGlow 1.5s infinite alternate;
}

/* Responsive Search Dialog & Compact Actions for Mobile */
@media (max-width: 640px) {
  #global-search-modal {
    padding: 6px 4px !important;
  }

  .global-search-dialog {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 95vh !important;
    border-radius: 12px !important;
  }

  .global-search-header {
    padding: 10px 10px !important;
    gap: 8px !important;
  }

  .global-search-results-area {
    padding: 8px 6px !important;
  }

  .search-item-card {
    padding: 8px 8px !important;
    gap: 9px !important;
  }

  .search-item-thumb {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }

  .search-item-name {
    font-size: 13.5px !important;
  }

  .search-item-sub {
    font-size: 11.5px !important;
  }
}

.btn-get-it.queued {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(74, 222, 128, 0.4) !important;
  pointer-events: none;
}

@media (max-width: 540px) {
  /* On phone screens, streamline actions to compact icon buttons to give maximum room to subtitles */
  .search-item-actions .action-label {
    display: none !important;
  }

  .search-item-actions .btn-get-it,
  .search-item-actions .btn-card-action {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .search-item-actions {
    gap: 6px !important;
  }
}
