/* The fonts (Anton for the painted lines, Barlow for reading), 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: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-400-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: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/anton-400-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: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/barlow-400-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: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/barlow-400-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: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/barlow-700-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: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/barlow-700-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 {
  --primary: #8CBCDB;            /* Yaguana sky blue: live and selected state */
  --bg-color: #072136;
  --panel: #0A2E4B;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #F5F8FB;
  --muted: #C9DDEB;              /* mist */
  --dim: #A9C3D6;                
  --error: #fca5a5;
  --text-soft: #D8E8F2;
  --surface: #0C3C60;            /* behind a cover while it loads */
  --edge: rgba(255, 255, 255, 0.1); /* the hairline round covers and boxes */
  --hover: rgba(255, 255, 255, 0.04);
  --selected: rgba(255, 255, 255, 0.06);
  /* The grounds (solid paint since the LRN world; the names stay from the glass era) */
  --glass: #072136;           /* the app column, the top bar */
  --glass-panel: #0A2E4B;     /* Log and Signal beside Now (computer) */
  --glass-side: #0A2E4B;     /* the sidebar (computer) */
  --glass-raised: #0C3C60; /* the mini player, a shade above the tabs */
  --glass-bar: #072136;      /* the tab bar */
  --ink: #072136;               /* text on the sky blue */
  --sign: #F2B630;               /* sign-painter yellow: the EN DIRECT stamp only */
  --board: #0C3C60;              /* a painted board */
  --board-deep: #0A2E4B;         /* a board at rest in the grid */
  --keyline: #8CBCDB;            /* the painted border round a board */
  --paint: 'Anton', 'Barlow', sans-serif;
  --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: 'Barlow', 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: 'Barlow', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 0.8125rem;
}

[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; }








/* ------------------------------------------------------------ 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);
  }
}

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

.brand {
  margin: 0;
  font-family: var(--paint);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.01em;
  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);
}



/* ------------------------------------------------------------ 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(0, 0, 0, 0.7);
}
.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-group { padding: 18px 4px 6px; color: var(--dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.stations-list li.station-group, .stations-list li.station-group + li { border-top: none; }

.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-family: var(--paint);
  font-weight: 400;
  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-family: var(--paint);
  font-weight: 400;
  font-size: 2rem;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.screen-sub {
  margin: 0 0 20px;
  color: var(--dim);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------ 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(100%, calc(100dvh - 420px));
  min-width: 132px;
  flex: none;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--edge);
  overflow: hidden;
  container-type: inline-size;   /* the facts label fits itself to the cover */
}



.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 {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 7px 11px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--edge);
  color: var(--text-soft);
  max-width: calc(100% - 20px);
}
.cover-facts > span { white-space: nowrap; }
.cover-facts b { font-weight: 700; color: var(--primary); }
.cover-facts > span:not([hidden]) ~ span { padding-left: 12px; border-left: 1px solid var(--edge); }
/* A small cover (a 320px phone, a short laptop) or large text: Year and Format one
   above the other, without the divider, instead of running off the edge */
@container (max-width: 15rem) {   /* 240px at normal text size */
  .cover-facts { flex-direction: column; gap: 4px; }
  .cover-facts > span:not([hidden]) ~ span { padding-left: 0; border-left: 0; }
}

/* The song's text on the left, Share beside it. The text is one block,
   so the taller column of buttons doesn't open a gap under the title */
.meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  margin-top: 20px;
}
.meta-text { min-width: 0; }
.meta .meta-actions {
  align-self: start;
  margin-top: -2px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  position: relative;
  min-height: 36px;
  padding: 0 12px 0 10px;
  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-family: var(--paint);
  font-weight: 400;
  font-size: 1.875rem;
  line-height: 0.95;
  letter-spacing: 0.01em;
  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;

}

@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(--keyline);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  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-family: var(--paint);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 0.95;
  letter-spacing: 0.01em;
  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: 36px;
  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: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lyrics[open] summary::after { transform: rotate(45deg); }
