/* Keep playback controls on screen; only the surah list scrolls. */
.recitation-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.recitation-page .header { padding-block: 12px; }
.recitation-page main {
  min-height: 0;
  margin-block: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding-block: 16px;
}
.recitation-page .intro { padding: 0; }
.recitation-page .intro h1 {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.4;
  margin: 0;
}
.recitation-page .intro .eyebrow { margin-bottom: 4px; }
.recitation-page .panel { padding: 16px 20px; margin: 0; }
.recitation-page .panel .eyebrow { margin-bottom: 2px; }
.recitation-page #now-playing { font-size: 24px; line-height: 1.5; margin: 0; }
.recitation-page audio { height: 44px; margin: 10px 0; }
.recitation-page button.toggle { min-height: 40px; padding: 6px 12px; }
.recitation-page .status { margin-top: 6px; line-height: 1.5; }
.recitation-page .playlist {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.recitation-page .section-title { flex-shrink: 0; }
.recitation-page .section-title h2 { margin: 0; font-size: 18px; }
.search-label {
  display: block;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 6px;
}
.surah-search {
  flex-shrink: 0;
  font: inherit;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid #a0b099;
  border-radius: 6px;
}
.surah-search:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.search-result { flex-shrink: 0; font-size: 12px; color: var(--muted); margin: 6px 0; }
.search-result:empty { margin: 5px 0; }
.recitation-page .tracks {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #8b9e8d #eef0e7;
  align-content: start;
  padding: 5px;
  gap: 10px;
}
.recitation-page .track { font-size: 17px; min-height: 62px; padding: 12px; }
.recitation-page footer {
  margin-block: 0;
  padding-block: 8px;
  flex-direction: row;
  justify-content: space-between;
  font-size: 11px;
}
[hidden] { display: none !important; }

/* Wide screens give the player its own column beside the scrolling list. */
@media (min-width: 900px), (min-width: 650px) and (max-height: 600px) {
  .recitation-page main {
    grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 24px;
  }
  .recitation-page .intro { grid-column: 1 / -1; }
  .recitation-page .panel { align-self: start; }
  .recitation-page .playlist { grid-column: 2; grid-row: 2; }
}

@media (max-width: 650px) {
  .recitation-page .header { gap: 6px; padding-block: 8px; }
  .recitation-page .brand { font-size: 23px; line-height: 1.3; }
  .recitation-page .brand small { font-size: 9px; }
  .recitation-page nav { gap: 7px 12px; }
  .recitation-page nav a { font-size: 11px; }
  .recitation-page main { padding-block: 10px; gap: 10px; }
  .recitation-page .panel { padding: 12px; }
  .recitation-page .track { font-size: 16px; min-height: 58px; }
  .surah-search { font-size: 16px; }
}

/* Leave room for the list on short screens, including a phone keyboard. */
@media (max-height: 700px) {
  .recitation-page .header { padding-block: 6px; gap: 5px; }
  .recitation-page .brand small,
  .recitation-page .intro .eyebrow { display: none; }
  .recitation-page main { padding-block: 8px; gap: 8px; }
  .recitation-page .intro h1 { font-size: 20px; }
  .recitation-page .panel { padding: 10px 12px; }
  .recitation-page .panel .eyebrow { display: none; }
  .recitation-page #now-playing { font-size: 21px; }
  .recitation-page audio { margin-block: 6px; }
  .recitation-page footer { padding-block: 4px; }
}
@media (max-width: 649px) and (max-height: 500px) {
  .recitation-page .header { flex-direction: row; gap: 12px; }
  .recitation-page .brand { font-size: 19px; }
  .recitation-page nav { gap: 2px 9px; justify-content: flex-start; }
  .recitation-page main { gap: 6px; padding-block: 6px; }
  .recitation-page .intro h1 { font-size: 17px; }
  .recitation-page .panel { padding: 8px 10px; }
  .recitation-page #now-playing { font-size: 18px; }
  .recitation-page audio { height: 36px; margin-block: 4px; }
  .recitation-page button.toggle { min-height: 32px; padding-block: 3px; font-size: 12px; }
  .recitation-page .search-label { margin-block: 2px; font-size: 11px; }
  .recitation-page .surah-search { min-height: 36px; padding-block: 4px; }
  .recitation-page footer { display: none; }
}
