/* The fonts, served from this site (Google Fonts' latin and latin-ext
   files, OFL): no third-party request before the first paint, and the
   service worker keeps them for offline. A browser only downloads the
   latin-ext file when a song title needs one of its letters. Browsers
   keep them for a year (_headers): to change a font, give the new
   file a new name. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/inter-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/inter-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Two colours only: indigo (the ground, its shades) and violet (the
     accent, its tints for text). Every colour below is one of the two */
  --primary: #b38bfa;            /* violet: live and selected state; 6.5:1 on the ground */
  --bg-color: #0f1535;           /* indigo */
  --panel: #131a40;
  --line: rgba(179, 139, 250, 0.14);
  --line-strong: rgba(179, 139, 250, 0.26);
  --text: #ffffff;               /* white: all text */
  --muted: #c3c5d7;              /* white at 75% on the indigo */
  --dim: #9fa1b5;                /* white at 60% on the indigo */
  --error: #f4b4c8;              /* a pink-violet, still read as an error */
  --text-soft: #e1e2ea;
  --surface: #1b2352;            /* behind a cover while it loads */
  --edge: rgba(179, 139, 250, 0.18); /* the hairline round covers and boxes */
  --hover: rgba(179, 139, 250, 0.06);
  --selected: rgba(179, 139, 250, 0.1);
  --glass: rgba(15, 21, 53, 0.82);           /* the app column, the top bar */
  --glass-panel: rgba(19, 26, 64, 0.82);     /* Log and Signal beside Now (computer) */
  --glass-side: rgba(17, 23, 58, 0.9);       /* the sidebar (computer) */
  --glass-raised: rgba(27, 35, 82, 0.96);    /* the mini player, a shade above the tabs */
  --glass-bar: rgba(15, 21, 53, 0.97);       /* the tab bar */
  /* The play bar: violet, indigo text (no longer the cover's colour) */
  --btn-bg: #b38bfa;
  --btn-ink: #0f1535;
  --ink: #0f1535;               /* text on the violet */
  --shade: 8, 11, 30;           /* indigo, darkest: shadows */
  --topbar-h: 56px;
  --tabbar-h: 64px;
  --mini-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}


*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg-color); }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text);
  height: 100vh;
  /* The visible height: 100vh is the height without the mobile toolbar,
     which would hide the tab bar behind it */
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--primary); color: var(--ink); }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8125rem;   /* 13px: the smallest text on the page */
}

[hidden] { display: none !important; }

/* Keyboard focus, visible on every control */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.screen:focus-visible { outline: none; }

/* ------------------------------------------------------------ backdrop */

#dynamic-bg {
  position: fixed;
  inset: -60px;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-image: radial-gradient(circle at 50% 28%, rgba(179, 139, 250, 0.22), transparent 62%);
}

#dynamic-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, transparent 0%, var(--bg-color) 80%);
}


/* ------------------------------------------------------------ app shell */

#app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) auto auto;
  /* One column that never grows past the screen, even when large text
     makes a row wider than it */
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 460px;
  height: 100%;
  margin: 0 auto;
}

/* On a computer the app sits as a phone-width column over the cover */
@media (min-width: 600px) {
  #app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: var(--glass);
    box-shadow: 0 30px 80px rgba(var(--shade), 0.6);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  cursor: default;
}
.brand span { color: var(--primary); }

/* Cast: an icon beside the listener count, green while casting */
.cast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;   /* with the count, to the right of the brand */
  margin-right: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}
.cast svg { width: 22px; height: 22px; fill: currentColor; }
.cast[aria-pressed="true"] { color: var(--primary); }
@media (hover: hover) {
  .cast:hover { color: var(--text); }
}

.live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent);
  animation: live-pulse 2.4s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* ------------------------------------------------------------ stations */

/* Beside the wordmark: "Stations" on the radio, the webradio's name in
   green on one. A pill like Sleep, cut short rather than pushing the
   listener count off a narrow phone. */
.station-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 42vw;
  min-height: 32px;
  margin-left: 12px;
  margin-right: auto;   /* the count and Cast stay on the right */
  padding: 0 8px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.station-btn::after { content: ""; position: absolute; inset: -6px 0; }   /* a 44px tap */
.station-btn span { overflow: hidden; text-overflow: ellipsis; }
.station-btn svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.station-btn .station-chev { width: 13px; height: 13px; }
body[data-station] .station-btn { border-color: var(--primary); color: var(--primary); }
@media (hover: hover) {
  .station-btn:hover { color: var(--text); }
  body[data-station] .station-btn:hover { color: var(--primary); background: var(--hover); }
}
/* Room for the button on the narrowest phones: the count's text goes,
   its green dot stays */
