/* Inter u nas, nie z fonts.googleapis.com. Krój ZMIENNY - jeden plik na cala oś
   grubosci, wiec piec wag panelu kosztuje tyle co jedna. Polskie znaki siedza
   WYLACZNIE w `latin-ext`; `ó` jest w `latin`, wiec brak drugiego pliku widac
   dopiero na „ą/ł/ż”. Pliki generuje `fonty/` - patrz komentarz w inter.css. */
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('/fonty/Inter-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('/fonty/Inter-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}

:root {
  /* Skala typograficzna. Bylo 20 rozmiarow, w tym cztery pary rozne o pol
     piksela - roznica niewidoczna, ale utrzymywana. Siedem stopni wystarcza na
     caly panel; nowy komponent wybiera stopien, nie wymysla liczby.
     --f7 jest zdefiniowany dla kompletu skali, na razie bez uzycia. */
  --f1: 11px;    /* podpisy nawigacji, znaczniki, drobne metki */
  --f2: 12.5px;  /* metadane kart, pastylki, przyciski drugorzedne */
  --f3: 14px;    /* tekst wlasciwy, pola formularzy, tresc postow */
  --f4: 16px;    /* wieksze pola i tresc wyrozniona */
  --f5: 20px;    /* naglowki widokow */
  --f6: 25px;    /* liczby na kafelkach kokpitu */
  --f7: 32px;

  /* Promienie. Bylo 11 wartosci przy dwoch zdefiniowanych tokenach - sasiadujace
     elementy mialy rogi 7, 8 i 9 px. Trzy stopnie plus pastylka. */
  --r-sm: 6px;    /* metki, male pastylki, ikony */
  --r-md: 10px;   /* pola, przyciski, kafelki wewnetrzne */
  --r-lg: 16px;   /* karty i okna */
  --r-pill: 999px;

  --bg: #0a0b0f;
  --sidebar-bg: #0d0f15;
  --card: #13151c;
  --card-2: #171a23;
  /* DWIE obwodki, nie jedna. `--border` jest DEKORACYJNA: rozdzielacze, subtelne
     ramki kart, siatki. Ma kontrast 1,19:1 wobec karty i tak ma zostac - jej
     zadaniem jest ledwie zaznaczyc podzial.
     `--line-control` jest FUNKCJONALNA: to jedyna rzecz, ktora pokazuje, gdzie
     zaczyna sie pole tekstowe, lista rozwijana czy pastylka. Norma dla granic
     kontrolek to 3:1 i ten kolor ja spelnia na wszystkich trzech tlach
     (karta 3,38:1 · karta-2 3,22:1 · tlo strony 3,45:1). */
  --border: #22252f;
  --border-soft: #1a1c25;
  --line-control: #656a7a;
  --text: #eef0f3;
  --muted: #8b8f9c;
  /* Podniesione z #5f6371 (~3,2:1): ten kolor niesie tresc - numery dni
     w kalendarzu, podpowiedzi pod polami, stopke. */
  --muted-2: #7c8290;
  --accent: #9061F9;
  --accent-2: #6B77F5;
  --accent-soft: rgba(144, 97, 249, 0.14);
  --accent-text: #c3b3ff;
  --ok: #35d187;
  /* Napis na PELNYM zielonym tle. W ciemnym motywie zielen jest jasna,
     wiec tekst musi byc ciemny; w jasnym odwrotnie. Bez tego tokenu
     przycisk „Zaakceptuj" miewalby biale litery na jasnej zieleni. */
  --ok-tekst: #06231a;
  --ok-soft: rgba(53, 209, 135, 0.14);
  --warn: #f5b93d;
  --warn-soft: rgba(245, 185, 61, 0.14);
  --err: #ff6669;
  --err-soft: rgba(255, 102, 105, 0.14);
  --fail: #ff9142;
  --fail-soft: rgba(255, 145, 66, 0.16);
  --info: #4fb8f0;
  --info-soft: rgba(79, 184, 240, 0.14);
  --shadow: 0 8px 24px -8px rgba(0,0,0,.45);
  --shadow-sm: 0 2px 8px -2px rgba(0,0,0,.3);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f8; --sidebar-bg: #ffffff; --card: #ffffff; --card-2: #f8f9fb;
    --border: #e6e8ee; --border-soft: #eef0f4; --text: #14161c; --muted: #5c6270;
    /* Bylo #767c8a: 4,18:1 na karcie i 3,84:1 na tle strony, czyli ponizej progu
       4,5:1 dla tekstu. Ten kolor niesie numery dni w kalendarzu i podpowiedzi
       pod polami. Teraz 5,18:1 / 4,75:1. */
    --muted-2: #676d7c;
    --line-control: #878b99;
    /* Bylo #9061F9 (dziedziczone z ciemnego motywu): biały napis na tym fioleti
       to 3,99:1, a fiolet jako tekst na bieli tyle samo. #7c4fe0 daje 5,18:1
       i jest tym samym fioletem, tylko ciemniejszym - marka sie nie zmienia. */
    --accent: #7c4fe0;
    --accent-soft: rgba(144, 97, 249, 0.09); --accent-text: #7c4fe0;
    --ok-soft: rgba(20, 170, 100, 0.1); --warn-soft: rgba(200, 140, 0, 0.1);
    --err-soft: rgba(220, 50, 55, 0.1); --info-soft: rgba(20, 130, 200, 0.1);
    --fail: #a25a06; --fail-soft: rgba(200, 114, 10, 0.1);
    /* Motyw jasny nadpisywal TLA statusow, ale nie kolory tekstu - zielony
       #35d187 i zolty #f5b93d na bialej karcie daja kontrast okolo 2:1, czyli
       ponizej czytelnosci. Te warianty sa przyciemnione do poziomu, ktory czyta
       sie na bieli; w ciemnym motywie zostaja jasne oryginaly. */
    /* --ok bylo #0f8a55 = 4,39:1, tuz pod progiem. #0e8050 daje 4,97:1 na karcie
       i 4,56:1 na tle strony. Pozostale trzy byly juz w normie. */
    --ok: #0e8050; --ok-tekst: #ffffff; --warn: #8a6100; --info: #0d6fa8; --err: #c62828;
    --shadow: 0 8px 24px -10px rgba(20,22,30,.15); --shadow-sm: 0 2px 10px -4px rgba(20,22,30,.1);
  }
}
* { box-sizing: border-box; }
/* Atrybut `hidden` MUSI wygrywac z klasa. Regula przegladarki
   (`[hidden] { display: none }`) siedzi w arkuszu uzytkownika, wiec KAZDA nasza
   klasa z wlasnym `display` ja przebija - element z `hidden` byl widoczny mimo
   wszystko. Tak dzialo sie z paskiem niezapisanych zmian (`display: flex`):
   `pasek.hidden = true` w JS nie ukrywalo go wcale. */
[hidden] { display: none !important; }
/* clip zamiast hidden: "overflow: hidden" na html/body robi z nich pojemniki
   przewijania, przez co Safari na iOS przejmuje przewijanie i gubi natywny ped
   (a wraz z nim plynnosc 120 Hz). "clip" tylko przycina, nie tworzy scrollera. */
html, body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01' 1;
}
h1, h2, h3 { margin: 0 0 .4em; letter-spacing: -0.01em; }
h2 { font-size: var(--f5); font-weight: 700; }
h3 { font-size: var(--f3); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.history-details { margin-top: 16px; }
.history-details summary {
  font-size: var(--f3); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; user-select: none;
}
.history-details summary::-webkit-details-marker { display: none; }
.history-details summary::before { content: '▸'; font-size: var(--f1); transition: transform .15s ease; color: var(--muted-2); }
.history-details[open] summary::before { transform: rotate(90deg); }
.history-details[open] summary { margin-bottom: 8px; }
a { color: var(--accent-text); text-decoration: none; }
p { line-height: 1.55; }

/* ---------- Shell / nav ---------- */

.app-shell { display: flex; min-height: 100vh; }

.app-nav {
  position: fixed; top: 0; left: 0; bottom: 0; width: 232px;
  background: var(--sidebar-bg); border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; padding: 20px 14px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; display: block; }
.brand-name { font-weight: 800; font-size: var(--f3); line-height: 1.15; }
.brand-name span { display: block; font-weight: 500; font-size: var(--f1); color: var(--muted-2); letter-spacing: .03em; }

.nav-links { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-sm);
  background: none; border: none; color: var(--muted); font-size: var(--f3); font-weight: 500;
  cursor: pointer; text-align: left; transition: background .15s ease, color .15s ease; position: relative;
  font-family: inherit;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label-short { display: none; }
.nav-link:hover { background: var(--card-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-badge {
  position: absolute; top: 4px; right: 10px; background: var(--err); color: #fff; font-style: normal;
  font-size: var(--f1); font-weight: 700; border-radius: var(--r-pill); padding: 1px 5px; line-height: 1.5; min-width: 15px; text-align: center;
}
@media (max-width: 880px) {
  .nav-badge { top: 2px; right: 16px; }
}
.nav-footer { font-size: var(--f1); padding: 8px 12px 2px; color: var(--muted-2); }

.main-col { margin-left: 232px; flex: 1; min-width: 0; }
main#app { max-width: 1080px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 28px 60px; }

@media (max-width: 880px) {
  .app-nav {
    top: auto; right: 0; flex-direction: row; align-items: center; width: auto;
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 0 6px calc(env(safe-area-inset-bottom)) 6px; border-right: none; border-top: 1px solid var(--border-soft);
    box-shadow: 0 -4px 16px rgba(0,0,0,.25);
  }
  .brand, .nav-footer { display: none; }
  .nav-links { flex-direction: row; flex: 1; justify-content: space-around; align-items: stretch; }
  .nav-link {
    flex: 1; min-width: 0; max-width: 84px;
    flex-direction: column; align-items: center; justify-content: flex-start;
    gap: 3px; font-size: var(--f1); padding: 7px 3px;
  }
  .nav-link svg { margin: 0 auto; }
  /* Podpisy mialy 9,5 px i zawijaly sie do dwoch linii - mniejsze pismo niz
     gdziekolwiek indziej w panelu, w miejscu czytanym najczesciej. Teraz 11 px
     (--f1) w JEDNEJ linii; zamiast zawijac, skracamy same slowa w HTML
     (`nav-label-short`). Krotsze slowo czyta sie szybciej niz dluzsze w dwoch
     liniach. `nowrap` pilnuje, zeby zawijanie nie wrocilo tylnymi drzwiami. */
  .nav-link span {
    display: block; width: 100%; text-align: center; white-space: nowrap;
    line-height: 1.2; overflow: hidden; text-overflow: ellipsis;
  }
  .nav-link .nav-label-full { display: none; }
  .nav-link .nav-label-short { display: block; }
  .main-col { margin-left: 0; }
  main#app { padding: calc(16px + env(safe-area-inset-top)) 14px calc(78px + env(safe-area-inset-bottom)); }
  button.primary, button.secondary, button.danger, button.ok, button.revise { min-height: 44px; }
}

/* ---------- Skeleton loaders ---------- */

@keyframes skel-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skel {
  background: linear-gradient(90deg, var(--card-2) 25%, var(--border-soft) 37%, var(--card-2) 63%);
  background-size: 400% 100%; animation: skel-shimmer 1.4s ease infinite; border-radius: var(--r-sm);
}
.skel-line { height: 14px; margin-bottom: 10px; }
.skel-card { height: 78px; margin-bottom: 12px; border-radius: var(--r-lg); }
.skel-tile { height: 74px; border-radius: var(--r-lg); }
.skel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 880px) { .skel-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Generic building blocks ---------- */

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); position: relative;
}
.overdue-card { border-color: var(--err); }
.overdue-tag { color: var(--err); font-weight: 700; }
/* Top-LEFT, with identical top/left insets so it reads as a deliberate corner
   mark rather than floating. The review card reserves a band for it (see
   .review-card below) so it never sits on top of the post thumbnail. */
.heart-like {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-control);
  background: var(--card); color: var(--muted); font-size: var(--f4); line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: border-color .2s ease, background-color .2s ease, transform .12s ease;
}
/* Both glyphs occupy the same cell; only opacity/scale animate, so the fill
   grows out of the outline instead of snapping between two characters. */
