/* ProgramyKSeF.pl – arkusz stylów (bez zewnętrznych zasobów) */
:root {
  --ink: #13232f;
  --ink-2: #33475a;
  --muted: #566775;
  --bg: #ffffff;
  --bg-soft: #f3f6f7;
  --bg-tint: #eaf3f1;
  --line: #d6e0e5;
  --brand: #0d3b4f;
  --brand-2: #12516b;
  --accent: #0d7a68;
  --link: #0a5874;
  --link-hover: #073f54;
  --warm: #e9a23b;
  --focus: #0a5874;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(13, 59, 79, .06), 0 6px 20px rgba(13, 59, 79, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 72ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
main { display: block; outline: none; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
a.ext::after { content: "↗"; font-size: .8em; margin-left: .15em; text-decoration: none; display: inline-block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--warm); }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.narrow { max-width: 860px; }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--warm); color: #1d1300; padding: .6rem 1rem; border-radius: var(--radius-sm); font-weight: 700;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--brand); color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 64px; padding-block: .35rem; }
.brand { min-width: 0; flex-wrap: wrap; }
.brand-name { overflow-wrap: anywhere; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.brand b, .footer-brand b { color: #8fe0cf; font-weight: 800; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.brand .logo-mark rect { fill: #fff; }
.brand .logo-mark path:first-of-type { fill: var(--brand); }
.brand .logo-mark path:nth-of-type(2) { fill: #8fe0cf; }
.brand .logo-mark path:nth-of-type(3) { stroke: #8fe0cf; }

.nav-desktop ul, .nav-list { list-style: none; margin: 0; padding: 0; }
.nav-desktop ul { display: flex; gap: .15rem; align-items: center; }
.nav-desktop a, .nav-list a {
  display: inline-flex; align-items: center; gap: .35rem;
  color: #e6f0f3; text-decoration: none; padding: .45rem .7rem; border-radius: 8px; font-size: .95rem; font-weight: 550;
}
.nav-desktop a:hover, .nav-list a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-desktop a[aria-current="page"], .nav-list a[aria-current="page"] { background: rgba(143, 224, 207, .18); color: #fff; box-shadow: inset 0 -2px 0 #8fe0cf; }
.menu { display: none; }
@media (max-width: 1080px) {
  .nav-desktop { display: none; }
  .menu { display: block; }
  .menu > summary {
    white-space: nowrap;
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem .85rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; font-weight: 600;
  }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; position: relative; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
  .menu[open] .menu-icon { background: transparent; }
  .menu[open] .menu-icon::before { top: 0; transform: rotate(45deg); }
  .menu[open] .menu-icon::after { top: 0; transform: rotate(-45deg); }
  .menu nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--brand); border-top: 1px solid rgba(255, 255, 255, .12);
    padding: .5rem clamp(16px, 4vw, 32px) 1rem; box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
  }
  .nav-list a { display: flex; padding: .75rem .5rem; font-size: 1.05rem; border-radius: 8px; }
  .nav-list li + li { border-top: 1px solid rgba(255, 255, 255, .08); }
}

/* ------------------------------------------------ typography */
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.012em; color: var(--ink); scroll-margin-top: 5rem; }
h1 { font-size: clamp(1.85rem, 1.2rem + 2.6vw, 2.75rem); margin: .2em 0 .45em; font-weight: 800; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.8rem); margin: 2.2em 0 .6em; font-weight: 750; }
h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.3rem); margin: 1.8em 0 .5em; font-weight: 700; }
h4 { font-size: 1.05rem; margin: 1.5em 0 .4em; }
p { margin: 0 0 1em; }
.h-anchor { margin-left: .4rem; color: var(--line); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity .15s; }
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus-visible { opacity: 1; color: var(--muted); }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-soft); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; overflow-wrap: anywhere; }
pre { overflow-x: auto; background: var(--bg-soft); padding: 1rem; border-radius: var(--radius-sm); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
strong { font-weight: 700; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 .4rem; }

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li > ul, .prose li > ol { margin: .3em 0; }
.prose ol > li::marker { font-weight: 700; color: var(--brand-2); }

/* ------------------------------------------------ article layout */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-block: 1.5rem 4rem; }
@media (min-width: 1100px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 3.5rem; }
  .toc-inline { display: none; }
}
.article-head { padding-top: .5rem; max-width: var(--measure); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem .5rem; padding: 0; margin: 0 0 1rem; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--line); }
.crumbs a { color: var(--muted); }
.lead p, .lead-p { font-size: clamp(1.08rem, 1rem + .35vw, 1.22rem); color: var(--ink-2); line-height: 1.6; }
.article-meta { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; padding: .75rem 0; margin: 0 0 1.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.article-meta span { color: var(--muted); }

.toc { font-size: .95rem; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: .3em 0; }
.toc a { text-decoration: none; color: var(--ink-2); }
.toc a:hover { color: var(--link); text-decoration: underline; }
.toc-inline { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1.1rem; margin: 0 0 2rem; background: var(--bg-soft); max-width: var(--measure); }
.toc-inline summary { cursor: pointer; font-weight: 700; padding: .2rem 0; }
.toc-inline[open] summary { margin-bottom: .5rem; }
.sidebar { display: none; }
@media (min-width: 1100px) {
  .sidebar { display: block; }
  .series { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
  .toc-side { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; padding-right: .5rem; }
  .toc-side a.is-active { color: var(--link); font-weight: 650; }
}
.side-h { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .6rem; }
.series ol { list-style: none; padding: 0; margin: 0; }
.series a { display: flex; gap: .6rem; align-items: baseline; padding: .45rem .6rem; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: .95rem; }
.series a:hover { background: var(--bg-soft); }
.series a[aria-current="page"] { background: var(--bg-tint); color: var(--ink); font-weight: 650; }
.series .num { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 800; background: var(--brand); color: #fff; }

/* ------------------------------------------------ summary / callouts */
.summary { background: linear-gradient(180deg, var(--bg-tint), #f6fbfa); border: 1px solid #c7e3dc; border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 1.1rem 1.4rem .4rem; margin: 0 0 2rem; }
.summary-title { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; color: var(--accent); margin-bottom: .4rem; }
.summary ul { padding-left: 1.2em; }
.callout { border-radius: var(--radius-sm); padding: .9rem 1.2rem .1rem; margin: 1.4rem 0; border: 1px solid var(--line); background: var(--bg-soft); }
.callout-warn { background: #fff7e8; border-color: #f1d49c; border-left: 5px solid #c77c0e; }
.callout-tip { background: #eef6fb; border-color: #c4dceb; border-left: 5px solid var(--link); }
.callout-example { background: #f5f3fb; border-color: #dcd5ef; border-left: 5px solid #6a4fb3; }
.callout-note { border-left: 5px solid var(--muted); }

/* ------------------------------------------------ badges */
.badge { display: inline-block; font-size: .74rem; font-weight: 700; line-height: 1.3; padding: .18em .55em; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; vertical-align: .1em; letter-spacing: .01em; }
.badge-ok { background: #e2f3ea; color: #0f5a37; border-color: #b9e0cb; }
.badge-pub { background: #e4eefa; color: #1b4a85; border-color: #bfd4f0; }
.badge-wip { background: #fff0d4; color: #6e4300; border-color: #f0d199; }
.badge-ann { background: #efe9fb; color: #50318f; border-color: #d6c8f2; }
.badge-unk { background: #eceff1; color: #3f4c56; border-color: #d3dade; }
.badge-hist { background: #f1f0ec; color: #4d4c45; border-color: #dcdad1; }
.badge-eu { background: #e6ecfa; color: #213c87; border-color: #c3d0f0; }
td .badge { white-space: normal; }

/* ------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 1.3rem 0 1.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; max-width: 100%; }
.table-wrap:focus-visible { outline-offset: 3px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--bg-soft); font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #fafcfc; }
.prose .table-wrap { max-width: none; }
@media (min-width: 1100px) {
  .prose .table-wrap { width: min(100%, calc(100vw - 420px)); }
}
@media (max-width: 640px) {
  .table-stack { border: 0; background: transparent; overflow: visible; }
  .table-stack table, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-stack tr { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .8rem; background: #fff; overflow: hidden; }
  .table-stack tbody tr:nth-child(even) td { background: #fff; }
  .table-stack td { border-bottom: 1px solid #edf1f3; padding: .55rem .8rem; }
  .table-stack td:first-child { background: var(--bg-soft) !important; font-weight: 650; }
  .table-stack td:empty { display: none; }
  .table-stack td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .1rem; }
}

/* ------------------------------------------------ diagrams */
.diagram { margin: 1.8rem 0; padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, #fbfdfd, #f5f9f9); }
.diagram figcaption { font-weight: 700; margin-bottom: 1rem; line-height: 1.4; }
.fig-kind { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: #fff; background: var(--brand-2); border-radius: 5px; padding: .12em .5em; margin-right: .35rem; vertical-align: .12em; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps li { counter-increment: st; position: relative; padding: 0 0 1rem 3rem; min-height: 2.4rem; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .95rem; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.02rem; top: 2.25rem; bottom: .15rem; width: 2px; background: #b7cfd6; }
.step-actor { display: inline-block; font-weight: 750; color: var(--brand-2); margin-right: .45rem; }
.step-text { color: var(--ink); }
.steps-alt { margin: .3rem 0 0; padding: .7rem 1rem; border-radius: var(--radius-sm); background: #fdeeee; border: 1px dashed #e0a3a3; }
.steps-alt .step-actor { color: #9b2c2c; }
.steps-alt .step-actor::before { content: "✕ "; }

.decision .d-node { margin: 0; }
.d-q { margin: 0 0 .5rem; font-weight: 700; display: flex; gap: .55rem; align-items: flex-start; }
.d-qmark { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 6px; background: var(--warm); color: #2b1a00; display: grid; place-items: center; font-weight: 900; }
.d-answers { list-style: none; margin: 0 0 0 .8rem; padding: 0 0 0 1.1rem; border-left: 2px solid #c9d8dd; }
.d-answers > li { margin: .45rem 0 .8rem; position: relative; }
.d-answers > li::before { content: ""; position: absolute; left: -1.1rem; top: .85em; width: .8rem; border-top: 2px solid #c9d8dd; }
.d-answer { display: inline-block; font-weight: 650; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .05em .5em; }
.d-result { font-weight: 600; color: var(--ink); }
.d-answers .d-node { margin-top: .6rem; }
.d-arrow { color: var(--accent); font-weight: 800; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: .55rem; top: .4rem; bottom: .4rem; width: 2px; background: #c3d4da; }
.timeline li { position: relative; padding: 0 0 1.1rem 2.2rem; display: grid; gap: .1rem; }
.timeline li::before { content: ""; position: absolute; left: .15rem; top: .4rem; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; border: 3px solid var(--brand-2); }
.timeline .tl-ok::before { border-color: #1d8a57; }
.timeline .tl-pub::before { border-color: #2a66b3; }
.timeline .tl-wip::before { border-color: #c77c0e; background: #fff0d4; }
.timeline .tl-hist::before { border-color: #9a978a; }
.timeline .tl-eu::before { border-color: #3557b0; }
.tl-when { font-weight: 800; color: var(--brand); }
.tl-text .badge { margin-left: .35rem; }

.tree ul { list-style: none; margin: 0; padding-left: 1.3rem; border-left: 2px solid #c9d8dd; }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { position: relative; margin: .45rem 0; }
.tree ul ul > li::before { content: ""; position: absolute; left: -1.3rem; top: .95em; width: 1rem; border-top: 2px solid #c9d8dd; }
.tree-name { display: inline-block; font-weight: 700; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .1em .55em; }
.tree-desc { color: var(--ink-2); }
.tree-desc::before { content: "– "; }

.plan { display: grid; gap: .3rem; }
.plan-head, .plan-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; }
.plan-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.plan-label { font-size: .93rem; }
.plan-sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: block; }
.plan-range { color: var(--muted); font-size: .85rem; }
.plan-track { display: grid; grid-template-columns: repeat(var(--weeks), minmax(0, 1fr)); gap: 2px; background: repeating-linear-gradient(90deg, #eef3f5 0 calc(100% / var(--weeks) - 2px), transparent 0 calc(100% / var(--weeks))); border-radius: 6px; min-height: 1.1rem; }
.plan-head .plan-track { background: none; }
.plan-w { font-size: .72rem; color: var(--muted); text-align: center; }
.plan-bar { background: linear-gradient(90deg, var(--accent), #14a08a); border-radius: 6px; min-height: 1.1rem; }
@media (min-width: 720px) {
  .plan-head, .plan-row { grid-template-columns: 17rem minmax(0, 1fr); align-items: center; }
}
.fig-note { margin: .8rem 0 0; font-size: .9rem; color: var(--muted); }

/* ------------------------------------------------ checklists */
.checklist { list-style: none; padding: 0 !important; margin: 1rem 0 1.4rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.checklist li.check { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .9rem; margin: 0; border-bottom: 1px solid #edf1f3; }
.checklist li.check:last-child { border-bottom: 0; }
.checklist input { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .22rem; accent-color: var(--accent); cursor: pointer; }
.checklist label { cursor: pointer; }
.checklist input:checked + label { color: var(--muted); }
.check-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: -.6rem 0 1.6rem; font-size: .9rem; }
.check-progress { color: var(--muted); margin-right: auto; }
.btn-small { font: inherit; font-size: .88rem; font-weight: 650; padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.btn-small:hover { background: var(--bg-soft); }

/* ------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 700; text-decoration: none; padding: .75rem 1.25rem; border-radius: 10px; border: 2px solid transparent; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0a6555; color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ------------------------------------------------ home */
.hero { background: radial-gradient(1200px 500px at 85% -10%, #1d6a85 0%, transparent 60%), linear-gradient(160deg, #0d3b4f 0%, #0b3242 60%, #092a38 100%); color: #e9f2f5; }
.hero-inner { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (min-width: 920px) { .hero-inner { grid-template-columns: 1.35fr 1fr; } }
.hero h1 { color: #fff; margin-top: .1em; max-width: 20ch; }
.hero p { color: #d3e3e9; font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem); max-width: 60ch; }
.hero .eyebrow { color: #8fe0cf; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-meta { font-size: .9rem !important; color: #a9c3cc !important; margin-top: 1rem; }
.hero-art { position: relative; min-height: 260px; display: none; }
@media (min-width: 920px) { .hero-art { display: block; } }
.art-card { position: absolute; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: 0 20px 40px rgba(0, 0, 0, .25); padding: 1rem 1.2rem; display: grid; gap: .5rem; }
.hero-art { min-height: 330px; }
.art-1 { width: 60%; left: 4%; top: 0; transform: rotate(-4deg); }
.art-2 { width: 62%; right: 0; top: 40%; }
.art-3 { width: 30%; left: 8%; bottom: 0; transform: rotate(3deg); }
.art-label { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.art-line { height: .55rem; border-radius: 4px; background: #e4ecef; }
.art-line.short { width: 60%; }
.art-mono { font-family: var(--mono); font-size: .9rem; color: var(--brand); }
.art-check { font-size: 1.8rem; font-weight: 900; color: #1d8a57; }

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-title { margin-top: 0; }
.needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .needs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .needs li:last-child { grid-column: 1 / -1; } }
@media (min-width: 980px) { .needs { grid-template-columns: repeat(6, minmax(0, 1fr)); } .needs li { grid-column: span 2; } .needs li:nth-child(n+4) { grid-column: span 3; } }
.need a { height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; gap: .5rem; padding: 1.3rem 1.3rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: #fff; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.need a:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.need-ico { width: 2.8rem; height: 2.8rem; border-radius: 10px; display: grid; place-items: center; background: var(--bg-tint); color: var(--accent); }
.need-ico .ico { width: 1.6rem; height: 1.6rem; }
.need-title { font-weight: 800; font-size: 1.12rem; line-height: 1.3; }
.need-desc { color: var(--ink-2); font-size: .97rem; line-height: 1.55; }
.need-go { color: var(--link); font-weight: 700; font-size: .95rem; }
.need-tools a { border-color: #b5ddd4; background: linear-gradient(180deg, #f2faf8, #fff); }
.band { background: var(--bg-soft); border-block: 1px solid var(--line); }
.feature { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }
@media (min-width: 920px) { .feature { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.feature h2 { margin-top: 0; }
.feature-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.feature-list li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.split { display: grid; gap: 1.5rem; }
@media (min-width: 920px) { .split { grid-template-columns: 1fr 1.3fr; gap: 3rem; } }
.split h2 { margin-top: 0; }
.principles h2 { margin-top: 0; }
.principles ul { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.principles li { border-top: 3px solid var(--accent); background: var(--bg-soft); padding: 1rem 1.1rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm); line-height: 1.55; }
.principles .badge { white-space: normal; }

/* ------------------------------------------------ pager, disclaimer */
.disclaimer { max-width: var(--measure); margin: 3rem 0 2rem; padding: 1rem 1.2rem; border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--ink-2); font-size: .93rem; }
.disclaimer p { margin: 0; }
.pager { max-width: var(--measure); display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pager a { display: grid; gap: .15rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 700; }
.pager a:hover { border-color: var(--accent); }
.pager span { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.pager-next { text-align: right; }

/* ------------------------------------------------ simple pages, search, 404 */
.page-simple { padding-block: 1.5rem 4rem; }
.search-form label { display: block; font-weight: 700; margin-bottom: .4rem; }
.search-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-row input { flex: 1 1 240px; min-width: 0; font: inherit; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: 10px; }
.search-row input:focus-visible { border-color: var(--focus); }
.search-status { margin: 1rem 0 .5rem; color: var(--muted); }
.search-results { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: .8rem; }
.search-results li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1.1rem; }
.search-results a { font-weight: 700; }
.search-results .sr-art { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.search-results p { margin: .3rem 0 0; font-size: .95rem; color: var(--ink-2); }
.search-results mark { background: #ffe9b3; color: inherit; padding: 0 .1em; border-radius: 3px; }
.error-page { padding-block: 4rem; }
.error-links { line-height: 2; }

/* ------------------------------------------------ footer */
.site-footer { background: #0b2c3a; color: #c9dbe1; margin-top: 2rem; font-size: .93rem; }
.footer-grid { display: grid; gap: 2rem; padding-block: 3rem; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.site-footer a { color: #e6f1f4; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; color: #fff; }
.footer-brand .logo-mark rect { fill: #fff; }
.footer-brand .logo-mark path:first-of-type { fill: #0b2c3a; }
.footer-h { font-weight: 800; color: #fff; margin-bottom: .6rem; }
.site-footer .muted { color: #9fb7c0; }

/* ------------------------------------------------ print */
@media print {
  @page { margin: 16mm 14mm; }
  body { font-size: 10.5pt; line-height: 1.45; color: #000; }
  .site-header, .site-footer, .sidebar, .toc-inline, .pager, .check-tools, .skip, .h-anchor, .hero-art, .hero-cta { display: none !important; }
  .article-layout { display: block; padding: 0; }
  .prose, .article-head, .disclaimer { max-width: none; }
  a { color: #000; }
  .prose a.ext::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
  .table-wrap { overflow: visible; border: 0; }
  table { font-size: 9pt; }
  .table-stack table { display: table; }
  tr, figure, .callout, .summary, .checklist li { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .diagram, .summary, .callout { background: none !important; }
  body.print-checklist main * { visibility: hidden; }
  body.print-checklist .print-target, body.print-checklist .print-target * { visibility: visible; }
  body.print-checklist .print-target { position: absolute; left: 0; top: 0; width: 100%; }
  .checklist input { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ------------------------------------------------ reflow przy dużym powiększeniu tekstu */
.diagram, .diagram *, .split > *, .feature > *, .hero-inner > *, .needs > li, .principles li, .footer-grid > * { min-width: 0; overflow-wrap: anywhere; }
.timeline li > *, .steps li > *, .tree li > * { min-width: 0; }
.nav-desktop ul { flex-wrap: wrap; justify-content: flex-end; }
.badge { white-space: normal; }
@media (max-width: 1280px) { .nav-desktop a { padding-inline: .5rem; } }
@media (max-width: 520px) {
  .d-answers { margin-left: .3rem; padding-left: .7rem; }
  .d-answers > li::before { left: -.7rem; width: .5rem; }
  .diagram { padding: 1rem .8rem; }
}
