/* Publikacja — SZCZEGÓŁ ogłoszenia nowego wyglądu (etap E2, plan SAAS/PLAN_PUBLIKACJA_BUDOWA.md §2b, §6; makieta 2 v5:
 * SAAS/makiety/publikacja.html + publikacja.css „SZCZEGÓŁ”). Kolory WYŁĄCZNIE z tokenów shared/wyglad.css (oba motywy).
 * Miejsce panelu w układzie (obok listy ≥ 1024, pełny ekran < 1024) daje lista.css; tu wnętrze: nagłówek, karty działów,
 * przełącznik platformy, znacznik, pola z „Kopiuj”, wersje opisu, hasztagi, kategoria, okno kategorii, usuwanie.
 * Zdjęcia (koszyk, półki, narzędzia) zostają na starych klasach strony — ich wygląd zmienia E3. */

#detail-panel:not(.empty) { background: var(--bg); display: block; }
.szcz-glowa { position: sticky; top: 0; z-index: 10; display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px 12px;
  background: var(--surface-1); border-bottom: 1px solid var(--border); }
.szcz-glowa .naglowek-tekst { flex: 1; min-width: 0; }
.szcz-glowa h2 { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.szcz-glowa h2:focus { outline: none; }
.szcz-glowa .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.szcz-tresc { padding: 4px 16px 24px; }
#detail-panel .cicho { color: var(--muted); }
#detail-panel .powod { font-size: 12.5px; color: var(--muted); }
#detail-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* działy = OSOBNE KARTY (uwaga operatora 2026-10-03 13:24: „działy się zlewają”) */
.sekcja { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-top: 14px; box-shadow: var(--shadow); }
.sekcja > h3 { font-size: 16px; margin: -14px -14px 12px; padding: 11px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); border-radius: 14px 14px 0 0; background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.sekcja > h3.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; padding: 0; border: 0; box-shadow: none; }
.sekcja > h3 .cicho { font-size: 13px; font-weight: 400; }

/* przełącznik platformy NA GÓRZE (E7) */
.platformy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); }
.platformy label { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 0 8px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: center; position: relative; }
.platformy input { position: absolute; opacity: 0; pointer-events: none; }
.platformy label:has(input:checked) { background: var(--surface-1); color: var(--text); box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 14%, transparent); }
.platformy label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.platformy svg { width: 14px; height: 14px; color: var(--green-text); }

