/* Reading rhythm for the current terms, privacy policy and pricing pages. */
body.public-page.public-documents {
  --reading-gap: 1rem;
}

body.pricing-page.public-documents a.skip-link:focus {
  background: #07101f;
  color: #fffaf2;
}

/* Keep successive cards and their contents visually separate. */
body.pricing-page.public-documents .pricing-section > :is(.block, .public-grid, .notice) + :is(.block, .public-grid, .notice) {
  margin-top: 20px;
}
body.pricing-page.public-documents .pricing-section .block.rich-text > * + *,
body.pricing-page.public-documents .pricing-section .block.rich-text details > * + *,
body.pricing-page.public-documents .pricing-section .block:not(.rich-text) > :is(h3, h4, p) + :is(h3, h4, p) {
  margin-top: var(--reading-gap);
}
body.pricing-page.public-documents .pricing-section .block.rich-text > :is(h3, h4):not(:first-child) {
  margin-top: 1.75rem;
}
body.pricing-page.public-documents .pricing-section .section-head p + p,
body.pricing-page.public-documents .annual-card p + p {
  margin-top: .75rem;
}
body.pricing-page.public-documents .pricing-section .block.rich-text :is(ul, ol) > li + li {
  margin-top: .7rem;
}
body.pricing-page.public-documents .pricing-section .block.rich-text details > summary {
  min-height: 44px;
  padding-block: 10px;
  line-height: 1.5;
}

/* Nested legal lists and headings remain easy to scan at every width. */
body.public-documents.legal-page .legal-content .legal-section.rich-text :is(ul, ol) > li + li {
  margin-top: .65rem;
}
body.public-documents.legal-page .legal-content .legal-section.rich-text :is(ul, ol) :is(ul, ol) {
  margin-top: .65rem;
}
body.public-page.public-documents.terms-document .terms-section .terms-list > li + li {
  margin-top: .85rem;
}
body.public-page.public-documents.terms-document .terms-section .terms-list .terms-list > li + li {
  margin-top: .5rem;
}
body.public-documents.legal-page .legal-content :is(p, li) {
  overflow-wrap: break-word;
}

@media (max-width: 600px) {
  body.pricing-page.public-documents .pricing-section > .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
  body.pricing-page.public-documents .pricing-section > .section-head .pill {
    max-inline-size: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.pricing-page.public-documents .price-table[aria-label="Prognoza kredytów dla zestawu indywidualnego"] td:not(:first-child),
  body.pricing-page.public-documents .price-table[aria-label="Cena i liczba zwykłych kredytów"] td:not(:first-child) {
    white-space: nowrap;
    font-size: 13px;
  }
  body.pricing-page.public-documents .price-table[aria-label="Prognoza kredytów dla zestawu indywidualnego"] :is(th, td),
  body.pricing-page.public-documents .price-table[aria-label="Cena i liczba zwykłych kredytów"] :is(th, td) { padding-inline: 6px; }

  body.pricing-page.public-documents .pricing-section > :is(.block, .public-grid, .notice) + :is(.block, .public-grid, .notice) {
    margin-top: 16px;
  }
  body.public-documents :is(.pricing-section, .legal-section) :is(h2, h3, h4) {
    overflow-wrap: break-word;
  }
}

@media screen {
  .public-documents .document-nav a { position: relative; }
  .public-documents .document-tab-ink {
    position: absolute;
    inset: auto 23% 2px;
    height: 3px;
    border-radius: 2px;
    pointer-events: none;
    background: #ffc674;
    transform-origin: left center;
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .public-documents .document-tab-ink.is-travelling {
    animation: izi-document-selection 360ms cubic-bezier(.22,.72,.18,1) backwards;
  }
  @keyframes izi-document-selection {
    from { transform: translate(var(--ink-x), var(--ink-y)) scaleX(var(--ink-scale)); }
    to { transform: none; }
  }

  @supports (animation-timeline: scroll()) {
    html:has(body.public-documents)::after {
      content: "";
      position: fixed;
      z-index: 40;
      inset: 0 0 auto;
      height: 3px;
      pointer-events: none;
      background: linear-gradient(90deg,#dd792c,#f6b954);
      transform: scaleX(0);
      transform-origin: left center;
      animation: izi-reading-progress linear both;
      animation-timeline: scroll(root block);
    }
    @keyframes izi-reading-progress { to { transform: scaleX(1); } }
  }
}

@media print {
  @page { size: A4; margin: 16mm; }
  html:has(body.public-documents) { background: #fff !important; }
  body.public-page.public-documents { background: #fff !important; }
  body.public-page.public-documents .document-data-table th:first-child { width: 24%; }
  body.public-page.public-documents .document-data-table :is(th, td) {
    overflow-wrap: break-word;
    hyphens: auto;
  }
  body.public-page.public-documents :is(.price-table, .document-data-table) tr { break-inside: avoid; }
  body.pricing-page.public-documents .price-card .price {
    white-space: normal;
    font-size: 10pt;
  }
  body.pricing-page.public-documents .price-card .price-amount {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: 10pt;
    line-height: 1.4;
    white-space: normal;
  }
  body.pricing-page.public-documents .pricing-section > :is(.block, .public-grid, .notice) + :is(.block, .public-grid, .notice) {
    margin-top: 10pt;
  }
  body.public-documents :is(h2, h3, h4, summary) { break-after: avoid; }
  body.public-documents :is(p, li) { orphans: 3; widows: 3; }
}
