:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --border: #e1e4e8;
  --accent: #0b7a5c;
  --accent-soft: #e3f4ee;
  --warn-soft: #fff4dc;
  --c1: #0b7a5c;
  --c2: #2f6fd6;
  --c3: #8b5cf6;
  --c4: #e0912f;
  --c5: #9aa3ad;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e8ebef;
    --muted: #9aa4b1;
    --border: #2a3038;
    --accent: #3fc79d;
    --accent-soft: #143329;
    --warn-soft: #3a2f16;
    --c1: #3fc79d;
    --c2: #5b93f0;
    --c3: #a78bfa;
    --c4: #f0a952;
    --c5: #6b7480;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; font-size: 18px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.intro { padding: 28px 0 8px; max-width: 720px; }
.intro h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; margin: 0 0 10px; }
.intro p { color: var(--muted); margin: 0; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; padding: 20px 0; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.results { display: grid; gap: 16px; }
.inputs { display: grid; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 0; min-width: 0; }
fieldset.card { display: grid; gap: 14px; }
legend, .rates summary { font-weight: 700; font-size: 17px; padding: 0; display: flex; align-items: center; gap: 8px; }
legend { float: left; width: 100%; margin-bottom: 2px; }
legend + * { clear: both; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; flex: none; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field em { font-weight: 400; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; }
input[type="number"], select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
input:focus-visible, select:focus-visible, summary:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.seg label { position: relative; text-align: center; font-size: 14px; padding: 8px 6px; border-radius: 7px; cursor: pointer; font-weight: 500; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); font-weight: 700; outline: 1px solid var(--border); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); }
@media (max-width: 420px) { .seg-3 { grid-auto-flow: row; } }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

#pv-fields, #nb-fields, #nm-fields { display: grid; gap: 14px; }
[hidden] { display: none !important; }

.rates summary { cursor: pointer; list-style: none; flex-wrap: wrap; }
.rates summary::-webkit-details-marker { display: none; }
.rates summary small { font-weight: 400; color: var(--muted); font-size: 13px; }
.rate { display: grid; grid-template-columns: minmax(0, 1fr) 110px 52px; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; }
.rate input { min-height: 36px; padding: 6px 8px; text-align: right; }
.rate em { font-style: normal; color: var(--muted); font-size: 12px; }
.btn-link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; padding: 10px 0 0; cursor: pointer; }

.result-main { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.label { color: var(--muted); font-size: 14px; font-weight: 600; }
.big { font-size: clamp(38px, 6vw, 52px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.k-label { display: block; font-size: 13px; color: var(--muted); }
.k-val { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }

.bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--bg); margin-bottom: 12px; gap: 2px; }
.bar span { display: block; height: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
td, th { padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: right; }
td:first-child, th:first-child { text-align: left; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.breakdown i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.breakdown td:last-child { color: var(--muted); width: 44px; }
tr.sum td { font-weight: 700; border-bottom: 0; }
tr.minus td { color: var(--accent); }
.compare tr.best td { background: var(--accent-soft); }
.compare tr.current td { font-weight: 700; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--border); margin-left: 6px; vertical-align: 1px; }
.pill-best { background: var(--accent); color: #fff; }

.kv { display: grid; gap: 6px; margin: 0 0 12px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--border); padding: 6px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.saving { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.saving-val { font-weight: 800; font-size: 18px; color: var(--accent); }

.btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.share { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.ad-slot { min-height: 100px; border: 1px dashed var(--border); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

.faq { margin: 8px 0 32px; }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; }
.disclaimer { margin-top: 16px; }

/* ---------- navigation ---------- */
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 520px) { .site-header .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; } .nav { margin-left: 0; width: 100%; } }

/* ---------- simulator ---------- */
.stack { display: grid; gap: 14px; margin-top: 14px; }
.with-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.btn-ghost { background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 10px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.table-scroll { overflow-x: auto; margin: 0 -4px; }
.table-scroll table { min-width: 100%; }
.compare th { white-space: nowrap; }
.compare td:first-child { white-space: nowrap; }
.compare-wrap td:first-child { white-space: normal; min-width: 140px; }
.compare-wrap td:not(:first-child) { white-space: nowrap; }
.compare-wrap td:nth-child(2) { white-space: normal; }
.compare td small { font-size: 12px; }
@media (max-width: 480px) {
  .compare { font-size: 12.5px; }
  .compare td, .compare th { padding: 7px 3px; }
  .compare th { letter-spacing: 0; font-size: 11px; }
  .card { padding: 14px; }
  .kpis-3 .k-val { font-size: 15px; }
}
.warn, .bad { color: #c2410c; font-weight: 600; }
.good { color: var(--accent); font-weight: 600; }
@media (prefers-color-scheme: dark) { .bad { color: #fb923c; } }
@media (prefers-color-scheme: dark) { .warn { color: #fb923c; } }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .grid.zero { stroke: var(--muted); stroke-dasharray: 4 3; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.lead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: var(--accent); }
.lead h2 { margin-bottom: 4px; }
.lead p { margin: 0; }
.lead .btn { text-decoration: none; }
.lead-placeholder { border-style: dashed; border-color: var(--border); display: grid; gap: 4px; }
.cta-link { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 700; text-decoration: none; }

/* ---------- generated tariff pages ---------- */
.article { display: grid; gap: 16px; padding-bottom: 32px; }
.article .intro { padding-top: 8px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.crumbs a, .related a, .rates-table + .hint a, .card .hint a { color: var(--accent); }
.kpi-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi-strip > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
@media (max-width: 560px) {
  .kpi-strip { gap: 8px; }
  .kpi-strip > div { padding: 10px; }
  .kpi-strip .k-val { font-size: 15px; }
  .kpi-strip .k-label { font-size: 12px; }
}
.rates-table th { white-space: normal; vertical-align: bottom; }
.callout { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; font-size: 15px; }
.callout-warn { background: var(--warn-soft); }
.rates-table td:first-child { white-space: normal; }
.rates-table + .table-scroll { margin-top: 14px; }
.cta-btn { display: inline-block; margin-top: 14px; text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile strong { font-size: 18px; }
.tile span { font-size: 13px; color: var(--muted); }
.tile .tile-price { color: var(--accent); font-weight: 700; font-size: 14px; }
.related ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.compare a { color: var(--accent); font-weight: 600; }

/* ---------- guides, trust pages, footer ---------- */
.prose { font-size: 16px; line-height: 1.65; }
.prose h2 { margin: 22px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 12px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; display: grid; gap: 6px; }
.prose a:not(.btn) { color: var(--accent); }
.prose .table-scroll { margin: 8px 0 12px; }
.big-link { font-size: 22px; font-weight: 700; }
.tiles-wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.footer-links a { color: var(--text); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }
.site-footer p { margin: 0; }
.home-links { margin-bottom: 24px; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: 13px; }
