/* ==========================================================================
   BIXY SPOTIFY EXTRACTOR · SYSTEM DESIGN & CRAFTSMANSHIP
   Aesthetic: Apple-grade White, Refined Neutrals, Physically-Convincing Glass
   ========================================================================== */

:root {
  /* ── Neutral Canvas & Surface System ── */
  --bg-canvas: #FAFAF8;
  --bg-canvas-rgb: 250, 250, 248;
  --bg-surface: #FFFFFF;
  --bg-surface-rgb: 255, 255, 255;
  --bg-surface-subtle: #F5F5F3;
  --bg-surface-elevated: #FFFFFF;

  /* ── Frosted Glass Tokens ── */
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-bg-hover: rgba(255, 255, 255, 0.90);
  --glass-bg-elevated: rgba(255, 255, 255, 0.88);
  --glass-blur: 20px;
  --glass-saturate: 180%;
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.95);

  /* ── Typography & Tone ── */
  --text-primary: #141416;
  --text-secondary: #5A5A60;
  --text-muted: #8E8E93;
  --text-subtle: #AEAEB2;

  /* ── Borders & Separators ── */
  --border-hairline: rgba(0, 0, 0, 0.05);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-focus: #16a34a;

  /* ── Spotify & Accent Colors ── */
  --accent-green: #15803d;
  --accent-green-hover: #166534;
  --accent-green-light: rgba(21, 128, 61, 0.08);
  --accent-green-border: rgba(21, 128, 61, 0.22);
  --spotify-brand: #1db954;

  /* ── Status Colors ── */
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.06);
  --color-danger-border: rgba(220, 38, 38, 0.18);
  --color-success: #15803d;
  --color-success-bg: rgba(21, 128, 61, 0.06);

  /* ── Realistic Ambient Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.03), 0 8px 24px -4px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 12px 32px -6px rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  --shadow-modal: 0 24px 64px -12px rgba(0, 0, 0, 0.16), 0 8px 24px -4px rgba(0, 0, 0, 0.06);

  /* ── Radius Scale ── */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* ── Typography Stack ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ── Motion Curves ── */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-fast: 140ms var(--ease-spring);
  --transition-base: 220ms var(--ease-spring);
  --transition-smooth: 320ms var(--ease-spring);
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Subtle Ambient Background Layer ── */
.canvas-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.canvas-mesh-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.35;
}

.glow-top {
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(21, 128, 61, 0.12), transparent 70%);
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
}

.glow-subtle {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(21, 128, 61, 0.06), transparent 70%);
  bottom: 10%;
  right: 5%;
}

/* ── Application Layout ── */
.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 80px;
}

/* ── Frosted Glass System Utility ── */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--glass-specular), var(--shadow-card);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

@supports not (backdrop-filter: blur(10px)) {
  .glass-panel {
    background: #FFFFFF;
  }
}

/* ── Top Translucent Navigation ── */
.navbar-wrapper {
  position: sticky;
  top: 16px;
  z-index: 100;
  margin-bottom: 40px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 16px;
  border-radius: var(--radius-pill);
  box-shadow: var(--glass-specular), var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-divider {
  color: var(--text-subtle);
  font-weight: 300;
}

.brand-service {
  font-weight: 500;
  color: var(--text-secondary);
}

.engine-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-green);
  background: var(--accent-green-light);
  border: 1px solid var(--accent-green-border);
  border-radius: var(--radius-pill);
  margin-left: 4px;
}

/* ── Navigation Tabs ── */
.nav-tabs-container {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.03);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.nav-tab.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 1px rgba(0, 0, 0, 0.03);
}

.tab-icon {
  stroke-width: 2;
  opacity: 0.75;
  transition: opacity var(--transition-fast);
}

.nav-tab.active .tab-icon {
  opacity: 1;
  stroke: var(--accent-green);
}

/* ── Account Actions in Nav ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 4px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-green);
}

.action-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

/* ── Standard Button Tokens ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
}

.btn:active {
  transform: scale(0.98) translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.25);
}

.btn-primary {
  background: #141416;
  color: #FFFFFF;
  border-color: #141416;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
  background: #262629;
  border-color: #262629;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.16);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--border-medium);
}

.btn-connect {
  background: #141416;
  color: #FFFFFF;
  font-weight: 600;
  padding: 8px 16px;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-connect:hover {
  background: #262629;
}

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

.btn-spotify {
  background: #15803d;
  color: #FFFFFF;
  border-color: #15803d;
  font-weight: 600;
}

.btn-spotify:hover {
  background: #166534;
  border-color: #166534;
}

.w-full {
  width: 100%;
}

/* ── Content Viewport & Panes ── */
.content-viewport {
  min-height: calc(100vh - 220px);
}

.tab-pane {
  display: none;
  animation: fadeIn 240ms var(--ease-spring);
}

