/* melodica-web: the cover is the hero. Same ink/gold family as
   spacegho.st/melodica (tokens copied; the app is self-contained). System
   fonts only, nothing fetched from another origin but Pandora cover art.

   The look is v0.4.0's: responsive layout (a left station rail and a wide
   player on desktop, a single column with a sticky transport bar on phones),
   two fixed-size body glows (900x480 and 800x420 px), the cover wash behind
   the art on desktop and a shadowed rail. tests/design-v040.spec.mjs compares the
   player at 1920x1080 and 2560x1440 against renders of the v0.4.0 tag.
   melodica-extension copies this file into public/theme.css. */
:root {
  color-scheme: dark;
  --ink: #0b0e14; --ink-2: #111622;
  --glass: rgba(24, 31, 46, 0.62); --solid: #151b28;
  --line: rgba(216, 178, 106, 0.22); --line-2: #2a3448; --control-line: #616c80;
  --text: #ece6d6; --muted: #a3acbc;
  --gold: #d8b26a; --gold-2: #f0d9a4; --aether: #6fd6d0; --warn: #e0a860;
  --on-accent: #0b0e14;
  --glow-a: rgba(111, 214, 208, 0.13); --glow-g: rgba(216, 178, 106, 0.10);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --cover-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); --bar-shadow: 0 -12px 30px rgba(0, 0, 0, 0.3);
  --err: #f0998f;
  --wash-opacity: 0.55; --quiet: 0.78;
  --bar-h: 5.25rem; /* the player bar pinned to the bottom of the viewport */
  --display: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", "Iowan Old Style", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --radius: 14px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ink: #f5f0e4; --ink-2: #efe7d6; --glass: rgba(255, 252, 244, 0.78); --solid: #fffbf2;
    --line: rgba(134, 97, 31, 0.32); --line-2: #d8ccb6; --control-line: #948466;
    --text: #1c212b; --muted: #535c6b; --gold: #7d5a1a; --gold-2: #5e430f; --aether: #0b6f6a; --warn: #8a500a;
    --on-accent: #ffffff; --glow-a: rgba(12, 122, 116, 0.10); --glow-g: rgba(134, 97, 31, 0.10);
    --shadow: 0 14px 36px rgba(60, 45, 15, 0.16);
    --cover-shadow: 0 14px 36px rgba(60, 45, 15, 0.2); --bar-shadow: 0 -8px 24px rgba(60, 45, 15, 0.12);
    --err: #a3261a;
    --wash-opacity: 0.3; --quiet: 1; /* the light --muted has no contrast to spare */
  }
}

*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute must win over every display rule below. */
[hidden] { display: none !important; }
html { background: var(--ink); color: var(--text); -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; display: flex; flex-direction: column;
  font: 15px/1.5 var(--body);
  background:
    radial-gradient(900px 480px at 85% -140px, var(--glow-a), transparent 70%),
    radial-gradient(800px 420px at 8% -160px, var(--glow-g), transparent 70%),
    linear-gradient(var(--ink), var(--ink-2));
}
a { color: var(--aether); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.015em; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 0.8rem; }
.fine code { font-family: var(--mono); font-size: 0.95em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 0.78em var(--mono); padding: 1px 6px; border: 1px solid var(--control-line); border-radius: 6px; color: var(--text); background: var(--solid); }
.eyebrow { font: 600 0.7rem/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

/* ---- controls base */
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--solid); border: 1px solid var(--control-line); border-radius: 10px; padding: 0.45rem 0.8rem; min-height: 40px; }
button:hover { border-color: var(--gold); }
button:disabled { opacity: 0.45; cursor: default; }
button:disabled:hover { border-color: var(--control-line); }
button.primary { background: var(--solid); color: var(--text); border-color: var(--control-line); font-weight: 600; min-height: 44px; }
button.primary:hover { background: var(--ink-2); border-color: var(--muted); }
button.quiet { background: var(--glass); }
button.icon { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; background: transparent; border-color: transparent; color: var(--muted); }
button.icon:hover { color: var(--gold-2); border-color: var(--line); }
button.link { background: none; border: 0; padding: 0 0.3rem; min-height: 40px; color: var(--aether); font: inherit; border-radius: 6px; }
button.link:hover { text-decoration: underline; }
button.menu-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; text-align: left; background: transparent; border-color: transparent; }
button.menu-item:hover { background: var(--solid); border-color: var(--control-line); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  background: var(--solid); border: 1px solid var(--control-line); border-radius: 10px; padding: 0.55rem 0.75rem; min-height: 42px; width: 100%;
}
input::placeholder { color: var(--muted); opacity: var(--quiet); }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--aether); outline-offset: 2px;
}
.station-list button:focus-visible, .search-results button:focus-visible { outline-offset: -2px; }
input[type=range] { accent-color: var(--gold); width: 100%; height: 40px; margin: 0; background: transparent; }
progress { appearance: none; -webkit-appearance: none; border: 0; background: var(--control-line); border-radius: 999px; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--control-line); }
progress::-webkit-progress-value { background: var(--gold); }
progress::-moz-progress-bar { background: var(--gold); }

