/* =====================================================================
   METRY, CENA NA ŻYWO, „JAK LICZYMY CENĘ?”, LISTA DLA EKIPY, TRYB HANDLOWCA
   Ten sam styl co reszta: grafit, jeden akcent (--miedz z js/firma.js),
   duże czytelne liczby, dużo powietrza. Ładuj po bramy.css i sprzedaz.css.
   (WS-DEMO · Wojciech Suszyński)
   ===================================================================== */

/* ---------- logo firmy z pliku (firma.js → logo) ---------- */
.logo-obraz { border: 0; width: auto; min-width: 42px; }
.logo-obraz img { height: 42px; width: auto; }

/* ---------- pole metrów (boki działki) ---------- */
.kf-metry { display: flex; align-items: center; gap: 6px; flex: none; }
.kf-metry button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linia); background: var(--bialy); font-size: 20px; line-height: 1; transition: border-color .2s; }
.kf-metry button:hover { border-color: var(--grafit-900); }
.kf-metry-pole { display: flex; align-items: baseline; justify-content: center; gap: 4px; width: 82px; padding: 2px 4px 3px; border-bottom: 1px solid var(--linia); }
.kf-metry-pole input { width: 4.2ch; border: 0; background: transparent; text-align: right; font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; padding: 0; }
.kf-metry-pole input::placeholder { color: var(--szary-jasny); font-weight: 500; font-size: 14px; letter-spacing: 0; }
.kf-metry-pole input:focus { outline: none; }
.kf-metry-pole:focus-within { border-bottom-color: var(--grafit-900); }
.kf-metry-pole span { font-size: 13px; font-weight: 600; color: var(--szary); }
.kf-liczba-g + .kf-metry-w { margin-top: 6px; border-top: 1px solid var(--linia); }

