/* =============================================
   LAYOUT PODSTRONY
   ============================================= */
body.subpage {
  background: var(--bg);
}

.sub-header {
  background: var(--jet);
  color: #fff;
  padding: 4px 28px 6px;
  border-bottom: 3px solid var(--dusty-olive);
}

.back-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--olive-light);
  margin-bottom: 6px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--sunflower); }

.sub-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sub-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.sub-desc {
  font-size: 0.8rem;
  color: var(--olive-light);
  margin-top: 2px;
}

.sub-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.group-1-badge {
  background: var(--olive-pale);
  color: var(--dusty-olive);
  border: 1px solid var(--dusty-olive);
}

/* =============================================
   GŁÓWNY LAYOUT PODSTRONY
   ============================================= */
.sub-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 28px 40px;
}

/* =============================================
   SEKCJE TREŚCI
   ============================================= */
.content-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.content-section:first-child { border-top: none; }

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--jet);
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 4px solid var(--dusty-olive);
}

/* =============================================
   UKŁADY KOLUMN
   ============================================= */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

/* =============================================
   BLOK TEORII
   ============================================= */
.theory-block {
  font-size: 0.87rem;
  color: var(--text-main);
  line-height: 1.6;
}

.theory-block p + p { margin-top: 8px; }

.theory-list {
  margin: 10px 0 10px 18px;
  padding: 0;
}

.theory-list li {
  margin-bottom: 5px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.rule-box {
  background: var(--olive-pale);
  border-left: 3px solid var(--dusty-olive);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-main);
  margin-top: 10px;
  line-height: 1.5;
}

.rule-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--dusty-olive);
  margin-bottom: 3px;
}

/* =============================================
   TABELE TEORII
   ============================================= */
.theory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 10px;
}

.theory-table th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  padding: 5px 8px;
  border-bottom: 2px solid var(--border);
}

.theory-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.4;
}

.theory-table tr:last-child td { border-bottom: none; }
.theory-table tr:hover td { background: var(--olive-pale); }

.mini-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--dusty-olive);
  margin-bottom: 4px;
  margin-top: 2px;
}

/* =============================================
   BLOKI KODU
   ============================================= */
.code-block-wrap {
  background: var(--jet);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.82rem;
}

.code-label {
  background: var(--jet-mid);
  color: var(--olive-light);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-block-wrap pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
}

.code-block-wrap code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #e8e8d8;
  line-height: 1.65;
  white-space: pre;
}

/* Podświetlenie inline code w tekście */
.theory-block code,
.theory-list code,
.rule-box code,
.example-task code,
.ex-desc code,
.explanation-list code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--olive-pale);
  color: var(--jet);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--olive-mid);
}

/* =============================================
   ZADANIA PRZYKŁADOWE
   ============================================= */
.examples-section { }

.example-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.example-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.example-num {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
}

.example-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.example-level {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}

.level-easy   { background: var(--olive-pale);      color: var(--dusty-olive); }
.level-medium { background: var(--sunflower-pale);  color: #7a5800; }
.level-hard   { background: var(--strawberry-pale); color: #a01040; }

.example-task {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.55;
}

/* =============================================
   BLOK OMÓWIENIA
   ============================================= */
.explanation-block {
  background: var(--lavender-pale);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid #ccc7d4;
}

.explanation-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b5f72;
  margin-bottom: 10px;
}

.explanation-list {
  margin: 0;
  padding-left: 18px;
}

.explanation-list li {
  font-size: 0.82rem;
  line-height: 1.55;
  margin-bottom: 10px;
  color: var(--text-main);
}

.explanation-list li:last-child { margin-bottom: 0; }

.explanation-list strong {
  display: block;
  color: var(--jet);
  margin-bottom: 2px;
}

/* =============================================
   ZADANIA DO SAMODZIELNEGO ROZWIĄZANIA
   ============================================= */
.exercises-section { }

.exercises-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.exercises-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  border-left-width: 4px;
}

.exercise-card.level-1 { border-left-color: var(--dusty-olive); }
.exercise-card.level-2 { border-left-color: var(--sunflower); }
.exercise-card.level-3 { border-left-color: var(--strawberry); }

