/* Kalkulačka energopomoci – vizuál podľa kalkulačky elektromobilov (labs/kalkulacka-elektromobily):
   písma Lumin a Inter z dizajnového systému dn-components, farby a odstupy rovnaké. */

:root {
  --text: #292222;
  --bg: #fbfafa;
  --muted: #6b6160;
  --border: #e2dbd9;
  --soft: #f2eae8;
  --btn-border: #8a8180;
  --dn-red: #ae0d21;
  --bad: #ae0d21;
  --bad-bg: #f4e5e5;
  --ok: #05707b;      /* tyrkysová z palety Denníka N, stmavená pre kontrast textu */
  --ok-bg: #e1f0f1;
  --accent: #214183;  /* E-čková modrá */
  --focus: #292222;
  --serif: Lumin, Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #d4cfce; --bg: #1c1b1b; --muted: #b3aaa9; --border: #47403e; --soft: #332f2e;
    --btn-border: #ccc3c2; --bad: #ec8793; --bad-bg: #42010c; --ok: #5fc6d1; --ok-bg: #11353a;
    --accent: #8aa8e6; --focus: #d4cfce;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --text: #d4cfce; --bg: #1c1b1b; --muted: #b3aaa9; --border: #47403e; --soft: #332f2e;
  --btn-border: #ccc3c2; --bad: #ec8793; --bad-bg: #42010c; --ok: #5fc6d1; --ok-bg: #11353a;
  --accent: #8aa8e6; --focus: #d4cfce;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 1.125rem/1.5 var(--serif); -webkit-text-size-adjust: 100%; }
.ep { max-width: 628px; margin: 0 auto; padding: 24px 16px 48px; }
/* vložená v článku: plná šírka iframu = šírka textu článku, bez bočného odsadenia */
.ep[data-embed] { max-width: none; padding: 8px 0 48px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0 0 12px; text-wrap: balance; }
h1 { font-size: 1.875rem; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.2; margin-top: 2.5rem; }
h3 { font-size: 1.1875rem; margin-top: 1.5rem; }
@media (min-width: 961px) { h1 { font-size: 2.5rem; line-height: 1; } h2 { font-size: 1.75rem; } }
p { margin: 0 0 12px; }
a { color: inherit; text-underline-offset: 2px; }
.kicker { display: inline-block; background: var(--dn-red); color: #fff; font: 600 0.8125rem/1.3 var(--sans); padding: 0.1875rem 0.5rem; margin-bottom: 0.75rem; }
ul.lead { font-size: 1.1875rem; padding: 0; margin: 0 0 12px 2ch; }
ul.lead li + li { margin-top: 6px; }
.hint, .note { color: var(--muted); font: 0.9375rem/1.45 var(--sans); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

a:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Príklady domácností */
.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 1.25rem; font-family: var(--sans); }
.presets-label { font-size: 0.875rem; color: var(--muted); margin-right: 4px; }
.chip { font: 0.9375rem/1.3 var(--sans); min-height: 2.75rem; padding: 0.5rem 0.875rem; cursor: pointer;
  background: var(--bg); color: var(--text); border: 1px solid var(--btn-border); border-radius: 0; }
@media (hover: hover) { .chip:hover { background: var(--soft); } }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Členovia domácnosti */
.members { display: grid; gap: 12px; margin-top: 1rem; }
.member { border: 1px solid var(--border); padding: 16px 16px 0; display: grid; gap: 12px; }
.member-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.who { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.coef { font: 600 0.8125rem/1.3 var(--sans); padding: 0.1875rem 0.5rem; background: var(--soft); font-variant-numeric: tabular-nums; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
@media (max-width: 480px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.field { margin: 0 0 16px; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
label { display: block; font: 600 0.9375rem/1.4 var(--sans); margin-bottom: 0.375rem; }
.unit { font-weight: 400; white-space: nowrap; }
input[type="number"], select {
  width: 100%; min-height: 3rem; padding: 0.625rem 0.875rem; font: 1rem/1.4 var(--sans); color: var(--text);
  background: var(--bg); border: 1px solid var(--btn-border); border-radius: 0; font-variant-numeric: tabular-nums;
}
.who select { width: auto; min-height: 2.75rem; }
.remove { font: 0.9375rem/1.3 var(--sans); background: none; border: 0; color: var(--muted); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; min-height: 2.75rem; padding: 0 4px; }
@media (hover: hover) { .remove:hover { color: var(--bad); } }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-add { font: 600 0.9375rem/1.3 var(--sans); min-height: 2.75rem; padding: 0.5rem 0.875rem; cursor: pointer;
  background: transparent; color: var(--text); border: 1px dashed var(--btn-border); border-radius: 0; }
@media (hover: hover) { .btn-add:hover { background: var(--soft); } }

/* Výsledok */
.verdict { padding: 14px 16px; margin-bottom: 16px; font-family: var(--sans); font-size: 1rem; }
.verdict p { margin: 0 0 6px; }
.verdict p:last-child { margin-bottom: 0; }
.verdict .big { font: 700 1.5rem/1.2 var(--serif); margin-bottom: 8px; }
.verdict.yes { background: var(--ok-bg); }
.verdict.yes .big { color: var(--ok); }
.verdict.no { background: var(--bad-bg); }
.verdict.no .big { color: var(--bad); }
.gauge svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
@media (prefers-reduced-motion: no-preference) { .bar { transition: width .25s ease; } }
.stats { margin: 16px 0 8px; font: 1rem/1.4 var(--sans); }
.stat { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.stat:last-child { border-bottom: 0; }
.stat dt { color: var(--muted); }
.stat dd { margin: 0; font-weight: 600; text-align: right; }
.formula { font: 0.9375rem/1.45 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.formula strong { color: var(--text); }

/* Ako sme počítali */
.method { font: 1rem/1.5 var(--sans); }
.method h2, .method h3 { font-family: var(--serif); }
.method ul { padding-left: 2ch; margin: 0 0 12px; }
.method li + li { margin-top: 6px; }
