/* Συνθήματα ΑΠΟΕΛ. Light by default in the tokens, dark when the phone is in dark mode.
   The look is the club's: the crest's royal blue, gold and white, a night at the GSP (the stand photos behind the
   header and the player), and the ultras' orange as a small extra. */

/* The display face: Sofia Sans Extra Condensed Black Italic (SIL OFL), self-hosted. */
@font-face {
  font-family: "AP Display"; font-style: italic; font-weight: 900; font-display: swap;
  src: url(/fonts/sofia-xc-900i-greek.woff2) format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "AP Display"; font-style: italic; font-weight: 900; font-display: swap;
  src: url(/fonts/sofia-xc-900i-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

:root {
  --display: "AP Display", "Arial Narrow", system-ui, sans-serif;
  /* The crest and the stands. */
  --blue: #004799;
  --gold: #fabf00;
  --navy: #071a45;
  --night: #050c1f;
  --orange: #f26b1d;
  --scarf: repeating-linear-gradient(-60deg, var(--blue) 0 14px, var(--gold) 14px 28px);

  --bg: #f2f5fb;
  --elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #e7ecf6;
  --surface-3: #d8e0ef;
  --text: #071433;
  --muted: #55627f;
  --faint: #8a93ab;
  --line: rgb(7 20 51 / .08);
  --accent: var(--gold);
  --accent-ink: #1a1400;
  --brand: var(--blue);
  --brand-2: #1d63c9;
  --current: var(--blue);
  --ok: #15803d;
  --danger: #d92d20;
  --bar-bg: rgb(242 245 251 / .86);
  --dock-bg: rgb(255 255 255 / .92);
  --shadow: 0 1px 2px rgb(7 20 51 / .05), 0 10px 30px rgb(7 20 51 / .08);
  --shadow-lg: 0 20px 60px rgb(7 20 51 / .22);
  --r: 16px;
  --tabs-h: 60px;
  --mini-h: 0px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050c1f;
    --elev: #0e1934;
    --surface: #0c1630;
    --surface-2: #16223f;
    --surface-3: #22305a;
    --text: #eef2fc;
    --muted: #9aa6c4;
    --faint: #69748f;
    --line: rgb(255 255 255 / .07);
    --current: var(--gold);
    --ok: #16a34a;
    --bar-bg: rgb(5 12 31 / .84);
    --dock-bg: rgb(9 17 38 / .92);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .3);
    --shadow-lg: 0 20px 60px rgb(0 0 0 / .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font: 15px/1.45 system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--tabs-h) + var(--mini-h) + env(safe-area-inset-bottom, 0px) + 16px);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.has-mini { --mini-h: 72px; }
:root { --side-w: 0px; }
body.np-open { overflow: hidden; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }

.ico, button > svg, .tab svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.ico.inline { width: 1.1em; height: 1.1em; vertical-align: -.2em; }

#app { max-width: 680px; margin: 0 auto; }

/* --- app bar --- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  display: grid;
  gap: 12px;
  transition: box-shadow .2s;
}
.appbar.scrolled { box-shadow: 0 1px 0 var(--line); }
.appbar-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.appbar-title { flex: 1; font-weight: 700; font-size: 17px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand-mark { width: 38px; height: 44px; flex: none; filter: drop-shadow(0 3px 6px rgb(0 0 0 / .25)); }
.brand h1 { font: italic 900 32px/1 var(--display); letter-spacing: .005em; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px 0 6px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
}
.chip svg { width: 18px; height: 18px; }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px; border-radius: 12px;
  background: var(--surface-2); color: var(--muted);
}
.search svg { width: 20px; height: 20px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 16px; }
.search input::placeholder { color: var(--faint); }
.search:focus-within { box-shadow: 0 0 0 2px var(--brand-2); }

/* --- the stand behind the header --- */

/* On the chants and playlists tabs a photo of the stands sits behind the header and the top of the page,
   darkened so white text reads on it, and fading into the page. The header turns solid once you scroll. */
.terrace {
  position: absolute; z-index: 0; top: 0; left: var(--side-w); right: 0;
  height: calc(var(--terrace-h, 350px) + env(safe-area-inset-top, 0px));
  background:
    linear-gradient(180deg, rgb(5 12 31 / .78) 0, rgb(5 12 31 / .3) 38%, rgb(5 12 31 / .12) 62%, rgb(5 12 31 / .35) 100%),
    var(--photo) 50% 100% / cover no-repeat;
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent);
  pointer-events: none;
}
body:not([data-terrace]) .terrace { display: none; }
body[data-terrace="choreo"] .terrace { --photo: url(/brand/choreo.jpg); }
body[data-terrace="ultras"] .terrace { --photo: url(/brand/ultras.jpg); --terrace-h: 280px; background-position: 50% 35%; }
#app { position: relative; z-index: 1; }
body[data-terrace] .appbar:not(.scrolled) {
  background: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff;
  --muted: rgb(255 255 255 / .78); --surface-2: rgb(255 255 255 / .16); --faint: rgb(255 255 255 / .7); --text: #fff;
}
body[data-terrace] .appbar:not(.scrolled) .search { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body[data-terrace] .appbar:not(.scrolled) .brand h1 { text-shadow: 0 2px 14px rgb(0 0 0 / .45); }
body[data-terrace] .appbar:not(.scrolled) .icon-btn.tonal { color: #fff; }

/* The chants tab: room for the card display to show, then the play buttons on it, then a scarf. */
.stand { display: grid; gap: 16px; padding-top: 150px; margin-bottom: 10px; }
.stand .quick { margin: 0; }
.stand .btn { height: 50px; font: italic 900 21px/1 var(--display); letter-spacing: .01em; box-shadow: 0 8px 24px rgb(0 0 0 / .35); }
.stand .btn svg { width: 22px; height: 22px; }
.stand .btn.tonal { background: rgb(255 255 255 / .16); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.scarf { height: 6px; border-radius: 99px; background: var(--scarf); }
/* The playlists tab: the ultras and their flag, then the list. */
.lists-stand { padding-top: 136px; }
.lists-stand + .empty { padding-top: 24px; }

/* --- views --- */

.view { padding: 4px 16px 0; }
.view.enter { animation: enter .28s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* --- buttons --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px;
  transition: transform .12s, filter .15s, opacity .15s;
}
.btn svg { width: 22px; height: 22px; margin-left: -4px; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.tonal { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.small svg { width: 20px; height: 20px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  color: var(--muted);
  transition: background .15s, color .15s, transform .12s;
}
.icon-btn:active:not(:disabled) { transform: scale(.92); background: var(--surface-2); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn.tonal { background: var(--surface-2); color: var(--text); }

:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

/* --- cards --- */

.card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: 8px 0 12px; padding: 14px; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow);
  position: relative;
}
.card-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue); color: var(--gold);
}
.card-icon svg { width: 22px; height: 22px; }
.card-body { display: grid; gap: 2px; min-width: 0; }
.card-body strong { font-size: 15px; }
.card-body span { color: var(--muted); font-size: 13.5px; }
.card-close { width: 32px; height: 32px; position: absolute; top: 6px; right: 6px; }
.card-close svg { width: 18px; height: 18px; }
#install-card { padding-right: 40px; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--scarf); transition: width .3s var(--ease); }

.quick { display: flex; gap: 10px; margin: 8px 0 6px; }
.quick .btn { flex: 1; }

/* --- rows --- */

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 4px;
  min-height: 68px;
  border-radius: 14px;
  background: var(--bg);
}
.row-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 4px; text-align: left; border-radius: 14px;
}
.row-main:active { background: var(--surface-2); }
.row-text { display: grid; min-width: 0; flex: 1; }
.row-title { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row-sub .saved { display: none; color: var(--ok); }
.row-sub .saved svg { width: 14px; height: 14px; }
.row.is-saved .saved { display: inline-flex; }
.row.is-current .row-title { color: var(--current); }
.row-more { width: 40px; height: 40px; }

.drag { width: 36px; height: 44px; display: grid; place-items: center; color: var(--faint); touch-action: none; cursor: grab; }
.drag svg { width: 22px; height: 22px; }
.reordering .row { transition: transform .18s var(--ease); }
.reordering .row.dragging { transition: none; z-index: 2; position: relative; background: var(--elev); box-shadow: var(--shadow-lg); cursor: grabbing; }

.empty-note { padding: 32px 8px; text-align: center; color: var(--muted); }
.about-note { margin: 18px 8px 8px; text-align: center; font-size: 13px; color: var(--muted); }
.fineprint { margin: 16px 4px 8px; color: var(--faint); font-size: 12.5px; text-align: center; }

.new-list {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 10px 4px; margin: 4px 0; text-align: left; border-radius: 14px;
}
.new-list-icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; flex: none;
  border: 2px dashed var(--surface-3); color: var(--muted);
}

