/* Warstwa Cyfrowni: pasek akcji, czat, kreator, tryb pokazowy */
body.ma-pasek { padding-bottom: 0; }
body.ma-pasek .stopka { padding-bottom: 130px; }

/* pasek akcji */
.pasek-akcji { position: fixed; z-index: 70; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(440px, calc(100% - 24px)); padding: 7px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 92%, transparent); backdrop-filter: blur(12px); box-shadow: 0 18px 40px -14px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.08); animation: pasekWjazd .8s .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pasekWjazd { from { transform: translate(-50%, 140%); } }
.pa-przycisk { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; border-radius: 999px; border: 0; font: 700 16px var(--body); cursor: pointer; transition: transform .15s; }
.pa-przycisk:active { transform: scale(.96); }
.pa-przycisk svg { width: 20px; height: 20px; }
.pa-wycena { background: rgba(255,255,255,.1); color: #fff; }
.pa-zadzwon { background: var(--akcent); color: var(--na-akcencie); }

/* awatar czatu */
.czat-awatar { position: fixed; z-index: 71; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); width: 74px; height: 74px; border-radius: 50%; border: 0; padding: 0; background: #fff; box-shadow: 0 14px 30px -10px rgba(0,0,0,.55); cursor: pointer; isolation: isolate; animation: awatarWjazd .9s 1.2s cubic-bezier(.3,1.4,.4,1) both; }
@keyframes awatarWjazd { from { transform: scale(0) rotate(-30deg); } }
.czat-awatar img { position: absolute; left: 50%; bottom: 0; width: 118%; border-radius: 0 0 50% 50%; transform: translateX(-50%); transform-origin: 50% 100%; animation: kiwanie 3.2s ease-in-out infinite; pointer-events: none; }
.czat-awatar { overflow: visible; }
.czat-awatar::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #fff; z-index: -1; }
@keyframes kiwanie { 0%, 100% { transform: translateX(-50%) rotate(-4deg); } 50% { transform: translateX(-50%) rotate(5deg) translateY(-3px); } }
.czat-fala { position: absolute; inset: 0; border-radius: 50%; z-index: -2; background: var(--akcent-2); animation: fala2 2.4s ease-out infinite; }
@keyframes fala2 { from { transform: scale(1); opacity: .55; } to { transform: scale(1.55); opacity: 0; } }
.czat-awatar.postac { width: 84px; height: 96px; border-radius: 0; background: none; box-shadow: none; overflow: visible; animation: postacWjazd 1s 1.2s cubic-bezier(.2,.8,.2,1) both; }
.czat-awatar.postac::after { display: none; }
.czat-awatar.postac img { left: 0; bottom: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transform: none; border-radius: 0; filter: drop-shadow(0 12px 16px rgba(0,0,0,.45)); animation: oddech 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.czat-awatar.postac.polkole { width: 112px; height: 92px; }
.czat-awatar.polkole img { bottom: 16px; height: auto; width: 112%; left: -6%; object-fit: contain; animation: wynurzenie 3.4s ease-in-out infinite; }
.czat-polkole { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; border-radius: 999px 999px 0 0; background: var(--ink); border-top: 3px solid var(--akcent); box-shadow: 0 -6px 18px -8px rgba(0,0,0,.6), inset 0 6px 12px rgba(255,255,255,.06); }
.czat-polkole::after { content: ''; position: absolute; left: 18%; right: 18%; top: 7px; height: 2px; border-radius: 2px; background: var(--akcent-2); opacity: .5; }
@keyframes wynurzenie { 0%, 100% { transform: translateY(2px) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1.5deg); } }
.czat-cien { position: absolute; left: 18%; right: 18%; bottom: -4px; height: 12px; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(5px); z-index: -1; }
@keyframes postacWjazd { from { transform: translateX(160px); opacity: 0; } }
@keyframes oddech { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.035, .985) rotate(-1.5deg); } }
.czat-awatar.postac:hover img { animation: machniecie .6s ease-in-out; }
@keyframes machniecie { 30% { transform: rotate(-6deg) translateY(-6px); } 60% { transform: rotate(4deg); } }
.czat-monogram { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--akcent); color: var(--na-akcencie); font: 400 34px var(--display); }
body.czat-otwarty .czat-awatar { transform: scale(.9); }