.heart-like .h-outline, .heart-like .h-fill {
  grid-area: 1 / 1; display: block; line-height: 1;
  transition: opacity .22s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.heart-like .h-fill { color: var(--accent); opacity: 0; transform: scale(.4); }
.heart-like.liked .h-fill { opacity: 1; transform: scale(1); }
.heart-like.liked .h-outline { opacity: 0; transform: scale(1.35); }
.heart-like:hover { border-color: var(--accent); color: var(--accent-text); }
.heart-like:active { transform: scale(0.92); }
.heart-like.liked { border-color: var(--accent); background: var(--accent-soft); }
.heart-like[disabled] { cursor: default; }
/* One short bounce on the button itself, only when switching ON. */
.heart-like.pop { animation: heart-pop .32s ease; }
@keyframes heart-pop {
  0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .heart-like, .heart-like .h-outline, .heart-like .h-fill { transition-duration: .01ms; }
  .heart-like.pop { animation: none; }
}
/* Reserve the corner band so the heart has its own space above the post row. */
.review-card { padding-top: 56px; }
.modal .heart-like { position: static; margin-left: 10px; }

/* Thumbs sit beside the heart but mean something different: the heart is
   aspirational ("more like this"), the thumbs are a verdict on THIS post and
   are deliberately independent of approve/reject - a post can ship and still
   be marked bad. Offset by the heart's 34px + a 10px gap. */
.signal-thumbs {
  position: absolute; top: 12px; left: 56px; z-index: 2;
  display: flex; gap: 6px;
}
.thumb-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-control);
  background: var(--card); color: var(--muted); font-size: var(--f3); line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .12s ease;
}
.thumb-btn:active { transform: scale(0.92); }
/* Ikona dziedziczy kolor przycisku (stroke: currentColor), wiec stan
   wcisniety maluje takze kreske - emoji tego nie potrafilo. */
.thumb-btn svg { display: block; pointer-events: none; }
.thumb-btn[disabled] { cursor: default; opacity: .6; }
/* Kolorowa obwodka wylacznie dla oceny wcisnietej - inaczej nie da sie jednym
   spojrzeniem odczytac stanu. Hover tylko rozjasnia tlo i tylko tam, gdzie
   kursor naprawde istnieje: na dotyku :hover zostaje przyklejony po tapnieciu
   i nieoceniony kciuk wygladalby jak wybrany. */
@media (hover: hover) {
  .thumb-btn:hover { background: var(--border-soft); color: var(--text); }
}
.thumb-btn.up.on { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.thumb-btn.down.on { border-color: var(--err); background: var(--err-soft); color: var(--err); }
.thumb-btn.on { animation: thumb-pop .3s ease; }
@keyframes thumb-pop {
  0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); }
}
/* W modalu serduszko i kciuki musza siedziec w jednym rzedzie flex.
   .heart-like ma display:grid, czyli jest blokiem - samo "position: static"
   dawalo mu wlasny wiersz, a kciuki spadaly obok. Rzad jest tez clearfixem dla
   .close (float: right), zeby przyciski nie oplywaly krzyzyka. */
.modal .signal-row {
  display: flex; align-items: center; gap: 8px;
  clear: both; padding-top: 4px; margin-bottom: 10px;
}
.modal .signal-row .heart-like { position: static; margin-left: 0; }
.modal .signal-thumbs { position: static; display: flex; margin-left: 0; }
@media (prefers-reduced-motion: reduce) {
  .thumb-btn { transition-duration: .01ms; }
  .thumb-btn.on { animation: none; }
}
.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-header h2 { margin: 0; }
.page-sub { color: var(--muted); font-size: var(--f2); margin-top: 2px; }

label { display: block; font-size: var(--f2); font-weight: 600; color: var(--muted); margin: 14px 0 5px; }
input[type=text], input[type=url], input[type=number], input[type=time], input[type=date], input[type=search], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-control);
  background: var(--card-2); color: var(--text); font-size: var(--f4); font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* 16px is deliberate, not a design choice - iOS Safari auto-zooms the whole
   page on focus for any text input under 16px, which then leaves the page
   pannable/zoomed until the user manually pinches back out. Never go below
   16px on a focusable text field, on any screen size. */
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Pola czasu i daty rysuje na iOS silnik systemowy: nasz padding DOKLADA sie do
   jego wlasnej wysokosci kontrolki, a wartosc jest centrowana. Obok pola
   liczbowego w tej samej karcie wyglada to jak inny komponent — wyzsze,
   szersze i z tekstem na srodku (zgloszenie operatora: „godzina publikacji ma
   okienko wyzsze i dluzsze od pozostalych"). `appearance: none` oddaje nam
   sterowanie; reszta wyrownuje do reguly wyzej. Ten sam mechanizm byl juz
   opisany przy `.rev-when input[type="datetime-local"]` — tam dotyczyl tylko
   jednego pola, tu dotyczy wszystkich. */
input[type=time], input[type=date], input[type=datetime-local] {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  min-height: 0;
}

textarea { min-height: 76px; resize: vertical; }
select { cursor: pointer; }
.hint { font-size: var(--f2); color: var(--muted-2); margin-top: 5px; line-height: 1.5; }

button { font-family: inherit; }
button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; border: none;
  padding: 11px 20px; border-radius: var(--r-sm); font-size: var(--f3); font-weight: 600; cursor: pointer;
  margin-top: 18px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease;
}
button.primary:hover { box-shadow: 0 6px 18px -4px rgba(144,97,249,.5); transform: translateY(-1px); }
button.primary:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
button.secondary {
  background: var(--card-2); border: 1px solid var(--line-control); color: var(--text);
  padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--f2); font-weight: 500;
  transition: background .15s ease, border-color .15s ease;
}
button.secondary:hover { background: var(--border-soft); border-color: var(--muted-2); }
button.secondary.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
button.icon-btn {
  background: var(--card-2); border: 1px solid var(--line-control); color: var(--text); width: 34px; height: 34px;
  border-radius: var(--r-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--f4); transition: background .15s ease;
}
button.icon-btn:hover { background: var(--border-soft); }
button.danger, button.ok, button.revise {
  padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--f2); font-weight: 600;
  border: 1px solid transparent; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
