/* ── Riso Signal sans type system ── */
@font-face {
  font-family: "Geist Sans";
  src: url("assets/fonts/geist-sans-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans SC";
  src: url("assets/fonts/noto-sans-sc-ui-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* ── Variables ── */
:root {
  color-scheme: dark;
  --font-ui: "Geist Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Geist Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --bg: #201411;
  --panel: #2a1b17;
  --panel-hover: #38231e;
  --muted: #c6a99c;
  --text: #f8eee5;
  --accent: #ff765f;
  --accent-strong: #ff927f;
  --accent-2: #d64b34;
  --accent-contrast: #2b100b;
  --accent-soft: rgba(255, 118, 95, .13);
  --border: #53362e;
  --border-hover: #936052;
  --red: #ff7380;
  --success: #b6c98d;
  --shadow: 0 14px 38px rgba(8, 3, 2, .28);
  --focus-ring: 0 0 0 3px rgba(255, 118, 95, .26);
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-xl: 10px;
  --radius-full: 999px;
  --z-card: 3;
  --z-header: 40;
  --z-download-action: 80;
  --z-download-progress: 300;
  --z-toast: 400;
  --z-skip-link: 1000;
  --light-bg: #f7efe5;
  --light-panel: #fcf7f0;
  --light-panel-hover: #f2e4d7;
  --light-muted: #765e54;
  --light-text: #321a15;
  --light-accent: #b52b1c;
  --light-accent-strong: #8f1f14;
  --light-accent-2: #d16249;
  --light-accent-contrast: #fff8f1;
  --light-accent-soft: rgba(181, 43, 28, .09);
  --light-border: #dfc4b2;
  --light-border-hover: #b9624e;
  --light-red: #a92d3d;
  --light-success: #4f704b;
}

/* ── Reset ── */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-synthesis: none;
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-width: 0;
}
button,
input,
select { font: inherit; }
.button-icon { vertical-align: -1px; margin-right: 5px; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}
@media (forced-colors: active) {
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  a:focus-visible,
  summary:focus-visible,
  .card:focus-visible {
    outline-color: Highlight;
    box-shadow: none;
  }
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: var(--z-skip-link);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--accent);
  transform: translateY(-150%);
  transition: transform .15s;
}
.skip-link:focus { transform: translateY(0); }

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px max(30px, calc((100% - 1440px) / 2));
  border-bottom: 1px solid var(--accent);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(10px);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-vinyl { width: 44px; height: 44px; flex-shrink: 0; color: var(--accent); }
.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 760;
  color: var(--accent);
  letter-spacing: .1em;
  line-height: 1.1;
}
.logo-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  white-space: nowrap;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-button { appearance: none; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 14px; border-radius: 0; padding: 7px 7px 6px; cursor: pointer; letter-spacing: .02em; }
.nav-button:hover { color: var(--text); border-bottom-color: var(--border-hover); }
.nav-button.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-count { display: inline-grid; min-width: 16px; height: 16px; place-items: center; margin-left: 2px; padding: 0 3px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font-size: 10px; }
.region-select,
.theme-select {
  appearance: none;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s;
}
.region-select:hover,
.theme-select:hover { border-color: var(--border-hover); }

/* ── Search Bar ── */
.controls {
  width: min(100%, 1488px);
  margin-inline: auto;
  padding: 24px 30px 30px;
  position: relative;
}
.search-bar {
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 4px 4px 12px;
  gap: 0;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.search-tabs {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.search-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  font-family: inherit;
}
.search-tab:hover {
  background: var(--panel-hover);
  color: var(--text);
}
.search-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.search-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 12px;
  flex-shrink: 0;
}
.search-bar input[type="search"] {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  min-width: 0;
  font-family: inherit;
}
.search-bar input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.search-bar input[type="search"]::placeholder { color: var(--muted); }
.search-submit {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--accent-contrast);
  font-weight: 650;
  font-size: 13px;
  padding: 9px 20px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: filter .15s, transform .1s, opacity .15s;
  font-family: inherit;
}
.search-submit:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.search-submit:active { transform: scale(.97); }
.search-submit.loading { opacity: .7; pointer-events: none; }
.search-hint {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 4px 0;
  color: var(--muted);
  font-size: 11px;
}
.quick-searches { min-height: 0; max-width: 1160px; margin: 8px auto 0; display: flex; flex-wrap: wrap; gap: 7px; }
.quick-searches:empty { display: none; }
.quick-searches button { border: 1px solid var(--border); color: var(--muted); background: var(--panel); font: inherit; font-size: 12px; padding: 5px 9px; border-radius: var(--radius-md); cursor: pointer; }
.quick-searches button:hover { color: var(--text); border-color: var(--accent); }
.search-shortcut { white-space: nowrap; }
kbd {
  display: inline-flex;
  min-width: 20px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-hover);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

