    :root {
      --bg: #141414; --card-bg: #181818; --brand-red: #e50914; --brand-red-hover: #b80710;
      --text: #ffffff; --text-muted: #b3b3b3; --border: #333333; --star: #f59e0b;
      /* Wspólny promień przycisków akcji (modal odtwarzacza, arkusze pomocy) - jedno miejsce,
         z którego biorą go wszystkie przyciski, żeby rząd akcji był spójny. */
      --control-radius: 4px;
    }

    /* ===== Paski przewijania (cienkie, dopasowane do ciemnego UI) =====
       scrollbar-width/scrollbar-color są dziedziczone, więc samo ustawienie ich na <html>
       obejmuje całą stronę, sidebar i modal. Warianty ::-webkit-* obsługują Chrome/Edge/Safari. */
    html { scrollbar-width: thin; scrollbar-color: #4a4a4a transparent; }
    ::-webkit-scrollbar { width: 12px; height: 12px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
      background: #4a4a4a; border: 4px solid transparent; background-clip: padding-box; border-radius: 999px;
    }
    ::-webkit-scrollbar-thumb:hover { background: #6e6e6e; border: 4px solid transparent; background-clip: padding-box; }
    ::-webkit-scrollbar-thumb:active { background: var(--brand-red); border: 4px solid transparent; background-clip: padding-box; }
    ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
    ::-webkit-scrollbar-corner { background: transparent; }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { background: var(--bg); color: var(--text); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; overflow-x: hidden; padding-bottom: calc(80px + var(--cookie-bar-h, 0px)); }
    /* Tło nie przewija się pod przyciemnionym modalem (klasę zakłada app.js). */
    body.modal-open { overflow: hidden; }

    header {
      position: sticky; top: 0; left: 0; right: 0; height: 70px; padding: 0 4%;
      display: flex; justify-content: space-between; align-items: center;
     background: #141414;  z-index: 100; transition: background 0.3s ease;
    }
    header.scrolled { background: #141414; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
    .header-left { display: flex; align-items: center; gap: 20px; }
    .menu-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: bold; transition: opacity 0.2s; }
    .menu-btn:hover { opacity: 0.8; }
    .brand { font-size: 1.8rem; font-weight: 900; color: var(--brand-red); letter-spacing: 1px; text-decoration: none; transition: transform 0.2s; display: inline-flex; align-items: center; }
    .brand:hover { transform: scale(1.05); }
    .brand-logo { height: 50px; width: auto; display: block; }
    .header-right { display: flex; align-items: center; gap: 16px; }
    .search-box { display: flex; align-items: center; gap: 8px; }
    .search-box input {
      background: rgba(0,0,0,0.75); border: 1px solid rgba(255,255,255,0.4); color: #fff; padding: 8px 14px; border-radius: 4px; outline: none; width: 200px; font-size: 0.9rem; transition: all 0.3s ease;
    }
    /* Licznik filmów obok wyszukiwarki - aktualizowany na bieżąco przez app.js (updateMovieCount). */
    .search-count {
      flex: 0 0 auto; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .search-count[hidden] { display: none; }
    /* Przycisk zamykający nakładkę wyszukiwania na telefonie - poza tym progiem nie istnieje. */
    .search-close { display: none; }
    .search-box input:focus { width: 260px; border-color: #fff; background: rgba(0,0,0,0.9); box-shadow: 0 0 10px rgba(255,255,255,0.2); }
    .profile-btn { display: flex; align-items: center; gap: 8px; background: #222; border: 1px solid #444; padding: 4px 10px; border-radius: 4px; color: #fff; text-decoration: none; font-size: 0.85rem; font-weight: bold; cursor: pointer; transition: background 0.2s; }
    .profile-btn:hover { background: #333; }
    .profile-btn img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; background: #e50914; }

    .profile-modal {
      position: fixed; inset: 0; background: #141414; z-index: 3000; display: none;
      align-items: center; justify-content: center; flex-direction: column; padding: 20px;
      animation: fadeInModal 0.3s ease-out;
    }
    .profile-modal.open { display: flex; }
    @keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }
    .profile-modal h1 { font-size: 3rem; font-weight: 500; margin-bottom: 40px; color: #fff; text-align: center; }
    .profile-modal-hint { color: #808080; font-size: 0.9rem; margin: -25px 0 35px; text-align: center; }
    .profiles-grid { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
    
    .profile-tile-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
    .profile-tile { text-align: center; cursor: pointer; text-decoration: none; color: #808080; width: 140px; transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
    .profile-tile img { width: 130px; height: 130px; border-radius: 6px; border: 3px solid transparent; transition: border-color 0.25s, transform 0.25s; margin-bottom: 10px; object-fit: cover; background: #333; }
    .profile-tile:hover { color: #fff; transform: scale(1.08); }
    .profile-tile:hover img { border-color: #fff; box-shadow: 0 10px 25px rgba(255,255,255,0.2); }
    .profile-tile div { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .delete-profile-btn {
      position: absolute; top: 0; right: 5px; background: rgba(229,9,20,0.9); color: #fff; border: none;
      width: 28px; height: 28px; border-radius: 50%; font-size: 1rem; cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 5;
      transition: background 0.2s, transform 0.2s;
    }
    .delete-profile-btn:hover { background: #ff1f2b; transform: scale(1.1); }
    .profile-tile-wrap:hover .delete-profile-btn { display: flex; }

    .add-profile-box {
      width: 130px; height: 130px; border-radius: 6px; border: 3px dashed #444; display: flex;
      align-items: center; justify-content: center; font-size: 3rem; color: #444; background: transparent; cursor: pointer; transition: all 0.25s; margin-bottom: 10px;
    }
    .profile-tile:hover .add-profile-box { border-color: #fff; color: #fff; background: rgba(255,255,255,0.05); }

    .add-form-container {
      background: #1f1f1f; padding: 30px; border-radius: 8px; border: 1px solid #333; width: 100%; max-width: 400px; display: none; text-align: center;
      animation: scaleUp 0.3s ease-out;
    }
    .add-form-container.open { display: block; }
    @keyframes scaleUp { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
    .add-form-container input {
      width: 100%; padding: 12px; background: #333; border: 1px solid #444; color: #fff; border-radius: 4px; font-size: 1rem; margin-bottom: 15px; outline: none; transition: border-color 0.2s;
    }
    .add-form-container input:focus { border-color: #e50914; }
    .btn-save { background: var(--brand-red); color: #fff; border: none; padding: 10px 24px; font-weight: bold; border-radius: 4px; cursor: pointer; transition: background 0.2s; }
    .btn-save:hover { background: var(--brand-red-hover); }
    .btn-cancel { background: transparent; color: #aaa; border: 1px solid #444; padding: 10px 20px; font-weight: bold; border-radius: 4px; cursor: pointer; margin-left: 10px; transition: all 0.2s; }
    .btn-cancel:hover { color: #fff; border-color: #fff; }

    /* Panel schowany po własnej szerokości (translateX(-100%)), a nie po stałej wartości left.
       W warstwie mobilnej szerokość zmienia się (86vw / max 330px) - przy sztywnej wartości
       left fragment panelu zostawałby widoczny na brzegu ekranu. */
    .sidebar { position: fixed; top: 0; left: 0; width: 300px; height: 100vh; background: #1f1f1f; z-index: 200; box-shadow: 5px 0 25px rgba(0,0,0,0.8); transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.1, 0.9, 0.2, 1); display: flex; flex-direction: column; padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
    .sidebar-title { font-size: 1.2rem; font-weight: bold; color: #fff; }
    .sidebar-close { background: none; border: none; color: #fff; font-size: 1.8rem; cursor: pointer; transition: transform 0.2s; }
    .sidebar-close:hover { transform: rotate(90deg); }
    .sidebar-item { padding: 12px 16px; color: var(--text-muted); text-decoration: none; border-radius: 6px; margin-bottom: 6px; cursor: pointer; font-weight: 600; transition: all 0.2s; }
    .sidebar-item:hover, .sidebar-item.active { background: var(--brand-red); color: #fff; padding-left: 20px; }
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 150; display: none; backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.3s; }
    .sidebar-overlay.open { display: block; opacity: 1; }

    /* Sekcja "Kanały" w panelu bocznym - obok listy kategorii. */
    .sidebar-section-title {
      margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--border);
      font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px;
      color: var(--text-muted); font-weight: 700;
    }
    .sidebar-channel-item {
      display: flex; align-items: center; gap: 10px; padding: 8px 12px;
      border-radius: 6px; margin-bottom: 6px; cursor: pointer; color: var(--text-muted);
      font-weight: 600; transition: all 0.2s;
    }
    .sidebar-channel-item:hover { background: var(--brand-red); color: #fff; padding-left: 16px; }
    .sidebar-channel-avatar {
      width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
      background: var(--brand-red); flex: 0 0 auto;
    }
    .sidebar-channel-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sidebar-channel-count { font-size: 0.75rem; opacity: 0.7; flex: 0 0 auto; }

    #heroBanner {
      position: relative; height: 80vh; min-height: 550px;
      background-size: cover; background-position: center center;
      display: flex; align-items: center; padding: 0 4%; margin-bottom: 30px;
      transition: background-image 0.8s ease-in-out;
    }
    /* Hero odsłania app.js dopiero po wstawieniu prawdziwych danych (brak widocznej atrapy).
       !important jest konieczne, bo JS steruje widocznością przez inline style.display. */
    #heroBanner[hidden] { display: none !important; }
    #heroBanner::after {
      content: ''; position: absolute; inset: 0;
      background: linear-gradient(77deg, rgba(20,20,20,0.95) 0%, rgba(20,20,20,0.5) 50%, transparent 100%),
                  linear-gradient(to top, #141414 0%, transparent 40%);
      z-index: 1;
    }
    .hero-content { position: relative; z-index: 2; max-width: 680px; animation: slideUp 0.6s ease-out; }
    @keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    .hero-title {
      font-size: 3.5rem; font-weight: 800; margin-bottom: 14px; line-height: 1.1;
      text-shadow: 2px 2px 6px rgba(0,0,0,0.8); display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
    }
    .hero-meta { display: flex; align-items: center; gap: 12px; font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
    .rating-badge { color: var(--star); }
    .hero-desc {
      font-size: 1.15rem; line-height: 1.5; color: #e5e5e5; margin-bottom: 24px;
      display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
      text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
    }
    .hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
    .btn-play {
      background: #fff; color: #000; border: none; padding: 12px 32px;
      font-size: 1.15rem; font-weight: 700; border-radius: 4px; cursor: pointer;
      display: flex; align-items: center; gap: 8px; transition: all 0.2s;
    }
    .btn-play:hover { background: rgba(255,255,255,0.85); transform: scale(1.03); }
    .btn-yt {
      background: rgba(109,109,110,0.7); color: #fff; border: none; padding: 12px 24px;
      font-size: 1.15rem; font-weight: 700; border-radius: 4px; cursor: pointer;
      display: flex; align-items: center; gap: 8px; text-decoration: none; backdrop-filter: blur(4px); transition: background 0.2s;
    }
    .btn-yt:hover { background: rgba(109,109,110,0.5); }

    .slider-dots {
      position: absolute; bottom: 30px; right: 4%; z-index: 3; display: flex; gap: 8px;
    }
    .slider-dot {
      width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.3s;
    }
    .slider-dot.active { background: var(--brand-red); width: 28px; border-radius: 6px; }

    .modal {
      position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92); display: none;
      align-items: center; justify-content: center; z-index: 1000; padding: 20px; backdrop-filter: blur(10px);
      animation: fadeInModal 0.25s ease-out;
    }
    .modal.open { display: flex; }
    .modal-box {
      background: #181818; width: 100%; max-width: 1000px; border-radius: 10px;
      overflow-y: auto; overflow-x: hidden; max-height: 92vh;
      scrollbar-width: thin; scrollbar-color: #3a3a3a transparent;
      scrollbar-gutter: stable; overscroll-behavior: contain;
      box-shadow: 0 25px 60px rgba(0,0,0,0.9); border: 1px solid #333;
      display: flex; flex-direction: column; position: relative; animation: scaleUp 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    }
    /* W modalu pasek jest odrobinę ciemniejszy - tło to #181818, nie #141414. */
    .modal-box::-webkit-scrollbar { width: 12px; }
    .modal-box::-webkit-scrollbar-thumb { background: #3a3a3a; }
    .modal-box::-webkit-scrollbar-thumb:hover { background: #5a5a5a; }
    .modal-box::-webkit-scrollbar-thumb:active { background: var(--brand-red); }
    .video-container { position: relative; padding-bottom: 56.25%; height: 0; background: #000; flex: 0 0 auto; }
    #ytPlayerDiv { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
    .modal-head {
      display: flex; justify-content: flex-end; align-items: center;
      padding: 8px 12px; background: #181818; border-bottom: 1px solid var(--border);
      position: sticky; top: 0; z-index: 3; flex: 0 0 auto;
    }
    .modal-foot { padding: 30px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; background: #181818; flex: 0 0 auto; }
    .close-btn {
      background: #232323; border: 2px solid #fff;
      color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
      display: flex; align-items: center; justify-content: center; transition: all 0.2s;
    }
    .close-btn:hover { background: var(--brand-red); border-color: var(--brand-red); transform: rotate(90deg); }
    .modal-title-row { font-size: 1.8rem; font-weight: bold; color: #fff; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
    .modal-channel-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
    .modal-channel {
      display: inline-flex; align-items: center; gap: 10px; margin-bottom: 0;
      padding: 5px 14px 5px 5px; background: #232323; border: 1px solid var(--border);
      border-radius: 999px; text-decoration: none; color: var(--text);
      transition: background 0.2s, border-color 0.2s, transform 0.2s;
    }
    .modal-channel:hover { background: #2e2e2e; border-color: var(--brand-red); transform: translateY(-1px); }
    .modal-channel .channel-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--brand-red); flex: 0 0 auto; }
    .modal-channel .channel-text { display: flex; flex-direction: column; line-height: 1.2; }
    .modal-channel .channel-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
    .modal-channel .channel-name { font-size: 0.9rem; font-weight: 700; color: #fff; }
    .modal-channel .channel-ext { color: var(--text-muted); transition: color 0.2s; }
    .modal-channel:hover .channel-ext { color: var(--brand-red); }
    .remove-request-btn {
      display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px;
      background: transparent; border: 1px solid var(--border); border-radius: 999px;
      color: var(--text-muted); text-decoration: none; font-size: 0.8rem; font-weight: 600;
      transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    }
    .remove-request-btn:hover { background: #232323; border-color: var(--brand-red); color: #fff; transform: translateY(-1px); }
    .modal-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 15px; }
    /* Długie opisy są domyślnie zwijane do kilku linii; przycisk (patrz app.js) rozwija całość. */
    .modal-desc.is-clamped {
      display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
      margin-bottom: 8px;
    }
    .desc-toggle {
      background: none; border: none; color: var(--brand-red); font-weight: 700;
      font-size: 0.9rem; cursor: pointer; padding: 0; margin: 0 0 15px;
      display: inline-flex; align-items: center; gap: 4px; transition: color 0.2s;
    }
    .desc-toggle:hover { color: var(--brand-red-hover); text-decoration: underline; }
    .desc-toggle[hidden] { display: none; }
    .yt-link-btn {
      background: var(--brand-red); color: #fff; text-decoration: none; padding: 10px 20px;
      border-radius: var(--control-radius); font-size: 0.9rem; font-weight: bold; display: inline-block; transition: background 0.2s;
    }
    .yt-link-btn:hover { background: var(--brand-red-hover); }
    /* Rząd akcji w modalu filmu: główne CTA (YouTube), ocena filmu, udostępnianie linku oraz
       pomoc odtwarzacza („Brak napisów?” / „Wyślij na telewizor”). Wszystkie przyciski tego
       rzędu biorą promień z --control-radius, żeby nie mieszały się kształty. */
    .modal-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .share-btn, .subs-help-btn, .cast-btn {
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      background: #232323; border: 1px solid var(--border); color: #fff;
      padding: 10px 18px; border-radius: var(--control-radius); font-family: inherit; font-size: 0.9rem; font-weight: 700;
      cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    }
    .share-btn:hover, .subs-help-btn:hover, .cast-btn:hover { background: #2e2e2e; border-color: var(--brand-red); transform: translateY(-1px); }
    .share-btn:active, .subs-help-btn:active, .cast-btn:active { transform: translateY(0); }
    .share-btn:focus-visible, .subs-help-btn:focus-visible, .cast-btn:focus-visible { outline: 2px solid var(--brand-red); outline-offset: 2px; }
    .subs-help-btn svg, .cast-btn svg { flex: 0 0 auto; }

    /* Oceny filmu (łapka w górę / w dół) w modalu odtwarzacza. Przyciski są ikonowe: obok łapki
       widać sam licznik, a pełną nazwę („Podoba mi się” / „Nie podoba mi się”) niosą aria-label
       i title, do których app.js dopisuje liczbę głosów. Klik w podświetloną łapkę cofa głos,
       klik w przeciwną go zmienia (patrz app.js). Promień jak w pozostałych przyciskach rzędu
       akcji (--control-radius), a wysokość wyrównana z sąsiadami (min-height). */
    .vote-actions { display: inline-flex; align-items: center; gap: 8px; }
    .vote-btn {
      display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
      background: #232323; border: 1px solid var(--border); color: #fff;
      padding: 9px 12px; border-radius: var(--control-radius); font-family: inherit; font-size: 0.9rem;
      font-weight: 700; cursor: pointer;
      transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    }
    .vote-btn svg { flex: 0 0 auto; }
    .vote-btn:hover { background: #2e2e2e; border-color: var(--brand-red); }
    .vote-btn:active { transform: translateY(1px); }
    .vote-btn:focus-visible { outline: 2px solid var(--brand-red); outline-offset: 2px; }
    .vote-btn:disabled { opacity: 0.6; cursor: default; }
    /* Podświetlenie własnego głosu: łapka w górę na czerwono, łapka w dół na szaro. */
    .vote-btn.is-active { background: rgba(229, 9, 20, 0.18); border-color: var(--brand-red); color: #fff; }
    #voteDownBtn.is-active { background: rgba(255, 255, 255, 0.12); border-color: #6b6b6b; }
    .vote-count {
      min-width: 1.4em; text-align: center; padding: 0 6px;
      background: rgba(255, 255, 255, 0.08); border-radius: 999px;
      font-size: 0.8rem; font-variant-numeric: tabular-nums;
    }

    .progress-bar-container { width: 100%; height: 4px; background: #333; border-radius: 2px; overflow: hidden; margin-top: 6px; }
    .progress-bar-fill { height: 100%; background: var(--brand-red); width: 0%; transition: width 0.4s ease; }

    .category-section { padding: 0 4%; margin-bottom: 40px; }
    .category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
    .category-title { font-size: 1.4rem; font-weight: 700; color: #e5e5e5; }
    .show-all-link { color: var(--text-muted); font-size: 0.9rem; cursor: pointer; text-decoration: none; font-weight: 600; transition: color 0.2s; }
    .show-all-link:hover { color: #fff; }
    .row-container {
      position: relative; display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; padding: 10px 0 20px 0; scrollbar-width: none;
    }
    .row-container::-webkit-scrollbar { display: none; }

    .movie-card {
      flex: 0 0 220px; background: var(--card-bg); border-radius: 6px; overflow: hidden;
      cursor: pointer; display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1), box-shadow 0.3s ease; border: 1px solid var(--border);
    }
    .movie-card:hover {
      transform: translateY(-8px) scale(1.03);
      box-shadow: 0 15px 30px rgba(0,0,0,0.8);
      border-color: #666;
      z-index: 10;
    }
    .poster-wrap { width: 100%; aspect-ratio: 2 / 3; background: #000; position: relative; overflow: hidden; }
    .poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
    .movie-card:hover .poster-wrap img { transform: scale(1.05); }
    .source-badge {
      position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.8);
      font-size: 0.65rem; padding: 3px 6px; border-radius: 4px; color: #fff; backdrop-filter: blur(4px);
      max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      text-align: left; pointer-events: none;
    }
    /* Oznaczenie wersji językowej: NAPISY PL (film zagraniczny, napisy tłumaczone) / LEKTOR PL. */
    .lang-badge {
      position: absolute; top: 8px; left: 8px; font-size: 0.6rem; font-weight: 700;
      letter-spacing: 0.5px; text-transform: uppercase; padding: 3px 6px;
      border-radius: 4px; color: #fff; backdrop-filter: blur(4px); pointer-events: none;
    }
    .lang-badge.is-subs, .lang-pill.is-subs { background: rgba(59, 130, 246, 0.92); color: #fff; }
    .lang-badge.is-lektor, .lang-pill.is-lektor { background: rgba(245, 158, 11, 0.92); color: #111; }
    .lang-pill {
      display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 700;
      letter-spacing: 0.5px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
      white-space: nowrap;
    }
    .lang-pill[hidden] { display: none; }

    /* ============================================================
       Etykieta przycisku kategorii (dawniej styl inline w topbar.php).
       ============================================================ */
    .menu-btn-label { font-size: 1rem; font-weight: normal; margin-left: 4px; }

    /* ============================================================
       Przycisk instalacji aplikacji (PWA) - pokazywany przez assets/js/pwa.js
       ============================================================ */
    .install-btn {
      display: inline-flex; align-items: center; gap: 8px;
      background: var(--brand-red); color: #fff; border: none; padding: 8px 14px;
      border-radius: 4px; font-size: 0.85rem; font-weight: bold; cursor: pointer;
      white-space: nowrap; transition: background 0.2s, transform 0.2s;
    }
    .install-btn:hover { background: var(--brand-red-hover); transform: translateY(-1px); }
    .install-btn[hidden] { display: none; }
    .install-btn svg { flex: 0 0 auto; }

    /* Wygodniejsza obsługa dotykiem na urządzeniach mobilnych. */
    button, .movie-card, .sidebar-item, .sidebar-channel-item, .profile-tile { touch-action: manipulation; }
    a, button { -webkit-tap-highlight-color: transparent; }

    .card-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--card-bg); }
    .card-title { font-size: 0.9rem; font-weight: bold; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .card-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

    .full-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; padding: 0 4%; margin-bottom: 40px; }
    .back-row-btn {
      background: #232323; color: #fff; border: 1px solid var(--border); padding: 8px 16px; border-radius: 4px;
      cursor: pointer; font-weight: bold; margin-bottom: 20px; display: inline-flex; align-items: center; gap: 6px; transition: background 0.2s;
    }
    .back-row-btn:hover { background: var(--brand-red); border-color: var(--brand-red); }

    #mainContainer { padding-top: 20px; }
    .empty-msg { padding: 60px; text-align: center; color: var(--text-muted); font-size: 1.2rem; }

    /* ============================================================
       RWD - tablety (<= 1024px)
       ============================================================ */
    @media (max-width: 1024px) {
      #heroBanner { height: 68vh; min-height: 460px; }
      .hero-title { font-size: 2.6rem; }
      .brand-logo { height: 42px; }
      .search-box input { width: 170px; }
      .search-box input:focus { width: 210px; }
      .modal-box { max-height: 94vh; }
    }

    /* ============================================================
       RWD - telefony i małe tablety (<= 768px)
       ============================================================ */
    @media (max-width: 768px) {
      header {
        height: auto; min-height: 60px;
        padding: env(safe-area-inset-top) 16px 0;
      }
      .header-left { gap: 12px; }
      .menu-btn { font-size: 1.3rem; }
      .brand-logo { height: 34px; }
      .header-right { gap: 10px; flex: 1 1 auto; justify-content: flex-end; }
      .search-box { flex: 1 1 auto; min-width: 0; }
      .search-box input, .search-box input:focus { width: 100%; flex: 1 1 auto; min-width: 0; font-size: 0.85rem; padding: 7px 10px; }
      .search-count { font-size: 0.72rem; }
      #activeProfileName { display: none; }

      #heroBanner { height: auto; min-height: 58vh; padding: 72px 5% 36px; align-items: flex-end; }
      .hero-content { max-width: 100%; }
      .hero-title { font-size: 2rem; gap: 10px; }
      .hero-meta { font-size: 0.9rem; gap: 8px; flex-wrap: wrap; }
      .hero-desc { font-size: 1rem; -webkit-line-clamp: 4; }
      .btn-play, .btn-yt { font-size: 1rem; padding: 10px 22px; }
      .slider-dots { bottom: 16px; right: 5%; }

      .category-section { padding: 0 5%; margin-bottom: 28px; }
      .category-title { font-size: 1.15rem; }
      .movie-card { flex: 0 0 165px; }
      .card-title { font-size: 0.85rem; }
      .full-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 14px; padding: 0 5%; }

      .sidebar { width: 85vw; max-width: 320px; }

      .modal { padding: 0; }
      .modal-box {
        max-width: 100%; max-height: 100vh; max-height: 100dvh;
        border-radius: 0; border-left: none; border-right: none;
      }
      .modal-head { padding-top: calc(8px + env(safe-area-inset-top)); }
      .modal-foot { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); flex-direction: column; gap: 14px; }
      .modal-foot > div { width: 100%; min-width: 0; }
      .modal-title-row { font-size: 1.35rem; }
      .modal-desc { font-size: 0.95rem; }
      .yt-link-btn { width: 100%; text-align: center; }
      .modal-actions { flex-direction: column; align-items: stretch; gap: 10px; }
      .modal-actions .share-btn, .modal-actions .subs-help-btn, .modal-actions .cast-btn { width: 100%; }
      /* Łapki rozciągają się na całą szerokość - na telefonie łatwiej w nie trafić palcem.
         Skoro przycisk jest ikonowy, łapka dostaje tu większy rozmiar, żeby nie ginęła
         w szerokim polu (licznik zostaje przy niej). */
      .vote-actions { width: 100%; }
      .vote-btn { flex: 1 1 0; justify-content: center; padding: 11px 14px; }
      .vote-actions .vote-btn svg { width: 20px; height: 20px; }

      .profile-modal h1 { font-size: 1.9rem; margin-bottom: 26px; }
      .profile-modal-hint { margin: -12px 0 22px; }
      .profiles-grid { gap: 18px; }
      .profile-tile { width: 106px; }
      .profile-tile img { width: 96px; height: 96px; }
      .add-profile-box { width: 96px; height: 96px; font-size: 2.4rem; }

      body { padding-bottom: calc(60px + env(safe-area-inset-bottom) + var(--cookie-bar-h, 0px)); }
    }

    /* ============================================================
       RWD - małe telefony (<= 480px)
       ============================================================ */
    @media (max-width: 480px) {
      .menu-btn-label { display: none; }
      .brand-logo { height: 30px; }
      .install-btn { padding: 8px 10px; }
      .install-btn-label { display: none; }

      #heroBanner { min-height: 62vh; }
      .hero-title { font-size: 1.6rem; }
      .hero-desc { -webkit-line-clamp: 3; }
      .hero-buttons { flex-direction: column; align-items: stretch; gap: 10px; }
      .btn-play, .btn-yt { justify-content: center; width: 100%; }

      .movie-card { flex: 0 0 140px; }
      .full-grid { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); }
      .modal-title-row { font-size: 1.2rem; }
      .progress-bar-container { margin-top: 4px; }
    }

    /* ============================================================
       RWD - bardzo małe ekrany (<= 360px)
       ============================================================ */
    @media (max-width: 360px) {
      .brand-logo { height: 26px; }
      .movie-card { flex: 0 0 126px; }
      .full-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
    }

    /* Tryb poziomy na niskich ekranach - hero nie zajmuje całej wysokości. */
    @media (max-height: 520px) and (orientation: landscape) {
      #heroBanner { height: auto; min-height: 100vh; padding: 60px 5% 30px; }
      .hero-desc { -webkit-line-clamp: 2; }
    }

    /* ============================================================
       Nota prawna na dole modala odtwarzacza (views/partials/player_modal.php).
       ============================================================ */
    .modal-legal {
      flex: 0 0 auto; padding: 16px 30px 20px; background: #141414;
      border-top: 1px solid var(--border); color: var(--text-muted);
      font-size: 0.78rem; line-height: 1.55; text-align: center;
    }
    .modal-legal p { max-width: 860px; margin: 0 auto; }
    .modal-legal-link {
      display: inline-block; margin-top: 8px; color: var(--text-muted);
      font-weight: 700; text-decoration: underline; transition: color 0.2s;
    }
    .modal-legal-link:hover { color: #fff; }

    /* ============================================================
       Ikonka informacyjna "i" w topbarze (views/partials/topbar.php).
       ============================================================ */
    .info-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
      background: #222; border: 1px solid #444; color: #fff;
      font-weight: 700; font-style: italic; font-size: 1.05rem; line-height: 1; cursor: pointer;
      transition: background 0.2s, border-color 0.2s, transform 0.2s;
    }
    .info-btn:hover { background: #333; border-color: var(--brand-red); transform: translateY(-1px); }

    /* Ikona wsparcia (kubek kawy) - link do zbiórki, views/partials/topbar.php.
       Korzysta z bazowej klasy .info-btn (rozmiar, kolory, motywy ocean/web), więc wygląda
       identycznie jak zębatka obok; <a> potrzebuje jedynie zdjęcia podkreślenia.
       Na telefonie ikona ustępuje miejsca w nagłówku, a link czeka w modalu informacyjnym. */
    .support-btn { text-decoration: none; }
    .support-btn svg { display: block; }

    /* ============================================================
       Modal informacyjny (views/partials/info_modal.php). Korzysta z bazowych
       klas .modal / .modal-box, jedynie zwęża zawartość i formatuje treść.
       ============================================================ */
    .info-box { max-width: 640px; }
    .info-body { padding: 4px 30px 30px; }
    .info-title { font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 16px; }
    /* Ramka o wersji beta serwisu i automatycznie pobieranych danych (okładki, opisy). */
    .info-beta {
      background: rgba(229,9,20,0.08); border: 1px solid rgba(229,9,20,0.35);
      border-radius: 6px; padding: 14px 16px; margin-bottom: 18px;
    }
    .info-beta-badge {
      display: inline-block; margin-bottom: 10px; padding: 2px 8px; border-radius: 3px;
      background: var(--brand-red); color: #fff;
      font-size: 0.68rem; font-weight: 700; letter-spacing: 1px;
    }
    .info-beta .info-text:last-child { margin-bottom: 0; }
    .info-text { color: #d2d2d2; font-size: 0.95rem; line-height: 1.6; margin-bottom: 12px; }
    .info-text a { color: #fff; }
    .info-text-muted { color: var(--text-muted); font-size: 0.85rem; }
    .info-actions {
      display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
      margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
    }
    .info-legal { flex: 1 1 260px; color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; }
    .info-legal a { color: #fff; }

    /* ============================================================
       Toast - krótki komunikat zwrotny (np. "Link skopiowany do schowka").
       Element wstawia views/partials/footer.php, treść ustawia app.js. Wyświetlany nad
       modalem odtwarzacza (1000) i paskiem cookies (900), ale pod modalem profili (3000);
       unosi się nad paskiem cookies dzięki zmiennej --cookie-bar-h.
       ============================================================ */
    .toast {
      position: fixed; left: 50%; bottom: calc(24px + var(--cookie-bar-h, 0px));
      transform: translate(-50%, 12px);
      z-index: 2500; max-width: min(90vw, 420px); text-align: center;
      background: #232323; border: 1px solid var(--border); color: #fff;
      padding: 12px 20px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
      box-shadow: 0 12px 30px rgba(0,0,0,0.6);
      opacity: 0; pointer-events: none;
      transition: opacity 0.25s ease, transform 0.25s ease;
    }
    .toast.show { opacity: 1; transform: translate(-50%, 0); }
    .toast[hidden] { display: none; }

    /* ============================================================
       Pasek informacyjny o cookies / danych wysyłanych do YouTube
       (views/partials/cookie_bar.php). Przyklejony do dołu ekranu; jego wysokość
       trafia do zmiennej --cookie-bar-h (patrz reguły body { padding-bottom }),
       dzięki czemu treść i stopka nie chowają się pod paskiem. z-index poniżej
       modali (1000), aby nie zasłaniał noty prawnej na dole modala odtwarzacza.
       ============================================================ */
    .cookie-bar {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
      display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
      padding: 10px 4% calc(10px + env(safe-area-inset-bottom));
      background: #1f1f1f; border-top: 1px solid var(--border);
      color: var(--text-muted); font-size: 0.82rem; line-height: 1.45;
      box-shadow: 0 -4px 20px rgba(0,0,0,0.55);
      max-height: 45vh; overflow-y: auto;
    }
    .cookie-bar[hidden] { display: none; }
    .cookie-bar-text { flex: 1 1 320px; margin: 0; }
    .cookie-bar-link { color: #fff; text-decoration: underline; }
    .cookie-bar-accept {
      flex: 0 0 auto; background: var(--brand-red); color: #fff; border: none;
      padding: 8px 18px; border-radius: 4px; font-size: 0.85rem; font-weight: 700;
      white-space: nowrap; cursor: pointer; transition: background 0.2s;
    }
    .cookie-bar-accept:hover { background: var(--brand-red-hover); }

    /* ============================================================
       Strona polityki prywatności (privacy.php).
       ============================================================ */
    .legal-body {
      background: var(--bg); color: var(--text); padding-bottom: 60px;
      font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    }
    .legal-header {
      position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
      justify-content: space-between; gap: 16px; flex-wrap: wrap;
      padding: 14px 4%; background: #141414; border-bottom: 1px solid var(--border);
    }
    .legal-brand { display: inline-flex; align-items: center; text-decoration: none; }
    .legal-back { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 700; transition: color 0.2s; }
    .legal-back:hover { color: #fff; }
    .legal-main { max-width: 820px; margin: 0 auto; padding: 40px 5% 20px; }
    .legal-main h1 { font-size: 2rem; margin-bottom: 8px; }
    .legal-main h2 { font-size: 1.2rem; margin: 28px 0 10px; color: #fff; }
    .legal-main p, .legal-main li { color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }
    .legal-main p { margin-bottom: 12px; }
    .legal-main ul { margin: 0 0 12px 22px; }
    .legal-main li { margin-bottom: 6px; }
    .legal-main a, .legal-footer a { color: #fff; }
    .legal-main code { background: #232323; padding: 1px 6px; border-radius: 4px; font-size: 0.85em; }
    .legal-updated { color: #808080; font-size: 0.85rem; margin-bottom: 24px; }
    .legal-footer { max-width: 820px; margin: 0 auto; padding: 20px 5% 0; border-top: 1px solid var(--border); }
    .legal-footer p { color: var(--text-muted); font-size: 0.82rem; line-height: 1.6; }

    /* ============================================================
       RWD - nowe elementy na małych ekranach (<= 768px).
       ============================================================ */
    @media (max-width: 768px) {
      .modal-legal { padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); }
      .info-body { padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); }
      .cookie-bar { padding: 10px 5% calc(10px + env(safe-area-inset-bottom)); font-size: 0.78rem; }
      .cookie-bar-accept { width: 100%; }
      .legal-main { padding: 28px 5% 16px; }
      .legal-main h1 { font-size: 1.6rem; }
    }

    /* ============================================================
       Leniwe renderowanie list (wydajność na słabych urządzeniach).
       content-visibility: auto pozwala przeglądarce pominąć layout i paint
       elementów poza ekranem, a contain-intrinsic-size rezerwuje dla nich
       miejsce - bez tego pasek przewijania skakałby przy doczytywaniu.
       ============================================================ */
    .category-section { content-visibility: auto; contain-intrinsic-size: 0 340px; }
    .movie-card { content-visibility: auto; contain-intrinsic-size: 0 320px; }

    /* Szkielety wierszy - widoczne, zanim doczytają się kafelki (renderRowSkeletons w app.js). */
    .row-container.is-loading { pointer-events: none; }
    .movie-card.is-skeleton { border-color: #262626; }
    .movie-card.is-skeleton .poster-wrap {
      background: linear-gradient(100deg, #1c1c1c 30%, #262626 50%, #1c1c1c 70%);
      background-size: 200% 100%; animation: ffSkeleton 1.2s ease-in-out infinite;
    }
    .skeleton-line {
      height: 12px; border-radius: 4px; margin: 10px 12px 0;
      background: linear-gradient(100deg, #232323 30%, #2e2e2e 50%, #232323 70%);
      background-size: 200% 100%; animation: ffSkeleton 1.2s ease-in-out infinite;
    }
    .skeleton-line.short { width: 55%; margin-bottom: 14px; }
    @keyframes ffSkeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

    /* Sentinel doczytywania kolejnych stron (widok kategorii / wyniki wyszukiwania). */
    .load-more-sentinel { min-height: 10px; }
    .load-more-btn {
      display: block; margin: 0 auto 40px; padding: 12px 22px; cursor: pointer;
      background: var(--card-bg); color: var(--text); border: 1px solid var(--border);
      border-radius: 6px; font-size: 0.9rem; font-weight: 600; touch-action: manipulation;
    }
    .load-more-btn:hover { border-color: #666; }

    /* Ograniczenie animacji: bez pulsujących szkieletów. */
    @media (prefers-reduced-motion: reduce) {
      .movie-card.is-skeleton .poster-wrap, .skeleton-line { animation: none; }
    }

    /* ============================================================
       Modal ustawień użytkownika (views/partials/settings_modal.php) + wybór szablonu.
       Korzysta z bazowych klas .modal / .modal-box, jak modal informacyjny.
       Lista szablonów pochodzi z config/config.php -> app_themes().
       ============================================================ */
    .settings-btn svg { display: block; }
    .settings-box { max-width: 820px; }
    .settings-body { padding: 4px 30px 30px; }
    .settings-title { font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
    .settings-section { margin-top: 20px; }
    .settings-section-title { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
    .settings-section-hint { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; }

    /* Kafelki szablonów - klikalne, z próbką kolorów i opisem różnic w układzie. */
    .theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
    .theme-option {
      display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
      text-align: left; font-family: inherit; color: var(--text); cursor: pointer;
      background: #1f1f1f; border: 1px solid var(--border); border-radius: 8px;
      padding: 14px; transition: border-color 0.2s, background 0.2s, transform 0.2s;
    }
    .theme-option:hover { background: #242424; border-color: #666; transform: translateY(-2px); }
    .theme-option.active { border-color: var(--brand-red); box-shadow: 0 0 0 1px var(--brand-red); }
    .theme-option.active::after {
      content: '✓ wybrany'; font-size: 0.7rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.5px; color: var(--brand-red);
    }
    .theme-swatch { display: flex; gap: 6px; }
    .theme-swatch span {
      width: 22px; height: 22px; border-radius: 50%;
      border: 1px solid rgba(255,255,255,0.25);
    }
    .theme-name { font-size: 0.95rem; font-weight: 700; }
    .theme-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }
    .settings-note { margin-top: 22px; font-size: 0.78rem; color: #808080; line-height: 1.55; }
    .settings-note a { color: #fff; }

    @media (max-width: 620px) {
      .settings-body { padding: 4px 18px calc(24px + env(safe-area-inset-bottom)); }
      .settings-title { font-size: 1.35rem; }
      .theme-grid { grid-template-columns: 1fr; }
    }

    /* ============================================================
       Filtry katalogu (kraj pochodzenia + język oryginalny + kolejność).
       Panel: views/partials/filters_modal.php (przycisk „Filtry” w topbarze),
       lista krajów w panelu bocznym oraz pasek podsumowania nad siatką wyników.
       Dane pochodzą z TMDB (kolumny country/lang w tabeli movies).
       ============================================================ */
    .filters-btn { position: relative; }
    .filters-btn svg { display: block; }
    .filters-badge {
      position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
      border-radius: 999px; background: var(--brand-red); color: #fff;
      font-size: 0.68rem; font-weight: 700; line-height: 17px; text-align: center;
    }
    .filters-badge[hidden] { display: none; }

    /* Kraj pochodzenia obok plakietki języka w modalu odtwarzacza. */
    .country-pill {
      display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
      background: rgba(255,255,255,0.12); border: 1px solid var(--border); color: var(--text);
      font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3px;
      padding: 3px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .country-pill[hidden] { display: none; }

    .filters-box { max-width: 720px; }
    .filters-body { padding: 4px 30px 30px; }
    .filters-title { font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
    .filters-hint { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }
    .filters-section { margin-top: 20px; }
    .filters-section-title { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 10px; }

    /* Lista „pigułek” - w każdej grupie aktywna jest dokładnie jedna. */
    .filter-chips {
      display: flex; flex-wrap: wrap; gap: 8px;
      max-height: 210px; overflow-y: auto; padding: 2px;
    }
    .filter-chip {
      font-family: inherit; font-size: 0.82rem; color: var(--text); cursor: pointer;
      background: #1f1f1f; border: 1px solid var(--border); border-radius: 999px;
      padding: 6px 12px; transition: background 0.2s, border-color 0.2s, color 0.2s;
    }
    .filter-chip:hover { background: #2a2a2a; border-color: #666; }
    .filter-chip.active { background: var(--brand-red); border-color: var(--brand-red); color: #fff; font-weight: 700; }

    .filters-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
    .filters-actions .btn-reset,
    .filters-actions .btn-apply {
      font-family: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
      padding: 10px 20px; border-radius: 6px; transition: background 0.2s, border-color 0.2s, color 0.2s;
    }
    .filters-actions .btn-reset { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
    .filters-actions .btn-reset:hover { border-color: #777; color: var(--text); }
    .filters-actions .btn-apply { background: var(--brand-red); border: 1px solid var(--brand-red); color: #fff; }
    .filters-actions .btn-apply:hover { background: var(--brand-red-hover); border-color: var(--brand-red-hover); }

    /* Pasek podsumowania nad siatką wyników filtrów. */
    .filters-active-note { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
    .filters-clear-link {
      background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
      font-size: 0.85rem; font-weight: 700; color: var(--brand-red); text-decoration: underline;
    }
    .filters-clear-link:hover { color: var(--brand-red-hover); }

    @media (max-width: 620px) {
      .filters-body { padding: 4px 18px calc(24px + env(safe-area-inset-bottom)); }
      .filters-title { font-size: 1.35rem; }
      .filter-chips { max-height: 168px; }
      .filters-actions { justify-content: stretch; }
      .filters-actions .btn-reset, .filters-actions .btn-apply { flex: 1 1 auto; }
    }


    /* ============================================================
       WARSTWA MOBILNA (app-like)
       ------------------------------------------------------------
       Telefon i mały tablet dostają układ jak w aplikacji: dolna nawigacja, modale
       wsuwane od dołu (bottom-sheet), nagłówek ukrywany przy przewijaniu w dół oraz
       odstępy bezpieczne (notch, pasek gestów, klawiatura).

       Zasady, których trzyma się ta sekcja:
         - to JEDYNE miejsce z dodatkową warstwą mobilną - nie dokładamy plików CSS, bo
           lista plików app shella (config/config.php -> app_shell_files) i sw.js są z nią
           spięte,
         - reguły stoją NA KOŃCU pliku, więc przy równej specyficzności nadpisują
           wcześniejsze bloki RWD (768 / 620 / 480 px) - celowo,
         - klasy is-mobile / is-touch / is-pwa nadaje <html> skrypt z views/partials/
           theme_boot.php (podgląd na komputerze: ?mobile=1, ?pwa=1).

       Podział odpowiedzialności: układ (i jego progi szerokości) opisują media queries,
       a sposób obsługi urządzenia (brak kursora, tryb standalone) - klasy z bootu.
       ============================================================ */

    /* --- Zmienne warstwy: wysokość dolnego paska + odstępy bezpieczne urządzenia --- */
    html {
      --bottom-nav-h: 0px;
      --safe-top: env(safe-area-inset-top, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --safe-left: env(safe-area-inset-left, 0px);
      --safe-right: env(safe-area-inset-right, 0px);
      -webkit-text-size-adjust: 100%;
    }

    /* Tło nie "odbija się" pod palcem (iOS) - przewijamy treść, nie całą kartę. */
    html.is-touch { overscroll-behavior-y: none; }

    /* Dotyk nie zna :hover - efekt uniesienia kafelka zostawałby włączony po dotknięciu.
       Zamiast tego krótkie wciśnięcie: lepszy sygnał, że palec trafił w kafelek. */
    html.is-touch .movie-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
    html.is-touch .movie-card:active { transform: scale(0.98); border-color: #666; }
    html.is-touch .profile-tile:hover { transform: none; }
    html.is-touch .profile-tile:hover img { border-color: transparent; box-shadow: none; }
    html.is-touch button:hover, html.is-touch a:hover { transform: none; }
    /* Na ekranie dotykowym "hover" zostaje po dotknięciu - łapki nie mogą zmieniać tła,
       własny głos nadal odróżnia klasa .is-active (patrz .vote-btn.is-active). */
    html.is-touch .vote-btn:hover { background: #232323; border-color: var(--border); }
    html.is-touch .vote-btn.is-active:hover { background: rgba(229, 9, 20, 0.18); border-color: var(--brand-red); }
    html.is-touch #voteDownBtn.is-active:hover { background: rgba(255, 255, 255, 0.12); border-color: #6b6b6b; }

    /* ============================================================
       Dolna nawigacja (views/partials/bottom_nav.php)
       Widoczna wyłącznie na telefonie. Poza tym progiem ma display:none, więc nie zajmuje
       miejsca ani nie łapie fokusu klawiatury. Gdy widoczny jest pasek cookies
       (--cookie-bar-h), nawigacja unosi się nad niego - nic się nie zasłania.
       ============================================================ */
    .bottom-nav {
      display: none;
      position: fixed; left: 0; right: 0; bottom: var(--cookie-bar-h, 0px); z-index: 850;
      height: calc(58px + var(--safe-bottom));
      padding-left: var(--safe-left); padding-right: var(--safe-right);
      background: rgba(18,18,18,0.96); border-top: 1px solid var(--border);
      backdrop-filter: blur(14px); box-shadow: 0 -6px 24px rgba(0,0,0,0.55);
      transition: bottom 0.25s ease;
    }
    .bottom-nav[hidden] { display: none; }
    .bottom-nav-item {
      position: relative; flex: 1 1 0; min-width: 0;
      height: 58px;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
      background: none; border: none; padding: 0 2px; margin: 0;
      color: var(--text-muted); font-family: inherit; font-size: 0.68rem; font-weight: 700;
      letter-spacing: 0.2px; cursor: pointer; touch-action: manipulation;
    }
    .bottom-nav-item svg { display: block; width: 23px; height: 23px; }
    .bottom-nav-item:active { opacity: 0.65; }
    .bottom-nav-item.is-active { color: #fff; }
    .bottom-nav-item.is-active::before {
      content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
      width: 26px; height: 3px; border-radius: 999px; background: var(--brand-red);
    }
    .bottom-nav-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .bottom-nav-badge {
      position: absolute; top: 6px; left: calc(50% + 5px); min-width: 17px; height: 17px;
      padding: 0 4px; border-radius: 999px; background: var(--brand-red); color: #fff;
      font-size: 0.66rem; font-weight: 700; line-height: 17px; text-align: center;
    }
    .bottom-nav-badge[hidden] { display: none; }


    /* ============================================================
       Telefon / mały tablet (<= 768px) - układ aplikacji
       ============================================================ */
    @media (max-width: 768px) {
      html { --bottom-nav-h: 58px; }

      /* Miejsce na dolną nawigację, pasek cookies i pasek gestów (nadpisuje blok RWD wyżej). */
      body {
        padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 18px + var(--cookie-bar-h, 0px));
      }
      .bottom-nav { display: flex; }

      /* Komunikaty (toast) lądują nad dolną nawigacją, żeby niczego nie zasłaniały. */
      .toast { bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 14px + var(--cookie-bar-h, 0px)); }

      /* --- Nagłówek: większe cele dotyku, brak auto-zoom w iOS (pola >= 16px) --- */
      header {
        padding-left: calc(16px + var(--safe-left));
        padding-right: calc(16px + var(--safe-right));
        transition: background 0.3s ease, transform 0.28s ease;
      }
      /* Auto-ukrywanie przy przewijaniu w dół (klasę zakłada app.js) - więcej miejsca na treść. */
      header.is-hidden { transform: translateY(-100%); }
      .info-btn { width: 40px; height: 40px; font-size: 1.15rem; }
      .info-btn svg { width: 19px; height: 19px; }
      .profile-btn { padding: 6px 10px; min-height: 40px; }
      .profile-btn img { width: 28px; height: 28px; }
      .menu-btn { min-height: 40px; padding: 9px 11px; }
      /* Panel "Filtry" jest w dolnej nawigacji - w nagłówku zostaje tylko profil i "i". */
      #filtersBtn { display: none; }
      /* Ikona wsparcia chowa się tu z tego samego powodu (brak miejsca na kolejny przycisk) -
         na telefonie do zbiórki prowadzi wpis w modalu informacyjnym. */
      #supportBtn { display: none; }

      /* --- Wyszukiwarka: w pasku nagłówka jej nie ma - rolę przejmuje skrót "Szukaj" z dolnej
         nawigacji. Pole rozwija się jako nakładka nad treścią po dotknięciu skrótu (app.js
         zakłada klasę search-open na <body>), a zamyka je krzyżyk, Escape albo wyczyszczenie
         zapytania. Jedno pole obsługuje więc i desktop, i telefon (bez drugiej ścieżki). */
      .search-box { display: none; }
      .search-box input, .search-box input:focus { font-size: 16px; padding: 9px 12px; min-height: 40px; }
      body.search-open header { z-index: 265; }
      body.search-open .search-box {
        display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 260;
        gap: 10px; align-items: center;
        padding: calc(10px + var(--safe-top)) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
        background: rgba(18,18,18,0.98); border-bottom: 1px solid var(--border);
        backdrop-filter: blur(14px); box-shadow: 0 6px 24px rgba(0,0,0,0.55);
      }
      body.search-open .search-box input, body.search-open .search-box input:focus {
        flex: 1 1 auto; width: 100%; min-width: 0;
      }
      .search-close {
        flex: 0 0 auto; width: 40px; height: 40px; align-items: center; justify-content: center;
        background: none; border: 1px solid var(--border); border-radius: 6px; color: #fff;
        font-size: 1.5rem; line-height: 1; cursor: pointer;
      }
      body.search-open .search-close { display: flex; }

      /* --- Panel boczny: wysokość niezależna od paska adresu Safari (dvh) + odstępy bezpieczne --- */
      .sidebar {
        width: 86vw; max-width: 330px; height: 100vh; height: 100dvh;
        padding-top: calc(20px + var(--safe-top)); padding-bottom: calc(20px + var(--safe-bottom));
      }
      .sidebar-item, .sidebar-channel-item { min-height: 46px; }
      .sidebar-close { width: 44px; height: 44px; font-size: 1.8rem; }

      /* --- Rzędy kafelków: przewijanie "przyciągające" do początku kafelka --- */
      .row-container {
        scroll-snap-type: x proximity; scroll-padding-left: 5%;
        -webkit-overflow-scrolling: touch;
      }
      .row-container .movie-card { scroll-snap-align: start; }

      /* --- Bottom-sheet: modale treści wsuwane od dołu ---
         Modal odtwarzacza (pełnoekranowy) zostaje bez zmian - arkusz przeszkadzałby w oglądaniu.
         Arkusz dostaje uchwyt do przeciągnięcia, zaokrąglone górne rogi i miejsce na pasek gestów. */
      .info-modal, .settings-modal, .filters-modal, .install-modal, .help-modal { align-items: flex-end; }
      .info-box, .settings-box, .filters-box, .install-box, .help-box {
        max-width: 100%; max-height: 88vh; max-height: 88dvh;
        border-radius: 18px 18px 0 0; border-bottom: none;
        padding-bottom: var(--safe-bottom);
        animation: ffSheetUp 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
      }
      .info-box::before, .settings-box::before, .filters-box::before, .install-box::before, .help-box::before {
        content: ''; flex: 0 0 auto; width: 44px; height: 4px; margin: 8px auto 0;
        border-radius: 999px; background: #4a4a4a;
      }
      /* Przeciąganie arkusza palcem (app.js) - bez animacji, dopóki palec jest na ekranie. */
      .is-dragging { transition: none; }
      .is-dragging::before { background: #7a7a7a; }
      .info-body, .settings-body, .filters-body, .install-body, .help-body {
        padding-bottom: calc(24px + var(--safe-bottom));
      }
      .close-btn { width: 42px; height: 42px; }

      /* --- Większe cele dotyku w formularzach i listach filtrów --- */
      .add-form-container input { font-size: 16px; }
      .filter-chip { padding: 8px 14px; min-height: 38px; }
      .filter-chips { max-height: 38vh; }

      /* --- Strona statyczna (polityka prywatności) i pasek cookies: odstępy bezpieczne --- */
      .legal-header { padding: calc(14px + var(--safe-top)) 5% 14px; }
      .legal-main { padding-left: calc(5% + var(--safe-left)); padding-right: calc(5% + var(--safe-right)); }
      .legal-footer { padding-bottom: calc(20px + var(--safe-bottom)); }
      .cookie-bar { padding-bottom: calc(10px + var(--safe-bottom)); }
    }

    @keyframes ffSheetUp {
      from { transform: translateY(28%); opacity: 0.65; }
      to { transform: translateY(0); opacity: 1; }
    }


    /* ============================================================
       Blokada przewijania tła na iOS (dopełnienie app.js)
       Na iOS samo overflow:hidden nie zatrzymuje strony - palec przesuwa ją pod modalem.
       app.js ustawia wtedy position:fixed z zapamiętaną pozycją (klasa is-scroll-locked),
       a po zamknięciu wraca w to samo miejsce.
       ============================================================ */
    body.modal-open.is-scroll-locked {
      position: fixed; left: 0; right: 0; width: 100%; overflow: hidden;
    }

    /* ============================================================
       Aplikacja zainstalowana (PWA / standalone)
       ============================================================ */
    html.is-pwa body { overscroll-behavior-y: none; }
    html.is-pwa .install-btn { display: none !important; }
    /* Pasek statusu systemowego nie nachodzi na przyklejony nagłówek. */
    html.is-pwa header { padding-top: var(--safe-top); }

    /* ============================================================
       Obsługa dotykiem: urządzenia bez kursora nie znają stanu :hover
       ============================================================ */
    @media (hover: none) {
      /* Usuwanie profilu musi być osiągalne palcem (na desktopie pojawia się po najechaniu). */
      .profile-tile-wrap .delete-profile-btn { display: flex; opacity: 0.85; }
      .profile-tile-wrap .delete-profile-btn:hover { transform: none; opacity: 1; }
    }

    /* Animacje warstwy mobilnej wyłączamy, gdy użytkownik ograniczył ruch. */
    @media (prefers-reduced-motion: reduce) {
      header, .bottom-nav, .bottom-nav-item, .modal-box {
        animation: none !important; transition: none !important;
      }
    }

    /* --- Arkusz pomocy przy instalacji (views/partials/install_sheet.php) --- */
    .install-box { max-width: 460px; }
    .install-body { padding: 6px 30px 30px; }
    .install-title { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
    .install-hint { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; }
    .install-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
    .install-steps li { display: flex; gap: 12px; align-items: flex-start; color: #d2d2d2; font-size: 0.92rem; line-height: 1.5; }
    .install-step-num {
      flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
      background: var(--brand-red); color: #fff; font-size: 0.8rem; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
    }
    .install-actions { display: flex; justify-content: flex-end; }

    /* ============================================================
       Arkusz pomocy odtwarzacza (views/partials/help_sheet.php)
       ------------------------------------------------------------
       Jeden arkusz obsługuje „Brak napisów?” oraz „Wyślij na telewizor” - app.js odsłania
       tylko właściwą sekcję (.help-section[hidden]), więc wygląd i obsługa są wspólne.
       Wizualnie spójny z arkuszem instalacji (.install-*).
       ============================================================ */
    /* Arkusz tekstowy: na szerokim ekranie nie rozciąga się na całą szerokość modala.
       W układzie telefonu (<= 768px) szerokość ustala lista arkuszy w warstwie mobilnej
       (max-width: 100%), więc ustawiamy go tylko powyżej tego progu - inaczej by ją nadpisał. */
    @media (min-width: 769px) {
      .help-box { max-width: 460px; }
    }
    .help-body { padding: 6px 30px 30px; }
    /* Sekcje przełącza app.js - hidden musi wygrywać z układem flex listy kroków. */
    .help-section[hidden] { display: none; }
    .help-title { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
    .help-hint { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; }
    .help-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
    .help-steps li { display: flex; gap: 12px; align-items: flex-start; color: #d2d2d2; font-size: 0.92rem; line-height: 1.5; }
    .help-step-num {
      flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
      background: var(--brand-red); color: #fff; font-size: 0.8rem; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
    }
    /* Stopka arkusza: CTA „Otwórz na YouTube” (ten sam styl co w modalu filmu) obok
       „Rozumiem”. Oba przyciski mają promień rzędu akcji odtwarzacza (--control-radius). */
    .help-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
    .help-ok-btn {
      display: inline-flex; align-items: center; justify-content: center;
      background: #232323; border: 1px solid var(--border); color: #fff;
      padding: 10px 20px; border-radius: var(--control-radius); font-family: inherit;
      font-size: 0.9rem; font-weight: 700; cursor: pointer;
      transition: background 0.2s, border-color 0.2s, color 0.2s;
    }
    .help-ok-btn:hover { background: #2e2e2e; border-color: var(--brand-red); }
    .help-ok-btn:focus-visible { outline: 2px solid var(--brand-red); outline-offset: 2px; }
    /* Na telefonie i tablecie arkusz jest bottom-sheetem (szerokość, uchwyt i animację wsunięcia
       ustawia warstwa mobilna), więc zostaje tylko mniejszy oddech i przyciski na całą szerokość.
       Dolny odstęp musi zostać wypisany wprost - skrót `padding` nadpisałby padding-bottom
       z listy arkuszy (miejsce na pasek gestów). */
    @media (max-width: 768px) {
      .help-body { padding: 4px 18px calc(24px + var(--safe-bottom)); }
      .help-actions { justify-content: stretch; }
      .help-actions .yt-link-btn, .help-actions .help-ok-btn { flex: 1 1 0; text-align: center; }
    }