button.danger { background: var(--err-soft); color: var(--err); }
button.danger:hover { background: var(--err); color: #fff; }
button.ok { background: var(--ok-soft); color: var(--ok); }
button.ok:hover { background: var(--ok); color: #06231a; }
button.revise { background: var(--accent-soft); color: var(--accent-text); }
button.revise:hover { background: var(--accent); color: #fff; }
button.danger:disabled, button.ok:disabled, button.revise:disabled { opacity: .5; cursor: default; }

.multi-row { display: flex; gap: 8px; margin-bottom: 6px; }
.multi-row input { flex: 1; }

/* ---------- Segmented control (view switcher) ---------- */

.segmented {
  display: flex; background: var(--card-2); border: 1px solid var(--line-control); border-radius: var(--r-sm);
  padding: 3px; gap: 2px; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.segmented button {
  background: none; border: none; color: var(--muted); font-size: var(--f2); font-weight: 600; padding: 7px 13px;
  border-radius: var(--r-sm); cursor: pointer; transition: background .15s ease, color .15s ease; white-space: nowrap;
  flex-shrink: 0;
}
.segmented button.active { background: var(--accent); color: #fff; }
.segmented button:not(.active):hover { color: var(--text); }

/* ---------- Status badges ---------- */

.status-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: var(--r-pill);
  font-size: var(--f2); font-weight: 600; white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-DRAFT { background: var(--border-soft); color: var(--muted); }
.status-REVIEW { background: var(--warn-soft); color: var(--warn); }
.status-APPROVED { background: var(--ok-soft); color: var(--ok); }
.status-SCHEDULED { background: var(--ok-soft); color: var(--ok); }
.status-PUBLISHED { background: var(--info-soft); color: var(--info); }
.status-REJECTED { background: var(--err-soft); color: var(--err); }
.status-ERROR { background: var(--fail-soft); color: var(--fail); }

.swatch.status-DRAFT { background: var(--muted); }
.swatch.status-REVIEW { background: var(--warn); }
.swatch.status-APPROVED, .swatch.status-SCHEDULED { background: var(--ok); }
.swatch.status-PUBLISHED { background: var(--info); }
.swatch.status-REJECTED { background: var(--err); }
.swatch.status-ERROR { background: var(--fail); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: var(--f2); color: var(--muted); }

/* ---------- Stat tiles ---------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px;
  cursor: pointer; transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.stat-tile:hover { background: var(--card-2); transform: translateY(-1px); }
/* Obwodka kafelka z WLACZONYM filtrem. Wczesniej byla to kreska accentu
   podwojona cieniem `0 0 0 1px` w tym samym kolorze - razem twardy pierscien
   ~2 px, ktory przy sasiadach w miekkim `--border` wygladal jak usterka
   renderowania, a nie jak stan. Zostaje jedna kreska + delikatna poswiata,
   dokladnie tak jak przy polach formularza i `.prod-current`. */
.stat-tile.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stat-tile .num { font-size: var(--f6); font-weight: 800; letter-spacing: -0.02em; }
.stat-tile .lbl { font-size: var(--f2); color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ---------- Toolbar (brand select + date nav) ---------- */

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 160px; max-width: 100%; }
/* Etykieta w pasku narzedzi stoi OBOK pola, nie nad nim - globalna regula
   `label` jest blokowa i z marginesem 14 px, co rozbijaloby pasek na dwa rzedy. */
.toolbar-label { display: inline; margin: 0; font-size: var(--f2); color: var(--muted); white-space: nowrap; }
.date-nav { display: flex; align-items: center; gap: 4px; }
.date-nav strong { font-size: var(--f3); min-width: 148px; text-align: center; font-weight: 700; }

/* ---------- Month grid ---------- */

.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.grid .dow { text-align: center; font-size: var(--f1); font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 2px; }
.day-cell {
  border: 1px solid var(--border); border-radius: var(--r-sm); min-height: 96px; padding: 7px;
  background: var(--card); transition: border-color .15s ease;
}
.day-cell.empty { border: none; background: none; }
.day-cell.today { border-color: var(--accent); }
.day-cell .daynum { color: var(--muted-2); font-size: var(--f1); font-weight: 700; margin-bottom: 5px; }
.day-cell.today .daynum { color: var(--accent-text); }
.post-chip {
  border-radius: var(--r-sm); padding: 4px 6px; margin-bottom: 4px; cursor: pointer; font-size: var(--f1);
  line-height: 1.35; font-weight: 600; border-left: 2.5px solid currentColor; transition: transform .1s ease;
}
.post-chip:hover { transform: translateX(1px); }
.post-chip.status-DRAFT { background: var(--border-soft); color: var(--muted); }
.post-chip.status-REVIEW { background: var(--warn-soft); color: var(--warn); }
.post-chip.status-APPROVED, .post-chip.status-SCHEDULED { background: var(--ok-soft); color: var(--ok); }
.post-chip.status-PUBLISHED { background: var(--info-soft); color: var(--info); }
.post-chip.status-REJECTED { background: var(--err-soft); color: var(--err); }
.post-chip.status-ERROR { background: var(--fail-soft); color: var(--fail); }
.more-chip { font-size: var(--f1); color: var(--muted-2); font-weight: 600; padding: 2px 6px; cursor: pointer; }

.month-fallback { display: none; }
@media (max-width: 880px) {
  .grid { display: none; }
  .month-fallback { display: block; }
}

/* ---------- Week view ---------- */

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-col { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); padding: 10px; min-height: 220px; }
.week-col .wh { font-size: var(--f1); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.week-col.today { border-color: var(--accent); }
.week-col.today .wh { color: var(--accent-text); }

/* Kafelek z miniatura. Kolumna tygodnia jest waska, wiec obrazek idzie nad
   tekstem i zajmuje jej cala szerokosc. Staly stosunek 4:3 daje rowna siatke
   niezaleznie od tego, czy post ma format 1:1, 4:5 czy pionowe story. */
.week-chip { display: flex; flex-direction: column; gap: 3px; padding: 5px; }
.week-thumb {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--r-sm); background: var(--border-soft);
}
/* Post bez grafiki dostaje pole w tym samym miejscu — inaczej kafelki w rzedzie
   mialyby rozne wysokosci i dzien wygladalby na krotszy, niz jest. */
.week-thumb.brak { border: 1px dashed var(--border); }
.week-czas { font-size: var(--f1); opacity: .85; }
/* Tytul do dwoch linii; dluzszy ucinamy wielokropkiem, calosc jest w title. */
.week-tytul {
  font-weight: 600; font-size: var(--f1); line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 880px) {
  .week-grid { display: flex; flex-direction: column; }
}

/* ---------- Quarter view ---------- */

.quarter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini-month { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); padding: 14px; }
.mini-month h3 { cursor: pointer; margin-bottom: 10px; }
.mini-month h3:hover { color: var(--accent-text); }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mini-grid .mdow { font-size: var(--f1); text-align: center; color: var(--muted-2); font-weight: 700; }
.mini-day {
  aspect-ratio: 1; border-radius: var(--r-sm); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: var(--f1); color: var(--muted-2); cursor: pointer;
}
.mini-day:hover { background: var(--card-2); }
.mini-day .dots { display: flex; gap: 2px; height: 4px; }
.mini-day .mdot { width: 4px; height: 4px; border-radius: 50%; }

.mini-month.standalone { padding: 10px; }
.mini-month.standalone .mini-grid { gap: 5px; }
.mini-month.standalone .mini-grid .mdow { font-size: var(--f1); padding-bottom: 3px; }
.mini-month.standalone .mini-day { font-size: var(--f3); font-weight: 600; border-radius: var(--r-md); }
.mini-month.standalone .mini-day .dots { height: 6px; gap: 3px; }
.mini-month.standalone .mini-day .mdot { width: 6px; height: 6px; }
@media (max-width: 880px) { .quarter-grid { grid-template-columns: 1fr; } }

/* ---------- List / row views ---------- */

.day-group { margin-bottom: 18px; }
.day-group h3 { font-size: var(--f2); border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; margin-bottom: 4px; }
.post-row {
  display: flex; gap: 12px; padding: 11px 6px; border-radius: var(--r-sm); cursor: pointer; align-items: center;
  transition: background .15s ease;
}
.post-row:hover { background: var(--card-2); }
.post-row img.thumb, .post-row .thumb {
  width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-md); background: var(--card-2); flex-shrink: 0;
  border: 1px solid var(--border-soft);
}
.post-row .meta { flex: 1; min-width: 0; }
.post-row .meta .title { font-weight: 600; font-size: var(--f3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-row .meta .sub { font-size: var(--f2); color: var(--muted); margin-top: 2px; }

.rev-commentable {
  border-radius: var(--r-md); padding: 8px 10px; margin: 0 -10px 4px;
  box-shadow: 0 0 0 2px var(--accent-soft); transition: box-shadow .15s ease, background .15s ease;
}
/* Kursor "wskazujacy" tylko tam, gdzie klikniecie cokolwiek robi. Pole
   tekstowe ma wlasny kursor i klikanie w nie nie otwiera juz uwagi. */
.rev-clickable { cursor: pointer; }
@media (hover: hover) {
  .rev-clickable:hover { box-shadow: 0 0 0 2px var(--accent); }
}
.rev-commentable.has-note { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
/* Wlasna poprawka wyglada inaczej niz uwaga dla agenta - to sa dwie rozne
   decyzje i operator musi widziec jednym spojrzeniem, ktora podjal. */
.rev-commentable.has-edit { box-shadow: 0 0 0 2px var(--ok); }
.rev-commentable img { cursor: pointer; }
.rev-note-box { margin-top: 8px; cursor: default; }
.rev-note-box textarea { min-height: 52px; }

.rev-edit { width: 100%; display: block; }
.rev-edit-title { font-size: var(--f4); font-weight: 650; }
.rev-edit-body { min-height: 220px; line-height: 1.5; resize: vertical; }
.rev-note-toggle {
  margin-top: 8px; padding: 5px 10px; font-size: var(--f2); font-weight: 600;
  border-radius: var(--r-pill); border: 1px dashed var(--border);
  background: transparent; color: var(--muted); cursor: pointer;
}
@media (hover: hover) {
  .rev-note-toggle:hover { border-style: solid; color: var(--text); }
}
.rev-commentable.has-note .rev-note-toggle { border-style: solid; color: var(--accent); border-color: var(--accent); }

/* ---------- Modal ---------- */

.modal-backdrop {
  /* Bez backdrop-filter (usuniete 2026-08-05). Rozmycie 2px pod scrimem o
     kryciu 0.72 bylo praktycznie niewidoczne, a kosztowalo przerysowywanie
     calej warstwy przy kazdej klatce przewijania modala - tekst drzal. */
  position: fixed; inset: 0; background: rgba(6,7,10,.72); display: flex;
  align-items: flex-end; justify-content: center; z-index: 100; animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 881px) { .modal-backdrop { align-items: center; } }
.modal {
  background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0; max-width: 640px; width: 100%;
  /* dvh, nie vh: w PWA na iOS wysokosc widoku zmienia sie przy pojawianiu
     klawiatury i paskow systemowych, a 90vh liczone od statycznej wysokosci
     powoduje przeskok ukladu w trakcie przewijania. */
  /* 100% NAKLADKI, nie 90dvh: przy otwartej klawiaturze JS przycina nakladke do
     tego, co realnie widac (patrz `dopasujNakladki`), a modal ma sie w tym
     zmiescic. Przy 90dvh liczonych od pelnego okna wystawal gora nad ekran
     i naglowek chowal sie pod zegarem. */
  max-height: calc(100% - 24px); overflow-y: auto; padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow);
  /* Swiadomie BEZ transform: translateZ(0) i contain: paint. Na iOS promowanie
     przewijanego pojemnika z tekstem do wlasnej warstwy daje efekt odwrotny do
     zamierzonego: tekst laduje w teksturze, a przy pedzie przewijania WebKit
     rasteryzuje go od nowa na ulamkowych pozycjach - i wlasnie to migocze.
     Na desktopie zysk byl niewielki, na iOS koszt duzy.
     -webkit-overflow-scrolling: touch tez usuniete - od iOS 13 nic nie robi. */
  /* Bez tego przewijanie na koncu listy przechodzi na strone pod spodem i
     cala zawartosc wizualnie skacze. */
  overscroll-behavior: contain;
}
/* Strona pod spodem nie moze sie przewijac, kiedy otwarta jest nakladka. */
body.modal-open { overflow: hidden; }
@media (min-width: 881px) { .modal { border-radius: var(--r-lg); } }
.modal img, .modal video { max-width: 100%; border-radius: var(--r-md); margin: 10px 0; border: 1px solid var(--border-soft); }
/* Rolka w oknie posta: wysokosc ograniczona, zeby pionowe 9:16 nie wypychalo
   przyciskow decyzji poza ekran telefonu. */
.modal video { width: 100%; max-height: 60vh; background: #000; display: block; }
.modal .close {
  float: right; background: var(--card-2); border: 1px solid var(--line-control); color: var(--muted); font-size: var(--f3);
  cursor: pointer; width: 30px; height: 30px; border-radius: 50%;
}
/* Wyszukiwarka produktu w modalu posta. Domyslnie widac tylko jedna linie z
   aktualnym produktem (.prod-current wyglada jak dawny <select>); wyszukiwarka
   rozwija sie dopiero po kliknieciu. Panel wchodzi w uklad strony, a nie w
   pozycjonowanie absolutne - modal przewija sie i przycina wszystko, co
   wychodzi poza jego prostokat. */
.prod-current {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-control);
  background: var(--card-2); color: var(--text); font-size: var(--f3); font-family: inherit;
  text-align: left; cursor: pointer; line-height: 1.35;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.prod-current:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prod-current[aria-expanded="true"] { border-color: var(--accent); }
.prod-current[aria-expanded="true"] .prod-caret { transform: rotate(180deg); }
.prod-caret { color: var(--muted); font-size: var(--f2); flex: none; transition: transform .15s ease; }
.prod-panel {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--card-2); padding: 8px; margin-top: 6px;
}
.prod-panel .prod-search { margin: 0 0 8px; background: var(--card); }
.prod-list { max-height: 190px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 3px; }
.prod-item {
  text-align: left; width: 100%; padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: var(--f3); cursor: pointer; line-height: 1.35;
  transition: background .12s ease, border-color .12s ease;
}
@media (hover: hover) { .prod-item:hover { background: var(--border-soft); } }
.prod-item.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.prod-note { padding: 8px 4px 2px; margin: 0; font-size: var(--f2); }

/* Strony nadane przez klienta, ale jeszcze nieprzypisane. To nie jest lista do
   wyboru, tylko wiersz z wlasnym przyciskiem, wiec `prod-item` nie moze tu byc
   klikalnym przyciskiem - stad wariant statyczny bez kursora i podswietlenia. */
.meta-oczekujace { margin-bottom: 14px; }
.meta-oczekujace h3 { margin: 0 0 4px; font-size: var(--f3); }
.meta-oczekujace p { margin: 0 0 6px; font-size: var(--f2); }
.prod-item-static {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: default; border-color: var(--line-control);
}
.prod-item-static button { flex: 0 0 auto; }


/* Karuzela grafik. Przewijanie natywne + scroll-snap zamiast przesuwania
   transformem: na iOS tylko wtedy pozostaje przy kompozytorze i nie drzy.
   overscroll-behavior-x: contain odcina gest "wstecz" przy krancu. */
.carousel { position: relative; margin: 10px 0; }
.carousel-track {
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; -ms-overflow-style: none; border-radius: var(--r-md);
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; }
.carousel-slide img, .carousel-slide video {
  width: 100%; display: block; margin: 0; border-radius: var(--r-md);
  border: 1px solid var(--border-soft); background: var(--card-2);
}
.carousel-badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  background: rgba(6,7,10,.74); color: #fff; font-size: var(--f2); font-weight: 700;
  letter-spacing: .02em; padding: 3px 9px; border-radius: var(--r-pill); pointer-events: none;
}
.carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.carousel-dot {
  width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--border);
  transition: width .15s ease, background .15s ease;
}
.carousel-dot.on { width: 18px; background: var(--accent); }
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: none;
  align-items: center; justify-content: center; cursor: pointer;
  background: rgba(6,7,10,.62); color: #fff; border: none;
  font-size: var(--f5); line-height: 1; padding: 0 0 2px;
}
.carousel-nav.prev { left: 8px; }
.carousel-nav.next { right: 8px; }
/* Strzalki tylko tam, gdzie nie ma dotyku - na telefonie przeszkadzaja i
   zabieraja miejsce gestowi, ktory i tak jest naturalniejszy. */
@media (hover: hover) { .carousel-nav { display: flex; } }
/* Wersja na karcie w kolejce: nizsza, zeby lista dala sie przejrzec. */
.carousel-compact .carousel-slide img, .carousel-compact .carousel-slide video { max-height: 300px; object-fit: contain; }

.meta-ok { color: var(--ok); }
.meta-warn { color: var(--warn); }

/* Wejscie do Dostepow: kafelek na samym dole strony glownej, nie zakladka w
   pasku. Rzecz administracyjna, uzywana rzadko - nie ma zajmowac miejsca w
   nawigacji, ktora na telefonie jest waska. */
.access-entry {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 14px;
  text-align: left; cursor: pointer; font-family: inherit; color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.access-entry svg { width: 26px; height: 26px; flex: none; color: var(--muted); }
.access-entry > span:nth-of-type(1) { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.access-entry strong { font-size: var(--f3); font-weight: 600; }
.access-entry .muted { font-size: var(--f2); }
.access-entry-arrow { font-size: var(--f5); color: var(--muted-2); flex: none; }
@media (hover: hover) { .access-entry:hover { border-color: var(--accent); } }

/* Przydzielanie marek kontom operatorskim. Zwykle checkboxy w siatce - lista
   marek jest krotka i ma byc czytelna na raz, bez rozwijania i szukania. */
.access-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin: 6px 0 4px; }
.access-brand {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--card-2);
  font-size: var(--f3); font-weight: 500; color: var(--text); cursor: pointer; text-transform: none;
}
.access-brand input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
.access-brand:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.access-status { font-size: var(--f2); }

.switcher-modal input[type=text] { margin-top: 4px; }
.switcher-results { margin-top: 12px; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.switcher-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  background: none; border: none; border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer;
  color: var(--text); font-size: var(--f3); font-weight: 600; font-family: inherit; transition: background .12s ease;
}
.switcher-row:hover { background: var(--card-2); }

/* Plywajaca lupa (FAB) usunieta 2026-08-09 - dublowala wybor marki z paska
   narzedzi, a na telefonie zaslaniala prawy dolny rog. */

.history-item { border-left: 2px solid var(--border); padding: 7px 0 7px 13px; margin-bottom: 3px; font-size: var(--f2); }
.history-item .agent { color: var(--accent-text); font-weight: 700; text-transform: capitalize; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--border); padding: 11px 18px; border-radius: var(--r-md);
  font-size: var(--f3); z-index: 200; box-shadow: var(--shadow);
  max-width: min(90vw, 420px); white-space: normal; text-align: center;
}
.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 50px 0; font-size: var(--f3); }

