/* rankingkonsolidacji.pl – wspólny arkusz stylów */
:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #edf1f4;
  --text: #13202a;
  --text-2: #43515c;
  --muted: #5b6874;
  --border: #dbe2e8;
  --accent: #1d6fa8;        /* przyciski, elementy graficzne */
  --accent-ink: #155a8a;    /* linki i tekst w kolorze akcentu */
  --accent-soft: #e3eef7;
  --on-accent: #ffffff;
  --note-bg: #fff6e6;
  --note-border: #e8bf73;
  /* serie wykresu porównania – zweryfikowane walidatorem palety */
  --s-now: #1d6fa8;
  --s-new: #d0621a;
  /* werdykt kalkulatora */
  --good: #12754f;  --good-soft: #e2f3ec;
  --warn: #9a5200;  --warn-soft: #fdf0dd;
  --bad: #b42318;   --bad-soft: #fde8e6;
  --info: #155a8a;  --info-soft: #e3eef7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 25, 35, .05), 0 4px 16px rgba(15, 25, 35, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1519;
    --surface: #172026;
    --surface-2: #1e2930;
    --text: #e8edf1;
    --text-2: #b4c0c9;
    --muted: #8f9ca6;
    --border: #2a363f;
    --accent: #3f93cc;
    --accent-ink: #7cb9e4;
    --accent-soft: #17344a;
    --on-accent: #0f1519;
    --note-bg: #2a2416;
    --note-border: #6e5728;
    --s-now: #3f93cc;
    --s-new: #d6702c;
    --good: #5fcf9e;  --good-soft: #12302a;
    --warn: #f0b45a;  --warn-soft: #33270f;
    --bad: #ff8a7d;   --bad-soft: #3a1a17;
    --info: #7cb9e4;  --info-soft: #17344a;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Nagłówek */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 19px; letter-spacing: -.01em; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.logo span b { color: var(--accent-ink); font-weight: 750; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 550; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-mobile { display: none; position: relative; }
.nav-mobile summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: 15px; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile ul { flex-direction: column; position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 5; }

@media (max-width: 900px) {
  .nav-desktop { display: none !important; }
  .nav-mobile { display: block; }
}

/* Okruszki i nagłówek artykułu */
.crumbs { font-size: 14px; color: var(--muted); margin: 24px 0 8px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

h1, h2, h3 { line-height: 1.22; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 44px); margin: 8px 0 14px; font-weight: 780; }
h2 { font-size: clamp(23px, 3.2vw, 28px); margin: 44px 0 12px; font-weight: 740; scroll-margin-top: 16px; }
h3 { font-size: 19px; margin: 28px 0 8px; font-weight: 700; }
p { margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--text-2); margin-bottom: 20px; }
.meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 24px; }

article ul, article ol { padding-left: 22px; margin: 0 0 18px; }
article li { margin-bottom: 6px; }
article li::marker { color: var(--accent-ink); }
strong { font-weight: 680; }

/* Spis treści */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 8px 0 28px; }
.toc p { font-weight: 700; margin: 0 0 6px; font-size: 15px; }
.toc ol { margin: 0; padding-left: 20px; font-size: 15px; }
.toc li { margin: 3px 0; }

/* Ramki */
.note, .key { border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; }
.note { background: var(--note-bg); border: 1px solid var(--note-border); }
.key { background: var(--accent-soft); border: 1px solid transparent; }
.note > :last-child, .key > :last-child { margin-bottom: 0; }
.note strong:first-child, .key strong:first-child { display: block; margin-bottom: 4px; }

/* Tabele */
.table-wrap { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Źródła i powiązane */
.sources { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-2); }
.sources h2 { font-size: 18px; margin-top: 0; }
.sources ol { padding-left: 20px; }
.sources li { margin-bottom: 6px; word-break: break-word; }
.related { margin: 40px 0 0; }
.related h2 { font-size: 20px; }

/* Karty artykułów */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 16px 0; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 18px; color: var(--text); }
.card p { margin: 0; font-size: 15px; color: var(--text-2); }
.card .more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 650; color: var(--accent-ink); }