.ex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ex-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-light);
  font-family: var(--mono);
}

.ex-diff {
  font-size: 0.72rem;
  color: var(--text-light);
  letter-spacing: 1px;
}

.ex-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.ex-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.ex-hint {
  font-size: 0.73rem;
  color: var(--dusty-olive);
  background: var(--olive-pale);
  padding: 4px 8px;
  border-radius: var(--radius);
  font-style: italic;
}
/* =============================================
   NAWIGACJA MIĘDZY PODSTRONAMI
   ============================================= */
.site-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 0;
}

.page-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 28px;
}

.page-nav-empty {
  display: block;
}

.page-nav-current {
  font-size: 0.72rem;
  color: var(--text-light);
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.page-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.page-nav-btn:hover {
  background: var(--olive-pale);
  border-color: var(--dusty-olive);
  color: var(--jet);
}

.page-nav-btn.prev {
  justify-self: start;
}

.page-nav-btn.next {
  justify-self: end;
}

.nav-arrow {
  font-size: 1rem;
  line-height: 1;
  color: var(--dusty-olive);
  transition: transform 0.15s;
}

.page-nav-btn.prev:hover .nav-arrow {
  transform: translateX(-3px);
}

.page-nav-btn.next:hover .nav-arrow {
  transform: translateX(3px);
}
/* =============================================
   AKCENTY KOLORYSTYCZNE NAGŁÓWKÓW PODSTRON
   Każda podstrona ma unikalny pasek u góry
   i subtelny odcień tła nagłówka
   ============================================= */

.tile-accent-bar {
  height: 4px;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.sub-header {
  position: relative;
  padding-top: 16px; /* miejsce na pasek */
}

.sub-header-content {
  padding: 0; /* wewnętrzny wrapper bez dodatkowego paddingu */
}


/* Kafelek 01 — oliwkowy (domyślny, już był) */
.tile-01 .tile-accent-bar {
  background: var(--dusty-olive);
}
.tile-01 {
  border-bottom-color: var(--dusty-olive);
}

/* Kafelek 02 — złoty akcent */
.tile-02 .tile-accent-bar {
  background: linear-gradient(
    90deg,
    var(--dusty-olive) 0%,
    var(--sunflower) 100%
  );
}
.tile-02 {
  border-bottom-color: var(--sunflower);
}
.tile-02 .sub-title .accent,
.tile-02 .sub-title {
  color: #fff;
}
.tile-02 .back-link:hover {
  color: var(--sunflower);
}

/* Kafelek 03 — lawendowy akcent */
.tile-03 .tile-accent-bar {
  background: linear-gradient(
    90deg,
    var(--dusty-olive) 0%,
    var(--lavender) 100%
  );
}
.tile-03 {
  border-bottom-color: #b0a0bb;
}
.tile-03 .back-link:hover {
  color: var(--lavender);
}
/* Kafelek 04 — zielono-miętowy akcent */
.tile-04 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #6dbf8a 100%);
}
.tile-04 {
  border-bottom-color: #6dbf8a;
}
.tile-04 .back-link:hover {
  color: #6dbf8a;
}

/* Kafelek 05 — ciepły akcent złoto-pomarańcz */
.tile-05 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #f4a536 100%);
}
.tile-05 {
  border-bottom-color: #f4a536;
}
.tile-05 .back-link:hover {
  color: #f4a536;
}
/* Kafelek 06 — niebieskawa zieleń */
.tile-06 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #5ba3a0 100%);
}
.tile-06 {
  border-bottom-color: #5ba3a0;
}
.tile-06 .back-link:hover {
  color: #5ba3a0;
}

/* Kafelek 07 — lawendowo-fioletowy */
.tile-07 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #9b7fc7 100%);
}
.tile-07 {
  border-bottom-color: #9b7fc7;
}
.tile-07 .back-link:hover {
  color: #9b7fc7;
}
/* Kafelek 08 — różowo-lawendowy */
.tile-08 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #c47eb5 100%);
}
.tile-08 {
  border-bottom-color: #c47eb5;
}
.tile-08 .back-link:hover {
  color: #c47eb5;
}

