/* Czcionka marki Outfit, lokalnie (bez CDN). */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../vendor/fonts/outfit-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../vendor/fonts/outfit-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Paleta wynika z logo Biura Magda: neutralny grafit i czerwień #e30513. Wszystkie kolory interfejsu są tokenami;
   ciemny motyw przestawia tylko tokeny. Arkusz do druku (.sheet) to papier i ma stałe kolory niezależne od motywu. */
:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --line: #e0e3e9;
  --line-strong: #c3c8d0;
  --line-input: #737b87; /* obramowanie pól tekstowych: min. 3:1 (WCAG 1.4.11) */
  --text: #1b1d21;
  --muted: #545b66;
  --red: #e30513;
  --red-hover: #c4040f;
  --red-soft: rgba(227, 5, 19, .08);
  --red-line: rgba(227, 5, 19, .45);
  --red-tint: #fff6f6; /* delikatne tło zaznaczonej opcji i hovera */
  --coral: #c4040f; /* czerwień do tekstu i linków: 6,2:1 na bieli */
  --glow: rgba(227, 5, 19, .10);
  --ok: #17713f;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --bad: #8f1d3a; /* bordo: błędy i alarmy, wyraźnie inne niż czerwień marki */
  --bad-soft: #fbeef2;
  --alarm: #8f1d3a; /* tło karty z alarmem (biały tekst: 8,7:1) */
  --ink: #1b1d21; /* ciemne powierzchnie: stopka, karta terminu, link „Przejdź do treści” */
  --on-ink: #ffffff;
  --on-ink-soft: rgba(255, 255, 255, .88);
  --on-dark: #d4d8df;
  --on-dark-hover: #ff9a9f;
  --on-red: #ffffff;
  --header-bg: rgba(255, 255, 255, .78);
  --bg-glass: rgba(244, 245, 247, .9);
  --focus: #e30513;

  --font-ui: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r: 14px; --r-lg: 24px;
  --shadow: 0 1px 2px rgba(27, 29, 33, .05), 0 12px 32px -16px rgba(27, 29, 33, .22);
  --shadow-red: 0 10px 24px -10px rgba(227, 5, 19, .55);
  --measure: 66ch;
  --touch: 48px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1b1e24;
    --surface-2: #242830;
    --line: #2f343d;
    --line-strong: #4a515d;
    --line-input: #8c94a1;
    --text: #eceef2;
    --muted: #a9b0bc;
    --red-soft: rgba(255, 90, 99, .14);
    --red-line: rgba(255, 90, 99, .5);
    --red-tint: #2c1a1d;
    --coral: #ff5a63;
    --glow: transparent; /* bez kolorowej poświaty na ciemnym tle */
    --ok: #6fd39a;
    --warn: #f2c14e;
    --warn-soft: #33290f;
      --bad: #ff8fa6;
    --bad-soft: #3a1822;
    --alarm: #7a1630;
    --ink: #0c0e11;
    --on-dark: #c5cad3;
    --header-bg: rgba(18, 20, 24, .78);
    --bg-glass: rgba(18, 20, 24, .9);
    --focus: #ff5a63;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .6);
    --shadow-red: 0 6px 16px -8px rgba(0, 0, 0, .7); /* bez czerwonej poświaty na ciemnym tle */
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 6rem; } /* przyklejony pasek Wstecz/Dalej nie zasłania fokusu */
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(70rem 30rem at 90% -8%, var(--glow), transparent 62%), var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
.wrap { width: min(100% - 2 * var(--s4), 68rem); margin-inline: auto; }
main { flex: 1; padding-block: var(--s6) var(--s8); outline: none; }
h1, h2, h3 { font-family: var(--font-ui); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.3rem; letter-spacing: -.02em; }
h1 em, h2 em { font-style: normal; color: inherit; }
.hero h1 em { color: var(--coral); } /* czerwony akcent tylko w głównym haśle, nie w każdym nagłówku */
p { margin: 0; max-width: var(--measure); text-wrap: pretty; }
a { color: var(--coral); text-underline-offset: .2em; }
main p a[href^="tel:"], main p a[href^="mailto:"] { display: inline-block; padding-block: .75rem; margin-block: -.75rem; }
a:hover { color: var(--text); }
[tabindex='-1']:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::placeholder { color: var(--muted); opacity: 1; }
::selection { background: var(--red); color: var(--on-red); }
input, textarea { caret-color: var(--red); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s4); top: -100px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: var(--s3) var(--s4); font-weight: 600; border-radius: var(--r); }
.skip-link:focus { top: var(--s3); }
.skip-link:hover { color: var(--on-ink); }

