/* ==========================================================================
   NaviAble - dostępna wersja strony.
   Warstwa wizualna oparta o Pure.css (reset, siatka, przyciski, menu, tabele)
   plus 5 motywów czytelnych dla seniorów i osób słabowidzących.
   Zasady: kontrast >= 4.5:1, focus 4px/2px, płynna typografia.
   ========================================================================== */

/* --- Zmienne bazowe (nadpisywane przez motywy) ---------------------------- */
.accessible-body {
  --a-bg: #ffffff;
  --a-text: #16202e;
  --a-muted: #475569;
  --a-accent: #1d4ed8;
  --a-accent-text: #ffffff;
  --a-link: #173ea5;
  --a-border: #d9e1ee;
  --a-header-bg: #f5f8fc;
  --a-nav-bg: #ffffff;
  --a-soft: #eef3fb;
  --a-radius: 10px;
  --a-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --a-font-heading: var(--a-font);
  --a-size: 1.0625rem;
  --a-line: 1.7;

  margin: 0;
  background: var(--a-bg);
  color: var(--a-text);
  font-family: var(--a-font);
  font-size: var(--a-size);
  line-height: var(--a-line);
}

/* --- Motywy --------------------------------------------------------------- */
.theme-classic {
  --a-bg: #ffffff;
  --a-text: #16202e;
  --a-muted: #475569;
  --a-accent: #1d4ed8;
  --a-link: #173ea5;
  --a-border: #d9e1ee;
  --a-header-bg: #f5f8fc;
  --a-soft: #eef3fb;
}

.theme-warm {
  --a-bg: #fbf7ef;
  --a-text: #2b2118;
  --a-muted: #5c4a3a;
  --a-accent: #7a3e12;
  --a-accent-text: #ffffff;
  --a-link: #8a3d0c;
  --a-border: #e3d6c2;
  --a-header-bg: #f4ebdc;
  --a-soft: #f1e7d6;
  --a-radius: 8px;
  --a-font-heading: Georgia, "Times New Roman", "DejaVu Serif", serif;
}

.theme-contrast {
  --a-bg: #000000;
  --a-text: #ffffff;
  --a-muted: #e6e6e6;
  --a-accent: #ffd400;
  --a-accent-text: #000000;
  --a-link: #ffd400;
  --a-border: #ffffff;
  --a-header-bg: #000000;
  --a-nav-bg: #000000;
  --a-soft: #1a1a1a;
  --a-radius: 0;
}

.theme-calm {
  --a-bg: #eef3f7;
  --a-text: #1f2d3d;
  --a-muted: #3f5368;
  --a-accent: #0e7490;
  --a-accent-text: #ffffff;
  --a-link: #0b5f75;
  --a-border: #cbdae6;
  --a-header-bg: #e3edf4;
  --a-soft: #dfeaf2;
}

.theme-large {
  --a-bg: #ffffff;
  --a-text: #111827;
  --a-muted: #374151;
  --a-accent: #1d4ed8;
  --a-link: #173ea5;
  --a-border: #c9d4e4;
  --a-header-bg: #f0f5fc;
  --a-soft: #e8f0fb;
  --a-size: 1.3rem;
  --a-line: 1.85;
}

/* --- Siatka --------------------------------------------------------------- */
.a-container {
  width: min(100% - 2.5rem, 900px);
  margin-inline: auto;
}

/* --- Pasek narzędzi ------------------------------------------------------- */
.a-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0b1220;
  color: #e6edf7;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.theme-contrast .a-bar {
  background: #000;
  border-bottom: 2px solid #fff;
}

.a-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  padding-block: 0.7rem;
  width: min(100% - 2.5rem, 1140px);
}

.a-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.a-brand__able {
  color: #7dd3fc;
}

.a-brand__tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b6c4da;
  border-left: 1px solid rgb(255 255 255 / 25%);
  padding-left: 0.5rem;
}