/* Spinner */
.search-spinner { display: flex; align-items: center; }
.spin-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search History Dropdown */
.search-history {
  position: absolute;
  left: 24px;
  right: 24px;
  top: calc(100% - 4px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
  animation: slideDown .15s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 4px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.history-clear {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .1s;
  font-family: inherit;
}
.history-clear:hover { color: var(--text); }
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background .1s;
  border-top: 1px solid var(--border);
}
.history-item:first-of-type { border-top: none; }
.history-item:hover { background: var(--panel-hover); }
.history-icon { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.history-type {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ── Panel Layout ── */
.panel {
  display: grid;
  grid-template-columns: minmax(252px, 294px) minmax(0, 1fr);
  gap: 30px;
  width: min(100%, 1488px);
  margin-inline: auto;
  padding: 0 30px 30px;
}

/* ── Sidebar (Options) ── */
.options {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: sticky;
  top: 90px;
  height: fit-content;
}
.settings-summary { display: none; }
.settings-content { display: block; }
.option-section {
  margin-bottom: 18px;
}
.option-section:last-of-type { margin-bottom: 0; }
.option-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Mode Pills (radio styled as pill buttons) */
.mode-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mode-pill {
  position: relative;
  display: inline-flex;
}
.mode-pill input[type="radio"],
.mode-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.mode-pill span {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.mode-pill:hover span { border-color: var(--border-hover); color: var(--text); }
.mode-pill input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Sizes */
.sizes {
  display: flex;
  gap: 6px 8px;
  flex-wrap: wrap;
}
.sizes label {
  background: transparent;
  color: var(--muted);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sizes label:hover { border-color: var(--border-hover); color: var(--text); }
.sizes label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.hint { color: var(--muted); font-size: 11px; margin: 6px 0 0; }

/* Download Main Button */
.download-main-btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--accent-contrast);
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  transition: filter .15s, transform .1s;
}
.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.primary:active { transform: scale(.98); }
.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: saturate(.5);
  transform: none;
}
.button-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-contrast) 16%, transparent);
  font-size: 11px;
  line-height: 1;
}

/* Social CTA Cards */
.social { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.social-title {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
}
.social-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.social-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: transparent;
  transition: border-color .18s, background .18s, transform .15s;
}
.social-card:hover {
  border-color: var(--s-brand);
  background: color-mix(in srgb, var(--s-brand) 8%, transparent);
  transform: translateX(3px);
}
.social-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--s-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: box-shadow .18s;
}
.social-card:hover .social-icon {
  box-shadow: 0 4px 12px color-mix(in srgb, var(--s-brand) 40%, transparent);
}
.social-icon svg {
  fill: white;
  width: 20px;
  height: 20px;
}
.social-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.social-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}
.social-handle {
  font-size: 11px;
  color: var(--muted);
}
.social-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
  transition: transform .15s, color .15s;
  flex-shrink: 0;
}
.social-card:hover .social-arrow {
  transform: translateX(3px);
  color: var(--s-brand);
}

