/* The music site (cloudflare/listen/, docs/listen.md). Dark unless the device asks for light. No external fonts or images but Google's covers. */
:root {
  --bg: #14161c;
  --bg-2: #1b1e26;
  --panel: #20242e;
  --panel-2: #282d39;
  --line: #313747;
  --text: #eceef3;
  --muted: #9aa2b4;
  --faint: #6c7488;
  --accent: #f2b84b;
  --accent-ink: #1d1606;
  --good: #57c68a;
  --bad: #f07a6a;
  --shadow: 0 10px 30px rgb(0 0 0 / 35%);
  --radius: 14px;
  --gutter: 20px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f4ef;
    --bg-2: #efece5;
    --panel: #ffffff;
    --panel-2: #f2f0ea;
    --line: #e0dcd2;
    --text: #1d1f24;
    --muted: #5f6573;
    --faint: #8b909c;
    --accent: #b87700;
    --accent-ink: #ffffff;
    --good: #1f8a52;
    --bad: #c2412f;
    --shadow: 0 10px 30px rgb(40 30 10 / 12%);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", "Arial Hebrew", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }
.pad { padding: var(--gutter); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.loading { padding: 40px var(--gutter); color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px var(--gutter); padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-size: 17px; }
.search { flex: 1; position: relative; max-width: 560px; display: flex; align-items: center; }
.search input {
  width: 100%; height: 42px; padding: 0 16px 0 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-icon { position: absolute; left: 14px; width: 18px; height: 18px; pointer-events: none; color: var(--muted); }
.search-icon svg { width: 18px; height: 18px; }
.bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--text); background: var(--panel); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); flex-shrink: 0;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.done { color: var(--good); }
.icon-btn.busy { color: var(--accent); }
.icon-btn:focus-visible, .btn:focus-visible, .card:focus-visible, .row:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- the page ---------- */
.view { padding: 8px var(--gutter) 120px; max-width: 1240px; margin: 0 auto; outline: none; }
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 6px; letter-spacing: -.3px; }
.hero p { margin: 0; color: var(--muted); }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 19px; margin: 0; letter-spacing: -.1px; }
.section-head .muted { font-size: 13px; }
.notice { margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--text); }
.empty { padding: 26px 0; color: var(--muted); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.searching { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 6px 0; }

/* ---------- shelves and grids ---------- */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 192px); gap: 0; overflow-x: auto; overflow-y: hidden; margin: 0 -10px; padding-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.shelf > .card { margin: 0; }
.shelf > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 18px 16px; }
.grid.videos { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { display: block; border-radius: var(--radius); padding: 10px; margin: -10px; cursor: pointer; transition: background .15s; min-width: 0; }
.card:hover { background: var(--panel); }
.cover {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--panel-2);
  box-shadow: 0 4px 14px rgb(0 0 0 / 22%);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.wide { aspect-ratio: 16 / 9; }
.cover.round { border-radius: 50%; }
.cover .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 34px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue, 40) 55% 42%), hsl(calc(var(--hue, 40) + 40) 60% 28%)); }
.cover .length { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 6px; background: rgb(0 0 0 / 70%); color: #fff; font-size: 12px; font-weight: 600; }
.cover .over { position: absolute; right: 8px; bottom: 8px; opacity: 0; transition: opacity .15s; }
.card:hover .cover .over, .card:focus-within .cover .over { opacity: 1; }
.cover .over .icon-btn { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.card-title { margin-top: 10px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin-top: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.artist { text-align: center; }
.video-row { display: flex; align-items: flex-start; gap: 6px; }
.video-row > div { flex: 1; min-width: 0; }

/* ---------- song rows ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: auto 44px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 7px 10px; margin: 0 -10px; border-radius: 10px; cursor: default;
}
.row:hover { background: var(--panel); }
.row .num { width: 22px; text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 14px; }
.row .thumb { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; background: var(--panel-2); position: relative; }
.row .thumb img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.row .thumb .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.row .thumb .fallback svg { width: 20px; height: 20px; }
.row .meta { min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .time { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.rows.numbered .row { grid-template-columns: 22px minmax(0, 1fr) auto auto; }
.rows.unnumbered .row { grid-template-columns: 44px minmax(0, 1fr) auto auto; }

/* ---------- artists A–Z ---------- */
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { height: 32px; min-width: 34px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.chip:hover { color: var(--text); background: var(--panel); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.name-link { display: flex; align-items: center; gap: 12px; padding: 7px 10px; margin: 0 -10px; border-radius: 10px; min-width: 0; }
.name-link:hover { background: var(--panel); }
.name-link .dot { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
  background: linear-gradient(135deg, hsl(var(--hue, 40) 55% 42%), hsl(calc(var(--hue, 40) + 40) 60% 28%)); }
.name-link .who { min-width: 0; }
.name-link .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-link .alt { font-size: 12px; color: var(--muted); }
.more-row { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- headers of an artist and an album ---------- */
.page-head { display: flex; align-items: flex-end; gap: 24px; padding: 26px 0 8px; flex-wrap: wrap; }
.page-head .cover { width: 190px; flex-shrink: 0; box-shadow: var(--shadow); }
.page-head .info { flex: 1; min-width: 220px; }
.kind { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.page-head h1 { font-size: clamp(26px, 5vw, 46px); line-height: 1.08; margin: 6px 0 8px; letter-spacing: -.6px; overflow-wrap: anywhere; }
.page-head .line { color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.back { margin-top: 14px; }

/* ---------- forms and dialogs ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.auth { max-width: 400px; margin: 9vh auto 0; }
.auth h1 { margin: 0 0 6px; font-size: 26px; }
.auth p { margin: 0 0 18px; color: var(--muted); }
.auth a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field textarea {
  height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-2); outline: none;
}
.field textarea { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field input:disabled { opacity: .7; }
.form-error { min-height: 20px; color: var(--bad); font-size: 14px; margin: -4px 0 10px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.auth .form-actions .btn { flex: 1; }
.dialog-back { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 50%); display: grid; place-items: center; padding: var(--gutter); animation: fade .15s; }
.dialog { width: 100%; max-width: 460px; }
.dialog h2 { margin: 0 0 4px; font-size: 21px; }
.dialog p { margin: 0 0 16px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }

/* ---------- the account menu ---------- */
.menu { position: absolute; right: var(--gutter); top: 64px; z-index: 30; width: 270px; padding: 8px; }
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; }
.meter { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--accent); width: 0; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--panel-2); }
.menu svg { width: 18px; height: 18px; color: var(--muted); }
.badge-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* ---------- requests ---------- */
.requests { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.request { padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.request .top { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.request .what { font-weight: 600; overflow-wrap: anywhere; }
.request .when { font-size: 12px; color: var(--faint); }
.request .note, .request .reply { margin-top: 6px; font-size: 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.request .reply { color: var(--text); border-left: 3px solid var(--accent); padding-left: 10px; }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.status.done { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.status.declined { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.ask { margin-top: 34px; padding: 20px; border-radius: var(--radius); background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), var(--panel)); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ask b { display: block; font-size: 16px; }

/* ---------- the downloads tray ---------- */
.tray {
  position: fixed; right: var(--gutter); bottom: max(var(--gutter), env(safe-area-inset-bottom)); z-index: 25; width: 340px; max-width: calc(100vw - 2 * var(--gutter));
  max-height: 46vh; overflow: auto; padding: 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.tray-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; font-weight: 700; font-size: 14px; }
.job { padding: 8px 8px 10px; border-radius: 10px; }
.job + .job { border-top: 1px solid var(--line); }
.job .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .state { font-size: 12px; color: var(--muted); margin-top: 2px; }
.job.failed .state { color: var(--bad); }
.job.saved .state { color: var(--good); }
.job .meter { margin-top: 7px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100vw - 32px)); }
.toast { pointer-events: auto; padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 14px; animation: fade .2s; }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .bar { flex-wrap: wrap; gap: 10px; }
  .brand-name { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .bar-actions .btn .label { display: none; }
  .bar-actions .btn { width: 38px; padding: 0; }
  .menu { top: 112px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px 12px; }
  .shelf { grid-auto-columns: 140px; }
  .row { gap: 10px; }
  .row .time { display: none; }
  .page-head .cover { width: 140px; }
  .tray { left: var(--gutter); right: var(--gutter); width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
