:root {
  color-scheme: dark;
  --bg: #0f0f13;
  --bg-surface: #1a1a24;
  --bg-hover: #24243a;
  --bg-active: #2d2d4a;
  --text: #e8e6f0;
  --text-muted: #8888a8;
  --accent: #7c6fff;
  --accent-dim: #5a4fd4;
  --accent-bright: #a69eff;
  --accent-soft: rgb(124 111 255 / 14%);
  --info: #4a90e2;
  --success: #5fcf9f;
  --warning: #efb45d;
  --danger: #ef6f7a;
  --border: #2a2a3e;
  --border-strong: #3c3c59;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --sidebar-width: 224px;
  --shadow-menu: 0 18px 48px rgb(0 0 0 / 38%);
}

* {
  box-sizing: border-box;
}

html {
  /*
   * The parser-blocking head bootstrap supplies the physical screen height
   * before the first iOS standalone paint. Other browsers use their dynamic
   * viewport.
   */
  height: 100vh;
  height: var(--app-viewport-height, 100dvh);
  min-width: 320px;
  overflow: hidden;
  scroll-behavior: smooth;
  background: var(--bg);
  /*
   * iOS Safari (15+) ignores maximum-scale/user-scalable in the viewport
   * meta tag, even in installed-PWA standalone mode, so pinch-zoom has to
   * be blocked here instead: pan-x/pan-y keep normal scrolling but omit
   * pinch-zoom, which browsers treat as disabling it (and double-tap zoom).
   */
  touch-action: pan-x pan-y;
}

body {
  height: 100vh;
  height: var(--app-viewport-height, 100dvh);
  min-width: 320px;
  min-height: 100vh;
  min-height: var(--app-viewport-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  touch-action: pan-x pan-y;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

svg {
  display: block;
}

select,
option {
  background: var(--bg);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-surface);
  box-shadow: var(--shadow-menu);
  color: var(--text);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.app-shell {
  height: auto;
  min-height: 0;
  background: var(--bg);
}

.header-accent {
  color: var(--info);
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: calc(var(--sidebar-width) + env(safe-area-inset-left, 0px));
  flex-direction: column;
  padding:
    calc(20px + env(safe-area-inset-top, 0px))
    12px
    calc(16px + env(safe-area-inset-bottom, 0px))
    calc(12px + env(safe-area-inset-left, 0px));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #14141c;
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  margin: 0 8px 24px;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgb(124 111 255 / 35%);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.brand-mark::after {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-bright);
  content: "";
}

.brand-mark span {
  width: 2px;
  border-radius: 2px;
  background: var(--accent-bright);
}

.brand-mark span:nth-child(1),
.brand-mark span:nth-child(5) {
  height: 8px;
}

.brand-mark span:nth-child(2),
.brand-mark span:nth-child(4) {
  height: 15px;
}

.brand-mark span:nth-child(3) {
  height: 22px;
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-nav {
  display: grid;
  gap: 4px;
}

.primary-nav a {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 550;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.primary-nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.primary-nav a.active {
  border-color: rgb(124 111 255 / 28%);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.primary-nav svg,
.mobile-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: auto;
  padding: 13px 10px 0;
  border-top: 1px solid var(--border);
}

.sidebar-note > span:last-child {
  display: grid;
  min-width: 0;
}

.sidebar-note strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.sidebar-note small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgb(95 207 159 / 12%);
}

.workspace {
  display: flex;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  margin-left: calc(var(--sidebar-width) + env(safe-area-inset-left, 0px));
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 15;
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    calc(24px + env(safe-area-inset-right, 0px))
    10px
    calc(24px + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--border);
  background: rgb(26 26 36 / 92%);
  backdrop-filter: blur(16px);
}

.mobile-brand {
  display: none;
}

.global-search {
  position: relative;
  width: min(720px, 100%);
  min-width: 0;
  margin: 0 auto;
}

.settings-button {
  position: relative;
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.settings-button svg,
.settings-close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sync-indicator {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--bg-surface);
  border-radius: 50%;
  background: var(--text-muted);
}

.settings-button.is-synced .sync-indicator {
  background: var(--success);
}

.settings-button.has-sync-problem .sync-indicator {
  background: var(--warning);
}

.global-search > svg {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--text-muted);
  stroke-linecap: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  height: 42px;
  padding: 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.global-search input:focus {
  border-color: var(--accent);
  background: #13131a;
  box-shadow: 0 0 0 3px rgb(124 111 255 / 12%);
}

.global-search input::placeholder {
  color: #6f6f8d;
}

.global-search kbd {
  position: absolute;
  top: 50%;
  right: 11px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  transform: translateY(-50%);
}

.search-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: min(480px, calc(100vh - 100px));
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-menu);
}

.search-result {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius);
  transition: background 100ms ease;
}

