/* Wspólne style portalu wynagrodzenie.pl
   Tokeny i komponenty zgodne z brand book/stylistyka.md
   Używane przez: index.html (kalkulator UoP simple) + uop/explained.html (wersja rozszerzona). */

:root {
  /* Tła */
  --bg-page:        #faf8f3;
  --bg-surface:     #ffffff;
  --bg-surface-2:   #f3efe4;
  --bg-hero:        #b89530;
  --bg-hero-deep:   #8c6a26;
  --bg-ink:         #1a1a1a;

  /* Tekst */
  --ink:            #1a1a1a;
  --ink-body:       #3a3a3a;
  --ink-muted:      #6b6b67;
  --ink-soft:       #9a9a93;
  --ink-on-hero:    #ffffff;
  --ink-on-dark:    #faf8f3;

  /* Akcent */
  --accent:         #b89530;
  --accent-deep:    #8c6a26;
  --accent-soft:    #ead9a8;
  --accent-tint:    #faf3e0;

  /* Semantyczne */
  --success:        #4a6b3a;
  --success-soft:   #e6ede0;
  --danger:         #a14a3a;
  --danger-soft:    #f3e1dc;
  --warn:           #d4a23e;
  --warn-soft:      #faf0d4;
  --info:           #4a6b8c;
  --info-soft:      #e3eaf2;

  /* Strukturalne */
  --border:         #e8e2d3;
  --border-strong:  #c9bfa6;
  --divider:        #efe9d9;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-8: 48px; --sp-10: 64px; --sp-12: 96px;

  /* Radius */
  --radius-sm: 4px;  --radius-md: 8px;  --radius-lg: 12px;
  --radius-xl: 20px; --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-sm: 0 2px 4px rgba(26, 26, 26, 0.05),
               0 1px 2px rgba(184, 149, 48, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.06),
               0 2px 4px rgba(184, 149, 48, 0.05);
  --shadow-lg: 0 12px 32px rgba(26, 26, 26, 0.08),
               0 4px 8px rgba(184, 149, 48, 0.06);
  --shadow-hero: 0 24px 64px rgba(140, 106, 38, 0.18),
                 0 8px 24px rgba(26, 26, 26, 0.10);

  /* Fonts */
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Manrope', -apple-system, 'Segoe UI', system-ui, sans-serif;

  /* Easing */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* TYPOGRAPHY ────────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--ink);
}
.t-h1 { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); }
.t-h2 { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
.t-h3 { font-family: var(--font-body); font-weight: 700; font-size: 18px; line-height: 1.3; color: var(--ink); }
.t-eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.t-eyebrow-ink { color: var(--ink); }
.t-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.t-num {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}
.t-num-display {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

/* LAYOUT ────────────────────────────────────────────── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 48px; } }

.paper-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
  border: 0;
  margin: 0;
}

/* HEADER ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 6px;
  text-decoration: none;
}
.logo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.nav-pill {
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 9999px;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.nav-pill:hover { color: var(--ink); background: var(--accent-tint); }
.nav-pill.active { color: var(--ink); background: var(--accent-soft); }
.nav-pill.disabled {
  color: var(--ink-soft); pointer-events: none;
  position: relative;
}
.nav-pill.disabled::after {
  content: "wkrótce"; margin-left: 6px;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-deep); opacity: 0.7;
}
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  color: var(--ink-muted); text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 200ms var(--ease-out), transform 250ms var(--ease-spring);
}
.back-link:hover { color: var(--ink); transform: translateX(-3px); }

/* HERO ─────────────────────────────────────────────── */
.hero-wrap {
  position: relative; overflow: hidden;
  padding: var(--sp-10) 0 var(--sp-12);
  background: var(--bg-page);
}
.hero-wrap::before {
  content: ""; position: absolute;
  top: 5%; right: -120px;
  width: 480px; height: 480px;
  background: radial-gradient(circle at center, rgba(184, 149, 48, 0.08) 0%, rgba(184, 149, 48, 0) 60%);
  pointer-events: none;
}
.hero-vol {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: var(--sp-6);
}
.hero-vol-tag {
  background: var(--accent); color: var(--ink);
  padding: 4px 10px;
  font-family: var(--font-body); font-weight: 800; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.hero-vol-text {
  font-family: var(--font-body); font-weight: 600; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-muted);
}
.hero-headline {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-weight: 600;
  font-size: clamp(48px, 9vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
  max-width: 18ch;
}
.hero-headline em {
  font-style: italic; font-weight: 500;
  color: var(--accent-deep);
  font-variation-settings: "opsz" 144, "SOFT" 80;
}
.hero-lede {
  margin-top: var(--sp-5);
  max-width: 56ch;
  font-size: 17px; line-height: 1.6;
  color: var(--ink-body);
}

/* INPUT GIANT ─────────────────────────────────────── */
.input-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
  margin-top: var(--sp-8);
}
.input-row {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-4);
  align-items: end;
}
@media (min-width: 768px) {
  .input-row { grid-template-columns: 320px 1fr; gap: var(--sp-6); }
}
.input-brutto-field { display: flex; flex-direction: column; gap: 6px; }
.input-brutto-label {
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.input-brutto {
  font-family: var(--font-display);
  font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: 56px; line-height: 1; letter-spacing: -0.02em;
  color: var(--ink);
  background: transparent;
  border: 0; outline: 0; padding: 0;
  width: 100%;
  -moz-appearance: textfield;
}
.input-brutto::-webkit-inner-spin-button,
.input-brutto::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-brutto-suffix {
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  color: var(--ink-muted); letter-spacing: 0.04em;
  margin-top: 4px;
}
.input-brutto-warning {
  margin-top: 6px; font-size: 12px;
  color: var(--danger); font-weight: 600;
}

.slider-wrap {
  display: flex; flex-direction: column; gap: 8px;
  padding-bottom: 8px;
}
.slider-marks {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--ink-soft); letter-spacing: 0.04em;
}
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--border);
  border-radius: 9999px; outline: 0;
  cursor: pointer;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  background: var(--ink);
  border: 3px solid var(--bg-page);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 150ms var(--ease-spring);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-webkit-slider-thumb:active { background: var(--accent-deep); }