.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-family: var(--paint);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

}
.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: 'Barlow', system-ui, sans-serif; font-variant-numeric: tabular-nums;
  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.875rem;
  text-transform: uppercase;
  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 { padding: 14px 0; }
.log-item.is-live .n { color: var(--primary); }
.log-item.is-live img { width: 48px; height: 48px; outline: 2px solid var(--primary); outline-offset: 2px; }
.log-item.is-live .song { font-family: var(--paint); font-weight: 400; font-size: 1.125rem; letter-spacing: 0.01em; text-transform: uppercase; }
.log-item.is-live .at { color: var(--primary); }

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

/* 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-family: var(--paint); font-weight: 400; text-transform: uppercase; }
.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-family: var(--paint);
  font-weight: 400;
  font-size: 4.5rem;
  line-height: 0.9;
  letter-spacing: 0.01em;
  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: 'Barlow', system-ui, sans-serif; font-variant-numeric: tabular-nums;
  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: 'Barlow', system-ui, sans-serif; font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

/* ------------------------------------------------------------ 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 */
  border-top: 1px solid var(--line);
  background: var(--glass-raised);
}
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-family: var(--paint);
  font-weight: 400;
  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: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-play {
  display: grid;
  place-items: center;
  border: 0;
  background: var(--keyline);
  color: var(--ink);
  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: 220px minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr) 88px;
    max-width: 1440px;
    background: var(--glass);
  }

  .topbar {
    grid-column: 1;
    grid-row: 1;
    padding: 0 24px;
    border-right: 1px solid var(--line);
    background: var(--glass-side);
  }
  /* The listener count sits at the foot of the sidebar */
  .topbar .live {
    position: absolute;
    left: 24px;
    bottom: calc(88px + 24px);
    z-index: 2;
  }

  /* 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: calc(88px + 24px + 36px);
    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(var(--topbar-h) + 16px);
    left: 12px;
    width: 196px;
    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); }
  .tab::before {
    top: 12px;
    bottom: 12px;
    left: 0;
    right: auto;
    width: 2px;
    height: auto;
    transform: scaleY(0);
  }
  .tab[aria-selected="true"]::before { transform: scaleY(1); }

  .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; }

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

  /* The player bar: the cover's colour, full width */
  body[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(--keyline);
    color: var(--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(0, 0, 0, 0.2); }
  .mini-title { font-size: 1.25rem; }
  .mini-artist { color: inherit; }
  .mini-play {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--keyline);
  }
  .mini-play .play-icon { width: 26px; height: 26px; }
  .mini-play:focus-visible,
  .mini-open:focus-visible { outline-color: var(--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; }
  .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; }
}

/* Replay: past shows, each with its play button; the one loaded is
   marked like the live song in the log */
.pod-player { margin: 0 0 22px; }
.pod-now {
  margin: 0 0 10px;
  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: #072136;
  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); }
.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-play { align-self: center; }
.pod-error { margin: 10px 0 0; }

/* A Replay 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; }

/* Another radio (stations.json): no song of its own to like or find */
body[data-external] #like, body[data-external] #find { display: none; }

/* ------------------------------------------------------------ Pannò Pent
   The LRN world: every station a hand-painted board, like Léogâne's
   roadside signs. Navy ground, boards with a painted sky keyline (an
   outer line and a fine inner one), Anton capitals for what's painted,
   Barlow for what's read. Flat paint: no glass, no glow, no blur. The
   one moving moment is the repaint when the song changes. */

#app { background: var(--bg-color); }
@media (min-width: 600px) {
  #app { border-color: var(--board); }
}

