/* ==========================================================================
   Blok „Tonery: koszt strony” (.lift--cost > .cost): niski arkusz na nagłówku.
   Po lewej wstęp z pytaniem i dwa paski na jednej skali; suwak leży na pasku „W praktyce”
   (przeciąga się koniec paska). Po prawej dwie liczby w jednej kolumnie: wynik w procentach
   i 95% tonerów DTS z rzędem dwudziestu kaset (1 kaseta = 5%). Notka jednym wierszem pod spodem.
   Źródło (prototyp): assets/css/podstrona.css (Calculators, .bars, .cost), podstrony/tonery.css (.t-yield).
   Reguły pod .cost, żeby nie zderzały się z innymi kalkulatorami.
   ========================================================================== */

/* Arkusz ciaśniejszy niż domyślny .lift__sheet (wspólne wymiary niskich modułów pod nagłówkiem) */
.lift--cost .lift__sheet { padding: clamp(1rem, 2.2vw, 1.5rem) clamp(1.25rem, 2.4vw, 2rem) clamp(1.25rem, 2.4vw, 2rem); }

/* Układ: rachunek po lewej, liczby po prawej. Kolumny zaczynają się pod linią tytułu (z odstępem),
   więc duża liczba nie może wejść na linię arkusza. */
.cost__layout {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 1.25rem clamp(1.5rem, 3.5vw, 3rem);
  align-items: start; margin-top: clamp(.875rem, 1.4vw, 1.125rem);
}
.cost__lead { margin: 0; color: var(--muted); font-size: .9375rem; line-height: 1.5; text-wrap: pretty; }
.cost__ask { color: var(--navy-900); font-weight: 500; cursor: pointer; }

/* Dwie liczby obok siebie (kafelki): liczba na górze, opis pod nią. Kolumna liczb stoi pod linią
   tytułu z odstępem (margin-top .cost__layout), więc „+60 %” nie może wejść na linię arkusza. */
.cost__out {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem clamp(1.25rem, 2.2vw, 1.75rem); align-items: start;
  border-left: 1px solid var(--line); padding-left: clamp(1.25rem, 2.6vw, 2.25rem);
}
.cost__fig { min-width: 0; font-size: .9375rem; }
.cost .calc__num {
  margin: 0 0 .4rem; color: var(--navy-900); white-space: nowrap;
  font-weight: 300; font-size: clamp(2.125rem, 1.6rem + 1vw, 2.5rem); line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.cost .calc__num small { font-size: max(13px, .4em); font-weight: 500; letter-spacing: 0; margin-left: .25rem; }
.cost .calc__say { margin: 0; color: var(--navy-900); line-height: 1.45; text-wrap: pretty; }

/* 95% tonerów DTS: zdanie, dwa rzędy po dziesięć kaset, legenda */
.cost .t-yield { max-width: none; }
.cost .t-yield__say { margin: 0; color: var(--muted); line-height: 1.45; }
.cost .t-yield__units { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px 4px; max-width: 14rem; margin: .5rem 0 0; }
.cost .t-yield__units svg { display: block; width: 100%; height: auto; aspect-ratio: 40 / 26; fill: var(--navy-900); }
.cost .t-yield__units svg.is-off { fill: var(--navy-100); }
.cost .t-yield__key { display: flex; align-items: center; gap: .35rem; margin: .35rem 0 0; font-family: var(--font-ui); font-weight: 500; font-size: .8125rem; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.cost .t-yield__key svg { flex: none; width: 18px; height: 12px; fill: var(--navy-900); }

.cost .calc__note { margin: .875rem 0 0; font-size: .875rem; line-height: 1.45; color: var(--muted); }

/* Two bars on one scale: what the label promises, what the toner printed */
.cost .bars { margin: .8rem 0 0; display: grid; row-gap: .25rem; }
.cost .bars__row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 5.5rem; column-gap: .9rem; align-items: center; min-height: 1.875rem; }
.cost .bars__label { font-size: .9375rem; color: var(--muted); }
.cost .bars__bar { position: relative; display: block; }
.cost .bars__track { position: relative; display: block; height: 14px; border-radius: 2px; background: var(--navy-50); overflow: hidden; }
.cost .bars__fill { position: absolute; inset: 0; background: var(--navy); border-radius: 2px; transform-origin: 0 50%; transform: scaleX(var(--wn, 1)); }
.cost .bars__row--real .bars__fill { background: var(--navy-900); }
.cost .bars__gap {
  position: absolute; inset: 0; clip-path: inset(0 0 0 calc(var(--wn, 1) * 100%));
  background: repeating-linear-gradient(135deg, var(--line-strong) 0 2px, transparent 2px 6px);
}
.cost .bars__val { font-family: var(--font-ui); font-weight: 500; font-size: .9375rem; color: var(--navy-900); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Suwak leży na pasku „W praktyce”: zaczyna się tam, gdzie na pasku wypada początek skali (--lo),
   i jest szerszy o średnicę uchwytu, więc środek uchwytu zawsze stoi na końcu ciemnego paska.
   Pole dotyku 40 px wysokości. */
.cost .range {
  -webkit-appearance: none; appearance: none; position: absolute; z-index: 1; top: 50%;
  left: calc(var(--lo, 0) * 100% - 11px); width: calc((1 - var(--lo, 0)) * 100% + 22px); height: 40px;
  margin: -20px 0 0; padding: 0; background: transparent; cursor: pointer; --p: 50%;
}
.cost .range::-webkit-slider-runnable-track { height: 40px; background: transparent; }
.cost .range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--navy-900); box-shadow: 0 2px 6px rgba(22, 42, 67, .3); transition: transform .2s var(--ease);
}
.cost .range:hover::-webkit-slider-thumb { transform: scale(1.08); }
.cost .range:active::-webkit-slider-thumb { transform: scale(1.15); }
.cost .range::-moz-range-track { height: 40px; background: transparent; }
.cost .range::-moz-range-progress { background: transparent; }
.cost .range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--navy-900); box-shadow: 0 2px 6px rgba(22, 42, 67, .3); }
.cost .range:focus-visible { outline: none; box-shadow: none; }
.cost .range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--navy-900); outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.cost .range:focus-visible::-moz-range-thumb { outline: 2px solid var(--navy-900); outline-offset: 3px; }

