/* Video library homepage (video.prosica.de/): small-screen fixes, added by the server (src/library.js) to the
   library's page; the page file itself stays as delivered (the offline copy is unchanged).
   Short screens (phones held sideways, small phones, up to 600 px high): while a video plays the header steps
   aside ("Back to library" stays under the video) and the video frame is never taller than the screen. */
@media (max-height: 600px) {
  body.watching > header { display: none !important; }
  body.watching .screen {
    width: min(100%, calc((100dvh - 24px) * 16 / 9)) !important;
    max-height: calc(100dvh - 24px) !important;
    margin-left: auto !important; margin-right: auto !important;
  }
  body.watching main { padding-top: 12px !important; }
}

/* Phones (up to 700 px wide): a compact header - menu, name and interface language on one row, search below,
   the presentation-language chips in one short scrolling row. Was ~300 px tall on a 390 px phone. */
@media (max-width: 440px) {
  /* the "P" logo already says Prosica: keep just "Video Library" so the name is never cut off */
  html body header .brand h1 { font-size: 0 !important; }
  html body header .brand h1 b { font-size: 17px; }
}
@media (max-width: 700px) {
  header .hd { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
    gap: 8px 10px !important; padding: 8px 12px !important; }
  header .menu { grid-column: 1; grid-row: 1; padding: 6px 9px !important; font-size: 18px; line-height: 1; }
  header .brand { grid-column: 2; grid-row: 1; gap: 8px !important; min-width: 0; }
  header .brand .logo { width: 32px !important; height: 32px !important; border-radius: 9px !important; font-size: 17px !important; flex: none; }
  header .brand > div { min-width: 0; }
  header .brand h1 { font-size: 17px !important; overflow: hidden; text-overflow: ellipsis; }
  header .uisel { grid-column: 3; grid-row: 1; max-width: 104px; font-size: 12px !important; padding: 5px 24px 5px 9px !important;
    background-position: right 7px center !important; background-size: 12px !important; }
  header .search { grid-column: 1 / -1; grid-row: 2; margin: 0 !important; }
  header .search input { padding: 7px 12px 7px 34px !important; font-size: 14px !important; }
  header .search svg { left: 12px !important; width: 15px !important; height: 15px !important; }
  header .strip { padding: 6px 12px !important; gap: 6px !important; }
  header .strip > span { display: none !important; }
  header .strip .chip { font-size: 12px !important; padding: 2px 9px 2px 3px !important; }
  header .strip .chip.all { padding: 2px 10px !important; }
  html { scroll-padding-top: 130px !important; }
}
@media (max-width: 350px) {
  html body header .brand h1 b { font-size: 14px; }
  header .uisel { max-width: 92px; }
}
