/* =====================================================================
   formio — konfigurator. Kolory marki z logo: krem + grafit; jeden akcent do zaznaczeń.
   ===================================================================== */
:root {
  --bg: #f3eee5;
  --panel: #fffdf9;
  --panel-2: #f8f3ea;
  --ink: #2b2826;
  --muted: #7d756b;
  --line: #e6dfd2;
  --line-strong: #d4cbbb;
  --accent: #3b5bdb;
  --accent-soft: #e9edff;
  --danger: #c2412d;
  --ok: #2f9e44;
  --seam: #8f877a;
  --wall: #f76707;
  --outer: #2b2826;
  --inner: #1f8a4c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 40, 38, .05), 0 6px 18px rgba(43, 40, 38, .06);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.icon { flex: none; display: block; }

/* ---------- nagłówek ---------- */
.top { height: 62px; padding: 0 20px; display: flex; align-items: center; gap: 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo-mark { width: 28px; height: 28px; fill: var(--ink); display: block; }
.wordmark { font-size: 25px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.tagline { color: var(--muted); font-size: 13px; padding-left: 16px; border-left: 1px solid var(--line); }

/* przełącznik języka — jak przełącznik mm / cm */
.lang { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; }
.lang button { border: 0; background: transparent; padding: 7px 13px; font-size: 14px; font-weight: 800; border-radius: 8px; min-width: 38px; color: var(--muted); }
.lang button:hover { color: var(--ink); }
.lang button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(43, 40, 38, .15); }
.toggles { display: inline-flex; gap: 8px; align-items: center; }

/* zakładka „Przykłady” w nagłówku — rozwijany panel z kartami szafek */
.examples { margin-left: auto; position: relative; }
.exbtn { padding: 10px 15px; font-size: 14px; border-radius: 11px; }
.exbtn[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.exbtn[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.expanel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(560px, 92vw); padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(43, 40, 38, .18); }
.expanel[hidden] { display: none; }
.exhead { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; font-size: 14px; }
.exhead .hint { margin: 0; }
.excards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.excard { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; text-align: left; border-radius: 12px; font-weight: 600; }
.excard svg { width: 100%; height: auto; display: block; border-radius: 8px; background: var(--panel-2); }
.excard b { font-size: 13px; }
.excard .hint { margin: 0; font-size: 11.5px; }
@media (max-width: 720px) { .excards { grid-template-columns: 1fr; } .examples { margin-left: 0; } }

/* ---------- układ ---------- */
/* kolumny: panel ustawień | widoki | panel szczegółu — szerokości zmieniają się płynnie */
.layout { --left: 330px; --right: 0px; --insp: 520px;
  display: grid; grid-template-columns: var(--left) 1fr var(--right); gap: 16px; padding: 16px; height: calc(100vh - 62px);
  transition: grid-template-columns .4s ease; }
.layout.inspecting { --right: var(--insp); }
.panel { min-width: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- panel lewy ---------- */
.panel { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 2px; }
.panel section { padding: 14px 16px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; font-weight: 800; display: flex; align-items: center; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 9px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 800; }
.panel h3 { margin: 14px 0 8px; font-size: 13px; font-weight: 800; }
.panel label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; font-weight: 600; }
.panel select, .panel input[type=number] { font: inherit; font-weight: 600; color: var(--ink); padding: 6px 9px;
  border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; }
.panel select:focus, .panel input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.panel select { width: 100%; margin-top: 4px; }
.dims label { display: flex; align-items: center; gap: 8px; }
.dims input { width: 96px; margin-left: auto; }
.dims .u { width: 22px; }

.sechead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sechead h2 { margin: 0; }
.unit { display: inline-flex; gap: 2px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; }
.unit button { border: 0; background: transparent; padding: 3px 10px; font-size: 12px; border-radius: 7px; color: var(--muted); }
.unit button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(43, 40, 38, .15); }

.hint { font-size: 12px; color: var(--muted); margin: 6px 0; line-height: 1.45; }
.info { font-size: 13px; margin: 8px 0 0; line-height: 1.55; }
.warn { color: var(--danger); }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 11px;
  font-family: inherit; background: #fff; }

/* ---------- przyciski ---------- */
button, .button {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: #fff; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 12px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, border-color .15s;
}
button:hover, .button:hover { border-color: var(--ink); background: #fffaf2; }
button.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
button.primary:hover { background: #45403c; }
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); }
button.iconbtn { padding: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.wallrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wallrow input { width: 84px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips button { padding: 3px 8px; font-size: 12px; border-radius: 999px; }
.chips button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.drawbtn { width: 100%; margin-top: 6px; padding: 9px 12px; }
/* równy podział szuflady */
.fillbox { margin: 12px 0 4px; padding: 10px 12px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.fillbox h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.fillbox h3 .icon { color: var(--accent); }
.fillbox .hint { margin-top: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; overflow: hidden; }
.stepper button { border: 0; border-radius: 0; padding: 7px 8px; background: transparent; }
.stepper button:hover { background: var(--panel-2); }
.panel .stepper input[type=number] { width: 52px; border: 0; border-radius: 0; text-align: center; padding: 6px 2px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#fillinfo { margin: 8px 0 2px; }
#fillinfo b { color: var(--ink); }
#fillgo:disabled { opacity: .5; cursor: not-allowed; }
#fillgrow[hidden] { display: none; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.pair .wallrow input { width: 76px; }
.pair .chips { margin-top: 6px; }
.pair .hint { margin: 5px 0 0; }


/* ---------- podsumowanie ---------- */
.price { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
/* D41: szacunek kosztu wydruku (filament + prąd), a nie cena — jasna ramka przerywaną linią, „≈” i widełki */
.price-est { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1.5px dashed var(--line-strong);
  border-radius: 12px; background: var(--panel-2); }
.price-est .pelabel { font-size: 12px; font-weight: 700; color: var(--muted); }
.price-est strong { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.price-est .perange { font-size: 12px; color: var(--muted); }
.price-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.price-meta div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; text-align: center; }
.price-meta b { display: block; font-size: 13px; }
.price-meta span { font-size: 10.5px; color: var(--muted); }
.parts { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.parts td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.parts td.n, .parts td.g { text-align: right; color: var(--muted); white-space: nowrap; padding-left: 8px; }

/* ---------- podgląd 3D ---------- */
.stage { display: flex; flex-direction: column; min-height: 0; }
.stage > .card { flex: 1; }
.view3d { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.viewhead { font-size: 14px; font-weight: 800; padding: 9px 14px; border-bottom: 1px solid var(--line);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.viewhead .hint { font-weight: 600; margin: 0; }
#three { position: absolute; inset: 0; }
.stage-wrap { position: relative; flex: 1; min-height: 0; }
/* D41: przycisk pobierania pływa w prawym dolnym rogu widoku 3D — zawsze widoczny podczas projektowania */
.dlbar { position: absolute; right: 14px; bottom: 14px; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  max-width: calc(100% - 28px); pointer-events: none; }
.dlbar > * { pointer-events: auto; }
.dlfab { display: inline-flex; align-items: center; gap: 8px; padding: 15px 24px; font-size: 16px; font-weight: 800; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(43, 40, 38, .22); }
.dlfab:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(43, 40, 38, .28); }
.dlbar .hint { margin: 0; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(43, 40, 38, .12); text-align: right; }
.dlbar .hint:empty { display: none; }
.overlaybar { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.overlaybar button { font-size: 12px; padding: 5px 10px; background: rgba(255, 255, 255, .94); }

/* ---------- rysunek techniczny w panelu szczegółu (web/js/rysunek.js) ----------
   Jak na kartce: grafitowe linie o kilku grubościach, kreskowanie przekroju, wnętrze kolorem akcentu. */
.td * { vector-effect: non-scaling-stroke; }
.td-edge { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; }
.td-edge.td-thin { stroke-width: 1; }
.td-wallfill { fill: url(#td-hatch); }
.td-cutfill { fill: url(#td-hatch-cut); }
.td-solid { fill: var(--ink); }
.td-solid-light { fill: var(--line-strong); }
.td-hatchline { stroke: var(--ink); stroke-width: .7; opacity: .55; }
.td-axis { stroke: var(--muted); stroke-width: .7; stroke-dasharray: 14 3 2 3; }
.td-cut { stroke: var(--ink); stroke-width: 2.4; }
.td-ground { stroke: var(--muted); stroke-width: 1; }
.td-split { stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: 6 4; }
.td-dim, .td-ext, .td-leader { stroke: var(--ink); stroke-width: .8; fill: none; }
.td-ext { opacity: .6; }
.td-arrow, .td-dot { fill: var(--ink); }
.td-in.td-dim, .td-in.td-ext { stroke: var(--accent); }
.td-arrow.td-in { fill: var(--accent); }
.td text { font-family: inherit; }
.td-text { font-size: var(--fs, 12px); font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--panel); stroke-width: calc(var(--fs, 12px) * .32); stroke-linejoin: round; }
.td-text.td-in { fill: var(--accent); }
.td-small { font-size: calc(var(--fs, 12px) * .88); font-weight: 600; }
.td-muted { fill: var(--muted); }
.td-splitlbl { fill: var(--accent); }
.td-cutlbl { font-weight: 800; }
.td-title { font-size: calc(var(--fs, 12px) * .82); font-weight: 800; letter-spacing: .12em; fill: var(--muted); }

/* ---------- panel szczegółu (z prawej) ---------- */
.inspector { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); opacity: 0; transition: opacity .3s ease; }
.layout.inspecting .inspector { opacity: 1; overflow-y: auto; }
.layout:not(.inspecting) .inspector { border-width: 0; box-shadow: none; }
.insp-inner { width: calc(var(--insp) - 2px); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.insp-head { display: flex; align-items: center; gap: 8px; }
.insp-head > .icon { color: var(--muted); }
.insp-head h2 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; }
.detail { width: 100%; height: 420px; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--panel-2); }
.kpi .k { font-size: 11px; color: var(--muted); font-weight: 700; }
.kpi .v { font-size: 16px; font-weight: 800; margin-top: 1px; }
.kpi.outer .v { color: var(--outer); }
.kpi.inner .v { color: var(--accent); }
.kpi.wide { grid-column: 1 / -1; }
.insp-actions { margin-top: 0; }

/* węższe ekrany: panel szczegółu wysuwa się NAD widokami (nie zabiera im miejsca) */
@media (max-width: 1200px) {
  .layout.inspecting { --right: 0px; }
  .inspector { position: fixed; top: 70px; right: 12px; bottom: 12px; width: min(var(--insp), 94vw); z-index: 20; opacity: 1;
    border-width: 1px; transform: translateX(110%); transition: transform .35s ease; box-shadow: -6px 0 24px rgba(43, 40, 38, .2); }
  .layout:not(.inspecting) .inspector { border-width: 1px; }
  .layout.inspecting .inspector { transform: none; overflow-y: auto; }
  .insp-inner { width: auto; }
  .tagline { display: none; }
}

@media (max-width: 720px) {
  .top { height: auto; padding: 10px 12px; flex-wrap: wrap; }
  .lang button { padding: 6px 10px; font-size: 13px; min-width: 32px; }
  .exbtn { padding: 7px 11px; font-size: 13px; }
  .dlfab { padding: 13px 18px; font-size: 15px; }
  .layout, .layout.inspecting { grid-template-columns: 1fr; height: auto; padding: 12px; }
  .inspector { top: 0; right: 0; bottom: 0; }
  .stage > .card { min-height: 60vh; }
}

/* podgląd 3D: komunikat (np. brak miejsca) i wyróżniony przycisk „Dodaj pojemnik" */
#status3d.bad { color: var(--danger); font-weight: 700; }
.overlaybar button.primary { background: var(--ink); }
/* panel szczegółu: wpisywane wymiary pojemnika */
.kpi.dimsin { grid-column: 1 / -1; }
.kpi.dimsin .wallrow { margin-top: 4px; font-weight: 700; }
.kpi.dimsin input { width: 78px; font: inherit; font-weight: 700; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }
/* pobieranie plików do druku */
#printfiles { width: 100%; margin: 10px 0 4px; }
#printfiles:disabled { opacity: .6; cursor: progress; }
#printinfo:empty { display: none; }
#printinfo.warn { color: var(--danger); font-weight: 700; }

/* ---------- okno płatności (paywall, D38) ---------- */
.paywall { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 22px;
  background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(43, 40, 38, .35); overflow: auto; }
.paywall::backdrop { background: rgba(43, 40, 38, .45); backdrop-filter: blur(3px); }
.paywall[open] { animation: pw-in .22s cubic-bezier(.2, .9, .3, 1.2); }
.paywall[open]::backdrop { animation: pw-fade .2s ease-out; }
@keyframes pw-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes pw-fade { from { opacity: 0; } }
/* D42: okno potwierdzenia — ten sam styl co okno płatności, tylko mniejsze */
.confirm { width: min(420px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 20px; background: var(--panel); color: var(--ink);
  box-shadow: 0 30px 80px rgba(43, 40, 38, .35); }
.confirm::backdrop { background: rgba(43, 40, 38, .45); backdrop-filter: blur(3px); }
.confirm[open] { animation: pw-in .2s cubic-bezier(.2, .9, .3, 1.2); }
.confirm[open]::backdrop { animation: pw-fade .2s ease-out; }
.cf { padding: 26px 26px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.cficon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: var(--bg); margin-bottom: 4px; }
.cficon.danger { background: #fdecea; color: var(--danger); }
.cf h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.cf p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cf p:empty { display: none; }
.cfbtns { display: flex; gap: 10px; width: 100%; margin-top: 12px; }
.cfbtns button { flex: 1; padding: 11px 14px; font-size: 14.5px; font-weight: 800; border-radius: 12px; }
.cfbtns button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.cfbtns button.danger:hover { filter: brightness(1.08); color: #fff; }
/* D44: konto — przycisk w nagłówku, okno logowania, Moje konto, komunikat na dole */
.acctbtn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; font-size: 14px; font-weight: 800; border-radius: 11px; }
.acctbtn[hidden] { display: none; }
.acctbal { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12px; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; }
.auth, .account { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.account { width: min(540px, calc(100vw - 32px)); }
.au, .ac { position: relative; align-items: stretch; text-align: left; }
.au > .cficon, .ac > .cficon, .au > h2, .ac > h2 { align-self: center; text-align: center; }
.aulead { margin: 0 0 4px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.aulead:empty { display: none; }
.aumain, .aucode { display: flex; flex-direction: column; gap: 12px; }
.aumain[hidden], .aucode[hidden] { display: none; }
.augoogle { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 800; font-size: 14.5px; text-decoration: none; }
.augoogle:hover { border-color: var(--ink); }
.augoogle[hidden], .audiv[hidden] { display: none; }
.audiv { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.audiv::before, .audiv::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.autabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.autabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; padding: 9px 10px;
  font-size: 13.5px; font-weight: 800; border-radius: 9px; color: var(--muted); }
.autabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(43, 40, 38, .15); }
.autabnote { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.45; }
.auform { display: flex; flex-direction: column; gap: 10px; }
.auform input[type=email], .auform input[type=password] { font: inherit; font-size: 16px; padding: 11px 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; }
.auform input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auform input[hidden], .pwnews[hidden], .pwlink[hidden] { display: none; }
.auform button { padding: 12px 16px; font-size: 15px; font-weight: 800; border-radius: 12px; }
.aualt { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.acbody { display: flex; flex-direction: column; gap: 14px; }
/* Moje konto (D48): e-mail pod tytułem, zakładki Szafki / Dokup / Ustawienia, wylogowanie w stopce */
.acwho { margin: -6px 0 0; text-align: center; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.actabs { grid-template-columns: repeat(3, 1fr); }
.acpanel { display: flex; flex-direction: column; gap: 12px; min-height: 180px; }
.acbal { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: #eef7f0; border: 1.5px solid #cfe8d5; }
.acbaltext b { display: block; font-size: 18px; font-weight: 800; line-height: 1.25; }
.acbaltext span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.acbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.acbtns button { display: inline-flex; align-items: center; gap: 7px; padding: 11px 16px; font-weight: 800; border-radius: 12px; }
.acbtns button.primary { flex: 1; justify-content: center; }
/* D49: abonament widoczny od razu — złota plakietka PRO, karta w odcieniu złota, szafki z pakietów pod spodem */
.acstate { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -8px 0 0; font-size: 13px; font-weight: 700; }
.probadge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #2b2826; color: #f6d77a; font-style: normal;
  font-size: 11px; font-weight: 900; letter-spacing: .8px; line-height: 1.5; }
.acbaltext .probadge { margin-bottom: 4px; }
.acbal.pro { background: linear-gradient(135deg, #fff8e5, #fdf1cf); border-color: #efd68b; }
.acbal.pro .pwbalico { color: #9a6b00; }
.acextra { display: flex; align-items: center; gap: 8px; margin: -4px 0 0; padding: 0 4px; font-size: 13px; color: var(--muted); }
.acctbal:not(:empty) { font-weight: 900; }
.acsubrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 14px;
  border-radius: 12px; background: var(--panel-2); font-size: 13px; color: var(--muted); }
.achead { display: flex; align-items: center; gap: 8px; margin: 4px 0 -4px; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); }
.account-n { padding: 1px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); letter-spacing: 0; }
.aclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow: auto; }
.aclist li { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); font-size: 13.5px; }
.aclist li .icon { color: var(--ok); }
.aclist span { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.acempty { margin: 0; padding: 14px; border-radius: 12px; border: 1.5px dashed var(--line-strong); text-align: center; font-size: 13px; color: var(--muted); }
.acbuy { display: flex; flex-direction: column; gap: 12px; }
.pwplans.acplans { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
.acsec { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.acsec h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; font-weight: 800; }
.acsec p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.acsec .pwrow { display: flex; gap: 8px; }
.acsec .pwrow input { flex: 1; min-width: 0; }
.acsec.danger { background: none; border-style: dashed; }
.acsec.danger h3 { color: var(--danger); }
.acdel { align-self: flex-start; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 800; color: var(--danger);
  background: none; border: 1.5px solid #f0c9c0; }
.acdel:hover { background: #fbe9e5; border-color: var(--danger); }
.acfoot { display: flex; justify-content: center; padding-top: 12px; border-top: 1px solid var(--line); }
.acfoot .pwlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.acfoot .pwlink:hover { color: var(--ink); }
.pwlink.danger { color: var(--danger); }
/* ---------- toasty (D47, web/js/toast.js): potwierdzenia akcji, nad otwartymi oknami (popover) ---------- */
.toasts { position: fixed; inset: 16px 16px auto auto; margin: 0; padding: 0; border: 0; background: none; overflow: visible;
  width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; z-index: 1000; pointer-events: none; }
.toasts:not(:popover-open):empty { display: none; }
.toast { position: relative; overflow: hidden; pointer-events: auto; display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 12px 15px 14px; border-radius: 14px; background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(43, 40, 38, .16), 0 2px 6px rgba(43, 40, 38, .06); font-size: 14px; line-height: 1.4;
  animation: toast-in .26s cubic-bezier(.2, .9, .3, 1.2); }
.toast.out { animation: toast-out .22s ease-in forwards; }
.toast-ico { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.toast-ok .toast-ico { background: #e6f4ea; color: var(--ok); }
.toast-err .toast-ico { background: #fbe9e5; color: var(--danger); }
.toast-info .toast-ico { background: var(--panel-2); color: var(--ink); }
.toast-err { border-color: #f0c9c0; }
.toast-body { flex: 1; min-width: 0; padding-top: 5px; overflow-wrap: anywhere; }
.toast-body b { display: block; font-weight: 800; margin-bottom: 2px; }
.toast-x { flex: none; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer; }
.toast-x:hover { background: var(--panel-2); color: var(--ink); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; background: var(--line-strong);
  animation: toast-bar linear forwards; }
.toast-ok .toast-bar { background: var(--ok); opacity: .55; }
.toast-err .toast-bar { background: var(--danger); opacity: .55; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-bar { to { transform: scaleX(0); } }
@media (max-width: 720px) { .toasts { inset: 10px 10px auto 10px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.out { animation: none; } .toast-bar { display: none; } }
@media (max-width: 720px) { .acctname { display: none; } .acctbtn { padding: 7px 10px; } }
.pw { position: relative; padding: 28px 30px 22px; display: flex; flex-direction: column; gap: 16px; }
.pwclose { position: absolute; top: 14px; right: 14px; border-color: transparent; background: transparent; }
.pwhead { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pwicon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: var(--bg); margin-bottom: 4px; }
.pwhead h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.pwhead p { margin: 0; color: var(--muted); font-size: 14px; }

.pwproject { display: flex; gap: 14px; align-items: center; padding: 12px 14px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
.pwproject > div:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwproject .hint { margin: 0; }
.pwthumb { flex: none; width: 92px; }
.pwthumb svg { width: 100%; height: auto; display: block; }
.pwget { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; font-weight: 600; }
.pwget li { display: inline-flex; align-items: center; gap: 5px; }
.pwget .icon { color: var(--ok); }

.pwplans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-top: 8px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px 14px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: 16px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.plan:hover { border-color: var(--ink); transform: translateY(-2px); }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 24px rgba(59, 91, 219, .14); }
.plan:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan.sub { background: linear-gradient(160deg, #fff 40%, var(--panel-2)); }
.plname { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.plcount { display: inline-flex; align-items: center; gap: 5px; font-size: 16px; font-weight: 800; }
.plprice { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }
.plprice { white-space: nowrap; }
.plprice small { display: block; margin-top: -2px; font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.plper { font-size: 12px; color: var(--muted); }
.plbadge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--accent); color: #fff; }
.plbadge.soft { background: #e6f4ea; color: var(--ok); }
.plcheck { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); color: transparent; transition: all .15s; }
.plan:has(input:checked) .plcheck { background: var(--accent); border-color: var(--accent); color: #fff; }

.pwnote { margin: -4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.pwgo { width: 100%; padding: 13px 18px; font-size: 15px; border-radius: 14px; }
.pwinfo { margin: -6px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--accent); }
.pwinfo:empty { display: none; }
.pwsecure { margin: -4px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pwdev { align-self: center; border: 0; background: none; padding: 2px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: underline; }
.pwdev:hover { background: none; color: var(--ink); }
.pwdev[hidden] { display: none; }

/* konto w oknie płatności (D39): pasek konta, pobranie z salda, logowanie kodem */
.pwacct { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 14px; border-radius: 14px;
  background: #eef7f0; border: 1px solid #cfe8d5; font-size: 13.5px; }
.pwwho { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.pwwho .icon { color: var(--ok); }
.pwbal { font-weight: 700; }
.pwacts { margin-left: auto; display: inline-flex; gap: 12px; }
.pwlink { border: 0; background: none; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.pwlink:hover { background: none; color: var(--ink); }
.pwlink[hidden] { display: none; }
/* D40: pierwsza szafka gratis (niezalogowany), przełącznik Pro rocznie, zgoda na newsletter */
.pwfree { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 18px; border-radius: 14px;
  font-size: 15px; font-weight: 800; background: #eef7f0; border: 1.5px solid #cfe8d5; color: var(--ink); }
.pwfree .icon { color: var(--ok); }
.pwfree:hover { border-color: var(--ok); background: #e3f2e7; }
.pwfree[hidden] { display: none; }
.pwyear { align-self: center; display: inline-flex; align-items: center; gap: 8px; margin-top: -6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pwyear input, .pwnews input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.pwnews { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.4; cursor: pointer; }
.pwnews input { margin-top: 1px; }
.pwnews[hidden] { display: none; }
.pwuse { display: flex; flex-direction: column; gap: 8px; }
/* D47: saldo na wierzchu — kto ma szafki albo abonament, widzi je zamiast pakietów */
.pwbuy { display: flex; flex-direction: column; gap: 14px; }
.pwbuy[hidden] { display: none; }
.pwbalcard { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px;
  background: #eef7f0; border: 1.5px solid #cfe8d5; }
.pwbalico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--panel); color: var(--ok);
  box-shadow: 0 1px 2px rgba(43, 40, 38, .06); }
.pwbalcard b { display: block; font-size: 18px; font-weight: 800; line-height: 1.25; }
.pwbalcard span:not(.pwbalico) { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.pwusenote.ok, #pwusenote.ok { color: var(--ok); font-weight: 700; }
.pwgo[hidden], .pwuse[hidden], .pwacct[hidden], .pwbuyhead[hidden], .pwlogin[hidden], .pwrow[hidden] { display: none; }
.pwbuyhead { margin: 6px 0 -6px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); text-align: center; }
.pwlogin { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; background: var(--panel-2); border: 1.5px solid var(--accent); }
.pwloginlead { margin: 0; font-size: 14px; font-weight: 700; }
.pwrow { display: flex; gap: 8px; }
.pwrow input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; }
.pwrow input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#pwcode { letter-spacing: 6px; font-weight: 800; text-align: center; }
#pwcode::placeholder { letter-spacing: 0; font-weight: 600; }
.pwrow button { padding: 10px 16px; border-radius: 12px; white-space: nowrap; }
.pwlogin .pwlink { align-self: flex-start; }
.pwinfo.bad { color: var(--danger); }
.pwnote.ok { color: var(--ok); font-weight: 700; }
button.busy { opacity: .65; cursor: progress; }

@media (max-width: 720px) {
  .pw { padding: 22px 16px 16px; }
  .pwplans { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .pwthumb { width: 64px; }
  .pwrow { flex-direction: column; }
  .pwacts { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .confirm[open], .confirm[open]::backdrop, .paywall[open], .paywall[open]::backdrop { animation: none; }
  .plan:hover { transform: none; }
}

/* D52: baner zgody na ciasteczka (web/js/zgoda.js) */
.cookiebar { position: fixed; left: 16px; bottom: 16px; z-index: 900; max-width: 420px; padding: 14px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(43,40,38,.18); font-size: 13.5px; line-height: 1.45; }
.cookiebar p { margin: 0 0 10px; }
.cookiebar a { color: inherit; }
.cookiebtns { display: flex; gap: 8px; justify-content: flex-end; }
.cookiebtns button { padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line); background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
.cookiebtns button.primary { background: var(--ink, #2b2826); color: #fffdf9; border-color: transparent; }
.legal { margin: 0; padding: 0 4px 4px; font-size: 12px; color: var(--muted, #7d756b); }
.legal a, .linkbtn { color: inherit; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 520px) { .cookiebar { left: 8px; right: 8px; bottom: 8px; max-width: none; } }
