/* Biblioteka demo /demo i interaktywne dema „Zobacz demo” [data-tour] (04.10.2026).
   Wzorzec jak w SaaS-ach: okno na cały ekran, plansza startowa, przyciemnienie z podświetlonym
   elementem i pulsującym punktem, dymek z jednym zdaniem, klik w element = kolejny stan, plansza z CTA.
   Tylko tokeny z daplo.css i klasy makiet .mk; zachowanie w site.js (Demo interaktywne). */

/* ---------- zajawka na stronach: podgląd + „Zobacz demo” ---------- */
.tz { align-items: center; row-gap: 32px; }
.tz__t { display: grid; gap: 16px; align-content: center; }
.tz__t .h2, .tz__t .lead { margin: 0; }
.tz__t .btn-rzad { align-items: center; margin-top: 8px; }
.tz__podglad { position: relative; display: block; border-radius: var(--r-m); color: inherit; text-decoration: none; cursor: pointer; }
.tz__mk { height: 380px; pointer-events: none; }
@media (max-width: 767px) { .tz__mk { height: 300px; } .tz__mk .mk__app { grid-template-columns: minmax(0, 1fr); } .tz__mk .mk__bok { display: none; } }
.tz__ekran { min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; container-type: inline-size; }
.tz__graj { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; border-radius: var(--r-m); background: rgba(11, 13, 16, .28); transition: background-color var(--ruch-szybki); }
.tz__kolo { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: var(--czern); color: #fff; box-shadow: var(--cien); transition: transform var(--ruch-szybki) var(--krzywa); }
.tz__kolo .ik { width: 30px; height: 30px; margin-left: 3px; }
.tz__napis { padding: 6px 14px; border-radius: 999px; background: #fff; font-size: .9375rem; font-weight: 600; }
.tz__podglad:hover .tz__graj { background: rgba(11, 13, 16, .38); }
.tz__podglad:hover .tz__kolo { transform: scale(1.06); }
.tz__podglad:focus-visible { outline: 3px solid var(--fokus); outline-offset: 3px; }

/* ---------- okno demo ---------- */
html.tour-otwarty { overflow: hidden; }
.tour {
  width: min(1280px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: var(--r-m); background: var(--panel); color: var(--czern); overflow: clip;
}
.tour[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.tour::backdrop { background: rgba(11, 13, 16, .72); }
.tour__gora { position: relative; display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 24px; background: #fff; border-bottom: 1px solid var(--linia); }
.tour__tytul { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tour__nazwa { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tour__et { flex: none; }
.tour__et { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--stal); }
.tour__licznik { margin: 0; font-size: .9375rem; font-weight: 600; color: var(--stal); white-space: nowrap; }
.tour__cta { flex: none; }
.tour__x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r-s); background: transparent; color: var(--czern); cursor: pointer; }
.tour__x:hover { background: var(--tlo-2); }
.tour__postep { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.tour__postep i { display: block; width: 0; height: 100%; background: var(--czern); transition: width 300ms var(--krzywa); }
.tour__cialo { position: relative; min-height: 0; padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); overflow: clip; }
.tour__scena { position: relative; width: 100%; max-width: 1100px; min-height: 0; height: min(100%, 620px); margin: 0 auto; align-self: center; }
.tour__mk { height: 100%; }
.tour__mk .mk__app { grid-template-columns: 52px minmax(0, 1fr); }
.tour__stany { position: relative; min-width: 0; container-type: inline-size; }
.tour__stan { position: absolute; inset: 0; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; overflow: clip; visibility: hidden; opacity: 0; transition: opacity 220ms var(--krzywa), visibility 0s linear 220ms; }
.tour__stan.jest { visibility: visible; opacity: 1; transition: opacity 220ms var(--krzywa); }
.tour__stan.jest .zn { --zn-t: 1; transition-delay: 350ms; }
.tour__stan.jest .nowe { animation: d90-wjazd 380ms var(--krzywa) 120ms both; }

/* podświetlenie: przyciemnienie makiety wokół elementu, obramowanie w kolorze sygnału */
.tour .tour-cel { position: relative; z-index: 2; border-radius: 8px; box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--sygnal), 0 0 0 200vmax rgba(11, 13, 16, .42); transition: box-shadow 200ms var(--krzywa); }
.tour .tour-cel--klik { cursor: pointer; }
.tour span.tour-cel { border-radius: 4px; }
/* tabela i karta przycinają cień: przy podświetlonym wierszu przyciemnienie musi wyjść poza nie */
.tour .mk__tab:has(.tour-cel), .tour .mk__karta:has(.tour-cel) { overflow: visible; }
.tour__punkt { position: absolute; z-index: 6; display: none; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--sygnal); border: 3px solid #fff; pointer-events: none; animation: tour-puls 1.6s ease-out infinite; }
.tour__punkt.jest { display: block; }
@keyframes tour-puls { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .6); } 70% { box-shadow: 0 0 0 18px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }

/* dymek z opisem kroku */
.tour__dymek { position: absolute; z-index: 7; display: none; gap: 10px; width: min(340px, calc(100% - 32px)); padding: 18px 18px 12px; border-radius: var(--r-m); background: var(--czern); color: #fff; box-shadow: var(--cien); }
.tour__dymek.jest { display: grid; }
.tour__nr { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mgla); }
.tour__tekst { margin: 0; font-size: 1.0625rem; line-height: 1.45; }
.tour__akcje { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour__wstecz { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px 0 0; border: 0; background: transparent; color: var(--mgla); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.tour__wstecz:hover { color: #fff; }
.tour__wstecz:disabled { visibility: hidden; }
.tour__dymek .btn { --btn-tlo: #fff; --btn-tekst: var(--czern); --btn-obrys: #fff; }

/* plansze: start i koniec */
.tour__plansza { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; padding: 24px; background: rgba(244, 245, 247, .94); }
.tour__plansza[hidden] { display: none; }
.tour__plansza > * { max-width: 620px; }
.tour__plansza .h2 { margin: 8px 0 12px; }
.tour__plansza .lead { margin: 0 0 24px; }
.tour__plansza > .btn { justify-self: start; }
.tour__znowu { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--czern); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 767px) {
  .tour { width: 100vw; height: 100dvh; border-radius: 0; }
  .tour__gora { gap: 8px; padding: 8px 8px 8px 16px; }
  .tour__et, .tour__cta { display: none; }
  .tour__cialo { padding: 12px 12px 0; }
  .tour__scena { display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); height: 100%; align-self: stretch; }
  .tour__mk .mk__app { grid-template-columns: minmax(0, 1fr); }
  .tour__mk .mk__bok { display: none; }
  .tour__stan { padding: 14px; gap: 10px; }
  .tour__dymek { position: relative; width: auto; margin: 12px -12px 0; border-radius: var(--r-m) var(--r-m) 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .tour__punkt { animation: none; box-shadow: 0 0 0 6px rgba(245, 158, 11, .35); }
  .tour__stan, .tour__stan.jest { transition: none; }
  .tour__stan.jest .nowe { animation: none; }
}

/* ---------- elementy ekranów ---------- */
.d90-lista { display: grid; gap: 6px; }
.d90-wiersz {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 12px;
  border: 1px solid var(--linia); border-radius: 8px; font-size: 13px;
}
.d90-wiersz b { font-weight: 600; font-size: 14px; }
.d90-wiersz em { font-style: normal; color: var(--stal); }
.d90-wiersz span { grid-column: 1 / -1; color: var(--stal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d90-wiersz--nowy { border-color: var(--czern); box-shadow: inset 3px 0 0 var(--czern); }
.d90-mail { font-size: 13.5px; line-height: 1.55; }
.d90-mail p { margin: 0; }
.d90-mail__od { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 4px !important; }
.d90-mail__od .ik { width: 14px; height: 14px; }
.d90-mail--maly { font-size: 13px; color: var(--stal); }
.d90-ai {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; width: max-content;
  background: var(--pole); font-size: 12px; font-weight: 600; color: var(--czern); white-space: nowrap;
}
.d90-ai .ik { width: 12px; height: 12px; }
.d90-et { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--stal); }
.d90-et .ik { width: 13px; height: 13px; }
.d90-pola { display: grid; gap: 8px; }
.d90-pole { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; font-size: 13.5px; }
.d90-pole > span:first-child { color: var(--stal); }
.d90-pole b { font-weight: 600; min-width: 0; }
.d90-pola--siatka { gap: 10px 16px; }
@container (min-width: 520px) {
  .d90-pola--siatka { grid-template-columns: 1fr 1fr; }
  .d90-pola--siatka .d90-pole { grid-template-columns: minmax(0, 1fr) auto; }
  .d90-pola--siatka .d90-pole > span:first-child { grid-column: 1 / -1; font-size: 12.5px; }
}
.d90-puste { display: block; width: min(70%, 220px); height: 14px; margin-top: 3px; border-radius: 4px; background: var(--tlo-2); border: 1px dashed var(--szkielet); }
.d90-tekst { margin: 0; font-size: 13.5px; line-height: 1.55; }
.d90-tekst--maly { font-size: 13px; color: var(--stal); }
.d90-osoba { display: flex; align-items: center; gap: 10px; }
.d90-osoba div { display: grid; flex: 1; min-width: 0; }
.d90-osoba b { font-size: 14px; font-weight: 600; }
.d90-osoba span:not(.d90-ai):not(.mk__av) { font-size: 13px; color: var(--stal); }
.d90-przyciski { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mk__btn--2 { background: #fff; color: var(--czern); box-shadow: inset 0 0 0 1px var(--obrys-ui); }
.tour__stan.jest .d90-klik { animation: d90-klik 900ms var(--krzywa) 900ms both; }
@keyframes d90-klik { 0%, 100% { transform: none; } 45% { transform: scale(.94); box-shadow: 0 0 0 4px var(--pole); } }
.d90-toast { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--ok-tlo); font-size: 13px; font-weight: 600; }
.d90-toast .ik { width: 16px; height: 16px; color: var(--ok); }
.tour__stan.jest .d90-toast { animation: d90-wjazd 400ms var(--krzywa) 1600ms both; }
@keyframes d90-wjazd { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.d90-szkic { display: grid; gap: 8px; padding: 12px 14px; border: 1px dashed var(--obrys-ui); border-radius: 8px; background: var(--papier); font-size: 13.5px; line-height: 1.55; }
.d90-szkic p { margin: 0; }
.d90-skr { color: var(--stal); text-decoration-thickness: 1.5px; }
.d90-hist { list-style: none; margin: 0; padding: 0 0 0 14px; display: grid; gap: 10px; border-left: 2px solid var(--linia); font-size: 13.5px; }
.d90-hist li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; position: relative; }
.d90-hist li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--czern); }
.d90-hist em { font-style: normal; color: var(--stal); }
.d90-spolki { display: grid; gap: 8px; }
.d90-spolka { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--linia); border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--stal); }
.d90-spolka .ik { width: 16px; height: 16px; }
.d90-spolka--jest { border: 2px solid var(--czern); color: var(--czern); }
.d90-postep { height: 8px; border-radius: 4px; background: var(--tlo-2); overflow: hidden; }
.d90-postep i { display: block; height: 100%; width: 0; background: var(--czern); }
.tour__stan.jest .d90-postep i { animation: d90-postep 2400ms var(--krzywa) 900ms forwards; }
@keyframes d90-postep { to { width: 100%; } }
.d90-skany { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
@container (max-width: 420px) { .d90-skany { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; } }
.d90-skany .mk__skan { padding: 4px 3px; gap: 2px; }
.tour__stan.jest .d90-skany .mk__skan { animation: d90-wjazd 300ms var(--krzywa) both; animation-delay: calc(500ms + var(--i, 0) * 40ms); }
.d90-wynik { margin: 0; font-size: 15px; }
.d90-plik { display: flex; align-items: center; gap: 12px; }
.d90-plik__ik { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--tlo-2); }
.d90-plik div { display: grid; }
.d90-plik b { font-size: 14px; font-weight: 600; }
.d90-plik span:not(.d90-plik__ik) { font-size: 13px; color: var(--stal); }
@media (prefers-reduced-motion: reduce) {
  .tour__stan, .tour__stan.jest { transition: none; }
  .tour__stan.jest .d90-klik, .tour__stan.jest .d90-toast, .tour__stan.jest .d90-skany .mk__skan { animation: none; }
  .tour__stan.jest .d90-postep i { animation: none; width: 100%; }
}

/* zasady AI pod demem z maila */
.d90-zasady { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 768px) { .d90-zasady { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.d90-zasady li { display: flex; gap: 14px; align-items: flex-start; }
.d90-zasady .poj { flex: none; }
.d90-zasady b { display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.d90-zasady p { margin: 4px 0 0; color: var(--stal); line-height: 1.5; }

/* biblioteka: karty jak galeria klocków, pięć w siatce */
.demo-lista { margin-top: 8px; }
.demo-lista .klocek__mk .d90-wiersz span { white-space: nowrap; }

/* ---------- dema systemu dla zarządcy: widok lokatora w telefonie, panel zarządcy ---------- */
.d90-widok { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--pole); font-size: 12px; font-weight: 700; white-space: nowrap; }
.d90-widok--z { background: var(--tlo-2); }
.d90-tel { align-self: center; width: min(300px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 16px; border: 2px solid var(--szkielet); border-radius: 26px; background: #fff; }
.d90-tel__g { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--linia); }
.d90-tel__g .mk__mono { width: 24px; height: 24px; font-size: 12px; }
.d90-tel__g b { flex: 1; font-size: 14px; font-weight: 600; }
.d90-tel__l { font-size: 12px; color: var(--stal); }
.d90-tel__btn { justify-content: center; width: 100%; height: 36px; }
.d90-tel .mk__karta { display: grid; gap: 8px; }
.d90-tel .mk__karta b { font-size: 14px; font-weight: 600; }
.d90-chip--jest { border-color: var(--czern); background: var(--czern); color: #fff; }
.d90-pole-tel { padding: 8px 10px; border: 1px solid var(--linia); border-radius: 8px; }
.d90-zdjecia { display: flex; gap: 8px; }
.d90-foto { width: 72px; aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 6px; background: var(--tlo-2); border: 1px solid var(--linia); color: var(--stal); }
.d90-foto .ik { width: 22px; height: 22px; }
.d90-statusy { display: flex; flex-wrap: wrap; gap: 6px; }
.d90-st { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--linia); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--stal); }
.d90-st--bylo { color: var(--czern); }
.d90-st--jest { border-color: var(--czern); background: var(--czern); color: #fff; }
.d90-szczegol { display: flex; gap: 14px; align-items: flex-start; }
.d90-szczegol .d90-foto { width: 120px; }
.d90-tr { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; }
.d90-tr > span:not(.mk__status):not(.mk__btn) { color: var(--stal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d90-tr .mk__btn { height: 28px; }
.d90-fak .d90-tr { grid-template-columns: minmax(0, 1fr) auto auto; }
.d90-tr--suma { background: var(--tlo-2); }
.d90-kwota { font-size: 22px; font-weight: 600; }
.d90-status--po { background: var(--err-tlo); }
.d90-status--po::before { background: var(--err); }
.d90-licznik { margin: 0; align-self: flex-start; padding: 6px 12px; border-radius: 8px; background: var(--czern); color: #fff; font-size: 24px; font-weight: 600; letter-spacing: .18em; }
.d90-btn--off { background: var(--tlo-2); color: var(--stal); }
.d90-wykres { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding: 12px 8px 0; border-bottom: 1px solid var(--linia); }
.d90-slupek { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.d90-slupek i { display: block; width: 100%; max-width: 44px; height: var(--h); border-radius: 4px 4px 0 0; background: var(--szkielet); }
.d90-slupek--jest i { background: var(--czern); }
.d90-slupek em { font-style: normal; font-size: 12px; color: var(--stal); padding-bottom: 6px; }
@container (max-width: 420px) {
  .d90-tr { grid-template-columns: minmax(0, 1fr) auto; }
  .d90-tr > span:not(.mk__status):not(.mk__btn) { display: none; }
  .d90-fak .d90-tr { grid-template-columns: minmax(0, 1fr) auto; }
  .d90-fak .d90-tr > b:nth-of-type(1):not(:last-child) { display: none; }
  .d90-szczegol { flex-direction: column; }
}

/* ---------- przyciski „Zobacz demo” w sekcjach o procesie i w case study (build/demo_wejscia2.py) ---------- */
.demo-wejscie { margin: 20px 0 0; }
.ns__bok .demo-wejscie { margin-top: 16px; }
.demo-trzy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 20px; }
.demo-trzy__t { width: 100%; font-size: .9375rem; font-weight: 600; color: var(--stal); }
