:root {
  --text: #1d1d1a;
  --muted: #4a4a45;          /* 8,6:1 na białym */
  --bg: #ffffff;
  --surface: #f3f5f8;
  --line: #c9ced6;
  --primary: #1457d1;        /* 6,3:1 na białym; biały tekst na tle też 6,3:1 */
  --primary-dark: #0e43a6;
  --danger: #a4141f;         /* 7,5:1 na białym */
  --danger-bg: #fdecee;
  --ok: #1b6b34;             /* 6,3:1 na białym */
  --ok-bg: #e8f5ec;
  --accent: #ea8f00;         /* tylko dekoracja, nigdy tekst */
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; margin-top: 1.6em; } h3 { font-size: 1.1rem; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.site-header :focus-visible { outline-color: #fff; }

.skip-link {
  position: absolute; left: .5rem; top: -4rem; background: #fff; color: var(--text);
  padding: .6rem 1rem; z-index: 10; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: .5rem; }

.site-header { background: var(--text); color: #fff; border-bottom: 4px solid var(--accent); }
.site-header .inner { max-width: 72rem; margin: 0 auto; padding: .6rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.site-header nav a { color: #fff; text-decoration: none; padding: .45rem .75rem; display: inline-block; border-radius: var(--radius); }
.site-header nav a:hover { background: #3a3a35; color: #fff; }
.site-header nav a[aria-current="page"] { background: #fff; color: var(--text); font-weight: 600; }
.user-box { margin-left: auto; display: flex; gap: .75rem; align-items: center; font-size: .95rem; }
.user-box form { margin: 0; }

main { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main:focus { outline: none; }

.flash, .error-summary { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error, .error-summary { background: var(--danger-bg); color: var(--danger); }
.flash-info { background: var(--surface); }

.page-head { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.btn, button {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
  padding: .55rem 1.1rem; border-radius: var(--radius); border: 2px solid var(--primary);
  background: var(--primary); color: #fff; line-height: 1.3;
}
.btn:hover, button:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--primary); }
.btn-secondary:hover { background: var(--surface); color: var(--primary-dark); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-small { padding: .3rem .7rem; font-size: .92rem; }
.link-button { background: none; border: 0; color: inherit; text-decoration: underline; padding: 0; font-weight: 500; }
.link-button:hover { background: none; color: inherit; }
.site-header .link-button { color: #fff; }

table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
caption { text-align: left; font-weight: 600; padding-bottom: .5rem; }
th, td { text-align: left; padding: .6rem .7rem; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface); border-bottom: 2px solid var(--text); }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; white-space: nowrap; }

form .field { margin-bottom: 1.1rem; max-width: 40rem; }
label, legend { font-weight: 600; display: block; margin-bottom: .25rem; }
.hint { color: var(--muted); font-size: .92rem; margin: 0 0 .35rem; }
.field-error { color: var(--danger); font-weight: 600; margin: .3rem 0 0; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], select, textarea {
  font: inherit; width: 100%; padding: .5rem .6rem; border: 2px solid #6b7280; border-radius: var(--radius); background: #fff; color: var(--text);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
textarea { min-height: 5.5rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.check label { margin: 0; font-weight: 500; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.status { font-weight: 600; white-space: nowrap; }
.status::before { content: "● "; }
.status-assigned { color: #5b4a00; } .status-in_progress { color: var(--primary-dark); }
.status-submitted { color: #7a3e00; } .status-approved { color: var(--ok); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.card { background: var(--surface); padding: 1rem; border-radius: var(--radius); }
a.card { text-decoration: none; color: inherit; }
a.card:hover { background: #e6eaf1; color: inherit; }
.card .big { font-size: 2rem; font-weight: 700; display: block; line-height: 1.1; }

.score-row { margin: .6rem 0 1rem; max-width: 40rem; }
.score-row .label { display: flex; justify-content: space-between; font-weight: 600; }
meter { display: block; width: 100%; height: .8rem; margin-top: .25rem; appearance: none; border: 0; background: #dfe3e9; border-radius: 4px; }
meter::-webkit-meter-bar { background: #dfe3e9; border: 0; border-radius: 4px; height: .8rem; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--primary); border-radius: 4px; }
meter::-moz-meter-bar { background: var(--primary); border-radius: 4px; }

.audit-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .25rem 1.5rem; margin: 0 0 1.25rem; }
.audit-meta dt { font-weight: 600; } .audit-meta dd { margin: 0 0 .5rem; }

.criterion { background: var(--surface); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.criterion legend { font-weight: 600; padding: 0; margin-bottom: .4rem; }
.criterion .code { color: var(--muted); font-weight: 500; }
.criterion.has-problem { background: var(--danger-bg); }
.options { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .5rem 0 .8rem; }
.options .check { margin: 0; }
.files { list-style: none; padding: 0; margin: .4rem 0; }
.files li { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: .25rem; }
.note-box { border-left: 4px solid var(--accent); padding: .5rem 1rem; background: var(--surface); margin: 1rem 0; }

.login-box { max-width: 28rem; margin: 2rem auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 40rem) { .user-box { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header, .actions, .skip-link { display: none; } }

.field-wide { max-width: none; }
.filter-form { margin-bottom: 1rem; }
.filter-form select { width: auto; }
td.actions form, .actions form { margin: 0; }
.demo-users { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .5rem; }
.demo-users form { margin: 0; }
.demo-users button { width: 100%; text-align: left; }
.demo-users button .muted { color: inherit; font-weight: 400; }
.checkgroup { max-width: 40rem; }
.check-top { align-items: flex-start; margin-bottom: .6rem; }
.check-top input { margin-top: .2rem; flex: none; }
.hint.block { display: block; margin: .15rem 0 0; font-weight: 400; }
.scenario-list { margin: 0 0 1.25rem; padding-left: 1.2rem; }
.scenario-list li { margin-bottom: .4rem; }
.scenario-card { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.scenario-card h3 { margin-bottom: .4rem; }
.scenario-card .version { font-weight: 400; font-size: .95rem; }
.scenario-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .25rem 1.5rem; margin: 0 0 .75rem; }
.scenario-meta dt { font-weight: 600; } .scenario-meta dd { margin: 0 0 .4rem; }
.steps legend { font-weight: 600; margin-bottom: .3rem; }
.step-list { list-style: decimal; padding-left: 1.6rem; margin: 0; }
.step-list li { margin-bottom: .35rem; padding-left: .25rem; }
.step-list li input { margin-right: .4rem; vertical-align: -2px; }
.step-list label { display: inline; font-weight: 400; }
.filter-form .field-inline { display: flex; gap: .4rem; align-items: center; }
.filter-form label { margin: 0; }
.inline-form { display: inline; margin: 0; }
.account-link { color: #fff; }
.account-link:hover { color: #fff; }
.account-link[aria-current="page"] { font-weight: 700; }

/* Grupa „Administracja” w menu: natywny <details>, bez zależności od JavaScriptu. */
.nav-group-item { position: relative; }
.nav-group > summary {
  list-style: none; cursor: pointer; color: #fff; padding: .45rem .75rem; border-radius: var(--radius); display: inline-block;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ""; display: inline-block; margin-left: .5rem; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.nav-group[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-group > summary:hover { background: #3a3a35; }
.nav-group.is-current > summary { background: #fff; color: var(--text); font-weight: 600; }
.nav-group > ul {
  position: absolute; z-index: 20; left: 0; top: 100%; min-width: 15rem; margin: .25rem 0 0; padding: .35rem; list-style: none;
  background: var(--text); border: 2px solid #fff; border-radius: var(--radius); display: block;
}
.nav-group > ul a { display: block; padding: .5rem .75rem; white-space: nowrap; }
@media (max-width: 40rem) {
  .nav-group > ul { position: static; border-width: 0; padding: 0 0 0 .75rem; margin: 0; min-width: 0; }
}

/* Strona logowania: dekoracyjne tło (obraz CSS, bez treści dla czytników ekranu) + biała karta z formularzem,
   więc kontrast tekstu nie zależy od tła. W trybie wysokiego kontrastu przeglądarka i tak usuwa obrazy tła. */
.login-hero {
  margin: 0; padding: 3rem 1rem 5rem; min-height: calc(100vh - 8rem);
  background: #eef3fc url("/img/login-bg.svg") center / cover no-repeat;
}
/* Strona logowania zajmuje całą szerokość okna (reszta stron ma wąską kolumnę). */
main:has(> .login-hero) { max-width: none; padding: 0; }
.login-card { background: #fff; border-radius: 12px; padding: 2rem 2rem 1.75rem; margin: 0 auto; }
.login-card h1 { margin-top: 0; }
@media (min-width: 64rem) { .login-hero { padding-top: 3rem; padding-bottom: 3rem; } }
@media (max-width: 40rem) { .login-card { padding: 1.25rem; } }
@media print { .login-hero { background: none; } }

/* Edytor kroków scenariusza (src/public/js/steps-editor.js) */
.steps-editor { max-width: 40rem; margin-bottom: .75rem; }
.steps-editor-list { list-style: none; margin: 0 0 .75rem; padding: 0; }
.steps-editor-list li { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; }
.steps-editor-list .step-no { min-width: 2rem; text-align: right; font-weight: 600; color: var(--muted); }
.steps-editor-list input[type="text"] { flex: 1 1 14rem; width: auto; }
.steps-editor-list button:disabled { opacity: 1; background: #e4e7ec; border-color: #c9ced6; color: #4a4a45; cursor: not-allowed; }

/* Stopka z informacją o autorach i wersji */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.site-footer p { max-width: 72rem; margin: 0 auto; padding: 1rem; font-size: .9rem; color: var(--muted); }
.site-footer .version { white-space: nowrap; }
@media print { .site-footer { border: 0; } }

/* Oświadczenie przy logowaniu */
.declaration { max-width: 46rem; }
.declaration-text { background: var(--surface); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 1.25rem 0; }
.declaration-text p:last-child { margin-bottom: 0; }
.declaration-logout { margin-top: 1.5rem; }
.declaration-logout .link-button { color: var(--muted); }

/* Przełącznik ról w nagłówku */
.role-switch { display: flex; gap: .4rem; align-items: center; margin: 0; }
.role-switch label { color: #fff; font-size: .9rem; margin: 0; font-weight: 500; }
.role-switch select { width: auto; padding: .25rem .4rem; font-size: .9rem; border-color: #fff; }
.role-switch button { background: #fff; color: var(--text); border-color: #fff; }
.role-switch button:hover { background: #dfe3e9; color: var(--text); border-color: #dfe3e9; }
.user-box { flex-wrap: wrap; justify-content: flex-end; }

/* Role w panelu Użytkownicy */
.role-set { display: grid; gap: .3rem; }
.role-fixed { font-weight: 600; }
.check-inline { display: flex; gap: .4rem; align-items: center; font-weight: 500; margin: 0; }
.status-entered { color: #3d4a5c; }

/* Nagłówek: nawigacja po lewej, zwarta strefa konta po prawej (jeden rząd na szerokich ekranach; na węższych: logo i konto w pierwszym rzędzie, menu pod spodem). */
.site-header .inner { gap: .4rem 1rem; }
.site-header .brand { order: 1; }
.site-header nav { order: 3; flex: 1 1 100%; }
.site-header .user-box { order: 2; margin-left: auto; flex-wrap: wrap; gap: .4rem .9rem; justify-content: flex-end; }
.site-header .role-switch { gap: .4rem; }
.site-header .role-switch select { max-width: 14rem; }
@media (min-width: 90rem) {
  .site-header .inner { max-width: 96rem; flex-wrap: nowrap; }
  .site-header nav { order: 2; flex: 1 1 auto; min-width: 0; }
  .site-header .user-box { order: 3; flex-shrink: 0; flex-wrap: nowrap; }
}
@media (max-width: 40rem) { .site-header .user-box { margin-left: auto; } }
.accept-box { border-left: 4px solid var(--accent); background: var(--surface); padding: .75rem 1rem; margin: 1rem 0; }
.accept-box h2 { margin-top: 0; }


/* Logowanie kontem zewnętrznym: osobny, skupiony ekran z dwoma krokami. */
.step-label { margin: 0 0 .25rem; color: var(--muted); font-size: .95rem; font-weight: 600; }
.ext-form .field input, .login-card #code { font-size: 1.1rem; padding: .65rem .75rem; }
.login-card #code { letter-spacing: .3em; max-width: 12rem; }
.ext-form button[type="submit"], .login-card form[action="/login/verify"] button[type="submit"] { width: 100%; padding: .75rem 1rem; font-size: 1.05rem; }
.login-back { margin: 1.25rem 0 0; }

/* Karta logowania wyśrodkowana w poziomie i w pionie. */
.login-hero { display: flex; align-items: center; justify-content: center; }
.login-hero > .login-card { width: 100%; max-width: 34rem; margin: 0 auto; }

/* Strona audytu: nagłówek z etapami, układ z panelem informacji i zwijane kategorie kryteriów. */
.audit-hero { margin: 0 0 1.25rem; }
.audit-hero .eyebrow { margin: 0; color: var(--muted); font-weight: 600; font-size: .95rem; }
.audit-hero .page-head { margin-bottom: .75rem; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; counter-reset: none; }
.step { display: flex; align-items: center; gap: .6rem; background: var(--surface); color: var(--text); padding: .6rem .75rem; border-radius: var(--radius); }
.step-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #fff; color: var(--text); font-weight: 700; font-size: .9rem; }
.step-done .step-num { background: var(--ok); color: #fff; }
.step-current { background: var(--primary); color: #fff; font-weight: 700; }
.step-current .step-num { background: #fff; color: var(--primary); }
.step-todo { color: var(--muted); }
.audit-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.audit-side { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.1rem; }
.audit-side .side-h { margin: 0 0 .5rem; font-size: 1.05rem; }
.audit-side .audit-meta { grid-template-columns: 1fr; margin: 0 0 .75rem; }
.progress-box label { display: block; font-weight: 600; margin-bottom: .3rem; }
.progress-box progress { width: 100%; height: .9rem; accent-color: var(--primary); }
@media (min-width: 64rem) {
  .audit-layout { grid-template-columns: minmax(0, 1fr) 19rem; }
  .audit-main { grid-column: 1; grid-row: 1; }
  .audit-side { grid-column: 2; grid-row: 1; position: sticky; top: 1rem; }
}
.cat { margin: 0 0 1.25rem; }
.cat > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; list-style: none; background: var(--text); color: #fff; padding: .6rem .9rem; border-radius: var(--radius); font-weight: 700; margin-bottom: .75rem; }
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary::after { content: ""; flex: none; width: .5rem; height: .5rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cat[open] > summary::after { transform: rotate(-135deg); }
.cat > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cat-count { margin-left: auto; font-weight: 500; }
.save-bar { position: sticky; bottom: 0; background: #fff; padding: .75rem 0; align-items: center; z-index: 5; box-shadow: 0 -6px 12px -8px rgba(0, 0, 0, .25); }
.save-progress { margin-right: auto; font-weight: 600; }
.decline-box { margin-top: 1rem; }
.decline-box > summary { cursor: pointer; font-weight: 600; color: var(--danger); width: fit-content; }
.decline-box form { margin-top: .75rem; }


.edit-box > summary { cursor: pointer; font-weight: 600; width: fit-content; }
.edit-box form { margin-top: .75rem; }
.decline-section { margin: 1rem 0; }
.reg-code { font-size: 2.6rem; font-weight: 300; letter-spacing: .35em; margin: .5rem 0; }

.login-help { margin-top: 1.25rem; }
.login-help > summary { cursor: pointer; font-weight: 700; color: #0e43a6; width: fit-content; }
.login-help > summary:focus-visible { outline: 3px solid #1d1d1a; outline-offset: 3px; }
.login-help h3 { font-size: 1rem; margin: 1rem 0 .3rem; }
.login-help ol { margin: 0 0 .5rem; padding-left: 1.4rem; }

/* ===== Wygląd aplikacji spójny z logowaniem: granatowy pasek z logo, nawigacja z wyraźnym stanem aktywnym, karty. ===== */
.site-header { background: #1457d1; border-bottom: 4px solid var(--accent); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.15rem; letter-spacing: -.01em; }
.brand .logo-mark { flex: none; }
.site-header nav a:hover, .nav-group > summary:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.site-header nav a[aria-current="page"], .nav-group.is-current > summary { background: #fff; color: #0e43a6; font-weight: 700; }
.nav-group > ul { background: #0e2f73; }
.nav-group > ul a:hover { background: rgba(255, 255, 255, .14); }
.lead { margin: .25rem 0 0; color: var(--muted); font-size: 1.05rem; }
.empty { background: var(--surface); padding: 1rem 1.1rem; border-radius: 10px; margin: 0 0 1rem; }
.cards { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.card { border-radius: 10px; color: var(--text); text-decoration: none; display: block; }
a.card:hover, a.card:focus-visible { background: #1457d1; color: #fff; }
a.card:hover .big, a.card:focus-visible .big { color: #fff; }
.card .big { color: #0e43a6; }
h2 { margin-top: 2rem; }
.table-wrap { border-radius: 10px; }

/* ===== Portal: biały pasek z logo i przyciskiem „Menu”, pulpit z bannerem, kafelkami „Aplikacje” i panelem komunikatów. ===== */
.site-header { background: #fff; color: var(--text); border-bottom: 3px solid #1457d1; }
.site-header :focus-visible { outline-color: #1457d1; }
.site-header .inner { max-width: 72rem; flex-wrap: nowrap; padding: .55rem 1rem; gap: 1rem; }
.brand { color: #0e43a6; font-weight: 700; font-size: 1.2rem; display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; }
.brand .logo-mark { color: #1457d1; flex: none; }
.user-box { margin-left: auto; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
.account-link { color: #0e43a6; display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-decoration: none; }
.account-link:hover { text-decoration: underline; }
.account-link[aria-current="page"] { text-decoration: underline; }
.site-header .link-button { color: #0e43a6; }
.role-switch select { border-color: #5b6472; background: #fff; color: var(--text); }
.role-switch button { background: #fff; color: #0e43a6; border-color: #1457d1; }
.role-switch button:hover { background: #e8f0fd; color: #0e43a6; }
.main-menu { position: relative; }
.menu-btn { list-style: none; cursor: pointer; background: #1457d1; color: #fff; font-weight: 700; padding: .55rem 1rem; border-radius: 4px; display: inline-flex; align-items: center; gap: .5rem; }
.menu-btn::-webkit-details-marker { display: none; }
.menu-btn::after { content: ""; width: .5rem; height: .5rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.main-menu[open] > .menu-btn::after { transform: translateY(1px) rotate(-135deg); }
.menu-btn:hover { background: #0e43a6; }
.menu-btn:focus-visible { outline: 3px solid #1d1d1a; outline-offset: 2px; }
.menu-panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30; width: min(46rem, 92vw); background: #fff; color: var(--text); border: 2px solid #1457d1; border-radius: 6px; padding: 1rem 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem 1.5rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.menu-group h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .35rem; }
.menu-group ul { list-style: none; margin: 0; padding: 0; }
.menu-group a { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 4px; color: #0e43a6; text-decoration: none; font-weight: 600; }
.menu-group a:hover { background: #e8f0fd; }
.menu-group a[aria-current="page"] { background: #1457d1; color: #fff; }
.menu-group .icon { flex: none; }
.menu-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: .75rem; }
.menu-foot form { margin: 0; }
.menu-foot .link-button { color: #0e43a6; font-weight: 600; }
.nav-group { display: none; }

.portal-hero { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); background: #1457d1; color: #fff; margin: -1.5rem -1rem 1.5rem; padding: 2rem 1rem;
  background-image: radial-gradient(circle at 8% 120%, rgba(255, 255, 255, .13) 0 16rem, transparent 16.05rem), radial-gradient(circle at 100% -20%, rgba(234, 143, 0, .5) 0 8rem, transparent 8.05rem); }
.portal-hero h1 { margin: 0 0 .25rem; font-size: 2rem; color: #fff; }
.portal-hero p { color: #fff; margin: 0 0 .5rem; }
.portal-lead { font-size: 1.25rem; }
.portal-card { background: #0e43a6; padding: 1.1rem 1.25rem; align-self: start; }
.portal-card h2 { margin: 0 0 .5rem; font-size: 1rem; color: #fff; }
.portal-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.portal-card-actions form { margin: 0; }
.portal-hero .btn { border-radius: 0; font-weight: 700; }
.btn-light { background: #fff; color: #0e43a6; border: 2px solid #fff; }
.btn-light:hover { background: #e8f0fd; color: #0e43a6; border-color: #e8f0fd; }
.btn-ghost { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.portal-hero :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (min-width: 56rem) { .portal-hero { grid-template-columns: minmax(0, 1fr) 21rem; align-items: center; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding: 2.5rem max(1rem, calc((100vw - 72rem) / 2 + 1rem)); } }

.portal-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) { .portal-grid { grid-template-columns: minmax(0, 1fr) 20rem; } }
.portal-h { font-size: 1rem; text-transform: none; border-bottom: 2px solid var(--line); padding-bottom: .4rem; margin: 0 0 .9rem; color: var(--muted); font-weight: 600; }
.app-tiles { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); }
.app-tile { display: flex; align-items: center; gap: .9rem; height: 100%; padding: 1rem; background: #fff; border: 1px solid #5b6472; border-radius: 4px; color: #0e43a6; text-decoration: none; }
.app-tile .icon { flex: none; color: #1457d1; }
.app-tile-name { display: block; font-weight: 700; font-size: 1.05rem; }
.app-tile-desc { display: block; font-size: .88rem; color: #3a3a35; margin-top: .15rem; }
.app-tile:hover, .app-tile:focus-visible { background: #1457d1; color: #fff; }
.app-tile:hover .icon, .app-tile:focus-visible .icon, .app-tile:hover .app-tile-desc, .app-tile:focus-visible .app-tile-desc { color: #fff; }
.app-tile:focus-visible { outline: 3px solid #1d1d1a; outline-offset: 2px; }
.notices { list-style: none; margin: 0; padding: 0; border: 1px solid #5b6472; border-radius: 4px; background: #fff; }
.notices li { padding: .8rem 1rem; display: grid; gap: .15rem; }
.notices li + li { border-top: 1px solid var(--line); }
.notice-title { font-weight: 700; font-size: 1.02rem; color: #0e43a6; }
.notice-meta { font-size: .9rem; color: #3a3a35; }
.lead { display: none; }

body { overflow-x: clip; }


/* ===== Logowanie w układzie „centralnego punktu logowania”: logo na środku, niebieski pas z tytułem, biała karta z formularzem
   po lewej i panelem informacji po prawej. Biały tekst na #1457d1 ma kontrast 6,3:1, ciemny tekst na bieli i jasnoszarym ≥ 12:1. ===== */
body:has(.login-top) { background: #f5f5f5; }
body:has(.login-top) .site-header { display: none; }
main:has(> .login-top) { max-width: none; padding: 0 0 2rem; }
.login-top { text-align: center; padding: 1.5rem 1rem 1.1rem; color: #0e43a6; }
.login-top .logo-mark { width: 3.5rem; height: 3.5rem; color: #1457d1; }
.login-top-name { margin: .25rem 0 0; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; color: #0e43a6; }
.login-band { background: #1457d1; color: #fff; text-align: center; padding: 1.6rem 1rem 1.4rem; }
.login-band h1, .login-band .band-title { margin: 0; color: #fff; font-size: 1.9rem; font-weight: 700; letter-spacing: .03em; }
.login-band p { margin: .4rem 0 0; color: #fff; }
.login-hero { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 64rem; margin: 2rem auto 1rem; padding: 0; min-height: 0; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .12); background-image: none; gap: 0; }
@media (min-width: 52rem) { .login-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.login-hero > .login-card { max-width: none; width: auto; margin: 0; padding: 2rem 1.5rem; background: #fff; border-radius: 0; justify-self: stretch; align-self: start; }
@media (min-width: 52rem) { .login-hero > .login-card { padding: 2.5rem 2.5rem 2.25rem; } }
.login-info { background: #f3f5f8; padding: 2rem 1.5rem; color: #1d1d1a; }
@media (min-width: 52rem) { .login-info { padding: 2.5rem 2.25rem; } }
.login-info .info-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.login-info .info-i { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: #ffb900; color: #1d1d1a; font: italic 700 1.7rem Georgia, serif; }
.login-info h2 { margin: 0; font-size: 1.45rem; line-height: 1.25; color: #3a3a35; }
.login-info h3 { font-size: 1.05rem; margin: 1.25rem 0 .3rem; }
.login-info p { margin: 0 0 .8rem; color: #1d1d1a; }
.login-card .field label { font-weight: 700; color: #3a3a35; }
.login-card input[type="email"], .login-card input[type="password"], .login-card input[type="text"], .login-card input[type="tel"] { border: 1px solid #5b6472; border-radius: 0; background: #fff; padding: .7rem .6rem; }
.login-card input:focus-visible { outline: 3px solid #1457d1; outline-offset: 2px; border-color: #1457d1; }
.login-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1rem; }
.login-card button[type="submit"], .login-card button[type="reset"], .login-card .btn { border-radius: 0; font-weight: 700; padding: .7rem 1.4rem; text-transform: none; letter-spacing: 0; }
.login-card button[type="submit"] { background: #1457d1; color: #fff; border: 2px solid #1457d1; }
.login-card button[type="submit"]:hover { background: #0e43a6; border-color: #0e43a6; }
.login-card button[type="reset"], .login-card .btn-outline { background: #fff; color: #0e43a6; border: 2px solid #1457d1; }
.login-card button[type="reset"]:hover, .login-card .btn-outline:hover { background: #e8f0fd; color: #0e43a6; }
.login-card .btn-outline { display: inline-block; text-align: center; text-decoration: none; min-width: 16rem; }
.login-card a { color: #0e43a6; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.login-card a.btn-outline { text-decoration: none; }
.login-card .login-sep { border: 0; border-top: 1px solid var(--line); margin: 1.75rem 0 1.25rem; }
.login-card h2 { font-size: 1rem; text-transform: none; letter-spacing: 0; margin: 0 0 .6rem; color: #3a3a35; }
.login-card .small { font-size: .9rem; color: #3a3a35; margin: .5rem 0 0; }
.login-card .step-label { color: #0e43a6; font-weight: 700; margin: 0 0 .25rem; }
.login-card h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
.login-card button:focus-visible, .login-card a:focus-visible, .login-help > summary:focus-visible { outline: 3px solid #1d1d1a; outline-offset: 2px; box-shadow: none; }
.login-card .error-summary { border-radius: 0; border-left: 6px solid #a4141f; }
.login-back { margin: 1.25rem 0 0; }
@media print { .login-top, .login-info { display: none; } }

/* ===== Okno audytu w stylu portalu: niebieski baner na całą szerokość z tytułem, przyciskami i etapami. Biały tekst na #1457d1 6,3:1, na #0e43a6 8,4:1. ===== */
.audit-hero { background: #1457d1; color: #fff; margin: -1.5rem -1rem 1.5rem; padding: 1.5rem 1rem 1.4rem;
  background-image: radial-gradient(circle at 6% 130%, rgba(255, 255, 255, .13) 0 15rem, transparent 15.05rem), radial-gradient(circle at 102% -20%, rgba(234, 143, 0, .5) 0 7rem, transparent 7.05rem); }
@media (min-width: 56rem) { .audit-hero { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding-left: max(1rem, calc((100vw - 72rem) / 2 + 1rem)); padding-right: max(1rem, calc((100vw - 72rem) / 2 + 1rem)); } }
.audit-hero .eyebrow { color: #fff; font-weight: 600; margin: 0 0 .25rem; }
.audit-hero h1 { color: #fff; margin: 0; font-size: 1.9rem; }
.audit-hero .btn { border-radius: 0; font-weight: 700; }
.audit-hero .btn-secondary { background: transparent; color: #fff; border: 2px solid #fff; }
.audit-hero .btn-secondary:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.audit-hero .btn-danger { background: #fff; color: #a4141f; border: 2px solid #fff; }
.audit-hero .btn-danger:hover { background: #fdecee; color: #a4141f; }
.audit-hero :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.audit-hero .stepper { gap: .4rem; }
.audit-hero .step { background: #0e43a6; color: #fff; border-radius: 0; }
.audit-hero .step-num { background: transparent; color: #fff; border: 2px solid #fff; }
.audit-hero .step-done .step-num { background: #1b6b34; border-color: #1b6b34; }
.audit-hero .step-current { background: #fff; color: #0e43a6; font-weight: 700; }
.audit-hero .step-current .step-num { background: #1457d1; border-color: #1457d1; color: #fff; }
.audit-hero .step-todo { color: #fff; }
.audit-side { border-radius: 4px; }
.cat > summary { background: #0e43a6; border-radius: 0; }
.criterion { border-radius: 4px; }
.save-bar { border-top: 3px solid #1457d1; }
.archive-actions { margin-bottom: 1rem; }
