:root {
  color-scheme: light dark;
  --bg: #f6f6f0;
  --surface: #ffffff;
  --ink: #202b27;
  --muted: #66736b;
  --line: #dfe4dc;
  --accent: #245e46;
  --tint: #e8f0e3;
  --error: #a63428;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, select, input { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
button { min-height: 44px; padding: 8px 14px; font-weight: 550; }
button:hover { background: var(--tint); }
button:disabled { cursor: default; opacity: .45; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.login-screen { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 360px); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.login-card > img { border-radius: 12px; margin-bottom: 16px; }
.login-card > p { color: var(--muted); }
.login-card label { display: block; margin: 24px 0 8px; }
.login-card input { width: 100%; min-width: 0; padding: 12px; font-size: 16px; }
.login-card button { width: 100%; margin-top: 12px; }
.login-card #login-status { color: var(--error); font-size: 13px; overflow-wrap: anywhere; }
.login-card #login-status:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; z-index: 10; top: -60px; left: 12px; padding: 10px; background: var(--surface); }
.skip:focus { top: 12px; }
.masthead, main { width: min(100% - 48px, 960px); margin: 0 auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.6px; }
.brand img { border-radius: 9px; }
.quiet { background: transparent; border-color: transparent; color: var(--muted); }
main { padding-bottom: calc(240px + env(safe-area-inset-bottom)); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: block; color: var(--muted); text-decoration: none; padding: 10px 0 13px; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; }
.tabs a[aria-current] { color: var(--accent); border-color: var(--accent); }
#queue-count { font-size: 12px; font-variant-numeric: tabular-nums; }
#search-form { display: flex; gap: 8px; }
#query { flex: 1; min-width: 0; padding: 12px 14px; font-size: 16px; }
select { padding: 10px 12px; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.primary:hover { filter: brightness(1.1); background: var(--accent); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; }
.page-heading > div { min-width: 0; }
#eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1.7px; }
h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.25; letter-spacing: -.8px; margin: 0; overflow-wrap: anywhere; }
h2, h3 { line-height: 1.3; }
#page-action { flex-shrink: 0; }
#status { color: var(--muted); font-size: 13px; margin: 10px 0 18px; min-height: 20px; overflow-wrap: anywhere; }
.error, #status.error { color: var(--error); }
.music-list { list-style: none; padding: 0; margin: 0; }
.music-row { display: flex; align-items: center; gap: 8px; min-height: 72px; border-bottom: 1px solid var(--line); }
.music-row.current { background: var(--tint); border-radius: 8px; }
.row-main { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1; border: 0; background: transparent; text-align: left; padding: 10px 6px; font-weight: 400; }
.row-main:hover { background: transparent; }
.cover { flex: 0 0 48px; width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--line); }
.row-details { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-details strong { font-size: 15px; font-weight: 550; }
.row-details > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-details > span { color: var(--muted); font-size: 12px; }
.track-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; padding: 0 10px; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; border: 0; background: transparent; min-width: 44px; height: 44px; padding: 8px; font-size: 22px; flex-shrink: 0; }
[aria-pressed="true"] { color: var(--accent); background: var(--tint); }
.row-chevron { margin-right: 18px; color: var(--muted); font-size: 24px; }
.section-title { font-size: 17px; margin: 28px 0 10px; letter-spacing: -.3px; }
.empty { padding: 48px 20px 60px; text-align: center; color: var(--muted); }
.empty-mark { display: inline-flex; width: 62px; height: 62px; align-items: center; justify-content: center; border-radius: 20px; background: var(--tint); color: var(--accent); font-size: 30px; }
.empty h2 { color: var(--ink); font-size: 20px; margin: 20px 0 8px; letter-spacing: -.4px; }
.empty p { max-width: 380px; margin: 0 auto; font-size: 14px; }
.more { display: block; margin: 24px auto; min-width: 140px; }
.player { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--line); background: var(--surface); padding: 14px max(24px, calc((100vw - 960px) / 2)) calc(12px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px 24px; }
.now { display: flex; min-width: 0; align-items: center; gap: 12px; }
.now > img { border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.now > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.now strong, .now span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.now strong { font-weight: 600; font-size: 14px; }
.now span { font-size: 12px; color: var(--muted); }
.transport { display: flex; align-items: center; justify-content: center; gap: 5px; }
.transport > button:not(.icon-button):not(.play-button) { font-size: 12px; padding: 6px; border-color: transparent; }
.play-button { width: 44px; min-width: 44px; height: 44px; border-radius: 50%; padding: 6px; background: var(--accent); color: var(--surface); border: 0; font-size: 18px; }
.play-button:hover { background: var(--accent); filter: brightness(1.1); }
.seek { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.seek span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; }
.seek span:last-child { text-align: right; }
.seek input { flex: 1; min-width: 0; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
#play-status { grid-column: 1 / -1; margin: 0; font-size: 12px; }
#play-status:empty { display: none; }
.inline-action { min-height: 24px; padding: 0 8px; margin-left: 6px; font-size: inherit; }
.refresh-stream { font-size: 12px; }
dialog { max-width: 480px; width: calc(100% - 32px); max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; padding: 24px; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 20px; letter-spacing: -.5px; margin: 0; overflow-wrap: anywhere; }
dialog label { display: block; margin-bottom: 8px; }
dialog select { width: 100%; }
dialog h3 { font-size: 16px; margin-top: 28px; }
dialog p { font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-actions button { font-size: 13px; }
.action-row { display: block; width: 100%; text-align: left; text-decoration: none; padding: 13px 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 14px; background: transparent; color: var(--ink); }
@media (max-width: 640px) {
  .masthead, main { width: calc(100% - 28px); }
  .masthead { padding: calc(12px + env(safe-area-inset-top)) 0 12px; }
  .tabs { gap: 22px; margin-bottom: 18px; font-size: 14px; }
  #search-form { flex-wrap: wrap; }
  #query { flex-basis: calc(100% - 92px); }
  #search-form select { width: 84px; padding-left: 8px; }
  #search-form .primary { width: 100%; }
  .page-heading { margin-top: 26px; }
  .music-row { gap: 0; }
  .row-main { gap: 10px; padding-left: 0; }
  .track-time { display: none; }
  .music-row .icon-button { min-width: 40px; width: 40px; padding: 4px; }
  .player { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px calc(10px + env(safe-area-inset-bottom)); }
  .now { gap: 10px; }
  .now > img { width: 40px; height: 40px; }
  .transport { gap: 14px; }
  .empty { padding-top: 26px; }
  #page-action { font-size: 12px; padding: 8px; }
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141b18; --surface: #1c2520; --ink: #e1e9e0; --muted: #a0afa3; --line: #334037; --accent: #b2d6a1; --tint: #2c3e2d; --error: #ffa89b; }
}