/* ---------- Brand settings view ---------- */
.view-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.view-header h2 { font-size: var(--f5); font-weight: 700; }
.view-header select { width: auto; min-width: 260px; max-width: 100%; margin: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.settings-grid .card h3 { margin-bottom: 10px; }
.field-label { font-size: var(--f2); font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line-control); background: var(--card-2); font-size: var(--f2); font-weight: 500;
  color: var(--text); cursor: pointer; margin: 0; width: auto;
}
.check-pill input { width: auto; margin: 0; padding: 0; }
.check-pill.disabled { opacity: .55; cursor: default; }
.check-pill.danger-active { border-color: var(--err); background: var(--err-soft); color: var(--err); }
.tag {
  display: inline-block; padding: 4px 10px; border-radius: var(--r-pill); background: var(--accent-soft);
  color: var(--accent-text); font-size: var(--f2); font-weight: 600; margin: 2px 4px 2px 0;
}
.product-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.product-row { display: flex; align-items: center; gap: 10px; font-size: var(--f2); }
.product-thumb { width: 40px; height: 40px; border-radius: var(--r-md); object-fit: cover; background: var(--card-2); border: 1px solid var(--border); flex-shrink: 0; }
.chat-box {
  max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--border); margin-top: 10px;
}
.chat-msg { font-size: var(--f3); line-height: 1.5; }
.chat-msg.chat-user { color: var(--text); }
.chat-msg.chat-assistant { color: var(--muted); }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; }
.chat-input-row input { margin: 0; flex: 1; }

/* Narzedzia podgladu posta: pobranie pliku i skopiowanie tekstu. */
.post-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.post-tool {
  font-size: var(--f2); padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer;
  background: transparent; border: 1px solid var(--line-control); color: var(--muted);
  font-family: inherit;
}
.post-tool:hover { background: var(--card-2); color: var(--text); }

/* ---------- Zgloszenia usterek ---------- */
#zgloszenieOpis { width: 100%; margin: 10px 0 0; resize: vertical; font-family: inherit; }
.zgl-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.zgl-row label { font-size: var(--f2); }
.zgl-row select { margin: 0; flex: 1; min-width: 160px; }
.zgl-odpowiedz {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--card-2); border: 1px solid var(--accent); font-size: var(--f3); line-height: 1.55;
}
.zgl-odpowiedz p { margin: 6px 0 0; }
.zgl-odpowiedz-glowa { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zgl-numer { font-size: var(--f2); color: var(--muted-2); font-variant-numeric: tabular-nums; }
.zgl-co-zrobic { color: var(--muted); }
.zgl-blad { margin-top: 14px; color: var(--err); font-size: var(--f2); }
.zgl-znacznik {
  font-size: var(--f1); text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px;
  border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--muted-2);
}
.zgl-znacznik.zgl-widze { border-color: var(--accent); color: var(--accent-text); }
.zgl-znacznik.zgl-waga-wysoka { border-color: var(--err); color: var(--err); }
.zgl-naglowek { font-size: var(--f2); margin: 20px 0 8px; color: var(--muted); }
.zgl-pozycja {
  padding: 10px 0; border-top: 1px solid var(--border-soft); font-size: var(--f2);
}
/* Zamkniete sprawy zostaja na liscie, ale sa wyraznie ciszej - historia ma byc
   widoczna, a uwaga ma isc na to, co otwarte. */
.zgl-pozycja.zgl-zamkniete { opacity: .55; }
.zgl-pozycja-glowa { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zgl-meta { font-size: var(--f2); margin-top: 3px; }
.zgl-otwarte { color: var(--accent-text); font-weight: 600; }
.zgl-pozycja button { margin-top: 8px; }

/* ---------- Home dashboard ---------- */
.mascot-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 26px 20px 22px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.mascot-card svg { display: block; cursor: pointer; transform-origin: 50% 100%; }
@keyframes mascot-bounce {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  20% { transform: translateY(-16px) rotate(-9deg) scale(1.04); }
  40% { transform: translateY(0) rotate(7deg) scale(0.98); }
  60% { transform: translateY(-7px) rotate(-4deg) scale(1.02); }
  80% { transform: translateY(0) rotate(2deg) scale(1); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}
.mascot-card svg.bounce { animation: mascot-bounce 0.6s ease; }
.mascot-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mascot-label { font-weight: 700; font-size: var(--f3); margin-top: 6px; }
.mascot-caption { color: var(--muted); font-size: var(--f3); max-width: 420px; min-height: 20px; transition: opacity .2s ease; }
/* Zdanie od silnika, nie staly podpis - jasniejsze, bo niesie tresc. */
.mascot-caption.mascot-zywy { color: var(--text); }
.mascot-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.mascot-ask, .mascot-jump {
  font-size: var(--f2); padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer;
  background: transparent; border: 1px solid var(--line-control); color: var(--muted);
}
.mascot-ask:hover, .mascot-jump:hover { background: var(--card-2); color: var(--text); }
.mascot-jump { border-color: var(--accent); color: var(--accent-text); }
.mascot-bug { display: inline-flex; align-items: center; gap: 6px; }
.mascot-bug-licznik {
  font-style: normal; font-size: var(--f1); font-weight: 700; line-height: 1.5;
  background: var(--err); color: #fff; border-radius: var(--r-pill); padding: 1px 6px;
}

/* Zycie robota. Ruch jest celowo powolny i drobny - to kokpit, na ktory patrzy
   sie przez caly dzien, a nie ekran powitalny. */
@keyframes mascot-unos { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes mascot-mrug { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes mascot-aura { 0%, 100% { transform: scale(1); opacity: .28; } 50% { transform: scale(1.35); opacity: .6; } }
.mascot-card svg .mk-korpus { animation: mascot-unos 4.4s ease-in-out infinite; }
.mascot-card svg .mk-oczy,
.mascot-card svg .mk-aura { transform-box: fill-box; transform-origin: center; }
.mascot-card svg .mk-oczy { animation: mascot-mrug 6.5s ease-in-out infinite; }
.mascot-card svg .mk-aura { animation: mascot-aura 2.6s ease-in-out infinite; }

/* --- Robot zajety soba ---------------------------------------------------
   Unoszenie, mruganie i puls anteny byly juz wczesniej, ale tak dyskretne
   (3 px co 4,4 s), ze operator nie zauwazyl ich wcale. Dokladamy zachowania
   ZALEZNE OD NASTROJU - tak zeby jednym spojrzeniem bylo widac, czy system ma
   spokojny dzien, czy sie awanturuje.

   Wszystko na `transform` i `opacity`, zadnych cieni ani filtrow: to jedyne
   wlasciwosci, ktore iOS animuje na kompozytorze, a karta stoi na gorze
   przewijanej strony. */

/* Diody na piersi przebiegaja po kolei - „maszyna pracuje". */
@keyframes mascot-dioda { 0%, 100% { opacity: .35; } 22% { opacity: 1; } }
.mascot-card svg .mk-dioda {
  animation: mascot-dioda 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * .28s);
}

/* Ramiona: leniwe kolysanie. Sam korpus juz sie unosi, wiec amplituda jest
   mala - inaczej robot wyglada, jakby machal na pozegnanie. */
@keyframes mascot-ramie-l { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-5deg); } }
@keyframes mascot-ramie-p { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(5deg); } }
.mascot-card svg .mk-ramie { transform-box: fill-box; transform-origin: 50% 10%; }
.mascot-card svg .mk-ramie-l { animation: mascot-ramie-l 4.4s ease-in-out infinite; }
.mascot-card svg .mk-ramie-p { animation: mascot-ramie-p 4.4s ease-in-out infinite; }

/* Fale przy zlym nastroju naprawde falują. */
@keyframes mascot-alarm { 0%, 100% { opacity: .25; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
.mascot-card svg .mk-alarm {
  transform-box: fill-box; transform-origin: center;
  animation: mascot-alarm 1.1s ease-in-out infinite;
}

/* Zadowolony: szybszy oddech i co jakis czas podskok. */
@keyframes mascot-podskok {
  0%, 86%, 100% { transform: translateY(0); }
  90% { transform: translateY(-7px); }
  94% { transform: translateY(0); }
  96% { transform: translateY(-3px); }
}
.mascot-card svg.mk-happy .mk-korpus { animation: mascot-podskok 5.2s ease-in-out infinite; }
.mascot-card svg.mk-happy .mk-ramie-l { animation-duration: 2.6s; }
.mascot-card svg.mk-happy .mk-ramie-p { animation-duration: 2.6s; }

/* Podejrzliwy: oczy wodza na boki. To jego cala mina - dlatego rusza sie
   powoli i z przystankami, a nie plynnie. */
@keyframes mascot-rozglada {
  0%, 30% { transform: translateX(0); }
  40%, 55% { transform: translateX(2.4px); }
  65%, 80% { transform: translateX(-2.4px); }
  90%, 100% { transform: translateX(0); }
}
.mascot-card svg.mk-suspicious .mk-oczy { animation: mascot-rozglada 4.8s ease-in-out infinite; }

/* Zly i wsciekly: drzenie. Wsciekly szybciej i mocniej - to jedyna roznica
   miedzy nimi poza kolorem, wiec musi byc czytelna. */
@keyframes mascot-drzenie {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-1px, 0) rotate(-1.1deg); }
  50% { transform: translate(1px, 0) rotate(1.1deg); }
  75% { transform: translate(-.6px, 0) rotate(-.6deg); }
}
.mascot-card svg.mk-angry .mk-korpus { animation: mascot-drzenie 0.9s ease-in-out infinite; }
.mascot-card svg.mk-furious .mk-korpus { animation: mascot-drzenie 0.32s linear infinite; }
.mascot-card svg.mk-furious .mk-alarm { animation-duration: .6s; }
/* Oczy-krzyzyki nie maja czym mrugac - zamiast tego drgaja w rytm wsciekłosci. */
@keyframes mascot-drgniecie { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.mascot-card svg.mk-furious .mk-oczy { animation: mascot-drgniecie .32s ease-in-out infinite; }

/* Smutny: wolniej i nizej - opada. */
.mascot-card svg.mk-sad .mk-korpus { animation-duration: 7s; }
.mascot-card svg.mk-sad .mk-ramie-l,
.mascot-card svg.mk-sad .mk-ramie-p { animation-duration: 7s; }

@media (prefers-reduced-motion: reduce) {
  .mascot-card svg .mk-korpus, .mascot-card svg .mk-oczy,
  .mascot-card svg .mk-aura, .mascot-card svg.bounce,
  .mascot-card svg .mk-dioda, .mascot-card svg .mk-ramie,
  .mascot-card svg .mk-alarm { animation: none; }
}
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.dash-tile { text-align: center; padding: 18px 12px; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.dash-tile:hover { background: var(--card-2); transform: translateY(-2px); }
.dash-tile:active { transform: translateY(0); }
/* Ton kafelka = obwodka + poswiata w tym samym kolorze. Poswiate mialy tylko
   `err` i `ok-glow`, a kafelek stanu systemu jako jedyny uzywa `ok` i `warn`
   (te byly dopisane osobno, 20 linii nizej, i ustawialy sama obwodke). Przez to
   odcinal sie od calej siatki: sasiedzi swiecili, on nie. Wszystkie tony w
   jednym miejscu, zeby nie dalo sie dodac koloru i zapomniec o poswiacie.
   `ok-glow` zostaje jako alias — uzywa go kafelek zaleglych publikacji. */
.dash-tile.err { border-color: var(--err); box-shadow: 0 0 0 1px var(--err), 0 0 26px -6px var(--err); }
/* Notka pod liczba na kafelku: informacja, ktora ma sie NIE domagac uwagi.
   Mniejsza od podpisu i bez wlasnej ramki - inaczej czytaloby sie jak drugi
   alarm, czyli dokladnie to, co usuwamy. */
.dash-notka { font-size: var(--f1); margin-top: 6px; opacity: .75; line-height: 1.3; }
.dash-tile.ok,
.dash-tile.ok-glow { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok), 0 0 26px -6px var(--ok); }
.dash-tile.warn { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn), 0 0 26px -6px var(--warn); }
.dash-num { font-size: var(--f6); font-weight: 800; margin-bottom: 3px; }
.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-row { display: flex; justify-content: space-between; font-size: var(--f3); padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.mini-row:last-child { border-bottom: none; }

/* Health tile - deliberately the SAME shape as every other dash tile: one
   glyph + one short label. The summary and the rescan button live in the
   details modal (openHealthModal), not here. */
.tile-note { font-size: var(--f2); color: var(--muted); display: block; margin-top: 3px; line-height: 1.35; }

/* Podpowiedz pod polem formularza. Byla skladana z `.muted` + wklejonego
   `font-size:12px` w kazdym miejscu z osobna — a `.muted` ustawia sam KOLOR.
   Jedno miejsce (horyzont planowania) tego rozmiaru nie dostalo i podpowiedz
   renderowala sie w rozmiarze tresci, dwa razy wieksza od sasiednich. Klasa
   zamiast piatki powtorzen: nowe pole nie ma jak wypasc z rytmu. */
.podpowiedz { font-size: var(--f2); color: var(--muted); line-height: 1.4; margin: 4px 0 0; }

/* Lista kanalow, na ktore post wyszedl - jeden wiersz na platforme, z nazwa.
   Pojedynczy nieopisany odnosnik nie mowil operatorowi, czy drugi kanal tez
   wydal, i czytalo sie to jako "wyszlo tylko tam". */
.lista-publikacji { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.lista-publikacji li { display: flex; align-items: baseline; gap: 8px; font-size: var(--f3); }

/* Data publikacji w trybie poprawy. Pole stoi poza blokiem komentowalnym,
   wiec potrzebuje wlasnego oznaczenia zmiany - zielona ramka, ta sama
   konwencja co przy edycji tekstu. */
.rev-when { margin: 10px 0 14px; }
.rev-when label {
  display: block;
  font-size: var(--f2);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.rev-when input[type="datetime-local"] {
  /* Bez tego iOS rysuje wlasna, JASNA pastylke — w ciemnym motywie wyglada jak
     obce cialo, a wartosc siedzi przy lewej krawedzi, zostawiajac puste pole
     po prawej (stad „data nie jest wycentrowana"). */
  -webkit-appearance: none;
  appearance: none;
  width: auto;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid var(--line-control);
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.rev-edit.changed { box-shadow: 0 0 0 2px var(--ok); }

/* ---------- Materialy ---------- */

.mat-drop {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 22px 18px;
  text-align: center;
  margin-top: 12px;
  transition: border-color .15s, background .15s;
}
.mat-drop.over { border-color: var(--accent); background: rgba(127,127,127,.06); }
.mat-drop p { margin: 4px 0; }

.mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.mat-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--border);
  /* Ramka rysowana cieniem, nie borderem - border zmienialby rozmiar kafelka
     przy zaznaczeniu i cala siatka drgalaby przy kazdym kliknieciu. */
  box-shadow: 0 0 0 1px var(--border);
}
.mat-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-tile.selected { box-shadow: 0 0 0 3px var(--ok); }

.mat-check {
  position: absolute;
  top: 6px; left: 6px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
  border-radius: var(--r-sm);
  backdrop-filter: blur(2px);
}
.mat-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--ok); }