/* Brand colors */
.social-card.xhs    { --s-brand: #FF2442; }
.social-card.douyin { --s-brand: #161823; }
.social-card.bili   { --s-brand: #00AEEC; }

/* Douyin: dark bg needs a slight lift in dark mode */
.social-card.douyin .social-icon {
  background: linear-gradient(135deg, #2d2d2d 0%, #161823 100%);
  border: 1px solid rgba(255,255,255,.12);
}

/* ── Results ── */
.results {
  min-width: 0;
  min-height: 60vh;
}
.discovery-panel { margin-bottom: 14px; }
.discovery-panel:empty { display: none; }
.discovery-hero { padding: 18px; border: 1px solid var(--border); border-left-color: var(--accent); border-radius: var(--radius-lg); background: var(--panel); display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.discovery-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.discovery-hero h1 { margin: 4px 0; font-family: var(--font-display); font-size: 22px; font-weight: 720; letter-spacing: -.015em; }
.discovery-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.discovery-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.discovery-actions button { white-space: nowrap; }
.charts-hero { padding: 18px; border: 1px solid var(--border); border-left-color: var(--accent); border-radius: var(--radius-lg); background: var(--panel); display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.charts-hero h1 { margin: 4px 0; font-family: var(--font-display); font-size: 22px; font-weight: 720; letter-spacing: -.015em; }
.charts-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.charts-region-controls { display: grid; justify-items: end; gap: 8px; min-width: 0; }
.charts-region-label { display: grid; grid-template-columns: auto minmax(140px, auto); align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.charts-region-select { min-width: 148px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-hover); color: var(--text); padding: 7px 10px; font: inherit; cursor: pointer; }
.chart-region-quick { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.chart-region-chip { min-height: 32px; border: 1px solid var(--border); border-radius: var(--radius-md); background: transparent; color: var(--muted); padding: 5px 8px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chart-region-chip:hover { color: var(--text); border-color: var(--border-hover); }
.chart-region-chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 650; }

/* Results Header */
.results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  min-width: 0;
}
.result-summary {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

/* Filter Pills */
.filter-pills-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.filter-pill {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--border-hover); color: var(--text); }
.filter-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Results Actions */
.results-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.density-control { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.density-control select { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); padding: 3px 5px; font: inherit; }
.secondary {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
  padding: 6px 12px;
  font-size: 13px;
}
.secondary:hover { border-color: var(--border-hover); background: var(--panel-hover); }
.secondary:active { transform: translateY(1px); }
.small { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.dedupe { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.dedupe input { cursor: pointer; }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  min-height: 430px;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  width: 80px;
  height: 80px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--muted);
}
.empty-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-desc { font-size: 14px; max-width: 300px; line-height: 1.6; }
.empty-state.error .empty-icon { border-color: rgba(239,68,68,.3); color: var(--red); }
.empty-state.error .empty-title { color: var(--red); }
.empty-retry {
  margin-top: 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 18px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s;
}
.empty-retry:hover { border-color: var(--border-hover); }
.empty-retry:active { transform: translateY(1px); }

/* ── Grid & Cards ── */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.grid.density-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.density-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.density-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Thumb */
.thumb {
  aspect-ratio: 1 / 1;
  background: #0a0d14;
  position: relative;
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .35s ease, transform .3s ease;
}
.thumb img.loaded { opacity: 1; }

/* Card Overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 55%, transparent 100%);
  opacity: 0;
  transition: opacity .2s;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  gap: 5px;
}
.card-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; z-index: 2; pointer-events: none; }
.card-badge { background: rgba(15,17,21,.78); color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 5px; padding: 2px 5px; font-size: 10px; font-weight: 700; }
.card-badge.vc { background: var(--accent-2); color: var(--accent-contrast); }
.favorite-button { position: absolute; right: 4px; top: 4px; z-index: var(--z-card); border: 1px solid rgba(255,255,255,.26); border-radius: var(--radius-full); width: 44px; height: 44px; display: grid; place-items: center; background: rgba(15,17,21,.65); color: #fff; cursor: pointer; }
.favorite-button.active { color: var(--accent); background: var(--panel); }
.card:focus-within .card-overlay { opacity: 1; }
.overlay-btn {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
  font-weight: 500;
}
.overlay-btn:hover { background: rgba(255,255,255,.22); }

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }
  .card:hover .thumb img { transform: scale(1.05); }
  .card:hover .card-overlay { opacity: 1; }
}

@media (hover: none) {
  .card-overlay { opacity: 1; }
}

/* Card Check Badge */
.card-check {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.card.selected .card-check { opacity: 1; transform: scale(1); }

/* Card Meta */
.meta { padding: 12px 11px; display: grid; gap: 6px; }
.title { font-weight: 650; font-size: 13px; line-height: 1.35; letter-spacing: -.01em; }
.artist { color: var(--muted); font-size: 12px; }
.artist a { color: var(--muted); text-decoration: none; transition: color .15s; }
.artist a:hover { color: var(--accent); }
.info { color: var(--muted); font-size: 11px; }
.select-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin-top: 2px;
}
.select-row input[type="checkbox"] { transform: scale(1.15); cursor: pointer; accent-color: var(--accent); }

/* ── Skeleton Cards ── */
.card.skeleton { pointer-events: none; cursor: default; }
.card.skeleton:hover { transform: none; border-color: var(--border); box-shadow: none; }
.skeleton-img {
  aspect-ratio: 1;
  background: var(--panel);
  position: relative;
  overflow: hidden;
}
.skeleton-img::after,
.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.skeleton-line {
  background: rgba(255,255,255,.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.skeleton-line-title { height: 13px; }
.skeleton-line-artist { width: 65%; height: 11px; }
.skeleton-line-meta { width: 45%; height: 10px; }
.card.skeleton .meta { padding: 10px; display: grid; gap: 8px; }

/* ── Artist Header ── */
.artist-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.artist-meta { display: flex; align-items: center; gap: 10px; }
.artist-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.artist-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.artist-card-avatar {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 800;
  color: rgba(255,255,255,.5);
  letter-spacing: -1px;
}
.avatar-tone-0 { background: #6f2e24; }
.avatar-tone-1 { background: #6b4938; }
.avatar-tone-2 { background: #733b43; }
.avatar-tone-3 { background: #78623b; }
.avatar-tone-4 { background: #51413b; }
.avatar-tone-5 { background: #8c4332; }
.artist-header-image { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.artist-header-image.loaded { opacity: 1; }
.artist-name { font-weight: 700; font-size: 15px; }
.artist-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.artist-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.artist-sort select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

/* ── Progress Bar (fixed bottom) ── */
.download-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-download-progress);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 10px 24px 14px;
  animation: slideUp .2s ease;
}
.download-progress.hidden { display: none; }
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.dl-track {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin-bottom: 7px;
}
.dl-fill {
  width: 100%;
  height: 100%;
  display: block;
  appearance: none;
  border: 0;
  background: transparent;
  overflow: hidden;
  border-radius: var(--radius-full);
}
.dl-fill::-webkit-progress-bar { background: var(--border); }
.dl-fill::-webkit-progress-value { background: var(--accent); transition: width .25s ease; }
.dl-fill::-moz-progress-bar { background: var(--accent); }
.dl-info { display: flex; align-items: center; justify-content: center; gap: 12px; }
.dl-text { font-size: 12px; color: var(--muted); }

/* Push toasts above progress bar when downloading */
body.downloading .toast,
body.has-download-selection .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* ── Toast ── */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast .toast-msg {
  pointer-events: auto;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 220px;
  max-width: 320px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toastIn .2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast .success { border-color: var(--success); }
.toast .error   { border-color: var(--red); }
.toast .info    { border-color: var(--border); }

/* ── Footer ── */
.footer {
  width: min(100%, 1488px);
  margin-inline: auto;
  color: var(--muted);
  font-size: 12px;
  padding: 20px 24px 24px;
  text-align: center;
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Modal ── */
.modal {
  width: min(860px, calc(100% - 32px));
  max-width: 860px;
  max-height: 90vh;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.modal::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
.modal-content {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  animation: modalIn .2s ease;
  box-shadow: 0 24px 80px rgba(10, 4, 2, .54);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 44px;
  height: 44px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s;
  z-index: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--border-hover); }
.modal-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  padding: 20px;
}
.modal-left { display: flex; flex-direction: column; gap: 10px; }
.modal-cover-wrap { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--bg); }
.modal-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .3s;
}
.modal-cover-wrap img.loaded { opacity: 1; }
.artwork-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #090b0f; }
.motion-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.motion-note { color: var(--muted); font-size: 11px; }
.modal-dl-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

/* Modal Advanced */
.modal-advanced {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.modal-advanced summary {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.modal-advanced summary::-webkit-details-marker { display: none; }
.modal-advanced summary::before { content: '▸ '; }
.modal-advanced[open] summary::before { content: '▾ '; }
.modal-advanced summary:hover { color: var(--text); }
.modal-options { padding: 10px 12px; display: grid; gap: 10px; }
.modal-options .option-block { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-options .sizes label {
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

/* Modal Right */
.modal-right { display: grid; gap: 0; align-content: start; }
.modal-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.4; letter-spacing: -.01em; }
.modal-artist { color: var(--muted); margin-top: 6px; font-size: 14px; }
.modal-artist a { color: var(--accent); text-decoration: none; }
.modal-artist a:hover { text-decoration: underline; }
.modal-meta {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.modal-links { margin-top: 12px; display: grid; gap: 6px; }
.link-row { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.link-label { color: var(--muted); min-width: 80px; }
.link-status { min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.3; }
.secondary.copy-success {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}
.clipboard-staging {
  position: fixed;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.link-btn {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  padding: 3px 10px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.link-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.tracks-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 16px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.tracks-title { font-weight: 700; font-size: 14px; }
.track-list-status { color: var(--muted); font-size: 11px; }
.track-list { margin: 8px 0 0; padding-left: 0; max-height: 310px; overflow: auto; font-size: 13px; }
.track-list .disc-title { font-weight: 700; margin: 10px 0 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.track-list ol { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 3px; }
.track-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; min-height: 48px; padding: 4px 4px 4px 0; border-radius: 7px; color: var(--muted); }
.track-row:hover, .track-row.is-playing { background: var(--panel-hover); color: var(--text); }
.track-number { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.track-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track-duration { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.track-preview { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: var(--radius-full); width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; font-size: 11px; }
.track-preview:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.track-preview:disabled { opacity: .38; cursor: not-allowed; }
.track-explicit { margin-left: 5px; color: var(--muted); font-size: 10px; border: 1px solid var(--border); border-radius: 3px; padding: 0 2px; vertical-align: 1px; }
.track-player { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-hover); animation: trackPlayerIn .18s ease both; }
@keyframes trackPlayerIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.inline-preview { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: calc(100vw - 40px); }
.inline-preview-video { width: min(420px, calc(100vw - 40px)); border-radius: var(--radius-lg); background: #000; box-shadow: 0 15px 50px rgba(0,0,0,.45); }
.track-player-now { display: grid; gap: 1px; min-width: 0; }
.track-player-eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.track-player-now strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.track-player-controls { display: grid; grid-template-columns: 30px minmax(40px, 1fr) auto auto; align-items: center; gap: 8px; margin-top: 7px; }
.track-player-button { width: 30px; height: 30px; border: 0; border-radius: 999px; color: var(--accent-contrast); background: var(--accent); cursor: pointer; }
.track-player-button:disabled { opacity: .45; cursor: not-allowed; }
.track-player-progress { width: 100%; accent-color: var(--accent); cursor: pointer; }
.track-player-progress:disabled { cursor: not-allowed; }
.track-player-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

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

.settings-dialog, .storage-notice { width: min(440px, calc(100% - 28px)); border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--panel); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.settings-dialog::backdrop, .storage-notice::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
.settings-dialog-content, .storage-notice form { padding: 20px; display: grid; gap: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.settings-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.settings-dialog h2, .storage-notice h2 { margin: 0; font-size: 17px; }
.settings-field { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
.settings-field select { color: var(--text); background: var(--panel-hover); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font: inherit; }
.settings-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.settings-note, .storage-notice p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

/* ── Light Theme ── */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: var(--light-bg);
    --panel: var(--light-panel);
    --panel-hover: var(--light-panel-hover);
    --muted: var(--light-muted);
    --text: var(--light-text);
    --accent: var(--light-accent);
    --accent-strong: var(--light-accent-strong);
    --accent-2: var(--light-accent-2);
    --accent-contrast: var(--light-accent-contrast);
    --accent-soft: var(--light-accent-soft);
    --border: var(--light-border);
    --border-hover: var(--light-border-hover);
    --red: var(--light-red);
    --success: var(--light-success);
    --shadow: 0 12px 30px rgba(83, 37, 23, .09);
    --focus-ring: 0 0 0 3px rgba(181, 43, 28, .17);
  }
}
[data-theme="light"] {
  color-scheme: light;
  --bg: var(--light-bg);
  --panel: var(--light-panel);
  --panel-hover: var(--light-panel-hover);
  --muted: var(--light-muted);
  --text: var(--light-text);
  --accent: var(--light-accent);
  --accent-strong: var(--light-accent-strong);
  --accent-2: var(--light-accent-2);
  --accent-contrast: var(--light-accent-contrast);
  --accent-soft: var(--light-accent-soft);
  --border: var(--light-border);
  --border-hover: var(--light-border-hover);
  --red: var(--light-red);
  --success: var(--light-success);
  --shadow: 0 12px 30px rgba(83, 37, 23, .09);
  --focus-ring: 0 0 0 3px rgba(181, 43, 28, .17);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #201411;
  --panel: #2a1b17;
  --panel-hover: #38231e;
  --muted: #c6a99c;
  --text: #f8eee5;
  --accent: #ff765f;
  --accent-strong: #ff927f;
  --accent-2: #d64b34;
  --accent-contrast: #2b100b;
  --accent-soft: rgba(255, 118, 95, .13);
  --border: #53362e;
  --border-hover: #936052;
  --red: #ff7380;
  --success: #b6c98d;
  --shadow: 0 14px 38px rgba(8, 3, 2, .28);
  --focus-ring: 0 0 0 3px rgba(255, 118, 95, .26);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .grid,
  .grid.density-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.density-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.density-6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .app-header { padding-inline: 18px; }
  .controls { padding-inline: 18px; }
  .panel {
    grid-template-columns: minmax(220px, 244px) minmax(0, 1fr);
    padding-inline: 18px;
  }
}

@media (max-width: 920px) {
  .top-nav { order: 3; width: 100%; overflow-x: auto; padding-top: 4px; }
  .app-header { flex-wrap: wrap; padding-block: 12px; }
  .controls { padding-block: 14px; }
  .panel { grid-template-columns: minmax(0, 1fr); }
  .results { order: 2; }
  .options {
    order: 1;
    position: static;
    display: block;
    padding: 0;
    overflow: hidden;
  }
  .settings-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    list-style: none;
  }
  .settings-summary::-webkit-details-marker { display: none; }
  .settings-summary::after {
    content: '＋';
    margin-left: auto;
    color: var(--muted);
    font-weight: 400;
  }
  .settings-disclosure[open] .settings-summary::after { content: '－'; }
  .settings-summary-meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
  }
  .settings-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border-top: 1px solid var(--border);
  }
  .option-section { margin: 0; }
  .download-action {
    padding: 0 16px 16px;
    margin: 0;
  }
  .social { display: none; }
  .artist-header { grid-template-columns: auto 1fr; }
  .artist-sort { display: none; }
}

@media (max-width: 720px) {
  body.has-download-selection { padding-bottom: 72px; }
  .settings-content { grid-template-columns: 1fr; }
  .download-action {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 12px;
    z-index: var(--z-download-action);
    margin: 0;
  }
  .download-main-btn {
    min-height: 48px;
    box-shadow: 0 10px 30px rgba(0,0,0,.32);
  }
}

@media (max-width: 600px) {
  /* Mobile is a focused discovery flow: one clear search action, then readable albums. */
  .app-header {
    gap: 6px;
    padding: 8px 16px 6px;
  }
  .header-right { margin-left: auto; }
  .theme-select { display: none; }
  .top-nav {
    justify-content: space-between;
    gap: 0;
    padding-top: 0;
  }
  .nav-button { min-height: 36px; padding: 6px 8px 5px; font-size: 13px; }
  .discovery-hero,
  .charts-hero { display: grid; align-items: start; padding: 16px; }
  .discovery-actions { justify-content: flex-start; }
  .charts-region-controls { justify-items: start; width: 100%; }
  .charts-region-label { grid-template-columns: 1fr; justify-items: start; gap: 4px; }
  .charts-region-select { min-height: 42px; width: 100%; }
  .chart-region-quick { width: 100%; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 2px; justify-content: flex-start; scrollbar-width: none; }
  .chart-region-quick::-webkit-scrollbar { display: none; }
  .chart-region-chip { flex: 0 0 auto; min-height: 38px; }
  .top-nav { margin-left: 0; }
  .grid,
  .grid.density-4,
  .grid.density-5,
  .grid.density-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-vinyl { width: 36px; height: 36px; }
  .header-logo { gap: 8px; min-width: 0; }
  .header-right { gap: 4px; }
  .region-select,
  .theme-select {
    min-width: 96px;
    max-width: 112px;
    padding: 6px 8px;
    font-size: 12px;
  }
  .controls { padding: 8px 16px 10px; }
  .panel { padding: 0 16px 24px; }
  .search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "tabs tabs"
      "query submit";
    gap: 8px;
    padding: 8px;
  }
  .search-tabs {
    grid-area: tabs;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }
  .search-tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 7px 9px;
    font-size: 12px;
    text-align: center;
  }
  .search-divider { display: none; }
  .search-bar input[type="search"] {
    grid-area: query;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg);
    font-size: 16px;
  }
  .search-submit {
    grid-area: submit;
    min-height: 38px;
    padding: 8px 16px;
  }
  .search-hint { padding-inline: 2px; }
  .search-shortcut { display: none; }
  .quick-searches {
    align-items: center;
    height: 32px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 1px 2px 3px;
    scrollbar-width: none;
  }
  .quick-searches button { flex: 0 0 auto; height: 28px; }
  .quick-searches::-webkit-scrollbar { display: none; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .filter-pills-row,
  .results-actions {
    width: 100%;
    margin-left: 0;
  }
  .filter-pills-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-pill { flex: 1; text-align: center; padding-inline: 8px; }
  .results-actions { justify-content: flex-start; }
  .density-control { display: none; }
  .dedupe { margin-left: auto; }
  .empty-state { min-height: 360px; padding: 52px 18px; }
  .grid { gap: 12px; }
  .card { border-radius: 12px; }
  .meta { padding: 9px 8px 10px; gap: 4px; }
  .title { font-size: 13px; line-height: 1.3; }
  .artist { font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .info { font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .favorite-button { width: 36px; height: 36px; right: 5px; top: 5px; background: rgba(15,17,21,.46); }
  .card-overlay { display: none; }
  .select-row { display: none; }
  .modal {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 10px);
    margin: auto 0 0;
  }
  .modal-content {
    width: 100%;
    max-height: calc(100dvh - 10px);
    border-radius: 20px 20px 0 0;
  }
  .modal-body { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .modal-left { max-width: 220px; width: 100%; margin-inline: auto; }
  .modal-right { min-width: 0; }
  .modal-title { font-size: 21px; padding-right: 42px; }
  .modal-close { right: 10px; top: 10px; border-radius: 999px; }
  .track-list { max-height: none; overflow: visible; }
  .track-row { grid-template-columns: 23px minmax(0, 1fr) auto 44px; gap: 6px; }
  .track-player-controls { grid-template-columns: 30px minmax(30px, 1fr) auto; }
  .track-player-controls .secondary { display: none; }
  .logo-text { font-size: 18px; }
  .logo-sub { display: none; }
}

@media (max-width: 380px) {
  .app-header { align-items: flex-start; }
  .logo-text { font-size: 17px; }
  .region-select,
  .theme-select { min-width: 88px; max-width: 96px; }
  .grid,
  .grid.density-4,
  .grid.density-5,
  .grid.density-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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