.tab-pane.active {
  display: block;
}

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

/* ══════════════════════════════════════════════════════════════ */
/* HERO SECTION & PLAYLIST EXTRACTION EXPERIENCE                  */
/* ══════════════════════════════════════════════════════════════ */
.hero-section {
  text-align: center;
  max-width: 820px;
  margin: 20px auto 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.2);
}

.hero-badge-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: clamp(15px, 2.2vw, 17px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
}

/* ── Search & Extraction Box ── */
.extract-box-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

.extract-card {
  padding: 10px;
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-specular), var(--shadow-float);
  border: 1px solid var(--border-subtle);
  background: var(--glass-bg-elevated);
}

.extract-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 14px;
  transition: all var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.extract-input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18), inset 0 1px 2px rgba(0, 0, 0, 0.02);
  background: #FFFFFF;
}

.input-icon-prefix {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.extract-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}

.extract-input::placeholder {
  color: var(--text-muted);
}

.input-actions-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pill-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-mini-btn:hover {
  background: #EAEAE7;
  color: var(--text-primary);
}

.clear-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clear-icon-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.btn-extract {
  padding: 11px 22px;
  font-size: 14px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.2);
}

.btn-arrow {
  transition: transform var(--transition-fast);
}

.btn-extract:hover .btn-arrow {
  transform: translateX(2px);
}

/* ── Helpers / Sample Playlist Chips ── */
.extract-helpers {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 8px 4px;
}

.helpers-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.sample-chip {
  padding: 4px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sample-chip:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

/* ── Validation Notice Banner ── */
.validation-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 16px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn 180ms ease;
}

.banner-close-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  color: currentColor;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
}

.banner-close-btn:hover {
  opacity: 1;
}

/* ── Refined Loading State ── */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.refined-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
  margin-bottom: 16px;
}

.refined-spinner.mini {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin-bottom: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.loading-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════ */
/* FIRST-CLASS PLAYLIST RESULTS VIEW                              */
/* ══════════════════════════════════════════════════════════════ */
.extracted-result-view {
  margin-top: 40px;
  scroll-margin-top: 100px;
  animation: fadeIn 320ms var(--ease-spring);
}

pre::-webkit-scrollbar,
.json-code-viewport::-webkit-scrollbar,
.curl-box::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

pre::-webkit-scrollbar-track,
.json-code-viewport::-webkit-scrollbar-track,
.curl-box::-webkit-scrollbar-track {
  background: transparent;
}

pre::-webkit-scrollbar-thumb,
.curl-box::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 9999px;
}

.console-output-box pre::-webkit-scrollbar-thumb,
.json-code-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}

.playlist-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.playlist-hero-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.playlist-artwork-box {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--bg-surface-subtle);
}

.playlist-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-info-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.playlist-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.playlist-name-display {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-break: break-word;
}

.playlist-desc-display {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  max-width: 680px;
}

.playlist-stats-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.playlist-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-bullet {
  color: var(--text-subtle);
}

.creator-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

/* ── Result Actions Toolbar ── */
.result-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
}

/* ── Track List Search & Filter Toolbar ── */
.tracklist-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.tracklist-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.tracklist-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.tracklist-heading {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.tracklist-count-badge {
  font-size: 12.5px;
  color: var(--text-muted);
}

.tracklist-filter-box {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.tracklist-filter-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.tracklist-filter-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

.filter-icon-inside {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Apple-Grade Track Table ── */
.track-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
}

.track-table th {
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-hairline);
  user-select: none;
}

.track-table th.col-index { width: 44px; text-align: center; }
.track-table th.col-title { width: 44%; }
.track-table th.col-album { width: 28%; }
.track-table th.col-isrc { width: 14%; }
.track-table th.col-duration { width: 14%; text-align: right; }

.track-row {
  border-bottom: 1px solid var(--border-hairline);
  transition: background-color var(--transition-fast);
}

.track-row:last-child {
  border-bottom: none;
}

.track-row:hover {
  background-color: rgba(0, 0, 0, 0.025);
}

.track-cell {
  padding: 10px 18px;
  vertical-align: middle;
  overflow: hidden;
}

.track-cell.track-main-cell {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.track-index {
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 500;
}

.track-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.track-thumb-img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--bg-surface-subtle);
}

.track-meta-wrap {
  min-width: 0;
  max-width: 100%;
  flex: 1;
  overflow: hidden;
}

.track-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  min-width: 0;
  max-width: 100%;
}

.track-name-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  min-width: 0;
  flex: 1;
}

.explicit-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  flex-shrink: 0;
}

.track-artist-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
  display: block;
}

