/* Persistent music dock styles — extracted from persistent-music.js
   2026-05-17 Pass G. Was injected via createElement(style) + textContent;
   moved here so the styles can be cached separately, loaded in parallel
   with HTML parse, and the JS file is ~28KB lighter.
   IF YOU EDIT THESE RULES: source of truth is now this file. The JS no
   longer contains the dock CSS. */

:root { --cmd-h: 80px; --cmd-art: 56px; --cmd-accent: #c0392b; }
body.has-cmd-dock { padding-bottom: var(--cmd-h); }

/* ─── DOCK SHELL ────────────────────────────────────── */
#__chris-dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--cmd-h);
  z-index: 9990;
  background: rgba(6,6,9,0.92);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #f5f5f0;
  font-family: 'Space Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.5);
  /* Dock is visible immediately on render. The previous slide-up
     animation was gated on requestAnimationFrame, which could be
     starved by heavy work on the page (mobile WebGL hero) and
     leave the dock stuck offscreen. Visibility > animation. */
}
/* .is-ready stays as a state marker (audio adopted, sync ran) but
   no longer gates display. */

/* ─── LEFT: art + meta ─────────────────────────────── */
.cmd-left {
  display: flex; align-items: center; gap: 14px;
  min-width: 0; /* allow ellipsis */
}
.cmd-art {
  flex-shrink: 0;
  width: var(--cmd-art); height: var(--cmd-art);
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
}
.cmd-art img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: grayscale(0.15) contrast(1.05);
}
.cmd-art:hover { border-color: rgba(255,255,255,0.25); }
.cmd-art::after {
  /* dossier corner mark */
  content: ''; position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-top: 1px solid rgba(255,255,255,0.35);
  border-right: 1px solid rgba(255,255,255,0.35);
}

