/* Kolik zbyde – styl. Bez externích fontů a knihoven (rychlé načtení, žádné cookies třetích stran). */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #1c1f24;
  --muted: #5b6068;
  --border: #dedad0;
  --brand: #1f4e79;
  --brand-strong: #173a5a;
  --brand-ink: #ffffff;
  --accent-bg: #eaf0f6;
  --warn-bg: #fbf5e6;
  --warn-border: #d9c485;
  --c-net: #1f4e79;
  --c-tax: #c9822b;
  --c-soc: #7a8794;
  --c-hlt: #a8483e;
  --shadow: none;
  --radius: 4px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181c;
    --surface: #1d2126;
    --surface-2: #242930;
    --text: #e8e6e1;
    --muted: #a3a8af;
    --border: #333941;
    --brand: #7fa8d1;
    --brand-strong: #a6c5e3;
    --brand-ink: #101820;
    --accent-bg: #222d3a;
    --warn-bg: #2b2616;
    --warn-border: #6b5a22;
    --c-net: #7fa8d1;
    --c-tax: #dba35a;
    --c-soc: #8d98a4;
    --c-hlt: #cf7f74;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; }
a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Hlavička */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--text); text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand span em { font-style: italic; color: var(--brand); }
.nav { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; padding: 4px 0; font-size: 0.95rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--border); }
.nav a[aria-current="page"] { border-bottom-color: var(--brand); color: var(--brand-strong); }

/* Obsah */
main { padding: 24px 0 56px; }
h1, h2 { font-family: var(--serif); font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); line-height: 1.2; margin: 8px 0 12px; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); line-height: 1.25; margin: 36px 0 12px; }
h3 { font-size: 1.08rem; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 70ch; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }
.meta { font-size: 0.85rem; color: var(--muted); }
.prose { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }

