/*
 * Kalkulatory ignacydev. Ten sam język co ignacydev.pl: Archivo (z osią szerokości) i JetBrains Mono,
 * jasne „intro” #E8E5DE z czernią #0D0D0B, ciemny „finał” z kalkulatorem, cienkie linie, rogi 2 px,
 * małe etykiety pismem maszynowym. Bez gradientów, cieni i szklanych kart.
 */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(fonty/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(fonty/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonty/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonty/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- podstawy ---------- */

:root {
  --jasne: #e8e5de;
  --ciemne: #0d0d0b;
  --bg: var(--jasne);
  --ink: var(--ciemne);
  --muted: color-mix(in oklab, var(--ink) 62%, var(--bg));
  --hairline: color-mix(in oklab, var(--ink) 20%, var(--bg));
  --margin: clamp(16px, 2.1vw, 36px);
  --szer: 1440px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Serie na wykresach (sprawdzone pod kątem daltonizmu na ciemnym tle). */
  --s1: #e5633d;
  --s2: #3597c8;
  --s3: #b48f12;
  /* Kolor straty i zysku w tekście: na jasnym tle ciemniejszy, żeby trzymał kontrast AA. */
  --minus: #b3401c;
  --plus: #1f6e96;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Ziarno jak na ignacydev.pl, bardzo lekkie. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

:where(h1, h2, h3) {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.przeskocz {
  position: absolute;
  left: var(--margin);
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
}

.przeskocz:focus {
  top: 12px;
}

.etykieta,
.kod {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.kod {
  text-transform: uppercase;
}

/* ---------- nagłówek ---------- */

.naglowek {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--szer);
  margin: 0 auto;
  padding: var(--margin) var(--margin) 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.okruszki {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.okruszki li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--muted);
}

.okruszki a {
  text-decoration: none;
}

.okruszki a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .okruszki li:last-child {
    display: none;
  }
}

.naglowek-cta {
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- otwarcie ---------- */

main {
  display: block;
}

.otwarcie {
  display: grid;
  gap: 22px;
  max-width: var(--szer);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 132px) var(--margin) clamp(40px, 5vw, 64px);
}

.otwarcie h1 {
  max-width: 17ch;
  font-size: clamp(44px, 7.4vw, 124px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variation-settings: "wdth" 86;
}

.otwarcie-glowna h1 {
  max-width: 14ch;
}

.lead {
  max-width: 44ch;
  font-size: clamp(19px, 1.6vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.fakty {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.fakty li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  vertical-align: 1px;
  background: currentColor;
}

/* ---------- kalkulator: ciemna plansza jak finał ignacydev.pl ---------- */

.kalk {
  --bg: var(--ciemne);
  --ink: var(--jasne);
  --minus: #ff8f73;
  --plus: #7cc4ea;
  color-scheme: dark;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 3vw, 56px);
  max-width: calc(var(--szer) - 2 * var(--margin));
  margin: 0 auto;
  padding: clamp(24px, 3vw, 48px);
  background: var(--bg);
  color: var(--ink);
  border-radius: 2px;
}

@media (min-width: 1000px) {
  .kalk {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    margin-inline: var(--margin);
  }
}

@media (min-width: 1505px) {
  .kalk {
    margin-inline: auto;
  }
}

@media (max-width: 999px) {
  .kalk {
    margin-inline: calc(var(--margin) / 2);
  }
}

.formularz {
  display: grid;
  gap: 34px;
  align-content: start;
  min-width: 0;
}

.grupa {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.grupa-tytul {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
  font-size: clamp(22px, 1.9vw, 30px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 90;
}

.grupa-tytul span {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.pole {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend.etykieta {
  padding: 0;
  margin-bottom: 9px;
}

.pomoc {
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

.pomoc a {
  color: var(--ink);
}

/* Kafelki wyboru. */
.chipy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 13px;
  border: 1px solid color-mix(in oklab, var(--ink) 26%, var(--bg));
  border-radius: 2px;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.chip small {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.chip:hover {
  border-color: var(--ink);
}

.chip:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.chip:has(input:checked) small {
  color: color-mix(in oklab, var(--bg) 70%, var(--ink));
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.chipy.szerokie {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.chipy.szerokie .chip {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 13px;
}

/* Pole liczbowe: −, wartość, +, jednostka. */
.licznik {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border: 1px solid color-mix(in oklab, var(--ink) 26%, var(--bg));
  border-radius: 2px;
  transition: border-color 0.2s;
}

.licznik:focus-within {
  border-color: var(--ink);
}

.licznik button {
  flex: none;
  width: 42px;
  height: 44px;
  font-size: 19px;
  line-height: 1;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.licznik button:hover {
  background: var(--ink);
  color: var(--bg);
}

.licznik button:focus-visible {
  outline-offset: -2px;
}

.licznik input {
  width: 9.5ch;
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  border: 0;
  border-inline: 1px solid color-mix(in oklab, var(--ink) 26%, var(--bg));
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  outline: none;
}

.jednostka {
  padding: 0 14px 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Suwak: cienka linia, wypełniona do wartości. */
.suwak {
  --p: 50%;
  width: min(100%, 420px);
  height: 22px;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.suwak::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(var(--ink) 0 0) 0 / var(--p) 100% no-repeat,
    color-mix(in oklab, var(--ink) 24%, var(--bg));
}

.suwak::-moz-range-track {
  height: 2px;
  background: color-mix(in oklab, var(--ink) 24%, var(--bg));
}

.suwak::-moz-range-progress {
  height: 2px;
  background: var(--ink);
}

.suwak::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  appearance: none;
}

.suwak::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
}

/* Przełącznik. */
.przelacznik {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  cursor: pointer;
}

.przelacznik input {
  position: absolute;
  opacity: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.przelacznik .tor {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border: 1px solid color-mix(in oklab, var(--ink) 40%, var(--bg));
  border-radius: 999px;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.przelacznik .tor::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out);
}

.przelacznik input:checked + .tor {
  background: var(--ink);
  border-color: var(--ink);
}

.przelacznik input:checked + .tor::after {
  transform: translateX(16px);
  background: var(--bg);
}

.przelacznik input:focus-visible + .tor {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- panel wyniku ---------- */

.wynik {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
  scroll-margin-top: 16px;
}

@media (min-width: 1000px) {
  .wynik {
    position: sticky;
    top: 20px;
    align-self: start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--hairline) transparent;
  }
}

.kwota {
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variation-settings: "wdth" 86;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.podpis {
  max-width: 46ch;
  font-size: 15.5px;
  line-height: 1.45;
  color: color-mix(in oklab, var(--ink) 78%, var(--bg));
}

.podpis b,
.podpis strong {
  color: var(--ink);
  font-weight: 600;
}

/* Kilka liczb obok siebie: małe kafelki z etykietą. */
.liczby {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.liczby > div {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 12px 14px 14px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.liczby dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.liczby dd {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-variation-settings: "wdth" 92;
  font-variant-numeric: tabular-nums;
}

.liczby dd small {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.minus-t {
  color: var(--minus);
}

.plus-t {
  color: var(--plus);
}

/* Rozpiska kwoty. */
.rozpiska {
  display: grid;
}

.rozpiska li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.rozpiska li span:last-child {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rozpiska li.minus span:last-child {
  color: var(--minus);
}

.rozpiska li.suma {
  border-bottom: 0;
  font-weight: 600;
}

.rozwin {
  border-top: 1px solid var(--hairline);
}

.rozwin summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.rozwin summary::-webkit-details-marker {
  display: none;
}

.rozwin summary::after {
  content: "+";
}

.rozwin[open] summary::after {
  content: "−";
}

.rozwin summary:hover {
  color: var(--ink);
}

.ostrzezenie {
  padding: 10px 12px;
  border-left: 2px solid var(--minus);
  font-size: 14px;
  line-height: 1.45;
  background: color-mix(in oklab, var(--minus) 9%, var(--bg));
}

/* Zaproszenie do wyceny. */
.cta {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
}

.cta-tytul {
  font-size: 21px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-variation-settings: "wdth" 92;
}

.cta-tekst {
  font-size: 14.5px;
  line-height: 1.45;
  color: color-mix(in oklab, var(--ink) 76%, var(--bg));
}

.cta-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.przycisk {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: max-content;
  max-width: 100%;
  height: 52px;
  padding: 0 20px 0 22px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--bg);
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.przycisk:hover {
  opacity: 0.9;
}

.strzalka {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
}

.przycisk:hover .strzalka {
  transform: translateX(4px);
}

.narzedzia {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.narzedzia a,
.narzedzia button {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.narzedzia a:hover,
.narzedzia button:hover {
  color: var(--ink);
}

/* ---------- wykresy ---------- */

.wykres-ramka {
  display: grid;
  gap: 10px;
}

.legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: color-mix(in oklab, var(--ink) 80%, var(--bg));
}

.legenda i,
.dymek i {
  display: inline-block;
  width: 14px;
  height: 0;
  margin-right: 7px;
  vertical-align: 3px;
  border-top: 2px solid var(--s1);
}

.legenda i.s2,
.dymek i.s2 {
  border-top: 2px dashed var(--s2);
}

.legenda i.s3,
.dymek i.s3 {
  border-top: 2px dotted var(--s3);
}

.wykres-pole {
  position: relative;
  touch-action: pan-y;
}

.wykres {
  width: 100%;
  height: auto;
  overflow: visible;
}

.wykres .siatka {
  stroke: color-mix(in oklab, var(--ink) 12%, var(--bg));
  stroke-width: 1;
}

.wykres .siatka.zero {
  stroke: color-mix(in oklab, var(--ink) 40%, var(--bg));
}

.wykres .os {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.wykres .linia {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.wykres .s1 {
  stroke: var(--s1);
}

.wykres .s2 {
  stroke: var(--s2);
  stroke-dasharray: 7 5;
}

.wykres .s3 {
  stroke: var(--s3);
  stroke-dasharray: 1 5;
}

.wykres .kropka {
  fill: var(--bg);
  stroke-width: 2;
  stroke-dasharray: none;
}

.wykres .znacznik line {
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.wykres .znacznik text {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
}

.wykres .kursor line {
  stroke: color-mix(in oklab, var(--ink) 55%, var(--bg));
  stroke-width: 1;
}

.dymek {
  position: absolute;
  top: 8px;
  z-index: 3;
  display: grid;
  gap: 3px;
  min-width: 170px;
  padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
}

.dymek b {
  font-weight: 500;
  color: var(--muted);
}

.tabela summary {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.tabela table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tabela th,
.tabela td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--hairline);
  text-align: right;
  font-weight: 400;
}

.tabela th:first-child {
  text-align: left;
}

/* Poziome słupki. */
.slupki {
  display: grid;
  gap: 10px;
}

.slupki li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  font-size: 14px;
}

.slupek-nazwa {
  grid-column: 1;
}

.slupek-wartosc {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.slupek-tor {
  grid-column: 1 / -1;
  height: 10px;
  background: color-mix(in oklab, var(--ink) 9%, var(--bg));
  border-radius: 1px;
}

.slupek {
  display: block;
  width: var(--w);
  min-width: 2px;
  height: 100%;
  border-radius: 1px;
  background: var(--s1);
  transition: width 0.5s var(--ease-out);
}

.slupek.s2 {
  background: repeating-linear-gradient(135deg, var(--s2) 0 6px, color-mix(in oklab, var(--s2) 70%, var(--bg)) 6px 8px);
}

.slupek.s3 {
  background: var(--s3);
}

.slupek.s0 {
  background: var(--ink);
}

/* ---------- pasek z wynikiem na telefonie ---------- */

.pasek {
  display: none;
}

@media (max-width: 999px) {
  .pasek {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -1px;
    padding: 10px var(--margin) calc(10px + env(safe-area-inset-bottom));
    background: var(--ciemne);
    color: var(--jasne);
    border-top: 1px solid color-mix(in oklab, var(--jasne) 20%, var(--ciemne));
    transition: transform 0.3s var(--ease-out);
  }

  .pasek > div {
    display: grid;
    min-width: 0;
  }

  .pasek-etykieta {
    font-family: var(--mono);
    font-size: 10.5px;
    color: color-mix(in oklab, var(--jasne) 62%, var(--ciemne));
  }

  .pasek-kwota {
    overflow: hidden;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-variation-settings: "wdth" 88;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .pasek a {
    flex: none;
    font-family: var(--mono);
    font-size: 12px;
    text-decoration: underline;
  }

  .pasek[data-ukryty] {
    transform: translateY(110%);
  }
}

/* ---------- treść pod kalkulatorem ---------- */

.artykul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  max-width: var(--szer);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 140px) var(--margin) 0;
}

@media (min-width: 1000px) {
  .artykul {
    grid-template-columns: minmax(200px, 0.32fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 110px);
  }
}

.spis {
  align-self: start;
  display: grid;
  gap: 12px;
}

@media (min-width: 1000px) {
  .spis {
    position: sticky;
    top: 24px;
  }
}

.spis ol {
  display: grid;
  border-top: 1px solid var(--hairline);
  counter-reset: spis;
}

.spis li {
  counter-increment: spis;
  border-bottom: 1px solid var(--hairline);
}

.spis a {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  font-size: 14.5px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.spis a::before {
  content: counter(spis, decimal-leading-zero);
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.spis a:hover {
  text-decoration: underline;
}

.artykul-tresc {
  display: grid;
  gap: clamp(56px, 7vw, 96px);
  max-width: 760px;
  min-width: 0;
}

.sekcja,
.pytania,
.zrodla {
  display: grid;
  gap: 18px;
  scroll-margin-top: 24px;
}

.artykul h2 {
  font-size: clamp(30px, 3.3vw, 50px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variation-settings: "wdth" 88;
}

.artykul h3 {
  margin-top: 10px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variation-settings: "wdth" 94;
}

.sekcja p,
.sekcja li {
  font-size: 17.5px;
  line-height: 1.6;
}

.sekcja ul,
.sekcja ol {
  display: grid;
  gap: 8px;
}

.sekcja ul li {
  position: relative;
  padding-left: 22px;
}

.sekcja ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.78em;
  width: 8px;
  height: 1px;
  background: currentColor;
}

.sekcja ol {
  counter-reset: lista;
}

.sekcja ol li {
  position: relative;
  padding-left: 34px;
  counter-increment: lista;
}

.sekcja ol li::before {
  content: counter(lista, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.35em;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.sekcja strong {
  font-weight: 600;
}

.wzor {
  padding: 14px 16px;
  border-left: 2px solid var(--ink);
  background: color-mix(in oklab, var(--ink) 5%, var(--bg));
  font-family: var(--mono);
  font-size: 13.5px !important;
  line-height: 1.7 !important;
  overflow-x: auto;
}

.uwaga {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
}

.uwaga-tytul {
  font-family: var(--mono);
  font-size: 11.5px !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.uwaga p,
.uwaga li {
  font-size: 16px;
}

.tabela-ramka {
  overflow-x: auto;
  border-top: 1px solid var(--ink);
}

.tabela-ramka table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.tabela-ramka caption {
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: left;
  color: var(--muted);
  caption-side: bottom;
}

.tabela-ramka th,
.tabela-ramka td {
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
}

.tabela-ramka thead th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.tabela-ramka tbody th {
  font-weight: 500;
}

.tabela-ramka .p {
  text-align: right;
  white-space: nowrap;
}

/* Pytania. */
.pytania details {
  border-bottom: 1px solid var(--hairline);
}

.pytania details:first-of-type {
  border-top: 1px solid var(--hairline);
}

.pytania summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  cursor: pointer;
  list-style: none;
}

.pytania summary::-webkit-details-marker {
  display: none;
}

.pytania summary::after {
  content: "+";
  flex: none;
  font-family: var(--mono);
  font-weight: 400;
  color: var(--muted);
}

.pytania details[open] summary::after {
  content: "−";
}

.pytania details > div {
  display: grid;
  gap: 10px;
  max-width: 64ch;
  padding-bottom: 20px;
  font-size: 16.5px;
  line-height: 1.6;
}

.zrodla ol {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  list-style: decimal;
  padding-left: 22px;
}

.zrodla h2 {
  font-size: 22px !important;
}

/* ---------- koniec strony: zaproszenie ---------- */

.koniec {
  --bg: var(--ciemne);
  --ink: var(--jasne);
  display: grid;
  justify-items: start;
  gap: 20px;
  max-width: calc(var(--szer) - 2 * var(--margin));
  margin: clamp(80px, 10vw, 160px) auto 0;
  padding: clamp(36px, 6vw, 96px) clamp(24px, 4vw, 64px);
  background: var(--bg);
  color: var(--ink);
  border-radius: 2px;
}

@media (max-width: 1504px) {
  .koniec {
    margin-inline: var(--margin);
  }
}

@media (max-width: 999px) {
  .koniec {
    margin-inline: calc(var(--margin) / 2);
  }
}

.koniec .kod {
  color: color-mix(in oklab, var(--ink) 62%, var(--bg));
}

.koniec h2 {
  max-width: 18ch;
  font-size: clamp(36px, 5.6vw, 92px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variation-settings: "wdth" 86;
}

.koniec p:not(.kod) {
  max-width: 52ch;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.45;
  color: color-mix(in oklab, var(--ink) 80%, var(--bg));
}

.koniec .przycisk {
  margin-top: 8px;
}

/* ---------- karty kalkulatorów ---------- */

.powiazane {
  display: grid;
  gap: 16px;
  max-width: var(--szer);
  margin: 0 auto;
  padding: clamp(56px, 7vw, 96px) var(--margin) 0;
}

.karty {
  display: grid;
  border-top: 1px solid var(--hairline);
}

.karta {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  padding: 18px 12px 18px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  transition:
    background-color 0.25s,
    color 0.25s,
    padding 0.35s var(--ease-out);
}

.karta-nr {
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding-left: 12px;
}

.karta-nazwa {
  font-size: clamp(21px, 2vw, 30px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 90;
}

.karta-opis {
  grid-column: 2;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

.karta-strzalka {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 20px;
  transition: transform 0.4s var(--ease-out);
}

.karta:hover {
  background: var(--ink);
  color: var(--bg);
}

.karta:hover .karta-nr,
.karta:hover .karta-opis {
  color: color-mix(in oklab, var(--bg) 66%, var(--ink));
}

.karta:hover .karta-strzalka {
  transform: translateX(4px);
}

.karta.mala .karta-nazwa {
  font-size: clamp(19px, 1.6vw, 24px);
}

@media (min-width: 1000px) {
  .powiazane .karty {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    border-top: 0;
  }

  .powiazane .karta {
    border-top: 1px solid var(--hairline);
  }
}

.grupa-kart {
  display: grid;
  gap: 18px 40px;
  max-width: var(--szer);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) var(--margin) 0;
}

@media (min-width: 1000px) {
  .grupa-kart {
    grid-template-columns: minmax(200px, 0.32fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 110px);
  }
}

.grupa-kart-opis {
  display: grid;
  gap: 8px;
  align-content: start;
}

.grupa-kart-opis h2 {
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 88;
}

.grupa-kart-opis p {
  font-size: 15px;
  color: var(--muted);
}

/* ---------- stopka ---------- */

.stopka {
  max-width: var(--szer);
  margin: clamp(80px, 10vw, 140px) auto 0;
  padding: 0 var(--margin) var(--margin);
}

.stopka-siatka {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px var(--margin);
  padding-top: 28px;
  border-top: 1px solid var(--ink);
}

.stopka-o {
  display: grid;
  gap: 12px;
  align-content: start;
  font-size: 14.5px;
  line-height: 1.5;
}

.stopka-znak {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variation-settings: "wdth" 88;
}

.stopka-znak a {
  text-decoration: none;
}

.stopka-znak span {
  color: var(--muted);
}

.stopka-tytul {
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.stopka ul {
  display: grid;
  gap: 6px;
  font-size: 14.5px;
}

.stopka ul a {
  text-decoration: none;
}

.stopka ul a:hover {
  text-decoration: underline;
}

.stopka-dol {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 999px) {
  .stopka {
    padding-bottom: calc(var(--margin) + 70px);
  }
}

/* ---------- ruch i druk ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  body::before,
  .naglowek-cta,
  .pasek,
  .narzedzia,
  .cta,
  .koniec,
  .powiazane,
  .spis,
  .stopka-siatka,
  .licznik button,
  .suwak {
    display: none !important;
  }

  .kalk {
    --bg: #fff;
    --ink: #000;
    border: 1px solid #000;
  }

  body {
    background: #fff;
  }
}

/* ---------- dodatki: pomiar adresu, jednostka przy kwocie ---------- */

.kwota .jedn {
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.pomiar-wiersz {
  display: flex;
  gap: 8px;
  max-width: 520px;
}

.pole-tekst {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid color-mix(in oklab, var(--ink) 26%, var(--bg));
  border-radius: 2px;
  background: transparent;
  font-size: 17px;
  outline: none;
  transition: border-color 0.2s;
}

.pole-tekst:focus-visible,
.pole-tekst:hover {
  border-color: var(--ink);
}

.pole-tekst::placeholder {
  color: color-mix(in oklab, var(--ink) 40%, var(--bg));
}

.przycisk-maly {
  height: 46px;
  padding: 0 18px;
  font-size: 15px;
}

.przycisk:disabled {
  opacity: 0.5;
  cursor: progress;
}

[data-psi] b {
  color: var(--ink);
}

/* ---------- więcej opcji, karty na liście, spokojniejszy wynik ---------- */

.wiecej {
  border-top: 1px solid var(--hairline);
}

.wiecej summary {
  display: flex;
  justify-content: space-between;
  padding: 14px 0 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.wiecej summary::-webkit-details-marker {
  display: none;
}

.wiecej summary::after {
  content: "+";
}

.wiecej[open] summary::after {
  content: "−";
}

.wiecej summary:hover {
  color: var(--ink);
}

.wiecej-pola {
  display: grid;
  gap: 20px;
  padding-top: 16px;
}

.cta .narzedzia {
  margin-top: 2px;
}

.grupa-kart > h2 {
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 88;
}

@media (min-width: 1000px) {
  .artykul-tresc {
    grid-column: 2;
  }
}

.otwarcie .lead {
  max-width: 40ch;
}
