/* ==========================================================================
   Stafford Audio — site.css
   Glue between the design kit (brand.css + app.css, untouched) and the live
   app: the player as an overlay, a real <input type=range> scrubber styled
   to the spec, sheet/scrim transitions, and a few live-app-only pieces.
   ========================================================================== */

/* ---- The listening room as an overlay ---------------------------------- */
.room-overlay {
  position: fixed; inset: 0; z-index: 35;
  background: var(--sa-navy); color: var(--sa-cream);
  overflow-y: auto;
  transform: translateY(4%); opacity: 0; pointer-events: none;
  transition: transform 320ms var(--sa-ease), opacity 320ms var(--sa-ease);
}
.room-overlay.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.room-overlay h1, .room-overlay h2, .room-overlay h3 { color: var(--sa-cream); }
body.player-open { overflow: hidden; }

/* ---- Scrubber: native range, spec skin --------------------------------- */
.scrub { position: relative; }
.scrub input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; margin: 0; background: transparent; display: block;
}
.scrub input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right,
    var(--sa-cream) 0%, var(--sa-cream) var(--fill, 0%),
    rgba(251,243,228,.18) var(--fill, 0%), rgba(251,243,228,.18) 100%);
}
.scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--sa-cream); margin-top: -6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); border: 0;
}
.scrub input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 2px; background: rgba(251,243,228,.18);
}
.scrub input[type="range"]::-moz-range-progress {
  height: 4px; border-radius: 2px; background: var(--sa-cream);
}
.scrub input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--sa-cream); border: 0; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.scrub .ticks { position: absolute; left: 8px; right: 8px; top: 50%; height: 4px;
  transform: translateY(-50%); pointer-events: none; }
.scrub .ticks span { position: absolute; top: -3px; width: 1.5px; height: 10px;
  background: rgba(251,243,228,.45); }

/* ---- Sheets & scrim: transitions --------------------------------------- */
.scrim { opacity: 0; pointer-events: none; transition: opacity 200ms var(--sa-ease); }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { visibility: hidden; transform: translateY(24px); opacity: 0;
  transition: transform 260ms var(--sa-ease), opacity 260ms var(--sa-ease), visibility 0s 260ms; }
.sheet.open { visibility: visible; transform: none; opacity: 1; transition-delay: 0s; }
@media (min-width: 640px) {
  .sheet { transform: translate(-50%, -50%) scale(.96); }
  .sheet.open { transform: translate(-50%, -50%) scale(1); }
}
.speed input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px;
  background: transparent; display: block; margin: 6px 0 2px;
}
.speed input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--sa-brass) var(--fill,33%), var(--sa-line) var(--fill,33%));
}
.speed input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--sa-white); margin-top: -11px;
  box-shadow: 0 2px 8px rgba(27,53,96,.35), inset 0 0 0 1.5px var(--sa-line);
}
.speed input[type="range"]::-moz-range-track { height: 4px; background: var(--sa-line); border-radius: 2px; }
.speed input[type="range"]::-moz-range-progress { height: 4px; background: var(--sa-brass); border-radius: 2px; }
.speed input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%;
  background: var(--sa-white); border: 0; box-shadow: 0 2px 8px rgba(27,53,96,.35); }

/* ---- Live-app pieces ---------------------------------------------------- */
.status-line { min-height: 1.3em; text-align: center; font-size: 13.5px;
  color: var(--sa-mist); margin: 2px 0 0; }
.status-line.error { color: #E7A793; }
.room-overlay .btn-retry { display: block; margin: 8px auto 0; height: 40px;
  padding: 0 18px; border-radius: 999px; border: 1px solid rgba(251,243,228,.3);
  color: var(--sa-cream); font-weight: 500; font-size: 14px; }
.diagnostics { max-width: 560px; margin: 26px auto 0; font-size: 12.5px;
  color: var(--sa-mist); border-top: 1px solid var(--sa-line-dark); padding: 10px 0 30px; }
.diagnostics summary { cursor: pointer; padding: 6px 0; }
.event-log { margin: 8px 0; padding-left: 1.4em; max-height: 200px; overflow: auto;
  font-variant-numeric: tabular-nums; }
.diagnostics button { text-decoration: underline; text-underline-offset: 3px;
  color: var(--sa-mist); font-size: 12.5px; padding: 8px 0; }

.mini { cursor: pointer; }
.mini .moon.on { color: var(--sa-straw); }
.mini .moon { color: rgba(251,243,228,.4); }
.mini[hidden], .tabbar[hidden], .room-overlay[hidden] { display: none !important; }
/* .btn sets display, which beats the hidden attribute — so the players'
   "Sign in free to keep…" buttons showed to everyone, signed in or not. */
.btn[hidden] { display: none !important; }
body.no-mini .main { padding-bottom: 32px; }
@media (max-width: 639px) { body.no-mini .main { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); } }

@media (min-width: 1024px) { .aux .pill-chapters { display: none; } }

.notice { background: var(--sa-white); border-radius: 14px; padding: 18px 20px;
  margin: 16px 0; max-width: 620px; }
