/* La recherche vient après la bibliothèque afin de privilégier la reprise de lecture. */
.search-section {
  border-top: 1px solid var(--line);
  padding-top: 39px;
}

.search-section .search-box {
  margin: 0 0 22px;
}

.search-section .empty-state {
  min-height: 140px;
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 70px;
    -webkit-tap-highlight-color: transparent;
  }

  body { padding-bottom: env(safe-area-inset-bottom); }

  .page-shell { width: calc(100% - 24px); }

  .hero {
    min-height: 76px;
    padding-top: 18px;
  }

  /* Sur téléphone, la bibliothèque est la priorité : pas de grand bandeau. */
  .hero-copy { display: none; }

  .brand {
    font-size: 20px;
    gap: 7px;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    font-size: 14px;
  }

  .user-menu {
    right: 9px;
    top: 9px;
  }

  .user-menu #logout-button {
    min-height: 42px;
    padding: 0 11px;
    font-size: 11px !important;
  }

  .content-section,
  .friends-panel { padding: 28px 0 42px; }

  .library-section,
  .suggestions-section,
  .search-section { padding-top: 28px; }

  .library-section {
    border-top: 0;
    padding-top: 8px;
  }

  .section-heading {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }

  .section-heading h2 { font-size: 22px; }

  .cards-grid { gap: 14px 10px; }

  .library-section .show-card,
  .suggestions-section .show-card {
    min-width: 0;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 10px;
    background: #17181c;
  }

  .poster-wrap { border-radius: 7px; }

  .card-info { padding: 8px 2px 2px; }

  .show-meta,
  .genres { font-size: 10px; }

  .action-button,
  .remove-button {
    min-height: 40px;
    margin-top: 9px;
  }

  .watch-tabs {
    gap: 8px;
    margin: 0 -2px 16px;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .watch-tabs button {
    min-height: 42px;
    padding: 0 13px;
    font-size: 12px;
    scroll-snap-align: start;
  }

  .search-section .search-box {
    height: 56px;
    margin-bottom: 17px;
    padding-left: 13px;
    border-radius: 9px;
  }

  .search-section .search-box input {
    padding: 0 8px;
    font-size: 13px;
  }

  .search-section .search-box button {
    width: auto;
    min-width: 112px;
    padding: 0 12px;
    font-size: 12px;
  }

  .search-section .search-box button span { font-size: 14px; }

  .search-section .empty-state {
    min-height: 118px;
    padding: 20px 14px;
  }

  .empty-state p,
  .empty-library p { font-size: 13px; }

  .empty-library {
    padding: 24px 16px;
    border-radius: 10px;
  }

  .progress-dialog {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .dialog-header,
  .dialog-show,
  .season-tabs,
  .episode-list { padding-left: 16px; padding-right: 16px; }

  .episode-row { min-height: 56px; }

  .dialog-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }

  .dialog-footer button { min-height: 44px; }

  .friends-panel { padding-bottom: 56px; }

  .friend-search input,
  .friend-search button { min-height: 42px; }

  .friend-row { padding: 10px; }

  .friend-row button { min-height: 34px; }
}

@media (max-width: 380px) {
  .hero { min-height: 70px; }
  .search-section .search-box button {
    min-width: 46px;
    padding: 0;
    font-size: 0;
  }
  .search-section .search-box button span { font-size: 18px; }
}