/* Nagłówek i stopka */
.site-header { background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 80px; }
.logo { display: inline-flex; color: var(--text); text-decoration: none; min-height: 44px; align-items: center; }
.logo img { display: block; height: 48px; width: auto; }
.site-header__tag { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.site-footer { background: var(--ink); color: var(--on-dark); padding-block: var(--s6); font-size: .92rem; }
.site-footer__inner { display: grid; gap: var(--s2); }
.site-footer a { color: var(--on-ink); }
.site-footer a:hover { color: var(--on-dark-hover); }
.footer-contact { display: grid; max-width: none; }
.footer-links { display: flex; flex-wrap: wrap; column-gap: var(--s5); }
.footer-links a { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; }
.footer-links a { text-decoration: none; }
.footer-links a span { text-decoration: underline; text-underline-offset: .2em; }
.footer-links .icon { width: 1.25rem; height: 1.25rem; flex: none; display: block; }
.site-footer .link-btn { color: var(--on-ink); }
.site-footer .link-btn:hover { color: var(--on-dark-hover); }
.site-footer :focus-visible { outline-color: var(--on-ink); }

/* Elementy wspólne */
.lead { font-size: 1.2rem; color: var(--muted); margin-top: var(--s4); }
.stack > * + * { margin-top: var(--s5); }
.lead + .helper { margin-top: var(--s3); }
h1 + .row { margin-top: var(--s3); }
.row + .lead { margin-top: var(--s3); }
.lead + .row { margin-top: var(--s3); }
.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s5); }
.panel--quiet { background: transparent; box-shadow: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); padding: 0 var(--s5); border: 1px solid transparent; border-radius: 999px;
  font: 600 1rem/1 var(--font-ui); cursor: pointer; text-decoration: none; touch-action: manipulation;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.btn--primary { background: var(--red); color: var(--on-red); box-shadow: var(--shadow-red); }
.btn--primary:hover { background: var(--red-hover); color: var(--on-red); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--text); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--muted); padding-inline: var(--s3); }
.btn--ghost:hover { color: var(--coral); }
.btn[aria-disabled='true'], .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg, .icon { width: 1.15em; height: 1.15em; flex: none; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--coral); font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.notice { display: flex; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.notice--warn { border-color: var(--warn); background: var(--warn-soft); }
.notice--bad { border-color: var(--bad); background: var(--bad-soft); }
.notice .icon { margin-top: .15em; }
.notice--warn .icon { color: var(--warn); } .notice--bad .icon { color: var(--bad); }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text); font-weight: 500; }
details > summary:hover { color: var(--coral); }

/* Ekran startowy */
.hero { display: grid; gap: var(--s7); padding-block: var(--s5) var(--s6); }
.hero.stack > * + * { margin-top: 0; }
.hero__top { display: grid; gap: var(--s5); grid-template-areas: 'copy' 'action' 'deadline'; }
.hero__copy { grid-area: copy; }
.hero__action { grid-area: action; display: grid; gap: var(--s4); align-content: start; }
.hero__top > .deadline { grid-area: deadline; }
.deadline { max-width: none; display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid var(--red-line); border-radius: var(--r); background: var(--red-soft); font-size: .98rem; }
.deadline .icon { color: var(--coral); margin-top: .2em; }
.deadline p { max-width: none; }
.deadline__more summary { min-height: 44px; font-weight: 500; }
.deadline__more p { padding-bottom: var(--s2); font-size: .95rem; }
.deadline strong { font-weight: 600; }
.dropzone {
  position: relative; display: grid; justify-items: center; text-align: center; gap: var(--s3);
  padding: var(--s7) var(--s5); border: 2px dashed var(--red-line); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .18s var(--ease), background-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--red); background: var(--red-tint); transform: translateY(-2px); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone .icon { width: 4rem; height: 4rem; padding: 1.05rem; border-radius: 50%; background: var(--red); color: var(--on-red); box-shadow: var(--shadow-red); }
