/* ============================================================================
   11i-kalkulator-wzor-konstrukcje.css — okno „Kalkulator kosztów”, zakładka KONSTRUKCJE wg wzoru (kalk_czesc.txt, 18.10.2026)
   ----------------------------------------------------------------------------
   Rozkaz właściciela: wdrożyć 1:1 — „nie chcę żadnych przygód jak przy Design”. Jedna ramka .pcost-dg (wzór .k-dg) z cienkimi liniami
   wewnątrz; kolejność: nagłówek Designu → pasek sum → szablon marż dla całego Designu → nagłówek kolumn → lista konstrukcji →
   NA KOŃCU pigułka Finanse | Materiały z podsumowaniem wszystkich zaznaczonych konstrukcji. Rozwinięta konstrukcja: pasek wyniku,
   pigułka Finanse | Materiały, tabela marż z suwakami (siatka 1,15fr 104px 2fr 96px), cena → prowizja → rabat.
   Zamiast: 11g (pasek, dwie kolumny, szczegóły) i części 11c (grupa, wiersz, rozwinięcie). Kod: okna/koszty-10, -17, -19.
   Tokeny programu (wzór → program): --pow→--surface, --pow-2/3→--surface-2/3, --linia→--line, --linia-2→--line-soft, --ramka→--line-strong,
   --tusz→--text, --tusz-2→--text-muted, --tusz-3→--text-faint, --ak→--accent, --ak-tlo→--accent-soft, --bl→--danger, --uw→--warn-strong.
   Progi: @media 1180/640 = @container app; @container ked = szerokość edytora (.project-cost-center-panel). Zero !important.
   ============================================================================ */