.slider::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--ink);
  border: 3px solid var(--bg-page);
  border-radius: 50%;
  cursor: pointer;
}

/* RESULT CARDS ────────────────────────────────────── */
.result-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-4);
  margin-top: var(--sp-6);
}
@media (min-width: 768px) {
  .result-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}
.result-card {
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: transform 250ms var(--ease-spring), box-shadow 250ms var(--ease-out);
  position: relative;
}
.result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.result-card-main {
  background: var(--ink); color: var(--ink-on-dark);
  box-shadow: var(--shadow-hero);
}
.result-card-main .t-eyebrow { color: var(--accent-soft); }
.result-card-main .result-value { color: var(--ink-on-dark); }
.result-card-main .result-sub { color: rgba(250, 248, 243, 0.7); }

.result-card-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.result-card-cost .result-value { color: var(--danger); }

/* SECONDARY RESULT GRID (drugi rząd, kondycjonalny — tylko gdy wspólne aktywne) */
.result-grid-secondary {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px dashed var(--border-strong);
}
.result-secondary-eyebrow-row {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.result-secondary-line { flex: 1; height: 1px; background: var(--border); }
.result-grid-secondary-cards {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-4);
}
@media (min-width: 768px) {
  .result-grid-secondary-cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .result-grid-secondary-cards { grid-template-columns: 1fr 1fr 1fr; }
}
.result-card-effective {
  background: var(--success-soft);
  border-color: var(--success);
}
.result-card-effective:hover {
  box-shadow: 0 12px 32px rgba(74, 107, 58, 0.12),
              0 4px 8px rgba(74, 107, 58, 0.08);
}

/* PIT-0 banner (rodzina 4+) — informacyjny, między głównym a drugim rzędem kart */
.pit0-banner {
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  background: var(--success-soft);
  border: 1px solid var(--success);
  border-radius: 12px;
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.pit0-banner-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.pit0-banner-content { flex: 1; min-width: 0; }
.pit0-banner-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--success);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.pit0-banner-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-body);
}
.pit0-banner-text em {
  color: var(--ink-muted);
  font-size: 12px;
  font-style: normal;
  display: block;
  margin-top: 4px;
}

.result-value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1; letter-spacing: -0.025em;
  margin: 8px 0 4px;
}
.result-card-main .result-value { font-size: clamp(48px, 7vw, 72px); }
.result-sub {
  font-size: 12px; color: var(--ink-muted);
  line-height: 1.5;
}

/* PARAMS PANEL ────────────────────────────────────── */
.params-section {
  padding: var(--sp-12) 0;
  background: var(--bg-page);
  position: relative;
}
.params-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.params-grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
}
@media (min-width: 900px) {
  .params-grid { grid-template-columns: repeat(2, 1fr); }
}
.param-row {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--divider);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
@media (min-width: 900px) {
  .param-row:nth-child(odd) { border-right: 1px solid var(--divider); }
}
.param-label {
  font-family: var(--font-body); font-weight: 700; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
}
.param-help { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }

.toggle-group {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
}
.toggle-pill {
  flex: 1; padding: 8px 14px;
  background: transparent; border: 0;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  color: var(--ink-muted);
  border-radius: 6px; cursor: pointer;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
}
.toggle-pill:hover { color: var(--ink); }
.toggle-pill.active {
  background: var(--bg-surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.stepper { display: flex; align-items: center; gap: var(--sp-3); }
.stepper-btn {
  width: 36px; height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 18px; color: var(--ink); font-weight: 600;
  cursor: pointer;
  transition: background 150ms var(--ease-out), transform 150ms var(--ease-spring);
}
.stepper-btn:hover { background: var(--accent-tint); transform: scale(1.05); }
.stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.stepper-value {
  font-family: var(--font-display); font-weight: 700; font-size: 24px;
  color: var(--ink); min-width: 30px; text-align: center;
  font-variant-numeric: tabular-nums;
}

.text-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-body); font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  outline: 0;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
  width: 100%;
}
.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.switch {
  position: relative; display: inline-flex; align-items: center;
  width: 48px; height: 26px;
  background: var(--border-strong);
  border-radius: 9999px; cursor: pointer;
  transition: background 200ms var(--ease-out);
  border: 0; padding: 0;
}
.switch::after {
  content: ""; position: absolute;
  width: 20px; height: 20px;
  background: var(--bg-surface);
  border-radius: 50%; top: 3px; left: 3px;
  transition: left 200ms var(--ease-spring);
  box-shadow: var(--shadow-xs);
}
.switch.on { background: var(--accent); }
.switch.on::after { left: 25px; }

/* SECTION BLOCK ──────────────────────────────────── */
.section { padding: var(--sp-10) 0 var(--sp-12); }
.section-eyebrow-row {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.section-eyebrow-line { flex: 1; height: 1px; background: var(--border-strong); }
.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1; letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  max-width: 24ch;
}
.section-lede {
  margin-top: var(--sp-3);
  color: var(--ink-body); font-size: 15px;
  max-width: 56ch;
}
.section-mark {
  display: inline-block; width: 28px; height: 4px;
  background: var(--accent);
  margin-bottom: var(--sp-4);
}

/* TABLE ─────────────────────────────────────────── */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: var(--sp-6);
}
.table-scroll { overflow-x: auto; }
table.tbl {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-body); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
table.tbl thead th {
  background: var(--ink); color: var(--ink-on-dark);
  text-align: right;
  padding: 12px 14px;
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
table.tbl thead th:first-child { text-align: left; }
table.tbl tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--divider);
  text-align: right;
  color: var(--ink-body); white-space: nowrap;
}
table.tbl tbody td:first-child {
  text-align: left;
  font-weight: 600; color: var(--ink);
}
table.tbl tbody tr:nth-child(even) td { background: var(--bg-surface-2); }

/* Kolorowanie semantyczne per-komórka (zamiast cały wiersz):
   - ZUS cap żółty na komórkach ZUS (po nasyceniu emerytalnej i rentowej)
   - Kwota wolna zielona na komórce PIT (gdy dochód_kum < 30 000 zł)
   - Próg 32% niebieski na komórce PIT (po przekroczeniu 120 000 zł dochodu)
   Każdy kolor reprezentuje INFORMACJĘ o stanie podatkowym, nie alarm. */