/* --- artwork --- */

/* Every chant gets a tile cut like the crest: one colour top left, a band on the diagonal, another bottom right,
   with the chant's first letter in the top corner. Six colourings, picked from the chant's ID. */
.art {
  --a: var(--blue); --band: #fff; --b: var(--gold); --ink: #fff;
  position: relative; flex: none;
  width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: start; overflow: hidden;
  background: linear-gradient(to bottom right, var(--a) 0 54%, var(--band) 54% 66%, var(--b) 66%);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgb(7 20 51 / .1);
}
.art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 15% 0%, rgb(255 255 255 / .18), transparent 55%);
  pointer-events: none;
}
.art b { font: italic 900 25px/1 var(--display); padding: 5px 0 0 7px; }
.art.p1 { --a: var(--gold); --band: #fff; --b: var(--blue); --ink: var(--blue); }
.art.p2 { --a: var(--navy); --band: var(--gold); --b: var(--blue); --ink: var(--gold); }
.art.p3 { --a: #fff; --band: var(--blue); --b: var(--gold); --ink: var(--blue); }
.art.p4 { --a: var(--orange); --band: #fff; --b: var(--blue); --ink: var(--navy); }
.art.p5 { --a: var(--blue); --band: var(--gold); --b: var(--navy); --ink: var(--gold); }
.art.sm { width: 44px; height: 44px; border-radius: 10px; }
.art.sm b { font-size: 21px; padding: 4px 0 0 6px; }
.art-empty { background: var(--surface-2); color: var(--faint); }
.art-empty svg { width: 26px; height: 26px; }

.eq { position: absolute; inset: 0; display: none; align-items: end; justify-content: center; gap: 3px; padding-bottom: 30%; background: rgb(0 0 0 / .35); }
.eq i { width: 4px; height: 40%; border-radius: 2px; background: var(--accent); animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 22%; } 50% { height: 50%; } }
.row.is-current .art .eq, .art.is-on .eq { display: flex; }
.row.is-current .art b, .art.is-on b { visibility: hidden; }
.row.is-current:not(.is-playing) .eq i { animation-play-state: paused; }

.mosaic {
  flex: none; width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
}
.mosaic .art { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.mosaic .art b { font-size: 13px; padding: 2px 0 0 3px; }
.mosaic.sm { width: 44px; height: 44px; border-radius: 10px; }
.mosaic.sm .art b { font-size: 11px; }

/* --- hero (playlist header) --- */

.hero { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 12px 0 8px; }
.hero-art { width: 168px; height: 168px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.hero-art.art b { font-size: 84px; padding: 14px 0 0 18px; }
.hero-art.mosaic .art b { font-size: 40px; padding: 8px 0 0 10px; }
.hero-art.art-empty svg { width: 56px; height: 56px; }
.hero-text { display: grid; gap: 4px; }
.hero h1 { font: italic 900 34px/1.05 var(--display); word-break: break-word; }
.hero-sub { color: var(--muted); }
.hero-actions { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.hero-actions .icon-btn { width: 46px; height: 46px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 4px; }
.section-head h2 { font: italic 900 24px/1 var(--display); }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 12px; }
.empty.small { padding: 28px 12px; color: var(--muted); }
.empty-art {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; margin-bottom: 6px;
  background: linear-gradient(to bottom right, var(--blue) 0 54%, #fff 54% 66%, var(--gold) 66%); color: #fff; box-shadow: var(--shadow-lg);
}
.empty-art svg { width: 38px; height: 38px; margin: -18px 0 0 -18px; }
.empty h2 { font: italic 900 30px/1.05 var(--display); }
.empty p { color: var(--muted); max-width: 30ch; margin-bottom: 8px; }

/* --- tabs (bottom bar on phones, sidebar on desktop) and mini player --- */

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 21;
  display: flex; justify-content: center;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--dock-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -1px 0 var(--line);
}
.tab {
  flex: 0 1 240px; display: grid; justify-items: center; align-content: center; gap: 2px;
  color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  border-radius: 12px;
}
.tab svg { width: 26px; height: 26px; transition: transform .2s var(--ease); }
.tab.active { color: var(--text); }
.tab.active svg { color: var(--current); transform: translateY(-1px); }
.side-brand, .side-lists { display: none; }

.dock {
  position: fixed; z-index: 20;
  left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 8px 8px;
  pointer-events: none;
}
.mini {
  position: relative; pointer-events: auto;
  display: flex; align-items: center; gap: 2px;
  height: 64px; max-width: 664px; margin: 0 auto; padding: 0 6px 0 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 94%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: enter .25s var(--ease);
}
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; height: 100%; }
.mini-open .art { width: 46px; height: 46px; border-radius: 10px; }
.mini-open .art b { font-size: 22px; padding: 4px 0 0 6px; }
.mini-text { display: grid; min-width: 0; }
.mini-title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .icon-btn { color: var(--text); }
.mini .icon-btn svg { width: 28px; height: 28px; }
.mini-progress { position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--surface-3); border-radius: 2px; }
.mini-progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.bar-buttons { display: flex; align-items: center; }
.bar-only { display: none !important; }
svg.flip { transform: rotate(180deg); }

/* --- now playing --- */

.np {
  position: fixed; inset: 0; z-index: 40;
  /* Always the night look, whatever the phone's mode. */
  --bg: var(--night); --text: #eef2fc; --muted: #9aa6c4; --faint: #69748f; --surface-2: #16223f; --surface-3: #22305a; --current: var(--gold);
  color-scheme: dark; color: var(--text);
  background: var(--bg);
  transform: translateY(100%);
  transition: transform .38s var(--ease), visibility 0s .38s;
  visibility: hidden;
  overflow: hidden;
}
.np.open { transform: none; visibility: visible; transition: transform .38s var(--ease); }
.np-bg {
  position: absolute; inset: 0 0 auto; height: min(70%, 640px);
  background: linear-gradient(180deg, rgb(5 12 31 / .55), rgb(5 12 31 / .2) 45%, var(--night) 100%), url(/brand/mosaic.jpg) 50% 0 / cover no-repeat;
}
.np-inner {
  position: relative; height: 100%;
  max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 22px calc(18px + env(safe-area-inset-bottom, 0px));
  transition: transform .25s var(--ease);
}
.np-top { display: flex; align-items: center; gap: 8px; touch-action: none; padding: 4px 0; }
.np-top .icon-btn { color: var(--text); }
.np-top .icon-btn:first-child svg { width: 30px; height: 30px; }
.np-context { flex: 1; display: grid; text-align: center; min-width: 0; }
.np-context span:last-child { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-context .eyebrow { font-size: 10.5px; }

.np-art { flex: 1; display: grid; place-items: center; min-height: 0; padding: 18px 0; }
.np-tile { width: min(100%, 44vh, 360px); height: auto; aspect-ratio: 1; border-radius: 24px; box-shadow: var(--shadow-lg); transition: transform .4s var(--ease); }
.np-tile b { font-size: clamp(90px, 20vh, 170px); padding: 7% 0 0 9%; }
/* The big tile shows its letter while playing; the scale change marks play/pause. */
.np-tile.is-on .eq { display: none; }
.np-tile.is-on b { visibility: visible; }
.np-art .art:not(.is-on) { transform: scale(.94); }

.np-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.np-titles { flex: 1; min-width: 0; }
.np-titles h2 { font: italic 900 30px/1.1 var(--display); letter-spacing: .005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-titles p { color: var(--muted); font-size: 14px; min-height: 1.4em; }
.np-meta .icon-btn { color: var(--text); }

.np-seek { margin-bottom: 8px; }
.seek {
  --fill: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; margin: 0; background: none; cursor: pointer;
}
.seek::-webkit-slider-runnable-track {
  height: 5px; border-radius: 5px;
  background: linear-gradient(90deg, var(--text) var(--fill), color-mix(in srgb, var(--text) 18%, transparent) var(--fill));
}
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%; background: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.seek::-moz-range-track { height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.seek::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--text); }
.seek::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--text); }
.np-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.np-controls { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 18px; }
.np-controls .icon-btn { color: var(--text); }
.np-controls .icon-btn[aria-pressed] { color: var(--muted); position: relative; }
.np-controls .icon-btn[aria-pressed="true"] { color: var(--current); }
.np-controls .icon-btn[aria-pressed="true"]::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.icon-btn.big { width: 56px; height: 56px; }
.icon-btn.big svg { width: 38px; height: 38px; }
.play-btn {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .12s;
}
.play-btn svg { width: 38px; height: 38px; }
.play-btn:active { transform: scale(.94); }
.play-btn.ready { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 22%, transparent); } }