.a-bar__tools {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- Przyciski (nakładka na Pure) ----------------------------------------- */
.a-btn.pure-button {
  border-radius: var(--a-radius);
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  background: #fff;
  color: #0b1220;
}

.a-btn.pure-button:hover,
.a-btn.pure-button:focus {
  background: #e8efff;
}

.a-btn--ghost.pure-button {
  background: transparent;
  color: #e6edf7;
  border-color: rgb(255 255 255 / 35%);
}

.a-btn--ghost.pure-button:hover,
.a-btn--ghost.pure-button:focus {
  background: rgb(255 255 255 / 12%);
}

.a-btn--primary.pure-button {
  background: var(--a-accent);
  color: var(--a-accent-text);
}

.a-btn--primary.pure-button:hover,
.a-btn--primary.pure-button:focus {
  filter: brightness(0.94);
}

/* --- Przełącznik motywów -------------------------------------------------- */
.a-themes {
  padding-bottom: 0.55rem;
}

.a-themes nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
}

.a-themes__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b6c4da;
}

.a-themes__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-themes__list li {
  margin: 0;
}

.a-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 30%);
  color: #dbe4f0;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.a-theme:hover {
  background: rgb(255 255 255 / 12%);
  color: #fff;
}

.a-theme.is-active {
  background: #fff;
  color: #0b1220;
  border-color: #fff;
}

.a-theme:focus-visible {
  outline: 4px solid #93c5fd;
  outline-offset: 2px;
}

.a-theme__dot {
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  border: 1px solid rgb(0 0 0 / 25%);
}

.a-theme__dot--classic { background: #1d4ed8; }
.a-theme__dot--warm { background: #7a3e12; }
.a-theme__dot--contrast { background: #ffd400; }
.a-theme__dot--calm { background: #0e7490; }
.a-theme__dot--large { background: #111827; }

/* --- Nagłówek dokumentu --------------------------------------------------- */
.a-header {
  padding-block: 2.6rem 1.5rem;
  background: var(--a-header-bg);
  border-bottom: 1px solid var(--a-border);
}

.a-header h1 {
  margin: 0.35rem 0 0;
  font-family: var(--a-font-heading);
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--a-text);
}

.theme-large .a-header h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
}

.a-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-link);
}

.a-lead {
  margin: 0.9rem 0 0;
  max-width: 68ch;
  color: var(--a-muted);
  font-size: 1.05em;
}

/* --- Nawigacja: dostępne menu rozwijane (natywny details/summary) --------- */
.a-nav {
  background: var(--a-nav-bg);
  border-bottom: 1px solid var(--a-border);
  padding-block: 0.9rem;
}

.a-nav__details {
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
}

.a-nav__summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--a-font-heading);
  font-size: 1.02em;
  font-weight: 700;
  color: var(--a-text);
  border-radius: var(--a-radius);
}

/* Ukrycie domyślnego markera i własna strzałka (dekoracyjna). */
.a-nav__summary::-webkit-details-marker {
  display: none;
}

.a-nav__summary::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s ease;
}

.a-nav__details[open] .a-nav__summary::before {
  transform: rotate(90deg);
}

.a-nav__summary:hover {
  background: rgb(0 0 0 / 4%);
}

.theme-contrast .a-nav__summary:hover {
  background: #1a1a1a;
}

.a-nav__summary:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: -4px;
  border-radius: var(--a-radius);
}

.a-nav__count {
  font-weight: 500;
  font-size: 0.9em;
  color: var(--a-muted);
}

.a-nav__hint {
  margin: 0 1rem 0.4rem;
  font-size: 0.85em;
  color: var(--a-muted);
}

/* Przewijany region: długa lista nie wydłuża strony. */
.a-nav__scroll {
  max-height: clamp(16rem, 55vh, 32rem);
  overflow-y: auto;
  border-top: 1px solid var(--a-border);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--a-muted) transparent;
}

.a-nav__scroll::-webkit-scrollbar {
  width: 10px;
}

.a-nav__scroll::-webkit-scrollbar-thumb {
  background: var(--a-border);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.a-nav__scroll:hover::-webkit-scrollbar-thumb {
  background: var(--a-muted);
  background-clip: content-box;
}

.a-nav__scroll:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: -4px;
}

.a-nav__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 2rem;
  margin: 0;
  padding: 0.6rem 1rem 1rem;
  list-style: none;
}

.a-nav__list li {
  margin: 0;
  padding: 0;
}

