/* PNP Webinar Room Mobile V1
   Marker: PNP_WEBINAR_ROOM_MOBILE_V1
   Scope: mobile-only overrides for /webinary/{slug}/pokoj
*/

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .pnp-room {
    min-width: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .pnp-stage__main {
    position: relative;
    align-items: stretch;
    justify-content: stretch;
    padding: 8px;
    min-width: 0;
    overflow: hidden;
  }

  .pnp-stage__grid {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 6px;
    padding: 4px;
    overflow: hidden;
  }

  .pnp-stage__tile {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
  }

  .pnp-stage__tile video,
  .pnp-lk-remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .pnp-stage__tile-label {
    left: 10px;
    right: 10px;
    bottom: 8px;
    width: auto;
    max-width: calc(100% - 20px);
    font-size: 14px;
    line-height: 1.25;
    padding: 5px 10px;
    border-radius: 999px;
  }

  .pnp-local-video-slot {
    position: absolute;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: 104px;
    height: 78px;
    z-index: 20;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
    background: rgba(4,10,20,.82);
  }

  .pnp-local-video-slot video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .pnp-bottombar {
    height: auto;
    min-height: calc(78px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .pnp-bottombar::-webkit-scrollbar {
    display: none;
  }

  .pnp-btn {
    min-width: 60px;
    min-height: 52px;
    padding: 8px 12px;
    border-radius: 14px;
    flex: 0 0 auto;
    touch-action: manipulation;
  }

  .pnp-btn__label,
  .pnp-btn span {
    font-size: 13px;
    line-height: 1.15;
  }

  .pnp-vsz-btn,
  .pnp-vsz-menu {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .pnp-stage__main {
    padding: 6px;
  }

  .pnp-stage__grid {
    gap: 5px;
    padding: 3px;
  }

  .pnp-local-video-slot {
    width: 86px;
    height: 64px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .pnp-btn {
    min-width: 58px;
    min-height: 50px;
    padding: 7px 10px;
  }

  .pnp-stage__tile-label {
    font-size: 13px;
    padding: 4px 9px;
  }
}

@media (max-width: 768px) and (min-width: 481px) {
  .pnp-stage__grid:has(.pnp-stage__tile:nth-child(2)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .pnp-stage__main {
    padding: 5px;
  }

  .pnp-stage__grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-content: stretch;
  }

  .pnp-local-video-slot {
    width: 86px;
    height: 64px;
    right: 6px;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .pnp-bottombar {
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-top: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .pnp-btn {
    min-height: 46px;
  }
}

/* PNP_LIVEKIT_C9C_MOBILE_BUTTON_ICONS */
@media (max-width: 768px) {
  .pnp-bottombar .pnp-btn {
    min-height: 56px;
  }

  .pnp-bottombar .pnp-btn__icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 20px;
  }

  .pnp-bottombar .pnp-btn__icon svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }

  /* Stan WŁĄCZONE — mocniejszy i czytelniejszy na mobile */
  .pnp-bottombar .pnp-btn.is-active {
    color: #ffe9a6;
  }

  .pnp-bottombar .pnp-btn.is-active .pnp-btn__icon {
    background: rgba(201, 168, 76, .28);
    box-shadow: 0 0 0 2px rgba(245, 210, 120, .30), 0 8px 20px rgba(0,0,0,.20);
  }

  .pnp-bottombar .pnp-btn.is-active .pnp-btn__icon svg {
    color: #fff3c4;
    stroke-width: 2.4;
  }
}

/* Jasne modele pokoju — aktywny przycisk musi być widoczny także na jasnym tle */
@media (max-width: 768px) {
  :is(
    body[data-pnp-room-model="klasyczna-konferencja"],
    body[data-pnp-room-model="biale-premium"],
    body[data-pnp-room-model="miekka-perla"],
    body[data-pnp-room-model="nowoczesny-blekit"],
    body[data-pnp-room-model="spokojne-biuro"],
    body[data-pnp-room-model="ciepla-kaplica"],
    body[data-pnp-room-model="kaplica"],
    body[data-pnp-room-model="jasne-zloto"],
    body[data-pnp-room-model="bialy-luksus"],
    body[data-pnp-room-model="perlowy-spokoj"],
    body[data-pnp-room-model="wysoki-kontrast-senior"]
  ) .pnp-bottombar .pnp-btn.is-active {
    color: #5f4200;
  }

  :is(
    body[data-pnp-room-model="klasyczna-konferencja"],
    body[data-pnp-room-model="biale-premium"],
    body[data-pnp-room-model="miekka-perla"],
    body[data-pnp-room-model="nowoczesny-blekit"],
    body[data-pnp-room-model="spokojne-biuro"],
    body[data-pnp-room-model="ciepla-kaplica"],
    body[data-pnp-room-model="kaplica"],
    body[data-pnp-room-model="jasne-zloto"],
    body[data-pnp-room-model="bialy-luksus"],
    body[data-pnp-room-model="perlowy-spokoj"],
    body[data-pnp-room-model="wysoki-kontrast-senior"]
  ) .pnp-bottombar .pnp-btn.is-active .pnp-btn__icon {
    background: rgba(180, 130, 0, .24);
    box-shadow: 0 0 0 2px rgba(145, 98, 0, .42), 0 8px 18px rgba(80,60,20,.16);
  }

  :is(
    body[data-pnp-room-model="klasyczna-konferencja"],
    body[data-pnp-room-model="biale-premium"],
    body[data-pnp-room-model="miekka-perla"],
    body[data-pnp-room-model="nowoczesny-blekit"],
    body[data-pnp-room-model="spokojne-biuro"],
    body[data-pnp-room-model="ciepla-kaplica"],
    body[data-pnp-room-model="kaplica"],
    body[data-pnp-room-model="jasne-zloto"],
    body[data-pnp-room-model="bialy-luksus"],
    body[data-pnp-room-model="perlowy-spokoj"],
    body[data-pnp-room-model="wysoki-kontrast-senior"]
  ) .pnp-bottombar .pnp-btn.is-active .pnp-btn__icon svg {
    color: #5f4200;
    stroke-width: 2.5;
  }
}

@media (max-width: 480px) {
  .pnp-bottombar .pnp-btn__icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .pnp-bottombar .pnp-btn__icon svg {
    width: 24px;
    height: 24px;
  }
}
/* /PNP_LIVEKIT_C9C_MOBILE_BUTTON_ICONS */

/* PNP_LIVEKIT_C10C_MOBILE_BOTTTOMBAR_SCROLL_FIX */
@media (max-width: 768px) {
  .pnp-bottombar {
    justify-content: flex-start;
    scroll-padding-inline: 10px;
  }
}
/* /PNP_LIVEKIT_C10C_MOBILE_BOTTTOMBAR_SCROLL_FIX */

/* PNP_LIVEKIT_C10F_MOBILE_CHAT_PANEL */
@media (max-width: 768px) {
  #pnpOverlayChat .pnp-overlay__sheet {
    height: 72vh;
    height: 72dvh;
  }
}

@media (max-width: 768px) and (max-height: 520px) {
  #pnpOverlayChat .pnp-overlay__sheet {
    height: 84vh;
    height: 84dvh;
  }
}
/* /PNP_LIVEKIT_C10F_MOBILE_CHAT_PANEL */

/* PNP_LIVEKIT_C10G_MOBILE_CHAT_VISIBLE_PANEL */
@media (max-width: 768px) {
  #pnpOverlayChat.pnp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: flex-end;
    justify-content: center;
    background: rgba(3, 7, 18, .58);
    pointer-events: auto;
  }

  #pnpOverlayChat.pnp-overlay.is-open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #pnpOverlayChat .pnp-overlay__sheet {
    width: 100%;
    max-width: none;
    height: 72vh;
    height: 72dvh;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
    color: #f8fafc;
    border-top: 1px solid rgba(245, 210, 120, .35);
    box-shadow: 0 -18px 45px rgba(0, 0, 0, .45);
  }

  #pnpOverlayChat .pnp-overlay__head {
    flex: 0 0 auto;
    color: #f8fafc;
    background: rgba(15, 23, 42, .98);
    border-bottom: 1px solid rgba(245, 210, 120, .18);
  }

  #pnpOverlayChat .pnp-overlay__title,
  #pnpOverlayChat .pnp-overlay__subtitle,
  #pnpOverlayChat .pnp-overlay__close {
    color: #f8fafc;
  }

  #pnpOverlayChat .pnp-overlay__body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0f172a;
    color: #f8fafc;
  }

  #pnpOverlayChat #pnpChatMessagesOverlay {
    flex: 1 1 auto !important;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto !important;
    padding: 14px;
    background: #111827;
    color: #f8fafc;
  }

  #pnpOverlayChat .pnp-chat__msg,
  #pnpOverlayChat .pnp-chat-msg {
    color: #f8fafc;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
  }

  #pnpOverlayChat .pnp-chat__msg--self,
  #pnpOverlayChat .pnp-chat-msg--self {
    color: #1f2937;
    background: #f8d77a;
    border-color: rgba(120, 82, 0, .28);
  }

  #pnpOverlayChat .pnp-chat__footer {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #0b1220;
    border-top: 1px solid rgba(245, 210, 120, .20);
  }

  #pnpOverlayChat #pnpChatInputOverlay {
    min-height: 48px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(245, 210, 120, .55);
  }

  #pnpOverlayChat .pnp-chat__send {
    min-width: 86px;
    color: #111827;
    background: #f8d77a;
    border: 1px solid rgba(120, 82, 0, .28);
    font-weight: 800;
  }
}

