@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Manrope:wght@400;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --paper: #0d0e0c;
  --ink: #f4f1e8;
  --muted: #a7a89f;
  --line: #34362f;
  --acid: #d9ff43;
  --card: #191a17;
  --panel: #121310;
  --panel-raised: #22231f;
  --accent-ink: #10110d;
  --success: #b9dc3f;
  --danger: #ff8d82;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0, rgba(217,255,67,.08), transparent 24rem),
    radial-gradient(circle at 90% 35%, rgba(88,105,45,.07), transparent 30rem),
    var(--paper);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  min-height: 100vh;
}

button { font: inherit; color: inherit; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 140px;
}

.masthead {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 20px;
  align-items: start;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 34px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--acid);
  display: grid;
  place-content: center;
  gap: 4px;
}

.brand-mark span {
  display: block;
  width: 27px;
  height: 2px;
  border-radius: 50%;
  background: var(--accent-ink);
}

.brand-mark span:nth-child(2) { width: 23px; }
.brand-mark span:nth-child(3) { width: 18px; }

.eyebrow, .prototype-badge, .step, .now-copy p {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.eyebrow { margin: 0 0 10px; font-size: 11px; }

h1 {
  margin: 0;
  font-size: clamp(48px, 9vw, 112px);
  line-height: .82;
  letter-spacing: -.075em;
  font-weight: 800;
}

.prototype-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 10px;
}

section { padding: 42px 0 12px; }

.spotify-connect { padding-top: 28px; }

.spotify-panel {
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--ink);
  border-radius: 16px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 16px;
  align-items: center;
}

.spotify-symbol {
  width: 44px;
  height: 44px;
  background: var(--acid);
  border-radius: 50%;
  display: grid;
  place-content: center;
  gap: 3px;
}

.spotify-symbol span {
  display: block;
  width: 23px;
  height: 2px;
  border-radius: 50%;
  background: var(--accent-ink);
}