.a-nav__list a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  max-width: 100%;
  padding: 0.12rem 0;
  color: var(--a-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.a-nav__list a > span {
  overflow-wrap: anywhere;
}

.a-nav__icon {
  width: 1.35em;
  height: 1.35em;
  flex: none;
  object-fit: contain;
  border-radius: 3px;
}

.a-nav__list a:hover {
  color: var(--a-text);
}

.a-nav__list a:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Treść ---------------------------------------------------------------- */
.a-main {
  padding-block: 2rem 3.5rem;
}

.a-prose {
  max-width: 74ch;
  overflow-wrap: break-word;
}

.a-prose :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--a-font-heading);
  color: var(--a-text);
  line-height: 1.25;
  margin: 1.8em 0 0.5em;
}

.a-prose h2 {
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
}

.a-prose h3 {
  font-size: clamp(1.2rem, 1.05rem + 0.6rem, 1.45rem);
}

.a-prose p,
.a-prose li {
  font-size: 1em;
}

.a-prose p {
  margin: 0 0 1em;
}

.a-prose ul,
.a-prose ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}

.a-prose li {
  margin-bottom: 0.35em;
}

.a-prose a {
  color: var(--a-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-weight: 600;
}

.a-prose a:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.a-prose img {
  margin: 1.2em 0;
  border-radius: var(--a-radius);
  border: 1px solid var(--a-border);
  height: auto;
}

.a-prose blockquote {
  margin: 1.2em 0;
  padding: 0.6em 1.1em;
  border-left: 4px solid var(--a-accent);
  background: var(--a-soft);
  color: var(--a-text);
}

.a-prose table.pure-table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  border: 1px solid var(--a-border);
  font-size: 0.98em;
}

.a-prose table.pure-table :where(th, td) {
  border: 1px solid var(--a-border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.a-prose table.pure-table thead th {
  background: var(--a-soft);
  color: var(--a-text);
}

.a-prose pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--a-radius);
  background: #0b1220;
  color: #e6edf7;
}

.a-prose code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.92em;
}

.a-prose :not(pre) > code {
  background: var(--a-soft);
  color: var(--a-text);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.a-prose hr {
  border: 0;
  border-top: 1px solid var(--a-border);
  margin: 2em 0;
}

/* --- Stopka --------------------------------------------------------------- */
.a-footer {
  padding-block: 2rem;
  background: var(--a-header-bg);
  border-top: 1px solid var(--a-border);
  color: var(--a-muted);
  font-size: 0.95em;
}

.a-note {
  padding-block: 1.5rem;
  border-top: 1px solid var(--a-border);
  background: var(--a-bg);
}

.a-note p {
  margin: 0;
  color: var(--a-muted);
  font-size: 0.92em;
}

.a-note a {
  color: var(--a-link);
}

/* --- Formularz narzędzia (Pure form) -------------------------------------- */
.a-hero {
  padding-block: 4rem 3rem;
}

.a-hero h1 {
  margin: 0.4rem 0 0;
  color: #fff;
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.a-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fff;
  color: #0b1220;
  border-radius: 12px;
  box-shadow: 0 30px 60px -30px rgb(15 23 42 / 35%);
  max-width: 640px;
}

.a-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
  color: #0b1220;
}

.a-form input[type="text"],
.a-form input[type="url"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: #0b1220;
  border: 2px solid #b8c4d8;
  border-radius: 8px;
  background: #fff;
}

.a-form input:focus-visible {
  outline: 4px solid #1d4ed8;
  outline-offset: 2px;
  border-color: #1d4ed8;
}

.a-form input[aria-invalid="true"] {
  border-color: #b91c1c;
}

.a-form__row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.a-form__row input {
  flex: 1 1 320px;
}

.a-form__error {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #fdeaea;
  color: #b91c1c;
  font-weight: 600;
}

