/* TMS-AGB · ALMAS-Webdesign-System v2 (hell) */
:root {
  --rot: #FF2325;
  --rot-text: #D81020;
  --text: #16181b;
  --text-2: #4a4f57;
  --text-3: #6b7078;
  --flaeche: #f6f6f7;
  --karte: #ffffff;
  --linie: #e7e8ea;
  --gruen: #147A3D;
  --blau: #0057B8;
  --amber: #B26A00;
  --radius: 18px;
  --radius-s: 12px;
  --schatten: 0 1px 2px rgba(16, 18, 27, .04), 0 4px 12px rgba(16, 18, 27, .05), 0 16px 40px rgba(16, 18, 27, .06);
  --schatten-hoch: 0 2px 4px rgba(16, 18, 27, .06), 0 10px 24px rgba(16, 18, 27, .08), 0 24px 60px rgba(16, 18, 27, .10);
  --schrift: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
  --kopf-h: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--flaeche); color: var(--text);
  font: 400 16px/1.65 var(--schrift); overflow-x: hidden;
}
a { color: var(--rot-text); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--rot-text); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }

/* Kopf (Glas) */
.kopf {
  position: sticky; top: 0; z-index: 20; height: var(--kopf-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.marke img { width: 44px; height: auto; flex: none; }
.marke-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.marke-text strong { font-size: 15px; letter-spacing: .06em; }
.marke-text small { font-size: 10.5px; letter-spacing: .14em; color: var(--rot-text); font-weight: 600; white-space: nowrap; }
.kopf-nav { display: flex; gap: 6px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 999px; padding: 4px; }
.kopf-nav a { text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 500; padding: 6px 14px; border-radius: 999px; transition: background .2s, color .2s; }
.kopf-nav a:hover { color: var(--text); }
body[data-aktiv="aktuell"] .kopf-nav a[data-nav="aktuell"],
body[data-aktiv="fassungen"] .kopf-nav a[data-nav="fassungen"] { background: #fff; color: var(--rot-text); box-shadow: 0 1px 3px rgba(16, 18, 27, .1); }

/* Raster */
.rahmen {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px;
  max-width: 1180px; margin: 0 auto; padding: 32px 24px 48px;
}
.seitenleiste { position: sticky; top: calc(var(--kopf-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 20px; }
.eyebrow { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.stand-karte { display: flex; flex-direction: column; gap: 4px; border-left: 4px solid var(--blau); }
.stand-datum { font-size: 28px; line-height: 1.2; color: var(--blau); letter-spacing: -.01em; }
.stand-meta { color: var(--text-2); font-size: 14px; margin-bottom: 12px; }
.toc ol, .blatt-liste { list-style: none; margin: 0; padding: 0; }
.toc li a, .blatt-liste li a {
  display: flex; gap: 10px; padding: 7px 10px; margin: 0 -10px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-size: 14px; line-height: 1.35; transition: background .15s, color .15s;
}
.toc li a:hover, .blatt-liste li a:hover { background: var(--flaeche); color: var(--text); }
.toc li a.aktiv { background: #fff1f1; color: var(--rot-text); }
.nr { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--rot-text); min-width: 1.4em; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: 12px; font: 600 15px/1 var(--schrift); text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.knopf-primaer { background: var(--rot-text); color: #fff; border: 1px solid var(--rot-text); box-shadow: 0 4px 14px rgba(216, 16, 32, .25); }
.knopf-primaer:hover { background: #b80d1b; transform: translateY(-1px); }
.knopf-sekundaer { background: #fff; color: var(--text); border: 1px solid var(--linie); margin-top: 8px; }
.knopf-sekundaer:hover { border-color: #cfd1d4; transform: translateY(-1px); }

/* Hauptteil */
.haupt { min-width: 0; outline: none; }
.haupt-schmal { max-width: 860px; margin: 0 auto; padding: 40px 24px 64px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 14px; font-weight: 700; }
.h1-zusatz { display: block; font-size: .55em; font-weight: 500; color: var(--text-2); letter-spacing: -.005em; margin-top: 8px; line-height: 1.3; }
.unterzeile { color: var(--text-2); margin: 0 0 18px; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .01em; }
.badge-blau { background: #e8f0fb; color: var(--blau); }
.badge-gruen { background: #e7f4ec; color: var(--gruen); }
.badge-amber { background: #fdf1df; color: var(--amber); }
.hinweis { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius-s); padding: 12px 16px; font-size: 14.5px; color: var(--text-2); margin: 0 0 24px; }
.hinweis .badge { margin-right: 6px; }
.hinweis-ok { border-left: 4px solid var(--gruen); }
.hinweis-alt { border-left: 4px solid var(--amber); }
.hinweis a { overflow-wrap: anywhere; }

.agb { display: flex; flex-direction: column; gap: 18px; }
.abschnitt { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 24px 28px; }
.abschnitt h2 { display: flex; gap: 12px; align-items: baseline; font-size: 20px; line-height: 1.3; margin: 0 0 12px; letter-spacing: -.005em; }
.ziffer { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid #f0f1f2; }
.ziffer:first-of-type { border-top: 0; }
.ziffer p { margin: 0; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; color: #23262b; }
.ziffer-nr { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-3); text-decoration: none; padding-top: 1px; }
.ziffer-nr:hover { color: var(--rot-text); }
.ziffer:target { background: #fff7f7; border-radius: 10px; box-shadow: 0 0 0 8px #fff7f7; }
.quelle { font-size: 13px; color: var(--text-3); margin: 20px 4px 0; }
.druck-kopf { display: none; }

/* Fassungen */
.fassungen-liste { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.fassung { display: flex; flex-direction: column; gap: 6px; transition: transform .2s, box-shadow .2s; }
.fassung:hover { transform: translateY(-2px); box-shadow: var(--schatten-hoch); }
.fassung-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 18px; }
.fassung .stand-meta { margin: 0; }
.link { font-size: 13px; color: var(--text-2); background: var(--flaeche); padding: 6px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.fassung-aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.fassung-aktionen .knopf-sekundaer { margin-top: 0; }

/* Fuß */
.fuss { border-top: 1px solid var(--linie); background: #fff; padding: 24px 24px calc(24px + env(safe-area-inset-bottom)); }
.fuss-innen { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.fuss nav { display: flex; gap: 18px; }
.fuss-hinweis { max-width: 1180px; margin: 10px auto 0; font-size: 12.5px; color: var(--text-3); }
.badge-version { font-size: 12px; color: var(--text-3); border: 1px solid var(--linie); border-radius: 999px; padding: 2px 10px; }

/* Mobil: eigene Handy-Oberfläche */
.mobil-leiste, .fab, .blatt, .blatt-schleier { display: none; }
@media (max-width: 900px) {
  :root { --kopf-h: 58px; }
  .kopf { padding: 0 16px; }
  .kopf-nav { display: none; }
  .marke img { width: 38px; }
  .rahmen { display: block; padding: 20px 16px 24px; }
  .seitenleiste { position: static; margin-bottom: 18px; }
  .seitenleiste .toc { display: none; }
  .stand-karte { padding: 16px 18px; }
  .stand-karte .knopf { display: none; }
  .stand-datum { font-size: 24px; }
  .stand-meta { margin-bottom: 0; }
  .abschnitt { padding: 18px 16px; border-radius: 16px; }
  .abschnitt h2 { font-size: 18px; }
  .ziffer { grid-template-columns: 36px minmax(0, 1fr); }
  .ziffer p { font-size: 15.5px; }
  .haupt-schmal { padding: 24px 16px 40px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .fuss { padding-bottom: 24px; }

  .mobil-leiste {
    display: grid; grid-template-columns: repeat(2, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--linie); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .mobil-leiste a, .mobil-leiste button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
    font: 600 12px/1.1 var(--schrift); color: var(--text-2); text-decoration: none; background: none; border: 0; border-radius: 12px; cursor: pointer;
  }
  .mobil-leiste span { font-size: 20px; color: var(--rot-text); }
  .mobil-leiste a:active, .mobil-leiste button:active { background: var(--flaeche); }

  .fab {
    display: flex; align-items: center; justify-content: center; position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 25;
    width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--rot-text); color: #fff; font-size: 22px;
    box-shadow: 0 8px 24px rgba(216, 16, 32, .35); opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .fab.sichtbar { opacity: 1; transform: none; pointer-events: auto; }

  .blatt-schleier:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(16, 18, 27, .35); }
  .blatt:not([hidden]) {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--schatten-hoch); padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
    animation: blatt-rein .25s ease-out;
  }
  .blatt-griff { width: 44px; height: 5px; border-radius: 3px; background: #d5d7da; margin: 4px auto 14px; }
  .blatt-liste li a { padding: 12px 10px; font-size: 15.5px; }
}
@keyframes blatt-rein { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Druck */
@media print {
  @page { size: A4; margin: 16mm 15mm; }
  body { background: #fff; font-size: 10pt; line-height: 1.45; padding: 0; }
  .kopf, .seitenleiste, .mobil-leiste, .fab, .blatt, .blatt-schleier, .hinweis, .fuss nav, .fuss-hinweis, .badge-version, .skip { display: none !important; }
  .rahmen { display: block; padding: 0; max-width: none; }
  .druck-kopf { display: block; font-size: 8.5pt; color: #444; border-bottom: 1px solid #999; padding-bottom: 4px; margin-bottom: 10px; }
  h1 { font-size: 16pt; }
  .eyebrow, .unterzeile .badge { color: #000; background: none; padding: 0; }
  .abschnitt { box-shadow: none; border: 0; padding: 0; margin: 0 0 8px; break-inside: auto; }
  .abschnitt h2 { font-size: 11pt; margin: 8px 0 4px; break-after: avoid; }
  .ziffer { border: 0; padding: 2px 0; grid-template-columns: 30px 1fr; break-inside: avoid; }
  .ziffer p, .ziffer-nr { color: #000; }
  a { color: #000; text-decoration: none; }
  .fuss { border: 0; padding: 8px 0 0; font-size: 8pt; }
}