/* === 1. GRUPA (Design / oferta): jedna ramka === */
.pcost-konstrukcje { gap: var(--s-3); }
.pcost-dg-wszystkie { display: flex; flex-direction: column; gap: var(--s-2); }
.pcost-dg-etykieta { margin: var(--s-2) 0 var(--s-1); padding: 0 var(--s-1); color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-strong); }
.pcost-dg-wszystkie > .pcost-dg-etykieta:first-child { margin-top: 0; }
.pcost-dg { overflow: clip; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: var(--t-sm); line-height: 1.4; color: var(--text); }
.pcost-dg[data-pcost-rodzaj="design"] { --kc: var(--etap-design); }
.pcost-dg[data-pcost-rodzaj="offer"] { --kc: var(--etap-konsultacje); }
.pcost-dg > summary.pcost-dg-glowa { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3) 0 0; list-style: none; cursor: pointer; user-select: none; background: var(--surface-3); }   /* rozwijany nagłówek Design A / Oferta A = SZARY jak inne szare nagłówki programu (--surface-3, decyzja właściciela 19.10) */
.pcost-dg > summary.pcost-dg-glowa::-webkit-details-marker { display: none; }
.pcost-dg-t { display: grid; flex: 1; grid-template-columns: 16px 34px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-width: 0; min-height: 56px; padding: var(--s-2) var(--s-3); }
.pcost-dg > summary.pcost-dg-glowa:hover { background: var(--line); }
.pcost-dg > summary.pcost-dg-glowa:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pcost-dg-strzalka { display: grid; place-items: center; color: var(--text-faint); }
.pcost-dg-strzalka .icon { width: 16px; height: 16px; transition: transform .18s cubic-bezier(.25, 1, .5, 1); }
.pcost-dg[open] > summary .pcost-dg-strzalka .icon { transform: rotate(90deg); }
.pcost-dg-ikona { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); background: color-mix(in srgb, var(--kc) 16%, var(--surface)); color: var(--kc); }
.pcost-dg-ikona .icon { width: 18px; height: 18px; }
.pcost-dg-nazwa { display: flex; flex-direction: column; min-width: 0; }
.pcost-dg-nazwa > b { overflow: hidden; color: var(--text); font-size: var(--t-md); font-weight: var(--w-strong); text-overflow: ellipsis; white-space: nowrap; }
.pcost-dg-nazwa > small { color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-regular); }
.pcost-dg-nazwa > small b { color: var(--text); font-weight: var(--w-strong); }
.pcost-dg-braki { color: var(--brak-bom); font-weight: var(--w-bold); }
.pcost-dg-braki[hidden] { display: none; }
.pcost-dg-suma { color: var(--ok); font-size: var(--t-md); font-weight: var(--w-strong); font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: baseline; gap: 3px; }
.pcost-dg-suma.is-zero { color: var(--text-faint); }
.pcost-dg:has(> summary .pcost-dg-braki:not([hidden])) .pcost-dg-suma { color: var(--brak-bom); }
/* Wzór: `.k-okno button { font: inherit }` — przyciski w oknie dziedziczą 13 px / 400 (przycisk, który chce inaczej, mówi to sam). */
.pcost-dg .button { font-size: var(--t-sm); font-weight: var(--w-regular); }
/* „Zaznacz wszystkie | Odznacz” — jeden pasek z ramką */
.pcost-dg-akcje { display: flex; flex: none; gap: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.pcost-dg-akcje .button { min-height: 40px; height: 40px; padding: 0 var(--s-3); border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: var(--t-sm); font-weight: var(--w-bold); }
.pcost-dg-akcje .button + .button { border-left: 1px solid var(--line-strong); }
.pcost-dg-akcje .button:not(:disabled):hover { background: var(--surface-2); }
/* Zaznacz wszystkie / Odznacz: podświetlony ten przycisk, który opisuje aktualny stan grupy (wszystkie zaznaczone albo żadna) — decyzja właściciela 19.10. */
.pcost-dg:not(:has(.pcost-kn.is-poza)):has(.pcost-kn) .pcost-dg-akcje .button[data-stan="1"], .pcost-dg:not(:has(.pcost-kn:not(.is-poza))):has(.pcost-kn) .pcost-dg-akcje .button[data-stan="0"] { background: var(--accent); color: var(--on-accent); }
.pcost-dg-akcje .button:disabled { opacity: .4; }
.pcost-dg-tresc { display: block; }

/* === 2. PASEK SUM (wzór .k-wystrip): Koszt + Zysk = Cena + Prowizja − Rabat = Po rabacie, 11 kolumn na całą szerokość === */
.pcost-kn-wyn { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.15fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.3fr); align-items: end; column-gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); box-shadow: var(--cien-1); }
.pcost-wyn-poz { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pcost-wyn-poz > small { color: var(--text-faint); font-size: var(--t-xs); }
.pcost-wyn-poz > b { display: inline-flex; align-items: baseline; gap: 3px; color: var(--text); font-size: var(--t-md); font-weight: var(--w-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcost-wyn-poz.is-zysk > b { color: var(--zysk); }
.pcost-wyn-poz.is-cena > b { font-size: var(--t-lg); }
.pcost-wyn-poz.is-wynik { justify-self: stretch; padding: var(--s-1) var(--s-3); border-radius: var(--r-sm); background: var(--accent-soft); }
.pcost-wyn-poz.is-wynik > b { color: var(--accent); font-size: var(--t-lg); }
.pcost-wyn-op { padding-bottom: 2px; color: var(--text-faint); font-weight: var(--w-bold); }
.pcost-kn-wyn.is-bez-prowizji { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.3fr); }
.pcost-dg > .pcost-dg-tresc > [data-pcost-dg-pasek-miejsce] > .pcost-kn-wyn { position: static; padding: var(--s-3) var(--s-4); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--surface-2); box-shadow: none; }

/* === 3. SZABLON MARŻ DLA CAŁEGO DESIGNU (wzór .k-fprof) === */
.pcost-fprof { display: flex; flex-direction: column; gap: var(--s-2); }
.pcost-dg > .pcost-dg-tresc > .pcost-fprof { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); background: var(--surface); }
.pcost-prw { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.pcost-prw > select { flex: 1 1 150px; min-width: 0; width: 100%; height: 36px; padding: 0 var(--s-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: var(--t-sm); font-weight: var(--w-bold); }
.pcost-dg > .pcost-dg-tresc > .pcost-fprof .pcost-prw > select { max-width: 420px; }
.pcost-prw > .button { flex: 1 1 auto; }
.pcost-dg > .pcost-dg-tresc > .pcost-fprof .pcost-prw > .button { flex: none; }
.pcost-prw > .button.is-swieci { position: relative; border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.pcost-prw > .button.is-swieci::after { content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.pcost-zmn { display: flex; align-items: center; gap: var(--s-2); box-sizing: border-box; min-height: calc(1.5em + 2 * var(--s-2)); margin: 0; padding: var(--s-2); border-radius: var(--r-sm); background: transparent; color: var(--text-faint); font-size: var(--t-xs); }
.pcost-zmn > i { flex: none; width: 8px; height: 8px; margin-top: 0; border-radius: 50%; background: var(--ok); }
.pcost-zmn.is-zmieniona { background: var(--accent-soft); color: var(--text-muted); }
.pcost-zmn.is-zmieniona > i { background: var(--accent); }
.pcost-dg > .pcost-dg-tresc > .pcost-fprof .pcost-zmn { margin: var(--s-2) 0 0; }

/* === 4. LISTA KONSTRUKCJI: nagłówek kolumn + wiersze o STAŁEJ wysokości === */
.pcost-dg > .pcost-dg-tresc > .pcost-dg-lista { --k-th: 112px; --k-rh: 72px; --k-bom: 80px; --k-cols: minmax(0, 1fr) repeat(5, 104px) 32px; display: flex; flex-direction: column; gap: 0; padding: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); }
/* Nagłówek kolumn trafia w kolumny wierszy: ten sam odstęp z lewej (przełącznik 36 px + miniatura) i z prawej (przycisk BOM). */
.pcost-kth { display: grid; grid-template-columns: var(--k-cols); column-gap: var(--s-2); padding: var(--s-2) calc(var(--s-4) + var(--s-3) + var(--k-bom) + var(--s-1)) var(--s-1) calc(var(--s-4) + 36px + 2 * var(--s-3) + var(--k-th) + var(--s-1)); border-bottom: 1px solid var(--line); color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-bold); }
.pcost-kth span + span { text-align: right; }
.pcost-dg .pcost-kn { position: relative; overflow: visible; padding: var(--s-3) var(--s-4); border-radius: 0; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.pcost-dg .pcost-kn + .pcost-kn { border-top: 1px solid var(--line); }
.pcost-dg .pcost-kn.is-poza { background: transparent; }
.pcost-dg .pcost-kn.is-braki { background: color-mix(in srgb, var(--brak-bom) 5%, transparent); }
.pcost-dg .pcost-kn.is-open { background: var(--surface-3); }   /* rozwinięta konstrukcja = ten sam szary co nagłówek (było 4 % bursztynu = żółtawe, decyzja właściciela 19.10) */
.pcost-kn-wiersz { display: flex; align-items: center; gap: var(--s-3); min-height: var(--k-rh); padding: 0; }
.pcost-kn-kratka { position: relative; display: grid; flex: none; place-items: center; width: 44px; height: 44px; margin: 0 -2px 0 -6px; cursor: pointer; }
/* przełącznik zakresu: ten sam rozmiar co w całym Kalkulatorze (tor 34 × 20, gałka 14, włączony 17 px od lewej) */
.pcost-dg .pcost-kn-wiersz .pcost-kn-kratka > input[type="checkbox"] { appearance: none; -webkit-appearance: none; position: relative; width: 34px; height: 20px; margin: 0; border: 0; border-radius: var(--r-pill); background: var(--line-strong); cursor: pointer; transition: background .15s; }
.pcost-dg .pcost-kn-wiersz .pcost-kn-kratka > input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--galka); box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 25%, transparent); transition: left .15s; }
.pcost-dg .pcost-kn-wiersz .pcost-kn-kratka > input[type="checkbox"]:checked { background: var(--ok); }
.pcost-dg .pcost-kn-wiersz .pcost-kn-kratka > input[type="checkbox"]:checked::after { left: 17px; }
.pcost-dg .pcost-kn-wiersz .pcost-kn-kratka > input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcost-dg .pcost-kn-wiersz .pcost-kn-kratka > input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
.pcost-kn-miniatura { position: relative; display: block; flex: none; width: var(--k-th); aspect-ratio: 16 / 10; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-muted); cursor: zoom-in; }
.pcost-kn-miniatura:hover:not(:disabled) { border-color: var(--accent); }
.pcost-kn-miniatura:disabled { cursor: default; }
.pcost-kn-miniatura > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pcost-kn-miniatura > .icon { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; opacity: .5; }
.pcost-kn-lupa { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text-muted); }
.pcost-kn-lupa .icon { width: 12px; height: 12px; }
.pcost-kn.is-poza .pcost-kn-miniatura { opacity: .5; }
.pcost-kn-rozwin { display: grid; flex: 1 1 0; grid-template-columns: var(--k-cols); align-items: center; column-gap: var(--s-2); min-width: 0; margin: 0; padding: var(--s-2) var(--s-1); border: 0; border-radius: var(--r-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pcost-kn-rozwin:hover { background: var(--surface-2); }
.pcost-kn-rozwin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcost-kn-opis { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pcost-kn-opis > b { overflow-wrap: anywhere; color: var(--text); font-size: var(--t-md); font-weight: var(--w-strong); line-height: 1.25; }
.pcost-kn-opis > small { color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-regular); line-height: 1.4; }
.pcost-kn-chipy { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-1); }
.pcost-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--s-2); border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-muted); font-size: var(--t-xs); font-weight: var(--w-bold); }
.pcost-chip .icon { width: 12px; height: 12px; }
.pcost-chip.is-blad { background: var(--brak-bom-soft); color: var(--brak-bom); }
.pcost-zl { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-muted); font-size: var(--t-xs); font-weight: var(--w-bold); vertical-align: 1px; white-space: nowrap; }
.pcost-kn-cel { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; font-variant-numeric: tabular-nums; }
.pcost-kn-cel > b { display: inline-flex; align-items: baseline; gap: 3px; color: var(--text); font-size: var(--t-base); font-weight: var(--w-bold); white-space: nowrap; }
.pcost-kn-cel.is-zysk > b { color: var(--zysk); }
.pcost-kn-cel.is-prowizja > b { color: var(--text); }
.pcost-kn-cel.is-prowizja > b.is-zm { color: var(--accent); }   /* wzór .k-cel b.zm: prowizja po rabacie (zmieniona) — akcent */
.pcost-kn-cel.is-cena > b { color: var(--text); font-size: var(--t-md); font-weight: var(--w-strong); }   /* wzór: cena konstrukcji neutralna (tusz), pomarańcz tylko przy brakach BOM */
.pcost-kn.is-braki .pcost-kn-cel.is-cena > b { color: var(--brak-bom); }
.pcost-kn-cel > b.is-zero { color: var(--text-faint); font-weight: var(--w-medium); }
.pcost-kn-cel:not(.is-cena) .kwota-waluta { display: none; }
.pcost-kn.is-poza .pcost-kn-opis > b, .pcost-kn.is-poza .pcost-kn-cel > b { color: var(--text-faint); }
.pcost-kn-strzalka { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--text-faint); }
.pcost-kn-strzalka .icon { width: 18px; height: 18px; transition: transform .2s cubic-bezier(.25, 1, .5, 1); }
.pcost-kn-rozwin:hover .pcost-kn-strzalka { color: var(--text); }
.pcost-kn-rozwin[aria-expanded="true"] .pcost-kn-strzalka .icon { transform: rotate(90deg); }
.pcost-kn-bom { flex: none; width: var(--k-bom); height: 34px; padding: 0 var(--s-3); border-radius: var(--r-sm); font-size: var(--t-sm); font-weight: var(--w-regular); }
.pcost-kn-bom .icon { width: 15px; height: 15px; }
.pcost-kn-bom.is-blad { border-color: var(--brak-bom-ramka); background: var(--brak-bom-soft); color: var(--brak-bom); }
.pcost-kn-bom:disabled { opacity: .45; cursor: default; }