@media (max-width: 359px) {
  .topbar .live #listeners { display: none; }
}

.stations {
  width: min(440px, calc(100vw - 32px));
  max-height: min(640px, calc(100dvh - 64px));
  padding: 16px 20px 20px;
  border: 1px solid var(--line-strong);
  background: var(--glass-raised);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.stations::backdrop {
  background: rgba(var(--shade), 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.stations-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.stations-head .block-label { margin: 0; }
.stations-list { list-style: none; margin: 0; padding: 0; }
.stations-list li + li { border-top: 1px solid var(--line); }

.station-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.station-item img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--edge);
  background: var(--surface);
}
.station-item .song {
  display: block;
  font-weight: 900;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-item .by {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-item .station-tag { color: var(--dim); }
.station-item[aria-current="true"] img { outline: 2px solid var(--primary); outline-offset: 2px; }
.station-item[aria-current="true"] .song,
.station-item[aria-current="true"] .station-tag { color: var(--primary); }
.station-item:disabled { cursor: default; opacity: 0.55; }
@media (hover: hover) {
  .station-item:not(:disabled):hover { background: var(--hover); }
}

/* ------------------------------------------------------------ screens */

.screens {
  position: relative;
  min-height: 0;
}

.screen {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 20px 28px;
  /* Rows check their own width against the text size (@container in rem) */
  container: screen / inline-size;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  animation: screen-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.screen::-webkit-scrollbar { width: 4px; }
.screen::-webkit-scrollbar-thumb { background: var(--line-strong); }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.screen-title {
  margin: 4px 0 6px;
  font-weight: 900;
  font-style: italic;
  font-size: 2rem;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.screen-sub {
  margin: 0 0 20px;
  color: var(--dim);
  font-size: 0.875rem;
  line-height: 1.5;
  text-wrap: pretty;   /* no word alone on the last line */
}

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

.screen-now {
  display: flex;
  flex-direction: column;
}

.cover {
  position: relative;
  margin: 0 auto;
  /* Short phones keep the title and PLAY above the tab bar: the cover
     takes what's left once the song text, its three buttons and PLAY
     have their room, down to a small square on the shortest screens */
  width: min(80%, calc(100dvh - 400px));
  min-width: 132px;
  flex: none;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--edge);
  box-shadow: 0 18px 50px rgba(var(--shade), 0.6);
  overflow: hidden;
  container-type: inline-size;   /* the facts label fits itself to the cover */
}

/* With a sponsor credit at the foot of Now, the cover gives up a little
   height so the whole screen still fits a phone like a Pixel 8 in the
   app (412×839), credit included, instead of the tab bar cutting it */
@media (orientation: portrait) and (max-width: 1023px) {
  body[data-sponsor] .cover { width: min(80%, calc(100dvh - 480px)); }
  /* "Up next" adds a line or two under the artist */
  body:has(#up-next:not([hidden])) .cover { width: min(80%, calc(100dvh - 415px)); }
  body[data-sponsor]:has(#up-next:not([hidden])) .cover { width: min(80%, calc(100dvh - 510px)); }
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease;
}
.cover img.is-loading { opacity: 0.35; }

.cover-facts { display: none !important; }   /* the year is in the artist line */
/* The song's text, its buttons in one row under it */
.meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 20px;
}
.meta-text { min-width: 0; }
.meta .meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.meta .meta-actions > :not([hidden]) { margin-top: 0; }
#find { display: none !important; }   /* on Now: each Log row has its own */

.share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  position: relative;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.share svg { width: 16px; height: 16px; fill: currentColor; }
/* The pills are drawn 36px tall but take a 44px tap; Share and Like sit
   8px apart, so their tap areas meet without overlapping */
.share::after,
.sleep::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

/* Like: an outlined heart, filled green once liked */
.like svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.like[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.like[aria-pressed="true"] svg { fill: currentColor; }

.title {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  font-size: 1.875rem;
  line-height: 0.95;
  padding-top: 0.12em;   /* room for an accent on a capital (É) that overflow would cut */
  margin-top: -0.12em;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;   /* a word too long for the line breaks at a syllable */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 0.08em; /* the italic's overhang */
}

@media (max-width: 380px) {
  .title { font-size: 1.625rem; }
}

/* Large text (the phone's text size turned up): the column is narrow
   for the size of its letters, so Share, Like and Find go in a row
   under the song and the title gets the whole width. Measured in rem,
   so it follows the text size, not the screen. */
@container screen (max-width: 19rem) {
  .meta { grid-template-columns: minmax(0, 1fr); }
  .meta .meta-actions {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 14px;
  }
}

.artist {
  margin: 10px 0 0;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-note { margin: 10px 0 0; color: var(--dim); }
/* A listener's request: "Demandé par Marie" */
.requested-by { margin: 10px 0 0; color: var(--primary); }
.up-next { margin: 10px 0 0; color: var(--dim); }
.requested-by:not([hidden]) + .up-next { margin-top: 6px; }

/* The play bar: cover-coloured, the station's one big control */
.play-wrap { margin-top: 20px; }

.play-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 60px;
  padding: 0 18px;
  border: 0;
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 10px 30px rgba(var(--shade), 0.45);
  transition: background-color 0.6s ease, color 0.6s ease, transform 0.12s ease;
}
.play-btn:active { transform: scale(0.985); }
@media (hover: hover) {
  .play-btn:hover { filter: brightness(1.06); }
}

.play-icon { width: 24px; height: 24px; flex: none; fill: currentColor; }
.play-icon .i-stop,
.play-icon .i-retry { display: none; }
/* Failed: a retry arrow, so the bar itself says something went wrong */
body[data-state="error"] .play-icon .i-play { display: none; }
body[data-state="error"] .play-icon .i-retry { display: inline; }
body[data-state="playing"] .play-icon .i-play,
body[data-state="connecting"] .play-icon .i-play { display: none; }
body[data-state="playing"] .play-icon .i-stop,
body[data-state="connecting"] .play-icon .i-stop { display: inline; }

.play-label { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.play-word {
  font-weight: 900;
  font-style: italic;
  font-size: 1.75rem;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
/* The words come from the page's language (script.js, applyLanguage) */
.play-word::before { content: attr(data-play); }
body[data-state="playing"] .play-word::before,
body[data-state="connecting"] .play-word::before { content: attr(data-stop); }

.play-status {
  margin-top: 5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
}
/* Only while there's something to show: idle dots read as a spinner */
body[data-state="idle"] .visualizer,
body[data-state="error"] .visualizer { visibility: hidden; }
.visualizer i {
  width: 3px;
  height: 24px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.5;
  /* Scale, not height: it runs on the compositor, so HLS work and
     song-info updates on the main thread can't make the wave stutter */
  transform: scaleY(0.1667);
  transform-origin: bottom;
}
/* One animation for both states, so a buffering blip (playing ->
   connecting -> playing) doesn't restart the wave from frame 0.
   Connecting just shrinks and dims it. */
body[data-state="playing"] .visualizer i,
body[data-state="connecting"] .visualizer i {
  animation: v-bounce 0.8s infinite ease-in-out;
  animation-delay: calc(var(--i) * 0.1s - 0.8s);
}
.visualizer {
  transform-origin: bottom;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
body[data-state="connecting"] .visualizer { transform: scaleY(0.42); opacity: 0.75; }
/* Negative delays start every bar mid-cycle: the full wave from the
   first frame instead of bars kicking in one after another */
.visualizer i:nth-child(1) { --i: 1; }
.visualizer i:nth-child(2) { --i: 2; }
.visualizer i:nth-child(3) { --i: 3; }
.visualizer i:nth-child(4) { --i: 4; }
.visualizer i:nth-child(5) { --i: 5; }
.visualizer i:nth-child(6) { --i: 6; }
.visualizer i:nth-child(7) { --i: 7; }

@keyframes v-bounce {
  0%, 100% { transform: scaleY(0.1667); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

.status-note {
  margin: 12px 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--error);
}

.volume {
  display: flex;
  align-items: center;
  flex-wrap: wrap;   /* large text: Sleep goes under the slider */
  gap: 4px 14px;
  margin-top: 18px;
  color: var(--muted);
}
.volume label { flex: none; }
.volume input[type="range"] { min-width: 6rem; }

/* Sleep timer: a pill like Share, green while it counts down */
.sleep {
  position: relative;
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}
.sleep[data-on="true"],
.sleep[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.saver-block .sleep { margin-top: 12px; }
.alerts-block { margin: 0 0 16px; }
.alerts-ask-yes { display: block; margin-top: 10px; }
.alerts-block .empty { margin: 8px 0 0; }
@media (hover: hover) {
  .share:hover,
  .sleep:hover { border-color: var(--primary); color: var(--primary); }
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 44px; /* touch target; the track is drawn below */
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 80%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(to right, var(--text) var(--fill), var(--line-strong) var(--fill));
}
input[type="range"]::-moz-range-track { height: 3px; background: var(--line-strong); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--text); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--text);
  border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  border: 0;
}

.lyrics {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.lyrics summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.lyrics summary::-webkit-details-marker { display: none; }
.lyrics summary::after { content: "+"; font-size: 1rem; }
.lyrics[open] summary::after { content: "–"; }
.lyrics-body {
  padding: 4px 0 8px;
  white-space: pre-line;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-soft);
}

/* Comments: under the lyrics, the same fold */
.comments { margin-top: 0; }
.comments-body { padding: 4px 0 12px; }
.comments-list { list-style: none; margin: 0 0 12px; padding: 0; }
.comments-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment-who {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-size: 0.75rem;
}
.comment-text { margin: 4px 0 0; font-size: 0.9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.comment-report {
  min-height: 44px;
  margin: -6px 0;   /* a 44px tap; the row keeps its height */
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
}
@media (hover: hover) {
  .comment-report:hover { color: var(--error); }
}
.comment-form textarea { min-height: 64px; padding: 10px 14px; resize: vertical; }
.comment-row { display: flex; gap: 10px; margin-top: 10px; }
.comment-row .req-input { flex: 1; min-width: 0; }
.comment-row .share { flex: none; margin-top: 0; min-height: 44px; }
.comment-rules { margin: 8px 0 0; color: var(--dim); font-size: 0.75rem; line-height: 1.5; }

/* ------------------------------------------------------------ iPhone install */

/* Under the volume row, drawn like the sponsor line: a hairline above,
   a mono label, Safari's Share glyph so it's easy to spot on the bar */
.ios-install {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ios-install-icon { width: 20px; height: 20px; fill: var(--primary); }
.ios-install-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text-soft);
}
.ios-install-label { display: block; margin-bottom: 2px; color: var(--dim); }
.ios-install-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -12px;   /* the cross lines up with the column's edge */
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}
.ios-install-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
@media (hover: hover) {
  .ios-install-close:hover { color: var(--text); }
}

/* ------------------------------------------------------------ sponsor */

/* The server's sponsor (sponsor.json): a credit, not an ad. A mono
   label, the name in the title's black italic, a hairline above, the
   same weight as the volume row: there when you look, never in the way.
   It sits at the foot of Now, so a short song pushes it down, not up. */
.sponsor-slot {
  margin-top: auto;
  padding-top: 20px;
}

.sponsor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  row-gap: 6px;
  min-height: 44px;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.sponsor-label { grid-column: 1 / -1; color: var(--dim); }
/* At the foot of Now: label and name on one line, to stay short */
.sponsor-slot .sponsor {
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 12px;
  padding-top: 12px;
}
.sponsor-slot .sponsor-label { grid-column: auto; }
.sponsor-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
/* Logos come in every shape: held to the name's height, never wider
   than a short word, and drawn as they are (no tint, no frame) */
.sponsor-logo {
  flex: none;
  height: 24px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
}
.sponsor-name {
  font-weight: 900;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.08em; /* the italic's overhang */
}
.sponsor-arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  transition: color 0.18s ease, transform 0.18s ease;
}

/* Signal: the station's accounts, one row each between hairlines like the
   readout: network, handle in mono, the arrow of a link that leaves */
.follow-list { list-style: none; margin: 0; padding: 0; }
.follow-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
}
.follow-list li:last-child a { border-bottom: 1px solid var(--line); }
.follow-name { font-weight: 700; transition: color 0.18s ease; }
.follow-name { flex: none; }
.follow-handle {
  min-width: 0;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  color: var(--muted);
}
.follow-arrow {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  transition: color 0.18s ease, transform 0.18s ease;
}

/* Signal: the sponsor with its one line, between hairlines like the readout */
.sponsor-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.sponsor-card .sponsor-logo { height: 40px; max-width: 120px; }
.sponsor-card .sponsor-logo[hidden] + .sponsor-text { grid-column: 1 / 3; }
.sponsor-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sponsor-card .sponsor-name {
  font-size: 1.375rem;
  line-height: 1;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sponsor-line { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }
.sponsor-line:empty { display: none; }
.sponsor-ask-link { color: var(--primary); }
/* A sponsor with just a name: one line on Signal too, like the foot of
   Now, instead of a name boxed between two rules */
.sponsor-block.is-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sponsor-block.is-compact .block-label { margin: 0; }
.sponsor-block.is-compact .sponsor-card {
  display: flex;
  min-height: 0;
  padding: 0;
  border: 0;
}
.sponsor-block.is-compact .sponsor-name { font-size: 1rem; }

@media (hover: hover) {
  /* Only a sponsor with a website is a link, and only a link lights up */
  .sponsor[href]:hover .sponsor-name,
  .sponsor-card[href]:hover .sponsor-name { color: var(--primary); }
  .sponsor[href]:hover .sponsor-arrow,
  .sponsor-card[href]:hover .sponsor-arrow { color: var(--primary); transform: translate(2px, -2px); }
  .follow-list a:hover .follow-name,
  .follow-list a:hover .follow-arrow { color: var(--primary); }
  .follow-list a:hover .follow-arrow { transform: translate(2px, -2px); }
}

/* The sidebar's credit is for a computer only */
.sponsor-side { display: none; }

/* ------------------------------------------------------------ log */

.log-list { list-style: none; margin: 0; padding: 0; }

.log-item {
  display: grid;
  grid-template-columns: 26px 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.log-item:last-child { border-bottom: 1px solid var(--line); }

.log-item .n { color: var(--dim); }
.log-item img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--edge);
  background: var(--surface);
}
.log-item .song {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-item .by {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-item .at { color: var(--dim); font-variant-numeric: tabular-nums; }

.log-item.is-live .n { color: var(--primary); }
/* The song on air: framed inside its own 48px, so the column stays aligned */
.log-item.is-live img { border: 2px solid var(--primary); }
.log-item.is-live .song { color: var(--primary); }
.log-item.is-live .at { color: var(--primary); }

.empty { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; text-wrap: pretty; }

/* Large text or a 320px phone: the number and the time no longer fit
   beside the song, so the number goes and the time sits under the
   artist (in Toute la journée the time is the number's cell) */
@container screen (max-width: 18rem) {
  .log-item:not(.liked-item, .req-item) {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    row-gap: 4px;
  }
  .log-item:not(.liked-item, .req-item) > img { grid-column: 1; grid-row: 1 / span 2; }
  .log-item:not(.liked-item, .req-item) > div { grid-column: 2; grid-row: 1; }
  .log-item:not(.liked-item, .req-item) > .at,
  .log-item.day-item > .n { grid-column: 2; grid-row: 2; min-width: 0; }
  .log-item:not(.liked-item, .req-item, .day-item) > .n { display: none; }
  .log-item:not(.liked-item, .req-item) > :last-child { grid-column: 3; grid-row: 1 / span 2; }
}

/* Whole day: every song of a day, under the log (the lyrics' fold) */
.day { margin-top: 22px; }
.day-tools { display: flex; gap: 8px; margin: 4px 0 12px; }
.day-tools .req-input { flex: 1; min-width: 0; }
.day-pick {
  flex: 0 1 auto !important;
  width: auto;
  max-width: 50%;
  padding-right: 10px;
  color-scheme: dark;
}
.day > .empty { margin: 0 0 12px; }
.log-item.day-item { grid-template-columns: auto 48px minmax(0, 1fr) auto; }
.log-item.day-item .n { min-width: 5ch; font-variant-numeric: tabular-nums; }

/* Programme (its own tab): the slot on air and the next three */
.prog-list { list-style: none; margin: 0; padding: 0; }
.prog-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.prog-item:last-child { border-bottom: 1px solid var(--line); }
.prog-time { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog-name { display: block; font-weight: 700; font-size: 0.875rem; text-transform: uppercase; }
.prog-desc { display: block; margin-top: 3px; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.prog-tags { display: block; margin-top: 4px; color: var(--dim); }
.prog-item.is-now .prog-time,
.prog-item.is-now .prog-tags { color: var(--primary); }
.prog-item.is-now .prog-name { font-weight: 900; font-style: italic; }
.block .empty { margin: 0; }

/* Liked songs, under the log: cover, song, then Find and remove */
.liked .block-label { margin-bottom: 12px; font-weight: 500; }
.liked .empty { margin: 0; }
.log-item.liked-item { grid-template-columns: 48px minmax(0, 1fr) auto auto; }
.log-item .find,
.liked-item .unlike {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.log-item .find svg { width: 20px; height: 20px; fill: currentColor; }
@media (hover: hover) {
  .log-item .find:hover { color: var(--primary); }
  .liked-item .unlike:hover { color: var(--error); }
}
.liked-item .unlike svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ------------------------------------------------------------ signal */

.block { margin-top: 22px; }
.block-label { margin: 0 0 8px; color: var(--muted); }

.big-number {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  font-size: 4.5rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 88px;
  margin-top: 6px;
  border-bottom: 1px solid var(--line-strong);
}
.chart i {
  flex: 1;
  max-width: 14px;
  min-height: 2px;
  background: var(--primary);
  opacity: 0.8;
}
.chart i:last-child { opacity: 1; }
.chart i.is-empty { height: 2px; min-height: 0; background: var(--line-strong); opacity: 1; }

.chart-peak { margin: 14px 0 0; text-align: right; color: var(--dim); }

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 0;
  color: var(--dim);
}

.readout { margin: 26px 0 0; }
.readout div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.readout div:last-child { border-bottom: 1px solid var(--line); }
.readout dt { color: var(--muted); }
.readout dd {
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.readout dd[data-tone="live"] { color: var(--primary); }
.readout dd[data-tone="error"] { color: var(--error); }

.top-artists { list-style: none; margin: 0; padding: 0; }
.top-artists li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 22px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
}
.top-artists .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-artists .bar { height: 6px; background: var(--line); }
.top-artists .bar i { display: block; height: 100%; background: var(--text); }
.top-artists .count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 1023px) and (pointer: coarse) {
  .volume label,
  .volume input[type="range"] { display: none; }
}

/* ------------------------------------------------------------ mini player */

.mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--mini-h);
  min-height: var(--mini-h);   /* taller with large text, never cut */
  overflow: hidden;
  background: var(--btn-bg);
  color: var(--btn-ink);
}
body[data-tab="now"] .mini { display: none; }

.mini-open {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 12px 8px 10px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mini-open img {
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--edge);
  background: var(--surface);
}
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-title {
  font-weight: 900;
  font-style: italic;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-artist {
  margin-top: 3px;
  color: inherit;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-play {
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(var(--shade), 0.22);
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.6s ease, color 0.6s ease;
}
.mini-play .play-icon { width: 26px; height: 26px; }

/* ------------------------------------------------------------ demandes */

.req-form { margin: 0; }
.req-input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;   /* 16px: phones don't zoom in on focus */
}
.req-input::placeholder { color: var(--dim); }
.req-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.req-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;   /* large text: the label above the field */
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.req-name label { flex: none; text-transform: uppercase; letter-spacing: 0.08em; }
.req-name .req-input { flex: 1 1 10rem; min-width: 0; }

.req-status { margin: 14px 0 0; font-size: 0.9375rem; line-height: 1.5; }
.req-status[data-tone="ok"] { color: var(--primary); }
.req-status[data-tone="error"] { color: var(--error); }
.req-status[data-tone="closed"] { margin: 0 0 4px; color: var(--muted); }

.req-list { margin-top: 14px; }
.log-item.req-item { grid-template-columns: minmax(0, 1fr) auto; }
.req-item .why { color: var(--dim); font-size: 0.75rem; text-align: right; }
.req-item .share { margin-top: 0; }
#req-results:empty,
#req-waiting:empty { display: none; }

/* ------------------------------------------------------------ tab bar */

.tabbar {
  display: grid;
  /* As many columns as tabs on screen: Demandes only shows once the
     radio takes requests */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  border-top: 1px solid var(--line);
  background: var(--glass-bar);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.18s ease;
}
.tab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}
.tab .mono {
  max-width: 100%;
  padding: 0 2px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Five tabs on a small phone: "Programme" and "Demandes" side by side */
@media (max-width: 420px) {
  .tab .mono { letter-spacing: 0.06em; }
}
/* 320px: "PROGRAMME" only fits whole without the spacing */
@media (max-width: 340px) {
  .tab .mono { padding: 0; letter-spacing: 0; }
}
@media (hover: hover) {
  .tab:hover { color: var(--text); }
}
.tab[aria-selected="true"] { color: var(--text); }
.tab::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 30%;
  right: 30%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab[aria-selected="true"]::before { transform: scaleX(1); }
.tab:focus-visible { outline-offset: -4px; }

/* ------------------------------------------------------------ sideways */

/* A phone held sideways is too short for the cover above the title:
   the cover takes the left, sized to the height, and the title, PLAY
   and volume sit beside it, all above the tab bar */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1023px) {
  #app { max-width: 820px; }
  .screen-now {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-auto-rows: min-content;
    column-gap: 24px;
    align-content: start;
  }
  .screen-now > * { grid-column: 2; }
  .screen-now .cover {
    grid-column: 1;
    grid-row: 1 / span 6;
    width: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--safe-b) - 48px);
    min-width: 140px;
    margin: 0;
  }
  .meta { margin-top: 0; }
  .title { font-size: 1.5rem; -webkit-line-clamp: 2; }
  .artist { margin-top: 6px; font-size: 1rem; }
  .play-wrap { margin-top: 16px; }
  .volume { margin-top: 8px; }
}

/* ------------------------------------------------------------ computer */

/* A desktop app: the sidebar (brand, Log/Signal, listeners) down the
   left, Now in the middle with the big cover, the log or Signal beside
   it, and the player along the bottom in the cover's colour */
@media (min-width: 1024px) {
  #app {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: 96px minmax(0, 1fr) auto;
    max-width: 1440px;
    background: var(--glass);
  }

  .topbar {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 0 24px;
    border-right: 1px solid var(--line);
    background: var(--glass-side);
    backdrop-filter: none;   /* a blur layer would paint over the listener count */
    -webkit-backdrop-filter: none;
  }
  /* The wordmark on one line, "On air" (or the listener count) under it */
  .brand { font-size: 1.25rem; white-space: nowrap; }
  .topbar .cast { position: absolute; top: 26px; left: 196px; margin: 0; }

  /* The sponsor at the foot of the sidebar, above the listener count;
     the line at the foot of Now gives way to it */
  .sponsor-slot,
  .sponsor-block { display: none !important; }   /* Signal's copy too: the sidebar's is always on screen */
  .sponsor-side:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    position: absolute;
    left: 24px;
    width: 172px;
    bottom: 24px;
    z-index: 2;
    padding-top: 12px;
  }
  /* The sidebar is narrow: a long name takes two lines, not an ellipsis */
  .sponsor-side .sponsor-name {
    font-size: 0.875rem;
    line-height: 1.1;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .sponsor-side .sponsor-logo { height: 20px; max-width: 72px; }

  .tabbar {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: auto;
    padding: 16px 12px;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: var(--glass-side);
  }
  #tab-now { display: none; }   /* Now is always on screen */
  /* The station: its own row at the top of the sidebar, above the tabs
     (beside the wordmark, 220px leaves no room for its name) */
  .station-btn {
    position: absolute;
    top: calc(96px + 16px);
    left: 12px;
    width: 216px;
    max-width: none;
    min-height: 44px;
    margin: 0;
    padding: 0 14px;
    z-index: 2;
  }
  .station-btn::after { inset: 0; }
  .station-btn .station-chev { margin-left: auto; }
  .topbar:has(.station-btn:not([hidden])) ~ .tabbar { padding-top: 76px; }
  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    height: 48px;
    padding: 0 14px;
    border-radius: 2px;
  }
  @media (hover: hover) {
    .tab:hover { background: var(--hover); }
  }
  .tab[aria-selected="true"] { background: var(--selected); }
  /* The tab chosen: its tint and violet label, no stripe down its side */
  .tab::before { display: none; }
  .tab[aria-selected="true"] { color: var(--primary); }

  .screens {
    grid-column: 2;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  }
  .screens > .screen { height: 100%; min-height: 0; }

  .screen-now {
    --col: min(540px, calc(100dvh - 360px), 100%);
    justify-content: safe center;
    align-items: center;
    padding: 32px 48px;
  }
  /* The cover follows the screen height; the song text under it keeps
     at least 440px, so a short laptop screen doesn't break the title
     mid-word */
  .screen-now > * { width: min(max(var(--col), 440px), 100%); }
  .screen-now .cover { width: var(--col); min-width: 0; }
  .title { font-size: 2.5rem; }
  /* PLAY under the song, as on a phone: Now is always on screen, so a
     bar along the bottom would only repeat it (it comes back for a
     podcast episode) */

  #panel-log,
  #panel-demandes,
  #panel-programme,
  #panel-signal {
    padding: 32px 36px;
    border-left: 1px solid var(--line);
    background: var(--glass-panel);
  }

  /* The player bar: only while a podcast episode is loaded */
  body[data-tab] .mini { display: none; }
  body[data-episode][data-tab] .mini {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    height: 88px;
    padding: 0 24px 0 14px;
    border-top: 0;
    background: var(--btn-bg);
    color: var(--btn-ink);
    transition: background-color 0.6s ease, color 0.6s ease;
  }
  body[data-episode][data-tab] .mini { grid-template-columns: minmax(0, 1fr) auto auto; }
  .mini-live { margin-right: 16px; border-color: currentColor; color: inherit; }
  .mini-open { gap: 16px; padding: 0; }
  .mini-open img { width: 60px; height: 60px; border-color: rgba(var(--shade), 0.2); }
  .mini-title { font-size: 1.25rem; }
  .mini-artist { color: inherit; }
  .mini-play {
    width: 64px;
    height: 64px;
    border-left: 0;
  }
  .mini-play .play-icon { width: 26px; height: 26px; }
  .mini-play:focus-visible,
  .mini-open:focus-visible { outline-color: var(--btn-ink); }
}

/* ------------------------------------------------------------ motion */

/* Movement off when the system asks: no slides, pulses or bouncing
   bars. Colour fades stay (they don't move anything), and every state
   still shows: a still halo on the live dot, still bars while playing,
   short dim bars while connecting */
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .live-dot { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
  .tab::before { transition: none; }
  .play-btn:active { transform: none; }
  .sponsor-arrow { transition: color 0.18s ease; transform: none !important; }
  .visualizer { transition: opacity 0.3s ease; }
  body[data-state] .visualizer i { animation: none; }
  body[data-state="playing"] .visualizer i { transform: scaleY(0.667); opacity: 1; }
}

/* Podcasts: the episodes, each with its play button; the one loaded is
   marked like the live song in the log */
.pod-player { margin: 0 0 22px; }
.pod-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.pod-now {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pod-now #pod-now { color: var(--primary); }
/* Play/pause, then the position across the row; the time and the
   pills under it. Same slider and pills as the volume and Sleep */
.pod-controls {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas: "toggle seek" "toggle meta";
  column-gap: 14px;
  align-items: center;
}
.pod-toggle {
  grid-area: toggle;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg-color);
  cursor: pointer;
  touch-action: manipulation;
}
.pod-toggle .play-icon { width: 22px; height: 22px; }
.pod-toggle .i-pause { display: none; }
body[data-pod="playing"] .pod-toggle .i-play,
body[data-pod="loading"] .pod-toggle .i-play { display: none; }
body[data-pod="playing"] .pod-toggle .i-pause,
body[data-pod="loading"] .pod-toggle .i-pause { display: inline; }
.pod-seek { grid-area: seek; width: 100%; --fill: 0%; }
.pod-controls > .pod-time,
.pod-actions { grid-area: meta; }
.pod-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.pod-actions { justify-self: end; display: flex; gap: 8px; }
.pod-actions .sleep[data-on="true"] { border-color: var(--primary); color: var(--primary); }
/* Which show is listed (pills, when there are several), and by whom */
.pod-shows { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; margin: 4px 0 24px; }
.pod-shows[hidden] { display: none; }
.pod-tile button {
  display: flex; flex-direction: column; width: 100%; padding: 0; margin: 0;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.pod-tile-art {
  display: grid; place-items: center; aspect-ratio: 1; overflow: hidden;
  background: var(--surface); border: 1px solid var(--edge);
  color: var(--muted); font-size: 2.5rem; font-weight: 700;
  transition: transform 160ms ease-out;
}
.pod-tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pod-tile button:active .pod-tile-art { transform: scale(0.97); }
.pod-tile button:focus-visible { outline: none; }
.pod-tile button:focus-visible .pod-tile-art { outline: 2px solid var(--primary); outline-offset: 3px; }
.pod-tile-by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-tile-title {
  margin-top: 10px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pod-tile-by { margin-top: 2px; color: var(--muted); font-size: 0.875rem; min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { .pod-tile-art { transition: none; } }

.pod-show-head { margin: 0 0 18px; }
.pod-to-shows { margin: 0 0 16px; }
.pod-show-id { display: flex; align-items: center; gap: 16px; }
.pod-show-art { flex: none; width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--edge); background: var(--surface); }
.pod-show-title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.pod-show-head .pod-credit { margin: 0; }
.pod-credit { margin: 0 0 14px; color: var(--muted); font-size: 0.8125rem; line-height: 1.45; }
.pod-credit a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.pod-item { grid-template-columns: 48px minmax(0, 1fr) auto; align-items: start; }
.pod-item.no-art { grid-template-columns: minmax(0, 1fr) auto; }
/* Show titles are long and carry their date: two lines, not one cut */
.pod-item .song {
  white-space: normal;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-wrap: balance;
}
.pod-item .by { margin-top: 5px; }
.pod-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pod-side { align-self: center; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
/* Share: the icon alone, a check once the link is copied */
.pod-share { flex: none; justify-content: center; width: 44px; margin: 0; padding: 0; }
.pod-share .i-done { display: none; }
.pod-share[data-done] { border-color: var(--primary); color: var(--primary); }
.pod-share[data-done] .i-share { display: none; }
.pod-share[data-done] .i-done { display: inline; }
/* The episode a shared link opened on */
.pod-item.is-shared .song { color: var(--primary); }
.sig-play { margin: 14px 0 0; }
.pod-error { margin: 10px 0 0; }

/* A podcast episode holds the bar: its play/pause, and DIRECT to go back
   to the live. The bar's icons follow the episode, not the live */
.mini-live { display: none; align-self: center; margin-right: 10px; min-height: 36px; }
body[data-episode] .mini { grid-template-columns: minmax(0, 1fr) auto var(--mini-h); }
body[data-episode] .mini-live:not([hidden]) { display: inline-flex; align-items: center; }
body[data-episode] .mini .play-icon path { display: none; }
body[data-episode] .mini .play-icon .i-play { display: inline; }
body[data-episode][data-pod="playing"] .mini .play-icon .i-play,
body[data-episode][data-pod="loading"] .mini .play-icon .i-play { display: none; }
body[data-episode][data-pod="playing"] .mini .play-icon .i-pause,
body[data-episode][data-pod="loading"] .mini .play-icon .i-pause { display: inline; }
.play-icon .i-pause { display: none; }
