:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1d2321;
  --muted: #5d6763;
  --line: #e2e4df;
  --accent: #0f7a5c;
  --accent-soft: #e3f2ec;
  --warn-soft: #fff4dc;
  --radius: 12px;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131715;
    --surface: #1c2220;
    --text: #e8ece9;
    --muted: #a3aeaa;
    --line: #2d3532;
    --accent: #4cc39b;
    --accent-soft: #1d3a30;
    --warn-soft: #3a3120;
    --series-1: #3987e5;
    --series-2: #d95926;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); }
a { color: var(--accent); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 1.5rem 0 .5rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.lead { color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); font-size: .9rem; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo-mark { background: var(--accent); color: #fff; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .95rem; padding: 6px 0; }
.site-header nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.site-header nav a:hover { color: var(--accent); }

.site-footer { margin-top: 4rem; padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Kalkulačka */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 1.2rem 0; }
@media (max-width: 720px) { .calc { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.field small { color: var(--muted); display: block; font-size: .82rem; }
input[type=text], input[type=number], select {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-eur { position: relative; }
.input-eur input { padding-right: 36px; font-size: 1.3rem; font-weight: 600; }
.input-eur::after { content: "€"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; margin-bottom: 8px; }
.check input { margin-top: 5px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { flex: 1; text-align: center; padding: 8px; cursor: pointer; font-weight: 600; margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { color: var(--accent); }
.seg label:has(input:checked) { background: var(--accent-soft); }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.js .btn-submit { display: none; }

.calc > * { min-width: 0; }
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.compare .result-main { margin-bottom: 0; padding: 12px; }
.compare .result-main .value { font-size: 1.6rem; }
.breakdown td + td + td { padding-left: 10px; }
@media (max-width: 720px) {
  .compare .result-main .value { font-size: 1.2rem; }
  .breakdown { font-size: .85rem; }
}
.result-main { background: var(--accent-soft); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.result-main .label { font-size: .9rem; color: var(--muted); }
.result-main .value { font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.breakdown { width: 100%; border-collapse: collapse; font-size: .95rem; }
.breakdown td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.breakdown td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.breakdown .sub td { color: var(--muted); font-size: .85rem; padding-left: 14px; }
.breakdown .total td { font-weight: 700; border-bottom: 0; }
.diff { font-size: .9rem; margin-top: 10px; }
.notice { background: var(--warn-soft); border-radius: 8px; padding: 10px 14px; font-size: .9rem; margin: 10px 0; }

table.data { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { white-space: nowrap; padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { background: var(--accent-soft); font-size: .85rem; }
.table-scroll { overflow-x: auto; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
summary { font-weight: 600; cursor: pointer; }

details.more { padding: 8px 12px; margin: 4px 0 14px; background: var(--bg); }
details.more summary { font-size: .95rem; margin-bottom: 4px; }

/* Graf */
.chart { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .chart .tick { font-size: 22px; } }
.chart .bar:hover rect:not([fill=transparent]) { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Článok */
.article { max-width: 720px; }
.article p, .article li { line-height: 1.7; }
.article table.data { margin: 12px 0; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 18px 0; }
.toc ol { margin: 6px 0 0; padding-left: 20px; }
.cta { background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; font-weight: 600; }
.cta a { text-decoration: none; }

/* Rozcestník */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
a.tile:hover { border-color: var(--accent); }
.tile h3 { margin: 0 0 4px; font-size: 1.05rem; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.tile.soon { opacity: .6; }
.badge { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-left: 6px; vertical-align: middle; }
.badge.warn { background: var(--warn-soft); color: var(--text); }