.track-album-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.isrc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.isrc-pill:hover {
  background: #EAEAE7;
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.track-duration-text {
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.track-ext-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: 6px;
}

.track-ext-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

/* ══════════════════════════════════════════════════════════════ */
/* MY PLAYLISTS & USER LIBRARY VIEW                               */
/* ══════════════════════════════════════════════════════════════ */
.section-top-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.section-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
}

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

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.search-input-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.library-search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.library-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

.stats-pill {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}

/* ── Empty State Card ── */
.empty-state-card {
  text-align: center;
  padding: 56px 28px;
  max-width: 620px;
  margin: 40px auto;
  border-radius: var(--radius-xl);
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-green-light);
  border: 1px solid var(--accent-green-border);
  margin-bottom: 20px;
}

.empty-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ── Playlists Grid ── */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.playlist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.playlist-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
  border-color: var(--border-medium);
}

.playlist-thumb-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg-surface-subtle);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.playlist-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
}

.playlist-meta {
  flex: 1;
  margin-bottom: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.playlist-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  max-width: 100%;
}

.playlist-owner {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.playlist-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.playlist-actions .btn {
  flex: 1;
  padding: 7px 8px;
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════ */
/* REST API DOCUMENTATION & LIVE CONSOLE                          */
/* ══════════════════════════════════════════════════════════════ */
.api-base-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  max-width: 100%;
  flex-wrap: wrap;
}

.base-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
}

.base-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.console-card {
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 36px;
  background: var(--bg-surface);
}

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

.console-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.console-heading {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.console-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.console-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.console-select {
  flex: 1;
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.console-select:focus {
  border-color: var(--border-focus);
}

.console-output-box {
  background: #111113;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.console-output-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.status-indicator {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: #9CA3AF;
}

.status-indicator.success {
  color: #34D399;
}

.status-indicator.error {
  color: #F87171;
}

.console-pre {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #E5E7EB;
  max-height: 380px;
  overflow: auto;
  line-height: 1.6;
}

/* ── API Documentation Grid ── */
.api-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.api-doc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.api-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.http-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.http-badge.get {
  background: rgba(21, 128, 61, 0.1);
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.2);
}

.http-badge.post {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.endpoint-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.curl-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
  max-width: 100%;
}

.curl-box pre,
.curl-box code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-all;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ══════════════════════════════════════════════════════════════ */
/* MODALS: CONNECT ACCOUNT & JSON VIEWER                          */
/* ══════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 18, 20, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 180ms ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 220ms var(--ease-spring);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-hairline);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-heading {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.modal-close-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-icon:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
}

/* ── Auth Tabs Inside Modal ── */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-hairline);
  overflow-x: auto;
}

.auth-tab {
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.auth-content-pane {
  display: none;
  padding: 24px;
  overflow-y: auto;
}

.auth-content-pane.active {
  display: block;
}

.auth-info-banner {
  background: var(--accent-green-light);
  border: 1px solid var(--accent-green-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}

.auth-info-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-green);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.auth-info-text {
  font-size: 12.5px;
  color: var(--accent-green-hover);
  line-height: 1.45;
}

.pane-note {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.form-field {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18);
}

.form-input.code-font {
  font-family: var(--font-mono);
  font-size: 12px;
}

.field-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

.step-guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 14px;
}

.step-counter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.step-body {
  font-size: 13px;
}

.step-body strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.step-body p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.vortex-callback-assist {
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.helper-accordion {
  margin-top: 14px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12.5px;
}

.helper-accordion summary {
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.helper-accordion ol {
  padding-left: 20px;
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.auth-error-banner {
  padding: 10px 14px;
  margin: 0 24px 16px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
  color: var(--color-danger);
  font-size: 12.5px;
}

.status-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  color: #2563eb;
  font-size: 12.5px;
  margin-top: 10px;
}

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}

/* ── JSON Viewer Modal ── */
.json-viewer-card {
  max-width: 780px;
}

.json-chip {
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.modal-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.json-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-hairline);
}

.search-input-box.compact {
  max-width: 320px;
}

.stats-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.json-code-viewport {
  background: #111113;
  padding: 18px;
  overflow: auto;
  max-height: 520px;
}

.json-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #E5E7EB;
}

/* ── Toast Notification Container ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #141416;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-modal);
  animation: toastIn 200ms var(--ease-spring);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* ── Footer ── */