.dropzone__title { font: 700 1.4rem/1.2 var(--font-ui); letter-spacing: -.02em; }
.dropzone__hint { color: var(--muted); font-size: .95rem; }
.privacy { display: flex; gap: var(--s3); align-items: flex-start; color: var(--muted); font-size: .95rem; }
.privacy .icon { color: var(--ok); margin-top: .2em; }
.privacy strong { color: var(--text); font-weight: 600; }
.next-steps { padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.next-steps h2 { font-size: 1.25rem; letter-spacing: -.02em; }
.next-steps ol { margin: var(--s3) 0 0; padding-left: 1.3em; display: grid; gap: var(--s2); max-width: var(--measure); }
.how { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); color: var(--muted); font-size: .98rem; }
.how li { display: inline-flex; align-items: center; gap: var(--s2); }
.how__n { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--red-soft); color: var(--coral); font-weight: 700; font-size: .9rem; }
.help { padding: var(--s1) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.steps-list { margin: var(--s3) 0 var(--s3); padding-left: 1.25em; color: var(--muted); display: grid; gap: var(--s2); max-width: var(--measure); }

/* Formularze */
label.field { display: grid; gap: var(--s2); font-weight: 500; }
textarea, input[type=search], input[type=text] {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line-input);
  border-radius: var(--r); padding: var(--s3) var(--s4); font: 400 1.05rem/1.5 var(--font-ui); min-height: var(--touch);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea:hover, input[type=search]:hover, input[type=text]:hover { border-color: var(--text); }
textarea { min-height: 11rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; }
.helper { color: var(--muted); font-size: .95rem; font-weight: 400; }
.error-text:empty { display: none; }
.error-text { color: var(--bad); font-size: .98rem; font-weight: 500; display: flex; gap: var(--s2); align-items: center; padding: var(--s3) var(--s4); background: var(--bad-soft); border: 1px solid var(--bad); border-radius: var(--r); max-width: none; }

/* Lista kodów */
.code-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.code-list li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3) var(--s4); align-items: center; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); }
.code-list li:last-child { border-bottom: 0; }
.code { font: 600 1rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; white-space: nowrap; }
.code-name { color: var(--muted); font-size: .98rem; min-width: 0; overflow-wrap: anywhere; }
.main-radio { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding-inline: var(--s2); font-size: .9rem; color: var(--muted); cursor: pointer; }
.main-radio__text { display: none; font-weight: 600; color: var(--text); }
.main-radio:has(input:checked) .main-radio__text { display: inline; }
.removed-row { display: flex; gap: var(--s3); align-items: center; justify-content: flex-start; flex-wrap: wrap; padding: var(--s3) var(--s5); background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); }
.main-radio input { width: 1.2rem; height: 1.2rem; accent-color: var(--red); }

/* Strona informacyjna */
.prose h2 { margin-top: var(--s2); }
.prose h3 { font-size: 1.1rem; font-weight: 650; margin-top: var(--s5); }
.prose h3 + p { margin-top: var(--s2); }
.prose p, .prose li { max-width: var(--measure); }
.plain-list { margin: 0; padding-left: 1.25em; display: grid; gap: var(--s3); }