.topbar {
  background: var(--bg-color);
  border-bottom: 2px solid var(--board);
}
.brand {
  font-family: var(--paint);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* EN DIRECT is a painted stamp, set at a slant like a hand-hung sign */
.live {
  padding: 5px 9px;
  border-radius: 3px;
  background: var(--sign);
  color: var(--ink);
  transform: rotate(-2deg);
}
.live-dot { background: var(--ink); }

.station-btn {
  border: 2px solid var(--board);
  border-radius: 6px;
  color: var(--text);
}
body[data-station] .station-btn { border-color: var(--keyline); color: var(--keyline); }
/* The station's name is the board's title now: let it take the bar's room */
.topbar .station-btn { flex: 0 1 auto; max-width: none; margin-right: 12px; }

/* ---- the board: what's on */
.board {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 3px solid var(--keyline);
  border-radius: 10px;
  background: var(--board);
}
.board::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.5px solid color-mix(in srgb, var(--keyline) 45%, transparent);
  border-radius: 6px;
  pointer-events: none;
}
.board .cover {
  width: 104px;
  min-width: 0;
  margin: 0;
  border: 2px solid var(--text);
  border-radius: 6px;
}
.board .cover-facts { display: none; }
.board .meta {
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr);
}
.board .meta .meta-actions {
  flex-direction: row;
  flex-wrap: wrap;
  margin-top: 12px;
}
.title {
  font-size: 2.5rem;
  line-height: 0.95;
}
@media (max-width: 380px) {
  .title { font-size: 2.125rem; }
}
.artist {
  margin-top: 6px;
  font-weight: 700;
  font-size: 1.125rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}
.share {
  border: 2px solid color-mix(in srgb, var(--keyline) 55%, transparent);
  border-radius: 6px;
}
.like[aria-pressed="true"] { border-color: var(--keyline); color: var(--keyline); }