table.tbl tbody td.cell-zus-cap   { background: var(--warn-soft)    !important; color: #7a5c00;        font-weight: 600; }
table.tbl tbody td.cell-pit-kzp   { background: var(--success-soft) !important; color: var(--success); font-weight: 600; }
table.tbl tbody td.cell-pit-prog32{ background: var(--info-soft)    !important; color: var(--info);    font-weight: 600; }
table.tbl tbody td.cell-pit-4plus { background: var(--success-soft) !important; color: var(--success); font-weight: 700; }
table.tbl tfoot td {
  padding: 14px;
  background: var(--info-soft);
  font-weight: 700; color: var(--info);
  text-align: right;
  font-size: 13px;
}
table.tbl tfoot td:first-child { text-align: left; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
table.tbl tbody td.netto-cell {
  background: var(--success-soft) !important;
  color: var(--success); font-weight: 700;
}
table.tbl tbody td.cost-cell {
  background: var(--danger-soft) !important;
  color: var(--danger); font-weight: 700;
}

/* PERSPECTIVES ────────────────────────────────── */
.persp-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-4);
  margin-top: var(--sp-6);
}
@media (min-width: 768px) {
  .persp-grid { grid-template-columns: repeat(2, 1fr); }
}
.persp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.persp-card.featured {
  background: var(--ink); color: var(--ink-on-dark);
}
.persp-card.featured .persp-row { border-color: rgba(250,248,243,0.1); }
.persp-card.featured .persp-label { color: var(--accent-soft); }
.persp-card.featured .persp-value { color: var(--ink-on-dark); }
.persp-card.featured .persp-headline { color: var(--ink-on-dark); }
.persp-card.featured .persp-final-row {
  background: var(--accent); color: var(--ink);
  margin: var(--sp-4) calc(-1 * var(--sp-6)) calc(-1 * var(--sp-6));
  padding: var(--sp-5) var(--sp-6);
}
.persp-card.featured .persp-final-row .persp-label,
.persp-card.featured .persp-final-row .persp-value { color: var(--ink); }
.persp-headline {
  font-family: var(--font-display); font-weight: 700;
  font-size: 24px; letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 var(--sp-2);
}
.persp-sub { font-size: 12px; color: var(--ink-muted); margin-bottom: var(--sp-5); }
.persp-card.featured .persp-sub { color: rgba(250,248,243,0.6); }
.persp-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--divider);
}
.persp-row:first-of-type { border-top: 0; }
.persp-label {
  font-family: var(--font-body); font-weight: 500; font-size: 13px;
  color: var(--ink-body);
}
.persp-value {
  font-family: var(--font-body); font-weight: 700; font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.persp-final-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--sp-4) 0;
  margin-top: var(--sp-3);
  border-top: 2px solid var(--border-strong);
}
.persp-final-row .persp-label {
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.persp-final-row .persp-value {
  font-family: var(--font-display); font-weight: 700; font-size: 32px;
  letter-spacing: -0.015em;
}

/* WSPÓLNE ROZLICZENIE CARD ────────────────────── */
.wspolne-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  margin-top: var(--sp-6);
  position: relative; overflow: hidden;
}
.wspolne-card::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent);
}
.wspolne-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-6);
}
@media (min-width: 768px) {
  .wspolne-grid { grid-template-columns: 1.4fr 1fr; gap: var(--sp-10); align-items: center; }
}
.wspolne-zwrot {
  text-align: center;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
}
.wspolne-zwrot-value {
  font-family: var(--font-display); font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-size: clamp(40px, 6vw, 64px);
  color: var(--success);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin: var(--sp-2) 0;
}

/* CTA BLOCK ───────────────────────────────────── */
.cta-block {
  background: var(--ink); color: var(--ink-on-dark);
  padding: var(--sp-12) 0;
  position: relative; overflow: hidden;
}
.cta-block::before {
  content: ""; position: absolute;
  bottom: -200px; left: -100px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(184, 149, 48, 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.cta-headline {
  font-family: var(--font-display); font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1; letter-spacing: -0.02em;
  color: var(--ink-on-dark); margin: 0;
  max-width: 18ch;
}
.cta-headline em { color: var(--accent); font-style: italic; font-weight: 500; }
.cta-link {
  display: inline-flex; align-items: center; gap: 14px;
  margin-top: var(--sp-6);
  padding: 16px 28px;
  background: var(--accent); color: var(--ink);
  border-radius: 9999px;
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 200ms var(--ease-out), transform 250ms var(--ease-spring);
}
.cta-link:hover { background: var(--bg-page); transform: translateX(4px); }
.cta-link:active { transform: translateX(2px) scale(0.98); }
.cta-link svg { transition: transform 250ms var(--ease-spring); }
.cta-link:hover svg { transform: translateX(4px); }

/* FOOTER ──────────────────────────────────────── */
.site-footer {
  padding: var(--sp-8) 0;
  background: var(--bg-page);
  border-top: 1px solid var(--border);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.7;
}

/* TRANSITIONS ───────────────────────────────── */
[x-cloak] { display: none !important; }
.value-fade { transition: opacity 150ms var(--ease-out); }

/* ALERT ───────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--warn-soft);
  color: #7a5c00;
  font-size: 13px;
  border-left: 3px solid var(--warn);
  margin-top: var(--sp-3);
}
.alert.danger {
  background: var(--danger-soft); color: var(--danger);
  border-left-color: var(--danger);
}
.alert.success {
  background: var(--success-soft); color: var(--success);
  border-left-color: var(--success);
}

/* CHIP */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--accent-soft); color: var(--ink);
  border-radius: 9999px;
  font-family: var(--font-body); font-weight: 600; font-size: 11px;
  letter-spacing: 0.04em;
}