.a-form__hint {
  margin: 0.7rem 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.a-form code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.88em;
  background: #eaf0f9;
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

/* --- Responsywność -------------------------------------------------------- */
@media (max-width: 620px) {
  .a-bar__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .a-brand__tag {
    display: none;
  }

  .a-container {
    width: min(100% - 1.6rem, 900px);
  }

  .a-nav__list {
    grid-template-columns: 1fr;
  }

  .a-nav__scroll {
    max-height: 50vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .a-nav__summary::before {
    transition: none;
  }
}

/* --- Skróty obrazkowe (banery, kafle) ------------------------------------- */
.a-quick {
  background: var(--a-nav-bg);
  border-bottom: 1px solid var(--a-border);
  padding-block: 0.9rem 1.1rem;
}

.a-quick__title {
  margin: 0 0 0.6rem;
  font-family: var(--a-font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}

.a-quick__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-quick__list li {
  margin: 0;
}

.a-quick__list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  color: var(--a-link);
  font-weight: 600;
  text-decoration: none;
  height: 100%;
  box-sizing: border-box;
}

.a-quick__list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.a-quick__list a:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
}

.a-quick__icon {
  width: 32px;
  height: 32px;
  flex: none;
  object-fit: contain;
}

@media (max-width: 620px) {
  .a-quick__list {
    grid-template-columns: 1fr;
  }
}

/* --- Komunikat o nieczytelnej treści -------------------------------------- */
.a-empty {
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  border: 2px solid var(--a-accent);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  color: var(--a-text);
}

.a-empty p {
  margin: 0 0 0.6rem;
}

.a-empty__actions {
  margin: 0 !important;
}

.a-embed {
  margin: 1em 0;
  padding: 0.6em 0.9em;
  border-left: 4px solid var(--a-accent);
  background: var(--a-soft);
}

/* --- Dostępna galeria zdjęć ----------------------------------------------- */
.a-gallery {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--a-border);
}

.a-gallery__title {
  margin: 0 0 1rem;
  font-family: var(--a-font-heading);
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  color: var(--a-text);
}

.a-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-gallery__grid li {
  margin: 0;
}

.a-gallery__item {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
}

.a-gallery__link {
  display: block;
  border-radius: var(--a-radius);
  overflow: hidden;
  background: var(--a-soft);
}

.a-gallery__link img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.a-gallery__link:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
}

.a-gallery__caption {
  padding: 0.5rem 0 0;
  font-size: 0.9em;
  color: var(--a-muted);
}

.theme-contrast .a-gallery__caption {
  color: var(--a-text);
}

@media (max-width: 480px) {
  .a-gallery__grid {
    grid-template-columns: 1fr;
  }
}

/* --- Dostępna sekcja wideo ------------------------------------------------- */
.a-videos {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--a-border);
}

.a-videos__title {
  margin: 0 0 1rem;
  font-family: var(--a-font-heading);
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  color: var(--a-text);
}

.a-videos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a-videos__grid li {
  margin: 0;
}

.a-video {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  overflow: hidden;
  background: var(--a-soft);
}

.a-video__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.a-video__title {
  margin: 0.8rem 1rem 0.3rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

.a-video__title a {
  color: var(--a-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.a-video__title a:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
}

.a-video__desc {
  margin: 0 1rem 0.6rem;
  color: var(--a-muted);
  font-size: 0.92em;
}

.a-video__action {
  margin: auto 1rem 1rem;
}

@media (max-width: 480px) {
  .a-videos__grid {
    grid-template-columns: 1fr;
  }
}

/* --- Ustawienia czytania -------------------------------------------------- */
.accessible-body {
  font-size: calc(var(--a-size) * var(--a-user-scale, 1));
  line-height: calc(var(--a-line) * var(--a-user-line, 1));
}

.a-reading {
  padding-bottom: 0.5rem;
}

.a-reading details {
  border-top: 1px solid rgb(255 255 255 / 12%);
  padding-top: 0.35rem;
}

.a-reading summary {
  padding: 0.4rem 0;
  color: #dbe4f0;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

.a-reading summary:focus-visible {
  outline: 4px solid #93c5fd;
  outline-offset: 2px;
}

.a-reading__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  padding: 0.4rem 0 0.7rem;
}

.a-reading__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.a-reading__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b6c4da;
}

.a-tool {
  padding: 0.3rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 999px;
  background: transparent;
  color: #dbe4f0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.a-tool:hover {
  background: rgb(255 255 255 / 12%);
}

.a-tool[aria-pressed="true"] {
  background: #fff;
  color: #0b1220;
  border-color: #fff;
}

.a-tool:focus-visible {
  outline: 4px solid #93c5fd;
  outline-offset: 2px;
}

.a-reading__status {
  width: 100%;
  margin: 0;
  color: #b6c4da;
  font-size: 0.82rem;
}

/* Preferencje czytelnika (klasy na <body>) */
.pref-underline :where(.a-prose, .a-nav__list, .a-quick__list, .a-toc) a {
  text-decoration: underline !important;
}

.pref-hide-images img {
  display: none !important;
}

.pref-dyslexia {
  --a-font: Verdana, Tahoma, "Trebuchet MS", sans-serif;
  --a-font-heading: Verdana, Tahoma, "Trebuchet MS", sans-serif;
  letter-spacing: 0.02em;
  word-spacing: 0.12em;
}

.pref-focus :where(.a-nav, .a-quick, .a-footer, .a-note, .a-gallery, .a-videos) {
  display: none !important;
}

/* --- Spis treści ---------------------------------------------------------- */
.a-toc {
  margin-bottom: 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
}

.a-toc__title {
  margin: 0 0 0.5rem;
  font-family: var(--a-font-heading);
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--a-text);
}