/* === 5. ROZWINIĘTA KONSTRUKCJA: pasek wyniku → pigułka → sekcja === */
.pcost-dg .pcost-kn > .pcost-kn-panel { margin: var(--s-3) 0 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.pcost-dg .pcost-kn > .pcost-kn-panel:not([hidden]) { display: flex; flex-direction: column; gap: var(--s-3); }
.pcost-dg .pcost-kn-panel > .pcost-kn-wyn { position: sticky; top: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); box-shadow: var(--cien-1); }
.pcost-ptabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-3); }
.pcost-ptabs > button { position: relative; min-height: 44px; padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); font: inherit; font-size: var(--t-base); font-weight: var(--w-bold); line-height: 1.2; cursor: pointer; transition: background .12s, color .12s; }
.pcost-ptabs > button:hover { color: var(--text); }
.pcost-ptabs > button.on { background: var(--surface); color: var(--text); box-shadow: var(--cien-1); }
.pcost-ptabs > button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pcost-ptabs > button i.bl { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--brak-bom); vertical-align: middle; }
.pcost-ptab { display: flex; flex-direction: column; gap: var(--s-3); width: 100%; min-width: 0; font-size: var(--t-sm); }
.pcost-ptab[hidden] { display: none; }
.pcost-gdol { display: flex; flex-direction: column; gap: 0; padding: 0; border-top: 1px solid var(--line); }
.pcost-gdol > .pcost-ptabs { margin: var(--s-4) var(--s-4) 0; }
.pcost-gdol .pcost-ptab { padding: var(--s-4); gap: var(--s-4); }
.pcost-gdol > .pcost-pusto { margin: 0; padding: var(--s-2) var(--s-4); border: 0; font-size: var(--t-sm); text-align: left; }
.pcost-dg .pcost-kn-panel .pcost-ptab { padding: 0; }   /* panel konstrukcji ma własny padding (.pcost-kn-panel) */
.pcost-pan-min { display: none; }
.pcost-pan-akc { display: flex; flex-wrap: wrap; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line-soft); }
.pcost-fin1 { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.pcost-gdol .pcost-fin1 { gap: var(--s-4); }

/* === 6. TABELA KOSZTÓW I MARŻ (wzór .k-ft): Pozycja | Koszt | Marża (suwak + pole) | Zysk === */
.pcost-ft { display: flex; flex-direction: column; border: 0; border-radius: 0; background: none; overflow: visible; }
.pcost-ft-h, .pcost-ft-r { display: grid; grid-template-columns: minmax(0, 1.15fr) 104px minmax(0, 2fr) 96px; column-gap: var(--s-3); align-items: center; padding: 0; }
.pcost-ft-h { min-height: 34px; border-bottom: 1px solid var(--line); background: none; color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-bold); }
.pcost-ft-h > span:nth-child(2), .pcost-ft-h > span:nth-child(4) { text-align: right; }
.pcost-ft-r { min-height: 52px; border-bottom: 1px solid var(--line-soft); }
.pcost-ft-r:last-child { border-bottom: 0; }
.pcost-ft-r > .n { display: flex; flex-direction: column; min-width: 0; }
.pcost-ft-r > .n b { font-size: var(--t-base); font-weight: var(--w-bold); line-height: 1.25; }
.pcost-ft-r > .n small { color: var(--text-faint); font-size: var(--t-xs); }
.pcost-ft-r .s2 { display: none; }
.pcost-ft-r.pod > .n { padding-left: var(--s-3); }
.pcost-ft-r.pod > .n b { color: var(--text-muted); font-weight: var(--w-medium); }
.pcost-ft-r > .k, .pcost-ft-r > .z { color: var(--text); font-size: var(--t-base); font-weight: var(--w-bold); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pcost-ft-r > .z.zy { color: var(--zysk); }
.pcost-ft-r > .z.zero { color: var(--text-faint); font-weight: var(--w-medium); }
.pcost-ft-m { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
/* Specyficzność 0-4-1 jak wspólna reguła suwaka w oknach (03-kontrolki.css) — inaczej ta ma 12 px; późniejszy plik wygrywa. */
.pcost-ft-m > input[type="range"]:not([type="checkbox"]):not([type="radio"]) { flex: 1 1 0; width: 100%; min-width: 0; height: 40px; margin: 0; accent-color: var(--accent); }
.pcost-ft-m > .project-cost-version-table-value { flex: none; width: auto; }
.pcost-ft-m > .project-cost-version-table-value > input[type="number"] { width: 52px; height: 36px; padding: 0 20px 0 var(--s-1); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: var(--t-sm); font-weight: var(--w-strong); text-align: right; font-variant-numeric: tabular-nums; }
.pcost-ft-m > .project-cost-version-table-value::after { right: 6px; color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-bold); }
.pcost-ft-m > .project-cost-version-table-value > input[type="number"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.pcost-ft-ro { justify-content: flex-end; color: var(--text-muted); font-size: var(--t-base); font-weight: var(--w-bold); }
.pcost-ft-r.suma { min-height: 46px; border-top: 1px solid var(--line); border-bottom: 0; background: none; }
.pcost-ft-r.suma .n b, .pcost-ft-r.suma > .k, .pcost-ft-r.suma > .z { font-weight: var(--w-strong); }
.pcost-ft-r.suma .pcost-ft-ro { color: var(--text-muted); }
.pcost-ft .kwota-waluta { display: none; }
.pcost-ft-brak { color: var(--text-faint); }
.pcost-ft .project-cost-version-mini-panel, .pcost-ft.project-cost-version-mini-panel { padding: 0; }
.pcost-ft-zamrozona { margin: 0 0 var(--s-2); color: var(--text-muted); font-size: var(--t-xs); }

/* === 8. MATERIAŁY: lista grup z pod-wierszami === */
.pcost-pdc { display: block; padding: 0; border-top: 0; }
.pcost-par { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); margin: 0; padding: var(--s-1) 0 var(--s-2); color: var(--text-faint); font-size: var(--t-sm); }
.pcost-par b { color: var(--text); font-weight: var(--w-bold); }
.pcost-pfl { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-3); align-items: start; }
.pcost-pfgr { display: flex; flex-direction: column; min-width: 0; overflow: clip; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; background: none; }
.pcost-pfg { display: flex; align-items: center; min-height: 34px; padding: var(--s-1) 0; border-bottom: 1px solid var(--line-soft); color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-strong); }
.pcost-pfr { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); min-height: 32px; padding: var(--s-1) 0; border-top: 1px solid var(--line-soft); font-size: var(--t-sm); }
.pcost-pfg + .pcost-pfr { border-top: 0; }
.pcost-pfosob > summary.pcost-pfg { cursor: pointer; list-style: none; }
.pcost-pfosob > summary.pcost-pfg::-webkit-details-marker { display: none; }
.pcost-pfr > span { min-width: 0; color: var(--text-muted); }
.pcost-pfr > b { color: var(--text); font-weight: var(--w-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcost-pfr > b i { margin-left: 3px; color: var(--text-faint); font-size: var(--t-xs); font-style: normal; font-weight: var(--w-bold); }
.pcost-pfr.gl { background: color-mix(in srgb, var(--kc-prod) 10%, var(--surface)); }
.pcost-pfr.gl > span { color: var(--text); font-weight: var(--w-strong); }
.pcost-pfr.gl > b { font-size: var(--t-base); }
.pcost-pfr.pod > span { padding-left: var(--s-3); color: var(--text-faint); }
.pcost-pfr.pod > b { color: var(--text-muted); font-weight: var(--w-bold); }

/* === 9. PASEK ZAKRESU CENY (wzór .k-scope): jeden, zawsze ta sama wysokość === */
.pcost-zakres { display: flex; align-items: center; gap: var(--s-3); box-sizing: border-box; min-height: 64px; font-size: var(--t-sm); line-height: 1.4; margin: 0 0 var(--s-3); padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.pcost-zakres-i { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.pcost-zakres-i .icon { width: 18px; height: 18px; }
.pcost-zakres-t { display: flex; flex: 1 1 0; flex-direction: column; gap: 1px; min-width: 0; }
.pcost-zakres-t > b { color: var(--text); font-size: var(--t-base); font-weight: var(--w-strong); }
.pcost-zakres-t > small { overflow: hidden; color: var(--text-faint); font-size: var(--t-xs); text-overflow: ellipsis; white-space: nowrap; }
.pcost-zakres > .button { flex: none; min-height: 44px; }
.pcost-zakres.is-zestaw { border-color: var(--warn-strong); background: var(--warn-soft); }
.pcost-zakres.is-zestaw .pcost-zakres-i { background: transparent; color: var(--warn-strong); }
.pcost-zakres.is-zestaw .pcost-zakres-t > small { color: var(--text-muted); }
.pcost-zakres.is-pusty .pcost-zakres-i { background: var(--surface-3); color: var(--text-faint); }

/* === 10. WĘŻSZY EDYTOR: kolumny liczb dobiera szerokość edytora (kontener „ked”) === */
@container ked (max-width: 1000px) {
  .pcost-dg > .pcost-dg-tresc > .pcost-dg-lista { --k-th: 72px; --k-rh: 64px; --k-cols: minmax(0, 1fr) repeat(3, 96px) 32px; }
  .pcost-kn-cel.is-prowizja, .pcost-kn-cel.is-rabat, .pcost-kth span:nth-child(4), .pcost-kth span:nth-child(5) { display: none; }
}
@container ked (max-width: 760px) {
  .pcost-dg > .pcost-dg-tresc > .pcost-dg-lista { --k-th: 64px; --k-cols: minmax(0, 1fr) 110px 32px; }
  .pcost-kn-cel.is-koszt, .pcost-kn-cel.is-zysk, .pcost-kth span:nth-child(2), .pcost-kth span:nth-child(3) { display: none; }
}
@container ked (max-width: 640px) {
  .pcost-ft-h { display: none; }
  .pcost-ft-r { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n z" "m m"; row-gap: 0; column-gap: var(--s-3); padding: var(--s-2) 0; }
  .pcost-ft-r > .n { grid-area: n; }
  .pcost-ft-r > .z { grid-area: z; }
  .pcost-ft-r > .pcost-ft-m { grid-area: m; }
  .pcost-ft-r > .k { display: none; }
  .pcost-ft-r .s1 { display: none; }
  .pcost-ft-r .s2 { display: block; }
  .pcost-ft-r.suma > .pcost-ft-m { display: none; }
  .pcost-ft-r.suma { grid-template-areas: "n z"; }
  .pcost-ft-ro { justify-content: flex-start; }
}
@container ked (max-width: 520px) {
  .pcost-dg > .pcost-dg-tresc > .pcost-dg-lista { --k-rh: 68px; --k-cols: minmax(0, 1fr) auto 28px; }
  .pcost-kn-wiersz { gap: var(--s-2); }
  .pcost-kn-wiersz > .pcost-kn-miniatura, .pcost-kth { display: none; }
  .pcost-kn-rozwin { padding: var(--s-2) 0; }
  .pcost-kn-cel.is-koszt, .pcost-kn-cel.is-zysk { display: none; }
  .pcost-kn-cel.is-cena > b { font-size: var(--t-md); }
  .pcost-kn-strzalka { width: 28px; height: 28px; }
  .pcost-kn-wyn, .pcost-kn-wyn.is-bez-prowizji { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); padding: var(--s-2) var(--s-3); }
  .pcost-kn-panel > .pcost-kn-wyn { top: 56px; }
  .pcost-kn-wyn > .pcost-wyn-poz:first-child, .pcost-kn-wyn > .pcost-wyn-op { display: none; }
  .pcost-kn-wyn .pcost-wyn-poz > b { font-size: var(--t-base); }
  .pcost-kn-wyn .pcost-wyn-poz.is-cena > b, .pcost-kn-wyn .pcost-wyn-poz.is-wynik > b { font-size: var(--t-md); }
  .pcost-kn-wyn .pcost-wyn-poz.is-wynik { padding: var(--s-1) var(--s-2); }
  .pcost-pan-min { display: block; width: 100%; height: 92px; margin: 0 0 var(--s-2); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; }
  .pcost-pan-min > img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .pcost-pan-akc .button { flex: 1 1 auto; }
}

/* === 11. TABLET (≤ 1180 px strony): pasek sum 6 kolumn, akcje Designu w drugim rzędzie, dotyk ≥ 44 px === */
@media (max-width: 1180px) {
  .pcost-pan-akc .button { min-height: 44px; }
  .pcost-kn-wyn { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1.2fr) auto minmax(0, 1.3fr); }
  .pcost-kn-wyn .pcost-wyn-op.o2, .pcost-kn-wyn .pcost-wyn-poz.o2 { display: none; }
  .pcost-kn-wyn.is-bez-prowizji { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); }
  .pcost-dg > summary.pcost-dg-glowa { flex-wrap: wrap; padding-right: 0; }
  .pcost-dg-akcje { width: calc(100% - 2 * var(--s-3)); margin: 0 var(--s-3) var(--s-2); }
  .pcost-dg-akcje .button { flex: 1 1 0; min-height: 44px; }
  .pcost-kn-bom { min-height: 44px; }
  .pcost-prw > .button { min-height: 44px; }
  .pcost-ft-m > .project-cost-version-table-value > input[type="number"] { height: 44px; width: 56px; }
}
@media (max-width: 900px) {
  .pcost-kn-wyn, .pcost-kn-wyn.is-bez-prowizji { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); align-items: end; gap: var(--s-2) var(--s-3); }
  .pcost-kn-wyn .pcost-wyn-op { display: none; }
}
@media (max-width: 640px) {
  .pcost-dg-t { grid-template-columns: 16px 34px minmax(0, 1fr); }
  .pcost-dg-t > .pcost-dg-suma { grid-column: 3; font-size: var(--t-base); }
  .pcost-dg-akcje { margin: 0 var(--s-3) var(--s-3); }
  .pcost-dg > .pcost-dg-tresc > .pcost-kn-wyn { padding: var(--s-3); }
  .pcost-dg > .pcost-dg-tresc > .pcost-fprof { padding: var(--s-3); }
  .pcost-dg > .pcost-dg-tresc > .pcost-fprof .pcost-prw > select { max-width: none; }
  .pcost-gdol > .pcost-ptabs { margin: var(--s-3) var(--s-3) 0; }
  .pcost-gdol .pcost-ptab { padding: var(--s-3); }
  .pcost-ptabs > button { font-size: var(--t-sm); padding: 0 var(--s-1); }
  .pcost-dg .pcost-kn { padding: var(--s-3); }
  .pcost-zakres { min-height: 68px; padding: var(--s-2); }
  .pcost-zakres-t > small { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .pcost-zakres > .button { max-width: 112px; padding: 0 var(--s-3); font-size: var(--t-sm); line-height: 1.2; white-space: normal; }
  .pcost-dg > .pcost-dg-tresc > .pcost-dg-lista { --k-bom: 44px; }
  .pcost-kn-bom { min-height: 44px; padding: 0; justify-content: center; }
  .pcost-kn-bom > span:not(.icon) { display: none; }
  .pcost-kn-bom .icon { width: 18px; height: 18px; }
}

/* === 12. PROFIL USŁUG nad listą kosztów (wzór .k-uprof): lista | „Zapisz” słowem | kosz === */
.pcost-uprof { display: flex; flex-direction: column; gap: var(--s-1); margin: 0 0 var(--s-3); padding: 0 var(--s-1); }
.pcost-uprof-r { display: flex; align-items: center; gap: var(--s-1); }
.pcost-uprof-r > :is(select, .combo) { flex: 1 1 0; min-width: 0; max-width: 200px; }
.pcost-uprof .button { flex: none; height: var(--h-control); font-size: var(--t-sm); font-weight: var(--w-regular); }
.pcost-uprof .pcost-uprof-zapisz { padding: 0 var(--s-3); font-weight: var(--w-bold); }
.pcost-uprof .pcost-ikonka { width: var(--h-control); padding: 0; }
.pcost-uprof .pcost-uprof-zapisz.is-swieci { position: relative; border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.pcost-uprof .pcost-uprof-zapisz.is-swieci::after { content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface-2); }
@media (max-width: 1180px) { .pcost-uprof .button, .pcost-uprof .pcost-uprof-r > :is(select, .combo) { min-height: 44px; height: 44px; } .pcost-uprof .pcost-ikonka { width: 44px; } }
@media (max-height: 520px) { .pcost-pan-min { display: none; } }
