/* Shared anchors also prevent mobile reaction badges escaping into the hero. */
.featured-song-row { position: relative; }
.kc-mobile-tabs, .kc-mobile-player-toggle, .kc-mobile-action-label,
.kc-mobile-menu-tools, [data-mobile-player-reaction] { display: none; }

@media (max-width: 780px) {
  :root { --kc-mobile-nav-height: calc(58px + env(safe-area-inset-bottom, 0px)); --kc-mobile-player-height: 66px; }
  html { scroll-padding-bottom: calc(var(--kc-mobile-nav-height) + var(--kc-mobile-player-height) + 20px); }
  .kc-mobile-ready { padding-bottom: calc(var(--kc-mobile-nav-height) + var(--kc-mobile-player-height)); }
  .kc-mobile-ready .header, .kc-mobile-ready.page-shell .header { min-height: 76px; height: auto; padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); gap: 10px; }
  .kc-mobile-ready .header .brand { width: 76px; }
  .kc-mobile-ready .header .brand img { width: 52px; height: 52px; max-width: 52px; }
  .kc-mobile-ready .header .brand span { font-size: 10px; letter-spacing: .7px; }
  body.kc-mobile-ready .header .header-actions { display: grid !important; grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-rows: auto; gap: 6px !important; flex: 1; min-width: 0; max-width: 330px; }
  body.kc-mobile-ready .header .header-actions > .quiet-button { display: none !important; }
  body.kc-mobile-ready .header .header-actions .kcf-count { grid-column: 1; grid-row: 1; justify-self: center; min-width: 0; max-width: 100%; font-size: 12px; gap: 5px; }
  .kc-mobile-ready .kcf-count svg { width: 18px; flex: 0 0 18px; }
  .kc-mobile-ready .kcf-count [data-kcf-count-value] { overflow-wrap: anywhere; }
  body.kc-mobile-ready .header .header-actions .language-control { grid-column: 2; grid-row: 1; }
  .kc-mobile-ready .header .language-control select { min-height: 44px; max-width: 74px; padding: 8px; font-size: 16px; }
  body.kc-mobile-ready .header .header-actions .menu-button { grid-column: 3; grid-row: 1; width: 44px; height: 44px; }

  /* A contained stage image, followed by real document flow in EN and FR. */
  .hero[data-hero-motion]:has(.hero-purpose) { display: grid; grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; max-height: none; overflow: hidden; background: var(--bg); }
  .hero[data-hero-motion] > .hero-slides { position: relative; inset: auto; grid-area: 1 / 1; width: 100%; height: clamp(230px, 64vw, 380px); z-index: 0; }
  .hero[data-hero-motion] > .hero-atmosphere, .hero[data-hero-motion] > .hero-shade,
  .hero[data-hero-motion]::after { position: relative; inset: auto; grid-area: 1 / 1; align-self: stretch; z-index: 1; pointer-events: none; }
  .hero[data-hero-motion] > .hero-shade { background: linear-gradient(0deg, var(--bg), transparent 32%); }
  .hero[data-hero-motion] .hero-slide .hero-photo { object-position: 62% 38%; opacity: 1; }
  .hero[data-hero-motion] .hero-slide .hero-photo-crowd { object-position: 58% 42%; }
  .hero[data-hero-motion] > .hero-controls { position: relative; inset: auto; grid-area: 1 / 1; align-self: end; justify-self: center; transform: none; margin: 0 0 14px; background: #07121b70; }
  .hero[data-hero-motion] .hero-copy.hero-purpose { position: relative; inset: auto; width: auto; max-width: none; margin: 0; padding: 16px 20px 24px; text-shadow: none; }
  :root[lang=fr] .hero[data-hero-motion] .hero-copy.hero-purpose { width: auto; }
  .hero[data-hero-motion] .hero-purpose .eyebrow { font-size: 10px; letter-spacing: .09em; line-height: 1.7; }
  .hero[data-hero-motion] .hero-purpose h1 { font-size: clamp(38px, 11vw, 66px); line-height: 1.02; margin: 14px 0 16px; text-shadow: none; }
  .hero[data-hero-motion] .hero-purpose > p { font-size: 15px; line-height: 1.65; max-width: 640px; color: var(--muted); }
  .hero[data-hero-motion] .hero-purpose .hero-buttons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 20px; }
  .hero[data-hero-motion] .hero-buttons > a { min-height: 48px; width: 100%; display: flex; justify-content: center; align-items: center; text-align: center; font-size: 14px; padding: 12px 14px; white-space: normal; }
  .hero[data-hero-motion] .hero-buttons > .text-link { border: 1px solid var(--line); border-radius: 5px; text-decoration: none; }
  .hero[data-hero-motion] .hero-release { position: relative; inset: auto; width: auto; max-width: none; min-width: 0; margin: 0 20px; padding: 12px; gap: 14px; background: var(--surface); border-color: var(--line); }
  .hero[data-hero-motion] .hero-release img { width: 58px; height: 58px; flex: 0 0 58px; }
  .hero[data-hero-motion] .hero-release strong { font-size: 21px; line-height: 1.3; }
  .hero[data-hero-motion] .hero-release .eyebrow { font-size: 11px; letter-spacing: .1em; }
  .hero[data-hero-motion] .hero-release div > span:last-child { color: var(--muted); font-size: 12px; }
  .hero[data-hero-motion] .hero-bottom { position: relative; inset: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 18px 20px 22px; text-align: left; font-size: 9px; letter-spacing: .06em; color: var(--muted); }
  .hero[data-hero-motion] .hero-bottom > span { display: block; max-width: 100%; }

  .kc-mobile-ready .kc-mobile-tabs { position: fixed; inset: auto 0 0; z-index: 76; min-height: var(--kc-mobile-nav-height); padding: 3px max(8px, env(safe-area-inset-right)) max(3px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--bg); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kc-mobile-tabs > a, .kc-mobile-tabs > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; min-width: 0; padding: 4px 2px; font-size: 11px; line-height: 1.2; color: var(--muted); border-radius: 8px; }
  .kc-mobile-tabs svg { width: 21px; height: 21px; }
  .kc-mobile-tabs > [aria-current=page], .kc-mobile-tabs > [aria-expanded=true] { color: var(--accent); background: var(--surface); }
  .kc-mobile-tabs > :focus-visible { outline-offset: -3px; }

  /* The same audio/transport nodes stay mounted during navigation. */
  .kc-mobile-ready .bottom-player { bottom: var(--kc-mobile-nav-height); display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; grid-template-rows: auto; gap: 8px; align-items: center; height: auto; min-height: 66px; padding: 9px max(12px, env(safe-area-inset-right)) 9px max(12px, env(safe-area-inset-left)); z-index: 75; max-height: calc(100dvh - var(--kc-menu-top, 76px) - var(--kc-mobile-nav-height) - 12px); overflow-y: auto; overscroll-behavior: contain; }
  .kc-mobile-ready .bottom-player .bottom-track { grid-column: 1; grid-row: 1; width: auto; min-width: 0; gap: 9px; }
  .kc-mobile-ready .bottom-player .bottom-track img { width: 40px; height: 40px; flex: 0 0 40px; }
  .kc-mobile-ready .bottom-player .bottom-track strong { max-width: none; font-size: 13px; }
  .kc-mobile-ready .bottom-player .bottom-track span { font-size: 9px; letter-spacing: .04em; }
  .kc-mobile-ready .bottom-player:not(.kc-player-expanded) [data-current-video] { display: none; }
  .kc-mobile-ready .bottom-player .bottom-controls { display: contents; }
  .kc-mobile-ready .bottom-player .bottom-controls > :not([data-play]),
  .kc-mobile-ready .bottom-player .bottom-right { display: none; }
  .kc-mobile-ready .bottom-player .bottom-controls > [data-play] { grid-column: 2; grid-row: 1; width: 44px; height: 44px; }
  .kc-mobile-ready .bottom-player .kc-mobile-player-toggle { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 44px; min-height: 44px; padding: 2px; color: var(--muted); font-size: 10px; }
  .kc-mobile-player-toggle svg { width: 20px; height: 20px; }
  .kc-mobile-ready .bottom-player.kc-player-expanded { grid-template-columns: minmax(0, 1fr) 44px; gap: 12px; padding-top: 12px; }
  .kc-mobile-ready .kc-player-expanded .kc-mobile-player-toggle { grid-column: 2; }
  .kc-player-expanded .kc-mobile-player-toggle svg { transform: rotate(180deg); }
  .kc-mobile-ready .kc-player-expanded .bottom-controls { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; max-width: none; }
  .kc-mobile-ready .kc-player-expanded .bottom-controls > :not([data-play]) { display: inline-flex; min-width: 44px; height: 44px; }
  .kc-mobile-ready .kc-player-expanded .bottom-controls > .seek-wrap { position: static; display: flex; flex: 0 0 100%; width: 100%; height: 44px; padding: 0; gap: 12px; }
  .kc-mobile-ready .kc-player-expanded .seek-wrap input { min-height: 24px; }
  .kc-mobile-ready .kc-player-expanded .seek-wrap > span:not(.sr-only) { display: inline; font-size: 12px; }
  .kc-mobile-ready .kc-player-expanded .bottom-right { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; border-top: 1px solid var(--line); padding-top: 10px; }
  .kc-mobile-ready .kc-player-expanded .bottom-right > button { display: inline-flex; min-width: 44px; width: auto; height: 44px; gap: 7px; padding: 8px 12px; border-radius: 24px; border: 1px solid var(--line); }
  .kc-mobile-ready .kc-player-expanded .kc-mobile-action-label { display: inline; font-size: 12px; }
  .kc-mobile-ready .kc-player-expanded [data-mobile-player-reaction] { display: block; }
  .kc-mobile-ready .kc-player-expanded [data-mobile-player-reaction] .kc-song-like { min-height: 44px; }
  .kc-mobile-ready .kc-player-expanded [data-current-video] button { min-height: 44px; }

  .kc-mobile-ready .mobile-nav { padding: 12px 20px 20px; max-height: calc(100dvh - var(--kc-menu-top, 76px) - var(--kc-mobile-nav-height) - var(--kc-mobile-player-height)); }
  .kc-mobile-ready .mobile-nav a { min-height: 44px; padding: 12px 4px; font-size: 16px; }
  .kc-mobile-ready .kc-mobile-menu-tools { display: block; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
  .kc-mobile-look { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 12px; width: 100%; text-align: left; border-radius: 8px; background: var(--surface2); font-size: 14px; }
  .kc-mobile-menu-tools summary { padding: 16px 0; cursor: pointer; min-height: 48px; font-size: 14px; }
  .kc-mobile-menu-tools ol { padding-left: 22px; margin: 0; color: var(--muted); font-size: 14px; }
  .kc-mobile-menu-tools li { margin: 0 0 12px; padding-left: 3px; }
  .kc-mobile-ready .look-toggle { display: none; }
  .kc-mobile-ready .look-panel { left: 12px; right: 12px; width: auto; max-width: none; bottom: calc(var(--kc-mobile-nav-height) + var(--kc-mobile-player-height) + 8px); max-height: calc(100dvh - var(--kc-mobile-nav-height) - var(--kc-mobile-player-height) - 28px); z-index: 80; overflow-y: auto; }
  .kc-mobile-ready .toast { bottom: calc(var(--kc-mobile-nav-height) + var(--kc-mobile-player-height) + 12px); }
  .kc-mobile-ready .kc-nav-status { top: calc(var(--kc-menu-top, 76px) + 10px); bottom: auto; }
  body.kc-mobile-ready footer { padding-bottom: 40px; }
  .kc-mobile-ready input:not([type=range]):not([type=checkbox]):not([type=radio]),
  .kc-mobile-ready select, .kc-mobile-ready textarea { font-size: 16px; }
  .kc-mobile-ready dialog { max-height: calc(100dvh - 24px); overscroll-behavior: contain; }

  /* Keep each song's counts, reaction and Play button together. */
  .featured-song-row, #featured-tracks .featured-song-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 12px; padding: 16px; min-height: 0; }
  .featured-song-row .featured-song-main { grid-column: 1 / -1; padding: 0; }
  .featured-song-row > .kc-reaction { position: static; grid-column: 1; grid-row: 2; min-width: 0; align-self: center; }
  .featured-song-row > .kc-reaction small { position: static; font-size: 11px; }
  .featured-song-row > .kc-song-like { grid-column: 1; grid-row: 2; justify-self: start; }
  .featured-song-row .featured-row-play { grid-column: 2; grid-row: 2; width: 44px; height: 44px; }
  .playlist-track-state { max-width: 74px; }
  .playlist-row-tools > button { min-height: 44px; }
}