/* The repaint: the song's painted line wipes in from the left, once */
.board.repaint .title,
.board.repaint .artist {
  animation: repaint 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.board.repaint .artist { animation-delay: 120ms; }
@keyframes repaint {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* ---- the ÉCOUTER key: sky paint, the word in Anton */
.play-wrap { margin-top: 16px; }
.play-btn {
  height: 64px;
  border-radius: 10px;
  background: var(--keyline);
  color: var(--ink);
}
.play-word {
  font-size: 1.875rem;
  line-height: 1;
}
.play-status { color: color-mix(in srgb, var(--ink) 80%, transparent); }
body[data-state="error"] .play-btn { background: var(--error); }

.block-label {
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--keyline);
}

/* ---- every station as a board, two to a row */
.now-stations { margin-top: 26px; }
.now-stations .block-label { margin: 0 2px 10px; }
.board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.board-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  min-height: 112px;
  padding: 10px 12px;
  border: 2px solid var(--board);
  border-radius: 8px;
  background: var(--board-deep);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.board-cell img {
  flex: none;
  width: 36px;
  height: 36px;
  margin-bottom: auto;
  border-radius: 5px;
  object-fit: contain;   /* a transparent logo sits on the board's paint */
}
.board-name {
  font-family: var(--paint);
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.board-by {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-cell[aria-current="true"] { border-color: var(--keyline); background: var(--board); }
.board-cell[aria-current="true"] .board-by { color: var(--keyline); }
.board-cell:disabled { cursor: default; }
@media (hover: hover) {
  .board-cell:not(:disabled):hover { border-color: color-mix(in srgb, var(--keyline) 60%, transparent); }
}

/* States stamp themselves: off air is a painted stamp, not a grey-out */
.stamp {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 6px;
  border: 2px solid currentColor;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-6deg);
}
.stamp-off { color: var(--error); }

/* ---- the stations dialog and the tab bar, in the same paint */
.stations {
  border: 3px solid var(--keyline);
  border-radius: 10px;
  background: var(--board);
}
.stations::backdrop { background: rgba(7, 33, 54, 0.85); }
.station-item img { border-radius: 6px; }
.station-item .song { font-size: 1.125rem; letter-spacing: 0.01em; }

.tabbar { background: var(--bg-color); border-top: 2px solid var(--board); }

/* Browser surfaces in the world's paint */
.screen { scrollbar-color: var(--board) transparent; }
.screen::-webkit-scrollbar-thumb { background: var(--board); }
input[type="range"] { accent-color: var(--keyline); }

@media (prefers-reduced-motion: reduce) {
  .board.repaint .title,
  .board.repaint .artist { animation: none; }
}

/* The computer's play bar: a painted board, not the cover's colour */
@media (min-width: 1024px) {
  body[data-tab] .mini {
    background: var(--board);
    color: var(--text);
    border-top: 3px solid var(--keyline);
  }
  .mini-open img { border-color: var(--text); }
  .mini-play { background: var(--keyline); color: var(--ink); }
  .mini-play:focus-visible,
  .mini-open:focus-visible { outline-color: var(--keyline); }
}

/* Stamps and tab labels keep the painted capitals */
.live, .stamp, .tab .mono, .block-label { text-transform: uppercase; letter-spacing: 0.08em; }

@media (min-width: 1024px) {
  /* The selected tab: a painted board, not a stripe down its side */
  .tab::before { display: none; }
  .tab { border: 2px solid transparent; border-radius: 6px; }
  .tab[aria-selected="true"] { background: var(--board); border-color: var(--keyline); }
  /* The bar's play is a painted key too */
  .mini-play { border-radius: 8px; }
}
/* The mini player's key in the same sky paint, not the cover's colour */
.mini-play { background: var(--keyline); color: var(--ink); }

/* LRN's own boards carry a painted radio mark where partners show a logo */
.board-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin-bottom: auto;
  border-radius: 5px;
  background: var(--keyline);
  color: var(--ink);
}
.board-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* Section headings that open (Toute la journée, Paroles, Commentaires)
   in the same painted capitals as the other section labels */
.lyrics summary { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }

/* Room above the capitals for È, Ò, Â: the clamped title clips what
   rises past its line box */
.title { line-height: 1.02; padding-top: 0.08em; }

/* Calmer sizes: Anton reads larger than its size, so the song leads at
   30px on a phone, the play word follows, the boards stay quieter */
.title { font-size: 1.875rem; }
@media (max-width: 380px) { .title { font-size: 1.75rem; } }
@media (min-width: 1024px) { .title { font-size: 2.25rem; } }
.play-word { font-size: 1.5rem; }
.board-name { font-size: 1.0625rem; }
.brand { font-size: 1.5rem; }

/* ---- the footer: LRN's name, tagline, contact and social links */
.lrn-footer {
  margin-top: 32px;
  padding: 20px 2px 8px;
  border-top: 2px solid var(--board);
}
.lrn-footer-brand {
  margin: 0;
  font-family: var(--paint);
  font-size: 1.125rem;
  line-height: 1.1;
  text-transform: uppercase;
}
.lrn-footer-brand span { color: var(--keyline); }
.lrn-footer-tag { margin: 4px 0 0; color: var(--muted); font-size: 0.9375rem; }
.lrn-footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.lrn-footer-links a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 2px solid var(--board);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease;
}
.lrn-footer-name { font-weight: 700; }
.lrn-footer-text { color: var(--muted); font-size: 0.9375rem; overflow-wrap: break-word; }
@media (hover: hover) {
  .lrn-footer-links a:hover { border-color: var(--keyline); }
}

/* Join the network: the footer's one painted call, sky keyline like the live board */
.join-network {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 3px solid var(--keyline);
  border-radius: 10px;
  background: var(--board);
  color: var(--text);
  text-decoration: none;
  transition: background-color 160ms ease;
}
.join-title {
  font-family: var(--paint);
  font-size: 1.375rem;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--keyline);
}
.join-text { color: var(--muted); font-weight: 700; }
@media (hover: hover) {
  .join-network:hover { background: var(--board-deep); }
}

/* The language switch: two painted keys, the one in use lit */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.lang-label {
  margin-right: 4px;
  color: var(--keyline);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--board);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.lang-btn[aria-pressed="true"] { border-color: var(--keyline); background: var(--board); color: var(--keyline); }
