/*
 * mobile-app.css — widok przeglądarki na telefonie = wierne odwzorowanie appki mobilnej
 * (narejonie-mobile, Expo). Wariant A: warstwa wizualna + nawigacja, bez PWA.
 * Ładowane zawsze; wszystkie reguły wewnątrz @media (max-width: 768px), plus twardy
 * wyłącznik dla ≥769px na końcu. Nie dotyka widoku desktopowego.
 *
 * Źródła 1:1 z kodu appki:
 *  - nagłówek:  src/components/AppHeader.tsx
 *  - dolny pasek: src/app/(tabs)/_layout.tsx
 *  - szuflada Dodaj: src/components/DodajOverlay.tsx
 *  - szuflada Menu: src/components/MenuOverlay.tsx
 *  - kolory: src/constants/colors.ts (== tokeny motywu WWW)
 */

@media (max-width: 768px) {

  /* ====== Wygaszenie desktopowego chromu ====== */
  body.nrj-mobile-app { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); overscroll-behavior-y: none; }
  body.nrj-mobile-app .site-footer { display: none; }
  body.nrj-mobile-app .tile-menu { display: none !important; }
  body.nrj-mobile-app #dm-login-banner { display: none !important; }

  /* Stary górny stos: zostaje tylko pasek PILNE (jako pływająca pigułka), reszta znika */
  body.nrj-mobile-app .top-stack { position: static; width: auto; margin: 0; padding: 0; gap: 0; background: none; }
  body.nrj-mobile-app .util-bar,
  body.nrj-mobile-app .nav-card { display: none !important; }

  /* ====== Nagłówek jak w appce: [+]  narejonie.pl ▾  [konto] ====== */
  .nrj-appheader {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 12px;
    background: linear-gradient(105deg, #00296B 0%, #0B4DA6 100%);
  }
  :root[data-theme="dark"] .nrj-appheader { background: linear-gradient(105deg, #0B2A52 0%, #123B72 100%); }

  /* trzy strefy: [+ po lewej] [wordmark WYŚRODKOWANY] [konto po prawej] — jak AppHeader.tsx */
  .nrj-appheader-side { flex: 1 1 0; display: flex; align-items: center; min-width: 0; }
  .nrj-appheader-side-r { justify-content: flex-end; }
  .nrj-appheader-brand { flex: 0 0 auto; }

  .nrj-appheader-add,
  .nrj-appheader-konto {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 3px 10px rgba(0,0,0,.32);
  }
  .nrj-appheader-add {
    background: #E63946;
    border-color: rgba(230,57,70,.28);
    box-shadow: 0 3px 10px rgba(230,57,70,.5);
    cursor: pointer;
  }
  .nrj-appheader-add svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2.6; }
  .nrj-appheader-konto {
    background: #E9B44C;
    border-color: rgba(233,180,76,.30);
    box-shadow: 0 3px 10px rgba(233,180,76,.5);
  }
  :root[data-theme="dark"] .nrj-appheader-konto { background: #F0C36B; }
  .nrj-appheader-konto svg { width: 20px; height: 20px; stroke: #00296B; stroke-width: 2.4; }
  .nrj-appheader-add:active,
  .nrj-appheader-konto:active { transform: scale(.9); }

  .nrj-appheader-brand {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nrj-wordmark { font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
  .nrj-wm-na { color: #E9B44C; }
  :root[data-theme="dark"] .nrj-wm-na { color: #F0C36B; }
  .nrj-wm-rejonie { color: #fff; }
  .nrj-wm-pl { color: rgba(255,255,255,.7); font-weight: 400; }
  .nrj-appheader-brand svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 2.4; margin-top: 2px; }

  /* ====== Pasek PILNE — pływająca czerwona pigułka (Wariant B z appki).
     Domyślnie UKRYTY na mobile; pokazywany tylko na Starcie i Tablicy (klasa .nrj-pilne-ok
     dokładana przez JS). ====== */
  body.nrj-mobile-app .almanac-strip { display: none; }
  body.nrj-mobile-app.nrj-pilne-ok .almanac-strip {
    display: flex;
    align-items: center;
    width: calc(100% - 28px);
    max-width: 400px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: #E63946;
    box-shadow: 0 6px 16px rgba(230,57,70,.4);
    position: relative;
    z-index: 45;
    overflow: hidden;
  }
  body.nrj-mobile-app.nrj-pilne-ok .almanac-strip-inner {
    padding: 7px 16px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }
  body.nrj-mobile-app.nrj-pilne-ok .almanac-strip b { flex: 0 0 auto; background: rgba(255,255,255,.22); }
  /* okno + tor przewijanego tekstu (marquee jak TekstPrzewijany w appce) */
  .nrj-pilne-window { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .nrj-pilne-track { display: inline-flex; align-items: center; white-space: nowrap; }
  .nrj-pilne-track > span { padding-right: 44px; }
  .nrj-pilne-track.is-marquee { animation: nrj-pilne-scroll var(--nrj-pilne-dur, 14s) linear infinite; animation-delay: 1.2s; }
  @keyframes nrj-pilne-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  @media (prefers-reduced-motion: reduce) {
    .nrj-pilne-track.is-marquee { animation: none; }
    .nrj-pilne-window { text-overflow: ellipsis; }
    .nrj-pilne-track.is-marquee > span:nth-child(2) { display: none; }
  }

  /* ====== Dolny pasek zakładek: Start / Tablica / Rynek / Niezbędnik / Lokalnie ====== */
  .nrj-tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: linear-gradient(105deg, #00296B 0%, #0B4DA6 100%);
  }
  :root[data-theme="dark"] .nrj-tabbar { background: linear-gradient(105deg, #0B2A52 0%, #123B72 100%); }
  .nrj-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 56px;
    padding: 8px 2px;
    background: none;
    border: 0;
    font: inherit;
    text-decoration: none;
    color: rgba(255,255,255,.65);
    font-family: var(--serif);
    font-weight: 600;
    font-size: 10.5px;
    -webkit-tap-highlight-color: transparent;
    transition: color .12s ease, transform .12s ease;
  }
  .nrj-tab svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 2; }
  .nrj-tab:active { transform: scale(.9); }
  .nrj-tab.is-active { color: #fff; }

  /* ====== Wspólny scrim + szuflady ====== */
  .nrj-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0,0,0,.4);
    opacity: 0;
    transition: opacity .2s ease;
  }
  .nrj-scrim.is-open { opacity: 1; }
  .nrj-scrim[hidden] { display: none; }

  .nrj-drawer {
    position: fixed;
    top: 0; bottom: 0;
    z-index: 71;
    width: 82%;
    max-width: 340px;
    background: var(--soft);
    display: flex;
    flex-direction: column;
    transition: transform .26s cubic-bezier(.32,.72,0,1);
    box-shadow: 0 0 40px rgba(0,18,51,.3);
  }
  .nrj-drawer-menu  { left: 0;  transform: translateX(-100%); }
  .nrj-drawer-dodaj { right: 0; transform: translateX(100%); }
  .nrj-drawer.is-open { transform: translateX(0); }

  .nrj-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 12px;
  }
  .nrj-drawer-title { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); }
  .nrj-drawer-x { background: none; border: 0; padding: 2px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .nrj-drawer-x svg { width: 22px; height: 22px; stroke: var(--muted); }
  .nrj-drawer-x-red svg { stroke: #E63946; }
  .nrj-drawer-body { flex: 1; overflow-y: auto; padding: 0 16px calc(40px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }

  /* ---- Szuflada Menu ---- */
  .nrj-menu-login {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--green);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 22px;
    color: var(--green);
    font-family: var(--serif);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
  }
  :root[data-theme="dark"] .nrj-menu-login { border-color: var(--accent2); color: var(--accent2); }
  .nrj-menu-login svg { width: 18px; height: 18px; stroke: currentColor; }

  .nrj-menu-section {
    margin: 0 0 8px 4px;
    font-family: var(--serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--muted);
  }
  .nrj-menu-section:not(:first-of-type) { margin-top: 22px; }
  .nrj-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 4px;
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .nrj-menu-item:active { background: var(--paper-deep); }
  .nrj-menu-ic {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--paper-deep);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nrj-menu-ic svg { width: 18px; height: 18px; stroke: var(--green); }
  :root[data-theme="dark"] .nrj-menu-ic svg { stroke: var(--accent2); }
  .nrj-menu-label { flex: 1; font-family: var(--serif); font-size: 15px; font-weight: 600; }
  .nrj-menu-item > svg { width: 18px; height: 18px; stroke: var(--muted); flex: 0 0 auto; }

  /* ---- Szuflada Dodaj ---- */
  .nrj-dodaj-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    color: var(--ink);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .nrj-dodaj-item:active { background: var(--paper-deep); }
  .nrj-dodaj-item.is-highlight {
    border: 1.5px solid var(--nrj-c);
    background: color-mix(in srgb, var(--nrj-c) 8%, transparent);
  }
  .nrj-dodaj-ic {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--nrj-c) 15%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nrj-dodaj-ic svg { width: 19px; height: 19px; stroke: var(--nrj-c); }
  .nrj-dodaj-txt { flex: 1; min-width: 0; }
  .nrj-dodaj-title { display: block; font-family: var(--serif); font-size: 15px; font-weight: 700; }
  .nrj-dodaj-item.is-highlight .nrj-dodaj-title { color: var(--nrj-c); }
  .nrj-dodaj-desc { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.35; }

  /* ====== Segmentowany przełącznik widoków (Rynek / Niezbędnik) — jak w appce ====== */
  .nrj-segtabs {
    position: sticky;
    z-index: 44;
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .nrj-segtab {
    flex: 1;
    padding: 10px 4px;
    border: 0;
    border-radius: 12px;
    background: var(--soft);
    color: var(--nrj-c, var(--green));
    font-family: var(--serif);
    font-weight: 700;
    font-size: 12.5px;
    line-height: 1.1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nrj-segtab.is-active { background: var(--nrj-c, var(--green)); color: #fff; }
  body.nrj-segmented main.page > section.nrj-seg-hidden { display: none; }
  body.nrj-segmented main.page > .page-hero { display: none; }
  body.nrj-segmented main.page { padding-top: 0; }

  /* ====== Pop-up „Pobierz aplikację" — karta między nagłówkiem a dolnym paskiem ====== */
  .nrj-apppop-scrim {
    position: fixed;
    inset: 0;
    z-index: 64;
    background: rgba(4,10,24,.45);
  }
  .nrj-apppop-scrim[hidden] { display: none; }
  .nrj-apppop {
    position: fixed;
    left: 18px;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 auto;
    max-width: 360px;
    z-index: 65;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 30px 24px 24px;
    border-radius: 24px;
    border: 2.5px solid #E63946;
    background: linear-gradient(150deg, #00296B 0%, #0B4DA6 100%);
    color: #fff;
    box-shadow: 0 20px 55px rgba(0,18,51,.45);
  }
  :root[data-theme="dark"] .nrj-apppop { background: linear-gradient(150deg, #0B2A52 0%, #123B72 100%); }
  .nrj-apppop[hidden] { display: none; }
  .nrj-apppop-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .nrj-apppop-x svg { width: 16px; height: 16px; stroke: #fff; }
  .nrj-apppop-mark { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
  .nrj-apppop-title { font-family: var(--serif); font-size: 21px; font-weight: 800; line-height: 1.15; }
  .nrj-apppop-desc { font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.9); }
  .nrj-apppop-btn {
    align-self: stretch;
    margin-top: 6px;
    padding: 14px;
    border-radius: 999px;
    background: #fff;
    color: #00296B;
    font-family: var(--serif);
    font-weight: 800;
    font-size: 15.5px;
    text-align: center;
    text-decoration: none;
  }
  .nrj-apppop-later {
    align-self: center;
    padding: 4px 8px;
    border: 0;
    background: none;
    color: rgba(255,255,255,.75);
    font-family: var(--serif);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
  }

  /* ====== Miękkie wejście treści (zmiana ekranu jak w appce) ====== */
  body.nrj-mobile-app main { animation: nrj-screen-in .22s ease both; }
  @keyframes nrj-screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) {
    body.nrj-mobile-app main { animation: none; }
    .nrj-drawer, .nrj-scrim { transition: none; }
  }

  /* ====== Widok artykułu: pasek „‹ tytuł" zamiast nagłówka ====== */
  body.nrj-article .nrj-appheader,
  body.nrj-article .almanac-strip { display: none; }
  .nrj-appbar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 52px;
    padding: calc(env(safe-area-inset-top, 0px)) 12px 0 2px;
    position: sticky;
    top: 0;
    z-index: 60;
    background: linear-gradient(105deg, #00296B 0%, #0B4DA6 100%);
    color: #fff;
    transition: transform .2s ease;
  }
  :root[data-theme="dark"] .nrj-appbar { background: linear-gradient(105deg, #0B2A52 0%, #123B72 100%); }
  .nrj-appbar.is-hidden { transform: translateY(-100%); }
  .nrj-appbar-back { flex: 0 0 auto; width: 42px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .nrj-appbar-back:active { transform: scale(.88); }
  .nrj-appbar-back svg { width: 24px; height: 24px; }
  .nrj-appbar-title { flex: 1; min-width: 0; font-family: var(--serif); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.nrj-article .article-page { padding-top: 18px; }
  body.nrj-article .article-sidebar { display: none; }

  /* ====== Kompaktowa karta pogody (jak PogodaWidget w appce) zamiast dużego panelu WWW ====== */
  body.nrj-mobile-app .weather-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: calc(100% - 32px);
    margin: 12px auto 0;
    padding: 14px;
    border-radius: 16px;
    background: var(--green-solid);
  }
  body.nrj-mobile-app .weather-bar .wb-seg { border: 0 !important; padding: 0; }
  body.nrj-mobile-app .wb-seg-today,
  body.nrj-mobile-app .wb-seg-forecast,
  body.nrj-mobile-app .wb-kicker,
  body.nrj-mobile-app .wb-loc-date { display: none; }
  body.nrj-mobile-app .wb-seg-now { order: 1; flex: 0 0 auto; }
  body.nrj-mobile-app .wb-now { display: flex; align-items: center; gap: 10px; }
  body.nrj-mobile-app .wb-now svg { width: 40px; height: 40px; flex: 0 0 auto; }
  body.nrj-mobile-app .wb-temp { color: #fff; font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.1; }
  body.nrj-mobile-app .wb-opis { color: rgba(255,255,255,.82); font-size: 12.5px; }
  body.nrj-mobile-app .wb-seg-loc { order: 2; flex: 1; min-width: 0; }
  body.nrj-mobile-app .wb-loc-name { color: #fff; font-family: var(--serif); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.nrj-mobile-app .wb-more {
    order: 3; align-self: center; margin-left: auto; flex: 0 0 auto;
    padding: 0; font-size: 0; color: rgba(255,255,255,.85);
  }
  body.nrj-mobile-app .wb-more::after { content: "›"; font-size: 22px; line-height: 1; }

  /* ====== Sekcje strony głównej jako karuzele (poziomy scroll jak w appce) ====== */
  body.nrj-mobile-app .essentials .grid-4,
  body.nrj-mobile-app .market-preview .grid-3,
  body.nrj-mobile-app .events-home .grid-4 {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 76%;
    grid-template-columns: none;
    gap: 12px;
    margin: 0 -16px;
    padding: 4px 16px 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.nrj-mobile-app .essentials .grid-4::-webkit-scrollbar,
  body.nrj-mobile-app .market-preview .grid-3::-webkit-scrollbar,
  body.nrj-mobile-app .events-home .grid-4::-webkit-scrollbar { display: none; }
  body.nrj-mobile-app .essentials .grid-4 > *,
  body.nrj-mobile-app .market-preview .grid-3 > *,
  body.nrj-mobile-app .events-home .grid-4 > * { scroll-snap-align: start; }
  body.nrj-mobile-app .essentials .article-card img,
  body.nrj-mobile-app .events-home .article-card img { height: 128px; object-fit: cover; }
  body.nrj-mobile-app .quick-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  body.nrj-mobile-app .section-head { flex-direction: row; align-items: baseline; }
  body.nrj-mobile-app .section-head .section-link { white-space: nowrap; font-size: 12px; }

  /* segtaby jako linki (zakładka „Lokalnie" → Kalendarz / Rekreacja / Kultura, osobne strony) */
  a.nrj-segtab { text-decoration: none; display: flex; align-items: center; justify-content: center; }

  /* ====== Strona główna: odstęp kafla „Pobierz aplikację" od sekcji poniżej ====== */
  body.nrj-mobile-app.home .hg-app-tile { margin-bottom: 10px; }
  body.nrj-mobile-app.home .hero-grid-section { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  body.nrj-mobile-app.home .essentials:first-of-type { margin-top: 22px; }
  /* sekcja „Niezbędnik mieszkańca" (quick-grid) — na Starcie appki jej nie ma → chowamy
     (klasa nrj-hide-section dokładana przez JS do właściwej sekcji) */
  body.nrj-mobile-app .nrj-hide-section { display: none !important; }

  /* ====== Niezbędnik: układ „launcher" jak w appce (kafelki), zamiast rozwiniętej strony WWW ====== */
  .nrj-launcher { padding: 4px 0 8px; }
  .nrj-launch-label {
    margin: 18px 4px 10px;
    font-family: var(--serif);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--muted);
  }
  .nrj-launch-label:first-child { margin-top: 4px; }
  .nrj-launch-intro {
    margin: 4px 0 6px;
    padding: 18px;
    border-radius: 18px;
    background: var(--green-solid);
    color: #fff;
  }
  .nrj-launch-intro b { display: block; font-family: var(--serif); font-size: 16px; font-weight: 800; line-height: 1.25; }
  .nrj-launch-intro span { display: block; margin-top: 8px; font-size: 12.5px; color: rgba(255,255,255,.82); }
  .nrj-launch-tile {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--soft);
    color: var(--ink);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .nrj-launch-tile:active { background: var(--paper-deep); }
  .nrj-launch-ic {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--paper-deep);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nrj-launch-ic svg { width: 21px; height: 21px; stroke: var(--green); }
  :root[data-theme="dark"] .nrj-launch-ic svg { stroke: var(--accent2); }
  .nrj-launch-txt { flex: 1; min-width: 0; }
  .nrj-launch-title { display: block; font-family: var(--serif); font-size: 16px; font-weight: 700; }
  .nrj-launch-desc { display: block; margin-top: 3px; font-size: 12px; line-height: 1.4; color: var(--muted); }
  .nrj-launch-tile > svg { flex: 0 0 auto; width: 19px; height: 19px; stroke: var(--muted); }
  body.nrj-launched main.page { padding-top: 4px; }
  body.nrj-launched main.page > .page-hero { display: none; }
  /* kompaktowa pogoda w sekcji Pogoda niezbędnika (zostaje widoczna nad launcherem) */
  body.nrj-launched .section .whourly-wrap,
  body.nrj-launched .section .wforecast,
  body.nrj-launched .section .filter-row-spaced { display: none; }
  body.nrj-launched .weather-wide { grid-template-columns: 1fr; }

  /* ====== Start → „Najnowsze nekrologi": kompaktowe wiersze jak NekrologWiersz w appce
     (bez dużej klepsydry, bez „Ś † P", bez „Zobacz cały nekrolog"; podpis gmina/miejscowość
     u góry — 1:1 z src/components/NekrologWiersz.tsx). ====== */
  body.nrj-mobile-app .obituaries .obituary-grid { display: flex; flex-direction: column; gap: 10px; }
  body.nrj-mobile-app .obituaries .obituary-card {
    min-height: 0;
    text-align: left;
    padding: 13px 14px;
    border: 1.5px solid #000;
    border-radius: 8px;
  }
  body.nrj-mobile-app .obituaries .obituary-sp-mala,
  body.nrj-mobile-app .obituaries .obituary-wiecej { display: none; }
  body.nrj-mobile-app .obituaries .obituary-miejsce {
    margin: 0 0 2px;
    font-family: var(--serif);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #6B6B6B;
  }
  body.nrj-mobile-app .obituaries .obituary-name {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.3;
    text-transform: none;
  }
  body.nrj-mobile-app .obituaries .obituary-opis-mala {
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
  }
  body.nrj-mobile-app .obituaries .obituary-zycie-mala {
    margin-top: 5px;
    padding-top: 0;
    border-top: 0;
    font-size: 12.5px;
  }
  body.nrj-mobile-app .obituaries .obituary-detail {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body.nrj-mobile-app .obituaries .obituary-card-photo { flex-direction: row; align-items: center; gap: 12px; }
  body.nrj-mobile-app .obituaries .obituary-card-photo-img { width: 76px; height: 76px; margin: 0; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }

  /* ====== Tablica: karty pionowe (zdjęcie u góry, potem treść) jak TablicaKarta w appce —
     zamiast ściśniętego układu 2-kolumnowego, w którym tytuł i „Ś † P" / kategorie się tną. ====== */
  body.nrj-mobile-app .tablica-list { gap: 12px; }
  body.nrj-mobile-app .t-row {
    display: block;
    border: 0;
    border-radius: 12px;
    background: var(--soft);
    box-shadow: 0 1px 4px rgba(0,18,51,.1);
  }
  body.nrj-mobile-app .t-row > img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
  body.nrj-mobile-app .t-row-body { display: block; padding: 13px 15px; }
  body.nrj-mobile-app .t-row-body h2 { font-size: 16.5px; line-height: 1.3; }
  body.nrj-mobile-app .t-row-body p.t-excerpt {
    font-size: 13.5px;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body.nrj-mobile-app .t-row-body .place-badges { margin-top: 8px; }
  body.nrj-mobile-app .t-row-body .t-meta-row { flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; }

  /* Tablica → nekrolog: kompaktowy wiersz jak w appce (TablicaKarta, gałąź NEKROLOG) */
  body.nrj-mobile-app .t-row-obituary {
    display: block;
    border: 1.5px solid #000;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
  }
  body.nrj-mobile-app .t-row-obituary .t-obit-mark,
  body.nrj-mobile-app .t-row-obituary .t-obit-wiecej,
  body.nrj-mobile-app .t-row-obituary .t-meta-row { display: none; }
  body.nrj-mobile-app .t-row-obituary .t-row-body { padding: 13px 14px; }
  body.nrj-mobile-app .t-row-obituary .t-obit-miejsce {
    margin: 0 0 2px;
    font-size: 10.5px;
    font-weight: 600;
    color: #6B6B6B;
  }
  body.nrj-mobile-app .t-row-obituary h2 {
    font-family: var(--serif);
    font-size: 16px;
    text-transform: none;
  }
  body.nrj-mobile-app .t-row-obituary p.t-excerpt { margin-top: 4px; font-size: 13px; color: #3A3A3A; }

  /* ====== „Lokalnie" / Kalendarz: pasek segtabów nie może zasłaniać tytułu sekcji ====== */
  body.nrj-segmented main.page { scroll-padding-top: 122px; }
  body.nrj-segmented .nrj-segtabs { box-shadow: 0 8px 16px -10px rgba(0,18,51,.3); }
  body.nrj-segmented .section-head { scroll-margin-top: 120px; }
  body.nrj-segmented main.page > .grid-2,
  body.nrj-segmented main.page > section:not(.page-hero) { padding-top: 8px; }
  /* „Kalendarz" segtab już nazywa ten widok — nagłówek „Nadchodzące wydarzenia" jest
     zbędny (w appce go nie ma) i to on chował się pod paskiem. */
  body.nrj-segmented .calendar-layout > section > .section-head:first-child { display: none; }

  /* Karty wydarzeń: zdjęcie wypełnia kadr (cover), nie „pływa" na tle z marginesem */
  body.nrj-mobile-app .event-card-v2 { display: block; }
  body.nrj-mobile-app .event-card-v2-media {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0;
  }
  body.nrj-mobile-app .event-card-v2-media img {
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
  body.nrj-mobile-app .event-card-v2-body { min-height: 0; padding: 14px 16px; }
  body.nrj-mobile-app .event-card-v2-title { font-size: 18px; }

  /* ====== Ekran logowania / rejestracji: mieści się w wąskim ekranie, Google nie wychodzi
     poza kartę, pola i przyciski jak w appce. ====== */
  body.nrj-mobile-app .login-box { width: calc(100% - 24px); padding: 26px 0 40px; }
  body.nrj-mobile-app .auth-card,
  body.nrj-mobile-app .auth-card.login-box { padding: 24px 18px 28px; }
  body.nrj-mobile-app .login-box h1 { font-size: 26px; margin-bottom: 18px; }
  body.nrj-mobile-app .login-form { gap: 16px; }
  body.nrj-mobile-app .login-field input {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--paper);
    font-size: 16px;
  }
  body.nrj-mobile-app .login-field-password input { padding-right: 46px; }
  body.nrj-mobile-app .login-password-toggle { right: 12px; bottom: 11px; }
  body.nrj-mobile-app .login-row { margin-top: 0; flex-direction: column; align-items: flex-start; gap: 8px; }
  body.nrj-mobile-app .login-links { flex-wrap: wrap; }
  body.nrj-mobile-app .social-login-group { gap: 10px; align-items: stretch; }
  body.nrj-mobile-app .social-login-group .g_id_signin {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    justify-content: center;
  }
  body.nrj-mobile-app .social-login-group .g_id_signin > div,
  body.nrj-mobile-app .social-login-group .g_id_signin iframe { margin: 0 auto !important; }
  body.nrj-mobile-app .social-login-btn { width: 100%; box-sizing: border-box; }
}

/* ====== Desktop / tablet: powłoka mobilna całkowicie nieaktywna ====== */
@media (min-width: 769px) {
  .nrj-appheader, .nrj-tabbar, .nrj-drawer, .nrj-scrim,
  .nrj-appbar, .nrj-segtabs, .nrj-apppop, .nrj-apppop-scrim { display: none !important; }
  /* podpis gmina/miejscowość przy nekrologu — tylko w mobilnej powłoce */
  .obituary-miejsce, .t-obit-miejsce { display: none; }
}