.cmd-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cmd-info-tag {
  font-size: 8px; letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(245,245,240,0.45);
  display: inline-flex; align-items: center; gap: 6px;
}
.cmd-info-tag .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cmd-accent);
  box-shadow: 0 0 5px var(--cmd-accent);
  animation: cmd-pulse 2.4s infinite ease-in-out;
}
.cmd-info-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #f5f5f0;
}
.cmd-info-meta {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(245,245,240,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes cmd-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ─── CENTER: controls + progress ──────────────────── */
.cmd-center {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0; align-items: center;
}
.cmd-controls {
  display: flex; align-items: center; gap: 8px;
}
.cmd-btn {
  /* Bigger hit target than before (was 30×30). 40×40 keeps the
     dock compact but gives shuffle/prev/next/repeat a real
     clickable area on desktop + tablet. */
  all: unset; cursor: pointer;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: rgba(245,245,240,0.65);
  font-size: 17px; line-height: 1;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.cmd-btn:hover { color: #f5f5f0; background: rgba(255,255,255,0.06); }
.cmd-btn:disabled { opacity: 0.3; cursor: default; }
.cmd-btn:disabled:hover { color: rgba(245,245,240,0.65); background: transparent; }
.cmd-btn.is-active { color: var(--cmd-accent); }
.cmd-btn.is-active:hover { color: var(--cmd-accent); }
.cmd-btn .cmd-glyph { display: block; line-height: 1; }
.cmd-btn .cmd-repeat-one {
  position: absolute;
  font-size: 8px; font-weight: 700;
  bottom: 6px; right: 7px;
}
.cmd-btn.is-repeat { position: relative; }

.cmd-play {
  /* Touch-target sized (44×44) — was 36×36, undersized for the
     primary control. */
  width: 44px; height: 44px;
  background: #f5f5f0; color: #08080c;
  font-size: 12px;
}
/* SVG glyphs render pixel-crisp and optical-centered, unlike Unicode —
   which on iOS gets hijacked by the system emoji font (gray, fixed-color,
   immune to CSS). All player buttons use inline SVG now. */
.cmd-play .cmd-glyph {
  display: grid; place-items: center;
  width: 100%; height: 100%;
}
.cmd-btn .cmd-glyph svg {
  width: 17px; height: 17px;
  fill: currentColor;
  display: block;
}
/* Slightly larger for shuffle/repeat (line-art reads thin at 17px) */
.cmd-shuffle .cmd-glyph svg,
.cmd-repeat .cmd-glyph svg { width: 19px; height: 19px; }
/* While dragging the seek/volume bar, force the handle visible */
.cmd-bar.is-dragging .cmd-handle,
.cmd-vol-bar.is-dragging .cmd-vol-handle { transform: translate(-50%, -50%) scale(1); }
.cmd-bar.is-dragging .cmd-fill,
.cmd-vol-bar.is-dragging .cmd-vol-fill { background: var(--cmd-accent); transition: none; }
.cmd-play:hover { transform: scale(1.06); }
.cmd-play.is-playing { background: var(--cmd-accent); color: #fff; }
.cmd-play.is-playing:hover { background: var(--cmd-accent); filter: brightness(1.12); }

.cmd-progress-wrap {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  max-width: 600px;
}
.cmd-time {
  font-size: 10px;
  color: rgba(245,245,240,0.55);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}
.cmd-time.cmd-time-cur { text-align: right; }
.cmd-bar {
  flex: 1; min-width: 100px;
  height: 4px; background: rgba(255,255,255,0.12);
  position: relative; cursor: pointer;
  border-radius: 2px;
  /* 2026-05-17 — same iOS touch-action fix as .cmf-bar (see below). */
  touch-action: none;
}
.cmd-bar::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -10px; bottom: -10px;
  background: transparent;
  cursor: pointer;
}
.cmd-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #f5f5f0; width: 0%;
  border-radius: 2px;
  transition: width 0.15s linear;
}
.cmd-bar:hover .cmd-fill { background: var(--cmd-accent); }
.cmd-handle {
  position: absolute; top: 50%; left: 0%;
  width: 12px; height: 12px;
  background: #f5f5f0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.18s;
  pointer-events: none;
}
.cmd-bar:hover .cmd-handle { transform: translate(-50%, -50%) scale(1); }

/* ─── RIGHT: queue + volume ─────────────────────────── */
.cmd-right {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.cmd-queue {
  all: unset; cursor: pointer;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: rgba(245,245,240,0.65);
  transition: color 0.15s, background 0.15s;
  border-radius: 4px;
}
.cmd-queue:hover { color: #f5f5f0; background: rgba(255,255,255,0.06); }
.cmd-queue.is-open { color: var(--cmd-accent); }
.cmd-queue svg { width: 16px; height: 16px; fill: currentColor; }

.cmd-volume {
  display: flex; align-items: center; gap: 6px;
}
.cmd-vol-bar {
  width: 90px; height: 4px;
  background: rgba(255,255,255,0.12);
  position: relative; cursor: pointer;
  border-radius: 2px;
  touch-action: none;
}
.cmd-vol-bar::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -10px; bottom: -10px;
  background: transparent;
  cursor: pointer;
}
.cmd-vol-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #f5f5f0; width: 80%;
  border-radius: 2px;
  transition: width 0.1s linear, background 0.15s;
}
.cmd-vol-bar:hover .cmd-vol-fill { background: var(--cmd-accent); }
.cmd-vol-handle {
  position: absolute; top: 50%; left: 80%;
  width: 10px; height: 10px;
  background: #f5f5f0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.18s;
  pointer-events: none;
}
.cmd-vol-bar:hover .cmd-vol-handle { transform: translate(-50%, -50%) scale(1); }
.cmd-volume.is-muted .cmd-vol-fill { background: rgba(255,255,255,0.18); }

/* ─── DRAWER (playlist popup) ───────────────────────── */
#__chris-dock-drawer {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--cmd-h);
  z-index: 9989;
  background: rgba(6,6,9,0.94);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #f5f5f0;
  font-family: 'Space Mono', monospace;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.34s cubic-bezier(.2,.7,.2,1);
}
#__chris-dock-drawer.is-open {
  max-height: min(60vh, 480px);
  overflow-y: auto;
}
.cmd-drawer-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 24px 12px;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(245,245,240,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cmd-drawer-list { padding: 8px 0 20px; }
.cmd-row {
  display: grid;
  grid-template-columns: 32px 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 24px;
  cursor: pointer;
  transition: background 0.12s;
}
.cmd-row:hover { background: rgba(255,255,255,0.04); }
.cmd-row.is-current .cmd-r-name { color: var(--cmd-accent); }
.cmd-row .cmd-r-num {
  font-size: 10px; color: rgba(245,245,240,0.45);
  font-variant-numeric: tabular-nums; text-align: center;
}
.cmd-row.is-current .cmd-r-num {
  color: var(--cmd-accent);
  font-size: 12px;
}
.cmd-r-art {
  width: 44px; height: 44px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}
.cmd-r-art img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: grayscale(0.15) contrast(1.05);
}
.cmd-r-info {
  min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.cmd-r-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f5f5f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmd-r-meta {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(245,245,240,0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmd-r-dur {
  font-size: 10px; color: rgba(245,245,240,0.5);
  font-variant-numeric: tabular-nums;
}

.cmd-drawer-empty {
  padding: 30px 24px; opacity: 0.4;
  text-align: center;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
}

/* ─── MOBILE MINI PLAYER ────────────────────────────── */
@media (max-width: 768px) {
  :root { --cmd-h: 64px; --cmd-art: 44px; }
  #__chris-dock {
    /* 2026-05-16 v3 — flex layout on mobile (was 3-col grid +
       display:contents). The display:contents approach was fragile
       and could leave the queue button invisible at certain widths.
       Flex with explicit ordering is unambiguous: art+info (1fr),
       queue button, play button. */
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    cursor: pointer;
  }
  .cmd-left { flex: 1 1 auto; min-width: 0; order: 1; }
  /* Visual order: art+info, then queue, then play. DOM order is
     left, center, right — so flip center and right via order: */
  .cmd-right  { order: 2; }
  .cmd-center { order: 3; }
  /* Hide cmd-center entirely on mobile — its only mobile-relevant
     child (.cmd-controls) is moved out via JS, see initDock. We
     pull just the play button from controls and slot it last. */
  .cmd-center .cmd-progress-wrap,
  .cmd-center .cmd-shuffle,
  .cmd-center .cmd-prev,
  .cmd-center .cmd-next,
  .cmd-center .cmd-repeat { display: none; }
  .cmd-center { display: flex; align-items: center; flex: 0 0 auto; }
  .cmd-center .cmd-controls { display: flex; align-items: center; }
  /* Show queue + hide volume inside .cmd-right (which is now a
     normal flex child, not display:contents) */
  .cmd-right { display: flex; align-items: center; flex: 0 0 auto; gap: 4px; }
  .cmd-right .cmd-volume { display: none; }
  /* Hamburger icon — borderless, matches the desktop player style.
     Chris 2026-05-16: "same as desktop, not a bordered box." */
  .cmd-queue {
    width: 36px; height: 36px;
    border: 0;
    background: transparent;
    color: rgba(245,245,240,0.7);
    padding: 0;
    display: grid; place-items: center;
    cursor: pointer;
    transition: color 0.15s;
    flex: 0 0 36px;
  }
  .cmd-queue:hover, .cmd-queue.is-open {
    color: #f5f5f0;
    background: transparent;
  }
  .cmd-queue svg { width: 18px; height: 18px; fill: currentColor; }
  .cmd-info-tag { display: none; }
  .cmd-info-name { font-size: 13px; }
  .cmd-info-meta { font-size: 10px; }
  .cmd-art::after { display: none; }
  .cmd-art { cursor: pointer; }
  /* Inside the dock-as-tap-target, prevent these buttons from
     bubbling their click up to the dock-expand handler */
  .cmd-play, .cmd-queue { cursor: pointer; }
}

/* ─── FULL-SCREEN MOBILE PLAYER ───────────────────────
   Slides up from below the mini player on tap. Spotify-style:
   big art, full-width controls, dossier framing. */
#__chris-fullscreen {
  position: fixed; inset: 0;
  z-index: 9991;
  background: #050505;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(192,57,43,0.18), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(192,57,43,0.10), transparent 60%);
  color: #f5f5f0;
  font-family: 'Space Mono', monospace;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 18px) 22px calc(env(safe-area-inset-bottom) + 22px);
  gap: 18px;
  transform: translateY(100%);
  transition: transform 0.34s cubic-bezier(.2,.7,.2,1);
  visibility: hidden;
  overflow: hidden;
}
#__chris-fullscreen.is-open {
  transform: translateY(0);
  visibility: visible;
}
@media (min-width: 769px) {
  #__chris-fullscreen { display: none; }
}
#__chris-fullscreen::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,255,255,0.018) 2px 3px);
  pointer-events: none;
  z-index: 0;
}
#__chris-fullscreen > * { position: relative; z-index: 1; }