/* ---- header / footer */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.55rem max(16px, env(safe-area-inset-right)) 0.55rem max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 3;
}
.brand { font-size: 1.5rem; color: var(--gold-2); line-height: 1.2; }
.brand-tag { font: 600 0.6rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); vertical-align: middle; margin-left: 0.15rem; }
.top-right { display: flex; align-items: center; gap: 0.5rem; }
.account { position: relative; }
.account-summary { list-style: none; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; min-height: 40px; padding: 0 0.6rem 0 0.3rem; border-radius: 999px; border: 1px solid transparent; color: var(--muted); max-width: 60vw; border-radius: 10px; }
.account-summary::-webkit-details-marker { display: none; }
.account-summary:hover, .account[open] .account-summary { border-color: var(--line); color: var(--text); background: var(--glass); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--solid); border: 1px solid var(--line-2); color: var(--gold); }
.avatar svg { width: 16px; height: 16px; }
.account-email { font: 0.82rem var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 15rem; max-width: calc(100vw - 32px);
  background: var(--solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 0.5rem; z-index: 5;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.account-line { padding: 0.35rem 0.8rem 0.5rem; font-size: 0.85rem; border-bottom: 1px solid var(--line-2); margin-bottom: 0.25rem; overflow-wrap: anywhere; }
.account-line b { font-weight: 600; }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1.5rem;
  padding: 0.6rem max(16px, env(safe-area-inset-right)) max(0.7rem, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--line); color: var(--muted); font: 0.74rem/1.5 var(--mono);
}
.status { overflow-wrap: anywhere; }
.status.error { color: var(--err); }

/* ---- views */
.app { flex: 1; display: flex; flex-direction: column; padding: 16px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); }
.app[data-view=loading]::after { content: "loading melodica…"; margin: auto; color: var(--muted); font: 0.9rem var(--mono); }
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.6rem;
}
.message { min-height: 1.5em; font-size: 0.9rem; }
.message.error { color: var(--err); }
.message.info { color: var(--aether); }

/* login (Pandora) and the GitHub gate share the card */
.login { flex: 1; display: grid; place-items: center; }
.login-card .intro { text-align: center; line-height: 1.5; }
a.button {
  display: block; text-align: center; box-sizing: border-box; min-height: 44px; padding: 0.6rem 0.8rem;
  border-radius: 10px; font-weight: 600; background: var(--solid); color: var(--text); border: 1px solid var(--control-line);
}
a.button:hover, a.button:focus-visible { background: var(--ink-2); border-color: var(--muted); text-decoration: none; }
.account-line-login { text-align: center; }
.account-line-login .link { min-height: 0; padding: 0; }
.login-card { width: min(100%, 26rem); display: flex; flex-direction: column; gap: 0.8rem; margin: 2rem 0; }
.mark { display: grid; place-items: center; margin: -0.3rem 0 0.2rem; }
.mark svg { width: 84px; height: 84px; stroke: var(--gold); stroke-width: 1.2; }
.mark .dot { fill: var(--gold-2); stroke: none; }
.login-card .eyebrow { text-align: center; }
.login-card h2 { font-size: 1.9rem; text-align: center; color: var(--gold-2); margin-bottom: 0.4rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; min-height: 40px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.warn { color: var(--warn); font-size: 0.85rem; }
.error .card { max-width: 36rem; margin: 2rem auto; }
.error h2 { color: var(--gold-2); font-size: 1.6rem; margin-bottom: 0.5rem; }

/* ---- player grid */
.player {
  flex: 1; width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr); grid-template-rows: auto auto 1fr;
  grid-template-areas: "rail stage" "rail deck" "rail shelf";
  gap: 0 1.5rem; align-items: start;
}
.rail { grid-area: rail; }
.stage { grid-area: stage; }
.deck { grid-area: deck; }
.shelf { grid-area: shelf; }