/* ANIMACJE WEJŚCIA ────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-rise { animation: rise 700ms var(--ease-out) both; }
.anim-rise-delay-1 { animation-delay: 80ms; }
.anim-rise-delay-2 { animation-delay: 160ms; }
.anim-rise-delay-3 { animation-delay: 240ms; }
.anim-rise-delay-4 { animation-delay: 360ms; }

/* MINI-LEGEND pod tabelą */
.legend {
  display: flex; flex-wrap: wrap; gap: var(--sp-5);
  padding: var(--sp-4) var(--sp-6);
  font-size: 12px; color: var(--ink-muted);
  background: var(--bg-page);
  border-top: 1px solid var(--divider);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; }

/* ── EXPLAINED.HTML SPECIFIC ───────────────────── */

/* 3-kolumnowy układ wzorów (sekcja 9.2 wytycznych) */
.formulas-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-4);
  margin-top: var(--sp-6);
}
@media (min-width: 900px) {
  .formulas-grid { grid-template-columns: repeat(3, 1fr); }
}
.formula-col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  position: relative;
}
.formula-col.before-cap { border-top: 4px solid var(--success); }
.formula-col.transition { border-top: 4px solid var(--warn); background: var(--warn-soft); }
.formula-col.after-cap { border-top: 4px solid var(--info); }
.formula-col-tag {
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
.formula-col.before-cap .formula-col-tag { color: var(--success); }
.formula-col.transition .formula-col-tag { color: #7a5c00; }
.formula-col.after-cap .formula-col-tag { color: var(--info); }
.formula-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0;
  font-family: var(--font-body); font-size: 13px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px dashed var(--divider);
}
.formula-row:last-of-type { border-bottom: 0; }
.formula-row .lbl { color: var(--ink-body); }
.formula-row .val { color: var(--ink); font-weight: 700; }
.formula-row.total {
  margin-top: 6px; padding-top: 12px;
  border-top: 2px solid var(--border-strong);
  border-bottom: 0;
}
.formula-row.total .lbl { font-weight: 700; color: var(--ink); }
.formula-row.netto .val { color: var(--success); font-size: 16px; }
.formula-row.koszt .val { color: var(--danger); font-size: 16px; }

/* Edukacyjne accordion ("Dla dociekliwych") */
.edu-list {
  margin-top: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.edu-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.edu-header {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  cursor: pointer;
  background: var(--bg-surface);
  transition: background 200ms var(--ease-out);
  border: 0; width: 100%; text-align: left;
}
.edu-header:hover { background: var(--accent-tint); }
.edu-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 28px; color: var(--accent); line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  min-width: 48px;
}
.edu-title {
  flex: 1;
  font-family: var(--font-display); font-weight: 600; font-size: 19px;
  color: var(--ink); letter-spacing: -0.01em; line-height: 1.3;
}
.edu-toggle {
  font-family: var(--font-body); font-size: 18px; color: var(--ink-muted);
  transition: transform 250ms var(--ease-spring);
}
.edu-item.open .edu-toggle { transform: rotate(45deg); color: var(--accent); }
.edu-body {
  padding: 0 var(--sp-6) var(--sp-6) calc(48px + var(--sp-4) + var(--sp-6));
  font-size: 14px; line-height: 1.7;
  color: var(--ink-body);
}
.edu-body p { margin: 0 0 var(--sp-3); }
.edu-body p:last-child { margin-bottom: 0; }
.edu-body strong { color: var(--ink); }
.edu-body em { color: var(--accent-deep); font-style: italic; }
.edu-body .pull-quote {
  margin: var(--sp-4) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  font-family: var(--font-display); font-style: italic; font-size: 15px;
  color: var(--ink); line-height: 1.6;
}

/* Sekcja porównania 2-kol Indywidualne vs Wspólne (jak w v5 9.4) */
.compare-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-body); font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-top: var(--sp-6);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-table th, .compare-table td { padding: 14px 18px; text-align: right; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; }
.compare-table thead th {
  background: var(--ink); color: var(--ink-on-dark);
  font-weight: 700; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.compare-table thead th.col-wspolne {
  background: var(--accent); color: var(--ink);
}
.compare-table tbody tr:nth-child(even) td { background: var(--bg-surface-2); }
.compare-table tbody td:first-child { font-weight: 600; color: var(--ink-body); }
.compare-table tbody tr.divider td {
  background: var(--info-soft) !important;
  font-weight: 700; color: var(--info);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  text-align: left;
  padding: 8px 18px;
}
.compare-table tbody tr.highlight td {
  background: var(--success-soft) !important;
  font-weight: 700; color: var(--success);
  font-size: 16px;
}