.np-bottom { display: flex; align-items: center; gap: 12px; }
.np-next { flex: 1; min-width: 0; display: grid; font-size: 14px; font-weight: 600; }
.np-next .eyebrow { font-size: 10.5px; }
.np-next { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.np-bottom .icon-btn { color: var(--text); }

/* --- sheets --- */

.sheet {
  width: 100%; max-width: 560px; max-height: 86dvh;
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--elev); color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .3s var(--ease); }
.sheet.closing { animation: sheet-out .18s ease-in forwards; }
.sheet.closing::backdrop { opacity: 0; transition: opacity .18s; }
.sheet::backdrop { background: rgb(5 12 31 / .55); backdrop-filter: blur(2px); }
.sheet.tall { height: 86dvh; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }

.sheet-body {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 0; flex: 1; overflow: auto;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 8px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sheet-head h2 { font-size: 17px; font-weight: 800; line-height: 1.25; }
.sheet-head p { color: var(--muted); font-size: 13.5px; }
.sheet-items { display: grid; }
.sheet-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 0 8px; border-radius: 12px; text-align: left; font-weight: 600;
}
.sheet-item svg { color: var(--muted); }
.sheet-item span { flex: 1; }
.sheet-item small { color: var(--faint); font-weight: 500; font-size: 12.5px; }
.sheet-item:active:not(:disabled) { background: var(--surface-2); }
.sheet-item:disabled { opacity: .5; cursor: default; }
.sheet-item.danger, .sheet-item.danger svg { color: var(--danger); }