.a-toc__list {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
}

.a-toc__item {
  margin: 0 0 0.25rem;
  break-inside: avoid;
}

.a-toc__item--h3 {
  margin-left: 1rem;
}

.a-toc__item--h4 {
  margin-left: 2rem;
}

.a-toc a {
  color: var(--a-link);
  text-underline-offset: 0.18em;
}

@media (max-width: 620px) {
  .a-toc__list {
    columns: 1;
  }
}

/* --- Druk ----------------------------------------------------------------- */
@media print {
  .a-bar,
  .a-nav,
  .a-quick,
  .a-toc,
  .a-report,
  .a-note,
  .a-footer,
  .a-empty__actions,
  .a-video__action {
    display: none !important;
  }

  .accessible-body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
  }

  .a-header,
  .a-main {
    padding: 0;
    border: 0;
    background: #fff;
  }

  .a-prose a {
    color: #000;
    text-decoration: underline;
  }

  .a-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .a-videos__grid {
    display: none;
  }
}

/* --- Zgłaszanie problemów -------------------------------------------------- */
.a-report {
  padding-block: 1.2rem;
  border-top: 1px solid var(--a-border);
  background: var(--a-bg);
}

.a-report details {
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  padding: 0.2rem 1rem;
}

.a-report summary {
  cursor: pointer;
  padding: 0.7rem 0;
  font-weight: 700;
  color: var(--a-text);
}

.a-report summary:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.a-report__form {
  display: grid;
  gap: 0.4rem;
  max-width: 620px;
  padding: 0.4rem 0 1rem;
}

.a-report__form label {
  font-weight: 650;
  color: var(--a-text);
}

.a-report__form select,
.a-report__form textarea,
.a-report__form input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--a-text);
  background: var(--a-bg);
  border: 2px solid var(--a-border);
  border-radius: var(--a-radius);
}

.a-report__form :focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
}

.a-report__form button {
  justify-self: start;
  margin-top: 0.4rem;
}

.a-report__msg {
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--a-radius);
  font-weight: 600;
}

.a-report__msg--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.a-report__msg--error {
  background: var(--danger-soft);
  color: var(--danger);
}

.a-cache-note {
  margin: 0 0 1rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  color: var(--a-muted);
  font-size: 0.88em;
}

/* --- Inteligentny układ treści -------------------------------------------- */
.a-prose article {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-bg);
}

.a-prose article :where(h2, h3) {
  margin-top: 0;
}

.a-prose article > :last-child {
  margin-bottom: 0;
}

/* Dokumenty do pobrania */
.a-prose a.a-file {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  margin: 0.15em 0;
  padding: 0.18em 0.55em 0.18em 0.2em;
  border: 1px solid var(--a-border);
  border-radius: 6px;
  background: var(--a-soft);
  font-weight: 600;
  text-decoration: none;
}

.a-prose a.a-file::before {
  content: attr(data-ext);
  padding: 0.08em 0.45em;
  border-radius: 4px;
  background: var(--a-accent);
  color: var(--a-accent-text);
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.a-prose li.a-file-item {
  list-style: none;
  margin-left: -1.2em;
}

/* Przewijalne tabele */
.a-table-scroll {
  margin: 1.2em 0;
  overflow-x: auto;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
}

.a-table-scroll:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
}

.a-table-scroll table {
  margin: 0;
  min-width: 100%;
  border: 0;
}