/* Kolumna wartości tak szeroka jak najdłuższa wartość („8 000 stron” nie wychodzi poza kolumnę na telefonie),
   a paski obu wierszy dalej mają jedną długość, bo wiersze dzielą siatkę (subgrid). Wynik „W praktyce” nigdy
   nie przekracza wartości z opakowania, więc przy przesuwaniu suwaka kolumna nie zmienia szerokości. */
@supports (grid-template-columns: subgrid) {
  .cost .bars { grid-template-columns: 7.5rem minmax(0, 1fr) max-content; column-gap: .9rem; }
  .cost .bars__row { grid-column: 1 / -1; grid-template-columns: subgrid; }
}

/* Tablet: rachunek na całą szerokość, dwie liczby obok siebie pod spodem */
@media (max-width: 900px) {
  .cost__layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .cost__out { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1rem; }
}

/* Telefon: podpis i wartość nad paskiem, pasek (i suwak) na całą szerokość; kafelki liczb zostają obok siebie */
@media (max-width: 560px) {
  .cost__layout { margin-top: .875rem; gap: .875rem; }
  .cost__lead { font-size: .875rem; line-height: 1.45; }
  .cost .bars { grid-template-columns: minmax(0, 1fr); row-gap: .5rem; margin-top: .7rem; }
  .cost .bars__row { grid-column: auto; grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "label val" "bar bar"; row-gap: .2rem; min-height: 0; }
  .cost .bars__label { grid-area: label; font-size: .875rem; }
  .cost .bars__val { grid-area: val; font-size: .875rem; }
  .cost .bars__bar { grid-area: bar; }
  .cost .bars__track { height: 12px; }
  .cost__out { column-gap: 1rem; padding-top: .875rem; }
  .cost__fig { font-size: .875rem; }
  .cost .calc__num { font-size: 1.875rem; margin-bottom: .3rem; }
  .cost .t-yield__units { gap: 2px 3px; margin-top: .4rem; }
  .cost .calc__note { font-size: .8125rem; margin-top: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cost .range::-webkit-slider-thumb { transition: none; }
}