/* rail */
.rail {
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; box-shadow: var(--shadow);
}
.rail-head { display: flex; align-items: center; justify-content: space-between; }
.rail-head h2 { font-size: 1.35rem; color: var(--gold-2); }
.count { font: 0.72rem var(--mono); color: var(--muted); margin-left: 0.3rem; vertical-align: 0.15em; }
.count:empty { display: none; }
.rail-sub { font-size: 1.05rem; color: var(--text); margin: 0 0 0.4rem; }
.station-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 6rem; max-height: 48vh; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.station-list li { display: flex; align-items: center; gap: 0.1rem; border-radius: 10px; }
.station-list li:hover { background: var(--solid); }
.station-list li.active { background: var(--solid); box-shadow: inset 0 0 0 1px var(--gold); }
.station-list button.station {
  flex: 1; min-width: 0; text-align: left; background: none; border: none; border-radius: 10px;
  padding: 0.45rem 0.7rem; min-height: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.station-list li.active button.station { color: var(--gold-2); }
.station-list button.delete { flex: none; width: 40px; height: 40px; padding: 0; background: none; border: none; color: var(--muted); opacity: var(--quiet); font-size: 1.2rem; line-height: 1; border-radius: 10px; }
.station-list li:hover button.delete, .station-list button.delete:focus-visible, .station-list li.active button.delete { opacity: 1; }
.station-list button.delete:hover { color: var(--err); }
.search { border-top: 1px solid var(--line-2); padding-top: 0.7rem; }
.search-row { display: flex; gap: 0.4rem; }
.search-row input { flex: 1; min-width: 0; }
.search-results { list-style: none; margin: 0; padding: 0; max-height: 14rem; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 10px; background: var(--solid); }
.search-results li { color: var(--muted); font-size: 0.85rem; padding: 0.4rem 0.7rem; }
.search-results li:has(button) { padding: 0; }
.search-results button { width: 100%; text-align: left; background: none; border: none; border-radius: 0; padding: 0.45rem 0.7rem; min-height: 40px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results button:hover { background: var(--glass); color: var(--gold-2); }
.search-results .kind { font: 600 0.65rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-right: 0.5rem; }

/* stage: cover hero with a soft colour wash bleeding behind it (no box edge:
   the wash is masked to a radial fade instead of clipped) */
.stage {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  padding: 1.6rem 1.2rem 1rem;
}
.wash {
  position: absolute; left: 50%; top: 42%; width: min(140%, 60rem); height: 150%; transform: translate(-50%, -50%);
  object-fit: cover; z-index: -1; pointer-events: none;
  filter: blur(64px) saturate(1.3); opacity: var(--wash-opacity);
  -webkit-mask-image: radial-gradient(ellipse 50% 36% at 50% 42%, #000 0%, rgba(0, 0, 0, 0.6) 35%, transparent 72%);
  mask-image: radial-gradient(ellipse 50% 36% at 50% 42%, #000 0%, rgba(0, 0, 0, 0.6) 35%, transparent 72%);
  transition: opacity 1.2s ease;
}
.stage.idle .wash, .wash[src="data:,"] { opacity: 0; }
.art { margin: 0; width: min(100%, 34vh, 340px); aspect-ratio: 1; flex: none; }
.cover {
  display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
  background: var(--solid); box-shadow: var(--cover-shadow), 0 0 0 1px var(--line);
  transition: opacity 0.5s ease;
}
.stage.idle .cover { opacity: 0.75; }
.meta { text-align: center; max-width: 42rem; width: 100%; min-width: 0; }
.station-name { margin-bottom: 0.35rem; overflow-wrap: anywhere; }
.station-name:empty { display: none; }
.title { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; color: var(--gold-2); overflow-wrap: anywhere; }
.stage.idle .title { color: var(--text); }
.artist { font-size: 1.1rem; margin-top: 0.3rem; overflow-wrap: anywhere; }
.artist:empty, .album:empty, .hint:empty { display: none; }
.album { color: var(--muted); margin-top: 0.1rem; overflow-wrap: anywhere; }
.hint { color: var(--muted); margin: 0.5rem auto 0; max-width: 34ch; font-size: 0.95rem; }
.line { margin-top: 0.5rem; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0.4rem 0.8rem; }
.line:empty { display: none; }
.chip { font: 600 0.72rem/1.6 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }
.progress { display: flex; align-items: center; gap: 0.7rem; width: min(100%, 34rem); font: 0.78rem var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.progress progress { flex: 1; height: 4px; width: auto; }
.song-lyrics { width: min(100%, 34rem); text-align: center; }
.song-lyrics summary { cursor: pointer; color: var(--gold-2); padding: .6rem; font-weight: 600; }
.song-lyrics [data-words] { position: relative; max-height: 13rem; overflow-y: auto; overscroll-behavior: contain; padding: .5rem 1rem; white-space: pre-line; overflow-wrap: anywhere; }
.song-lyrics [data-words] p { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; margin: .3rem 0; }
.song-lyrics [aria-current] { font-weight: 600; }
.song-lyrics [data-words] [aria-current] { color: var(--text); }

/* controls */
.controls { display: flex; justify-content: center; align-items: center; gap: 0.7rem; }
button.round {
  width: 46px; height: 46px; padding: 0; border-radius: 10px; display: inline-grid; place-items: center;
  background: var(--glass); border: 1px solid var(--control-line); color: var(--text);
}
button.round svg { width: 20px; height: 20px; }
button.round:hover { border-color: var(--gold); color: var(--gold-2); }
button.round.big { width: 64px; height: 64px; border-radius: 14px; background: var(--solid); color: var(--text); border-color: var(--control-line); margin: 0 0.3rem; }
button.round.big svg { width: 28px; height: 28px; }
button.round.big:hover { background: var(--ink-2); color: var(--text); border-color: var(--muted); }
#btn-play[data-state=playing] .ico-play, #btn-play[data-state=paused] .ico-pause { display: none; }
button.round.on { background: var(--ink-2); color: var(--gold-2); border-color: var(--gold); }
button.round.off { color: var(--warn); border-color: var(--warn); }
button.round:disabled { opacity: 0.4; }

/* deck: volume, quality */
.deck { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.4rem 1.6rem; padding: 0.4rem 0.5rem 0.8rem; color: var(--muted); font-size: 0.85rem; }
.deck-item { display: flex; align-items: center; gap: 0.5rem; }
.deck-item input[type=range] { width: 9rem; }
.deck-item select { width: auto; min-height: 40px; padding: 0.3rem 0.6rem; font-size: 0.85rem; }

/* toast: one line of feedback, fixed near the controls, never over them */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 1rem); transform: translateX(-50%); z-index: 30;
  max-width: min(92vw, 40rem); padding: 0.55rem 1rem; border-radius: 999px; font-size: 0.9rem; text-align: center;
  background: var(--solid); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow);
  pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast:empty { opacity: 0; transform: translate(-50%, 6px); }
.toast.error { border-color: var(--err); color: var(--err); }
.toast.info { border-color: var(--line); }

/* shelf: explain, up next, play log */
.shelf { display: grid; grid-template-columns: minmax(14rem, 2fr) minmax(0, 3fr); gap: 1rem; align-content: start; padding-bottom: 1rem; }
.nowrap { white-space: nowrap; }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.panel-head h3 { font-size: 1.15rem; color: var(--gold-2); }
.panel-head .icon { align-self: center; margin: -6px -8px -6px 0; }
.pull { grid-column: 1 / -1; margin: 0; padding: 0.9rem 1.2rem 0.5rem; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--gold) 7%, transparent); }
.pull:focus-visible { outline-offset: -2px; }
.pull-text { font-family: var(--display); font-style: italic; font-size: 1.2rem; line-height: 1.45; }
.pull-foot { margin-top: 0.3rem; font: 0.74rem/1.4 var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: center; }
.pull-foot .link { font: inherit; }
.up-next { list-style: none; margin: 0; padding: 0; counter-reset: track; }
.up-next li, .history:not(.sui .history) .hist {
  display: grid; column-gap: 0.6rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--line-2); min-width: 0;
}
.up-next li { grid-template-columns: 1.6rem 40px minmax(0, 1fr); grid-template-areas: "n c t" "n c a" "n c b"; }
.up-next .queue-cover { grid-area: c; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--ink-2); }
.up-next .queue-album { grid-area: b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.76rem; color: var(--muted); }
.up-next li::before, .history:not(.sui .history) .hist::before {
  counter-increment: track; content: counter(track, decimal-leading-zero);
  grid-area: n; font: 0.72rem/1 var(--mono); color: var(--gold); align-self: start; padding-top: 0.3em;
}
.up-next li:last-child, .history:not(.sui .history) .hist:last-child { border-bottom: 0; }
.up-next .t, .history:not(.sui .history) .hist-title { grid-area: t; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: 1rem; }
.up-next .a, .history:not(.sui .history) .hist-artist { grid-area: a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; color: var(--muted); }
.history:not(.sui .history) { list-style: none; margin: 0; padding: 0; counter-reset: track; }
.history:not(.sui .history) .hist { grid-template-columns: 1.6rem 40px minmax(0, 1fr) auto; grid-template-areas: "n c meta acts"; }
.history:not(.sui .history) .hist-cover { grid-area: c; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--ink-2); }
.history:not(.sui .history) .hist-meta { grid-area: meta; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.history:not(.sui .history) .hist-rating { font: 600 0.66rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.history:not(.sui .history) .hist-rating:empty { display: none; }
.history:not(.sui .history) .hist[data-rating="2"] .hist-title { text-decoration: line-through; color: var(--muted); }
.history:not(.sui .history) .hist[data-rating="2"] .hist-rating, .history:not(.sui .history) .hist[data-rating="3"] .hist-rating { color: var(--muted); }
.history:not(.sui .history) .hist.now .hist-title { color: var(--gold-2); }
.history:not(.sui .history) .hist-rate { grid-area: acts; display: flex; gap: 2px; }
.history:not(.sui .history) .hist-rate button { width: 40px; height: 40px; padding: 0; background: none; border-color: transparent; border-radius: 10px; color: var(--muted); display: inline-grid; place-items: center; }
.history:not(.sui .history) .hist-rate button svg { width: 16px; height: 16px; }
.history:not(.sui .history) .hist-rate button:hover { color: var(--gold-2); border-color: var(--line); }
.history:not(.sui .history) .hist-rate button.on { color: var(--gold); }
.history:not(.sui .history) .hist-rate button.off { color: var(--warn); }

/* shortcuts sheet */
.sheet { background: var(--solid); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; width: min(100% - 2rem, 26rem); }
.sheet::backdrop { background: rgba(5, 7, 12, 0.6); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1rem; margin: 0.6rem 0 0.8rem; align-items: center; font-size: 0.9rem; }
.keys dt { text-align: right; white-space: nowrap; }
.keys dd { margin: 0; }
.sheet-check { margin-top: 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--line-2); }
.confirm { width: min(100% - 2rem, 24rem); }
.confirm-text { font-size: 1.02rem; line-height: 1.45; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
/* scrobbling: settings in the account menu, "Your listens" panel */
.scrobble-settings { border-bottom: 1px solid var(--line-2); margin-bottom: 0.25rem; padding-bottom: 0.3rem; }
.scrobble-settings .message { font-size: 0.8rem; padding: 0 0.8rem; min-height: 0; }
.melodica-phone .account-menu { max-height: 75dvh; overflow-y: auto; }
#phone-history form, #phone-history [data-custom]:not([hidden]), #phone-history label { display: grid; gap: .35rem; }
#phone-history form { padding: .35rem .8rem; font-size: .85rem; }
#phone-history input, #phone-history select { min-width: 0; width: 100%; }
.scrobble-links { padding: 0.2rem 0.8rem 0.3rem; margin: 0; }
.listens { margin-top: 1rem; }
.shelf .listens { grid-column: 1 / -1; }
.history:not(.sui .history) .hist-when { grid-area: acts; font: 0.72rem var(--mono); color: var(--muted); white-space: nowrap; align-self: center; }
.listens-more { margin: 0.5rem 0 1.5rem; }
/* The listens scroll in their own box (about 15 rows; at most 60vh on phones), so the
   page below stays reachable; a soft fade marks the bottom edge. */
.listens-box {
  max-height: calc(15 * 3.3rem); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-right: 0.25rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent);
}
.listens-box:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 760px) { .listens-box { max-height: min(calc(15 * 3.3rem), 60vh); } }