/* znacznik „wystawione” (E10) */
.wystawione { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.wystawione b { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.wystawione b.ok { color: var(--green-text); }
.wystawione b svg { width: 16px; height: 16px; }
.wystawione small { display: block; width: 100%; font-size: 12.5px; color: var(--muted); }
.powod-w-toku { display: block; width: 100%; font-size: 12.5px; color: var(--warn-text); }

/* zdjęcia (E3, PU11–PU14, PU20–PU21): siatka z numerami w kolejności wystawiania, narzędzia wybranego zdjęcia, pominięte */
.zdj-info { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.zdj-w-toku { color: var(--warn-text); }
.zdj-dokoncz { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 10px 8px 12px; margin-bottom: 10px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.zdj-dokoncz p { flex: 1 1 200px; color: var(--muted); }
.zdj-siatka { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kafel { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); padding: 0; cursor: pointer;
  background: var(--pod-podgladem, var(--surface-3)); }
.kafel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.kafel[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 1px; }
.kafel:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kafel.poza img { opacity: .55; }
/* plakietki leżą NA ZDJĘCIU — stałe kolory na ciemnym półprzezroczystym tle (jak w makiecie), nie tokeny motywu */
.kafel .podpis { position: absolute; left: 5px; bottom: 5px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
  background: rgba(10, 12, 18, .66); color: #fff; max-width: calc(100% - 10px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kafel .podpis.poza { background: #6b4b06; }
.kafel .numer { position: absolute; right: 5px; top: 5px; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; display: grid;
  place-items: center; border-radius: 20px; background: rgba(255, 255, 255, .85); color: #141926; }
.kafel .glowne-znak { position: absolute; left: 5px; top: 5px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 20px;
  background: rgba(10, 12, 18, .66); color: #FFD66B; }
.kafel .glowne-znak svg { width: 13px; height: 13px; }
.narzedzia-zdj { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 8px; }
.narzedzia-zdj .kt { font-size: 13px; font-weight: 600; }
.narzedzia-zdj .rzad-przyciskow { display: flex; flex-wrap: wrap; gap: 6px; }
.narzedzia-zdj .rzad-przyciskow:empty { display: none; }
.narzedzia-zdj .btn[hidden] { display: none; }    /* „Wygeneruj jeszcze raz” tylko przy zdjęciu AI — .btn ustawia display */
.narzedzia-zdj .btn .ikona { width: 15px; height: 15px; }
#zdj-pominiete:not(:empty) { margin-top: 10px; display: grid; gap: 8px; }
.zdj-pom-tytul { font-size: 13px; color: var(--muted); }
.zdj-pom-lista { display: flex; flex-wrap: wrap; gap: 8px; }
.zdj-pom { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.zdj-pom img { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; }
.sekcja-foto #detail-style-info { padding: 8px 0 0; font-size: 12px; color: var(--muted); }
.narzedzia-foto { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.stan-narzedzia { font-size: 12.5px; color: var(--green-text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* podgląd na pełnym ekranie (PU21): duże zdjęcie, strzałki, narzędzia przeniesione ze szczegółu */
body[data-otwarte="foto"] .tlo-nakladki { display: block; }
body[data-otwarte="foto"] #o-foto { display: flex; }
#o-foto.nakladka { inset: 0; top: 0; left: 0; right: 0; bottom: 0; transform: none; width: auto; max-height: none; height: 100%; border-radius: 0; }
#o-foto .nakladka-glowa::before { display: none; }
.foto-duze { flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; }
.foto-duze img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; background: var(--pod-podgladem, var(--surface-3)); min-height: 200px; }
.foto-stopka { display: block; overflow-y: auto; max-height: 46%; }
.foto-stopka .narzedzia-zdj { margin-top: 0; }

/* teksty z „Kopiuj” (PU4) */
.pole-kopia { margin-top: 12px; }
.pole-kopia-glowa { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pole-kopia-glowa b { font-size: 13.5px; }
.pole-kopia-glowa small { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.btn-kopiuj { display: inline-flex; align-items: center; gap: 6px; }
.btn-kopiuj .ikona { width: 16px; height: 16px; }
#detail-panel .tekst { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px;
  max-width: 70ch; white-space: pre-line; overflow-wrap: anywhere; color: var(--text); }
.pole-tytul .tekst { font-weight: 600; }
.pusto-pola { font-size: 13.5px; color: var(--muted); padding: 8px 0; }
.blad-pola { font-size: 13.5px; color: var(--danger-text); padding: 8px 0; }
.wiersz-akcji { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.wiersz-akcji p { flex: 1 1 200px; }

/* wersje opisu (PU7) i hasztagi (PU8) */
.wersje { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border); margin: 2px 0 8px; }
.wersje label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; position: relative; }
.wersje input { position: absolute; opacity: 0; pointer-events: none; }
.wersje label:has(input:checked) { background: var(--surface-1); color: var(--text); box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 14%, transparent); }
.wersje label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.wersje small { font-weight: 400; color: var(--green-text); }
.tagi { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 10px; border-radius: 20px; border: 1px solid var(--border-2);
  background: var(--surface-1); font-size: 13.5px; min-height: 30px; color: var(--text); }
.tag:not(:has(button)) { padding-right: 10px; }
.tag button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 20px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.tag button:hover { background: var(--surface-3); color: var(--text); }
.tag button svg { width: 13px; height: 13px; }

/* kategoria (PU10) */
.kategoria { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); }
.kategoria .sciezka { font-size: 14px; overflow-wrap: anywhere; }
.kategoria small { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }

/* maszynownia operatora (rysowana tylko w widoku pełnym) */
.maszynownia { border-style: dashed; }
.wiersz-op { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; margin-top: 8px; }
.wiersz-op input { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 5px 8px; width: 110px; margin-left: 6px; }

/* usuwanie — na końcu, czerwone, z oknem (D6, D14) */
.usun-wpis { margin-top: 18px; padding: 18px 0 8px; border-top: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.usun-wpis p { font-size: 12.5px; color: var(--muted); flex: 1 1 200px; }

/* okno kategorii (jedna odmiana okna — D14; arkusz z dołu < 1024 z lista.css) */
body[data-otwarte="kategoria"] .tlo-nakladki { display: block; }
body[data-otwarte="kategoria"] #o-kategoria { display: flex; }
#o-kategoria .pub-szukaj { position: relative; }
#o-kategoria .pub-szukaj input { font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 7px 10px 7px 34px; min-height: 36px; width: 100%; }
#o-kategoria .pub-szukaj svg { position: absolute; left: 10px; top: 50%; margin-top: -8px; width: 16px; height: 16px; color: var(--muted); }
.okruszki { font-size: 13.5px; color: var(--muted); }
.lista-kat { display: grid; gap: 6px; }
.lista-kat button { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: inherit; font-size: 14px; text-align: left;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; min-height: 40px; }
.lista-kat button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.lista-kat button small { color: var(--muted); font-weight: 400; }
.nakladka-stopka { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }

/* telefon i tablet pionowo: szczegół na pełnym ekranie — „Wróć” w nagłówku */
.szcz-wroc { display: none; }
@media (max-width: 1023.98px) {
  .szcz-wroc { display: inline-grid; place-items: center; flex: none; }
  .szcz-tresc { padding: 4px 12px calc(24px + env(safe-area-inset-bottom)); }
}
@media (min-width: 600px) and (max-width: 1023.98px) {
  .zdj-siatka { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* telefon: narzędzia zdjęcia tylko w podglądzie na pełnym ekranie (stuknięcie w kafel go otwiera) */
@media (max-width: 599.98px) {
  .sekcja-foto > .narzedzia-zdj { display: none; }
  .foto-duze { grid-template-columns: minmax(0, 1fr); position: relative; }
  /* E125 (D-2, operator 2026-10-16 „1tak”): strzałki NA zdjęciu, pole 44 px (G-01: sąsiadem jest zdjęcie, nie przycisk);
     do tego przesunięcie palcem (`publikacja.js`, podgląd). Dawniej `display: none` — sąsiednie zdjęcie tylko przez kafel. */
  .foto-duze .strzalka { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 44px; height: 44px;
    border-radius: 50%; background: var(--surface-1); border: 1px solid var(--border); }
  .foto-duze #foto-poprz { left: 20px; }
  .foto-duze #foto-nast { right: 20px; }
  .foto-duze .strzalka:disabled { opacity: .35; }
  .foto-duze img { max-height: 46vh; }
}

/* dotyk: cel ≥ 44 px (Z3, G-01) */
@media (pointer: coarse) {
  #detail-panel .btn, .platformy label, .wersje label, .lista-kat button, .nakladka-stopka .btn, #o-foto .btn { min-height: 44px; }
  #detail-panel .btn, #o-foto .btn { min-width: 44px; }
  /* G-01 (dawca MPE): w gęstym rzędzie narzędzi pole NIE rośnie na sąsiada (::after kradłby mu środek) — rośnie sam przycisk */
  .narzedzia-zdj .rzad-przyciskow { gap: 8px; }
  .kafel { min-height: 44px; min-width: 44px; }
  .zdj-pom img { width: 44px; height: 44px; }
  .tag { min-height: 44px; }
  .tag button { width: 44px; height: 44px; }
  .wiersz-op input, #o-kategoria .pub-szukaj input { min-height: 44px; font-size: 16px; }
}

/* E4-0: karta stanu zamówienia sprzed odświeżenia (publikacja.js `_zamStanSzczegolu`) */
.zam-stan { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.zam-stan[hidden] { display: none; }
.zam-stan-tytul { font-size: 14px; margin: 0 0 6px; color: var(--text); }
.zam-stan-lista { margin: 0 0 8px; padding-left: 18px; font-size: 14px; color: var(--text); display: grid; gap: 4px; }