.sheet-form { display: grid; gap: 14px; padding-top: 6px; }
.field {
  height: 50px; padding: 0 14px; border-radius: 12px; border: 0;
  background: var(--surface-2); font-size: 16px; outline: none;
}
.field:focus { box-shadow: 0 0 0 2px var(--brand-2); }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding-top: 8px; }
.sheet-actions .btn { min-width: 110px; }
.sheet-actions.sticky {
  position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom, 0px));
  margin: 4px -16px calc(-16px - env(safe-area-inset-bottom, 0px));
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--elev); box-shadow: 0 -1px 0 var(--line);
}
.pick-count { flex: 1; color: var(--muted); font-weight: 600; }
.search.in-sheet { margin: 4px 0; flex: none; }

.pick .row { min-height: 64px; background: none; }
.pick-mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--muted); transition: background .15s, color .15s;
}
.pick-mark svg { width: 20px; height: 20px; }
.pick-mark .on, .picked .pick-mark .off { display: none; }
.picked .pick-mark .on { display: block; }
.picked .pick-mark { background: var(--accent); color: var(--accent-ink); }

/* --- toast --- */

.toast {
  position: fixed; z-index: 60;
  left: 50%; bottom: calc(var(--tabs-h) + var(--mini-h) + env(safe-area-inset-bottom, 0px) + 18px);
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px;
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.toast.show { animation: toast-in .25s var(--ease); }
.np-open .toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.toast-action { color: var(--accent); font-weight: 800; padding: 4px 2px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

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

/* ===================== larger screens ===================== */

/* Tablets and small laptops: a wider column, two columns of chants. */
@media (min-width: 720px) {
  #app { max-width: 920px; }
  .view { padding: 8px 24px 0; }
  .appbar { padding-left: 24px; padding-right: 24px; }
  #chant-rows, .rows.lists, [data-context="shared"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 20px; }
  .quick .btn { flex: 0 0 auto; padding: 0 26px; }
  .hero { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: end; column-gap: 28px; padding: 20px 0 12px; }
  .hero-art { grid-row: span 2; width: 200px; height: 200px; }
  .hero h1 { font-size: 46px; }
  .hero-actions { justify-content: flex-start; }
  #playlist-rows, .section-head, #playlist-rows + .fineprint { max-width: 760px; }
  #playlist-rows + .fineprint { text-align: left; }

  /* Sheets become centred dialogs. */
  .sheet { margin: auto; width: min(520px, calc(100% - 48px)); max-height: min(80dvh, 760px); border-radius: 22px; }
  .sheet.tall { height: min(80dvh, 760px); }
  .sheet[open] { animation: dialog-in .22s var(--ease); }
  .sheet.closing { animation: dialog-out .16s ease-in forwards; }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: 18px; padding-bottom: 16px; }
  .sheet-actions.sticky { bottom: -16px; margin-bottom: -16px; padding-bottom: 12px; }
  .np-inner { max-width: 560px; }
}
@keyframes dialog-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes dialog-out { to { opacity: 0; transform: scale(.97); } }

/* Desktop: sidebar navigation, full-width player bar, chants in a grid. */
@media (min-width: 1024px) {
  :root { --tabs-h: 0px; --side-w: 248px; }
  body.has-mini { --mini-h: 84px; }
  body { padding-bottom: calc(var(--mini-h) + 24px); }

  .tabs {
    inset: 0 auto 0 0; width: var(--side-w); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 18px 12px calc(var(--mini-h) + 12px);
    box-shadow: 1px 0 0 var(--line);
  }
  .side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
  .side-brand img { width: 38px; height: 44px; }
  .side-brand div { display: grid; line-height: 1.15; }
  .side-brand strong { font: italic 900 25px/1 var(--display); }
  .side-brand span { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
  .tab {
    flex: none; display: flex; align-items: center; gap: 14px;
    height: 44px; padding: 0 12px; font-size: 14.5px; color: var(--muted);
  }
  .tab svg { width: 22px; height: 22px; }
  .tab:hover { background: var(--surface-2); color: var(--text); }
  .tab.active { background: var(--surface-2); }
  .tab.active svg { transform: none; }
  .side-lists { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; min-height: 0; overflow-y: auto; }
  .side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 12px; }
  .side-head .icon-btn { width: 32px; height: 32px; }
  .side-head .icon-btn svg { width: 20px; height: 20px; }
  .side-empty { padding: 6px 12px; color: var(--faint); font-size: 13px; }
  .side-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
  .side-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-link:hover, .side-link.active { background: var(--surface-2); color: var(--text); }
  .side-link.is-current span { color: var(--current); }
  .art.xs, .mosaic.xs { width: 34px; height: 34px; border-radius: 8px; }
  .art.xs b { font-size: 16px; padding: 3px 0 0 4px; }
  .mosaic.xs .art b { font-size: 9px; padding: 1px 0 0 2px; }
  .art-empty.xs svg { width: 18px; height: 18px; }

  #app { max-width: none; margin-left: var(--side-w); }
  .appbar, .view { padding-left: max(40px, calc((100% - 1160px) / 2)); padding-right: max(40px, calc((100% - 1160px) / 2)); }
  .appbar { grid-template-columns: 1fr minmax(240px, 380px); align-items: center; padding-top: 18px; padding-bottom: 14px; }
  .appbar .brand-mark { display: none; }
  .appbar > :only-child { grid-column: 1 / -1; }
  .appbar .brand h1 { font-size: 40px; }
  #chant-rows, .rows.lists, [data-context="shared"] { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); column-gap: 28px; }
  .row-main:hover, .new-list:hover { background: var(--surface-2); }
  .row-more { opacity: .65; }
  .row:hover .row-more { opacity: 1; }
  .card { max-width: 760px; }

  /* The mini player becomes a full-width bar: track | controls + seek | extras. */
  .dock { left: var(--side-w); bottom: 0; padding: 0; }
  .mini {
    display: grid; grid-template-columns: minmax(180px, 1fr) minmax(280px, 600px) minmax(140px, 1fr); gap: 20px;
    max-width: none; height: var(--mini-h); padding: 0 20px; border-radius: 0;
    background: var(--dock-bg); box-shadow: 0 -1px 0 var(--line);
    animation: none;
  }
  .bar-only { display: flex !important; }
  .mini-progress { display: none; }
  .mini-open { height: auto; padding: 8px 0; }
  .mini-open .art { width: 52px; height: 52px; }
  .bar-center { display: grid; gap: 2px; justify-items: center; }
  .bar-buttons { gap: 10px; }
  .mini .icon-btn { width: 38px; height: 38px; color: var(--muted); }
  .mini .icon-btn svg { width: 24px; height: 24px; }
  .mini .icon-btn:hover { color: var(--text); }
  .mini .mini-toggle { width: 42px; height: 42px; background: var(--text); color: var(--bg); }
  .mini .mini-toggle:hover { color: var(--bg); transform: scale(1.05); }
  .mini [aria-pressed="true"] { color: var(--current) !important; }
  .bar-seek { align-items: center; gap: 10px; width: 100%; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
  .bar-seek span { width: 36px; flex: none; }
  .bar-seek span:first-child { text-align: right; }
  .bar-seek .seek { flex: 1; height: 16px; }
  .bar-right { justify-content: flex-end; gap: 4px; }

  .toast { left: calc(50% + var(--side-w) / 2); bottom: calc(var(--mini-h) + 24px); }

  /* Full-screen player: artwork beside the controls. */
  .np-inner {
    max-width: 1080px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); grid-template-rows: auto 1fr;
    column-gap: 64px; padding: 24px 40px 40px;
  }
  .np-top { grid-column: 1 / -1; }
  .np-art { padding: 24px 0; }
  .np-tile { width: min(100%, 62vh, 520px); }
  .np-tile b { font-size: clamp(130px, 24vh, 250px); }
  .np-panel { align-self: center; }
  .np-titles h2 { font-size: 40px; white-space: normal; }
}

/* Very wide screens: a little more room. */
@media (min-width: 1600px) {
  :root { --side-w: 280px; }
  .appbar, .view { padding-left: max(48px, calc((100% - 1480px) / 2)); padding-right: max(48px, calc((100% - 1480px) / 2)); }
  #chant-rows, .rows.lists, [data-context="shared"] { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
}

/* Phones in landscape: the full-screen player puts the artwork beside the controls. */
@media (orientation: landscape) and (max-height: 540px) {
  .np-inner {
    max-width: 900px;
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr;
    column-gap: 28px; padding: 6px max(24px, env(safe-area-inset-right, 0px)) 10px max(24px, env(safe-area-inset-left, 0px));
  }
  .np-top { grid-column: 1 / -1; }
  .np-art { padding: 4px 0; }
  .np-tile { width: min(68vh, 300px); }
  .np-tile b { font-size: 26vh; }
  .np-panel { align-self: center; }
  .np-meta { margin-bottom: 4px; }
  .np-controls { margin: 0 0 6px; }
  .play-btn { width: 60px; height: 60px; }
  .icon-btn.big { width: 48px; height: 48px; }
  .sheet { max-height: 92dvh; }
}

/* Small phones (iPhone SE and narrower). */
@media (max-width: 360px) {
  .appbar, .view { padding-left: 12px; padding-right: 12px; }
  .brand h1 { font-size: 23px; }
  .quick .btn { padding: 0 12px; }
  .np-inner { padding-left: 16px; padding-right: 16px; }
  .play-btn { width: 66px; height: 66px; }
  .icon-btn.big { width: 48px; height: 48px; }
  .hero-actions .btn { padding: 0 16px; }
}