.a-table-scroll caption {
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-weight: 700;
  background: var(--a-soft);
  color: var(--a-text);
}

/* Callouty / komunikaty */
.a-callout {
  margin: 1.2em 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--a-accent);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  color: var(--a-text);
}

.a-callout--warning {
  border-left-color: #b45309;
  background: #fff7e6;
  color: #4a2c00;
}

.a-callout--success {
  border-left-color: #116b33;
  background: #e7f6ec;
  color: #0b3d1e;
}

.theme-contrast .a-callout--warning,
.theme-contrast .a-callout--success,
.theme-contrast .a-callout {
  background: #1a1a1a;
  color: #fff;
  border-color: #ffd400;
}

/* Definicje, adres, accordiony */
.a-prose dl {
  margin: 1em 0;
}

.a-prose dt {
  font-weight: 700;
  margin-top: 0.5em;
}

.a-prose dd {
  margin: 0 0 0.3em 1.2em;
}

.a-prose address {
  font-style: normal;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--a-border);
  background: var(--a-soft);
  border-radius: var(--a-radius);
}

.a-prose details {
  margin: 0.6em 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-bg);
}

.a-prose summary {
  cursor: pointer;
  padding: 0.4rem 0;
  font-weight: 650;
}

.a-prose summary:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 3px;
}

/* --- Karty osób ----------------------------------------------------------- */
.a-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.2em 0;
  padding: 0;
  list-style: none;
}

.a-people > .a-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-bg);
}

.a-person__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 0 0.6rem;
  border: 1px solid var(--a-border);
}

.a-person__name {
  color: var(--a-link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.a-person__name:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.a-person__role {
  margin: 0.3rem 0 0;
  color: var(--a-muted);
  font-size: 0.92em;
}

.a-person :where(p, span, small) {
  margin: 0.2rem 0 0;
}

@media (max-width: 480px) {
  .a-people {
    grid-template-columns: 1fr;
  }
}

/* Pierwszy element treści nie dodaje zbędnego odstępu pod spisem treści. */
.a-prose > :first-child {
  margin-top: 0;
}

.a-prose > :last-child {
  margin-bottom: 0;
}

/* --- Metryka dokumentu (BIP) ---------------------------------------------- */
.a-metadata {
  margin: 1.5em 0;
  padding: 0.2rem 0.9rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-soft);
  color: var(--a-muted);
  font-size: 0.9em;
}

.a-metadata summary {
  cursor: pointer;
  padding: 0.55rem 0;
  font-weight: 650;
  color: var(--a-text);
}

.a-metadata summary:focus-visible {
  outline: 4px solid var(--a-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.a-metadata :where(table) {
  margin: 0.3rem 0 0.8rem;
  font-size: 0.92em;
}

.a-metadata :where(dl, ul) {
  margin: 0.3rem 0 0.8rem;
}

.a-metadata :where(h2, h3, h4) {
  margin: 0.6rem 0 0.3rem;
  font-size: 1em;
}

.a-metadata a {
  color: var(--a-link);
}

/* Widoczność elementów wybierana przez użytkownika */
.pref-hide-toc .a-toc,
.pref-hide-quick .a-quick,
.pref-hide-dates .a-date,
.pref-hide-metadata .a-metadata,
.pref-hide-gallery .a-gallery,
.pref-hide-videos .a-videos,
.pref-hide-nav .a-nav,
.pref-hide-footer .a-footer {
  display: none !important;
}

/* Karta osoby także poza siatką (np. pojedyncze profile). */
.a-person {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-bg);
}

.a-person__photo {
  flex: none;
}

.a-people > .a-person {
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0;
}

.a-people > .a-person .a-person__photo {
  margin: 0 0 0.6rem;
}

/* Osoby: bez podwójnych ramek i bez ogromnych obrazów w treści. */
.a-plain-article {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.a-prose img {
  max-height: min(60vh, 26rem);
  width: auto;
  margin-inline: auto;
}

/* Pojedyncze karty osób: wyśrodkowany, wąski profil. */
.a-person {
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 30rem;
  margin: 0 auto 1rem;
}

.a-person__photo {
  display: block;
  margin: 0 auto 0.6rem;
}

.a-person :where(p, a) {
  overflow-wrap: anywhere;
}

.a-people > .a-person {
  max-width: none;
  margin: 0;
}