.spotify-symbol span:nth-child(2) { width: 20px; }
.spotify-symbol span:nth-child(3) { width: 16px; }
.spotify-copy .step { color: var(--acid); margin: 0 0 4px; font-size: 8px; }
.spotify-copy h2 { font-size: 20px; letter-spacing: -.035em; }
.spotify-copy > p:last-child { color: #aaa99f; font-size: 11px; margin: 3px 0 0; }

.connect-button {
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--acid);
  color: var(--accent-ink);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.connect-button[hidden], .connected-badge[hidden] { display: none; }
.connected-badge { color: var(--acid); font-family: "DM Mono", monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }

.section-copy {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 22px;
}

.step { font-size: 11px; margin: 6px 0 0; color: var(--muted); }
h2 { margin: 0; font-size: clamp(24px, 4vw, 38px); letter-spacing: -.045em; }
.section-copy p:not(.step) { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.target-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-left: 76px;
}

.refresh-button {
  display: block;
  margin: -8px 0 14px 76px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 3px 0;
  background: transparent;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
}

.refresh-button:disabled { color: var(--muted); cursor: wait; }

.nfc-panel {
  margin: 0 0 42px 76px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: var(--card);
}

.nfc-panel strong { font-size: 13px; }
.nfc-panel p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.nfc-panel p[data-tone="success"] { color: var(--success); }
.nfc-panel p[data-tone="error"] { color: var(--danger); }

.nfc-button, .pair-button {
  border: 1px solid var(--acid);
  background: var(--acid);
  color: var(--accent-ink);
  border-radius: 9px;
  padding: 10px 13px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
}

.nfc-button:disabled, .pair-button:disabled { opacity: .45; cursor: not-allowed; }
.catalogue-heading { margin-top: 0; }

.discovery {
  margin: 0 0 40px 76px;
  padding: 0;
}

.discovery > .section-copy { margin-left: -76px; }
.search-bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.search-combobox { position: relative; min-width: 0; }
.search-bar input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 0 16px;
  color: var(--ink);
  font: 600 15px "Manrope", sans-serif;
  outline: none;
}
.search-bar input:focus { box-shadow: 0 0 0 3px var(--acid); }
.search-bar > button, .result-play, .favourite-button {
  border: 1px solid var(--acid);
  border-radius: 10px;
  background: var(--acid);
  color: var(--accent-ink);
  padding: 10px 14px;
  font: 500 9px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
}
.search-bar > button:disabled, .result-play:disabled, .favourite-button:disabled { opacity: .5; cursor: wait; }
.search-suggestions {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-raised);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .42);
}
.search-suggestions[hidden] { display: none; }
.search-suggestion {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.search-suggestion:hover, .search-suggestion[aria-selected="true"] { background: var(--acid); color: var(--accent-ink); }
.search-suggestion:hover small, .search-suggestion[aria-selected="true"] small { color: #38410f; }
.suggestion-art { width: 42px; height: 42px; overflow: hidden; border-radius: 5px; background: #292b26; }
.suggestion-art.artist { border-radius: 50%; }
.suggestion-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.suggestion-copy { min-width: 0; }
.suggestion-copy strong, .suggestion-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-copy strong { font-size: 12px; }
.suggestion-copy small { margin-top: 2px; color: var(--muted); font: 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; }
.favourite-heading { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; margin-top: 26px; }
.favourite-heading h3, .discovery-results > h3 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.favourite-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.album-favourites-heading { margin-top: 22px; }
.favourite-album-shelf { display: flex; gap: 9px; overflow-x: auto; padding: 10px 0 4px; scroll-snap-type: x proximity; }
.favourite-album {
  position: relative;
  flex: 0 0 210px;
  min-width: 0;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.favourite-album-play { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; border: 0; padding: 9px 38px 9px 9px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.favourite-album-play:disabled { opacity: .55; cursor: wait; }
.favourite-album-art { width: 64px; height: 64px; overflow: hidden; border-radius: 8px; background: #292b26; }
.favourite-album-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.favourite-album-copy { min-width: 0; }
.favourite-album-copy strong, .favourite-album-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favourite-album-copy strong { font-size: 12px; }
.favourite-album-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.favourite-album-artist { margin: 0 10px 10px; border: 0; border-bottom: 1px solid var(--ink); padding: 0 0 2px; background: transparent; font: 500 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.favourite-album-menu { position: absolute; z-index: 6; top: 7px; right: 7px; }
.favourite-album-menu summary { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; list-style: none; font-size: 10px; letter-spacing: 1px; }
.favourite-album-menu summary::-webkit-details-marker { display: none; }
.favourite-album-menu summary:hover, .favourite-album-menu[open] summary { background: var(--panel-raised); color: var(--ink); }
.favourite-album-menu button { position: absolute; top: 32px; right: 0; width: 170px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel-raised); color: var(--ink); box-shadow: 0 10px 28px rgba(0,0,0,.38); font: 500 8px "DM Mono", monospace; text-align: left; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.favourite-album-menu button:hover { color: var(--acid); }
.favourite-album-menu button:disabled { opacity: .55; cursor: wait; }
.artist-shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; padding: 10px 0 4px; }
.favourite-artist {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 90px;
  padding: 10px 42px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.favourite-artist-art { width: 68px; height: 68px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--panel-raised); color: var(--acid); font: 500 18px "DM Mono", monospace; letter-spacing: .04em; }
.favourite-artist-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.favourite-artist-copy { min-width: 0; }
.favourite-artist-copy small, .favourite-artist-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favourite-artist-copy small { color: var(--success); font: 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .09em; }
.favourite-artist-copy strong { margin-top: 3px; font-size: 13px; }
.favourite-artist-releases { margin-top: 8px; border: 0; border-bottom: 1px solid var(--ink); padding: 0 0 2px; background: transparent; font: 500 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; cursor: pointer; }
.favourite-artist-releases:disabled { opacity: .5; cursor: wait; }
.favourite-artist-menu { position: absolute; z-index: 5; top: 8px; right: 8px; }
.favourite-artist-menu summary { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; list-style: none; font-size: 10px; letter-spacing: 1px; }
.favourite-artist-menu summary::-webkit-details-marker { display: none; }
.favourite-artist-menu summary:hover, .favourite-artist-menu[open] summary { background: var(--panel-raised); color: var(--ink); }
.favourite-remove { position: absolute; top: 32px; right: 0; width: 170px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel-raised); color: var(--ink); box-shadow: 0 10px 28px rgba(0,0,0,.38); font: 500 8px "DM Mono", monospace; text-align: left; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.favourite-remove:hover { color: var(--acid); }
.favourite-remove:disabled { opacity: .55; cursor: wait; }
.recent-releases {
  margin-top: 20px;
  padding: 18px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 0, rgba(217,255,67,.18), transparent 30%),
    var(--panel);
  color: var(--ink);
}
.recent-releases[hidden] { display: none; }
.recent-release-albums[hidden] { display: none; }
.app-section .library-releases { margin: 30px 0 0; padding: 18px; }
.recent-releases[data-tone="error"] { box-shadow: inset 0 0 0 1px var(--danger); }
.recent-releases-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 14px; }
.recent-releases-heading .step { margin: 0 0 4px; color: var(--acid); }
.recent-releases-heading h3 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.recent-releases-heading > p { max-width: 210px; margin: 0; color: #aaa99f; font-size: 9px; text-align: right; }
.recent-release-albums {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--acid) #34342f;
}
.recent-release-card {
  flex: 0 0 168px;
  min-width: 0;
  scroll-snap-align: start;
}
.recent-release-art { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #34342f; color: var(--acid); font: 500 14px "DM Mono", monospace; }
.recent-release-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.recent-release-card > small, .recent-release-card > strong, .recent-release-card > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-release-card > small { margin-top: 9px; color: var(--acid); font: 500 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.recent-release-card > strong { margin-top: 3px; font-size: 12px; }
.recent-release-card > span { margin-top: 2px; color: #aaa99f; font-size: 9px; }
.recent-release-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 9px; }
.recent-release-actions button { border: 1px solid var(--acid); border-radius: 999px; padding: 7px 9px; background: var(--acid); color: var(--accent-ink); font: 600 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.recent-release-actions button:disabled { opacity: .55; cursor: wait; }
.recent-release-actions .recent-artist-albums { border-color: #686860; background: transparent; color: white; }
.recent-release-actions a { color: #aaa99f; font: 500 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .05em; }
.discovery-results { scroll-margin-top: 18px; }
.discovery-results:empty { display: none; }
.discovery-results > h3 { margin: 26px 0 10px; }
.artist-discography[hidden], #library-browser[hidden] { display: none; }
.artist-discography { padding-bottom: 28px; }
.artist-discography-back {
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0 0 3px;
  background: transparent;
  color: var(--ink);
  font: 500 9px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
}
.artist-discography-heading { margin: 28px 0 18px; }
.artist-discography-heading .eyebrow { margin-bottom: 7px; }
.artist-discography-heading h2 { margin: 0; font-size: clamp(34px, 7vw, 62px); line-height: .96; letter-spacing: -.055em; }
#artist-discography-status { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.artist-discography-actions { margin-top: 12px; }
.artist-discography-actions .favourite-button { padding: 9px 12px; border-radius: 999px; }
.artist-discography-albums:empty { min-height: 180px; border: 1px dashed var(--line); border-radius: 16px; }
.discovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.discovery-card { min-width: 0; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 11px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(25,26,23,.82); }
.discovery-art { grid-row: 1 / 3; width: 78px; height: 78px; border-radius: 8px; overflow: hidden; background: #292b26; }
.discovery-art.artist-art { border-radius: 50%; }
.discovery-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.discovery-copy { min-width: 0; align-self: center; }
.discovery-copy small, .discovery-copy strong, .discovery-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discovery-copy small { color: var(--success); font: 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.discovery-copy strong { margin-top: 2px; font-size: 12px; }
.discovery-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.discovery-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.discovery-actions .result-play, .discovery-actions .favourite-button { padding: 7px 8px; border-radius: 7px; font-size: 7px; }
.discovery-actions .favourite-button { background: transparent; color: var(--ink); }
.discovery-actions .favourite-button[aria-pressed="true"] { border-color: var(--acid); background: var(--acid); color: var(--accent-ink); }
.discovery-actions .favourite-button.saved:disabled { opacity: 1; cursor: default; }
.discovery-actions a { color: var(--muted); font: 500 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .05em; }
.discovery-empty { grid-column: 1 / -1; margin: 0; padding: 20px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; text-align: center; }

.album-view-switch {
  display: flex;
  width: max-content;
  margin: -8px 0 18px 76px;
  padding: 3px;
  border: 1px solid var(--ink);
  border-radius: 999px;
}

.album-view-switch button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
}

.album-view-switch button[aria-pressed="true"] { background: var(--acid); color: var(--accent-ink); }

.coverflow {
  position: relative;
  margin-left: 76px;
  min-height: 510px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 35%, rgba(217,255,67,.16), transparent 28%),
    linear-gradient(180deg, #282824, #11110f 72%);
  color: white;
  outline: none;
}

.coverflow:focus-visible { box-shadow: 0 0 0 3px var(--acid); }
.coverflow-stage {
  position: relative;
  height: 330px;
  perspective: 1100px;
  transform-style: preserve-3d;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
  contain: layout paint;
}
.coverflow-stage.empty { display: grid; place-items: center; color: #aaa99f; font-size: 12px; }
.coverflow.dragging .coverflow-stage { cursor: grabbing; }
.coverflow.dragging .coverflow-cover { transition: none; pointer-events: none; }

.coverflow-cover {
  position: absolute;
  left: 50%;
  top: 38px;
  width: clamp(180px, 25vw, 250px);
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  background: #3b3b36;
  color: white;
  box-shadow: 0 22px 45px rgba(0,0,0,.46);
  transform: translateX(calc(-50% + var(--flow-x))) translateZ(var(--flow-z)) rotateY(var(--flow-turn)) scale(var(--flow-scale, 1));
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  z-index: var(--flow-order);
  cursor: pointer;
  transition: transform .38s cubic-bezier(.2,.75,.2,1), opacity .3s ease, filter .3s ease;
  filter: saturate(.72) brightness(.72);
  -webkit-box-reflect: below 5px linear-gradient(transparent 62%, rgba(255,255,255,.16));
}

.coverflow-cover.active { opacity: 1; filter: none; border-color: var(--acid); }
.coverflow:not(.dragging) .coverflow-cover:not(.active):hover { filter: saturate(.95) brightness(.94); }
.coverflow-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.coverflow-cover.scanning { transform: translateX(calc(-50% + var(--flow-x))) translateZ(var(--flow-z)) rotateY(var(--flow-turn)) scale(calc(var(--flow-scale, 1) * .94)); }

.flow-arrow {
  position: absolute;
  top: 155px;
  z-index: 20;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  background: rgba(0,0,0,.52);
  color: white;
  cursor: pointer;
}

.flow-arrow.previous { left: 18px; }
.flow-arrow.next { right: 18px; }
.flow-arrow:disabled { opacity: .25; cursor: default; }

.coverflow-details { position: relative; z-index: 20; text-align: center; padding: 6px 18px 24px; }
.coverflow-position { margin: 0 0 7px; color: var(--acid); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .12em; }
.coverflow-details h3 { margin: 0; font-size: clamp(20px, 3vw, 30px); letter-spacing: -.04em; }
.coverflow-details > p:not(.coverflow-position) { margin: 4px 0 0; color: #aaa99f; font-size: 12px; }
.coverflow-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.flow-action { border: 1px solid #77776f; border-radius: 9px; padding: 10px 14px; background: transparent; color: white; font-family: "DM Mono", monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.flow-action.primary { border-color: var(--acid); background: var(--acid); color: var(--accent-ink); }
.flow-action:disabled { opacity: .42; cursor: not-allowed; }
.flow-action.saved:disabled { border-color: var(--acid); color: var(--acid); opacity: 1; cursor: default; }

.rotation-panel {
  margin: 14px 0 22px 76px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 16px;
  align-items: end;
  border: 1px solid #3b3d36;
  border-radius: 14px;
  background: linear-gradient(145deg, #20211d, #171815);
  box-shadow: inset 0 1px rgba(255,255,255,.05), inset 0 -1px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.28);
}

.rotation-panel .step { margin: 0 0 4px; color: var(--success); }
.rotation-panel h3 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.rotation-panel > div > p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.rotation-panel label { color: var(--muted); font-family: "DM Mono", monospace; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.rotation-panel select { display: block; margin-top: 5px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-raised); padding: 0 28px 0 9px; color: var(--ink); font: 11px "Manrope", sans-serif; }
.rotation-order-note { max-width: 260px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.rotation-play { min-height: 36px; border: 1px solid var(--acid); border-radius: 8px; padding: 0 13px; background: var(--acid); color: var(--accent-ink); font-family: "DM Mono", monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.rotation-play:disabled { opacity: .4; cursor: not-allowed; }
.rotation-spotify-reconnect { grid-column: 1 / -1; color: var(--acid); font: 9px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; text-underline-offset: 4px; }
.rotation-card-button { border-color: var(--success); }
.rotation-albums {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 14px;
}
.rotation-albums[hidden] { display: none; }

.stack-table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #33342e;
  border-radius: 12px;
  background: #141512;
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 8px 24px rgba(0,0,0,.35);
}

.stack-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.stack-table th {
  padding: 12px 14px;
  border-bottom: 1px solid #2d2f28;
  background: #191a16;
  color: var(--muted);
  font: 500 8px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.stack-table td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #20221c;
}

.stack-table-row:last-child td {
  border-bottom: 0;
}

.stack-table-row:hover {
  background: rgba(255,255,255,.025);
}

.stack-table-row.playing {
  background: rgba(217,255,67,.06);
}

.stack-table-row.playing .stack-disc-badge {
  text-shadow: 0 0 10px rgba(217,255,67,.5);
}

.stack-th-slot, .stack-td-slot {
  width: 80px;
  white-space: nowrap;
}

.stack-disc-badge {
  color: var(--acid);
  font: 500 9px "DM Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stack-album-play {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
}

.stack-album-play:hover .stack-album-title {
  color: var(--acid);
}

.stack-album-art {
  width: 44px;
  height: 44px;
  flex: none;
  overflow: hidden;
  border-radius: 6px;
  background: #282924;
}

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

.stack-album-title {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.stack-artist-name {
  display: block;
  overflow: hidden;
  color: #bbb;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.stack-th-actions {
  text-align: right;
}

.stack-td-actions {
  text-align: right;
  white-space: nowrap;
}

.stack-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.stack-action-btn {
  border: 1px solid #5e5e56;
  border-radius: 5px;
  padding: 6px 9px;
  background: #191916;
  color: #e5e5dc;
  font: 600 8px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
}

.stack-action-btn:hover {
  border-color: var(--acid);
  color: var(--acid);
}

.rotation-album {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  padding: 5px 8px 5px 5px;
  border: 1px solid #484840;
  border-radius: 7px;
  background: linear-gradient(180deg, #2c2c27, #22221e);
  color: white;
  box-shadow: inset 0 1px rgba(255,255,255,.07);
}
.rotation-album.playing { border-color: var(--acid); box-shadow: inset 0 0 0 1px var(--acid), 0 0 14px rgba(217,255,67,.12); }
.rotation-slot-play {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rotation-slot-play:hover .rotation-album-copy strong { color: var(--acid); }
.rotation-album-art { width: 48px; height: 48px; overflow: hidden; border-radius: 6px; background: #2d2d29; }
.rotation-album-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rotation-album-copy { min-width: 0; }
.rotation-album-copy small, .rotation-album-copy strong, .rotation-album-copy span { display: block; }
.rotation-album-copy small { margin-bottom: 2px; color: var(--acid); font: 8px "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.rotation-album-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.rotation-album-copy span { overflow: hidden; margin-top: 2px; color: #aaa99f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.rotation-remove { border: 1px solid #5e5e56; border-radius: 5px; padding: 7px 6px; background: #191916; color: #aaa99f; font: 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.rotation-remove:hover { border-color: var(--acid); color: var(--acid); }
.rotation-remove:disabled { opacity: .4; }
.rotation-item-actions { display: grid; gap: 4px; }
.rotation-artist { border: 0; border-bottom: 1px solid #77776e; padding: 2px 0; background: transparent; color: #d1d1c8; font: 7px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.rotation-artist:hover { border-color: var(--acid); color: var(--acid); }
.rotation-favourite { border: 0; border-bottom: 1px solid #77776e; border-radius: 0; padding: 2px 0; background: transparent; color: #d1d1c8; font-size: 7px; text-align: left; }
.rotation-favourite:hover, .rotation-favourite.saved { border-color: var(--acid); color: var(--acid); }
.rotation-favourite.saved:disabled { opacity: 1; cursor: default; }

.target-card {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 78px;
  padding: 13px;
  display: grid;
  grid-template-columns: 28px 1fr 16px;
  gap: 8px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.target-card:hover { transform: translateY(-2px); border-color: var(--acid); }
.target-card.selected { background: var(--panel-raised); color: var(--ink); border-color: var(--acid); }
.target-icon { color: var(--muted); font-size: 20px; }
.target-card.selected .target-icon { color: var(--acid); }
.target-card strong, .target-card small { display: block; }
.target-card strong { font-size: 13px; }
.target-card small { color: var(--muted); margin-top: 2px; font-size: 10px; }
.target-card.selected small { color: #aaa99f; }
.radio-dot { width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 50%; }
.selected .radio-dot { background: var(--acid); border-color: var(--acid); box-shadow: inset 0 0 0 2px var(--panel-raised); }

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 16px;
  margin-left: 76px;
}

.album-grid[hidden], .coverflow[hidden] { display: none; }

.album-card {
  min-width: 0;
}

.album-play {
  appearance: none;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.album-art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease;
}

.album-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-art:has(img)::before { display: none; }
.album-art:has(img) .scan-hint {
  color: white;
  background: rgba(0, 0, 0, .58);
  padding: 5px 7px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.album-card:hover .album-art { transform: translateY(-5px) rotate(-.5deg); box-shadow: 0 18px 34px rgba(0,0,0,.46); }
.album-card:active .album-art, .album-card.scanning .album-art { transform: scale(.96); }
.album-art::before { content: ""; position: absolute; inset: 10%; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; box-shadow: 0 0 0 24px rgba(20,20,20,.05), 0 0 0 48px rgba(255,255,255,.07); }
.art-1::before { border-radius: 0; transform: rotate(45deg); }
.art-2::before { inset: -15% 28%; border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.1), 0 0 0 48px rgba(20,20,20,.07); }
.art-3::before { inset: 18%; border-radius: 4px; transform: rotate(8deg); }
.record-hole { width: 18px; height: 18px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 6px rgba(0,0,0,.12); z-index: 1; }
.scan-hint { position: absolute; right: 12px; bottom: 10px; color: rgba(0,0,0,.62); font-family: "DM Mono", monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }

.album-meta { display: block; padding: 10px 2px 0; }
.album-meta strong, .album-meta small { display: block; }
.album-meta strong { font-size: 14px; letter-spacing: -.02em; }
.album-meta small { color: var(--muted); margin-top: 2px; font-size: 11px; }

.pair-button {
  margin-top: 9px;
  width: 100%;
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.pair-button:not(:disabled):hover { background: var(--acid); color: var(--accent-ink); }
.album-card-favourite.saved:disabled { border-color: var(--acid); background: var(--acid); color: var(--accent-ink); opacity: 1; cursor: default; }

.now-playing {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: min(660px, calc(100% - 28px));
  transform: translate(-50%, 130%);
  opacity: 0;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--ink);
  padding: 10px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  border-radius: 15px;
  box-shadow: 0 16px 50px rgba(0,0,0,.28);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
  z-index: 10;
}

.now-playing.visible { transform: translate(-50%, 0); opacity: 1; }
.mini-art { width: 56px; height: 56px; border-radius: 8px; }
.now-copy { min-width: 0; }
.now-copy p { color: var(--acid); font-size: 8px; margin: 0 0 3px; }
.now-copy strong, .now-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-copy strong { font-size: 13px; }
.now-copy span { color: #aaa99f; font-size: 10px; margin-top: 2px; }
.now-copy #now-album { color: var(--ink); }
.playback-controls { display: flex; gap: 7px; }
.player-control {
  width: 42px;
  height: 42px;
  border: 1px solid var(--acid);
  border-radius: 50%;
  background: transparent;
  color: var(--acid);
  font-weight: 800;
  cursor: pointer;
}
.player-control.primary { background: var(--acid); color: var(--accent-ink); }
.player-control:disabled { opacity: .55; cursor: wait; }
.sound-bars { height: 26px; display: flex; gap: 3px; justify-content: center; align-items: end; }
.sound-bars i { display: block; width: 3px; background: var(--acid); animation: bounce .8s ease-in-out infinite alternate; }
.sound-bars i:nth-child(1) { height: 35%; }
.sound-bars i:nth-child(2) { height: 80%; animation-delay: -.2s; }
.sound-bars i:nth-child(3) { height: 55%; animation-delay: -.4s; }
.sound-bars i:nth-child(4) { height: 100%; animation-delay: -.6s; }
@keyframes bounce { to { height: 20%; } }

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 580px); padding-top: 22px; }
  .masthead { grid-template-columns: 42px 1fr; gap: 12px; padding-bottom: 24px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-mark span { width: 21px; }
  .prototype-badge { grid-column: 2; justify-self: start; margin-top: 8px; }
  h1 { font-size: clamp(52px, 18vw, 78px); }
  section { padding-top: 34px; }
  .spotify-connect { padding-top: 20px; }
  .spotify-panel { grid-template-columns: 38px 1fr; padding: 14px; gap: 12px; }
  .spotify-symbol { width: 38px; height: 38px; }
  .connect-button, .connected-badge { grid-column: 2; justify-self: start; }
  .section-copy { grid-template-columns: 30px 1fr; gap: 6px; margin-bottom: 16px; }
  .target-list, .album-grid, .nfc-panel, .coverflow, .rotation-panel, .discovery { margin-left: 36px; }
  .discovery > .section-copy { margin-left: -36px; }
  .album-view-switch { margin-left: 36px; }
  .refresh-button { margin-left: 36px; }
  .nfc-panel { align-items: stretch; flex-direction: column; margin-bottom: 34px; }
  .target-list { grid-template-columns: 1fr 1fr; }
  .album-grid { grid-template-columns: 1fr 1fr; gap: 20px 10px; }
  .coverflow { min-height: 470px; }
  .coverflow-stage { height: 300px; }
  .coverflow-cover { width: min(58vw, 210px); top: 34px; }
  .flow-arrow { top: 135px; width: 38px; height: 38px; }
  .rotation-panel { grid-template-columns: 1fr 1fr; gap: 12px; }
  .rotation-panel > div, .rotation-play { grid-column: 1 / -1; }
  .rotation-order-note { grid-column: 1 / -1; max-width: none; }
  .rotation-panel select { width: 100%; }
  .search-bar { grid-template-columns: 1fr; }
  .search-bar > button { min-height: 44px; }
  .favourite-heading { display: block; }
  .favourite-heading p { margin-top: 4px; }
  .discovery-grid { grid-template-columns: 1fr; }
}

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

/* App-shell redesign */
.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  width: min(960px, calc(100% - 32px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(13,14,12,.9);
  backdrop-filter: blur(18px);
}
.compact-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.compact-brand .brand-mark { width: 38px; height: 38px; }
.compact-brand .brand-mark span { width: 20px; }
.compact-brand .brand-mark span:nth-child(2) { width: 17px; }
.compact-brand .brand-mark span:nth-child(3) { width: 14px; }
.compact-brand strong { font-size: 17px; letter-spacing: -.045em; }
.active-target { display: flex; align-items: center; gap: 8px; max-width: 54%; min-height: 40px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; background: var(--card); font-size: 11px; cursor: pointer; }
.active-target #active-target-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.speaker-glyph { color: var(--success); }
.app-shell { width: min(960px, calc(100% - 32px)); padding: 28px 0 190px; }
.app-section { padding: 0; }
.app-section[hidden] { display: none; }
.page-heading { max-width: 700px; margin-bottom: 24px; }
.page-heading .eyebrow { margin-bottom: 8px; color: var(--success); }
.page-heading h1 { font-size: clamp(42px, 7vw, 72px); line-height: .94; }
.page-heading > p:last-child { max-width: 600px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.home-heading h1 { max-width: 720px; }
.app-section section { padding: 0; }
.spotify-connect { margin-bottom: 30px; }
.home-scanner, .home-shelf { margin-top: 30px; }
.home-stack-hero { overflow: hidden; margin-bottom: 30px; border: 1px solid #2f312b; border-radius: 24px; background: #11120f; box-shadow: 0 28px 70px rgba(0,0,0,.34); }
.home-stack-toolbar { position: relative; z-index: 25; display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px 24px 0; color: white; }
.home-stack-toolbar .step { margin: 0 0 4px; color: var(--acid); }
.home-stack-toolbar h2 { font-size: clamp(22px, 4vw, 34px); }
.home-stack-toolbar button { flex: none; border: 1px solid #686860; border-radius: 999px; padding: 10px 13px; background: transparent; color: white; font: 500 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; cursor: pointer; }
.home-stack-toolbar button:hover { border-color: var(--acid); color: var(--acid); }
.home-coverflow { margin: 0; min-height: 535px; border-radius: 0; background: radial-gradient(circle at 50% 32%, rgba(217,255,67,.19), transparent 31%); }
.home-coverflow .coverflow-stage { height: 350px; }
.home-coverflow .coverflow-cover { width: clamp(210px, 29vw, 285px); }
.home-coverflow .flow-arrow { top: 170px; }
.home-coverflow.empty-stack { min-height: 395px; }
.home-coverflow.empty-stack .coverflow-stage { height: 190px; }
.home-coverflow.empty-stack .flow-arrow { top: 85px; }
.home-coverflow.empty-stack .coverflow-actions > button:not(#coverflow-empty-action) { display: none; }
.discover-gateways { margin: 32px 0; }
.discovery-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.discovery-shortcuts > button { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 16px; padding: 17px; background: rgba(25,26,23,.82); color: var(--ink); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.discovery-shortcuts > button:hover { border-color: #788c28; background: var(--card); transform: translateY(-2px); }
.discovery-shortcuts .shortcut-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); color: var(--accent-ink); font-size: 22px; }
.discovery-shortcuts strong, .discovery-shortcuts small { display: block; }
.discovery-shortcuts strong { font-size: 15px; letter-spacing: -.025em; }
.discovery-shortcuts small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.home-section > .spotify-connect { margin-top: 30px; }
.home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 12px; }
.home-section-heading .step { margin: 0 0 4px; color: var(--success); }
.home-section-heading h2 { font-size: clamp(24px, 4vw, 34px); }
.home-section-heading > p { max-width: 310px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.home-section-heading > button { border: 0; padding: 0 0 2px; border-bottom: 1px solid var(--ink); background: transparent; font: 500 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; cursor: pointer; }
.nfc-panel { margin: 0; }
.shelf-status { margin: -5px 0 0; color: var(--muted); font-size: 11px; }
.favourite-album-shelf { gap: 12px; padding: 12px 0 5px; }
.favourite-album { flex-basis: 235px; }
.stack-preview { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.stack-preview .step { margin: 0 0 4px; color: var(--success); }
.stack-preview h2 { font-size: 20px; }
.stack-preview p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.stack-preview button { flex: none; border: 1px solid var(--acid); border-radius: 999px; padding: 10px 12px; background: var(--acid); color: var(--accent-ink); font: 500 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.library-section .search-bar { margin-top: 8px; }
.library-section .favourite-heading { margin-top: 34px; }
.stack-section .album-view-switch { margin: 0 0 16px; }
.stack-section .coverflow { margin-left: 0; }
.stack-section .rotation-panel { margin-left: 0; }
.stack-coverflow-shell { margin: 0 0 24px; padding: 0; overflow: hidden; border: 1px solid #2f312b; border-radius: 24px; background: #11120f; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.stack-coverflow-heading { position: relative; z-index: 25; padding: 22px 24px 0; color: white; }
.stack-coverflow-heading .eyebrow { margin-bottom: 4px; color: var(--acid); }
.stack-coverflow-heading h2 { margin: 0; font-size: clamp(22px, 4vw, 34px); }
.stack-coverflow { margin: 0; border-radius: 0; background: radial-gradient(circle at 50% 32%, rgba(217,255,67,.19), transparent 31%); }
.rotation-panel[hidden] { display: none; }
.stack-section .album-grid { margin-left: 0; }
.devices-section .refresh-button { margin: 0 0 14px; }
.devices-section .target-list { margin-left: 0; }
.device-help { margin-top: 18px; padding: 16px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); }
.device-help strong { color: var(--ink); font-size: 12px; }
.device-help p { margin: 4px 0 0; font-size: 11px; }
.app-navigation {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 12px;
  width: min(620px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid #34342f;
  border-radius: 18px;
  background: rgba(23,23,20,.96);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}
.app-navigation button { min-height: 62px; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: #aaa99f; font: 500 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.app-navigation button span { font: 18px "Manrope", sans-serif; }
.app-navigation button[aria-selected="true"] { background: #292a25; color: var(--acid); }
.now-playing { bottom: 86px; z-index: 65; }

@media (max-width: 720px) {
  .app-header { width: calc(100% - 24px); min-height: 66px; }
  .app-shell { width: calc(100% - 24px); padding-top: 22px; }
  .page-heading h1 { font-size: clamp(38px, 12vw, 58px); }
  .home-heading h1 { font-size: clamp(36px, 11vw, 52px); }
  .home-heading { margin-bottom: 18px; }
  .home-stack-hero { margin-right: -4px; margin-left: -4px; border-radius: 20px; }
  .stack-coverflow-shell { margin-right: -4px; margin-left: -4px; border-radius: 20px; }
  .collection-sort { margin-top: 10px; }
  .home-stack-toolbar { align-items: flex-start; padding: 18px 18px 0; }
  .home-stack-toolbar h2 { font-size: 23px; }
  .home-stack-toolbar button { padding: 9px 10px; }
  .home-coverflow { min-height: 500px; }
  .home-coverflow .coverflow-stage { height: 318px; }
  .home-coverflow .coverflow-cover { top: 32px; width: min(60vw, 225px); }
  .home-coverflow .flow-arrow { top: 145px; width: 38px; height: 38px; }
  .home-coverflow.empty-stack { min-height: 370px; }
  .home-coverflow.empty-stack .coverflow-stage { height: 170px; }
  .home-coverflow.empty-stack .flow-arrow { top: 74px; }
  .discovery-shortcuts { grid-template-columns: 1fr; }
  .spotify-connect { padding-top: 0; }
  .spotify-panel { grid-template-columns: 38px minmax(0,1fr); }
  .home-section-heading { display: block; }
  .home-section-heading > p { margin-top: 6px; text-align: left; }
  .shelf-heading { display: flex; }
  .nfc-panel { margin: 0; }
  .recent-releases { margin-top: 24px; }
  .recent-releases-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .recent-releases-heading > p { max-width: none; text-align: left; }
  .recent-release-albums { gap: 14px; scroll-padding-left: 2px; }
  .recent-release-card { flex: 0 0 min(72vw, 230px); }
  .recent-release-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .recent-release-actions button,
  .recent-release-actions a { width: 100%; min-height: 34px; display: grid; place-items: center; padding: 7px 6px; text-align: center; line-height: 1.15; }
  .recent-release-actions .recent-artist-albums,
  .recent-release-actions a { grid-column: 1 / -1; }
  .stack-preview { align-items: flex-start; flex-direction: column; }
  .target-list, .album-grid, .coverflow, .rotation-panel { margin-left: 0; }
  .app-navigation { bottom: 8px; width: calc(100% - 16px); }
  .app-navigation button { min-height: 58px; }
  .now-playing { bottom: 78px; }
}

/* Music-first information architecture */
[hidden] { display: none !important; }

.discovery-search {
  margin-bottom: 28px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: 0 16px 42px rgba(0,0,0,.24);
}
.discovery-search input { border: 0; background: transparent; }
.discovery-search input:focus { box-shadow: none; }
.discovery-search > button { min-width: 148px; }

.collection-gateway {
  margin: 28px 0;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 10%, rgba(217,255,67,.09), transparent 35%),
    var(--card);
}
.collection-gateway .step { margin: 0 0 5px; color: var(--success); }
.collection-gateway h2 { font-size: clamp(22px, 4vw, 32px); }
.collection-gateway p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.collection-gateway button {
  flex: none;
  border: 1px solid var(--acid);
  border-radius: 999px;
  padding: 11px 14px;
  background: var(--acid);
  color: var(--accent-ink);
  font: 500 8px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
}

.home-stack-hero { margin-top: 38px; }
.home-coverflow { min-height: 500px; }
.home-coverflow .coverflow-stage { height: 325px; }

.collection-toolbar {
  position: sticky;
  z-index: 30;
  top: 78px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(25,26,23,.94);
  box-shadow: 0 14px 35px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}
.collection-toolbar > input,
.stack-filter {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--ink);
  font: 600 13px "Manrope", sans-serif;
  outline: none;
}
.collection-toolbar > input:focus,
.stack-filter:focus { border-color: var(--acid); box-shadow: 0 0 0 2px rgba(217,255,67,.2); }
.collection-kind-filter { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; }
.collection-kind-filter button {
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  font: 500 8px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
}
.collection-kind-filter button[aria-pressed="true"] { background: var(--acid); color: var(--accent-ink); }
.collection-summary { margin: 10px 3px 0; color: var(--muted); font: 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.collection-group { padding: 34px 0 4px; }
.collection-group + .collection-group { margin-top: 16px; border-top: 1px solid var(--line); }
.collection-group .favourite-heading { margin-top: 0; }
.collection-group .favourite-heading h2 { font-size: clamp(22px, 4vw, 30px); }
.collection-sort { flex: none; color: var(--muted); font: 500 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; }
.collection-sort select { display: block; min-height: 36px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; padding: 0 30px 0 10px; background: var(--panel); color: var(--ink); font: 600 11px "Manrope", sans-serif; }

.collection-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
  overflow: visible;
  padding-top: 14px;
}
.collection-album-grid .favourite-album { width: auto; flex: none; }
.collection-album-grid .favourite-album-play { display: block; padding: 8px 8px 5px; }
.collection-album-grid .favourite-album-art { width: 100%; height: auto; aspect-ratio: 1; }
.collection-album-grid .favourite-album-copy { display: block; padding: 9px 2px 5px; }
.collection-album-grid .favourite-album-copy strong { font-size: 13px; }
.collection-album-grid .favourite-album-stack { width: calc(100% - 16px); margin: 0 8px 8px; padding: 9px 7px; }
.collection-album-grid .favourite-album-artist { margin: 0 10px 11px; }
.collection-group .artist-shelf { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding-top: 14px; }

.stack-filter { max-width: 430px; margin: 0 0 18px; }

.settings-card {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}
.settings-card.spotify-connect { padding: 0; }
.settings-card .spotify-panel { border: 0; }
.settings-card-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.settings-card-heading .step { margin: 0 0 4px; color: var(--success); }
.settings-card-heading h2 { font-size: 24px; }
.settings-card-heading > p { max-width: 330px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.settings-card .refresh-button { margin: 0 0 14px; }
.settings-card .target-list { margin: 0; }
.settings-card .nfc-panel { padding: 0; border: 0; background: transparent; }

@media (max-width: 720px) {
  .discovery-search { grid-template-columns: 1fr; padding: 6px; }
  .discovery-search > button { min-height: 44px; }
  .collection-gateway { align-items: flex-start; flex-direction: column; padding: 18px; }
  .collection-toolbar { top: 66px; grid-template-columns: 1fr; }
  .collection-kind-filter button { flex: 1; min-height: 36px; padding: 0 8px; }
  .collection-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .collection-group .artist-shelf { grid-template-columns: 1fr; }
  .home-stack-hero { margin-top: 30px; }
  .home-coverflow { min-height: 470px; }
  .home-coverflow .coverflow-stage { height: 300px; }
  .settings-card { padding: 16px; }
  .settings-card-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .settings-card-heading > p { text-align: left; }
}