/* the site nav shared with spacegho.st/melodica/ (melodica-scrobble docs/CLIENTS.md) */
.top { flex-wrap: wrap; }
.site-nav { display: flex; gap: 0.15rem; flex: 1 1 auto; justify-content: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { font: 600 0.72rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 0.45rem 0.55rem; border-radius: 8px; white-space: nowrap; }
.site-nav a:hover { color: var(--gold-2); }
.site-nav a[aria-current="page"] { color: var(--gold); background: var(--ink-2); }
@media (max-width: 760px) { .site-nav { order: 3; flex-basis: 100%; justify-content: flex-start; margin: 0 -0.3rem; } }

/* the Scrobbles panels: tabs over the shared UI's views */
.scrobbles .panel-head { align-items: center; }
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.tab { font: 1.05rem var(--display); color: var(--muted); background: none; border: 1px solid transparent; border-radius: 10px; padding: 0.2rem 0.75rem; }
.tab[aria-selected="true"] { color: var(--gold-2); border-color: var(--line); background: var(--ink-2); }
.tab:hover { color: var(--gold-2); }
.live-state:empty { display: none; }
.live-state[data-state="open"]::before { content: ''; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--gold); margin-right: 0.35em; vertical-align: 0.05em; }
.sui-host { min-width: 0; }
.sui-map-host { min-height: 240px; }