/* Kafelek 09 — ciepły brąz */
.tile-09 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #b07d4a 100%);
}
.tile-09 {
  border-bottom-color: #b07d4a;
}
.tile-09 .back-link:hover {
  color: #b07d4a;
}

/* Kafelek 10 — czerwono-pomarańczowy */
.tile-10 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #d4603a 100%);
}
.tile-10 {
  border-bottom-color: #d4603a;
}
.tile-10 .back-link:hover {
  color: #d4603a;
}

/* Badge dla grupy 3 */
.group-3-badge {
  background: var(--sunflower-pale);
  color: #7a5800;
  border: 1px solid var(--sunflower);
}

/* Badge dla grupy 2 */
.group-2-badge {
  background: var(--lavender-pale);
  color: #6b5f72;
  border: 1px solid #b0a0bb;
}

/* Kafelek 11 — stalowy niebieski */
.tile-11 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #4a7fa5 100%);
}
.tile-11 {
  border-bottom-color: #4a7fa5;
}
.tile-11 .back-link:hover {
  color: #4a7fa5;
}

/* Kafelek 12 — głęboka czerwień */
.tile-12 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #c0392b 100%);
}
.tile-12 {
  border-bottom-color: #c0392b;
}
.tile-12 .back-link:hover {
  color: #c0392b;
}

/* Kafelek 13 — ciemnozielony */
.tile-13 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #2e7d52 100%);
}
.tile-13 { border-bottom-color: #2e7d52; }
.tile-13 .back-link:hover { color: #2e7d52; }

/* Kafelek 14 — indygo */
.tile-14 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #4a4aad 100%);
}
.tile-14 { border-bottom-color: #4a4aad; }
.tile-14 .back-link:hover { color: #4a4aad; }

/* Kafelek 15 — truskawkowy (egzamin!) */
.tile-15 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, var(--strawberry) 100%);
}
.tile-15 { border-bottom-color: var(--strawberry); }
.tile-15 .back-link:hover { color: var(--strawberry); }

/* Kafelek 16 — złoto-oliwkowy */
.tile-16 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, var(--sunflower) 100%);
}
.tile-16 { border-bottom-color: var(--sunflower); }
.tile-16 .back-link:hover { color: var(--sunflower); }