.cmf-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.cmf-close, .cmf-more {
  all: unset; cursor: pointer;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: rgba(245,245,240,0.75);
  font-size: 18px;
}
.cmf-close svg, .cmf-more svg {
  width: 18px; height: 18px; fill: currentColor;
}
.cmf-head-tag {
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(245,245,240,0.6);
  display: inline-flex; align-items: center; gap: 8px;
}
.cmf-head-tag .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cmd-accent);
  box-shadow: 0 0 5px var(--cmd-accent);
  animation: cmd-pulse 2.4s infinite ease-in-out;
}

.cmf-art-wrap {
  display: flex; align-items: center; justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 0;
}
.cmf-art {
  width: min(82vw, 360px);
  aspect-ratio: 1 / 1;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 40px rgba(0,0,0,0.6);
}
.cmf-art img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: grayscale(0.1) contrast(1.05);
}
.cmf-art::after {
  content: ''; position: absolute;
  top: 8px; right: 8px;
  width: 14px; height: 14px;
  border-top: 1px solid rgba(255,255,255,0.45);
  border-right: 1px solid rgba(255,255,255,0.45);
}
.cmf-art::before {
  content: ''; position: absolute;
  bottom: 8px; left: 8px;
  width: 14px; height: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.45);
  border-left: 1px solid rgba(255,255,255,0.45);
}

