:root {
  --navy:#000000; --yellow:#FFB21B; --sky:#F5F9FC; --paper:#F5F9FC;
  --ink:#000000; --muted:#647083; --line:#D7DFEE; --red:#CB2E3B;
  --red-soft:rgba(203,46,59,.09); --blue:#002092;
  --pop-button:#FFAF00; --pop-label:#3D4A77; --pop-badge:#C3D4FF;
  color-scheme:light;
}
* { box-sizing:border-box; }
html { scroll-behavior:auto; }
body { margin:0; display:flow-root; color:var(--ink); background:var(--paper); font-family:'Inter Tight',sans-serif; font-weight:500; line-height:1.5; }
[hidden] { display:none!important; }
::selection { color:var(--ink); background:var(--pop-badge); }
button,input,select { font:inherit; color:inherit; }
input,select { caret-color:var(--blue); }
button { cursor:pointer; border:1px solid var(--line); min-height:44px; padding:11px 16px; background:#FFFFFF; border-radius:9px; font-size:14px; font-weight:600; line-height:1.3; -webkit-tap-highlight-color:transparent; transition:filter 150ms ease; }
button:hover:not(:disabled),button:active:not(:disabled) { filter:brightness(.95); }
button:disabled { opacity:.55; cursor:wait; }
button:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
button:focus:not(:focus-visible) { outline:none; }
:root[data-calc-input='pointer'] button:focus { outline:none; }
.wrap { width:min(1152px,calc(100% - 32px)); margin:0 auto 32px; display:grid; gap:32px; }
.card { min-width:0; background:#FFFFFF; border:1px solid var(--line); border-radius:12px; }
.form { display:grid; grid-template-columns:minmax(0,1fr); }
.form>div { min-width:0; padding:24px; }
.form>div+div { border-top:1px solid var(--line); }
.step { display:flex; align-items:center; gap:10px; margin:0 0 16px; font-size:18px; font-weight:600; line-height:1.3; }
.step b { flex:none; display:grid; place-items:center; width:28px; height:28px; background:var(--pop-badge); border-radius:50%; font:600 13px/1 Inter,sans-serif; color:var(--pop-label); }
.seg,.tryb { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.seg button,.tryb button { min-width:0; padding:12px 8px; background:var(--paper); color:var(--pop-label); }
.seg button.on,.tryb button.on { background:var(--yellow); border-color:var(--yellow); color:var(--ink); }
.tryb { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:16px; }
.years { display:flex; flex-wrap:wrap; gap:12px; }
.years>label { display:flex; align-items:center; justify-content:space-between; gap:8px; flex:1 1 120px; min-width:0; padding:8px 14px; background:var(--paper); border:1px solid var(--line); border-radius:9px; }
.years input { width:100%; min-width:44px; border:0; padding:0; font-size:24px; font-weight:600; background:transparent; font-variant-numeric:tabular-nums; }
.years label small { color:var(--muted); font-size:14px; }
.years .seg { flex:3 1 230px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.hint { min-height:20px; margin:12px 0 0; color:var(--muted); font-size:13px; line-height:1.5; }
.hint.err { color:var(--red); font-weight:600; }
.go { display:flex; align-items:center; }
.go button,.actions button.main { width:100%; border-color:var(--pop-button); background:var(--pop-button); color:var(--ink); box-shadow:0 3px 8px rgba(0,0,0,.10); }
.go button { min-height:48px; padding:14px 20px; font-size:16px; }
.result,.all { padding:24px; scroll-margin-top:112px; }
h2 { margin:0; font-size:24px; font-weight:600; letter-spacing:-.02em; line-height:1.2; text-wrap:balance; }
.lead { margin:12px 0 0; color:var(--muted); font-size:16px; line-height:1.5; }
.lead span { display:block; }
.dates { margin:12px 0 0; font-size:14px; font-weight:600; color:var(--pop-label); }
.chart { margin:24px 0 8px; }
.chart,.dist { min-width:0; }
.chart svg,.dist svg { display:block; width:100%; height:auto; font-family:'Inter Tight',sans-serif; }
.legend { display:flex; flex-wrap:wrap; gap:8px 20px; color:var(--muted); font-size:13px; }
.legend i { display:inline-block; width:14px; height:10px; margin-right:6px; vertical-align:middle; }
.stats { display:grid; grid-template-columns:minmax(0,1fr); margin-top:24px; border:1px solid var(--line); }
.stat { min-width:0; padding:16px; }
.stat+.stat { border-top:1px solid var(--line); }
.stat p { margin:0; color:var(--pop-label); font:600 11px/1.5 Inter,sans-serif; text-transform:uppercase; letter-spacing:.025em; }
.stat strong { display:block; margin-top:8px; font-size:32px; font-weight:600; line-height:1.2; font-variant-numeric:tabular-nums; }
.stat span { display:block; margin-top:8px; color:var(--muted); font-size:13px; line-height:1.5; }
.stat.bad { background:var(--paper); }
.stat.bad strong { color:var(--red); }
.actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; }
.actions button { flex:1 1 160px; }
.actions button.main { width:auto; }
.dist { margin-top:24px; }
.facts { display:grid; grid-template-columns:minmax(0,1fr); margin-top:24px; border:1px solid var(--line); }
.facts>div { min-width:0; padding:16px; font-size:14px; line-height:1.5; background:var(--paper); }
.facts>div+div { border-top:1px solid var(--line); }
.facts b { display:block; font-size:24px; font-weight:600; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.facts span { color:var(--muted); }
.note { margin:24px 0 0; color:var(--muted); font-size:13px; line-height:1.6; max-width:100ch; }
.note span { display:block; }
.okres { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.okres label { min-width:0; display:block; padding:8px 12px; border:1px solid var(--line); border-radius:9px; background:var(--paper); }
.okres label small { display:block; margin-bottom:4px; color:var(--pop-label); font-size:13px; }
.okres label div { display:flex; gap:8px; min-width:0; }
.okres label div select:first-child { flex:1 1 auto; }
.okres select { min-width:0; min-height:36px; max-width:100%; border:0; padding:4px 0; background:transparent; font-size:16px; font-weight:600; cursor:pointer; }
.wniosek { margin:16px 0 0; padding:16px; background:var(--paper); font-size:16px; line-height:1.5; }
.wniosek span { display:block; }
.wniosek b { color:var(--blue); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
@media(min-width:640px) {
 .okres { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .stats,.facts { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .stat+.stat,.facts>div+div { border-top:0; border-left:1px solid var(--line); }
 .result,.all { padding:32px; }
}
@media(min-width:1024px) {
 .form { grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) minmax(200px,.7fr); align-items:stretch; }
 .form>div { padding:24px; }
 .form>div+div { border-top:0; border-left:1px solid var(--line); }
 .go { padding:24px; }
 h2 { font-size:28px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; } }