.search-result:hover,
.search-result[aria-selected="true"] {
  background: var(--bg-hover);
}

.search-result-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgb(124 111 255 / 24%);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.search-result-icon.album {
  border-color: rgb(239 180 93 / 24%);
  background: rgb(239 180 93 / 10%);
  color: var(--warning);
}

.search-result-icon.recording {
  border-color: rgb(74 144 226 / 25%);
  background: rgb(74 144 226 / 11%);
  color: #7eb4f3;
}

.search-result-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

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

.search-result-copy strong,
.search-result-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.search-result-copy small {
  color: var(--text-muted);
  font-size: 11px;
}

main {
  width: 100%;
  max-width: 1440px;
  min-height: 0;
  flex: 1;
  align-self: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding:
    28px
    calc(32px + env(safe-area-inset-right, 0px))
    calc(30px + env(safe-area-inset-bottom, 0px))
    calc(32px + env(safe-area-inset-left, 0px));
  scrollbar-color: var(--border-strong) transparent;
}

main:focus {
  outline: none;
}

/* The desktop footer is the framework's .list-footer, unmodified: it brings the
   padding, safe-area reserve, border, background, centring and the out-of-flow
   version label, and framework.js injects the copyright. The only thing left
   for this app to say is which breakpoint it belongs to — see the mobile block,
   where this hides and .mobile-footer takes over. */
#status-message {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persistent-player {
  position: relative;
  z-index: 20;
  display: grid;
  min-width: 0;
  flex: 0 0 auto;
  grid-template-columns: minmax(180px, 0.75fr) minmax(280px, 1.25fr) auto;
  gap: 16px;
  align-items: center;
  padding: 8px calc(24px + env(safe-area-inset-right, 0px))
    8px calc(24px + env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--border-strong);
  background: rgb(20 20 29 / 98%);
  box-shadow: 0 -12px 32px rgb(0 0 0 / 20%);
}

.persistent-player[hidden] {
  display: none;
}

.persistent-player [hidden] {
  display: none;
}

.persistent-player-summary {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
}