.app-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border-hairline);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.footer-copy {
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

/* ── Global Utility: Hidden ── */
.hidden {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════ */
/* RESPONSIVE DESIGN BREAKPOINTS                                  */
/* ══════════════════════════════════════════════════════════════ */
/* ── Custom Confirmation & Alert Dialog ── */
.custom-dialog-card {
  max-width: 440px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border-subtle);
  animation: modalSlideUp 200ms var(--ease-spring);
}

.dialog-content-area {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.dialog-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dialog-icon-circle.info {
  background: rgba(21, 128, 61, 0.08);
  color: #15803d;
}

.dialog-icon-circle.warning {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
}

.dialog-text-area {
  flex: 1;
  min-width: 0;
}

.dialog-heading {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.dialog-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dialog-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-action-buttons .btn {
  padding: 9px 18px;
  font-size: 13px;
}

.btn-danger {
  background: #dc2626;
  color: #FFFFFF;
  border-color: #dc2626;
  font-weight: 600;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* ══════════════════════════════════════════════════════════════ */
/* RESPONSIVE DESIGN BREAKPOINTS                                  */
/* ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .playlist-hero-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .playlist-stats-row {
    justify-content: center;
  }

  .result-toolbar {
    justify-content: center;
  }

  .track-table th.col-album,
  .track-cell.track-album-cell {
    display: none;
  }
}

@media (max-width: 680px) {
  .app-layout {
    padding: 10px 12px 60px;
  }

  .navbar {
    padding: 6px 10px;
    margin-bottom: 24px;
  }

  .brand-service, .brand-divider, .engine-tag {
    display: none;
  }

  .nav-brand {
    gap: 6px;
  }

  .nav-tabs-container {
    gap: 2px;
    padding: 2px;
  }

  .nav-tab {
    padding: 6px 8px;
    font-size: 12px;
    gap: 4px;
  }

  .nav-tab span {
    display: none;
  }

  .user-profile-badge {
    padding: 3px 6px;
  }

  .user-meta {
    display: none;
  }

  .hero-section {
    margin: 10px auto 32px;
  }

  .hero-title {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 13.5px;
    margin-bottom: 20px;
    line-height: 1.5;
  }

  .extract-card {
    padding: 8px;
  }

  .extract-input-group {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 10px;
    position: relative;
  }

  .extract-input {
    width: 100%;
    font-size: 13.5px;
    padding-right: 28px;
  }

  .input-icon-prefix {
    display: none;
  }

  .input-actions-cluster {
    position: absolute;
    right: 12px;
    top: 10px;
  }

  .btn-extract {
    width: 100%;
    padding: 11px;
    font-size: 13.5px;
  }

  .extract-helpers {
    gap: 6px;
    padding: 8px 4px 2px;
  }

  .sample-chip {
    font-size: 11px;
    padding: 3px 9px;
  }

  /* ── Mobile Playlist Header & Table ── */
  .playlist-header-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .playlist-artwork-box {
    width: 130px;
    height: 130px;
    margin: 0 auto 12px;
  }

  .playlist-name-display {
    font-size: 20px;
  }

  .playlist-stats-row {
    font-size: 12px;
    gap: 6px 8px;
    margin-bottom: 16px;
  }

  .result-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .result-toolbar .btn {
    width: 100%;
    font-size: 12px;
    padding: 8px 6px;
  }

  .tracklist-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .tracklist-filter-box {
    width: 100%;
  }

  .track-table {
    table-layout: fixed;
    width: 100%;
  }

  .track-table th.col-index,
  .track-cell.track-index {
    width: 24px;
    padding: 8px 2px 8px 6px;
    font-size: 11px;
  }

  .track-table th.col-title,
  .track-cell:nth-child(2),
  .track-cell.track-main-cell {
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 8px 6px;
    overflow: hidden;
  }

  .track-table th.col-duration,
  .track-cell.track-duration-cell {
    width: 58px;
    padding: 8px 8px 8px 2px;
    text-align: right;
  }

  .track-table th.col-isrc,
  .track-cell.track-isrc-cell,
  .track-table th.col-album,
  .track-cell.track-album-cell {
    display: none;
  }

  .track-identity {
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  .track-thumb-img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
  }

  .track-meta-wrap {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .track-name-text {
    font-size: 12.5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .track-artist-text {
    font-size: 11.5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .track-duration-text {
    font-size: 12px;
  }

  .track-ext-btn {
    display: none;
  }

  /* ── Mobile Library & API ── */
  .section-top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  .section-title {
    font-size: 22px;
  }

  .header-action-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .header-action-group .btn {
    flex: 1;
    font-size: 12px;
    padding: 7px 10px;
  }

  .library-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search-input-box {
    max-width: 100%;
  }

  .stats-pill {
    align-self: flex-start;
    font-size: 12px;
  }

  .playlists-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .console-card {
    padding: 16px;
  }

  .console-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 14px;
  }

  .console-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .console-controls .btn {
    width: 100%;
  }

  .api-docs-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .api-doc-card {
    padding: 16px;
    max-width: 100%;
    overflow: hidden;
  }

  .custom-dialog-card {
    width: calc(100% - 32px);
    padding: 18px;
    margin: 16px;
  }

  .dialog-action-buttons {
    width: 100%;
  }

  .dialog-action-buttons .btn {
    flex: 1;
  }
}

/* ── Reduced Motion Preference ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