@media (hover: hover) {
  .lang-btn:not([aria-pressed="true"]):hover { border-color: color-mix(in srgb, var(--keyline) 60%, transparent); }
}

/* Phones have volume keys: the slider only on a computer */
@media (max-width: 1023px) {
  .volume label[for="volume"], .volume #volume { display: none; }
  .volume { justify-content: flex-end; }
}
.saver-block { display: inline-flex; }
.saver-block[hidden] { display: none; }
.volume .sleep { margin-top: 0; margin-bottom: 0; }
.saver-block { align-items: center; }

/* ---- favourites: a painted star on every board and list row */
.board-li, .station-row { position: relative; }
.star-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--keyline) 55%, transparent);
  cursor: pointer;
  touch-action: manipulation;
}
.star-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
}
.star-btn[aria-pressed="true"] { color: var(--keyline); }
.star-btn[aria-pressed="true"] svg { fill: currentColor; }
@media (hover: hover) {
  .star-btn:hover { color: var(--keyline); }
  .star-btn[aria-pressed="true"]:hover { color: var(--text); }
}
.board-li .star-btn { top: 2px; right: 2px; }
.station-row .star-btn { top: 50%; right: -6px; transform: translateY(-50%); }
.station-row .station-item { padding-right: 40px; }
/* The off-air stamp makes room for the star */
.board-cell .stamp { right: 46px; }

/* "Toutes les stations (20)": opens the full list */
.now-all {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 2px solid var(--keyline);
  border-radius: 8px;
  background: transparent;
  color: var(--keyline);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) {
  .now-all:hover { background: var(--board); }
}

/* The search box in the full list */
.stations-search {
  width: 100%;
  margin: 8px 0 4px;
}

/* Seek: ◀ ▶ beside the ÉCOUTER key, painted keys of the same height */
.play-wrap { display: flex; gap: 8px; }
.play-wrap .play-btn { flex: 1; min-width: 0; }
.seek-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 64px;
  padding: 0;
  border: 2px solid var(--keyline);
  border-radius: 10px;
  background: var(--board);
  color: var(--keyline);
  cursor: pointer;
  touch-action: manipulation;
}
.seek-btn[hidden] { display: none; }
.seek-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.seek-btn:active { transform: scale(0.96); }
@media (hover: hover) {
  .seek-btn:hover { background: var(--board-deep); }
}

/* No signal: the board's corner gets a painted warning, sign yellow */
.board-stamp {
  z-index: 1;
  margin: 0;
  padding: 5px 9px;
  border: 0;
  background: var(--sign);
  color: var(--ink);
  font-size: 0.75rem;
  transform: rotate(-4deg);
}


@media (min-width: 1024px) {
  /* Now is always on screen here, PLAY with it: the bar only comes
     back when a Replay episode holds it */
  body:not([data-episode]) #app { grid-template-rows: var(--topbar-h) minmax(0, 1fr) 0; }
  body:not([data-episode])[data-tab] .mini { display: none; }
  /* The sidebar's tabs pick the panel beside the player: say so */
  .tabbar::before {
    content: attr(data-beside);
    padding: 0 14px 6px;
    color: var(--dim);
    font-family: 'Barlow', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

/* Another radio's line on the board, under the artist */
.station-desc { margin: 6px 0 0; color: var(--text-soft); font-size: 0.9375rem; line-height: 1.35; }

/* A tap on a station card scrolls back up to the board: a little room above it */
#now-board { scroll-margin-top: 16px; }
/* The station after the Log's title, in the sky paint */
.log-station { color: var(--primary); }

/* A station's contact links on the board: icons only on a phone, so
   Share, E-mail and Website fit one line (each keeps its name in
   aria-label, and a 44px tap); named again where there's room */
.board .contact-link { justify-content: center; min-width: 40px; padding: 0 10px; }
.board .contact-link span { display: none; }
@media (min-width: 600px) {
  .board .contact-link { padding: 0 12px 0 10px; }
  .board .contact-link span { display: inline; }
}