.points { counter-reset: p; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.points li { counter-increment: p; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.points li::before { content: counter(p); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 750; display: grid; place-items: center; font-size: 15px; }
.points strong { display: block; }

/* FAQ i słownik */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 15px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.faq details > div { padding-bottom: 6px; }
dl.glossary dt { font-weight: 700; margin-top: 22px; scroll-margin-top: 16px; }
dl.glossary dd { margin: 4px 0 0; color: var(--text-2); }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.az a { font-size: 14px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; background: var(--surface); }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 32px; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 4px; }

/* Stopka */
.site-footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--border); font-size: 14.5px; color: var(--text-2); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 32px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--text-2); }
.site-footer .disclaimer { margin: 0 0 8px; }
.site-footer .copy { color: var(--muted); margin: 0; }

.notfound { text-align: center; padding: 60px 0 20px; }
.notfound .code { font-size: 72px; font-weight: 800; color: var(--accent-ink); margin: 0; line-height: 1; }

@media print {
  .site-header, .site-footer, .toc, .related { display: none; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Przyciski i sekcje */
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 650; text-decoration: none; font-size: 16px; border: 0; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent-ink); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--accent); } }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.section { padding: 28px 0; }
.section-lead { color: var(--text-2); max-width: 720px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h2, .panel h3 { margin-top: 0; }

/* Strona główna */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(32px, 5.5vw, 50px); max-width: 860px; margin: 12px 0 12px; }
.hero .lead { max-width: 740px; font-size: clamp(18px, 2.2vw, 20px); }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.trust { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 14px 0 0; font-size: 15px; color: var(--text-2); }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%23155a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* Ranking */
.ranking { margin-top: 8px; }
.scenario { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
@media (max-width: 860px) { .scenario { grid-template-columns: 1fr 1fr; } .scenario .filters { grid-column: 1 / -1; } }
@media (max-width: 520px) { .scenario { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; align-content: start; }
.field > label, .field .label { font-size: 14px; font-weight: 650; color: var(--text-2); }
.input-suffix { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.input-suffix input { flex: 1; min-width: 0; font: inherit; font-size: 18px; font-weight: 650; color: var(--text); background: transparent; border: 0; padding: 9px 12px; font-variant-numeric: tabular-nums; }
.input-suffix span { padding-right: 12px; color: var(--muted); font-size: 15px; }
.input-suffix:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.input-suffix input:focus { outline: none; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 12px; font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.seg input:checked + span { background: var(--accent-ink); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { .seg input:checked + span { background: var(--accent); } }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.ranking-note { font-size: 14.5px; color: var(--muted); margin: 14px 2px 10px; }
.ranking-foot { font-size: 13.5px; color: var(--muted); margin-top: 12px; }

.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.offer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); scroll-margin-top: 16px; }
.offer-hl { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.offer-muted { opacity: .78; }
.offer-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.offer-pos { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 780; font-size: 16px; background: var(--accent-soft); color: var(--accent-ink); }
.offer:first-child:not(.offer-muted) .offer-pos { background: var(--accent-ink); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { .offer:first-child:not(.offer-muted) .offer-pos { background: var(--accent); } }
.offer-name { font-weight: 720; font-size: 17.5px; color: var(--text); text-decoration: none; }
.offer-name:hover { text-decoration: underline; }
.offer-product { display: block; font-size: 14px; color: var(--muted); }
.offer-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px; margin: 12px 0 0 46px; }
@media (max-width: 640px) { .offer-metrics { grid-template-columns: 1fr 1fr; margin-left: 0; } }
.offer-metrics dt { font-size: 12.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.offer-metrics dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.offer-metrics dd small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.offer-warn { margin: 10px 0 0 46px; font-size: 14.5px; color: var(--warn); }
@media (max-width: 640px) { .offer-warn { margin-left: 0; } }
.offer-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 12px 0 0 46px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }
@media (max-width: 640px) { .offer-foot { margin-left: 0; } }
.offer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.offer-tags span { background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 2px 9px; font-size: 13px; }
.offer-links { display: flex; gap: 16px; font-weight: 600; }

.badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); }
.badge-pozabankowa, .badge-skok { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* Strona oferty */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 20px; }
.facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.facts dt { font-size: 13px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 650; font-size: 15.5px; line-height: 1.4; }
.rep-text { margin: 0 0 20px; padding: 12px 16px; border-left: 4px solid var(--border); background: var(--surface); border-radius: 0 10px 10px 0; font-size: 14.5px; color: var(--text-2); }
.yn-tak { color: var(--good); font-weight: 650; }
.yn-nie { color: var(--text-2); }
.yn-brak { color: var(--muted); font-style: italic; }
.chips { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { margin: 0 !important; }
.chips a { display: inline-block; font-size: 15px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; background: var(--surface); }

/* Kalkulator */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.calc h2 { margin-top: 0; font-size: 21px; }
.calc h2 + p { color: var(--text-2); font-size: 15px; }
.debts { width: 100%; border-collapse: collapse; font-size: 15px; }
.debts th { background: none; padding: 0 6px 6px 0; font-size: 12.5px; }
.debts td { padding: 0 6px 8px 0; border: 0; }
.debts input, .calc-grid input, .calc-grid select { font: inherit; font-size: 16px; width: 100%; min-width: 0; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; font-variant-numeric: tabular-nums; }
.debts .del { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 9px; width: 40px; height: 42px; cursor: pointer; font-size: 18px; }
@media (max-width: 640px) {
  .debts thead { display: none; }
  .debts tr { display: grid; grid-template-columns: 1.3fr 1fr .8fr 40px; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
  .debts input { padding: 9px 8px; }
  .debts td { padding: 0; }
  .debts td:first-child { grid-column: 1 / -1; }
  .debts td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
  .debts td:last-child { align-self: end; }
}
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
.calc-grid label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; color: var(--text-2); }
.calc-grid .wide { grid-column: 1 / -1; }
.calc-sep { margin: 24px 0 14px; border: 0; border-top: 1px solid var(--border); }
.calc-result { margin-top: 20px; }
.hint { color: var(--muted); }
.verdict { border-radius: var(--radius); padding: 16px 18px; border-left: 6px solid; margin-bottom: 18px; }
.verdict p { margin: 0 0 8px; }
.verdict p:last-child { margin: 0; }
.verdict-label { display: inline-block; font-size: 13px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; color: #fff; }
@media (prefers-color-scheme: dark) { .verdict-label { color: var(--bg); } }
.verdict-title { font-size: 19px; font-weight: 720; line-height: 1.3; }
.verdict-good { background: var(--good-soft); border-color: var(--good); } .verdict-good .verdict-label { background: var(--good); }
.verdict-warn { background: var(--warn-soft); border-color: var(--warn); } .verdict-warn .verdict-label { background: var(--warn); }
.verdict-bad { background: var(--bad-soft); border-color: var(--bad); } .verdict-bad .verdict-label { background: var(--bad); }
.verdict-info { background: var(--info-soft); border-color: var(--info); } .verdict-info .verdict-label { background: var(--info); }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
@media (max-width: 700px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.cmp figcaption { font-weight: 700; margin-bottom: 10px; }
.cmp-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: 14px; }
.cmp-label { color: var(--text-2); }
.cmp-track { height: 20px; }
.cmp-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.cmp-now { background: var(--s-now); }
.cmp-new { background: var(--s-new); }
.cmp-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-notes { font-size: 14px; color: var(--text-2); padding-left: 20px; }
.calc-notes li { margin-bottom: 4px; }

/* Pasek pomocy */
.help-band { margin-top: 64px; background: var(--surface-2); border-top: 1px solid var(--border); }
.help-band .wrap { padding-top: 18px; padding-bottom: 18px; }
.help-band p { margin: 0; font-size: 15px; color: var(--text-2); }
.help-band + .site-footer { margin-top: 0; }