.notice h3 { margin: 0 0 6px; }
.notice p { margin: 0 0 6px; color: var(--sa-slate); font-size: 14.5px; }
.notice p:last-child { margin: 0; }

.toast { opacity: 0; transform: translateX(-50%) translateY(8px);
  transition: opacity 200ms var(--sa-ease), transform 200ms var(--sa-ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.code-input input {
  width: 100%; height: 64px; border-radius: 12px; border: 1.5px solid var(--sa-line);
  background: var(--sa-white); font-family: var(--sa-font-serif); font-size: 30px;
  letter-spacing: 14px; text-align: center; color: var(--sa-navy);
}
.code-input input:focus { border-color: var(--sa-ocean); outline: none;
  box-shadow: 0 0 0 3px rgba(74,116,184,.18); }

.form-error { color: #B3541E; font-size: 13px; margin: 10px 0 0; }
.form-ok { color: var(--sa-bronze); font-size: 13px; margin: 10px 0 0; }

.account-panels { display: grid; gap: 18px; max-width: 560px; }
.panel .prow { display: flex; justify-content: space-between; align-items: center;
  gap: 14px; padding: 12px 0; border-top: 1px solid var(--sa-line); font-size: 14.5px; }
.panel .prow:first-of-type { border-top: 0; }
.panel .prow .k { color: var(--sa-slate); }
.panel .prow select { height: 40px; border-radius: 10px; border: 1.5px solid var(--sa-line);
  background: var(--sa-white); font: inherit; padding: 0 10px; color: var(--sa-navy); }

.admin-bg { background: var(--sa-sand); min-height: 100dvh; }

.chapters li button.rowbtn { display: contents; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  .room-overlay, .sheet, .scrim, .toast { transition: none !important; }
}


/* ---- QA round 1 fixes --------------------------------------------------- */
.card .cov { display: block; }
.card .cov img, .lrow img, .hero .cover, .np .cover, .mini .who img,
.detail .cover, .table .tt img {
  object-fit: cover; object-position: center;
}
.lrow img { height: 72px; }
.mini::before { width: var(--w, 0%) !important; }
.stage.no-panel { grid-template-columns: minmax(0, 640px); }
.np .aux { width: 100%; }


/* ---- QA round 2: brand + play discs + shelves --------------------------- */
.sidebar .brand { display: flex; justify-content: center; padding: 6px 0 28px; }
.sidebar .brand img.full { height: 46px; }

/* Play discs: light disc, navy glyph, a whisper of the compass hub. */
.playbig, .transport .pp, .mini .tp .pp {
  background: var(--sa-cream);
  color: var(--sa-navy);
  box-shadow: inset 0 0 0 2px var(--sa-brass), 0 12px 30px -12px rgba(0, 0, 0, 0.5);
}
.playbig:hover, .transport .pp:hover, .mini .tp .pp:hover { background: var(--sa-white); }


/* ---- QA round 3: installed-app safe areas + touch targets ---------------- */
.main { padding-top: env(safe-area-inset-top, 0px); }
.auth-wrap { padding-top: env(safe-area-inset-top, 0px); }
.room-top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.sidebar { padding-top: calc(28px + env(safe-area-inset-top, 0px)); }
.back { padding: 12px 10px; margin: 12px -10px 4px; min-height: 44px; border-radius: 10px; }
.hero .buy { justify-self: center; }

/* ------------------------------ watch page ------------------------------- */
.watch-overlay {
  position: fixed; inset: 0; z-index: 36;
  background: var(--sa-navy); color: var(--sa-cream);
  overflow-y: auto;
}
.watch-top { display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 6px; }
.watch-top .lab { font-size: 13px; color: var(--sa-mist); }
.watch-top button { width: 44px; height: 44px; background: none; border: 0;
  color: var(--sa-cream); display: flex; align-items: center; justify-content: center; }
.watch-stage { max-width: 960px; margin: 0 auto; padding: 8px 16px 40px; }
.watch-stage video { width: 100%; border-radius: 14px; background: #000;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6); }
.watch-stage h1 { font-family: var(--sa-font-serif); font-weight: 400;
  font-size: 22px; margin: 16px 0 4px; color: var(--sa-cream); }
.watch-status { min-height: 1.3em; font-size: 13.5px; color: var(--sa-mist); margin: 6px 0; }
.watch-cta { margin-top: 8px; }


/* ---- burgundy rebrand ---------------------------------------------------- */
.room-overlay, .watch-overlay {
  background: linear-gradient(180deg, #700C18 0%, #5A040E 100%);
}
.btn-gold { background: var(--sa-cream); color: var(--sa-navy); }
.btn-gold:hover { background: var(--sa-white); }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup .bmk { height: 40px; width: 40px; }
.brand-lockup .bword { font-family: var(--sa-font-serif); color: var(--sa-navy);
  font-size: 19px; line-height: 1.05; }
.brand-lockup .bword em { display: block; font-style: normal; font-size: 11px;
  letter-spacing: var(--sa-tracking-caps); text-transform: uppercase;
  opacity: 0.62; margin-top: 2px; }
@media (min-width: 640px) and (max-width: 1023px) {
  .sidebar .brand .full { display: none; }
  .sidebar .brand img.mk { display: block; }
}
.auth-side .s-cream { width: 88px; margin-bottom: 18px; }
.auth-side .brandname { font-family: var(--sa-font-serif); color: var(--sa-cream);
  font-size: 26px; line-height: 1.1; }
.auth-side .brandname em { display: block; font-style: normal; font-size: 13px;
  letter-spacing: var(--sa-tracking-caps); text-transform: uppercase; opacity: 0.7; }

/* --------------------------- admin titles table --------------------------- */
.atable { padding: 6px 18px 10px; }
.atable .ahead, .atable .arow {
  display: grid; grid-template-columns: 52px 1fr 70px 76px 104px 64px 48px;
  gap: 12px; align-items: center;
}
.atable .ahead { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sa-slate); padding: 10px 0 8px; border-bottom: 1px solid var(--sa-line); }
.atable .arow { padding: 10px 0; border-bottom: 1px solid var(--sa-line);
  color: var(--sa-navy); font-size: 14px; }
.atable .arow:last-child { border-bottom: 0; }
.atable .arow img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover;
  box-shadow: 0 6px 16px -8px rgba(74, 7, 16, 0.5); }
.atable .at { min-width: 0; }
.atable .at b { display: block; font-family: var(--sa-font-serif); font-weight: 400;
  font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atable .at small { color: var(--sa-slate); font-size: 12px; }
.atable .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; }
.atable .dot.live { background: #3E7A4E; }
.atable .dot.draft { background: var(--sa-brass); }
@media (max-width: 760px) {
  .atable .ahead { display: none; }
  .atable .arow { grid-template-columns: 52px 1fr 76px; }
  .atable .arow span:nth-child(3), .atable .arow span:nth-child(4),
  .atable .arow span:nth-child(6), .atable .arow span:nth-child(7) { display: none; }
}

/* Private titles: the lock sits inline with its note, not on a line of its own. */
.detail .cta .note .ic { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }

/* -------------------------------- albums --------------------------------- */
/* An album's songs: the chapter list's rows, with a status column. */
.tracks li button.rowbtn { cursor: pointer; }
.tracks li { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
.tracks .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .dur { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tracks .dur .ic { width: 15px; height: 15px; }
.tracks li.is-done .name { color: var(--sa-slate); }
.tracks li.on { background: linear-gradient(90deg, rgba(112, 12, 24, 0.06), transparent 70%); }
.autoplay-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sa-slate); cursor: pointer; }
.autoplay-switch input { width: 18px; height: 18px; accent-color: var(--sa-navy); }

/* A shelf's own button beside "See all" (Shuffle all). */
.shelf-h .shelf-tools { display: inline-flex; align-items: baseline; gap: 16px; }
.shelf-shuffle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0;
  font: 500 14px/1 var(--sa-font-sans, inherit); color: var(--sa-deep); cursor: pointer; }
.shelf-shuffle .ic { width: 16px; height: 16px; }
.shelf-shuffle:hover { text-decoration: underline; text-underline-offset: 3px; }
.shelf-note { margin: -8px 0 14px; font-size: 14px; color: var(--sa-slate); max-width: 640px; }

/* For grown-ups: a quiet label and, on its page, the note about it. */
.tag.grown { background: var(--sa-sand); color: var(--sa-deep); box-shadow: none; }
.detail .advisory { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px;
  border-radius: 12px; background: var(--sa-sand); color: var(--sa-navy); font-size: 14px; line-height: 1.45; max-width: 560px; }
.detail .advisory .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--sa-deep); }
@media (max-width: 639px) { .detail .advisory { text-align: left; margin-left: auto; margin-right: auto; } }

/* The Up next card, in the burgundy listening room. */
.upnext {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  margin: 14px auto 0; padding: 12px 14px; max-width: 640px; text-align: left;
  border-radius: 16px; background: rgba(251, 243, 228, 0.1); box-shadow: inset 0 0 0 1px rgba(251, 243, 228, 0.22);
  color: var(--sa-cream); animation: upnext-in .25s ease-out;
}
@keyframes upnext-in { from { opacity: 0; transform: translateY(6px); } }
.upnext__art { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.upnext__txt { min-width: 0; }
.upnext__txt small { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--sa-mist); }
.upnext__txt b { display: block; font-family: var(--sa-font-serif); font-weight: 400; font-size: 18px; margin: 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upnext__count { font-size: 13px; color: var(--sa-mist); }
.upnext__btns { display: flex; gap: 8px; }
.upnext .btn-ghost { background: transparent; color: var(--sa-cream); box-shadow: inset 0 0 0 1.5px rgba(251, 243, 228, 0.4); }
@media (max-width: 639px) {
  .upnext { grid-template-columns: 52px minmax(0, 1fr); }
  .upnext__art { width: 52px; height: 52px; }
  .upnext__btns { grid-column: 1 / -1; }
  .upnext__btns .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .upnext { animation: none; } }
.watch-frame { position: relative; }