/* "Remember me on this device" in the account menu */
.menu-check { padding: 0.45rem 0.8rem; font-size: 0.85rem; }

/* username: the "Pick a username" sheet and the field in the account menu */
.username-sheet { width: min(100% - 2rem, 25rem); }
.username-sheet h3 { margin-bottom: 0.4rem; }
.username-sheet input { width: 100%; margin-top: 0.3rem; }
.username-change { padding: 0.35rem 0.8rem 0.4rem; border-bottom: 1px solid var(--line-2); margin-bottom: 0.25rem; }
.username-row { display: flex; gap: 0.4rem; margin-top: 0.3rem; }
.username-row input { flex: 1; min-width: 0; }
.username-change .message { font-size: 0.8rem; margin-top: 0.25rem; }
button.primary.danger { background: var(--err); border-color: var(--err); color: var(--ink); }
button.primary.danger:hover { background: var(--warn); border-color: var(--warn); }

/* ---- responsive */
@media (max-width: 1000px) {
  .player { gap: 0 1rem; }
  .shelf { grid-template-columns: 1fr; }
  .wash { display: none; }
}
@media (max-width: 760px) {
  .app { padding: 8px 10px 0; }
  .player { display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; min-height: 100%; }
  .stage { padding: 0.8rem 0.4rem 0.4rem; gap: 0.6rem; }
  .art { width: min(100%, 58vw, 34vh, 300px); }
  .title { font-size: 1.45rem; }
  .artist { font-size: 1rem; }
  .deck { padding: 0; gap: 0.3rem 1.2rem; }
  .rail { position: static; max-height: none; overflow: visible; box-shadow: none; }
  .station-list { max-height: 40vh; }
  .controls { gap: 0.45rem; }
  button.round { width: 44px; height: 44px; }
  button.round.big { width: 56px; height: 56px; margin: 0 0.1rem; }
  .pull-text { font-size: 1.08rem; }
  .foot { font-size: 0.68rem; }
  .brand { font-size: 1.3rem; }
  .account-email { max-width: 9rem; }
}
@media (max-width: 400px) {
  .controls { gap: 0.3rem; }
  button.round { width: 42px; height: 42px; }
  .deck-item input[type=range] { width: 7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wash, .cover, .toast { transition: none; }
}

/* Remote mode: the extension has no Pandora session yet. */
.remote-signin { margin-top: 12px; display: grid; gap: 8px; justify-items: start; }
.remote-signin p { margin: 0; }
.remote-signin[hidden] { display: none; }
@media (max-width: 760px) {
  .tab { font-size: 0.95rem; padding: 0.2rem 0.55rem; }
}
@media (max-width: 480px) {
  .live-state { font-size: 0; } /* the dot alone */
  .live-state[data-state="open"]::before { width: 0.6rem; height: 0.6rem; margin: 0; }
}

/* ---- the player bar: pinned to the bottom of the viewport on every route (0.11.0) */
body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); min-height: 100dvh; }
.controls-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0 1rem;
  min-height: var(--bar-h); padding: 0.45rem max(16px, env(safe-area-inset-right)) max(0.45rem, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--solid); border-top: 1px solid var(--line); box-shadow: var(--bar-shadow);
}
.bar-progress { position: absolute; left: 0; right: 0; top: -1px; width: 100%; height: 3px; border: 0; background: transparent; appearance: none; }
.bar-progress::-webkit-progress-bar { background: transparent; }
.bar-progress::-webkit-progress-value { background: var(--gold); }
.bar-progress::-moz-progress-bar { background: var(--gold); }
.bar-now { display: flex; align-items: center; gap: 0.7rem; min-width: 0; color: var(--text); }
.bar-track { display: flex; align-items: center; gap: .65rem; min-width: 0; width: 100%; }
.bar-track .bar-now { flex: 1; }
#bar-lyrics { flex: none; min-height: 40px; color: var(--gold-2); }
.bar-now:hover, .bar-now:focus-visible { text-decoration: none; }
.bar-cover { width: 48px; height: 48px; flex: none; border-radius: 8px; object-fit: cover; background: var(--ink-2); border: 1px solid var(--line-2); }
.mini { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini #mini-title { color: var(--text); font-family: var(--display); font-size: 1rem; }
.mini #mini-artist { color: var(--muted); font-size: 0.82rem; }
.mini span:empty { display: none; }
.bar-signin { grid-column: 1 / -1; justify-self: center; padding: 0.4rem 1rem; border: 1px solid var(--line); border-radius: 999px; color: var(--gold-2); }
.bar-resume {
  position: absolute; left: 50%; bottom: calc(100% + 0.6rem); transform: translateX(-50%);
  padding: 0.6rem 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--on-accent);
  font: 700 0.95rem var(--display); box-shadow: var(--bar-shadow); cursor: pointer; white-space: nowrap;
}
.bar-resume[hidden] { display: none; }
.bar-resume:hover, .bar-resume:focus-visible { background: var(--gold-2); }
#deploy-feedback { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 0.75rem); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem); z-index: 45; }
/* Shared history can be mounted inside a host with centered text. Song details
   follow the cover's leading edge on every page. */