/* Kafelek 17 — ciemnoszary stalowy */
.tile-17 .tile-accent-bar {
  background: linear-gradient(90deg, var(--dusty-olive) 0%, #546e7a 100%);
}
.tile-17 { border-bottom-color: #546e7a; }
.tile-17 .back-link:hover { color: #546e7a; }

/* Badge dla grupy 4 */
.group-4-badge {
  background: var(--strawberry-pale);
  color: #a01040;
  border: 1px solid var(--strawberry);
}




/* =============================================
   NAWIGACJA GÓRNA MIĘDZY PODSTRONAMI
   ============================================= */
.top-page-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 4px 28px;
  background: var(--jet-mid);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.top-nav-empty {
  display: block;
}

.top-nav-current {
  font-size: 0.68rem;
  color: var(--text-light);
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

.top-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 12px;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--olive-light);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: var(--dusty-olive);
  color: #fff;
}

.top-nav-btn.prev {
  justify-self: start;
}

.top-nav-btn.next {
  justify-self: end;
}

.top-nav-btn .nav-arrow {
  color: var(--sunflower);
  font-size: 0.75rem;
}

.top-nav-btn.prev:hover .nav-arrow {
  transform: translateX(-3px);
}

.top-nav-btn.next:hover .nav-arrow {
  transform: translateX(3px);
}

/* =============================================
   DRUK — ukryj górną nawigację
   ============================================= */
@media print {
  .top-page-nav {
    display: none;
  }
}

/* =============================================
   DRUK — uzupełnienie dla akcentów
   ============================================= */
@media print {
  .tile-accent-bar {
    height: 3pt;
    background: #797d62 !important;
  }
  .sub-header {
    padding-top: 14pt;
  }
}

/* =============================================
   DRUK — ukryj nawigację między stronami
   ============================================= */
@media print {
  .page-nav {
    display: none;
  }
}
/* =============================================
   RESPONSYWNOŚĆ
   ============================================= */
@media (max-width: 1100px) {
  .three-col      { grid-template-columns: 1fr 1fr; }
  .exercises-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .two-col        { grid-template-columns: 1fr; }
  .three-col      { grid-template-columns: 1fr; }
  .exercises-grid { grid-template-columns: 1fr; }
  .sub-layout     { padding: 0 14px 32px; }
}

/* =============================================
   DRUK
   ============================================= */
@media print {

  /* Podstawy */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.subpage {
    background: #fff;
    font-size: 11pt;
    color: #000;
  }

  /* Ukryj elementy niepotrzebne przy druku */
  .back-link,
  .site-footer {
    display: none;
  }

  /* Nagłówek — kompaktowy, bez ciemnego tła */
  .sub-header {
    background: #fff !important;
    border-bottom: 2pt solid #797d62;
    padding: 8pt 0 6pt;
    color: #000;
  }

  .sub-title {
    font-size: 14pt;
    color: #000;
  }

  .sub-desc {
    font-size: 9pt;
    color: #444;
  }

  .sub-badge {
    border: 1pt solid #797d62;
    color: #797d62 !important;
    background: #e8ead8 !important;
    font-size: 7pt;
  }

  .sub-layout {
    padding: 0;
    max-width: 100%;
  }

  /* -----------------------------------------------
     ŁAMANIE STRON — sedno całej zmiany
     ----------------------------------------------- */

  /* Sekcja nigdy nie zaczyna się w połowie strony */
  .content-section {
    break-before: auto;
    break-inside: avoid;
  }

  /* Tytuł sekcji trzyma się razem z pierwszym elementem po nim */
  .section-title {
    break-after: avoid;
    font-size: 11pt;
    border-left: 3pt solid #797d62;
    padding-left: 6pt;
    color: #000;
  }

  /* Dwukolumnowy układ → jedna kolumna na wydruku */
  .two-col,
  .three-col {
    display: block;
  }

  .two-col > *,
  .three-col > * {
    margin-bottom: 8pt;
  }

  /* Blok teorii */
  .theory-block {
    break-inside: avoid;
    font-size: 10pt;
    line-height: 1.55;
  }

  /* Ramka z zasadą */
  .rule-box {
    break-inside: avoid;
    background: #e8ead8 !important;
    border-left: 3pt solid #797d62;
    padding: 5pt 8pt;
    font-size: 9pt;
    margin-top: 6pt;
  }

  .rule-label {
    color: #797d62 !important;
    font-size: 7pt;
  }

  /* Tabele teorii */
  .theory-table {
    break-inside: avoid;
    font-size: 9pt;
    width: 100%;
  }

  .theory-table th {
    background: #e8ead8 !important;
    color: #000;
    font-size: 7pt;
    padding: 3pt 5pt;
  }

  .theory-table td {
    padding: 3pt 5pt;
    border-bottom: 0.5pt solid #ccc;
  }

  .theory-table tr:hover td {
    background: none !important;
  }

  .mini-header {
    font-size: 7pt;
    color: #797d62 !important;
    margin-top: 6pt;
  }

  /* Bloki kodu — ciemne tło zastępujemy jasnym */
  .code-block-wrap {
    break-inside: avoid;
    background: #f4f4f0 !important;
    border: 1pt solid #ccc;
    border-radius: 4pt;
    margin-bottom: 8pt;
  }

  .code-label {
    background: #e8ead8 !important;
    color: #444 !important;
    font-size: 7pt;
    padding: 3pt 8pt;
    border-bottom: 0.5pt solid #ccc;
  }

  .code-block-wrap pre {
    padding: 8pt 10pt;
  }

  .code-block-wrap code {
    color: #1a1a1a !important;
    font-size: 8.5pt;
    line-height: 1.55;
  }

  /* Inline code w tekście */
  .theory-block code,
  .theory-list code,
  .rule-box code,
  .example-task code,
  .ex-desc code,
  .explanation-list code {
    background: #efefea !important;
    border: 0.5pt solid #ccc;
    color: #1a1a1a !important;
    font-size: 8.5pt;
    padding: 0 3pt;
  }

  /* -----------------------------------------------
     ZADANIA PRZYKŁADOWE
     ----------------------------------------------- */

  /* Każde zadanie przykładowe — nowy blok, nie łamie się w środku */
  .example-block {
    break-inside: avoid;
    border: 1pt solid #ccc;
    background: #fff !important;
    padding: 10pt 12pt;
    margin-bottom: 10pt;
    border-radius: 4pt;
  }

  .example-header {
    margin-bottom: 5pt;
  }

  .example-num {
    background: #f0f0ec !important;
    border: 0.5pt solid #ccc;
    font-size: 7pt;
    padding: 1pt 5pt;
  }

  .example-title {
    font-size: 10pt;
    font-weight: 700;
  }

  .example-level {
    font-size: 7pt;
    padding: 1pt 5pt;
  }

  .level-easy   { background: #e8ead8 !important; color: #555 !important; }
  .level-medium { background: #fff3d6 !important; color: #7a5800 !important; }
  .level-hard   { background: #fde8ee !important; color: #a01040 !important; }

  .example-task {
    font-size: 9pt;
    color: #333;
    margin-bottom: 8pt;
  }

  /* Blok omówienia */
  .explanation-block {
    break-inside: avoid;
    background: #f0edf2 !important;
    border: 0.5pt solid #ccc;
    padding: 8pt 10pt;
    border-radius: 4pt;
  }

  .explanation-title {
    font-size: 7pt;
    color: #6b5f72 !important;
    margin-bottom: 5pt;
  }

  .explanation-list {
    padding-left: 14pt;
  }

  .explanation-list li {
    font-size: 8.5pt;
    margin-bottom: 5pt;
    line-height: 1.5;
  }

  .explanation-list strong {
    font-size: 8.5pt;
    color: #000;
  }

  /* -----------------------------------------------
     ZADANIA DO SAMODZIELNEGO ROZWIĄZANIA
     ----------------------------------------------- */
  .exercises-intro {
    font-size: 9pt;
    color: #444;
    margin-bottom: 8pt;
  }

  /* Siatka zadań → dwie kolumny na wydruku */
  .exercises-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8pt;
  }

  /* Każde zadanie samodzielne nie łamie się w środku */
  .exercise-card {
    break-inside: avoid;
    background: #fff !important;
    border: 1pt solid #ccc;
    border-left-width: 3pt;
    padding: 8pt 10pt;
    border-radius: 3pt;
  }

  .exercise-card.level-1 { border-left-color: #797d62 !important; }
  .exercise-card.level-2 { border-left-color: #ffc759 !important; }
  .exercise-card.level-3 { border-left-color: #f44174 !important; }

  .ex-num  { font-size: 7pt; color: #777 !important; }
  .ex-diff { font-size: 8pt; color: #777 !important; }

  .ex-title {
    font-size: 9pt;
    font-weight: 700;
    margin-bottom: 4pt;
  }

  .ex-desc {
    font-size: 8.5pt;
    color: #333;
    line-height: 1.45;
    margin-bottom: 5pt;
  }

  .ex-hint {
    font-size: 8pt;
    background: #e8ead8 !important;
    color: #555 !important;
    padding: 2pt 5pt;
    border-radius: 2pt;
  }

  /* -----------------------------------------------
     DODATKOWE REGUŁY ŁAMANIA
     ----------------------------------------------- */

  /* Tytuł grupy trzyma się z następnym elementem */
  .group-label   { break-after: avoid; }

  /* Listy teorii nie łamią się w połowie */
  .theory-list   { break-inside: avoid; }

  /* Tabela nie łamie się między wierszami */
  .theory-table  { break-inside: avoid; }
  .theory-table tr { break-inside: avoid; }

  /* Sekcja z przykładami zaczyna się od nowej strony */
  .examples-section  { break-before: page; }

  /* Sekcja z zadaniami samodzielnie zaczyna się od nowej strony */
  .exercises-section { break-before: page; }

}