.persistent-player-art {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.persistent-player-art svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.persistent-player-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.persistent-player-copy small {
  overflow: hidden;
  color: var(--accent-bright);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.persistent-player-copy strong,
.persistent-player-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persistent-player-copy strong {
  font-size: 12px;
}

.persistent-player-copy > span {
  color: var(--text-muted);
  font-size: 10px;
}

.persistent-player-media {
  min-width: 0;
}

.persistent-player .persistent-native-player {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.persistent-native-player .audio-player-heading {
  min-height: 16px;
}

.persistent-native-player .audio-player {
  margin-top: 2px;
}

.persistent-player .persistent-soundcloud-player {
  height: 166px;
  margin: 0;
}

.persistent-player .persistent-youtube-player {
  height: 166px;
  margin: 0;
}

.persistent-player-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.persistent-player-link {
  min-height: 32px;
  padding: 0 9px;
  font-size: 10px;
}

.persistent-player-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.persistent-player-close {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.persistent-player-close svg,
.playback-select svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.playback-select svg {
  fill: currentColor;
  stroke: none;
}

.mobile-nav {
  display: none;
}

.mobile-footer {
  display: none;
}

.eyebrow {
  display: block;
  margin: 0 0 6px;
  color: var(--accent-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
.display-title {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h2 {
  margin-bottom: 4px;
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h3 {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 650;
}

.lede {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.overview-hero {
  position: relative;
  display: grid;
  min-height: 236px;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.7fr);
  gap: 28px;
  align-items: center;
  padding: clamp(26px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 86% 30%, rgb(124 111 255 / 13%), transparent 17rem),
    var(--bg-surface);
}

.overview-hero::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--info));
  content: "";
}

.overview-hero h1 {
  max-width: 720px;
}

.hero-record {
  position: relative;
  display: grid;
  width: min(158px, 100%);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at center,
      #15151d 0,
      #15151d 3px,
      #20202c 4px,
      #15151d 6px
    );
  box-shadow: 0 16px 34px rgb(0 0 0 / 24%);
  animation: record-in 420ms ease-out both;
}

.hero-record::before {
  display: grid;
  width: 38%;
  height: 38%;
  place-items: center;
  border: 1px solid rgb(166 158 255 / 45%);
  border-radius: 50%;
  background: var(--accent-dim);
  color: #fff;
  content: "GT";
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.hero-record::after {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  content: "";
}

@keyframes record-in {
  from {
    opacity: 0;
    transform: translateX(16px) rotate(8deg) scale(0.95);
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stat-card {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.stat-card strong {
  display: block;
  font-size: clamp(23px, 2.4vw, 30px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section-block {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 13px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.text-link {
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.text-link:hover,
.table-link:hover,
.location-provider-link:hover,
.audio-player-fallback:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.entity-card {
  position: relative;
  display: grid;
  min-height: 124px;
  grid-template-rows: auto 1fr auto;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition:
    background 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.favorite-row {
  position: relative;
  min-width: 0;
}

.row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.entity-card-row {
  min-height: 124px;
}

.entity-card-row > .entity-card {
  height: 100%;
  padding-right: 54px;
}

.favorite-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: rgb(15 15 19 / 88%);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 110ms ease,
    border-color 110ms ease,
    color 110ms ease,
    transform 110ms ease;
}

.favorite-button:hover {
  border-color: var(--warning);
  background: var(--bg-hover);
  color: var(--warning);
  transform: scale(1.04);
}

.favorite-button svg {
  width: 19px;
  height: 19px;
  fill: transparent;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.favorite-button.is-favorite {
  border-color: rgb(239 180 93 / 45%);
  background: rgb(239 180 93 / 13%);
  color: var(--warning);
}

.favorite-button.is-favorite svg {
  fill: currentColor;
}

.favorite-row > .favorite-button {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.favorite-row > .favorite-button:hover {
  transform: translateY(-50%) scale(1.04);
}

.entity-card-row > .favorite-button {
  top: 13px;
  transform: none;
}

.entity-card-row > .favorite-button:hover {
  transform: scale(1.04);
}

.entity-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.card-kicker {
  margin-bottom: 6px;
  color: var(--accent-bright);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.entity-card h3 {
  max-width: calc(100% - 8px);
  font-size: 17px;
  line-height: 1.25;
}

.card-meta,
.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
}

.card-meta {
  margin-top: 3px;
}

.metric-row {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.metric-row strong {
  color: var(--text);
  font-weight: 650;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.provider-row {
  display: grid;
  min-height: 56px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(110px, 1.2fr) auto 16px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition:
    background 120ms ease,
    border-color 120ms ease;
}

.provider-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.provider-name {
  display: grid;
  min-width: 0;
}

.provider-name strong,
.provider-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-name strong {
  font-size: 13px;
  font-weight: 600;
}

.provider-name small {
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.provider-bar {
  width: 100%;
  height: 5px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 99px;
  background: var(--bg);
}

.provider-bar::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--bg);
}

.provider-bar::-webkit-progress-value,
.provider-bar::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dim), var(--info));
}

.provider-count {
  display: grid;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.provider-count strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.provider-count small {
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-section:first-of-type {
  margin-top: 0;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.source-card {
  display: grid;
  min-height: 158px;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition:
    background 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.source-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.source-card-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgb(124 111 255 / 24%);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.source-card-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.source-card-copy h3 {
  margin: 3px 0 4px;
  font-size: 17px;
}

.source-card-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.source-card-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.playable-count {
  color: var(--warning);
}

.source-availability {
  color: var(--text-muted);
}

.source-results {
  margin-top: 20px;
}

.source-results-heading {
  margin-bottom: 13px;
}

.section-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.section-heading-actions .result-count {
  padding-bottom: 0;
}

.source-controls {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, auto);
}

.source-recording-row {
  grid-template-columns: minmax(220px, 1.5fr) minmax(100px, 0.55fr) minmax(45px, 0.25fr) minmax(80px, 0.45fr) minmax(66px, auto) 18px;
}

.source-row-action {
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.page-heading {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-heading .lede {
  max-width: 600px;
}

.result-count {
  padding-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.filters-panel {
  margin-bottom: 12px;
}

.filters-panel .browse-controls,
.filters-panel .source-controls {
  margin-top: 8px;
  margin-bottom: 0;
}

.filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition:
    background 110ms ease,
    border-color 110ms ease,
    color 110ms ease;
}

.filters-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  color: var(--accent-bright);
}

.filters-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-count {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.filters-chevron {
  display: inline-flex;
  margin-left: 1px;
  transition: transform 130ms ease;
}

.filters-panel.is-open .filters-chevron {
  transform: rotate(180deg);
}

.browse-controls {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) repeat(3, minmax(130px, auto));
  gap: 8px;
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.field {
  position: relative;
  display: grid;
  gap: 4px;
}

.field label {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(124 111 255 / 12%);
}

.field input::placeholder {
  color: #6f6f8d;
}

.jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.jump-chip {
  display: inline-flex;
  min-width: 32px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition:
    background 110ms ease,
    border-color 110ms ease,
    color 110ms ease;
}

.jump-chip:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  color: var(--accent-bright);
}

.jump-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.catalog-list {
  display: grid;
  gap: 5px;
}

.catalog-row {
  display: grid;
  min-height: 60px;
  grid-template-columns: minmax(220px, 1.5fr) minmax(90px, 0.55fr) repeat(4, minmax(70px, 0.45fr)) 18px;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition:
    background 110ms ease,
    border-color 110ms ease;
}

.catalog-favorite-row > .catalog-row,
.recording-favorite-row > .recording-row,
.track-favorite-row > .track-row {
  padding-right: 56px;
}

.catalog-row.album-row {
  grid-template-columns: minmax(220px, 1.5fr) minmax(120px, 0.65fr) repeat(3, minmax(70px, 0.45fr)) 18px;
}

.catalog-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.row-title {
  min-width: 0;
}

.row-title strong,
.row-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title strong {
  font-size: 13px;
  font-weight: 600;
}

.row-title small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.row-metric {
  color: var(--text-muted);
  font-size: 10px;
  text-align: right;
}

.row-metric strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.row-arrow {
  color: var(--accent-bright);
  font-size: 18px;
  text-align: right;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 21px;
  align-items: center;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid rgb(124 111 255 / 24%);
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.gold {
  border-color: rgb(239 180 93 / 26%);
  background: rgb(239 180 93 / 11%);
  color: var(--warning);
}

.badge.coral,
.badge.unresolved {
  border-color: rgb(239 111 122 / 27%);
  background: rgb(239 111 122 / 11%);
  color: #ff9ca5;
}

.badge.neutral,
.badge.unknown,
.badge.provisional {
  border-color: var(--border-strong);
  background: rgb(136 136 168 / 9%);
  color: #aaaac4;
}

.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition:
    background 110ms ease,
    border-color 110ms ease,
    color 110ms ease;
}

.button:hover,
.icon-button:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  color: var(--accent-bright);
}

.button.primary {
  border-color: var(--accent-dim);
  background: var(--accent-dim);
  color: #fff;
}

.button.primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.entity-header {
  position: relative;
  padding: clamp(22px, 3vw, 32px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, rgb(124 111 255 / 7%), transparent 44%),
    var(--bg-surface);
  padding-right: clamp(72px, 8vw, 94px);
}

.entity-header::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--info));
  content: "";
}

.entity-header > .back-btn {
  position: relative;
  z-index: 2;
  margin-bottom: 10px;
}

.breadcrumbs {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 11px;
}

.breadcrumbs a {
  color: var(--accent-bright);
  font-weight: 600;
}

.entity-title-wrap {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.entity-header > .detail-favorite {
  position: absolute;
  z-index: 3;
  top: clamp(20px, 3vw, 30px);
  right: clamp(20px, 3vw, 30px);
  width: 40px;
  height: 40px;
}

.entity-title-wrap h1 {
  margin-bottom: 9px;
  overflow-wrap: anywhere;
}

.entity-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
}

.entity-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.entity-links a {
  color: var(--accent-bright);
  font-weight: 600;
  font-size: 12px;
}

.alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.alias {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.detail-main,
.detail-aside {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

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

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
}

.panel-heading h2 {
  font-size: 20px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mini-stat {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.mini-stat strong,
.mini-stat span {
  display: block;
}

.mini-stat strong {
  font-size: 19px;
  font-weight: 650;
}

.mini-stat span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.compact-list {
  display: grid;
}

.compact-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 9px 3px;
  border-bottom: 1px solid var(--border);
}

.compact-row:last-child {
  border-bottom: 0;
}

.compact-row:hover strong {
  color: var(--accent-bright);
}

.compact-row strong {
  transition: color 100ms ease;
}

.compact-row small {
  display: block;
  margin-top: 1px;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 10px;
}

.compact-metric {
  color: var(--text-muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.provider-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.provider-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
}

.provider-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.provider-chip strong {
  color: var(--text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.table-link {
  color: var(--accent-bright);
  font-weight: 600;
}

.release-block + .release-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.release-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.release-heading h3 {
  margin: 0;
  font-size: 16px;
}

.release-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
}

.track-list {
  display: grid;
}

.track-row {
  display: grid;
  min-height: 42px;
  grid-template-columns: 42px minmax(0, 1fr) minmax(120px, 0.5fr) 58px 20px;
  gap: 10px;
  align-items: center;
  padding: 6px 7px;
  border-radius: var(--radius-sm);
}

.track-row:hover {
  background: var(--bg-hover);
}

.track-position {
  color: var(--text-muted);
  font: 10px ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

.track-title strong,
.track-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-title strong {
  font-size: 12px;
}

.track-title small {
  color: var(--text-muted);
  font-size: 10px;
}

.track-performer {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.track-available {
  color: var(--success);
  font-size: 11px;
  text-align: center;
}

.recording-list {
  display: grid;
  gap: 5px;
}

.recording-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 18px;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition:
    background 100ms ease,
    border-color 100ms ease;
}

.recording-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.recording-row strong,
.recording-row small {
  display: block;
}

.recording-row small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-count {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.location-list {
  display: grid;
  gap: 7px;
}

.location-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.location-copy {
  min-width: 0;
}

.location-copy > strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.location-provider-link {
  font-weight: 650;
}

.location-provider-link:hover {
  color: var(--accent-bright);
}

.location-uri {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-muted);
  font: 10px ui-monospace, SFMono-Regular, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.youtube-link-list {
  display: grid;
  gap: 7px;
}

.youtube-link-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.youtube-link-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.youtube-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.youtube-link-copy strong,
.youtube-link-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-link-copy small {
  color: var(--text-muted);
  font-size: 10px;
}

.native-audio-player {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.archive-audio-player {
  border-left: 3px solid var(--accent);
}

.audio-player-heading {
  display: flex;
  min-height: 30px;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.audio-player-heading > span {
  display: grid;
}

.audio-player-heading strong {
  font-size: 11px;
  font-weight: 650;
}

.audio-player-heading small {
  color: var(--text-muted);
  font-size: 10px;
}

.native-audio-player[data-audio-state="playing"] .audio-player-heading small {
  color: var(--success);
}

.native-audio-player[data-audio-state="error"] {
  border-color: rgb(239 111 122 / 55%);
}

.native-audio-player[data-audio-state="error"] .audio-player-heading small {
  color: #ff9ca5;
}

.audio-player {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 40px;
  margin-top: 7px;
  color-scheme: dark;
}

.audio-retry {
  min-height: 30px;
  padding: 0 9px;
}

.audio-player-fallback {
  display: inline-block;
  margin-top: 5px;
  color: var(--accent-bright);
  font-size: 10px;
  font-weight: 600;
}

.soundcloud-player {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 166px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.provenance-list {
  display: grid;
  gap: 5px;
}

.provenance-row {
  padding: 9px;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg);
}

.provenance-row strong,
.provenance-row small {
  display: block;
}

.provenance-row strong {
  font-size: 11px;
}

.provenance-row small {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 9px;
}

.empty-state,
.error-view {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 32px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.search-results .empty-state {
  min-height: 84px;
  padding: 16px;
  border: 0;
}

.empty-state > div,
.error-view > div {
  max-width: 460px;
}

.empty-icon,
.error-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 19px;
}

.error-icon {
  border-color: rgb(239 111 122 / 34%);
  color: var(--danger);
}

.empty-state p,
.error-view p {
  margin-bottom: 14px;
  color: var(--text-muted);
}

.loading-view {
  display: grid;
  min-height: 52vh;
  place-items: center;
  align-content: center;
  color: var(--text-muted);
}

.loading-record {
  position: relative;
  width: 54px;
  height: 54px;
  margin-bottom: 13px;
  border: 5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-record::after {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

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

.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  max-width: min(340px, calc(100vw - 36px));
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-hover);
  box-shadow: var(--shadow-menu);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.favorites-section {
  margin-top: 24px;
}

.favorites-list {
  display: grid;
  gap: 7px;
}

.favorite-card {
  display: grid;
  min-height: 66px;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  gap: 11px;
  align-items: center;
  padding: 10px 56px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition:
    background 110ms ease,
    border-color 110ms ease;
}

.favorite-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.favorite-card.unavailable {
  border-style: dashed;
  opacity: 0.72;
}

.favorite-card.unavailable .row-arrow {
  visibility: hidden;
}

.favorite-card-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(124 111 255 / 24%);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.favorite-card-icon.album {
  border-color: rgb(239 180 93 / 24%);
  background: rgb(239 180 93 / 10%);
  color: var(--warning);
}

.favorite-card-icon.recording {
  border-color: rgb(74 144 226 / 25%);
  background: rgb(74 144 226 / 11%);
  color: #7eb4f3;
}

.favorite-card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.favorite-card-copy {
  min-width: 0;
}

.favorite-card-copy strong,
.favorite-card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-card-copy strong {
  font-size: 13px;
}

.favorite-card-copy small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.favorites-warning {
  padding: 10px 12px;
  border: 1px solid rgb(239 180 93 / 28%);
  border-radius: var(--radius);
  background: rgb(239 180 93 / 9%);
  color: var(--warning);
  font-size: 11px;
}

.settings-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
}

.settings-overlay[hidden] {
  display: none;
}

.settings-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: rgb(0 0 0 / 56%);
  cursor: default;
}

.settings-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  flex-direction: column;
  border-left: 1px solid var(--border-strong);
  background: #14141c;
  box-shadow: -18px 0 48px rgb(0 0 0 / 32%);
}

.settings-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding:
    calc(20px + env(safe-area-inset-top, 0px))
    calc(20px + env(safe-area-inset-right, 0px))
    17px
    20px;
  border-bottom: 1px solid var(--border);
}

.settings-heading .eyebrow {
  margin-bottom: 3px;
}

.settings-heading h2 {
  margin: 0;
}

.settings-close {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.settings-content {
  display: grid;
  gap: 13px;
  min-height: 0;
  padding:
    18px
    calc(20px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    20px;
  overflow-y: auto;
}

.setting-block {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.setting-block h3 {
  margin-bottom: 7px;
}

.setting-block p {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 11px;
}

.setting-block p strong {
  color: var(--text);
}

.setting-note {
  margin: 11px 0 0 !important;
  line-height: 1.55;
}

.nav-picker {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.nav-picker-row:last-child {
  border-bottom: 0;
}

.nav-picker-row label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.nav-picker-row.is-checked label {
  color: var(--text);
}

.nav-picker-row:not(.is-checked) label {
  color: var(--text-muted);
}

.nav-picker-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.nav-picker-order {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.nav-picker-order button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}

.nav-picker-order button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.nav-picker-order button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.sync-panel {
  display: grid;
  gap: 8px;
}

.sync-signin {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  background: var(--accent-dim);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.sync-signin:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.sync-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.sync-state {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.sync-alt,
.sync-off {
  padding: 0;
  background: transparent;
  color: var(--accent-bright);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.sync-alt:hover,
.sync-off:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sync-alt:disabled,
.sync-off:disabled {
  cursor: wait;
  opacity: 0.5;
}

.sync-message {
  margin: 0 !important;
  color: var(--text-muted);
  font-size: 10px !important;
}

.sync-error {
  color: #ff9ca5 !important;
}

@media (max-width: 1100px) {
  .card-grid,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-grid {
    grid-template-columns: 1fr;
  }

  .catalog-row {
    grid-template-columns: minmax(220px, 1.5fr) minmax(90px, 0.55fr) repeat(2, minmax(70px, 0.4fr)) 18px;
  }

  .catalog-row .row-metric.optional {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    min-height: 60px;
    gap: 12px;
    padding:
      calc(9px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      9px
      calc(14px + env(safe-area-inset-left, 0px));
  }

  .mobile-brand {
    display: flex;
    flex: 0 0 auto;
  }

  .mobile-brand .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .mobile-brand strong {
    display: none;
  }

  .global-search {
    margin: 0;
  }

  .settings-button {
    width: 38px;
    min-width: 38px;
  }

  main {
    padding:
      22px
      calc(18px + env(safe-area-inset-right, 0px))
      24px
      calc(18px + env(safe-area-inset-left, 0px));
  }

  .desktop-footer {
    display: none;
  }

  .persistent-player {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding:
      7px
      calc(14px + env(safe-area-inset-right, 0px))
      7px
      calc(14px + env(safe-area-inset-left, 0px));
  }

  .persistent-player-media {
    grid-column: 1 / -1;
  }

  .persistent-player-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .persistent-player-summary {
    grid-column: 1;
    grid-row: 1;
  }

  .persistent-player-link[data-player-source] {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .persistent-player-link[data-player-source] span {
    display: none;
  }

  /* Keep navigation in the flex shell so document scroll never moves it. */
  .mobile-nav {
    z-index: 40;
    position: relative;
    display: grid;
    height: 44px;
    flex: 0 0 auto;
    grid-template-columns: repeat(var(--nav-item-count, 6), 1fr);
    padding:
      0
      max(6px, env(safe-area-inset-right, 0px))
      0
      max(6px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--border);
    background: rgb(26 26 36 / 96%);
    backdrop-filter: blur(16px);
  }

  .mobile-nav a {
    display: grid;
    min-width: 0;
    place-items: center;
    align-content: center;
    gap: 1px;
    padding: 2px 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 8.5px;
    font-weight: 600;
  }

  .mobile-nav a.active {
    background: var(--accent-soft);
    color: var(--accent-bright);
  }

  .mobile-nav a span {
    overflow: hidden;
    max-width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mobile-nav svg {
    width: 19px;
    height: 19px;
  }

  .mobile-footer {
    z-index: 40;
    display: flex;
    height: max(18px, env(safe-area-inset-bottom, 0px));
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding:
      0
      max(6px, env(safe-area-inset-right, 0px))
      max(0px, calc(env(safe-area-inset-bottom, 0px) - 28px))
      max(6px, env(safe-area-inset-left, 0px));
    background: rgb(26 26 36 / 96%);
    color: var(--text-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }

  .mobile-footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* No opacity. This is 10px --text-muted on the strip's own background —
       already at the edge of the 4.5:1 WCAG AA floor, so any dimming drops it
       under. The small type is what de-emphasises this line. */
    pointer-events: none;
    white-space: nowrap;
  }

  #mobile-version-label {
    /* Framework-filled, so it carries .version-label — which is positioned out
       of flow for a normal footer. This strip lays its own contents out. */
    position: static;
    color: var(--accent-bright);
    font-size: inherit;
    font-weight: 600;
  }

  .toast {
    bottom: calc(54px + max(18px, env(safe-area-inset-bottom, 0px)));
  }

  .overview-hero {
    grid-template-columns: 1fr 0.45fr;
  }

  .hero-record {
    width: 122px;
  }

  .browse-controls {
    grid-template-columns: 1fr 1fr;
  }

  .source-controls {
    grid-template-columns: 1fr 1fr;
  }

  .browse-controls .field:first-child {
    grid-column: 1 / -1;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 9px;
    padding:
      calc(8px + env(safe-area-inset-top, 0px))
      calc(10px + env(safe-area-inset-right, 0px))
      8px
      calc(10px + env(safe-area-inset-left, 0px));
  }

  .mobile-brand .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .global-search input {
    height: 40px;
    padding-right: 12px;
    padding-left: 38px;
    font-size: 16px;
  }

  .global-search > svg {
    left: 12px;
  }

  .global-search kbd {
    display: none;
  }

  main {
    padding:
      16px
      calc(11px + env(safe-area-inset-right, 0px))
      22px
      calc(11px + env(safe-area-inset-left, 0px));
  }

  h1,
  .display-title {
    font-size: 30px;
  }

  h2 {
    font-size: 20px;
  }

  .lede {
    font-size: 13px;
  }

  .overview-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 21px 19px;
  }

  .overview-hero h1 {
    font-size: 31px;
  }

  .hero-record {
    display: none;
  }

  .stat-grid {
    gap: 6px;
    margin-top: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .section-block {
    margin-top: 26px;
  }

  .section-heading,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .page-heading {
    margin-bottom: 13px;
  }

  .result-count {
    padding-bottom: 0;
  }

  .card-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .entity-card {
    min-height: 108px;
    padding: 13px;
  }

  .entity-card-row {
    min-height: 108px;
  }

  .entity-card-row > .entity-card {
    padding-right: 51px;
  }

  .source-card {
    min-height: 0;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 9px 11px;
    padding: 13px;
  }

  .source-card-icon {
    grid-column: 1;
    grid-row: 1;
  }

  .source-card-copy {
    min-width: 0;
    grid-column: 2;
    grid-row: 1;
  }

  .source-card-copy h3 {
    font-size: 15px;
  }

  .source-card-footer {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .provider-row {
    grid-template-columns: minmax(0, 1fr) auto 16px;
  }

  .provider-bar {
    display: none;
  }

  .browse-controls,
  .source-controls {
    grid-template-columns: 1fr;
  }

  .browse-controls .field:first-child {
    grid-column: auto;
  }

  .jump-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .jump-chip {
    flex: 0 0 auto;
  }

  .catalog-row,
  .catalog-row.album-row {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) auto 16px;
    gap: 8px;
    padding: 9px 10px;
  }

  .catalog-favorite-row > .catalog-row,
  .recording-favorite-row > .recording-row,
  .track-favorite-row > .track-row {
    padding-right: 51px;
  }

  .catalog-row.source-recording-row {
    grid-template-columns: minmax(0, 1fr) auto 16px;
  }

  .source-recording-row .row-metric,
  .source-recording-row .badge {
    display: none;
  }

  .source-row-action {
    font-size: 10px;
  }

  .catalog-row .badge,
  .catalog-row .row-metric.optional {
    display: none;
  }

  .catalog-row .row-metric {
    font-size: 9px;
  }

  .entity-header {
    padding: 18px 66px 18px 16px;
  }

  .entity-header > .detail-favorite {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }

  .breadcrumbs {
    margin-bottom: 12px;
  }

  .entity-title-wrap h1 {
    font-size: 29px;
  }

  .detail-aside {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 13px;
  }

  .panel-heading {
    margin-bottom: 9px;
  }

  .track-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 7px;
  }

  .track-performer,
  .track-duration {
    display: none;
  }

  .recording-row {
    grid-template-columns: minmax(0, 1fr) auto 16px;
  }

  .recording-row .recording-count.optional {
    display: none;
  }

  .location-card {
    grid-template-columns: 1fr;
  }

  .youtube-link-card {
    grid-template-columns: 1fr;
  }

  .youtube-link-actions {
    justify-content: flex-start;
  }

  .location-actions {
    justify-content: flex-start;
  }

  .audio-player-heading {
    align-items: flex-start;
  }

  .soundcloud-player {
    height: 166px;
  }

  .favorite-card {
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    gap: 9px;
    padding-right: 51px;
  }

  .favorite-card-icon {
    width: 32px;
    height: 32px;
  }

  .settings-overlay {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    width: min(390px, 100vw);
    grid-column: 1;
    justify-self: end;
  }
}

@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  .topbar {
    min-height: 48px;
    padding-top: calc(5px + env(safe-area-inset-top, 0px));
    padding-bottom: 5px;
  }

  .mobile-brand .brand-mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .global-search input {
    height: 36px;
  }

  main {
    padding-top: 14px;
    padding-bottom: 16px;
  }

  .mobile-footer {
    padding-bottom: 6px;
  }

  .mobile-nav a {
    gap: 0;
  }

  .mobile-nav a span {
    display: none;
  }
}

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