@media (min-width: 520px) and (max-width: 780px) {
  .hero[data-hero-motion] .hero-purpose .hero-buttons { grid-template-columns: 1fr 1fr; }
  .hero[data-hero-motion] .hero-copy.hero-purpose { padding-inline: 28px; }
  .hero[data-hero-motion] .hero-release { margin-inline: 28px; }
}

/* Keep the complete selection side by side, with stacked details on phones. */
@media (max-width: 780px) {
  .selection-page .featured-track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .selection-page .featured-song-row { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto auto; align-items: start; gap: 10px; padding: 12px; }
  .selection-page .featured-song-main { grid-template-columns: minmax(0, 1fr); grid-column: 1; grid-row: 1; gap: 12px; width: 100%; }
  .selection-page .featured-song-main img { grid-column: 1; grid-row: 1; width: 100%; height: auto; aspect-ratio: 1; }
  .selection-page .featured-song-copy { grid-column: 1; grid-row: 2; gap: 5px; }
  .selection-page .featured-song-copy > strong { font-size: clamp(21px, 5vw, 28px); line-height: 1.15; }
  .selection-page .featured-song-copy > small { font-size: 11px; overflow-wrap: anywhere; }
  .selection-page .featured-row-period, .selection-page .featured-row-total { grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; min-width: 0; }
  .selection-page .featured-row-period { grid-row: 3; }
  .selection-page .featured-row-total { grid-row: 4; }
  .selection-page .featured-row-period > strong, .selection-page .featured-row-total > strong { font-size: 18px; }
  .selection-page .featured-row-period small, .selection-page .featured-row-total small { font-size: 11px; }
  .selection-page .featured-row-total small + small { flex-basis: 100%; max-width: none; font-size: 10px; }
  .selection-page .featured-song-row > .kc-reaction, .selection-page .featured-song-row > .kc-song-like { grid-column: 1; grid-row: 2; justify-self: stretch; width: 100%; }
  .selection-page .kc-song-like { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 5px; width: 100%; min-height: 44px; padding: 8px 4px; font-size: 11px; }
  .selection-page .featured-song-row .featured-row-play { grid-column: 1; grid-row: 3; justify-self: end; }
}