@media (max-width: 768px) and (max-height: 520px) {
  #pnpOverlayChat .pnp-overlay__sheet {
    height: 84vh;
    height: 84dvh;
  }

  #pnpOverlayChat #pnpChatMessagesOverlay {
    min-height: 110px;
  }
}
/* /PNP_LIVEKIT_C10G_MOBILE_CHAT_VISIBLE_PANEL */

/* PNP_WEBINAR_MOBILE_LAYOUT_V1
   Mobile: stabilny układ kafelków + lokalny PIP bez nachodzenia.
   Jeden owner: pnp_webinar_room_mobile_v1.css.
*/
@media (max-width: 768px) {
  /* Te ogólne reguły (bez selektora body) obowiązywały poprzednio dla
     WSZYSTKICH trybów, w tym Mówiący/Prowadzący. Focus Layout jest teraz
     jedynym właścicielem układu Mówiący/Prowadzący na mobile, więc gdy
     body[data-pnp-focus-layout="1"] jest aktywne, te reguły muszą milczeć —
     stąd guard body:not([data-pnp-focus-layout="1"]). Galeria
     (body[data-pnp-room-view="tiles"]) nigdy nie ma data-pnp-focus-layout="1",
     więc jej zachowanie jest identyczne jak wcześniej. */
  body:not([data-pnp-focus-layout="1"]) .pnp-stage__main {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body:not([data-pnp-focus-layout="1"]) .pnp-stage__grid,
  body:not([data-pnp-focus-layout="1"]) .pnp-stage__grid--livekit {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    align-content: stretch !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  body:not([data-pnp-focus-layout="1"]) .pnp-stage__tile,
  body:not([data-pnp-focus-layout="1"]) .pnp-lk-remote-tile {
    min-height: 0 !important;
    max-height: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
  }

  body:not([data-pnp-focus-layout="1"]) .pnp-stage__tile video,
  body:not([data-pnp-focus-layout="1"]) .pnp-lk-remote-tile video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  body:not([data-pnp-focus-layout="1"]) .pnp-stage__tile-label {
    left: 50% !important;
    right: auto !important;
    bottom: 10px !important;
    transform: translateX(-50%) !important;
    max-width: calc(100% - 32px) !important;
    z-index: 8 !important;
  }

  body:not([data-pnp-focus-layout="1"]):not([data-pnp-room-view="tiles"]) .pnp-local-video-slot,
  body:not([data-pnp-focus-layout="1"])[data-pnp-room-view="auto"] .pnp-local-video-slot {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
    width: 86px !important;
    height: 64px !important;
    min-height: 0 !important;
    max-height: 64px !important;
    border-radius: 16px !important;
    z-index: 14 !important;
    overflow: hidden !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) 96px !important;
    gap: 6px !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__grid,
  body[data-pnp-room-view="tiles"] .pnp-stage__grid--livekit {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-local-video-slot {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 96px !important;
    min-height: 0 !important;
    max-height: 96px !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    border-radius: 16px !important;
    z-index: 1 !important;
    overflow: hidden !important;
  }
}

@media (max-width: 390px) {
  body:not([data-pnp-focus-layout="1"]):not([data-pnp-room-view="tiles"]) .pnp-local-video-slot,
  body:not([data-pnp-focus-layout="1"])[data-pnp-room-view="auto"] .pnp-local-video-slot {
    width: 78px !important;
    height: 58px !important;
    max-height: 58px !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__main {
    grid-template-rows: minmax(0, 1fr) 84px !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-local-video-slot {
    height: 84px !important;
    max-height: 84px !important;
  }
}
/* /PNP_WEBINAR_MOBILE_LAYOUT_V1 */

/* PNP_WEBINAR_MOBILE_SCROLL_TILES_V2
   Mobile / Widok=Kafelki:
   kafelki jeden pod drugim + przewijanie sceny palcem.
*/
@media (max-width: 768px) {
  body[data-pnp-room-view="tiles"] .pnp-stage__main {
    display: block !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 6px 6px 14px !important;
    scroll-padding-bottom: 18px !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__grid,
  body[data-pnp-room-view="tiles"] .pnp-stage__grid--livekit {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: auto !important;
    align-content: start !important;
    justify-content: stretch !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__tile,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile {
    width: 100% !important;
    height: auto !important;
    min-height: 176px !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__tile video,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-local-video-slot {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    width: 100% !important;
    height: 112px !important;
    min-height: 112px !important;
    max-height: 112px !important;
    margin: 8px 0 0 !important;
    border-radius: 18px !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    overflow: hidden !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__tile-label {
    bottom: 10px !important;
    z-index: 8 !important;
  }
}

@media (max-width: 390px) {
  body[data-pnp-room-view="tiles"] .pnp-stage__tile,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile {
    min-height: 162px !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-local-video-slot {
    height: 96px !important;
    min-height: 96px !important;
    max-height: 96px !important;
  }
}
/* /PNP_WEBINAR_MOBILE_SCROLL_TILES_V2 */

/* PNP_WEBINAR_ROOM_OLD_MOBILE_FOCUS_RULES_REMOVED_V1
   Usunięto w całości stary mechanizm Mówiący (PNP_WEBINAR_MOBILE_SPEAKER_LAYOUT_V1):
   body:not([data-pnp-room-view="tiles"]) / body[data-pnp-room-view="auto"]
   + [data-pnp-active-speaker="true"], flex/order/position:sticky.
   Zero powiązania z Galerią (body[data-pnp-room-view="tiles"]) — bezpiecznie
   usunięte, nie tylko zgardowane. Zastąpione przez
   pnp_webinar_room_focus_layout_v1.css (body[data-pnp-focus-layout="1"]).
*/
/* /PNP_WEBINAR_ROOM_OLD_MOBILE_FOCUS_RULES_REMOVED_V1 */

/* PNP_WEBINAR_MOBILE_SCROLL_END_V3B
   Mobile / Widok=Kafelki:
   oddech na końcu scrolla, żeby ostatni kafelek przewinął się w całości nad dolnym paskiem.
*/
@media (max-width: 768px) {
  body[data-pnp-room-view="tiles"] .pnp-stage__main {
    box-sizing: border-box !important;
    padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)) !important;
    overscroll-behavior: contain !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__main::after {
    content: "" !important;
    display: block !important;
    width: 100% !important;
    height: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__grid,
  body[data-pnp-room-view="tiles"] .pnp-stage__grid--livekit {
    padding-bottom: 18px !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__tile:last-child,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile:last-child {
    margin-bottom: 18px !important;
  }
}
/* /PNP_WEBINAR_MOBILE_SCROLL_END_V3B */

/* =========================================================
   PNP_WEBINAR_MOBILE_PRESENTATION_NO_LEFT_RAIL_V1
   Cel: mobile — przy prezentacji ukryj lewy dock kafelków,
   żeby prezentacja była czytelna i nie była zasłaniana.
   ========================================================= */
@media (max-width: 768px) {
  body[data-pnp-screen-share="1"] .pnp-stage__grid--livekit,
  body[data-pnp-remote-screen-share="1"] .pnp-stage__grid--livekit {
    display: none !important;
  }

  body[data-pnp-screen-share="1"] .pnp-stage__main,
  body[data-pnp-remote-screen-share="1"] .pnp-stage__main {
    padding-left: 4px !important;
  }
}
/* /PNP_WEBINAR_MOBILE_PRESENTATION_NO_LEFT_RAIL_V1 */


/* =========================================================
   PNP_WEBINAR_MOBILE_PEOPLE_BUTTON_NO_HAND_BADGE_V1
   Cel: mobile — usuń badge ręki z przycisku Osoby,
   bez ruszania osobnego przycisku Ręka.
   ========================================================= */
@media (max-width: 768px) {
  #pnpBtnPeople #pnpHandAlertMobileBottom,
  #pnpBtnPeople #pnpHandAlertMobileBottom.pnp-hand-mobile-badge--visible {
    display: none !important;
  }
}
/* /PNP_WEBINAR_MOBILE_PEOPLE_BUTTON_NO_HAND_BADGE_V1 */

/* =========================================================
   PNP_WEBINAR_MOBILE_GUEST_EVENT_PANEL_TOP_LEFT_V1
   Mobile: toast wejścia/wyjścia gościa — góra lewa + safe-area.
   Desktop bez zmian (reguły tylko w max-width: 768px).
   ========================================================= */
@media (max-width: 768px) {
  #pnpRoomPresenceGlassToastsV1 {
    left: max(10px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    top: calc(10px + env(safe-area-inset-top, 0px) + var(--top-h, 56px)) !important;
    bottom: auto !important;
    max-width: min(330px, calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))) !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    z-index: 12050 !important;
  }

  #pnpRoomPresenceGlassToastsV1 .pnp-room-presence-glass-toast-v1 {
    transform: translateY(-8px) scale(.98);
  }
}
/* /PNP_WEBINAR_MOBILE_GUEST_EVENT_PANEL_TOP_LEFT_V1 */

/* =========================================================
PNP_WEBINAR_MOBILE_GALLERY_EQUAL_TILES_SCROLL_END_V1

Mobile / Galeria:
1. równe kafelki 16:9 jeden pod drugim;
2. lokalna kamera ma taki sam rozmiar jak pozostali;
3. ostatni kafelek przewija się ponad dolny pasek;
4. odstęp uwzględnia zoom i safe-area.
========================================================= */

@media (max-width: 768px) {
  body[data-pnp-room-view="tiles"] .pnp-stage__main {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 6px 6px 12px !important;
    scroll-padding-bottom:
      calc(
        var(
          --pnp-a11y-bottombar-height,
          var(--pnp-bottom-h, 84px)
        )
        + 44px
        + env(safe-area-inset-bottom, 0px)
      ) !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__grid,
  body[data-pnp-room-view="tiles"] .pnp-stage__grid--livekit {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: auto !important;
    align-content: start !important;
    justify-content: stretch !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    gap: 8px !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__tile,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile,
  body[data-pnp-room-view="tiles"] .pnp-local-video-slot {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
    margin: 0 !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-local-video-slot {
    margin-top: 8px !important;
    border-radius: 18px !important;
    z-index: 1 !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__tile video,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile video,
  body[data-pnp-room-view="tiles"] .pnp-local-video-slot video {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__tile:last-child,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile:last-child {
    margin-bottom: 0 !important;
  }

  body[data-pnp-room-view="tiles"] .pnp-stage__main::after {
    content: "" !important;
    display: block !important;
    width: 100% !important;
    height:
      calc(
        var(
          --pnp-a11y-bottombar-height,
          var(--pnp-bottom-h, 84px)
        )
        + 36px
        + env(safe-area-inset-bottom, 0px)
      ) !important;
    pointer-events: none !important;
  }
}

@media (max-width: 390px) {
  body[data-pnp-room-view="tiles"] .pnp-stage__tile,
  body[data-pnp-room-view="tiles"] .pnp-lk-remote-tile,
  body[data-pnp-room-view="tiles"] .pnp-local-video-slot {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
  }
}

/* /PNP_WEBINAR_MOBILE_GALLERY_EQUAL_TILES_SCROLL_END_V1 */

/* Usunięto w całości stary mechanizm Mówiący/Prowadzący oparty na
   mechanizmie Galerii (dawny marker PNP_WEBINAR_MOBILE_SPEAKER_HOST_GALLERY_BASE_V3):
   body[data-pnp-room-view="speaker"] / body[data-pnp-room-view="host"]
   + [data-pnp-active-speaker="true"], flex/order, aspect-ratio 40/27,
   object-fit:cover na całym kaflu. Mimo nazwy "GALLERY_BASE" te reguły
   NIGDY nie dotyczyły Galerii (body[data-pnp-room-view="tiles"]) — bezpiecznie
   usunięte, nie tylko zgardowane. Zastąpione przez
   pnp_webinar_room_focus_layout_v1.css (body[data-pnp-focus-layout="1"]).
*/

