/* Copyright (c) 2026 Martial Systems LLC. All rights reserved. */
:root {
  color-scheme: dark;
  --bg: #0f1012;
  --surface: #15161a;
  --line: #26282d;
  --text: #ececee;
  --muted: #8d9099;
  --faint: #5d6068;
  --accent: #6f9e88;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.bar { display: flex; justify-content: space-between; align-items: baseline; height: 48px; padding: 14px 24px 0; border-bottom: 1px solid var(--line); }
.wordmark { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.wordmark span { font-weight: 400; color: var(--muted); margin-left: 4px; }
.muted { color: var(--muted); font-size: 13px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; max-width: 1280px; margin: 0 auto; }
.now-playing { padding: 24px; border-right: 1px solid var(--line); }
.up-next { padding: 24px; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } .now-playing { border-right: 0; border-bottom: 1px solid var(--line); } }

.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 4px; overflow: hidden; }
.player iframe, #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.track { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-top: 20px; }
.track-text { min-width: 0; }
h1 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.artist { font-size: 15px; color: var(--muted); margin-top: 2px; }
.reason { font-size: 13px; color: var(--faint); margin-top: 8px; }
.meta { font-size: 12px; color: var(--faint); margin-top: 8px; text-transform: capitalize; }

.actions { display: flex; gap: 4px; flex-shrink: 0; }
.actions button { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.actions button:hover { color: var(--text); border-color: #3a3c43; }
.actions button.primary { color: var(--text); }
.actions button.on { color: var(--accent); border-color: var(--accent); }
/* Stay on this artist: a sliding switch (role=switch). Knob left = off, right = on. */
.actions .artist-switch { display: inline-flex; align-items: center; gap: 8px; border-radius: 4px; max-width: 240px; margin-right: 8px; padding: 0 4px; border: 0; white-space: nowrap; color: var(--muted); }
.actions .artist-switch:hover { color: var(--text); }
.actions .artist-switch:focus-visible { outline: 1px solid var(--muted); outline-offset: 2px; }
.artist-switch .sw { position: relative; flex: none; width: 32px; height: 18px; border-radius: 9px; background: var(--line); border: 1px solid #3a3c43; transition: background-color .2s ease, border-color .2s ease; }
.artist-switch .knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background-color .2s ease; }
.artist-switch[aria-checked="true"] { color: var(--text); }
.artist-switch[aria-checked="true"] .sw { background: var(--accent); border-color: var(--accent); }
.artist-switch[aria-checked="true"] .knob { transform: translateX(14px); background: #fff; }
.artist-switch .sw-label { display: inline-flex; gap: 4px; min-width: 0; }
.artist-switch .name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .artist-switch .sw, .artist-switch .knob { transition: none; } }
.actions button[hidden] { display: none; }
.lock-note { color: var(--muted); }
@media (max-width: 600px) {
  .track { flex-direction: column; gap: 12px; }
  .actions { width: 100%; flex-wrap: wrap; }
  .actions .artist-switch { flex: 1 0 100%; max-width: none; margin: 0 0 4px; padding: 0 2px; height: 28px; }
  .actions button:not(.artist-switch) { flex: 1 1 0; }
}


.timeline { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; margin-top: 16px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.timeline span:last-child { text-align: right; }
.progress { height: 2px; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--muted); }

h2 { font-size: 13px; font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li { display: grid; grid-template-columns: 20px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 56px; border-bottom: 1px solid var(--line); }
.tracks .n { color: var(--faint); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.tracks img { width: 40px; height: 40px; object-fit: cover; border-radius: 2px; background: var(--surface); }
.tracks .t { display: flex; flex-direction: column; min-width: 0; }
.tracks .title, .tracks .artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .title { font-size: 14px; }
.tracks .artist { font-size: 13px; color: var(--muted); margin: 0; }
.tracks .d { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tracks li.empty { display: block; height: auto; padding: 16px 0; color: var(--muted); }

.details-bar { display: flex; justify-content: space-between; margin-top: 16px; }
.link { font-size: 12px; color: var(--muted); }
.link:hover { color: var(--text); text-decoration: underline; }
.details { margin-top: 12px; border-top: 1px solid var(--line); }
.details table { width: 100%; border-collapse: collapse; font: 11px/16px var(--mono); }
.details th, .details td { text-align: left; vertical-align: top; padding: 4px 0; border-bottom: 1px solid var(--line); }
.details th { color: var(--faint); font-weight: 400; width: 104px; padding-right: 8px; }
.details td { color: var(--muted); word-break: break-word; }

.foot { max-width: 1280px; margin: 0 auto; padding: 16px 24px 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); text-align: center; }
.foot .foot-line { margin: 0; }
.foot .foot-line + .foot-line { margin-top: 4px; }
.foot .foot-kofi { color: var(--faint); text-decoration: underline; text-underline-offset: 2px; }
.foot .foot-kofi:hover, .foot .foot-kofi:focus-visible { color: var(--text); }

.bar { align-items: center; padding-top: 0; }
.search { position: relative; width: 320px; }
.search input { width: 100%; height: 30px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; color: var(--text); font: 13px var(--font); outline: none; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: #3a3c43; }
.results { position: absolute; z-index: 10; top: 34px; left: 0; right: 0; list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.results li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; height: 44px; padding: 0 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.results li:last-child { border-bottom: 0; }
.results li.active, .results li:hover { background: #1c1d22; }
.results img { width: 32px; height: 32px; object-fit: cover; border-radius: 2px; }
.results .t { display: flex; flex-direction: column; min-width: 0; }
.results .title, .results .artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .title { font-size: 13px; }
.results .artist { font-size: 12px; color: var(--muted); }
.results .d { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.results li.none { display: block; height: auto; padding: 10px; color: var(--muted); cursor: default; font-size: 13px; }
@media (max-width: 720px) { .search { width: 180px; } #catalog-size { display: none; } }

.results { max-height: 70vh; overflow-y: auto; }
.results li.sep { display: block; height: auto; padding: 8px 10px 4px; font-size: 11px; color: var(--faint); cursor: default; border-bottom: 1px solid var(--line); }
.results li.sep:hover { background: none; }
.results .ph { width: 32px; height: 32px; background: var(--line); border-radius: 2px; }

/* Single column: no Up next list. */
.layout { grid-template-columns: minmax(0, 1fr); max-width: 960px; }
.now-playing { border-right: 0; }
.details-bar { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Idle auto-pause */
.settings { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.settings label { display: inline-flex; align-items: center; gap: 6px; }
.settings input[type="checkbox"] { margin: 0; accent-color: var(--accent); }
.settings select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none; color-scheme: dark;
  height: 24px; padding: 0 24px 0 8px; font: inherit; line-height: 22px; color: var(--text); cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238d9099' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 10px 6px;
  border: 1px solid var(--line); border-radius: 4px; outline: none;
}
.settings select:hover { border-color: #3a3c43; }
.settings select:focus-visible { border-color: var(--muted); outline: 1px solid var(--muted); outline-offset: 2px; }
.settings select::-ms-expand { display: none; }
/* The opened list (Chrome/Edge/Firefox draw it from these; Safari follows color-scheme). */
.settings select option { background: var(--surface); color: var(--text); }
.settings select option:checked { background: var(--line) linear-gradient(var(--line), var(--line)); color: var(--text); }
.settings .hint { font-style: italic; }
.settings input[type="number"] { width: 44px; height: 22px; padding: 0 4px; font: inherit; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 4px; }
.idle-note { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.idle-note[hidden] { display: none; }
.idle-note button { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); }
.idle-note button:hover { border-color: #3a3c43; }

/* Reset confirmation */
.reset-confirm { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.reset-confirm[hidden] { display: none; }
.link.danger { color: #c27a74; }
.link.danger:hover { color: #d8918b; }

/* Footer privacy note: one line on desktop, wraps under the copyright on narrow screens */
@media (max-width: 760px) { .foot .foot-line:first-child .sep { display: none; } .foot .foot-line:first-child .foot-note { display: block; margin-top: 4px; } }
/* Wordmark links home */
a.wordmark { color: inherit; text-decoration: none; border-radius: 3px; transition: opacity .15s; }
a.wordmark:hover { opacity: .8; }
a.wordmark:focus-visible { outline: 1px solid var(--muted); outline-offset: 3px; }

/* v2 home page (logo, new visitors, resets) */
.home { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 56px 16px 40px; text-align: center; }
.home[hidden] { display: none; }
.home-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.home-search { width: min(560px, 100%); }
.search.big { width: 100%; }
.search.big input { height: 48px; font-size: 17px; padding: 0 16px; border-radius: 8px; }
.search.big .results { text-align: left; }
.home-or { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.search-cap { margin: -8px 0 0; color: var(--faint); font-size: 12px; line-height: 17px; max-width: 520px; }
.results li.cap-note { font-size: 11px; color: var(--faint); line-height: 15px; }
.search-cap.cap-out, .results li.cap-note.cap-out { color: #e5534b; }
.genres { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; }
.genres .genre { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 14px; font: 13px var(--font); cursor: pointer; }
.genres .genre:hover, .genres .genre:focus-visible { border-color: var(--accent); }
.surprise { margin-top: 6px; background: var(--accent); color: #0f1012; border: 0; border-radius: 999px; padding: 9px 20px; font: 600 14px var(--font); cursor: pointer; }
.surprise:hover { filter: brightness(1.08); }
.now-playing.bare { display: none; }
#app[data-home="1"] .now-playing:not(.bare) { opacity: .55; }

/* Skip feedback card (after a skip, during the next track) */
.skip-feedback { margin-top: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; animation: sf-in .18s ease-out; }
.skip-feedback[hidden] { display: none; }
@keyframes sf-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sf-q { color: var(--text); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.sf-title { font-weight: 600; }
.sf-close { flex: none; width: 28px; height: 28px; margin: -6px -8px 0 0; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 4px; }
.sf-close:hover, .sf-close:focus-visible { color: var(--text); }
.sf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sf-chip { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; background: none; color: var(--muted); font: 12px/26px var(--font); cursor: pointer; white-space: nowrap; }
.sf-chip:hover { color: var(--text); border-color: #3a3c43; }
.sf-chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: rgba(111, 158, 136, .08); }
.sf-genres { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sf-genres[hidden] { display: none; }
.sf-glabel { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.sf-glist { display: flex; flex-wrap: wrap; gap: 5px; }
.sf-glist .sf-chip { height: 26px; padding: 0 9px; font-size: 12px; line-height: 24px; }
.sf-row { display: flex; gap: 6px; margin-top: 10px; }
.sf-note { flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--text); font: 13px var(--font); }
.sf-note::placeholder { color: var(--faint); }
.sf-note:focus { outline: none; border-color: var(--muted); }
.sf-send { flex: none; height: 30px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 4px; background: none; color: var(--accent); font: 13px var(--font); cursor: pointer; }
.sf-send:disabled { border-color: var(--line); color: var(--faint); cursor: default; }
.sf-done { display: none; margin: 0; color: var(--accent); font-size: 13px; }
.skip-feedback.sf-thanks > :not(.sf-done) { display: none; }
.skip-feedback.sf-thanks .sf-done { display: block; }
@media (max-width: 480px) { .sf-chip { height: 32px; line-height: 30px; } .sf-glist .sf-chip { height: 30px; line-height: 28px; padding: 0 8px; } .sf-note, .sf-send { height: 34px; font-size: 16px; } }