/* Wyniki wyszukiwania */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.result { display: grid; gap: var(--s2); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.result__head { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.result__head .code { font-size: 1.1rem; color: var(--coral); background: var(--red-soft); padding: 5px 10px; border-radius: 8px; }
.result__name { max-width: none; overflow-wrap: anywhere; }
.result__map { color: var(--muted); font-size: .98rem; max-width: none; }
.result__map summary { color: var(--text); }
.result__arrow { color: var(--muted); }
.result__targets { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s2); }
.result__targets li { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: baseline; padding-top: var(--s2); border-top: 1px solid var(--line); }
.result .btn { justify-self: start; margin-top: var(--s2); }

/* Statusy */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; padding: 4px 11px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); white-space: nowrap; }
.badge .icon { width: 1em; height: 1em; }
.badge--ok { color: var(--ok); } .badge--warn { color: var(--warn); } .badge--bad { color: var(--bad); } .badge--info { color: var(--muted); } .badge--accent { color: var(--coral); }

/* Podsumowanie */
.stats { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.stat { display: grid; grid-template-columns: 3.2rem 1fr; gap: var(--s4); align-items: start; padding: var(--s4) var(--s5); }
.stat + .stat { border-top: 1px solid var(--line); }
.stat--ok .stat__num { color: var(--ok); } .stat--warn .stat__num { color: var(--warn); } .stat--bad .stat__num { color: var(--bad); }
.stat__num { font: 700 2.4rem/1 var(--font-ui); letter-spacing: -.04em; }
.stat__title { font-weight: 600; display: flex; gap: var(--s2); align-items: center; }
.stat__text { color: var(--muted); font-size: .98rem; }

/* Kreator */
.progress { display: grid; gap: var(--s2); }
.progress__label { font-size: .82rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.step { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: .8rem; color: var(--muted); }
.step .code { font-size: .8rem; }
.step.is-current { border-color: var(--text); color: var(--text); font-weight: 600; }
.progress__bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress__bar > span { display: block; height: 100%; background: var(--red); border-radius: 999px; width: calc(var(--p, 0) * 1%); transition: width .3s var(--ease); }
.q-title { font-size: clamp(1.5rem, 3.4vw, 2.3rem); max-width: 28ch; }
.q-title .q-code { display: block; width: fit-content; font: 600 1.05rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; color: var(--coral); background: var(--red-soft); padding: 7px 12px; border-radius: 8px; margin-bottom: var(--s3); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: var(--s3); }
.mode-list { display: grid; gap: var(--s2); }
.mode { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; min-height: var(--touch); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.mode:hover { border-color: var(--line-strong); }
.mode:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); background: var(--surface-2); }
.mode input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; accent-color: var(--red); flex: none; }
.options { display: grid; gap: var(--s2); margin-top: var(--s3); }
.option { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: start; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; min-height: var(--touch); transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease); }
.option:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.option:has(input:checked) { border-color: var(--text); background: var(--surface-2); box-shadow: 0 0 0 1px var(--text); }
.option input { width: 1.25rem; height: 1.25rem; margin-top: .25rem; accent-color: var(--red); }
.option__body { display: grid; gap: 6px; min-width: 0; }
.option__head { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.option__name { color: var(--text); overflow-wrap: anywhere; }
.options--disabled { opacity: .4; pointer-events: none; }
/* Opcja kreatora: karta z polem wyboru + przycisk "Co obejmuje?" jako jej dolna część */
.option-item { display: grid; }
.option-item > .option { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.option-item > .explain { border: 1px solid var(--line); border-top: 0; background: var(--surface); border-radius: 0 0 var(--r) var(--r); }

/* Nota wyjaśniająca GUS ("Co obejmuje?") */
.explain > summary { list-style: none; cursor: pointer; min-height: var(--touch); display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s4); color: var(--coral); font-size: .95rem; font-weight: 500; }
.explain > summary::-webkit-details-marker { display: none; }
.explain > summary::before { content: ''; flex: none; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .18s var(--ease); }
.explain[open] > summary::before { transform: rotate(45deg); }
.explain > summary:hover { color: var(--text); }
.explain__body { display: grid; gap: var(--s2); padding: var(--s1) var(--s4) var(--s4); max-width: var(--measure); }
.explain__head { margin: var(--s2) 0 0; font-weight: 600; }
.explain__p { margin: 0; color: var(--muted); font-size: .98rem; }
.explain__list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; color: var(--muted); font-size: .98rem; }
.explain__list .explain__list { margin-top: 4px; }
.explain__source { margin: var(--s2) 0 0; font-size: .85rem; color: var(--muted); }
.result .explain { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r); }
.result__targets li .explain { flex: 1 1 100%; }

