/* Shared phone layout. Kept last so each route follows the same spacing. */
@media (max-width: 680px) {
  :root { --page-pad: 18px; --nav-height: 64px; }
  html { scroll-padding-top: 80px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  input, select, textarea, .mobile-search input { font-size: 16px; }
  button, a, input, select { -webkit-tap-highlight-color: transparent; }
  .sidebar { padding-inline: 18px; }
  .sidebar .brand { font-size: 29px; }
  .mobile-menu-toggle { width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }
  .mobile-bottom-nav { height: calc(68px + env(safe-area-inset-bottom)); box-shadow: none; }
  .mobile-bottom-nav a { font-size: 11px; gap: 5px; color: #a0a0aa; }
  .mobile-bottom-nav svg { width: 22px; height: 22px; }
  .mobile-bottom-nav b { font-size: 9px; }
  .mobile-bottom-nav b:empty, .mobile-bottom-nav b[data-count="0"] { display: none; }
  .mobile-drawer { width: min(92vw, 390px); padding-inline: 22px; gap: 20px; }
  .mobile-drawer nav a { padding-block: 14px; }
  .mobile-drawer nav a small { font-size: 12px; color: #aaa; }
  .mobile-search { min-height: 50px; }

  .home-route .hero { --hero-stage-height: clamp(520px, 72svh, 640px); margin-bottom: 20px; }
  .home-route .hero > .hero-art { background-position: 60% top; background-size: cover; transform: none; }
  .home-route .hero > .hero-shade { background: linear-gradient(180deg, #08080842 0%, transparent 28%, #14141499 52%, #141414f2 82%, #141414 100%); }
  .home-route .hero > .hero-content { top: auto; bottom: auto; inset-inline: 18px; width: auto; transform: none; margin: 0; top: var(--hero-stage-height); translate: 0 calc(-100% - 34px); }
  .hero .eyebrow { font-size: 10px; letter-spacing: .18em; margin-bottom: 14px; }
  .hero h1 { font-size: clamp(34px, 10vw, 46px); line-height: 1.06; letter-spacing: -.035em; max-width: 100%; margin-bottom: 13px; }
  .hero .meta { font-size: 12px; line-height: 1.5; gap: 7px 10px; }
  .hero #hero-description { font-size: 14px; line-height: 1.55; margin-top: 12px; -webkit-line-clamp: 2; }
  .hero .actions { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 10px; margin-top: 19px; }
  .hero .actions .primary, .hero .actions .secondary { width: 100%; min-width: 0; min-height: 48px; padding: 10px 9px; border-radius: 8px; font-size: 12px; line-height: 1.35; gap: 6px; }
  .hero .actions .secondary { background: #ffffff24; border: 1px solid #ffffff30; backdrop-filter: blur(8px); }
  .home-route .hero > .hero-switch { top: 82px; right: 18px; height: auto; padding: 0 4px; gap: 0; border-radius: 12px; }
  .hero .hero-arrow { width: 44px; height: 44px; min-height: 44px; opacity: 1; }
  .hero-dots { gap: 0; }
  .hero-dots button, .hero-dots button.active { position: relative; width: 22px; height: 44px; border-radius: 0; background: transparent; }
  .hero-dots button::after { content: ""; position: absolute; width: 5px; height: 5px; top: 19px; left: 9px; border-radius: 5px; background: #ffffff60; }
  .hero-dots button.active::after { width: 15px; left: 4px; background: #fff; }
  .hero-trending { padding: 0 18px 8px; }
  .hero-trending .section-heading h2, .home-route .section-heading h2, .collection h2 { font-size: 22px; line-height: 1.2; letter-spacing: -.5px; }
  .section-heading { gap: 12px; align-items: center; }
  .section-heading a { flex-shrink: 0; font-size: 12px; padding-block: 12px; }
  .home-route .grid, .home-route .row-grid { gap: 12px; }
  .home-route .grid .card, .home-route .row-grid .card { flex-basis: min(76vw, 310px); }
  .home-route .card .poster { border-radius: 10px; }
  .home-route .row-grid, .home-route .grid { padding-bottom: 14px; }
  .home-route .collection { margin-bottom: 28px; }
  .card h3 { font-size: 13px; line-height: 1.4; }
  .card .save-button { min-width: 36px; min-height: 36px; }
  .home-route .hero-trending .trending-rank { font-size: 68px; -webkit-text-stroke-width: 1.5px; }

  .browse-only #browse, .genres-route #browse, .saved-route #browse { padding-top: calc(var(--nav-height) + 24px); }
  .browse-only .library > .section-heading { gap: 16px; margin-bottom: 20px; }
  .browse-only .section-heading h2, .genres-route .section-heading h2, .saved-route .section-heading h2 { font-size: 32px; letter-spacing: -1px; }
  #catalog-intro { font-size: 13px; line-height: 1.6; }
  .library-tools { width: 100%; min-width: 0; }
  .library-tools select { min-height: 44px; max-width: 100%; border-radius: 10px; font-size: 14px; }
  .catalog-search-panel { gap: 8px; padding: 6px 6px 6px 12px; min-height: 52px; border-radius: 12px; }
  .catalog-search-panel input { font-size: 16px; }
  .catalog-search-panel button { min-height: 40px; padding-inline: 14px; font-size: 13px; }
  .filter-chips { gap: 8px; margin-bottom: 24px; padding-bottom: 8px; }
  .browse-only .filter-chips .chip { min-height: 40px; font-size: 13px; padding: 10px 15px; border-radius: 999px; }
  .browse-only .filter-chips { scrollbar-width: none; }
  .browse-only .filter-chips::-webkit-scrollbar { display: none; }
  .movies-route .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .movie-poster-card .poster { border-radius: 10px; }
  .movie-poster-card h3 { font-size: 13px; line-height: 1.4; }
  .genre-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .genre-tile { min-height: 142px; padding: 15px; border-radius: 12px; }
  .genre-tile strong { font-size: 16px; line-height: 1.3; overflow-wrap: normal; }
  .pagination { flex-wrap: wrap; gap: 7px; margin-top: 28px; }
  .pagination button, .pagination a { min-width: 40px; min-height: 44px; }
  .saved-empty { padding: 45px 6px; }

  .watch-route .watch-inner { padding: calc(var(--nav-height) + 22px) 18px 30px; }
  .watch-titlebar, .series-experience .watch-titlebar { flex-direction: column; gap: 18px; padding-bottom: 20px; margin-bottom: 20px; }
  .watch-titlebar h1, .series-experience .watch-titlebar h1 { font-size: 32px; line-height: 1.12; letter-spacing: -1px; overflow-wrap: anywhere; }
  .watch-titlebar .meta { font-size: 12px; gap: 7px 10px; line-height: 1.6; }
  .watch-admin-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .watch-admin-actions button { min-height: 44px; border-radius: 8px; }
  .player-shell, .series-experience > .player-shell { border-radius: 12px; box-shadow: none; }
  .player-cover, .series-experience .player-cover { gap: 10px; }
  .player-cover > span { width: 52px; height: 52px; border-width: 1.5px; }
  .player-cover > span .ui-icon { width: 21px; height: 21px; }
  .player-cover strong, .series-experience .player-cover strong { font-size: 15px; }
  .player-cover small, .series-experience .player-cover small { font-size: 11px; }
  .player-watermark { top: 10px; left: 10px; padding: 5px 7px; }
  .player-watermark span { font-size: 12px; }
  .player-watermark small { font-size: 6px; }
  .player-bar, .series-experience .player-bar { padding: 12px; gap: 10px; }
  .source-picker { width: 100%; flex-direction: column; align-items: stretch; gap: 9px; }
  .source-label { font-size: 10px; color: #a0a0aa; }
  .player-tabs, .series-experience .player-tabs { display: flex; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 3px; }
  .player-tab, .series-experience .player-tab { flex: 0 0 auto; min-width: 86px; height: 44px; align-items: center; border-radius: 8px; padding-inline: 12px; }
  .player-actions { width: 100%; justify-content: flex-end; }
  .player-tool { height: 44px; border-radius: 8px; font-size: 12px; }
  .playback-note { font-size: 12px; line-height: 1.6; }
  .watch-progress-controls { padding: 16px; border-radius: 12px; gap: 12px; }
  .watch-progress-controls > div { flex-basis: 100%; }
  .watch-progress-controls label { flex: 1; min-width: 0; }
  .watch-progress-controls input { width: 100%; min-height: 44px; }
  .watch-progress-controls button { min-height: 44px; padding-inline: 15px; font-size: 12px; border-radius: 8px; }
  .series-now-playing { gap: 12px; align-items: center; }
  .series-episode-navigation button { min-width: 44px; min-height: 44px; }
  .series-episodes { margin-top: 30px; padding-top: 24px; }
  .series-episodes-heading { align-items: flex-start; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
  .series-episodes-heading h2 { font-size: 26px; }
  .series-season-label select { min-height: 44px; font-size: 16px; }
  .series-episode-grid { gap: 10px; }
  .series-episode-open { grid-template-columns: 22px 96px minmax(0, 1fr); padding: 12px; gap: 10px; min-height: 108px; }
  .series-episode-title { font-size: 14px; }
  .series-episode-description { font-size: 12px; line-height: 1.45; -webkit-line-clamp: 2; }
  .series-episode-meta { font-size: 11px; line-height: 1.4; }
  .watch-info { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 28px; }
  .watch-info .info-poster { display: none; }
  .watch-details h2 { font-size: 22px; }
  .watch-details p { font-size: 14px; line-height: 1.65; }
  .watch-details .genre-links { flex-wrap: wrap; }
  .watch-details .chip { min-height: 36px; font-size: 12px; }
  .cast-grid { gap: 12px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 16px; }
  .auth-inner, .episode-dialog-inner { padding: 34px 20px 24px; }
  dialog .close { min-width: 44px; min-height: 44px; top: 10px; right: 10px; }
  dialog .two-col { grid-template-columns: 1fr; }
  dialog input, dialog select { min-height: 48px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); max-width: calc(100vw - 36px); }
}
@media (max-width: 370px) {
  :root { --page-pad: 14px; }
  .home-route .hero > .hero-content { inset-inline: 14px; }
  .hero h1 { font-size: 34px; }
  .hero .actions { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
  .hero .actions .primary, .hero .actions .secondary { font-size: 11px; }
  .watch-route .watch-inner { padding-inline: 14px; }
  .series-episode-open { grid-template-columns: 18px 80px minmax(0, 1fr); gap: 8px; padding: 10px; }
}
@media (max-width: 680px) and (orientation: landscape) {
  .home-route .hero { --hero-stage-height: 500px; }
}