.mat-flag {
  position: absolute;
  bottom: 6px; left: 6px; right: 6px;
  font-size: var(--f1);
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  padding: 3px 4px;
  border-radius: var(--r-sm);
  background: rgba(0,0,0,.6);
  color: #fff;
}

/* Pasek akcji przyklejony do dolu - przy dlugiej bibliotece przycisk
   "Zaplanuj" musi byc pod reka bez przewijania na sam dol. */
.mat-bar {
  position: sticky;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-top: 16px;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: 0 6px 24px rgba(0,0,0,.28), 0 0 0 1px var(--border);
}
.mat-bar span { margin-right: auto; }

/* Na telefonie cztery elementy nie mieszcza sie w jednym rzedzie — pasek
   wychodzil poza ekran i „Zaplanuj z AI" bylo ucinane po prawej. Licznik
   dostaje wlasny wiersz, przyciski dziela sie reszta i moga sie zawinac. */
@media (max-width: 880px) {
  .mat-bar { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .mat-bar span { flex: 1 0 100%; margin-right: 0; }
  .mat-bar button { flex: 1 1 auto; min-width: 0; }
  /* Pasek jest wazniejszy niz plywajaca lupa, gdyby kiedys sie zetknely. */
  .mat-bar { z-index: 31; }
}

/* Plywajaca lupa jest `fixed` i domyslnie ladowala DOKLADNIE na przycisku
   „Zaplanuj z AI", zaslaniajac go. Gdy pasek zaznaczenia jest na ekranie,
   podnosimy ja ponad niego. Klase ustawia widok materialow. */


.mat-modal { max-width: 720px; }
.mat-full {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: var(--r-md);
  background: #000;
}

.mat-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mat-filter { display: flex; align-items: center; gap: 8px; margin: 0; }
.mat-filter select { margin: 0; }
.up-modal { max-width: 560px; }
.up-step2 { margin-top: 4px; }

/* Przycisk wgrywania: ikona + etykieta, ta sama wysokosc co reszta akcji
   w panelu. Wczesniej mial klasy `btn btn-primary`, ktorych ten panel w ogole
   nie definiuje - renderowal sie jako surowy przycisk przegladarki. */
button.mat-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.mat-upload svg { width: 17px; height: 17px; flex: none; }
.mat-back { margin-right: 12px; }
.view-header .mat-back { align-self: center; }

/* Dni, w ktore marka zwykle publikuje. To SUGESTIA, nie ograniczenie -
   operator moze wybrac dowolna date, a podswietlenie ma tylko pokazac,
   gdzie post naturalnie wpasuje sie w rytm marki. Stad delikatne tlo i
   kropka, a nie ramka czy wyszarzenie pozostalych dni. */
.day-cell.suggested {
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 70%);
}
.day-cell.suggested .daynum::after {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  margin-left: 5px;
  vertical-align: 2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .75;
}
.mini-day.suggested {
  background: var(--accent-soft);
  border-radius: var(--r-sm);
}

/* --- Przeglad materialu zebranego ze strony marki ------------------------ */
/* Tresc bywa dluga (Ogrody Staszica: 175 fragmentow), wiec panel ma wlasne
   przewijanie - inaczej przyciski zakladek uciekaja poza ekran telefonu. */