.czat-dymek { position: fixed; z-index: 71; right: 100px; bottom: calc(92px + env(safe-area-inset-bottom)); max-width: min(240px, calc(100vw - 130px)); padding: 11px 15px; border-radius: 16px 16px 4px 16px; background: #fff; color: var(--ink); font-weight: 600; font-size: 14.5px; line-height: 1.3; box-shadow: 0 12px 28px -12px rgba(0,0,0,.45); opacity: 0; transform: translateX(10px) scale(.95); transform-origin: 100% 100%; transition: opacity .35s, transform .35s; pointer-events: none; cursor: pointer; }
.czat-dymek.widac { opacity: 1; transform: none; pointer-events: auto; }

/* panel czatu */
.czat-panel { position: fixed; z-index: 90; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); width: min(390px, calc(100vw - 24px)); height: min(600px, calc(100svh - 120px)); display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--papier); box-shadow: 0 30px 70px -20px rgba(0,0,0,.6); transform: translateY(20px) scale(.96); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s; transform-origin: 100% 100%; }
.czat-panel.otwarty { transform: none; opacity: 1; pointer-events: auto; }
.czat-glowa { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--ink); color: #fff; }
.czat-glowa img, .czat-glowa .czat-monogram { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; object-fit: contain; font-size: 22px; }
.czat-glowa .czat-monogram { background: var(--akcent); }
.czat-glowa div { flex: 1; }
.czat-glowa strong { display: block; font-size: 16px; }
.czat-glowa small { font-size: 12.5px; opacity: .8; display: flex; align-items: center; gap: 6px; }
.czat-glowa small i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; }
.czat-zamknij { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.czat-zamknij svg, .kreator-zamknij svg { width: 18px; height: 18px; }
.czat-wiadomosci { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.czat-msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; animation: wjazd .3s both; }
.czat-msg.bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; box-shadow: 0 6px 16px -10px rgba(0,0,0,.3); }
.czat-msg.ja { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.czat-msg.pisze { display: flex; gap: 4px; padding: 14px; }
.czat-msg.pisze span { width: 7px; height: 7px; border-radius: 50%; background: var(--szary); animation: pisze 1s infinite; }
.czat-msg.pisze span:nth-child(2) { animation-delay: .15s; } .czat-msg.pisze span:nth-child(3) { animation-delay: .3s; }
@keyframes pisze { 50% { transform: translateY(-4px); opacity: .4; } }
.czat-akcja { display: inline-flex; margin: 10px 6px 0 0; padding: 9px 14px; border-radius: 999px; border: 0; background: var(--akcent); color: var(--na-akcencie); font: 700 14px var(--body); cursor: pointer; }
.czat-podpowiedzi { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; }
.czat-podpowiedzi::-webkit-scrollbar { display: none; }
.czat-chip { flex: none; padding: 9px 13px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); background: #fff; color: var(--ink); font: 600 13.5px var(--body); cursor: pointer; }
.czat-pole { display: flex; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid rgba(0,0,0,.06); background: #fff; }
.czat-pole input { flex: 1; min-width: 0; border: 0; background: var(--papier); border-radius: 999px; padding: 0 16px; font: 16px var(--body); height: 46px; }
.czat-pole button { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--akcent); color: var(--na-akcencie); cursor: pointer; }
.czat-pole button svg { width: 20px; height: 20px; }

/* kreator */
.kreator { position: fixed; inset: 0; z-index: 95; display: grid; place-items: end center; pointer-events: none; }
.kreator-tlo { position: absolute; inset: 0; background: rgba(6,14,20,.6); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.kreator-karta { position: relative; width: min(560px, 100%); max-height: 92svh; overflow-y: auto; background: var(--papier); border-radius: 26px 26px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.kreator.otwarty { pointer-events: auto; }
.kreator.otwarty .kreator-tlo { opacity: 1; }
.kreator.otwarty .kreator-karta { transform: none; }
.kreator-karta header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.kreator-karta h2 { font-family: var(--display); text-transform: uppercase; font-size: 30px; line-height: 1.02; margin-top: 4px; }
.kreator-zamknij { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(0,0,0,.07); cursor: pointer; }
.kreator-postep { height: 6px; border-radius: 3px; background: rgba(0,0,0,.08); margin: 16px 0 18px; overflow: hidden; }
.kreator-postep i { display: block; height: 100%; width: 0; background: var(--akcent); transition: width .4s; }
.kreator-licznik { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--szary); }
.kreator-krok h3 { font-size: 21px; margin: 4px 0 14px; line-height: 1.25; }
.kreator-krok.wjazd { animation: wjazd .35s both; }
.kreator-krok.potrzasnij { animation: potrzasnij .35s; }
@keyframes potrzasnij { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.kafle-wyboru { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kw { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 86px; padding: 14px; border-radius: 16px; border: 2px solid transparent; background: #fff; font: 700 15.5px var(--body); color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 8px 20px -14px rgba(0,0,0,.4); transition: border-color .2s, transform .15s; }
.kw:active { transform: scale(.97); }
.kw.wybrany { border-color: var(--akcent); background: color-mix(in srgb, var(--akcent) 8%, #fff); }
.kw-ikona { font-size: 24px; line-height: 1; }
.kreator-suwak output { display: block; font-family: var(--display); font-size: 54px; line-height: 1; color: var(--akcent); margin-bottom: 10px; }
.kreator-suwak input { width: 100%; accent-color: var(--akcent); height: 36px; }
.kpole { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.kpole input { display: block; width: 100%; margin-top: 6px; height: 52px; border-radius: 14px; border: 2px solid rgba(0,0,0,.1); padding: 0 14px; font: 17px var(--body); background: #fff; }
.kpole input:focus { outline: none; border-color: var(--akcent); }
.kpole input.blad { border-color: #d33; }
.kreator-uwaga { font-size: 12.5px; color: var(--szary); }
.kreator-karta footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.kreator-karta footer button { min-height: 52px; padding: 0 22px; border-radius: 999px; border: 0; font: 700 16px var(--body); cursor: pointer; }
.kreator-wstecz { background: transparent; color: var(--ink); }
.kreator-dalej { background: var(--akcent); color: var(--na-akcencie); flex: 1; max-width: 240px; margin-left: auto; }
.kreator-koniec { text-align: center; padding: 6px 0 4px; animation: wjazd .4s both; }
.kk-znak { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--akcent); color: var(--na-akcencie); font-size: 36px; animation: awatarWjazd .6s both; }
.kreator-koniec p { color: #3b4d57; }
.kk-lista { list-style: none; margin-top: 16px; text-align: left; background: #fff; border-radius: 16px; padding: 6px 16px; }
.kk-lista li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 14.5px; }
.kk-lista li:last-child { border: 0; }
.kk-lista span { color: var(--szary); }

/* tryb pokazowy */
.pokaz { position: fixed; inset: 0; z-index: 120; pointer-events: none; opacity: 0; transition: opacity .3s; }
.pokaz.otwarty { opacity: 1; pointer-events: auto; }
.pokaz-krag { position: fixed; box-shadow: 0 0 0 9999px rgba(6,14,20,.78), 0 0 0 3px var(--akcent-2); transition: all .45s cubic-bezier(.2,.8,.2,1); }
.pokaz-krag::after { content: ''; position: absolute; inset: -8px; border-radius: inherit; border: 2px solid var(--akcent-2); animation: fala2 1.6s ease-out infinite; }
.pokaz-karta { position: fixed; background: #fff; color: var(--ink); border-radius: 18px; padding: 16px 18px; box-shadow: 0 20px 50px -16px rgba(0,0,0,.6); transition: left .45s, bottom .45s; }
.pokaz-nr { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--akcent); }
.pokaz-tekst { margin-top: 4px; font-size: 16px; line-height: 1.4; }
.pokaz-tekst b { color: var(--akcent); }
.pokaz-przyciski { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pokaz-przyciski button { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 0; font: 700 14px var(--body); cursor: pointer; }
.pokaz-pomin { background: transparent; color: var(--szary); }
.pokaz-dalej { background: var(--ink); color: #fff; }

.znaczek-cyfrowni { display: inline-block; margin-bottom: 10px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: rgba(244,247,249,.8); font: 500 13px var(--body); cursor: pointer; }
.znaczek-cyfrowni b { color: #fff; }
.znaczek-cennik { margin-left: 8px; text-decoration: none; }
.znaczek-cennik b { color: var(--akcent-2, #fff); }
.stopka { display: flex; flex-direction: column; align-items: center; }

/* przyciski pod tytułem */
.hero-akcje { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; opacity: 0; animation: wjazd .8s 1.6s forwards; }
.hero-akcje .na-przycisk { min-height: 54px; padding: 0 26px; font-size: 16px; }
@media (max-width: 860px) { .hero-akcje { display: none; } }
.na-przycisk { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0; font: 700 15px var(--body); cursor: pointer; transition: transform .15s, box-shadow .2s; }
.na-przycisk svg { width: 18px; height: 18px; }
.na-przycisk:hover { transform: translateY(-2px); }
.na-wycena { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.na-zadzwon { background: var(--akcent); color: var(--na-akcencie); box-shadow: 0 10px 24px -10px var(--akcent); }


@media (min-width: 861px) {
  .pasek-akcji { display: none; }
  .czat-awatar { bottom: 22px; right: 24px; width: 84px; height: 84px; }
  .czat-awatar.postac { width: 150px; height: 170px; right: 20px; bottom: 12px; }
  .czat-awatar.postac.polkole { width: 170px; height: 132px; bottom: 18px; }
  .czat-polkole { height: 40px; }
  .czat-awatar.polkole img { bottom: 22px; }
  .czat-dymek { right: 122px; bottom: 34px; }
  .czat-awatar.postac ~ .czat-dymek, body:has(.czat-awatar.postac) .czat-dymek { right: 176px; bottom: 30px; }
  body:has(.czat-awatar.postac) .czat-panel { bottom: 196px; }
  .czat-panel { bottom: 118px; right: 24px; }
}
@media (max-width: 560px) {
  .czat-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 88svh; border-radius: 22px 22px 0 0; z-index: 96; }
  body.czat-otwarty .czat-awatar, body.czat-otwarty .czat-dymek, body.kreator-otwarty .czat-awatar { opacity: 0; pointer-events: none; }
  .czat-dymek { right: 96px; }
  body:has(.czat-awatar.postac) .czat-dymek { right: 122px; }
}
@media (prefers-reduced-motion: reduce) { .czat-fala, .pokaz-krag::after, .czat-awatar img { animation: none; } }

/* ---------- przejście do cennika Cyfrowni ---------- */
.do-cennika { position: relative; overflow: hidden; background: linear-gradient(120deg, #021836 0%, #06385F 55%, #0A95C9 130%); color: #fff; padding: clamp(56px, 8vw, 96px) 20px; }
.do-cennika::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(127,211,242,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(127,211,242,.08) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.dc-w { position: relative; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
.dc-w > img { width: 120px; filter: drop-shadow(0 18px 24px rgba(0,0,0,.35)); }
.dc-et { font: 600 12px var(--body); letter-spacing: .16em; text-transform: uppercase; color: #7FD3F2; }
.do-cennika h2 { font-family: var(--display); font-size: clamp(30px, 4.2vw, 54px); line-height: 1.02; text-transform: uppercase; margin: 8px 0 10px; font-weight: 400; }
.do-cennika h2 em { font-style: normal; color: #FC6E08; }
.do-cennika p:not(.dc-et) { color: #C4D6E6; max-width: 34em; }
.dc-przycisk { display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #021836; font-weight: 700; text-decoration: none; border-radius: 14px; padding: 16px 22px; white-space: nowrap; box-shadow: 0 16px 30px -12px rgba(0,0,0,.5); transition: transform .2s; }
.dc-przycisk:hover { transform: translateY(-2px); }
@keyframes sowaWlot { from { opacity: 0; transform: translateY(24px) rotate(-8deg) scale(.8); } }
.kurtyna-cyfrowni { position: fixed; inset: 0; z-index: 200; background: radial-gradient(circle at 50% 45%, #FFFFFF, #E6EFF6 70%); display: grid; place-items: center; clip-path: circle(0% at 50% 100%); transition: clip-path .7s cubic-bezier(.7,0,.2,1); pointer-events: none; }
.kc-srodek { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.kc-sowa { width: min(190px, 42vw); opacity: 0; transform: translateY(20px) scale(.85); filter: drop-shadow(0 22px 30px rgba(2,24,54,.28)); }
.kc-napis { width: min(300px, 64vw); opacity: 0; }
.kc-pasek { width: 120px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #0A95C9, #FC6E08); transform: scaleX(0); transform-origin: left; }
.kurtyna-cyfrowni.zaslania { clip-path: circle(150% at 50% 100%); pointer-events: auto; }
.kurtyna-cyfrowni.zaslania .kc-sowa { animation: kcSowa .7s .35s cubic-bezier(.2,.9,.2,1.25) forwards; }
.kurtyna-cyfrowni.zaslania .kc-napis { animation: kcNapis .5s .55s forwards; }
.kurtyna-cyfrowni.zaslania .kc-pasek { animation: kcPasek .5s .6s ease-out forwards; }
@keyframes kcSowa { to { opacity: 1; transform: none; } }
@keyframes kcNapis { to { opacity: 1; } }
@keyframes kcPasek { to { transform: scaleX(1); } }
@media (max-width: 760px) {
  .dc-w { grid-template-columns: 1fr; gap: 18px; }
  .dc-w > img { width: 84px; }
  .dc-przycisk { width: 100%; }
}

@media (max-width: 760px) { .czat-dymek { font-size: 13px; padding: 9px 12px; max-width: min(200px, calc(100vw - 130px)); } }

/* telefon: awatar czatu w pasku akcji, między „Zapytaj” a „Zadzwoń” (v2 zawsze, v1 przy czat_w_pasku) */
@media (max-width: 900px) {
  .pasek-akcji.z-czatem { grid-template-columns: 1fr auto 1fr; align-items: center; overflow: visible; }
  .pasek-akcji .czat-awatar, .pasek-akcji .czat-awatar.postac { position: relative; inset: auto; width: 62px; height: 62px; margin: -20px 2px 0; border-radius: 50%; background: var(--ink-2); box-shadow: 0 0 0 3px var(--akcent), 0 12px 24px -8px rgba(0,0,0,.7); animation: none; transform: none; overflow: hidden; }
  .pasek-akcji .czat-awatar::after, .pasek-akcji .czat-cien, .pasek-akcji .czat-fala { display: none; }
  .pasek-akcji .czat-awatar img, .pasek-akcji .czat-awatar.postac img { position: absolute; inset: 9px; left: 9px; bottom: 9px; width: calc(100% - 18px); height: calc(100% - 18px); object-fit: contain; transform: none; border-radius: 0; filter: none; animation: oddech 3.6s ease-in-out infinite; }
  body:has(.pasek-akcji.z-czatem) .czat-dymek { right: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(50%) scale(.95); transform-origin: 50% 100%; border-radius: 16px; text-align: center; }
  body:has(.pasek-akcji.z-czatem) .czat-dymek.widac { transform: translateX(50%); }
  body.czat-otwarty .pasek-akcji .czat-awatar { opacity: 1; pointer-events: auto; }
}
/* krok „Zadzwoń do asystenta”: pasek nad przyciemnieniem, prawdziwy przycisk działa */
body.zadzwon-teraz .pasek-akcji { z-index: 130; }
.krok-zadzwon .pokaz-krag { pointer-events: none; }
