:root {
  --navy: #102a43;
  --blue: #1769aa;
  --blue-soft: #eaf4fc;
  --ink: #172b3a;
  --muted: #647789;
  --line: #dde6ec;
  --surface: #fff;
  --canvas: #f7f9fb;
  --sidebar: #fbfcfd;
  --shadow: 0 14px 40px rgba(16, 42, 67, 0.12);
  color-scheme: light;
}
[data-theme="dark"] {
  --navy: #edf5fb;
  --blue: #63b3ed;
  --blue-soft: #16364d;
  --ink: #e8f0f5;
  --muted: #9fb1bf;
  --line: #2c4353;
  --surface: #122531;
  --canvas: #0c1c26;
  --sidebar: #10222d;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: -60px;
  left: 16px;
  background: var(--navy);
  color: var(--surface);
  padding: 12px 18px;
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
.topbar {
  height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
  min-width: 276px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1976b9, #0f4f83);
  color: white;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  box-shadow: 0 5px 15px rgba(23, 105, 170, 0.25);
}
.brand strong {
  display: block;
  font-size: 16px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.search-trigger {
  width: min(410px, 36vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--muted);
  border-radius: 11px;
  padding: 0 13px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.search-trigger span {
  font-size: 24px;
}
.search-trigger kbd {
  margin-left: auto;
}
.site-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.icon-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 23px;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  cursor: pointer;
}
.icon-button:hover {
  background: var(--blue-soft);
}
.menu-button,
.close-menu {
  display: none;
}
.app-shell {
  padding-top: 72px;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  z-index: 20;
  top: 72px;
  bottom: 0;
  left: 0;
  width: 292px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar-head {
  height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
#navigation {
  padding: 0 12px 24px;
  overflow: auto;
  flex: 1;
}
.nav-group {
  margin: 4px 0 8px;
}
.nav-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 9px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.nav-group summary::-webkit-details-marker {
  display: none;
}
.nav-group summary:before {
  content: "›";
  font-size: 20px;
  transition: transform 0.2s;
}
.nav-group[open] summary:before {
  transform: rotate(90deg);
}
.nav-item {
  display: block;
  color: var(--muted);
  text-decoration: none;
  border-left: 1px solid var(--line);
  padding: 7px 10px 7px calc(13px + (var(--level, 2) - 2) * 10px);
  margin-left: 16px;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 0 7px 7px 0;
}
.nav-item:hover {
  color: var(--blue);
  background: var(--blue-soft);
}
.nav-item.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-left: 2px solid var(--blue);
  font-weight: 650;
}
.sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.main {
  margin-left: 292px;
  min-height: calc(100vh - 72px);
  padding: 24px clamp(24px, 5vw, 80px) 32px;
}
.breadcrumbs {
  max-width: 960px;
  min-height: 18px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 13px;
}

/*
 * Treść artykułu jest pobierana asynchronicznie. Do czasu zbudowania pełnego
 * układu ukrywamy dynamiczne elementy, aby zamiana loadera na artykuł nie była
 * liczona przez przeglądarkę jako Cumulative Layout Shift.
 */
.main.is-loading .article,
.main.is-loading .page-nav {
  visibility: hidden;
}
.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumbs span {
  margin: 0 7px;
}
.article {
  max-width: 960px;
  min-height: 60vh;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 58px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(16, 42, 67, 0.04);
  overflow: hidden;
}
.article h1 {
  font-size: clamp(29px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--navy);
  margin: 0 0 34px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.article h2,
.article .p_helpy_nagłówek {
  color: var(--navy) !important;
  font-size: 22px !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
  margin: 34px 0 12px !important;
}
.article p,
.article span,
.article li,
.article td {
  font-family: Inter, "Segoe UI", system-ui, sans-serif !important;
  line-height: 1.72 !important;
  color: var(--ink) !important;
}
.article p {
  margin-top: 0.5em !important;
  margin-bottom: 0.8em !important;
}
.article a {
  color: var(--blue) !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
}
.article table {
  max-width: 100% !important;
}
.article [style*="width"] {
  max-width: 100%;
}
.article-loading {
  display: grid;
  place-items: center;
  padding: 100px 20px;
  color: var(--muted);
}
.article-loading span {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.page-nav {
  max-width: 960px;
  margin: 18px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.page-link {
  min-height: 72px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.page-link.next {
  text-align: right;
}
.page-link small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.page-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.page-link:disabled {
  visibility: hidden;
}
.content-footer {
  max-width: 960px;
  margin: 34px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.search-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.search-dialog::backdrop {
  background: rgba(7, 22, 32, 0.58);
  backdrop-filter: blur(3px);
}
.search-panel {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.search-box {
  height: 66px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
}
.search-box span {
  font-size: 26px;
  color: var(--muted);
}
.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
}
.search-box button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
  cursor: pointer;
}
.search-meta {
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  background: var(--canvas);
}
kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--surface);
  border-radius: 5px;
  padding: 2px 6px;
  font: 11px inherit;
}
.search-results {
  overflow: auto;
  padding: 8px;
}
.result {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 14px;
  border-radius: 10px;
}
.result:hover,
.result.selected {
  background: var(--blue-soft);
}
.result strong {
  display: block;
  margin-bottom: 4px;
}
.result p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.loading-line {
  height: 12px;
  background: var(--line);
  border-radius: 8px;
  margin: 16px 10px;
}
.loading-line.short {
  width: 60%;
}
.overlay {
  display: none;
}
@media (max-width: 860px) {
  .topbar {
    height: 64px;
    padding: 0 12px;
  }
  .brand {
    min-width: 0;
  }
  .brand small,
  .site-link,
  .search-trigger {
    display: none;
  }
  .menu-button,
  .close-menu {
    display: inline-grid;
    place-items: center;
  }
  .app-shell {
    padding-top: 64px;
  }
  .sidebar {
    top: 64px;
    width: min(330px, 88vw);
    transform: translateX(-102%);
    transition: transform 0.25s;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: none;
  }
  .overlay {
    position: fixed;
    z-index: 15;
    inset: 64px 0 0;
    background: rgba(7, 22, 32, 0.42);
  }
  .overlay.open {
    display: block;
  }
  .main {
    margin-left: 0;
    padding: 18px 12px 28px;
  }
  .article {
    padding: 25px 18px;
    border-radius: 12px;
  }
  .page-nav {
    grid-template-columns: 1fr;
  }
  .breadcrumbs {
    padding: 0 5px;
  }
}
@media print {
  .topbar,
  .sidebar,
  .breadcrumbs,
  .page-nav,
  .content-footer {
    display: none;
  }
  .app-shell {
    padding: 0;
  }
  .main {
    margin: 0;
    padding: 0;
  }
  .article {
    border: 0;
    box-shadow: none;
    max-width: none;
  }
}