/* ---------- wyliczenie na żywo: metry bieżące, przęsła, słupki ---------- */
.kf-licz { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 16px 0 6px; border: 1px solid var(--linia); border-radius: var(--r); overflow: hidden; background: var(--linia); }
.kf-licz > div { display: flex; flex-direction: column; gap: 5px; padding: 13px 14px 12px; background: var(--bialy); min-width: 0; }
.kf-licz strong { font-size: 28px; line-height: 1; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kf-licz p { grid-column: 1 / -1; margin: 0; padding: 8px 14px 9px; background: var(--papier); font-size: 10.5px; letter-spacing: .03em; color: var(--szary); }
.kf-licz span { font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--szary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- przełącznik kadru w studiu: wjazd / cała działka ---------- */
.st-kadr { position: absolute; z-index: 4; right: 14px; top: 64px; display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.st-kadr button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #4c5561; min-height: 36px; white-space: nowrap; }
.st-kadr button[aria-pressed="true"] { background: var(--grafit-900); color: #fff; }
.st[data-tryb="2d"] .st-kadr, .st[data-ogr="0"] .st-kadr, .st.st-bez3d .st-kadr { display: none; }
.st-podpowiedz { top: 122px; }

/* ---------- pasek ceny: duża liczba, netto, „Jak liczymy cenę?” ---------- */
.sp-pasek { padding: 12px 10px 12px 18px; }
.sp-zapisz { flex: none; }
button.sp-cena { -webkit-appearance: none; appearance: none; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; align-items: flex-start; gap: 1px; }
.sp-cena .sp-kwota { display: flex; align-items: baseline; gap: 6px; font-size: clamp(25px, 2.3vw, 30px); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-kwota i { font-style: normal; font-size: .52em; font-weight: 600; letter-spacing: 0; color: var(--szary-jasny); }
.sp-cena[data-tryb="widelki"] .sp-kwota { font-size: clamp(19px, 1.9vw, 23px); }
.sp-cena[data-tryb="zapytanie"] .sp-kwota { font-size: 19px; letter-spacing: -.01em; }
.sp-cena[data-tryb="zapytanie"] .sp-kwota i { display: none; }
.sp-cena .sp-cena-d { font-size: 11.5px; color: var(--szary-jasny); white-space: nowrap; }
.sp-l2:not(:empty)::after { content: " · "; }
.sp-jak { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--miedz); transition: color .2s; }
.sp-cena:hover .sp-jak { color: var(--miedz-jasna); }

/* cena na karcie projektu (klik otwiera rozbicie) */
button.kf-cena { width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; }
.kf-cena strong { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kf-cena .kf-cena-tekst { font-size: 21px; }
.kf-cena u { color: #fff; text-decoration-color: var(--miedz); text-underline-offset: 3px; }

/* ---------- szuflada: „Jak liczymy cenę?” i „Lista dla ekipy” ---------- */
.sp-szuflada { border: 0; padding: 0; margin: 0 0 0 auto; width: min(480px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; background: var(--papier); color: var(--tekst); box-shadow: -30px 0 80px -30px rgba(0,0,0,.45); overflow: hidden; }
.sp-szuflada[open] { animation: sz-bok .34s cubic-bezier(.2,.8,.2,1); }
.sp-szuflada::backdrop { background: rgba(11,16,22,.4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@keyframes sz-bok { from { transform: translateX(44px); opacity: 0; } }
@keyframes sz-dol { from { transform: translateY(44px); opacity: 0; } }
.sp-sz-w { display: flex; flex-direction: column; height: 100%; max-height: inherit; }
.sp-sz-g { position: relative; flex: none; padding: 28px 28px 0; background: var(--grafit-900); color: #fff; }
.sp-sz-g .sp-etyk { color: var(--miedz-jasna); margin-bottom: 10px; }
.sp-sz-g .sp-d-x { color: #c9d1db; top: 14px; right: 14px; }
.sp-sz-g .sp-d-x:hover { color: #fff; }
.sp-sz-kwota { margin: 0 0 4px; font-size: 42px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.sp-sz-kwota small { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--szary-jasny); margin-left: 2px; }
.sp-sz-pod { margin: 0 0 20px; font-size: 13.5px; color: var(--szary-jasny); }
.sp-zakladki { display: flex; gap: 26px; }
.sp-zakladki button { border: 0; background: none; padding: 12px 0 13px; min-height: 46px; border-bottom: 2px solid transparent; color: var(--szary-jasny); font-size: 14px; font-weight: 600; transition: color .2s, border-color .2s; }
.sp-zakladki button:hover { color: #fff; }
.sp-zakladki button[aria-selected="true"] { color: #fff; border-bottom-color: var(--miedz); }
.sp-sz-t { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px 28px 30px; }
.sp-poz, .sp-mat { list-style: none; margin: 0; padding: 0; }
.sp-poz li, .sp-mat li { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 14px 0 13px; border-bottom: 1px solid var(--linia); }
.sp-poz li > div, .sp-mat li > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sp-poz strong, .sp-mat strong { font-size: 15px; font-weight: 600; line-height: 1.3; }
.sp-poz small, .sp-mat small { font-size: 12.5px; line-height: 1.45; color: var(--szary); }
.sp-poz small.mono { font-size: 11px; letter-spacing: .01em; }
.sp-poz-k { flex: none; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-poz-k em { font-style: normal; font-weight: 500; font-size: 13px; color: var(--szary); }
.sp-suma { margin: 16px 0 0; }
.sp-suma div { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-size: 14px; color: var(--szary); }
.sp-suma dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tekst); }
.sp-suma .sp-suma-b { margin-top: 10px; padding-top: 14px; border-top: 2px solid var(--grafit-900); color: var(--tekst); }
.sp-suma-b dt { font-size: 15px; font-weight: 650; }
.sp-suma-b dd { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.sp-przyp { margin: 18px 0 0; font-size: 10.5px; line-height: 1.65; letter-spacing: .03em; color: var(--szary); }
.sp-kopiuj { width: 100%; justify-content: center; margin: 18px 0 0; }
.sp-kopiuj span[aria-hidden] { color: var(--miedz-jasna); }
.sp-recznie { display: block; width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--linia); border-radius: 12px; background: var(--bialy); font: 400 12px/1.5 var(--f-mono); color: var(--tekst); resize: vertical; }
.sp-d-btn .sp-recznie { grid-column: 1 / -1; }

/* ---------- przycisk „Tryb handlowca” w nagłówku ---------- */
.gl-handl { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: #c2cad4; font-size: 13px; font-weight: 600; white-space: nowrap; transition: border-color .2s, color .2s, background .2s; }
.gl-handl:hover { border-color: rgba(255,255,255,.42); color: #fff; }
.gl-handl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.gl-handl[aria-pressed="true"] { background: var(--miedz); border-color: var(--miedz); color: var(--grafit-950); }

/* ---------- tryb handlowca: jeden ekran, cztery wielkie pola, wynik ---------- */
.kf-handl { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.kf-handl[hidden] { display: none; }
.tryb-handlowca .hb, .tryb-handlowca #realizacje, .tryb-handlowca #pytania, .tryb-handlowca #kontakt, .tryb-handlowca .stopka,
.tryb-handlowca .kf-postep, .tryb-handlowca .kf-krok, .tryb-handlowca .kf-nav, .tryb-handlowca .sp-pasek { display: none !important; }
.tryb-handlowca .kf { grid-template-columns: minmax(0, 1fr) min(540px, 46vw); }
.tryb-handlowca .kf-scena { height: max(560px, calc(100svh - 69px)); }
.tryb-handlowca .kf-panel { min-height: max(560px, calc(100svh - 69px)); padding: 16px 30px 0; }
.hd-g { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.hd-znak { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--miedz-ciemna); }
.hd-znak i { width: 7px; height: 7px; border-radius: 50%; background: var(--miedz); box-shadow: 0 0 0 4px color-mix(in srgb, var(--miedz) 22%, transparent); }
.hd-g-p { display: flex; gap: 4px; }
.hd-link { border: 0; background: none; min-height: 44px; padding: 0 10px; font-size: 13.5px; font-weight: 600; color: var(--szary); border-radius: 10px; white-space: nowrap; }
.hd-link:hover { color: var(--tekst); background: var(--papier-2); }
.hd-link-m { color: var(--tekst); }
.hd-link-m span { color: var(--miedz-ciemna); }
.hd-pole { padding: 14px 0 18px; border-top: 1px solid var(--linia); }
.hd-pole .kf-etyk { margin: 0 0 12px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; color: var(--tekst); }
.hd-pole .kf-etyk small { font-size: 10.5px; letter-spacing: .04em; text-transform: none; color: var(--szary); }
.hd-liczba { display: flex; align-items: center; gap: 14px; }
.hd-liczba button { flex: none; width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--linia); background: var(--bialy); font-size: 26px; line-height: 1; transition: border-color .2s, transform .1s; }
.hd-liczba button:hover { border-color: var(--grafit-900); }
.hd-liczba button:active { transform: scale(.95); }
.hd-liczba-pole { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 8px; border-bottom: 1px solid var(--linia); padding-bottom: 2px; }
.hd-liczba-pole:focus-within { border-bottom-color: var(--grafit-900); }
.hd-liczba-pole input { width: 3.4ch; border: 0; background: transparent; padding: 0; text-align: right; font-size: 64px; line-height: 1.05; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hd-liczba-pole input:focus { outline: none; }
.hd-liczba-pole i { font-style: normal; font-size: 22px; font-weight: 600; color: var(--szary); }
.hd-licz { margin: 12px 0 0; text-align: center; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--szary); }
.hd-kafle { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hd-kafle button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 9px; min-height: 72px; border: 1px solid var(--linia); border-radius: 12px; background: var(--bialy); font-size: 11.5px; letter-spacing: -.01em; font-weight: 650; color: var(--tekst); transition: border-color .2s, box-shadow .2s, transform .15s; }
.hd-kafle button:hover { border-color: #c9c3b8; transform: translateY(-1px); }
.hd-kafle button[aria-checked="true"] { border-color: var(--grafit-900); box-shadow: inset 0 0 0 1px var(--grafit-900), var(--cien); }
.hd-ik { height: 26px; color: #8a929c; }
.hd-ik svg { height: 100%; width: auto; }
.hd-kafle button[aria-checked="true"] .hd-ik { color: var(--miedz-ciemna); }
.hd-segment button { min-height: 52px; font-size: 15px; }
.hd-rzad { display: grid; grid-template-columns: 1fr auto; gap: 10px 26px; align-items: center; margin-top: 12px; }
.hd-mini { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; font-size: 14.5px; font-weight: 600; }
.hd-mini[hidden] { display: none; }
.hd-mini output { min-width: 62px; text-align: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hd-kolor-n { margin-left: auto; }
.hd-kolory { display: flex; gap: 10px; flex-wrap: wrap; }
.hd-kolory button { width: 48px; height: 48px; border-radius: 50%; border: 0; padding: 0; background: var(--k); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), inset 0 2px 3px rgba(255,255,255,.2); transition: transform .15s, box-shadow .2s; }
.hd-kolory button:hover { transform: translateY(-2px); }
.hd-kolory button[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), 0 0 0 3px var(--papier), 0 0 0 5px var(--grafit-900); }
.hd-wynik { position: sticky; bottom: 0; z-index: 3; margin: auto -30px 0; padding: 20px 30px 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; background: var(--grafit-900); color: #fff; }
.hd-wynik-l { display: flex; flex-direction: column; min-width: 0; }
.hd-wynik-l small.mono { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--miedz-jasna); margin-bottom: 4px; }
.hd-brutto { display: flex; align-items: baseline; gap: 10px; font-size: clamp(44px, 4.6vw, 62px); line-height: 1; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-brutto i { font-style: normal; font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--szary-jasny); }
.hd-netto { margin-top: 8px; font-size: 13.5px; color: var(--szary-jasny); font-variant-numeric: tabular-nums; }
.hd-wynik-p { display: flex; flex-direction: column; gap: 6px; flex: none; }
.hd-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: background .2s, border-color .2s; }
.hd-btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); }

.st-tryb button { white-space: nowrap; }
@media (min-width: 901px) and (max-width: 1340px) {
  .st-tytul { display: none; }
  .st-kadr { left: 16px; right: auto; top: 14px; }
  .st-gora { justify-content: flex-end; }
  .st-podpowiedz { display: none; }
}
@media (max-width: 1100px) {
  .tryb-handlowca .kf-panel { padding: 14px 22px 0; }
  .hd-wynik { margin: auto -22px 0; padding: 18px 22px 20px; }
}
@media (max-width: 900px) {
  .st-kadr { top: 8px; right: 8px; padding: 2px; }
  .st-kadr button { padding: 6px 11px; font-size: 12.5px; min-height: 44px; min-width: 44px; }
  .gl-handl { padding: 0; width: 44px; justify-content: center; border-color: transparent; }
  .gl-handl span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gl-handl[aria-pressed="true"] { background: transparent; border-color: var(--miedz); color: var(--miedz); }
  .kf-licz strong { font-size: 24px; }
  .tryb-handlowca .kf { grid-template-columns: 1fr; }
  .tryb-handlowca .kf-scena { height: 33svh; min-height: 250px; max-height: 360px; }
  .tryb-handlowca .kf-panel { min-height: calc(67svh - 59px); padding: 8px 16px 0; }
  .hd-wynik { margin: auto -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .hd-pole { padding: 12px 0 16px; }
}
@media (max-width: 560px) {
  .sp-pasek { padding: 10px 8px 10px 14px; gap: 8px; }
  .sp-cena .sp-kwota { font-size: 24px; }
  .sp-cena .sp-cena-d { white-space: normal; line-height: 1.35; }
  .sp-l2 { display: block; }
  .sp-l2:not(:empty)::after { content: none; }
  .sp-szuflada { margin: auto 0 0; width: 100vw; height: auto; max-height: 90dvh; border-radius: 20px 20px 0 0; box-shadow: 0 -30px 80px -30px rgba(0,0,0,.5); }
  .sp-szuflada[open] { animation-name: sz-dol; }
  .sp-sz-w { max-height: 90dvh; }
  .sp-sz-g { padding: 22px 18px 0; }
  .sp-sz-kwota { font-size: 34px; }
  .sp-sz-pod { margin-bottom: 14px; }
  .sp-sz-t { padding: 6px 18px calc(22px + env(safe-area-inset-bottom)); }
  .kf-metry-pole { width: 70px; }
  .hd-liczba button { width: 54px; height: 54px; }
  .hd-liczba-pole input { font-size: 52px; }
  .hd-kafle { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hd-rzad { grid-template-columns: 1fr; }
  .hd-kolory { gap: 8px; }
  .hd-kolory button { width: 44px; height: 44px; }
  .hd-wynik { flex-direction: column; align-items: stretch; gap: 12px; }
  .hd-wynik { gap: 10px; padding-top: 12px; }
  .hd-brutto { font-size: 36px; }
  .hd-brutto i { font-size: 14px; }
  .hd-netto { margin-top: 5px; font-size: 12.5px; }
  .hd-wynik-p { flex-direction: row; }
  .hd-wynik-p .hd-btn { flex: 1; padding: 0 8px; }
  .hd-kafle button { font-size: 12.5px; }
  .hd-link { padding: 0 6px; font-size: 13px; }
}
@media print { .gl-handl, .st-kadr, .sp-szuflada { display: none !important; } }

/* kolumny konfiguratora nie mogą się rozpychać od środka (pasek dni pomiaru przewija się sam) */
.kf-panel, .kf-scena, .kf-krok { min-width: 0; }
.sp-pomiar { min-inline-size: 0; }