.sui .hist-meta, .sui .sui-np-meta { text-align: left; }
.controls-bar[data-state="signin"] { min-height: 3rem; }
.controls-bar[data-state="signin"] > :not(.bar-signin):not(.bar-progress) { display: none; }
.controls { display: flex; align-items: center; gap: 0.5rem; }
.bar-volume { justify-self: end; display: flex; align-items: center; }
.bar-volume input[type=range] { width: 8rem; }
@media (max-width: 760px) {
  :root { --bar-h: 7.4rem; }
  .controls-bar { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0.3rem; padding-top: 0.5rem; }
  .bar-now { justify-self: stretch; }
  .bar-cover { width: 36px; height: 36px; }
  .bar-volume { display: none; }
  .controls { gap: 0.4rem; }
}
:root:has(.controls-bar[data-state="signin"]) { --bar-h: 3rem; }

/* ---- routes inside the shell (0.11.0): one design for every /melodica/ page */
.route-view { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0.5rem 0 1.5rem; }
#app[data-route]:not([data-route="app"]) > .view { display: none !important; }
#app[data-route]:not([data-route="app"]) > .route-view { display: block !important; }
.route-body { display: grid; gap: 1.2rem; }
.route-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 1rem; }
.route-notice p { margin: 0; flex: 1 1 14rem; }
.route-body > h2, .route-body .route-title { font-size: 1.8rem; color: var(--gold-2); }
.route-body section:not(.sui *), .route-body .card:not(.sui *), .route-body .quick-item, .route-body article.app {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem;
}
.route-body .wrap { max-width: none; padding: 0; margin: 0; }
.route-body .hero { padding: 0.5rem 0 0; }
.route-body .hero h1 { font-family: var(--display); font-size: 2.2rem; color: var(--gold-2); }
.route-body .lede, .route-body .tagline { color: var(--muted); max-width: 46rem; }
.route-body .grid, .route-body .quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.route-body .button { display: inline-flex; flex-direction: column; justify-content: center; gap: 0.2rem; min-height: 44px; padding: 0.65rem 1rem; border-radius: 10px; border: 1px solid var(--control-line); background: var(--solid); color: var(--text); }
.route-body .button-big { padding: 0.75rem 1rem; font-size: 1rem; font-weight: 600; background: var(--solid); color: var(--text); border-color: var(--control-line); }
.route-body .button-quiet { background: var(--glass); color: var(--text); border-color: var(--line-2); }
.route-body ul:not(.sui *) { padding-left: 1.1rem; }
.route-body .sha { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); word-break: break-all; }
.route-body img:not(.sui img) { max-width: 100%; height: auto; }
.route-body .sui-host { max-height: calc(100dvh - var(--bar-h) - 12rem); min-height: 16rem; overflow: auto; }
.route-body .sui-map-host { max-height: none; min-height: 60dvh; overflow: visible; padding-bottom: 0.5rem; }
.route-body .account-menu { position: static; display: grid; gap: 0.6rem; box-shadow: none; max-width: 32rem; }
a.button.github-signin { display: flex; justify-content: center; margin-top: 0.6rem; min-height: 44px; align-items: center; background: transparent; color: var(--text); border: 1px solid var(--line); }
.github-signin[hidden] { display: none; }
a.button.github-signin:hover, a.button.github-signin:focus-visible { background: var(--ink-2); color: var(--gold-2); }
/* first paint (0.11.2): a quiet dot while the extension is being reached */
#app[data-connecting] .bar-now::after { content: ''; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); opacity: 0.8; animation: mw-pulse 1.2s ease-in-out infinite; }
@keyframes mw-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { #app[data-connecting] .bar-now::after { animation: none; } }
/* Link tools stay available before sign-in and collapse at phone widths. */
.listen-links { position: relative; }
.listen-links summary { cursor: pointer; }
.listen-links .panel { position: absolute; z-index: 30; right: 0; width: min(22rem, 88vw); padding: 1rem; background: var(--bg, #171b24); border: 1px solid currentColor; }
.listen-links input { width: 100%; box-sizing: border-box; margin-bottom: .6rem; }
.listen-links button { margin: .2rem; }
#listen-pending { grid-column: 1 / -1; padding: 1rem; }

/* The shared navigation and live home panels retain their current routing. */
.brand { font-family: var(--display); }
.site-nav > .sui-nav { display: flex; flex: 1; gap: inherit; justify-content: inherit; min-width: max-content; margin: 0; border: 0; padding: 0; }
.route-body .hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.route-body .hub > .foot, .route-body .hub-board { grid-column: 1 / -1; }
.route-body .hub-board { min-width: 0; }
.route-body .hub-board-host { max-height: none; min-height: 0; overflow: visible; padding: 0; }
.route-body .hub-board .boards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.route-body .hub-board .board-head .hub-board-all { margin-left: auto; }
@media (max-width: 760px) {
  .route-body .hub, .route-body .hub-board .boards { grid-template-columns: minmax(0, 1fr); }
}

.route-body .button:hover { background: var(--ink-2); border-color: var(--muted); text-decoration: none; }
.route-body .hero .cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }
.route-body .hero .button .app { font: 600 1rem/1.3 var(--body); }
.route-body .hero .button .file { font: 0.75rem/1.4 var(--body); color: var(--muted); }
@media (max-width: 760px) {
  .route-body .hero .cta { display: grid; grid-template-columns: minmax(0, 1fr); }
  .route-body .hero .button { width: 100%; min-width: 0; }
}

.route-body .grid > .card:only-child { grid-column: 1 / -1; }
.route-body .verified-summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font: 0.85rem var(--body); }
.route-body .verified-details { margin-top: 1rem; }

/* Room controls follow the complete player, using the existing panel styles. */
.shelf .player-rooms { grid-column: 1 / -1; }
.room-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.player-rooms details > summary { cursor: pointer; padding: 0.6rem 0; }
.player.room-listener { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "deck" "shelf"; }
.player.room-listener > .rail { display: none; }
/* Walk journal on the same player shell, with the live transport below it. */
.walks { max-width: 68rem; margin: 0 auto; font-size: 1rem; }
.walks [hidden] { display: none !important; }
.walk-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; margin: .7rem 0; }
.walk-head h1 { font: 500 clamp(2.5rem,6vw,4.25rem)/1.05 var(--display); letter-spacing: -.045em; margin: 0; }
.walk-head p { color: var(--muted); margin: .55rem 0; max-width: 36rem; }
.walk-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.walk-actions button, .walk-file, .walk-picker select { min-height: 44px; font: inherit; }
.walks .walk-start { background: var(--gold-2); color: var(--on-accent); border: 1px solid var(--gold-2); font-weight: 680; }
.walk-file { cursor: pointer; position: relative; display: inline-flex; align-items: center; padding: .45rem .8rem; border: 1px solid var(--control-line); border-radius: 10px; background: var(--solid); }
.walk-file:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.walk-file input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.walk-help { font-size: .91rem; margin: .65rem 0 .9rem; color: var(--muted); max-width: 48rem; }
.walk-help summary { cursor: pointer; color: var(--text); width: fit-content; padding: .3rem 0; }
.walk-help p { margin: .6rem 0; }
.walk-status { color: var(--gold-2); margin: .7rem 0; }
.walk-status:empty { display: none; }
.walk-grid { display: grid; grid-template-columns: minmax(0,1.12fr) minmax(0,1fr); gap: clamp(1.2rem,4vw,3.2rem); align-items: start; }
.walk-sleeve { margin: 0; border: 1px solid #465a5a; border-radius: 16px; overflow: hidden; background: #172a2e; color: #f5edda; box-shadow: var(--shadow); }
.walk-sleeve figcaption { padding: 1.15rem 1.4rem .9rem; }
.walk-sleeve figcaption span, .walk-stats { font: 500 .88rem/1.45 var(--mono); color: #c7d7cd; }
.walk-sleeve h2 { font: 500 clamp(1.7rem,3vw,2.7rem)/1.14 var(--display); margin: .22rem 0 0; }
.walk-sleeve canvas { display: block; width: 100%; height: auto; }
.walk-stats { display: flex; gap: .7rem; justify-content: space-between; padding: .75rem 1.25rem; flex-wrap: wrap; }
.walk-picker { display: grid; gap: .3rem; color: var(--muted); font-size: .91rem; }
.walk-picker select { min-width: 0; width: 100%; background: var(--solid); color: var(--text); border: 1px solid var(--control-line); border-radius: 9px; padding: .4rem .7rem; }
.walk-side { min-width: 0; }
.walk-side h2 { font: 550 1.35rem var(--display); margin: 1rem 0 .4rem; }
.walk-song { font: 570 clamp(1.45rem,3.9vw,2.25rem)/1.13 var(--display); margin: .3rem 0; overflow-wrap: anywhere; }
.walk-artist { color: var(--muted); margin: .3rem 0 .65rem; }
.walk-time { display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; align-items: center; font-size: .88rem; }
.walk-time output { font-family: var(--mono); }
.walk-time input { grid-column: 1 / -1; width: 100%; height: 32px; margin: 0; accent-color: var(--gold); }
.walk-list { display: grid; gap: .22rem; }
.walk-list button { min-height: 44px; display: grid; grid-template-columns: 3.1rem minmax(0,1fr); align-items: baseline; text-align: left; padding: .5rem; background: transparent; border: 1px solid transparent; border-radius: 7px; }
.walk-list button[aria-current="true"] { background: var(--glass); border-color: var(--line-2); }
.walk-list button time { font: .85rem var(--mono); color: var(--muted); }
.walk-list button span { overflow-wrap: anywhere; }
.walk-list p { color: var(--muted); }
.walk-exports { margin-top: 1rem; }
@media (max-width: 760px) {
  .walk-grid { grid-template-columns: 1fr; gap: .9rem; }
  .walk-head { margin-top: .3rem; gap: .4rem; }
  .walk-side h2 { margin-top: .9rem; }
}

.walk-music { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; padding: 1rem 1.2rem; margin: 1rem 0; border: 1px solid var(--control-line); border-radius: 14px; background: var(--solid); }
.walk-live-track { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.walk-live-track img { flex: none; border-radius: 7px; object-fit: cover; }
.walk-now { min-width: 0; }
.walk-now h2 { font: 500 1.3rem/1.2 var(--display); margin: 0; }
.walk-now p { margin: .25rem 0 0; overflow-wrap: anywhere; color: var(--muted); }
.walk-music .walk-actions { align-items: end; max-width: 100%; }
.walk-music .walk-picker { min-width: 0; max-width: 100%; }
.walk-empty { border-top: 1px solid var(--control-line); padding: 1rem 0; color: var(--muted); }
.walk-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.walk-pair figure, .walk-help [data-w="preview"] figure { margin: 1rem 0; }
.walk-pair canvas, .walk-help [data-w="preview"] canvas { width: 100%; height: auto; max-width: 25rem; }
.walk-pair figcaption, .walk-help [data-w="preview"] figcaption { margin-bottom: .4rem; }

.phone-audio { width: 100%; max-width: 42rem; padding: .5rem; text-align: left; }
.phone-options, .phone-bands { display: grid; grid-template-columns: repeat(auto-fit,minmax(9rem,1fr)); gap: .6rem; padding: .6rem 0; align-items: center; }
.phone-options label, .phone-bands label { display: grid; gap: .25rem; }
.phone-options label:has(input[type=checkbox]) { display: flex; align-items: center; }
.phone-bands output { font-variant-numeric: tabular-nums; }
.melodica-phone .stage .wash { display: block; opacity: .24; pointer-events: none; }
.melodica-phone .stage.idle .wash, .melodica-phone .stage .wash[src="data:,"] { opacity: 0; }

.station-tools { margin-top: .9rem; }
.station-tools label { display: block; margin: .45rem 0; }
.station-tools details, .station-tools [data-st=seedList], .station-tools-row { margin: .55rem 0; }
.station-tools button { min-height: 40px; margin: .12rem; }
.station-tools select, .station-tools input:not([type=checkbox]) { max-width: 100%; }
/* Shared by the standalone catalog and the player when it opens the same directory. */
.app-directory h1 { margin: 1.5rem 0 .3rem; font: 600 clamp(2.3rem, 6vw, 3.7rem)/1.1 var(--display); color: var(--gold-2); }
.app-directory > .lede { margin: 0; color: var(--muted); }
.directory-jumps { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .75rem 0; }
.directory-jumps a { display: inline-flex; align-items: center; min-height: 44px; }
.app-directory .directory-section, .route-body .app-directory .directory-section { margin: 0 0 2rem; padding: 0; border: 0; background: none; box-shadow: none; }
.directory-section h2 { margin: 0 0 .7rem; color: var(--gold-2); font-size: 1.6rem; }
.directory-section > p { margin: 0 0 .75rem; color: var(--muted); }
.app-directory [id] { scroll-margin-top: 5rem; }
.app-directory .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1rem; }
.app-directory .card { display: flex; flex-direction: column; gap: .55rem; min-width: 0; }
.app-directory .card h3 { margin: 0; font-size: 1.3rem; }
.app-directory .card p { margin: 0; }
.app-directory .platforms, .directory-note, .app-directory footer { font-size: .88rem; color: var(--muted); }
.directory-actions { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .9rem; margin-top: auto; padding-top: .55rem; }
.directory-actions a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
.app-directory .directory-actions .button { flex-direction: row; flex-wrap: wrap; padding: .5rem .75rem; }
.directory-actions small { font: .75rem var(--mono); color: var(--muted); white-space: nowrap; }
.app-directory footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; padding-top: .6rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
