.agb-document__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  max-width: none;
}

.agb-document__heading > div { min-width: 0; }
.agb-document__heading h1 { overflow-wrap: break-word; }
.agb-document__print-brand { display: none; }
.agb-document__provider { display: none; }

.agb-document__print {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: .6rem;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--paper);
  cursor: pointer;
}

.agb-document__print[hidden] { display: none; }
.agb-document__print:hover { color: #fff; border-color: var(--red); }
.agb-document__print:focus-visible { outline: 3px solid var(--red-hi); outline-offset: 4px; }

@media (max-width: 480px) {
  .agb-document__heading { flex-direction: column-reverse; align-items: stretch; }
  .agb-document__print { align-self: flex-end; }
}

@page {
  size: A4;
  margin: 17mm 17mm 19mm;
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-family: "Thomas Sans", Arial, sans-serif;
    font-size: 8pt;
    color: #454b55;
  }
}

@media print {
  .agb-document__imprint-reference { display: none; }
  html { color-scheme: light; }
  body {
    min-width: 0;
    overflow: visible;
    background: #fff;
    color: #171b22;
    font-size: 10pt;
    line-height: 1.5;
  }
  body::before, body::after,
  .site-header, .site-footer, .skip-link,
  .agb-document__print { display: none !important; }

  .site-shell, #main-content, .agb-document, .agb-document__panel {
    display: block;
    position: static;
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 0;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .agb-document__print-brand {
    display: flex;
    align-items: center;
    gap: 3mm;
    padding-bottom: 4mm;
    margin-bottom: 7mm;
    border-bottom: 1.1pt solid #e41625;
    break-inside: avoid;
  }
  .agb-document__mark {
    display: grid;
    place-items: center;
    width: 10mm;
    height: 10mm;
    border: 1pt solid #e41625;
    border-radius: 2mm;
    color: #b0101d;
    font-weight: 700;
    font-size: 12pt;
    letter-spacing: -.04em;
  }
  .agb-document__print-brand strong { display: block; font-size: 11pt; }
  .agb-document__print-brand div > span { display: block; font-size: 8pt; color: #454b55; }
  .agb-document__domain { margin-left: auto; font-size: 8pt; color: #454b55; }
  .agb-document__panel .agb-document__heading {
    display: block;
    padding: 0;
    margin: 0 0 5mm;
    border: 0;
  }
  .agb-document__heading h1 {
    max-width: none;
    margin: 0;
    font-size: 22pt;
    line-height: 1.15;
    letter-spacing: -.035em;
    color: #171b22;
  }
  .agb-document__content { max-width: none; }
  .agb-document__provider {
    display: block;
    padding: 0 0 4mm;
    margin: 0 0 4mm;
    border-bottom: .5pt solid #c4c8ce;
    font-size: 8pt;
    line-height: 1.45;
    color: #171b22;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .agb-document__provider-label {
    margin: 0 0 1.5mm;
    color: #a8101c;
    font-size: 8pt;
    font-weight: 700;
  }
  .agb-document__provider-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 5mm;
  }
  .agb-document__provider-details > div,
  .agb-document__provider-details dd { min-width: 0; overflow-wrap: anywhere; }
  .agb-document__provider address { white-space: pre-line; font-style: normal; }
  .agb-document__provider dl { margin: 0; }
  .agb-document__provider dl > div {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 2mm;
  }
  .agb-document__provider dt { font-weight: 700; }
  .agb-document__provider dd { margin: 0; }
  .agb-document__provider-notice { margin: 2mm 0 0; color: #171b22; }
  .agb-document .agb-document__content :where(h2, h3, h4) {
    max-width: none;
    margin: 6mm 0 2.5mm;
    color: #a8101c;
    font-size: 12pt;
    line-height: 1.25;
    letter-spacing: -.015em;
    break-after: avoid-page;
    page-break-after: avoid;
  }
  .agb-document .agb-document__content :where(p, li) {
    max-width: none;
    color: #171b22;
    font-size: 10pt;
    line-height: 1.5;
    orphans: 3;
    widows: 3;
  }
  .agb-document__content p { margin-bottom: 3mm; }
  .agb-document .agb-document__content :where(strong, em, code) { color: #171b22; }
  .agb-document__content code { background: transparent; border: 0; }
  .agb-document a, .agb-document a:hover { color: #171b22; }
}
/* Screen presentation only. Existing print rules and document markup stay intact. */
@media screen {
  .agb-document .agb-document__panel {
    max-width: min(var(--content), 72rem);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  .agb-document .agb-document__heading {
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
  }
  .agb-document__heading h1 {
    max-width: 25ch;
    margin-bottom: 0;
    font-size: clamp(2.1rem, 4.1vw, 3.7rem);
    line-height: 1.14;
  }
  .agb-document .agb-document__print {
    width: 3rem;
    height: 3rem;
    border-color: rgb(255 146 155 / 35%);
    background: #1c1922;
    color: #ff929b;
  }
  .agb-document .agb-document__print:hover {
    border-color: #ff929b;
    background: #2b1c28;
    color: #fff;
  }
  .agb-document .agb-document__content {
    max-width: 76ch;
    margin-inline: auto;
    color: var(--muted);
    overflow-wrap: anywhere;
  }
  .agb-document .agb-document__content h2 {
    max-width: 36ch;
    margin-top: clamp(2.6rem, 5vw, 4rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--line-bright);
    color: var(--paper);
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    line-height: 1.3;
    letter-spacing: -.025em;
    scroll-margin-top: 9rem;
  }
  .agb-document .agb-document__content h3 {
    max-width: none;
    margin-top: 1.8rem;
    color: var(--paper);
    font-size: 1.15rem;
    line-height: 1.4;
    scroll-margin-top: 9rem;
  }
  .agb-document .agb-document__content p,
  .agb-document .agb-document__content li {
    max-width: none;
    line-height: 1.85;
  }
  .agb-document .agb-document__content p { margin-bottom: 1.3rem; }
  .agb-document .agb-document__content > p:first-child {
    margin: 0 0 2rem;
    color: #d3b7c0;
    font-size: .88rem;
  }
  .agb-document .agb-document__content blockquote {
    padding: 1rem 1.25rem;
    margin: 0 0 2rem;
    border-left: 2px solid #a44b57;
    background: rgb(255 255 255 / 3%);
    font-size: .9rem;
  }
  .agb-document .agb-document__content blockquote p:last-child { margin-bottom: 0; }
  .agb-document .agb-document__content strong { color: var(--paper); }
  .agb-document .agb-document__imprint-reference a { text-decoration-color: #ff929b; }
}
@media screen and (max-width: 480px) {
  .agb-document .agb-document__heading { flex-direction: row; gap: 1rem; }
  .agb-document .agb-document__print { align-self: flex-start; }
  .agb-document .agb-document__heading h1 { font-size: clamp(1.9rem, 8vw, 2.3rem); }
  .agb-document .agb-document__content h2,
  .agb-document .agb-document__content h3 { scroll-margin-top: 16rem; }
}