.options-label { margin: var(--s3) 0 0; font-weight: 600; }
.option-list, .option-groups { display: grid; gap: var(--s2); }
.option-group { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.option-group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: var(--touch); padding: var(--s3) var(--s4); cursor: pointer; }
.option-group > summary::-webkit-details-marker { display: none; }
.option-group > summary::after { content: ''; flex: none; width: 1.1rem; height: 1.1rem; margin-left: var(--s2); background: var(--muted); -webkit-mask: url('../assets/chevron.svg') center / contain no-repeat; mask: url('../assets/chevron.svg') center / contain no-repeat; transition: transform .18s var(--ease); }
.option-group[open] > summary::after { transform: rotate(180deg); }
.option-group__title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.option-group__title .code { color: var(--coral); margin-right: var(--s2); }
.option-group__count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.option-group .option-list { padding: 0 var(--s3) var(--s3); }
.wide-tools { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: end; margin-top: var(--s3); }
.wide-tools label { flex: 1 1 16rem; }
.selected-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.nav-row--sticky { position: sticky; bottom: 0; z-index: 5; margin-top: var(--s6); padding: var(--s3) 0 max(var(--s3), env(safe-area-inset-bottom)); background: var(--bg-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.suggest { display: grid; gap: var(--s3); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.suggest__title { display: flex; gap: var(--s2); align-items: center; font-size: 1.1rem; letter-spacing: -.01em; color: var(--ok); }
.suggest__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.suggest__why { max-width: none; color: var(--muted); font-size: .96rem; }
.suggest__done { display: flex; gap: var(--s2); align-items: center; color: var(--ok); font-weight: 600; }
.suggest .btn { justify-self: start; }
.bulk { display: grid; gap: var(--s3); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--ok); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.bulk p { max-width: none; }
.bulk-offer { display: grid; gap: var(--s3); justify-items: start; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); }
.bulk-offer p { max-width: none; }
.bulk-offer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); font-size: .96rem; }
.bulk .row { gap: var(--s2); }
.bulk .row .btn { width: auto; flex: 1 1 auto; min-height: 44px; padding-inline: var(--s3); font-size: .95rem; }
.mode-list.is-invalid .mode { border-color: var(--bad); }
.suggest__applied { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.chips__label { font-size: .9rem; color: var(--muted); align-self: center; }
.outcome-line { max-width: none; padding: var(--s3) var(--s4); background: var(--surface-2); border-radius: var(--r); font-size: .98rem; font-weight: 500; }
.option-group__official { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.answers { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.answers li { display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); align-items: start; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.answers li:last-child { border-bottom: 0; }
.answers__old { grid-column: 1 / -1; max-width: none; color: var(--muted); font-size: .95rem; }
.answers__old .code { color: var(--text); }
.answers__result { display: flex; gap: var(--s2); align-items: flex-start; min-width: 0; }
.answers__out { display: grid; gap: var(--s1); }
.answers__tname { color: var(--muted); font-size: .95rem; }
.auto-list ul { list-style: none; margin: 0; padding: 0 0 var(--s3); display: grid; gap: var(--s3); font-size: .95rem; }
.auto-list li { display: block; }
.auto-list__to { display: inline; }
.answers li .link-btn { align-self: start; }
.glossary dl { margin: 0; padding: 0 0 var(--s3); display: grid; gap: var(--s3); font-size: .96rem; }
.glossary dt { font-weight: 600; }
.glossary dd { margin: var(--s1) 0 0; color: var(--muted); max-width: var(--measure); }
.clear-block { display: grid; gap: var(--s3); }
.nav-row { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; align-items: center; margin-top: var(--s6); }

/* Karta wyniku (kartka A4 na ekranie) */
.result-more { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: calc(var(--s2) * -1); }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.paper-wrap { overflow-x: auto; padding-block: var(--s2); }
.sheet { color-scheme: light; /* papier: stałe kolory */
  background: #fff; color: #141212; width: min(100%, 210mm); margin-inline: auto; padding: 14mm 14mm 12mm;
  font: 400 10pt/1.45 var(--font-ui); box-shadow: var(--shadow); border-radius: 6px;
}
.sheet h2, .sheet h3 { font-family: var(--font-ui); color: #141212; letter-spacing: -.01em; text-wrap: balance; }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid #141212; padding-bottom: 10px; }
.sheet__logo { display: inline-flex; }
.sheet__logo img { display: block; height: 15mm; width: auto; }
.sheet__meta { text-align: right; font-size: 8.5pt; color: #4a4441; line-height: 1.35; }
.sheet h2 { font-size: 19pt; font-weight: 700; margin-top: 14px; }
.sheet h2 em { color: #c8102e; }
.sheet h3 { font-size: 12.5pt; font-weight: 600; margin: 16px 0 6px; }
.sheet p { max-width: none; }
.sheet__summary { margin-top: 6px; color: #3a3532; }
.sheet__box { border: 1.5px solid #141212; padding: 10px 12px; margin-top: 14px; break-inside: avoid; }
.sheet__box--review { border-style: dashed; border-color: #8a6d00; }
.sheet__box > h3 { margin-top: 0; }
.sheet__box--deadline { border-color: #c8102e; }
.sheet__box--deadline p { margin-top: 4px; font-size: 9.5pt; color: #3a3532; }
.sheet__list { list-style: none; margin: 6px 0 0; padding: 0; }
.sheet__list li { display: grid; grid-template-columns: 4.6em 1fr auto; gap: 8px; padding: 3px 0; border-bottom: 1px solid #e3ded8; align-items: baseline; }
.sheet__list li:last-child { border-bottom: 0; }
.sheet .code { font-size: 9.5pt; }
.sheet__action { display: block; font-size: 8pt; font-weight: 600; margin-top: 1px; }
.sheet__action--change { color: #8a0a1c; }
.sheet__action--keep { color: #1f5f3a; }
.sheet__note--remove { color: #8a0a1c; }
.sheet__author { font-size: 7.5pt; color: #5a534d; margin-top: 4px; text-align: right; }
.footer-author { font-size: .8125rem; opacity: .85; }
.sheet__tag { font-size: 7.5pt; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; border: 1px solid #c8102e; color: #c8102e; padding: 1px 6px; white-space: nowrap; }
.sheet__note { font-size: 9pt; color: #3a3532; margin-top: 6px; }
.sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9pt; margin-top: 6px; }
.sheet th:nth-child(1) { width: 37%; } .sheet th:nth-child(2) { width: 40%; } .sheet th:nth-child(3) { width: 23%; }
.sheet td .out + .out { margin-top: 4px; }
.sheet th { text-align: left; font-size: 7.5pt; letter-spacing: .08em; text-transform: uppercase; color: #4a4441; border-bottom: 1.5px solid #141212; padding: 4px 6px 4px 0; }
.sheet td { overflow-wrap: anywhere; vertical-align: top; padding: 2px 6px 2px 0; border-bottom: 1px solid #e3ded8; }
.sheet__pagebreak { break-before: page; }
@media screen { .sheet__pagebreak { margin-top: 24px; padding-top: 8px; border-top: 1px dashed #b9b2ab; } }
.sheet tr { break-inside: avoid; }
.sheet td .code, .sheet td .sub { display: block; }
.sheet td .code { font-size: 9pt; }
.sheet td .sub { color: #4a4441; font-size: 8pt; line-height: 1.3; }
.sheet .st { font-weight: 600; }
.sheet .st--ok::before { content: '✓ '; } .sheet .st--chosen::before { content: '● '; } .sheet .st--review::before { content: '? '; } .sheet .st--removed::before { content: '– '; }
.sheet ol { margin: 6px 0 0; padding-left: 1.3em; }
.sheet ol li { margin-bottom: 2px; }
.sheet__foot { margin-top: 16px; padding-top: 8px; border-top: 1.5px solid #141212; display: flex; justify-content: space-between; gap: 16px; font-size: 8.5pt; color: #3a3532; break-inside: avoid; }
.sheet__foot strong { color: #141212; }
.sheet__disclaimer { font-size: 7.5pt; color: #5a534d; margin-top: 8px; }

@media (min-width: 56rem) {
  .hero__top { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); grid-template-areas: 'copy action' 'deadline action'; column-gap: var(--s8); align-items: start; }
  .how { grid-template-columns: repeat(3, 1fr); }
}

@media (pointer: coarse) {
  .print-hint { display: none; }
  .result-actions a[href^='tel:'] { order: -1; }
  /* linki w zdaniach: większy obszar dotyku bez zmiany układu tekstu */
  .deadline a, .next-steps a, .outcome-line a { display: inline-block; padding-block: .45rem; margin-block: -.45rem; }
}

/* Podgląd kartki na wąskim ekranie: nagłówek i lista zawijają się zamiast wystawać poza arkusz */
@media screen and (max-width: 40rem) {
  .sheet__head { flex-wrap: wrap; }
  .sheet__meta { text-align: left; }
  .sheet__list li { grid-template-columns: 4.6em 1fr; }
  .sheet__list li .sheet__tag { grid-column: 2; justify-self: start; }
  .sheet__list li > span:empty { display: none; }
}

@media (max-width: 40rem) {
  .hero__top { grid-template-areas: 'copy' 'deadline' 'action'; }
  .lead__more { display: none; }
  main { padding-block: var(--s5) var(--s7); }
  .site-header__tag { display: none; }
  .logo img { height: 40px; }
  .answers li { padding-inline: var(--s4); }
  .site-header__inner { min-height: 68px; }
  .code-list li { padding-inline: var(--s4); }
  .panel { padding: var(--s4); }
  .code-list li { grid-template-columns: 1fr auto; }
  .code-list li .code-name { grid-column: 1 / -1; order: 3; }
  .sheet { padding: 8mm 6mm; }
  .btn { width: 100%; }
  .nav-row .btn, .result-actions .btn, .row .btn { flex: 1 1 100%; }
  .result-more { flex-direction: column; align-items: stretch; }
  .result-more .btn { width: 100%; justify-content: center; }
  .stepper { flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--s1); }
  .step { flex: none; }
  /* lista kodów: akcje w wierszu nie rozciągają się na całą szerokość (poprzednio kosz miał 195 px, wiersz do 191 px) */
  .code-list .row { flex-wrap: nowrap; gap: var(--s1); }
  .code-list .btn { width: auto; flex: none; padding-inline: var(--s3); }
  /* kreator: "Wstecz" i "Dalej" w jednym przyklejonym rzędzie, "Dalej" zajmuje resztę */
  .nav-row--sticky { flex-wrap: nowrap; gap: var(--s2); }
  .nav-row--sticky .btn { flex: 1 1 auto; width: auto; }
  .nav-row--sticky .btn--ghost { flex: none; }
}

/* Ograniczony ruch: znika unoszenie kart i przycisków oraz płynne przewijanie; krótkie zmiany koloru i paska postępu zostają, bo pokazują stan. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .btn, .dropzone { transition-property: background-color, border-color, color, box-shadow; }
  .btn:hover, .btn:active, .dropzone:hover, .dropzone.is-over { transform: none; }
}

@media (forced-colors: active) {
  .btn--primary, .badge, .notice, .option, .mode { border: 1px solid CanvasText; }
}

/* Druk: tylko kartka, na białym papierze */
/* Margines 0 wyłącza nagłówek i stopkę przeglądarki (tytuł strony, adres, data); odstęp robi padding kartki. */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; color: #141212 !important; min-height: 0; display: block; }
  .site-header, .site-footer, .skip-link, .no-print, #live { display: none !important; }
  .wrap, main { width: auto; margin: 0; padding: 0; }
  .paper-wrap { overflow: visible; padding: 0; }
  .sheet { width: auto; padding: 12mm; box-shadow: none; margin: 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .sheet a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.stepper__legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: .8125rem; }
.progress__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.removed-row .btn { width: auto; }