.site-panel {
  max-height: 58vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-page { margin-bottom: 16px; }

.site-page-url {
  font-size: var(--f2);
  color: var(--muted);
  word-break: break-all;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.site-text {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  font-size: var(--f3);
  line-height: 1.45;
}

.site-tag {
  flex: 0 0 auto;
  font-size: var(--f1);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 5px;
}

.site-assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.site-asset {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  background: var(--card);
}

/* Szachownica pod grafika: ikony bywaja przezroczyste i na ciemnym tle
   znikaja, a wtedy nie da sie ocenic, czy skan pobral wlasciwy plik. */
.site-asset img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: contain;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #e9e9e9 25%, transparent 25%),
    linear-gradient(-45deg, #e9e9e9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9e9e9 75%),
    linear-gradient(-45deg, transparent 75%, #e9e9e9 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}

.site-asset span {
  display: block;
  padding: 5px 7px;
  font-size: var(--f1);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-colors { display: flex; flex-wrap: wrap; gap: 12px; }

.site-color { text-align: center; }

.site-color span {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-bottom: 4px;
}

.site-color code { font-size: var(--f1); color: var(--muted); }

/* Dwie kolumny na szerokim ekranie, jedna na telefonie - uzywane przy wyborze
   zakresu dat w eksporcie planu. */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Wybór materiałów do postów: zaznaczone wyróżniamy ramką i pełną jasnością,
   odznaczone przygaszamy — operator ma widzieć stan jednym rzutem oka, bez
   czytania checkboxów. */
.site-asset { position: relative; }
.site-asset.wybieralny { opacity: .45; transition: opacity .15s ease, border-color .15s ease; }
.site-asset.wybieralny.zaznaczony { opacity: 1; border-color: var(--accent); }

.site-asset-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: rgba(0, 0, 0, .55);
  border-radius: var(--r-sm);
  padding: 3px 4px 1px;
  cursor: pointer;
}

.site-asset-check input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }

/* Miniatura przy pozycji na liście wyboru. Przy materiałach ze skanu strony
   nazwa pliku („11-OS-26_38.jpg") nic operatorowi nie mówi. Przy produktach
   z katalogu okazało się to samo: Hdrey ma 220 pozycji, a „Amber Ceramide
   Firming Serum" i „…Night Cream" różnią się jednym słowem — opakowania
   różnią się od razu. Miniatury produktów idą przez /api/mini (240 px). */
.prod-item.z-miniatura {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.prod-thumb {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: #fff;
}

.prod-item.z-miniatura span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Zamowienie rolki z zatwierdzanej grafiki. Pole siedzi tuz pod obrazem, bo
   decyzja dotyczy TEJ grafiki - w pasku akcji na dole gubiloby ten zwiazek. */
.rev-reels {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-control);
  border-radius: var(--r-md);
  font-size: var(--f3);
}
/* Bylo tu pole wyboru dzialajace dopiero razem z „Zaakceptuj". Teraz to
   przycisk wykonujacy akcje od razu, wiec nie moze sie zwezac do etykiety. */
.rev-reels button { flex: 0 0 auto; white-space: nowrap; }
.rev-reels .muted { font-size: var(--f2); }
/* TRZECI prog, swiadomie. Uklad przelacza sie na 880 px (telefon / szerzej);
   te dwa komponenty naprawde potrzebuja jeszcze jednego stopnia, bo na waskim
   telefonie nie mieszcza sie w zadnym ustawieniu: podglad kadru zjadlby pol
   ekranu, a wiersz rolki nie zmiescilby opisu obok przelacznika. */
@media (max-width: 560px) {
  .rev-reels { flex-wrap: wrap; }
  .rev-reels .muted { flex: 1 0 100%; margin-left: 0; }
}

/* Zmiana terminu na zatwierdzonym poscie: pole obok przycisku, zeby bylo od
   razu widac, ze to jedno dzialanie, a nie osobna sekcja ustawien. */
.rev-when-approved { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
/* Pole nie rozciaga sie na cala szerokosc: rozciagniete zostawialo puste
   miejsce po prawej od daty, bo wartosc trzyma sie lewej krawedzi. */
.rev-when-approved input { flex: 0 1 auto; }
.rev-when-approved button { flex: 0 0 auto; }

/* Kadr reczny: podglad musi byc DOKLADNIE tym, co zapisze kompozytor, wiec
   ramka ma proporcje formatu, a obraz jest pozycjonowany w pikselach z JS
   (patrz `ustawKadrPodglad`) - zadnego object-fit, ktory liczylby inaczej. */
.kadr { margin: 4px 0 14px; }
.kadr-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: var(--f3); color: var(--text); font-weight: 500;
}
.kadr-body { margin-top: 8px; }
.kadr-formaty { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.kadr-fmt {
  border: 1px solid var(--line-control); background: var(--card-2); color: var(--text); cursor: pointer;
  border-radius: var(--r-pill); padding: 5px 12px; font-size: var(--f2);
}
.kadr-fmt.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.kadr-scena { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.kadr-ramka {
  position: relative; width: 220px; flex: 0 0 220px;
  overflow: hidden; border-radius: var(--r-md); background: var(--card-2);
  border: 1px solid var(--border);
}
.kadr-okno { position: relative; overflow: hidden; }
.kadr-okno img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.kadr-apla { display: flex; align-items: center; justify-content: center; }
.kadr-apla span { color: #fff; font-size: var(--f1); letter-spacing: 1px; opacity: .92; text-align: center; padding: 0 8px; }
.kadr-suwaki { flex: 1 1 200px; display: flex; flex-direction: column; gap: 10px; }
.kadr-suwaki label { display: flex; flex-direction: column; gap: 4px; font-size: var(--f2); }
.kadr-suwaki input[type="range"] { width: 100%; }
.kadr-suwaki input[type="range"]:disabled { opacity: .35; }
.kadr-suwaki .check-pill { flex-direction: row; align-items: center; gap: 8px; }
@media (max-width: 560px) {
  .kadr-ramka { width: 150px; flex: 0 0 150px; }
}

/* Logotyp marki w widoku Materialy. Stoi w naglowku marki, a nie w siatce
   zdjec - inaczej dalby sie zaznaczyc i zaplanowac jako post. */
.mat-logo {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 12px; margin-bottom: 12px;
  border: 1px dashed var(--border); border-radius: var(--r-md);
}
.mat-logo-podglad {
  width: 96px; height: 96px; flex: 0 0 96px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); background: var(--card-2, #f2f2ef);
  /* Szachownica: logo na przezroczystym tle musi byc widoczne takze wtedy,
     gdy jest bialy znak na przezroczystosci. */
  background-image:
    linear-gradient(45deg, rgba(0,0,0,.06) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.06) 75%),
    linear-gradient(45deg, rgba(0,0,0,.06) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.06) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}
.mat-logo-podglad img { max-width: 84px; max-height: 84px; object-fit: contain; display: block; }
.mat-logo-podglad .muted { font-size: var(--f2); }
.mat-logo-tresc { flex: 1 1 220px; min-width: 0; }
.mat-logo-tytul { font-weight: 600; font-size: var(--f3); margin-bottom: 2px; }
.mat-logo-tresc .muted { font-size: var(--f2); margin: 0 0 8px; }
.mat-logo .actions-row { margin: 0; }
.kadr-apla-logo { max-width: 62%; max-height: 70%; object-fit: contain; }

/* Widok Materialy: domyslnie lista marek, materialy dopiero po rozwinieciu. */
.mat-marka { padding: 0; overflow: hidden; }
.mat-pasek {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; background: none; border: none; cursor: pointer;
  text-align: left; font: inherit; color: inherit;
}
.mat-pasek:hover { background: var(--card-2, #f2f2ef); }
.mat-pasek-logo {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--card-2, #f2f2ef); overflow: hidden;
}
.mat-pasek-logo img { max-width: 34px; max-height: 34px; object-fit: contain; display: block; }
.mat-pasek-inicjal { font-weight: 600; font-size: var(--f3); opacity: .55; }
.mat-pasek-nazwa { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: var(--f3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-pasek-licznik { flex: 0 0 auto; font-size: var(--f2); }
.mat-pasek-strzalka {
  flex: 0 0 auto; font-size: var(--f5); line-height: 1; opacity: .45;
  transition: transform .18s ease;
}
.mat-pasek-strzalka.otwarte { transform: rotate(90deg); }
.mat-rozwiniete { padding: 0 14px 14px; }

/* Kasowanie marki. Ramka i kolor sa tu celowo krzykliwe - to jedyne miejsce
   w panelu, ktorego nie da sie cofnac. */
.strefa-ryzyka { border: 1px solid var(--err, #b3261e); }
.strefa-ryzyka h3 { color: var(--err, #b3261e); }
.strefa-ryzyka label { display: block; margin-top: 10px; }
.strefa-ryzyka input { width: 100%; }

/* Toast siadal na dolnym pasku nawigacji (pasek ma z-index 20, toast 200),
   wiec komunikat o wyniku decyzji zaslanial przyciski. */
@media (max-width: 880px) {
  .toast { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* Cele dotykowe. Ikony, serce i kciuki zostawaly przy 34 px, mimo ze media
   query podnosila do 44 px tylko przyciski tekstowe. Kciuk w gore i w dol
   znacza rzeczy przeciwne, wiec dostaja tez wiekszy odstep. */
@media (max-width: 880px) {
  .icon-btn { min-width: 44px; min-height: 44px; }
  .heart-like, .thumb-btn { width: 42px; height: 42px; }
  .signal-thumbs { gap: 12px; }
  .modal .close { width: 44px; height: 44px; font-size: var(--f4); }
  .mat-check { width: 34px; height: 34px; }
  .mat-check input { width: 22px; height: 22px; }
  /* Rzad decyzji na iPhone bez przycisku home siadal pod paskiem gestow. */
  .modal { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  /* Ramka kadru na 150 px nie pozwalala niczego ustawic precyzyjnie. */
  .kadr-ramka { width: 100%; flex: 1 1 100%; max-width: 320px; }
}

/* Karta znika po decyzji zamiast przeladowywac cala kolejke. */
.karta-znika {
  transition: opacity .18s ease, transform .18s ease;
  opacity: 0; transform: translateY(-6px) scale(.985); pointer-events: none;
}

/* Pasek niezapisanych zmian w ustawieniach - lepki, zeby nie trzeba bylo
   szukac przycisku zapisu w polowie dlugiej strony. */
.niezapisane {
  position: sticky; bottom: 12px; z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 14px 0; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--warn-soft); border: 1px solid var(--warn); font-size: var(--f3);
}
@media (max-width: 880px) {
  .niezapisane { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* Komunikat o stanie, ktory operator MUSI zauwazyc, ale ktory nie jest bledem
   (np. „wybor materialow wyczerpal sie przez blokady"). `muted` by go schowal,
   a tego wlasnie stanu nie dalo sie wczesniej nigdzie zobaczyc. */
.warn-box {
  margin: 10px 0; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--warn-soft); border: 1px solid var(--warn); font-size: var(--f3);
}

/* Toast: wariant bledu odrozniamy kolorem krawedzi, a kolejne komunikaty
   ustawiaja sie jeden nad drugim zamiast nakladac sie w tym samym miejscu. */
.toast.blad { border-color: var(--err); }

/* Kropka stanu systemu zamiast emoji - ten sam jezyk wizualny co reszta. */
.stan-kropka {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted-2); vertical-align: middle;
}
.stan-kropka.ok { background: var(--ok); }
.stan-kropka.warn { background: var(--warn); }
.stan-kropka.err { background: var(--err); }
.stan-kropka.trwa { background: var(--info); animation: pulsuj 1.2s ease-in-out infinite; }
@keyframes pulsuj { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .stan-kropka.trwa { animation: none; } }

/* Telefon: maskotka i pasek kafelkow zabieraly caly pierwszy ekran, wiec
   „Najwiecej do przegladu" - czyli powod, dla ktorego operator tu wchodzi -
   ladowalo pod zagieciem. */
@media (max-width: 880px) {
  .mascot-card { display: flex; flex-direction: row; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; }
  .mascot-card svg { width: 72px; height: 72px; flex: 0 0 72px; }
  .mascot-text { align-items: flex-start; min-width: 0; }
  .mascot-label { margin: 0; }
  .mascot-caption { margin: 2px 0 0; }
  .mascot-actions { justify-content: flex-start; margin-top: 8px; }
  /* Kafelki filtrow: jeden przewijany rzad zamiast siatki na pol ekranu. */
  .stat-row {
    display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .stat-row::-webkit-scrollbar { display: none; }
  .stat-row > * { flex: 0 0 auto; min-width: 118px; scroll-snap-align: start; }
}

/* ---------- Edytor grafik w ramce ---------- */
/* Edytor to osobna aplikacja pod /edytor, wpieta ramka. Zajmuje caly ekran,
   bo sam ma juz swoj pasek narzedzi i wlasne okna — obramowanie panelu wokol
   niego tylko zabieraloby kadr. */
.edytor-backdrop { align-items: stretch; justify-content: stretch; padding: 0; }
.edytor-ramka { position: relative; flex: 1; display: flex; }
.edytor-ramka iframe { flex: 1; width: 100%; height: 100%; border: 0; display: block; }
.edytor-stan {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  padding: 9px 14px; border-radius: var(--r-pill); z-index: 2;
  background: rgba(6,7,10,.9); color: var(--text); font-size: var(--f2);
  border: 1px solid var(--border);
}
.edytor-stan.blad { color: #ffb4b4; border-color: var(--err); }

/* Dwa narzedzia grafiki w jednym rzedzie. Zawijaja sie na waskim ekranie
   zamiast wypychac sie poza modal. */
.kadr-narzedzia { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
/* Wybor slajdu karuzeli do edycji. Etykieta i numerki maja trzymac sie razem,
   nawet gdy pasek narzedzi zawinie sie na telefonie - stad wlasny odstep
   mniejszy niz miedzy narzedziami. */
.kadr-slajd-etykieta { font-size: 12.5px; margin-left: 4px; }
.kadr-narzedzia .kadr-slajd-etykieta + .kadr-fmt { margin-left: -10px; }
.kadr-narzedzia .kadr-fmt { min-width: 30px; }

/* ============================================================
   Pola dotyku i wskaznik fokusu — audyt UX/UI, 2026-08-11
   ============================================================ */

/* A8. Wskaznik fokusu zaprojektowano tylko dla pol: `input:focus` dostawal
   fioletowa obwodke i pierscien, a przyciski, karty i pastylki - domyslny
   pierscien przegladarki, ktory na ciemnym tle bywa ledwie widoczny i wyglada
   obco. Jedna regula dla wszystkiego, co da sie sfokusowac.
   `:focus-visible`, nie `:focus`: obwodka ma pokazywac sie przy klawiaturze,
   a nie po kazdym kliknieciu myszka.
   Pola zostaja przy swoim pierscieniu — maja obwodke, ktora da sie zabarwic;
   przyciski jej nie maja, wiec potrzebuja konturu na zewnatrz. */
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
/* `tabindex="-1"` dostaje okno dialogowe, zeby moc przejac fokus po otwarciu.
   Kontur wokol calego okna wygladalby jak usterka, wiec ten przypadek wypada. */
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Element w rogu karty ma obwodke tuz przy krawedzi obrazka - kontur na
   zewnatrz zlewalby sie z grafika, wiec idzie do srodka. */
.heart-like:focus-visible,
.thumb-btn:focus-visible { outline-offset: -3px; }

/* --------------------------------------------------------------
   B1/B2/B3. Rozmiary dotykowe.

   `pointer: coarse` zamiast szerokosci ekranu: znaczenie ma palec, a nie to,
   ile pikseli ma okno. Tablet w poziomie ma szeroki ekran i gruby wskaznik,
   a okno przegladarki zwezone na komputerze - odwrotnie.
   -------------------------------------------------------------- */
@media (pointer: coarse) {

  /* Serce i kciuki: rysunek zostaje 34 px, zeby nie rozsadzic rogu karty —
     rosnie samo pole dotyku, przezroczysta warstwa do 44 x 44 px.
     Odstep podniesiony z 6 do 10 px, bo przy 6 px pola dotyku sasiadow
     zachodzilyby na siebie o 4 px i o trafieniu decydowalaby kolejnosc
     w drzewie dokumentu, a nie to, gdzie operator faktycznie dotknal. */
  /* WYCOFANE 2026-08-12. Powiekszanie pola dotyku serca i kciukow przez
     przezroczysta warstwe `::after { position: absolute; inset: -5px }` okazalo
     sie zbyt ryzykowne: warstwa liczy sie wzgledem najblizszego POZYCJONOWANEGO
     przodka, a serce ma rozne pozycjonowanie w kolejce (`absolute`) i w oknie
     posta (`static`) - tam rozlewala sie na cale okno i polykala dotkniecia.
     Doszywanie `position: relative` do kolejnych przypadkow to leczenie objawow;
     kazdy nowy kontekst, w ktorym te przyciski sie pojawia, byłby nastepna
     pulapka. Zostaja przy 34 px do czasu, az pole dotyku da sie powiekszyc
     bez nakladki (np. przycisk 44 px z widocznym kolem w srodku).
     Zalecenie B1 jest tym samym NIEZREALIZOWANE w czesci dotyczacej serca
     i kciukow; przelacznik widoku, lista produktow i pastylki kadru maja
     `min-height`, ktory niczego nie przykrywa, i zostaja. */

  /* Przelacznik Lista / Tydzien / Miesiac: 30 -> 44 px. Pasek jest
     jednorzedowy, wiec zyskana wysokosc niczego nie wypycha. */
  .segmented button { min-height: 44px; padding: 9px 15px; }

  /* Wiersz listy produktow: 34 -> 44 px. Przy 220 pozycjach Hdrey pomylka jest
     CICHA - wybiera sie nie ten produkt i nic o tym nie mowi. Miniatura ma
     46 px, wiec wysokosc i tak byla zajeta. */
  .prod-item { min-height: 44px; }

  /* Pastylki formatu kadru: 28 -> 38 px. */
  .kadr-fmt { min-height: 38px; padding: 8px 14px; }
}

/* Legenda — wiedza wyjeta z dymkow `title` (audyt UX, B6).
   Dymek pojawia sie tylko po najechaniu myszka, a panel jest obslugiwany
   kciukiem: dla glownego uzytkownika ta wiedza po prostu nie istniala. */
.legenda {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0 0 14px; font-size: var(--f2); color: var(--muted-2); line-height: 1.5;
}
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda b { color: var(--muted); font-weight: 600; }
.legenda:empty { display: none; margin: 0; }
/* Probka koloru dnia publikacji — to samo tlo, co w siatce kalendarza, zeby
   legenda pokazywala rzecz, a nie tylko ja opisywala. */
.legenda-dzien {
  width: 14px; height: 14px; border-radius: var(--r-sm);
  background: var(--accent-soft); border: 1px solid var(--accent); flex: none;
}

/* Komunikat z „Cofnij" (audyt UX, F2). Pojemnik komunikatow ma
   `pointer-events: none`, zeby nie zaslanial interfejsu - ten jeden musi
   klikniecia przyjmowac, wiec wlacza je z powrotem u siebie. */
.toast-cofnij {
  display: flex; align-items: center; gap: 14px;
  pointer-events: auto; padding-right: 6px;
}
.toast-akcja {
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--accent-text); font-weight: 700; font-size: var(--f2);
  padding: 8px 10px; border-radius: var(--r-sm); min-height: 40px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.toast-akcja:hover { background: var(--accent-soft); }
/* Odliczanie ma stala szerokosc, zeby przycisk nie drgal przy kazdej sekundzie. */
.toast-akcja em {
  font-style: normal; font-variant-numeric: tabular-nums;
  color: var(--muted-2); min-width: 1.4em; text-align: right;
}

/* Lista bledow w oknie stanu systemu. Wpisy sa krotkie, ale slad wykonania
   potrafi miec kilkanascie linii - dlatego chowamy go w `details`, a `pre`
   przewija sie w poziomie zamiast rozpychac okno. */
.bledy-lista { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.blad-wpis {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--card-2); padding: 8px 10px;
}
.blad-wpis.zasob { opacity: .72; }
.blad-naglowek { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.blad-naglowek strong { font-size: var(--f3); font-weight: 600; }
.blad-naglowek .podpowiedz { white-space: nowrap; margin: 0; }
.blad-wpis details { margin-top: 4px; }
.blad-wpis summary { cursor: pointer; }
.blad-stos {
  margin: 6px 0 0; padding: 8px; border-radius: var(--r-sm);
  background: var(--bg); font-size: var(--f1); line-height: 1.4;
  overflow-x: auto; white-space: pre;
}

/* --- Miniatura wideo -------------------------------------------------------
   Rolka w kolejce przegladu pokazywala PUSTY prostokat. `<video>` z samym
   `preload="metadata"` wystarcza przegladarkom desktopowym, ale iOS Safari
   pobiera wtedy tylko czas trwania i wymiary — klatki nie rysuje. Adres dostaje
   wiec `#t=0.1` (w `mediaHtml`), a tutaj domykamy wyglad: kadrowanie takie samo
   jak przy zdjeciu i naklejka „film", widoczna zanim klatka dojedzie.

   Naklejka ma `pointer-events: none`. To nie jest ostroznosc na zapas: warstwa
   `::after` nad trescia okna raz juz polknela wszystkie dotkniecia i kosztowalo
   to dwa zgloszenia operatora. */
.media-wideo { position: relative; display: block; overflow: hidden; line-height: 0; }
.media-wideo > video { display: block; width: 100%; background: #000; }
/* Miniatury maja twardy rozmiar z klasy (`thumb`, `week-thumb`), wiec wideo
   wypelnia je tak samo jak zdjecie. W oknie posta wysokosc zostaje wolna. */
.media-wideo.thumb > video,
.media-wideo.week-thumb > video { width: 100%; height: 100%; object-fit: cover; }
.media-wideo.bez-sterowania::after,
.media-wideo.gra.pauza::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 0; height: 0;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent rgba(255, 255, 255, .92);
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, .55));
  pointer-events: none;
}
.media-wideo.bez-sterowania.week-thumb::after { border-width: 9px 0 9px 15px; }

/* Rolka w oknie posta: zadnego paska, zadnego gradientu — caly kadr zostaje
   widoczny, bo to jego operator ma ocenic. Trojkat pojawia sie WYLACZNIE po
   zatrzymaniu. `::-webkit-media-controls` domyka temat na iOS Safari, ktory
   potrafi dorysowac wlasna nakladke mimo braku atrybutu `controls`. */
.media-wideo.gra { cursor: pointer; }
.media-wideo.gra.pauza::after { border-width: 11px 0 11px 19px; }
.media-wideo.gra > video::-webkit-media-controls,
.media-wideo.gra > video::-webkit-media-controls-start-playback-button { display: none !important; }

/* --- Dziennik aktywnosci kont ----------------------------------------------
   Lista ma sie czytac jak wyciag z konta: kolumna czasu, kto, co. Dlatego
   siatka, a nie wiersz tekstu - na telefonie ostatnia kolumna (cel) schodzi
   pod spod, zamiast lamac czas i nazwe. */
.akt-filtry { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.akt-chipy { display: flex; flex-wrap: wrap; gap: 6px; }
.akt-chip {
  border: 1px solid var(--border); border-radius: 999px; background: var(--card-2);
  color: var(--text); font-family: inherit; font-size: var(--f1); font-weight: 500;
  padding: 5px 11px; cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.akt-chip-on { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) { .akt-chip:hover { border-color: var(--accent); } }

.akt-dzien { margin-bottom: 14px; }
.akt-dzien h4 {
  margin: 0 0 6px; font-size: var(--f1); font-weight: 600; color: var(--muted);
  text-transform: lowercase; letter-spacing: .03em;
}
.akt-wpis {
  display: grid; grid-template-columns: 46px 92px 1fr auto; gap: 4px 10px;
  align-items: baseline; padding: 6px 8px; border-radius: var(--r-sm);
  font-size: var(--f2); line-height: 1.35;
}
.akt-wpis:nth-child(odd) { background: var(--card-2); }
.akt-czas { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.akt-kto { font-weight: 600; overflow-wrap: anywhere; }
.akt-co { overflow-wrap: anywhere; }
.akt-cel { color: var(--muted); text-align: right; overflow-wrap: anywhere; }
/* Przegladanie jest tlem dla zdarzen, nie trescia - ma byc widoczne dopiero,
   gdy ktos go szuka. */
.akt-obecnosc { opacity: .6; }
.akt-nieudane .akt-co { color: var(--err); }
.akt-blad { font-weight: 600; }

@media (max-width: 560px) {
  .akt-wpis { grid-template-columns: 44px 1fr; }
  .akt-co { grid-column: 2; }
  .akt-cel { grid-column: 2; text-align: left; }
}

/* ============================================================================
   Przeglad wygladu 2026-08-18. Zrodlo: obejrzenie WSZYSTKICH widokow w Chrome
   (poprzedni audyt szedl przez jsdom i sam to zastrzegal). Wniosek byl jeden
   i powtarzal sie na kazdym ekranie: panel pokazywal LICZNIKI tam, gdzie ma
   pokazywac TRESC, i rozdawal wszystkim elementom te sama wage.
   ========================================================================= */

/* ---------- Karta przegladu: grafika, nie znaczek pocztowy ----------
   Przegladanie postu to ocena GRAFIKI, a miniatura miala 48 px - tyle co ikona
   w liscie. Operator zatwierdzal obrazek, ktorego nie widzial. Reszta panelu
   uzywa `.post-row` do list, wiec zmiana jest zawezona do karty przegladu. */
.review-card .rev-glowna { align-items: flex-start; gap: 16px; }
.review-card .rev-glowna img.thumb,
.review-card .rev-glowna .thumb,
.review-card .rev-glowna .media-wideo.thumb {
  width: 220px; height: auto; aspect-ratio: 4 / 5; border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
.review-card .rev-glowna .media-wideo.thumb > video { width: 100%; height: 100%; object-fit: cover; }
.review-card .rev-glowna .meta { padding-top: 2px; }
/* Tytul postu to najwazniejszy tekst na tej karcie - do tej pory mial rozmiar
   tresci i lamal sie w jedna linie z wielokropkiem. */
.review-card .rev-glowna .meta .title {
  font-size: var(--f4); font-weight: 700; line-height: 1.3; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.review-card .rev-glowna .meta .sub { margin-top: 6px; line-height: 1.5; }
/* Miara wiersza. Karta ma 1000 px, wiec tresc szla przez cala szerokosc -
   okolo 180 znakow w wierszu, dwa razy wiecej niz da sie wygodnie czytac. */
.rev-zajawka {
  font-size: var(--f3); margin: 12px 0 0; max-width: 68ch; line-height: 1.55; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 620px) {
  .review-card .rev-glowna { flex-direction: column; }
  /* Na telefonie grafika liczy sie z WYSOKOSCIA EKRANU, nie z szerokoscia
     karty. Przy `width: 100%` obrazek 4:5 zajmowal ~440 px i wypychal
     „Zaakceptuj" poza ekran - a przeglad na telefonie to wlasnie klikanie
     tego przycisku. 40vh zostawia miejsce na tytul i rzad decyzji. */
  .review-card .rev-glowna img.thumb,
  .review-card .rev-glowna .thumb,
  .review-card .rev-glowna .media-wideo.thumb {
    width: auto; max-width: 100%; height: 40vh; max-height: 340px;
  }
  .rev-zajawka { -webkit-line-clamp: 3; }
}
/* Trzy przyciski w jednym pastelu wygladaly na wylaczone i nie mowily, ktory
   jest glowny. Akceptacja - jedyna czynnosc, ktora operator wykonuje dziesiatki
   razy dziennie - dostaje pelny kolor; „Popraw" i „Odrzuc" zostaja stonowane,
   bo dzialanie nieodwracalne nie ma sie samo prosic o klikniecie. */
.review-card .actions-row button.ok {
  background: var(--ok); color: var(--ok-tekst); border-color: transparent;
  padding: 10px 20px; font-size: var(--f3);
}
.review-card .actions-row button.ok:hover { filter: brightness(1.06); }
.review-card .actions-row button.revise,
.review-card .actions-row button.danger { padding: 10px 16px; font-size: var(--f3); }

/* ---------- Miesiac: chip z tytulem ----------
   Godzina bez tytulu nie mowi nic o tym, co danego dnia wychodzi. Widok
   tygodnia rozwiazal to juz wczesniej (miniatura + tytul); miesiac zostal
   z sama godzina, bo ma waskie kolumny. Dwie linie mieszcza sie w kolumnie
   i nie rozpychaja siatki, bo tytul jest przyciety do jednej linii. */
.post-chip.chip-2w { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; padding: 4px 6px; }
.chip-czas { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-tytul { font-size: var(--f1); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-cell { min-height: 106px; }

/* ---------- Ustawienia: ekran startowy zamiast pustki ----------
   Bez wybranej marki widok byl pusta plaszczyzna z lista rozwijana w rogu. */
.ust-start .podpowiedz { margin: 0 0 14px; max-width: 62ch; }
.ust-marki { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.ust-marka {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  margin: 0; cursor: pointer; font-family: inherit; color: var(--text);
  transition: border-color .15s ease, transform .12s ease;
}
@media (hover: hover) { .ust-marka:hover { border-color: var(--accent); transform: translateY(-1px); } }
.ust-marka-znak {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-md);
  display: grid; place-items: center; font-weight: 700; font-size: var(--f4);
  background: var(--accent-soft); color: var(--accent-text);
}
.ust-marka-tresc { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.ust-marka-tresc strong { font-size: var(--f3); font-weight: 600; }
.ust-uwagi { display: flex; flex-wrap: wrap; gap: 5px; }
.ust-znak {
  font-size: var(--f1); font-weight: 600; padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--warn-soft); color: var(--warn);
}
.ust-znak.pauza { background: var(--border-soft); color: var(--muted); }
.ust-znak.blad { background: var(--err-soft); color: var(--err); }
.ust-znak.spokoj { background: var(--ok-soft); color: var(--ok); }

/* ---------- Materialy: pasmo miniatur w zwinietym pasku ----------
   Biblioteka zdjec pokazywala wylacznie nazwy marek i liczby. */
.mat-pasek-podglad { display: flex; gap: 4px; flex: none; margin-left: auto; }
.mat-pasek-podglad img {
  width: 34px; height: 34px; object-fit: cover; border-radius: var(--r-sm);
  border: 1px solid var(--border-soft);
}
.mat-pasek-licznik { margin-left: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .mat-pasek-podglad img:nth-child(n+3) { display: none; } }
@media (max-width: 460px) { .mat-pasek-podglad { display: none; } }

/* ---------- Maskotka: mniej pionu, wiecej tresci ----------
   Kafelek zajmowal 330 px nad pierwsza liczba - ekran otwieral sie rysunkiem,
   a nie stanem systemu. Na szerokim ekranie robot idzie w bok, zdanie ustawia
   sie do lewej (srodkowanie wielolinijkowego akapitu czyta sie najgorzej). */
@media (min-width: 721px) {
  .mascot-card { flex-direction: row; align-items: center; text-align: left; gap: 20px; padding: 18px 22px; }
  .mascot-card svg { width: 108px; height: auto; flex: none; }
  .mascot-text { align-items: flex-start; flex: 1; }
  .mascot-caption { max-width: 72ch; }
  .mascot-actions { justify-content: flex-start; }
  .mascot-label { margin-top: 0; }
}

/* ---------- Kafelki kokpitu ----------
   Liczby do lewej razem z podpisem: srodkowanie zmuszalo oko do skakania na
   os kazdego kafelka z osobna. Cyfry tabelaryczne, zeby „12" i „43" nie
   przeskakiwaly przy odswiezeniu. */
.dash-tile { text-align: left; padding: 16px 18px; }
.dash-num { font-size: var(--f7); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-tile .num { font-variant-numeric: tabular-nums; }
/* Stan niesla PELNA obwodka w kolorze plus podwojony pierscien - kafelek
   z jednym postem do przegladu wygladal jak awaria. Zostaje delikatna kreska
   i poswiata (w ciemnym motywie robi robote), a sygnal dostaje wlasny pasek
   przy lewej krawedzi: widac go katem oka, nie krzyczy. */
.dash-tile.err, .dash-tile.ok, .dash-tile.ok-glow, .dash-tile.warn {
  box-shadow: var(--shadow-sm), 0 0 22px -10px currentColor;
}
.dash-tile.err { border-color: color-mix(in srgb, var(--err) 55%, var(--border)); color: var(--err); }
.dash-tile.ok, .dash-tile.ok-glow { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); color: var(--ok); }
.dash-tile.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); color: var(--warn); }
.dash-tile.err::before, .dash-tile.ok::before, .dash-tile.ok-glow::before, .dash-tile.warn::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 var(--r-pill) var(--r-pill) 0; background: currentColor;
}
/* Kolor stanu zostaje na obwodce i pasku; tekst wraca do czytelnego. */
.dash-tile.err .dash-num, .dash-tile.ok .dash-num,
.dash-tile.ok-glow .dash-num, .dash-tile.warn .dash-num { color: var(--text); }
.dash-tile.err .muted, .dash-tile.ok .muted,
.dash-tile.ok-glow .muted, .dash-tile.warn .muted { color: var(--muted); }

/* ---------- Naglowek widoku ----------
   Przy przewijaniu dlugiego kalendarza znikala informacja, na czym sie stoi. */
.view-header {
  position: sticky; top: 0; z-index: 5; margin: 0 -28px 18px; padding: 4px 28px 12px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
@media (max-width: 880px) { .view-header { margin: 0 -14px 14px; padding: 4px 14px 10px; } }

/* ---------- Pasek kafelkow na telefonie ----------
   Kafelki przewijaja sie w bok, ale nic tego nie zapowiadalo: ostatni widoczny
   byl po prostu UCIETY i wygladal na uszkodzony. Zanik przy prawej krawedzi
   mowi, ze cos tam jeszcze jest. */
@media (max-width: 880px) {
  .stat-row {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
  }
}

/* Chip z tytulem wysadzil siatke miesiaca: `1fr` respektuje min-content, wiec
   nieprzycinalny tytul rozpychal kolumne na cala szerokosc ekranu (siedem
   kolumn zeszlo do poltorej). Przyciecie dziala dopiero, gdy KAZDY przodek
   moze byc wezszy od swojej tresci - stad `minmax(0, 1fr)` na siatce
   i `min-width: 0` na chipie. Widac to tylko w przegladarce; w jsdom nie ma
   ukladu, wiec poprzedni audyt nie mial jak tego zlapac. */
.grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.post-chip.chip-2w { min-width: 0; }
.chip-tytul { min-width: 0; max-width: 100%; }

/* Znacznik statusu w legendzie kalendarza. Kolor bierze z tych samych klas
   `status-*`, ktore maluja chipy - jedno zrodlo prawdy, wiec legenda nie moze
   sie rozjechac z siatka. */
.legenda-stan {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none;
  background: currentColor;
}
.legenda .post-chip, .legenda span { align-items: center; }
.legenda-stan.status-DRAFT { color: var(--muted); }
.legenda-stan.status-REVIEW { color: var(--warn); }
.legenda-stan.status-APPROVED, .legenda-stan.status-SCHEDULED { color: var(--ok); }
.legenda-stan.status-PUBLISHED { color: var(--info); }
.legenda-stan.status-REJECTED { color: var(--err); }
.legenda-stan.status-ERROR { color: var(--fail); }

/* ---------- Domkniecie przegladu z 2026-08-18 ----------
   Rzeczy zostawione w pierwszym podejsciu jako „do decyzji operatora"
   albo „osobna przebudowa". Operator przeszedl po liscie. */

/* Listy rozwijane mialy tlo, obwodke i promien panelu, ale strzalke rysowal
   system - obok przyciskow z wlasnym stylem widac bylo, ze sa z innego swiata
   (najmocniej na Chrome/Linuksie, gdzie kontrolka jest plaska i szara).
   Strzalka jest teraz nasza. Szarosc `#8b8f9c` czyta sie na obu motywach, wiec
   nie trzeba dwoch obrazkow. `padding-right` robi jej miejsce, zeby dluga nazwa
   marki nie wchodzila pod strzalke. */
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238b8f9c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select::-ms-expand { display: none; }

/* Pasek narzedzi kalendarza na telefonie: bylo PIEC rzedow kontrolek, zanim
   pokazala sie pierwsza tresc - przelacznik widoku, marka, nawigacja dat,
   „Pokazuj odrzucone" i „Dodaj post", kazde w swoim wierszu. Dwa ostatnie
   dzielą teraz jeden rzad, a nawigacja dat rozklada sie na cala szerokosc,
   wiec strzalki trafiaja pod kciuk przy krawedziach. */
@media (max-width: 560px) {
  .toolbar-kalendarz { gap: 8px; margin-bottom: 12px; }
  .toolbar-kalendarz > .toolbar-group { width: 100%; }
  .toolbar-kalendarz > .toolbar-group.date-nav { justify-content: space-between; }
  .toolbar-kalendarz > .toolbar-group.date-nav strong { flex: 1; text-align: center; }
  .toolbar-kalendarz > .toolbar-group:nth-last-child(-n+2) { width: auto; flex: 1 1 45%; }
  .toolbar-kalendarz > .toolbar-group:last-child { justify-content: flex-end; }
  .toolbar-kalendarz select { flex: 1; }
}

/* Kolejka wg marek: byl wiersz tekstu na calej szerokosci karty, w ktory nie
   dalo sie kliknac. Teraz kazda marka prowadzi do swojej kolejki przegladu. */
.kolejka-marek h3 { margin-bottom: 10px; }
.kolejka-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.kolejka-marka {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: inherit; font-size: var(--f3); color: var(--text); cursor: pointer; text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
@media (hover: hover) { .kolejka-marka:hover { border-color: var(--accent); background: var(--accent-soft); } }
.kolejka-nazwa { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.kolejka-spoznione {
  font-size: var(--f1); font-weight: 600; padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--err-soft); color: var(--err); white-space: nowrap;
}
.kolejka-licznik { font-variant-numeric: tabular-nums; font-size: var(--f4); }

/* Notka „X po terminie" na kafelku kokpitu - jedyna czesc kolejki, ktora jest
   naprawde zalegloscia, wiec jedyna, ktora ma prawo byc czerwona. */
.tile-note.tile-alarm { color: var(--err); font-weight: 600; }

/* Tytul w siatce miesiaca lamie sie na dwie linie zamiast urywac po jednej.
   Kolumna ma okolo 140 px, wiec jedna linia miescila trzy slowa - a to wlasnie
   tytul jest powodem, dla ktorego chip przestal byc sama godzina. */
.chip-tytul {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}

/* Tytul w liscie dnia urywal sie po JEDNEJ linii - na telefonie to okolo
   20 znakow, czyli „Witaminy z grupy B a ...". Lista jest domyslnym widokiem
   kalendarza na telefonie, wiec to wlasnie tam tytul jest najbardziej potrzebny.
   Na monitorze jedna linia wystarcza i trzyma wiersze rowno. */
@media (max-width: 880px) {
  .post-row .meta .title {
    white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
  }
}

/* Cofniecie akceptacji na zatwierdzonym poscie. Wyglada jak wiersz rolki, bo
   to ten sam rodzaj rzeczy: jedno dzialanie z wyjasnieniem obok, a nie decyzja
   z pary „zaakceptuj / odrzuc" - dlatego stoi osobno, pod nimi. */
.actions-row.actions-cofnij {
  align-items: center;
  gap: 8px;
  font-size: var(--f3);
}
.actions-cofnij button { flex: 0 0 auto; white-space: nowrap; }
.actions-cofnij .muted { font-size: var(--f2); }
@media (max-width: 560px) {
  .actions-cofnij .muted { flex: 1 0 100%; margin-left: 0; }
}

/* Zdjecie zablokowane dla calej marki („nie uzywac"). Musi byc widoczne na
   pierwszy rzut oka i odwracalne jednym klikniecem - blokada zakladana zdaniem
   przy jednym poscie dziala na wszystkie przyszle posty tej marki. */
/* Przygaszamy SAM OBRAZEK, nie caly kafelek: `opacity` na kafelku brala ze soba
   plakietke i przycisk, przez co jedyne dwie rzeczy, ktore maja tu byc czytelne,
   robily sie blade. */
.site-asset.zablokowany { border-color: var(--err); }
.site-asset.zablokowany img { filter: grayscale(1); opacity: 0.5; }
/* `.site-asset span` (0,1,1) bije samo `.site-asset-plakietka` (0,1,0) i
   nadpisywalo kolor na szary - bialy napis na czerwonym tle znikal. */
.site-asset .site-asset-plakietka {
  position: absolute;
  top: 6px; left: 6px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--err);
  color: #fff;
  font-size: var(--f1);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.site-asset .site-asset-odblokuj {
  position: absolute;
  bottom: 6px; right: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: var(--f1);
}

/* „Zapamietaj jako trwaly fakt o marce" — pod polem uwagi do tresci. Stoi
   osobno i ma pelne zdanie zamiast etykiety, bo to jedyne miejsce w panelu,
   ktore zapisuje cos NA STALE dla calej marki. */
.rev-fakt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  font-size: var(--f2);
  color: var(--muted);
  cursor: pointer;
}
.rev-fakt input { margin-top: 2px; flex: 0 0 auto; }

/* Lista faktow o marce. Kazdy wiersz to zdanie, wiec nie skracamy go do jednej
   linii - operator ma widziec, co dokladnie wiaze agenta. */
.fakty-lista { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.fakty-lista li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-control);
  border-radius: var(--r-md);
  font-size: var(--f3);
}
.fakty-lista li span { flex: 1 1 auto; }
.fakty-lista li.muted { border-style: dashed; }
.fakty-dodaj { display: grid; gap: 8px; margin-top: 10px; }
.fakty-dodaj button { justify-self: start; }

/* Widok sciany: siatka trzech kolumn, dokladnie jak na profilu. Bez odstepow —
   Instagram tez ich nie ma, a nawet kilkupikselowa przerwa zmienia wrazenie
   spojnosci, czyli jedyna rzecz, ktora ten widok ma pokazac. */
.sciana {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  max-width: 760px;
}
.sciana-opis { margin: 0 0 10px; }
/* Granica miesiaca na scianie: PIONOWA kreska na pierwszym kafelku miesiaca.
   Poprzednia wersja szla przez cala szerokosc siatki (`grid-column: 1 / -1`)
   i wypychala kazdy miesiac do nowego wiersza - na koncu poprzedniego rzedu
   zostawaly DZIURY. Sciana ma byc nieprzerwana jak profil na Instagramie, wiec
   znacznik mieszka W kafelku i nie zajmuje wlasnego miejsca w siatce. */
/* Kreska musi byc NAD grafika. `box-shadow: inset` rysuje sie pod trescia
   kafelka, a ta jest obrazkiem na cala powierzchnie - linia byla wiec
   niewidoczna (wyszlo dopiero na zrzucie, w kodzie wygladalo poprawnie).
   `::after` jest zajete przez pasek stanu, wiec bierzemy `::before`. */
.sciana-kafelek.zaczyna-miesiac::before {
  content: '';
  position: absolute;
  /* PRAWA krawedz: kafelek zaczynajacy miesiac zamyka blok od dolu, a znacznik
     po prawej nie zderza sie z plakietka roli (ta siedzi w lewym gornym rogu). */
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  z-index: 2;
}
.sciana-miesiac-pion {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 6px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);   /* czyta sie z dolu do gory */
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.75);
  pointer-events: none;
  max-height: calc(100% - 12px);
  overflow: hidden;
}
.nieaktywny { opacity: .35; cursor: default; }
.sciana-kafelek {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
}
.sciana-kafelek img,
.sciana-kafelek video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Pasek stanu przy dolnej krawedzi zamiast ramki: ramka na kafelku 4:5 zjada
   kadr i falszuje to, co operator ocenia. */
.sciana-kafelek::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: currentColor; opacity: .9;
}
.sciana-rola {
  position: absolute; top: 6px; left: 6px;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: rgba(0,0,0,.6); color: #fff;
  font-size: var(--f1); letter-spacing: .04em;
}
@media (max-width: 620px) { .sciana { max-width: 100%; } }

/* Rodzaj materialu na kafelku galerii. Maly select w rogu, a nie osobny ekran:
   operator ustawia to przy okazji przegladania zdjec, nie w drugim miejscu. */
.site-asset-kategoria {
  position: absolute; right: 6px; top: 6px;
  max-width: calc(100% - 48px);
  padding: 2px 6px;
  font-size: var(--f1);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-control);
  background: rgba(255,255,255,.92);
  color: #111;
}

/* Napisy na apli w panelu kadru. Pola stoja pod suwakami, bo nalezą do tego
   samego kroku: operator ustawia kadr i od razu widzi, co bedzie pod nim. */
.kadr-napisy { display: grid; gap: 8px; margin-top: 10px; }
.kadr-napisy label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.kadr-napisy input[type="text"] {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: var(--r-sm, 8px); background: var(--bg); color: var(--fg);
  font-size: 13.5px;
}