.cmf-info {
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
}
.cmf-info:hover .cmf-info-name { color: #fff; }
.cmf-info-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 22px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}
.cmf-info-meta {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(245,245,240,0.55);
}

.cmf-progress {
  display: flex; flex-direction: column; gap: 6px;
}
.cmf-bar {
  height: 4px; background: rgba(255,255,255,0.14);
  position: relative; cursor: pointer;
  border-radius: 2px;
  /* 2026-05-17 — iOS Safari was claiming touchstart for vertical
     scroll before the drag handler could engage on the thin 4px
     track. touch-action: none tells the browser "this element
     handles its own gestures, don't auto-scroll." */
  touch-action: none;
}
/* Expand the touch hit area to a comfortable ~24px tall band
   without changing the visual 4px height. Pseudo-element extends
   above/below the track so a finger landing 10px off still
   registers a drag. */
.cmf-bar::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -10px; bottom: -10px;
  background: transparent;
  cursor: pointer;
}
.cmf-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #f5f5f0; width: 0%;
  border-radius: 2px;
  transition: width 0.15s linear;
}
.cmf-handle {
  position: absolute; top: 50%; left: 0%;
  width: 14px; height: 14px;
  background: #f5f5f0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cmf-bar.is-dragging .cmf-fill { background: var(--cmd-accent); transition: none; }
.cmf-times {
  display: flex; justify-content: space-between;
  font-size: 11px; color: rgba(245,245,240,0.55);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.cmf-controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
}
.cmf-btn {
  all: unset; cursor: pointer;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  margin: 0 auto;
  color: rgba(245,245,240,0.75);
  transition: color 0.15s, background 0.15s, transform 0.15s;
  border-radius: 50%;
  position: relative;
}
.cmf-btn svg { width: 22px; height: 22px; fill: currentColor; }
.cmf-btn:hover, .cmf-btn:active { color: #f5f5f0; }
.cmf-btn.is-active { color: var(--cmd-accent); }
.cmf-btn.cmf-play {
  width: 64px; height: 64px;
  background: #f5f5f0; color: #08080c;
}
.cmf-btn.cmf-play svg { width: 24px; height: 24px; display: block; }
/* The .cmf-glyph wrapper needs to be a grid cell too, or the SVG sits
   on an inline-text baseline with a 3-4px descender, pushing the play
   triangle / pause bars off the button's optical center. */
.cmf-play .cmf-glyph {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
}
.cmf-btn.cmf-play.is-playing { background: var(--cmd-accent); color: #fff; }
.cmf-btn.cmf-repeat-one .cmf-repeat-one-badge {
  position: absolute;
  font-size: 8px; font-weight: 700;
  bottom: 8px; right: 9px;
}

.cmf-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cmf-queue {
  all: unset; cursor: pointer;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(245,245,240,0.7);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 4px;
}
.cmf-queue:hover, .cmf-queue:active { color: var(--cmd-accent); }
.cmf-queue svg { width: 14px; height: 14px; fill: currentColor; }
.cmf-foot-meta {
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(245,245,240,0.4);
}

body.cmf-locked { overflow: hidden; }

/* Suppressed (video pages or hideDock) — body padding off */
body.no-cmd-dock { padding-bottom: 0 !important; }