/* Kalkulačka */
.calc { display: grid; gap: 20px; margin: 20px 0 8px; align-items: start; }
@media (min-width: 880px) { .calc { grid-template-columns: 340px 1fr; } .calc .calc-form { position: sticky; top: 16px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.calc-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; }
.field label { display: block; font-weight: 650; font-size: 0.93rem; margin-bottom: 5px; }
.field.check label { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
.field.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.input-wrap { display: flex; align-items: stretch; }
input[type="text"], select {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--text); background: var(--bg);
  border: 1px solid #b9b5aa; border-radius: 3px; padding: 10px 12px; min-height: 46px;
}
.input-wrap input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-wrap.has-steps input { border-radius: 0; text-align: right; }
.step { flex: none; width: 46px; font: inherit; font-size: 1.3rem; line-height: 1; color: var(--text); background: var(--surface-2); border: 1px solid #b9b5aa; cursor: pointer; padding: 0; }
.step:first-child { border-radius: 3px 0 0 3px; border-right: 0; }
.step:not(:first-child) { border-left: 0; }
.step:hover { background: var(--accent-bg); }
.step:active { background: var(--border); }
.input-wrap.has-steps .suffix { border-left: 1px solid #b9b5aa; }
.input-wrap.has-steps .step:last-of-type:not(:first-child) { border-radius: 0; }
.input-wrap.has-steps:not(:has(.suffix)) .step:last-child { border-radius: 0 3px 3px 0; }
.input-wrap .suffix { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid #b9b5aa; border-left: 0; border-radius: 0 3px 3px 0; color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
input[type="text"]:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.hint { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.result { min-width: 0; }
.hero-number { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 5px solid var(--brand); border-radius: var(--radius); padding: 16px 20px 14px; margin-bottom: 18px; }
.hero-label { display: block; font-size: 0.9rem; color: var(--muted); }
.hero-number strong { display: block; font-family: var(--serif); font-size: clamp(2rem, 7vw, 2.9rem); line-height: 1.1; margin: 2px 0 4px; font-variant-numeric: tabular-nums; color: var(--brand-strong); }
.hero-sub { display: block; font-size: 0.95rem; color: var(--muted); }
.bar { display: flex; height: 14px; border-radius: 2px; overflow: hidden; background: var(--surface-2); margin: 4px 0 10px; }
.seg { display: block; height: 100%; min-width: 2px; }
.seg.net, .dot.net { background: var(--c-net); }
.seg.tax, .dot.tax { background: var(--c-tax); }
.seg.soc, .dot.soc { background: var(--c-soc); }
.seg.hlt, .dot.hlt { background: var(--c-hlt); }
.legend { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 16px; font-size: 0.92rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.dot { width: 11px; height: 11px; border-radius: 1px; flex: none; }
table { border-collapse: collapse; width: 100%; }
.breakdown, .compare { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 0 0 16px; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding: 0 2px 8px; font-size: 1rem; caption-side: top; }
.breakdown th, .breakdown td, .compare th, .compare td { padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.97rem; }
.breakdown td, .compare td { text-align: right; white-space: nowrap; }
.breakdown thead th, .compare thead th { background: var(--surface-2); font-size: 0.88rem; }
.breakdown th[scope="row"], .compare th[scope="row"] { font-weight: 500; }
.breakdown tr:last-child th, .breakdown tr:last-child td, .compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
tr.strong th, tr.strong td { font-weight: 700; }
tr.total th, tr.total td { font-weight: 800; background: var(--accent-bg); }
tr.cash th, tr.cash td { font-weight: 800; }
.compare th.best, .compare td.best { background: color-mix(in srgb, var(--accent-bg) 85%, transparent); }
.compare .na { color: var(--muted); opacity: 0.7; }
.badge { display: block; margin-top: 4px; font-size: 0.72rem; font-weight: 700; color: var(--brand-ink); background: var(--brand); border-radius: 2px; padding: 1px 7px; width: max-content; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border-radius: var(--radius); }
.table-wrap .breakdown, .table-wrap .compare { margin: 0; min-width: 520px; }
/* Dvousloupcové srovnání (refinancování) se na mobilu vejde bez vodorovného posunu. */
.table-wrap .compare.compact { min-width: 0; width: 100%; }
@media (max-width: 520px) { .compare.compact th, .compare.compact td { padding: 8px 8px; font-size: 0.88rem; } .compare.compact thead th { font-size: 0.8rem; } }
.breakdown.wide th, .breakdown.wide td { white-space: nowrap; }
.note { font-size: 0.88rem; color: var(--muted); margin: 0 0 10px; }
details.schedule { margin-top: 6px; }
details.schedule summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.disclaimer { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 12px 16px; font-size: 0.9rem; margin: 28px 0 0; }

/* Karty, mřížky, odkazy */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 16px 0; }
.tile { display: block; background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 12px 4px 14px; text-decoration: none; color: var(--text); }
.tile:hover { border-top-color: var(--brand); background: var(--surface-2); }
.tile:hover h3 { text-decoration: underline; }
.tile h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.08rem; color: var(--brand-strong); }
.tile p { margin: 0; font-size: 0.93rem; color: var(--muted); }
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.pill-links a { display: inline-block; padding: 5px 11px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); text-decoration: none; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.pill-links a:hover { border-color: var(--brand); background: var(--accent-bg); }
.pill-links a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.hero { padding: 12px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); }
.cta { display: inline-block; background: var(--brand); color: var(--brand-ink); font-weight: 600; padding: 11px 20px; border-radius: 3px; text-decoration: none; }
.cta:hover { background: var(--brand-strong); color: var(--brand-ink); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 14px 0; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.faq details p { margin-bottom: 14px; }

/* Partnerské boxy a reklama */
.affiliate { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 26px 0; }
.affiliate a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); }
.affiliate b { display: block; color: var(--brand-strong); }
.affiliate small { color: var(--muted); }
.ad-slot { margin: 24px 0; min-height: 90px; text-align: center; }
.ad-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* Patička */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 28px 0; font-size: 0.92rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: 0.95rem; margin: 0 0 8px; color: var(--text); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 5px; }
.site-footer a { color: var(--muted); }
.fine { margin-top: 20px; font-size: 0.82rem; }

/* Cookie lišta */
.cookie { position: fixed; inset: auto 12px 12px 12px; max-width: 560px; margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.15); padding: 16px 18px; z-index: 50; font-size: 0.92rem; }
.cookie[hidden] { display: none; }
.cookie p { margin: 0 0 12px; }
.cookie .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { font: inherit; font-weight: 600; border-radius: 3px; padding: 8px 16px; border: 1px solid var(--brand); cursor: pointer; background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; color: var(--brand-strong); }

@media print { .site-header, .site-footer, .calc-form, .ad-slot, .cookie, .affiliate { display: none !important; } body { background: #fff; } }
