/* Empire Life – Serverregelwerk (öffentlich + Bearbeiten-Modus) */
:root {
  color-scheme: dark;
  --bg: #07070a;
  --surface: #0f0f16;
  --surface-up: #15151e;
  --surface-hoch: #1b1b26;
  --text: #f6f6fa;
  --text-body: #e4e4ec;
  --text-2: #c9c9d4;
  --muted: #a3a3b2;
  --line: #2b2b37;
  --line-soft: rgba(255,255,255,.08);
  --pink: #f2057d;
  --pink-hell: #ff7ab8;
  --violet: #8d16f5;
  --blue: #1488ff;
  --blue-hell: #82bcff;
  --gradient: linear-gradient(118deg,var(--pink),var(--violet) 53%,var(--blue));
  --max: 1320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; min-width: 320px; overflow-x: hidden; color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -4; opacity: .13; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.32) .55px,transparent .55px); background-size: 5px 5px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #7cb2ff; outline-offset: 3px; }
::selection { color: #fff; background: rgba(242,5,125,.72); }
.shell { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 200; top: 12px; left: 12px; padding: 11px 15px; transform: translateY(-160%); border-radius: 8px; color: #050507; background: #fff; font-weight: 850; }
.skip-link:focus { transform: none; }
.rw-unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rw-leise { color: var(--muted); }

/* ------------------------------ Kopfzeile ------------------------------ */
.site-header { position: fixed; z-index: 80; inset: 0 0 auto; height: 76px; border-bottom: 1px solid var(--line-soft); background: rgba(7,7,10,.86); backdrop-filter: blur(18px); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 40px; }
.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; font-size: .93rem; font-weight: 900; letter-spacing: -.03em; }
.brand b { color: #b4b4c0; }
.brand-mark { width: 29px; display: grid; gap: 3px; transform: skewX(-17deg); }
.brand-mark i { display: block; height: 6px; border-radius: 2px; background: var(--gradient); }
.brand-mark i:nth-child(2) { width: 82%; margin-left: 9%; }
.brand-mark i:nth-child(3) { width: 64%; margin-left: 18%; }
.desktop-nav { display: flex; align-items: center; gap: 28px; margin-inline: auto; }
.desktop-nav a { position: relative; padding: 27px 0 24px; color: #b4b4c0; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { color: #fff; }
.desktop-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gradient); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.desktop-nav + .header-actions { margin-left: 0; }
.portal-switcher { position: relative; }
.portal-switcher summary { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 9px; list-style: none; border: 1px solid var(--line); border-radius: 8px; color: #e7e6ed; background: rgba(255,255,255,.035); font-size: .78rem; font-weight: 820; cursor: pointer; user-select: none; }
.portal-switcher summary::-webkit-details-marker { display: none; }
.portal-switcher summary::after { content: "⌄"; color: #9e9cab; }
.portal-switcher[open] summary { border-color: #575767; background: rgba(255,255,255,.075); }
.portal-switcher-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 236px; padding: 8px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13,13,19,.99); box-shadow: 0 24px 70px rgba(0,0,0,.48); }
.portal-switcher-menu a { min-height: 43px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; color: #d8d7df; font-size: .78rem; font-weight: 760; }
.portal-switcher-menu a::after { content: "→"; color: #8a8898; }
.portal-switcher-menu a:hover { color: #fff; background: rgba(255,255,255,.065); }
.portal-switcher-menu a[aria-current="page"] { color: #fff; background: linear-gradient(118deg,rgba(242,5,125,.18),rgba(20,136,255,.14)); }
.eyebrow { margin: 0 0 14px; color: var(--pink-hell); font-size: .76rem; font-weight: 850; letter-spacing: .2em; text-transform: uppercase; }

/* ------------------------------ Kopfbereich ------------------------------ */
main { padding-top: 76px; }
.rw-held { padding: 52px 0 40px; border-bottom: 1px solid var(--line-soft); background:
  radial-gradient(760px 340px at 10% 0%, rgba(242,5,125,.16), transparent 70%),
  radial-gradient(900px 380px at 90% 10%, rgba(20,136,255,.14), transparent 70%); }
.rw-held-innen { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 36px; align-items: center; }
.rw-held-marke { position: relative; width: 150px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 34px; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gradient) border-box; border: 2px solid transparent; box-shadow: 0 24px 60px rgba(141,22,245,.22); }
.rw-held-marke span { font-family: Georgia, "Times New Roman", serif; font-size: 5.6rem; font-weight: 700; line-height: 1; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rw-held h1 { margin: 0; overflow-wrap: break-word; hyphens: auto; font-size: clamp(2.2rem, 5.2vw, 3.9rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 900; }
.rw-held-text { max-width: 680px; margin: 16px 0 8px; color: var(--text-2); font-size: 1.02rem; }
.rw-held-text a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.4); }
.rw-held-text a:hover { border-bottom-color: #fff; }
.rw-stand { margin: 0; color: var(--muted); font-size: .86rem; font-weight: 700; }
.rw-suche { margin-top: 22px; max-width: 640px; }
.rw-suche .rw-eingabe { width: 100%; min-height: 50px; padding: 12px 16px; font-size: 1rem; }
.rw-trefferzahl { min-height: 1.2em; margin: 10px 0 0; color: var(--text-2); font-size: .86rem; font-weight: 700; }
.rw-trefferzahl:empty { display: none; }

/* ------------------------------ Eingaben & Knöpfe ------------------------------ */
.rw-eingabe { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #0b0b11; font-size: .92rem; }
.rw-eingabe:focus { outline: 2px solid #7cb2ff; border-color: transparent; }
.rw-haken { display: inline-flex; gap: 8px; align-items: center; font-size: .88rem; cursor: pointer; }
.rw-haken input { width: 18px; height: 18px; accent-color: var(--pink); }
.rw-knopf { min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.04); font-size: .8rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.rw-knopf:hover { border-color: #5d5d6d; background: rgba(255,255,255,.08); }
.rw-knopf:disabled { opacity: .45; cursor: not-allowed; }
.rw-knopf-leise { color: var(--text-2); }
.rw-knopf-haupt { border-color: transparent; color: #fff; background: var(--gradient); }
.rw-knopf-haupt:hover { border-color: transparent; filter: brightness(1.08); }
.rw-knopf-gefahr { border-color: rgba(242,80,80,.5); color: #ffbcbc; }

/* ------------------------------ Aufbau ------------------------------ */
.rw-raster { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 26px; align-items: start; padding: 28px 0 90px; }
.rw-raster > * { min-width: 0; }
.rw-seite { display: grid; gap: 18px; position: sticky; top: 96px; }
.rw-karte { padding: 18px 20px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
.rw-karte h2 { margin: 0 0 10px; font-size: 1rem; letter-spacing: -.01em; }
.rw-karte p { margin: 8px 0 0; color: var(--text-2); font-size: .88rem; }
.rw-karte a:not(.rw-knopf) { color: #fff; border-bottom: 1px solid rgba(255,255,255,.35); }
.rw-karte a:not(.rw-knopf):hover { border-bottom-color: #fff; }
.rw-karte .rw-knopf { margin-top: 12px; }
.rw-karte .rw-leise { color: var(--muted); font-size: .8rem; }
.rw-karte-check { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(118deg,rgba(242,5,125,.7),rgba(141,22,245,.55),rgba(20,136,255,.7)) border-box; border: 1px solid transparent; }
#rwRedaktionKarte p { margin: 8px 0; }

/* Inhaltsverzeichnis */
.rw-inhalt { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow: auto; font-size: .86rem; scrollbar-width: thin; }
.rw-inhalt-box { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); }
.rw-inhalt-box summary { min-height: 46px; padding: 0 16px; display: flex; align-items: center; font-weight: 850; cursor: pointer; list-style: none; }
.rw-inhalt-box summary::-webkit-details-marker { display: none; }
.rw-inhalt-box summary::after { content: "⌄"; margin-left: auto; color: var(--muted); }
.rw-inhalt-liste { list-style: none; margin: 0; padding: 0 8px 10px; }
.rw-inhalt-liste ol { list-style: none; margin: 0 0 6px 12px; padding: 0 0 0 12px; border-left: 1px solid var(--line); }
.rw-inhalt-liste a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--text-2); }
.rw-inhalt-liste a:hover { color: #fff; background: rgba(255,255,255,.05); }
.rw-inhalt-liste a span { color: var(--pink-hell); font-variant-numeric: tabular-nums; font-weight: 800; }
.rw-inhalt-kapitel { font-weight: 800; color: var(--text) !important; }
.rw-inhalt-liste ol a { font-size: .82rem; }
.rw-inhalt-liste a.rw-aktiv { color: #fff; background: linear-gradient(118deg,rgba(242,5,125,.16),rgba(20,136,255,.12)); }

/* ------------------------------ Dokument ------------------------------ */
.rw-dokument { padding: 34px 40px 40px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--surface); box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.rw-praeambel { margin: 0 0 30px; padding: 18px 22px; border-radius: 12px; background: var(--surface-up); border-left: 3px solid var(--pink); }
.rw-praeambel h2 { margin: 0 0 8px; color: var(--pink-hell); font-size: .8rem; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.rw-praeambel .rw-text { color: var(--text-2); }
.rw-leer { padding: 40px 16px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.rw-leer p { margin: 6px 0; }

.rw-kapitel { margin-top: 38px; scroll-margin-top: 96px; }
.rw-praeambel + .rw-kapitel, .rw-dokument > h2 + .rw-kapitel, .rw-r-hinweis + .rw-kapitel { margin-top: 8px; }
.rw-kapitel-kopf { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.rw-kapitel-nr { min-width: 64px; margin: 0; padding: 8px 12px; border-radius: 14px; text-align: center; font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; background: linear-gradient(var(--surface-up), var(--surface-up)) padding-box, var(--gradient) border-box; border: 1px solid transparent; }
.rw-kapitel-kopf h2 { margin: 4px 0 0; overflow-wrap: break-word; hyphens: auto; font-size: 1.4rem; line-height: 1.2; letter-spacing: -.015em; font-weight: 850; }
.rw-kapitel-text { margin: 6px 0 0; max-width: 680px; color: var(--text-2); font-size: .95rem; }

.rw-regel { position: relative; padding: 20px 0 18px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 96px; transition: background-color .4s ease; }
.rw-regel:last-of-type { border-bottom: 0; }
.rw-regel.rw-markiert { margin: 0 -18px; padding-inline: 18px; border-radius: 12px; background: rgba(141,22,245,.12); box-shadow: inset 0 0 0 1px rgba(141,22,245,.45); }
.rw-regel-kopf { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.4; font-weight: 800; }
.rw-nr { margin-right: 6px; color: var(--pink-hell); font-variant-numeric: tabular-nums; white-space: nowrap; border-bottom: 1px solid rgba(255,122,184,.4); }
.rw-nr:hover { text-decoration: underline; }
.rw-text { color: var(--text-body); font-size: 1rem; line-height: 1.7; }
.rw-text p { margin: 8px 0 0; }
.rw-text p:first-child { margin-top: 0; }
.rw-text ul { margin: 8px 0 0; padding-left: 24px; }
.rw-text li + li { margin-top: 4px; }
.rw-s1 { padding-left: 2.1em; text-indent: -2.1em; }
.rw-s2 { padding-left: 4.1em; text-indent: -2em; }
.rw-s3 { padding-left: 6em; text-indent: -1.9em; }
.rw-s4 { padding-left: 7.6em; text-indent: -1.6em; }
.rw-verweis { color: var(--blue-hell); border-bottom: 1px dotted currentColor; }
.rw-beispiele { margin-top: 14px; padding: 12px 16px; border-radius: 10px; background: rgba(20,136,255,.08); border-left: 3px solid var(--blue); }
.rw-beispiele-titel { margin: 0 0 4px; color: var(--blue-hell); font-size: .76rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.rw-beispiele .rw-text { font-size: .95rem; color: var(--text-2); }
.rw-sanktion { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 12px 0 0; color: var(--text-2); font-size: .9rem; }
.rw-sanktion span { padding: 2px 9px; border-radius: 999px; color: #ffc2de; background: rgba(242,5,125,.14); font-size: .76rem; font-weight: 850; white-space: nowrap; }
.rw-regel-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; min-height: 32px; margin-top: 12px; }
.rw-historie { margin: 0; color: var(--muted); font-size: .8rem; }
.rw-historie:empty { display: none; }
.rw-aktionen { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.rw-regel-fuss .rw-knopf { min-height: 32px; font-size: .78rem; }

/* Letzte Änderungen */
.rw-fassungen { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rw-fassungen > li + li { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.rw-fassung-kopf { margin: 0 !important; color: var(--text) !important; font-size: .84rem !important; font-weight: 800; }
.rw-fassung-neu { display: inline-block; margin: 6px 0 0 !important; padding: 1px 9px; border-radius: 999px; color: #ffc2de !important; background: rgba(242,5,125,.14); font-size: .76rem !important; font-weight: 850; }
.rw-fassungen ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; color: var(--text-2); font-size: .84rem; }
.rw-fassungen ul a { color: var(--pink-hell) !important; border: 0 !important; font-weight: 800; }
.rw-art { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.rw-art-neu { color: #9ff0bf; background: rgba(46,160,90,.18); }
.rw-art-geaendert { color: #ffdb94; background: rgba(201,150,25,.18); }
.rw-art-verschoben { color: var(--text-2); background: rgba(255,255,255,.08); }
.rw-art-entfernt { color: #ffbcbc; background: rgba(196,56,62,.2); }

.rw-toast { position: fixed; z-index: 140; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, calc(100% - 32px)); padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #15151f; box-shadow: 0 18px 50px rgba(0,0,0,.5); font-size: .9rem; }
.rw-toast-kritisch { border-color: rgba(242,80,80,.6); }
.footer { border-top: 1px solid var(--line-soft); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 28px 0 34px; color: var(--muted); font-size: .82rem; }
.footer-inner a:hover { color: #fff; }

/* ======================== Bearbeiten-Modus (Redaktion) ======================== */
.rw-leiste { position: sticky; top: 76px; z-index: 70; border-bottom: 1px solid rgba(242,5,125,.35); background: rgba(16,10,18,.95); backdrop-filter: blur(14px); }
.rw-leiste-innen { min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 0; }
.rw-leiste-titel { display: inline-flex; align-items: center; gap: 8px; color: var(--pink-hell); font-size: .78rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.rw-leiste-titel::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px rgba(242,5,125,.18); }
.rw-schalter { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.04); font-size: .82rem; font-weight: 800; cursor: pointer; }
.rw-schalter i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #3a3a46; transition: background .2s ease; }
.rw-schalter i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.rw-schalter[aria-pressed="true"] { border-color: rgba(242,5,125,.6); }
.rw-schalter[aria-pressed="true"] i { background: var(--pink); }
.rw-schalter[aria-pressed="true"] i::after { transform: translateX(16px); }
.rw-leiste-info { color: var(--text-2); font-size: .84rem; }
.rw-leiste-info b { color: var(--pink-hell); }
.rw-leiste-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.rw-marke { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid; border-radius: 999px; font-size: .76rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.rw-marke-neu { color: #9ff0bf; border-color: rgba(46,160,90,.55); background: rgba(46,160,90,.15); }
.rw-marke-geaendert { color: #ffdb94; border-color: rgba(201,150,25,.55); background: rgba(201,150,25,.15); }
.rw-marke-entfernen { color: #ffbcbc; border-color: rgba(196,56,62,.6); background: rgba(196,56,62,.16); }
.rw-marke-leise { color: var(--text-2); border-color: var(--line); background: rgba(255,255,255,.04); }
.rw-r-zustand-neu { box-shadow: inset 4px 0 0 #2e9a5a; }
.rw-r-zustand-geaendert { box-shadow: inset 4px 0 0 #c99619; }
.rw-r-zustand-entfernen { box-shadow: inset 4px 0 0 #c4383e; }
.rw-r-regel, .rw-kapitel.rw-r-zustand-neu, .rw-kapitel.rw-r-zustand-geaendert, .rw-kapitel.rw-r-zustand-entfernen, .rw-frage-karte { padding-left: 18px; margin-left: -18px; }
.rw-r-zustand-entfernen > .rw-text, .rw-r-zustand-entfernen > .rw-beispiele, .rw-r-zustand-entfernen > .rw-sanktion, .rw-r-zustand-entfernen .rw-regel-kopf, .rw-r-zustand-entfernen > .rw-antworten { opacity: .5; }
.rw-r-kopfzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.rw-r-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rw-regel-fuss .rw-r-knoepfe { margin: 0 0 0 auto; }
.rw-r-knoepfe .rw-knopf { min-height: 32px; font-size: .78rem; }
.rw-r-neu { display: flex; justify-content: center; padding: 14px 0 4px; }
.rw-r-hinweis { margin: 0 0 22px; padding: 12px 14px; border: 1px solid rgba(242,5,125,.3); border-radius: 10px; background: rgba(242,5,125,.07); color: var(--text-2); font-size: .9rem; }
.rw-r-hinweis b { color: #fff; }
.rw-r-neu-oben { justify-content: flex-start; padding: 0 0 18px; }
.rw-fassung-zahlen { margin: 6px 0 0 !important; color: var(--text-2) !important; font-size: .8rem !important; font-weight: 700; }
.rw-r-leer-kapitel { margin: 12px 0 0; color: var(--muted); font-style: italic; }

/* Regelcheck in der Redaktion */
.rw-quiz { margin-top: 44px; padding-top: 26px; border-top: 2px dashed var(--line); scroll-margin-top: 96px; }
.rw-quiz-kopf { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 14px; }
.rw-quiz-kopf h2 { margin: 4px 0 0; font-size: 1.4rem; font-weight: 850; letter-spacing: -.015em; }
.rw-quiz-kopf .rw-leise { margin: 6px 0 0; font-size: .82rem; }
.rw-fragen { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rw-frage-karte { padding: 14px 16px 14px 18px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-up); }
.rw-frage-karte.rw-r-zustand-neu, .rw-frage-karte.rw-r-zustand-geaendert, .rw-frage-karte.rw-r-zustand-entfernen { margin-left: 0; }
.rw-frage-titel { margin: 0; font-weight: 800; }
.rw-frage-titel span { color: var(--pink-hell); font-variant-numeric: tabular-nums; }
.rw-antworten { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; color: var(--text-2); font-size: .92rem; }
.rw-antworten li { display: flex; gap: 8px; }
.rw-antworten li > span:first-child { width: 1em; flex: none; color: var(--muted); }
.rw-antworten .rw-richtig { color: #b6f5cf; font-weight: 700; }
.rw-antworten .rw-richtig > span:first-child { color: #59d68e; }
.rw-frage-info { margin: 8px 0 0; color: var(--muted); font-size: .84rem; }
.rw-frage-info a { color: var(--blue-hell); }

/* Dialoge */
.rw-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: #101018; box-shadow: 0 40px 120px rgba(0,0,0,.6); }
.rw-dialog-breit { width: min(1120px, calc(100% - 24px)); }
.rw-dialog::backdrop { background: rgba(3,3,6,.72); backdrop-filter: blur(3px); }
.rw-dialog-form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.rw-dialog-kopf { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.rw-dialog-kopf h2 { margin: 0; font-size: 1.05rem; }
.rw-x { width: 36px; height: 36px; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: 1.2rem; cursor: pointer; }
.rw-dialog-inhalt { padding: 18px 20px; overflow: auto; }
.rw-dialog-fuss { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.rw-frage-text { margin: 0; color: var(--text-2); }

.rw-form { display: grid; gap: 14px; }
.rw-feld { display: grid; gap: 6px; }
.rw-feld > span { color: var(--text-2); font-size: .8rem; font-weight: 800; }
.rw-feld small { color: var(--muted); font-size: .78rem; }
.rw-feld .rw-eingabe, .rw-feld select { width: 100%; }
.rw-feld textarea { min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.rw-feld textarea.rw-regeltext { min-height: 230px; }
.rw-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rw-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.rw-vorschau { position: sticky; top: 0; }
.rw-vorschau > p { margin: 0 0 8px; color: var(--muted); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.rw-vorschau-flaeche { padding: 4px 20px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); }
.rw-vorschau-flaeche .rw-regel { border: 0; }
.rw-hilfe { margin: 0; padding: 10px 12px; border-radius: 10px; background: #17171f; color: var(--text-2); font-size: .8rem; line-height: 1.55; }
.rw-hilfe code { color: var(--pink-hell); }
.rw-fehler { margin: 0; padding: 10px 12px; border: 1px solid rgba(242,80,80,.5); border-radius: 10px; color: #ffcaca; background: rgba(242,80,80,.1); font-size: .86rem; }
.rw-antwort-liste { display: grid; gap: 8px; }
.rw-antwort-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.rw-antwort-zeile .rw-eingabe { width: 100%; }
.rw-haken-block { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #15151d; }
.rw-haken-block input { margin-top: 3px; }
.rw-haken-block small { display: block; margin-top: 2px; color: var(--muted); font-size: .8rem; }

/* Freigabe */
.rw-art-wahl { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.rw-art-wahl legend { margin-bottom: 8px; color: var(--text-2); font-size: .8rem; font-weight: 800; }
.rw-art-option { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #15151d; cursor: pointer; }
.rw-art-option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--pink); }
.rw-art-option small { display: block; margin-top: 2px; color: var(--muted); font-size: .8rem; }
.rw-art-option:has(input:checked) { border-color: rgba(242,5,125,.6); background: rgba(242,5,125,.08); }
.rw-folgen-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.rw-gruppe-titel { margin: 8px 0 6px; color: var(--pink-hell); font-size: .8rem; font-weight: 850; letter-spacing: .06em; }
.rw-frei-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rw-frei-eintrag { border: 1px solid var(--line); border-radius: 10px; background: #15151d; }
.rw-frei-zeile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.rw-frei-zeile input { width: 18px; height: 18px; accent-color: var(--pink); flex: none; }
.rw-frei-zeile label { flex: 1; min-width: 0; cursor: pointer; font-size: .9rem; }
.rw-frei-eintrag details { padding: 0 12px 10px 40px; }
.rw-frei-eintrag summary { color: var(--text-2); font-size: .8rem; font-weight: 800; cursor: pointer; }
.rw-diff { display: grid; gap: 8px; margin-top: 8px; font-size: .84rem; }
.rw-diff-feld { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; }
.rw-diff-feld > span { color: var(--muted); font-weight: 800; }
.rw-diff-alt { color: #ffb4b4; text-decoration: line-through; text-decoration-color: rgba(255,180,180,.5); white-space: pre-wrap; }
.rw-diff-neu { color: #b4f0c8; white-space: pre-wrap; }
.rw-diff-text { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: .86rem; line-height: 1.5; }
.rw-diff-text del { color: #ffb4b4; background: rgba(242,80,80,.12); text-decoration: line-through; }
.rw-diff-text ins { color: #b4f0c8; background: rgba(46,160,90,.14); text-decoration: none; }
.rw-verlauf { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .86rem; }
.rw-verlauf li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #15151d; }
.rw-verlauf-kopf { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: .8rem; }
.rw-verlauf-kopf b { color: var(--text); }

/* ------------------------------ Breiten ------------------------------ */
@media (max-width: 1240px) {
  .rw-raster { grid-template-columns: minmax(0, 1fr) 300px; }
  .rw-inhalt { grid-column: 1 / -1; position: static; max-height: none; overflow: visible; }
  .rw-inhalt-liste { columns: 2 280px; column-gap: 18px; }
  .rw-inhalt-liste > li { break-inside: avoid; }
}
@media (max-width: 1023px) {
  .rw-raster { grid-template-columns: minmax(0, 1fr); }
  .rw-seite { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .rw-toast { top: 88px; bottom: auto; }
  .rw-editor { grid-template-columns: minmax(0, 1fr); }
  .rw-vorschau { position: static; }
}
@media (max-width: 760px) {
  .desktop-nav { display: none; }
  .header-inner { gap: 16px; }
  .desktop-nav + .header-actions { margin-left: auto; }
  .rw-held { padding: 32px 0 28px; }
  .rw-held-innen { grid-template-columns: 1fr; gap: 18px; }
  .rw-held-marke { width: 84px; border-radius: 22px; }
  .rw-held-marke span { font-size: 3.1rem; }
  .rw-held h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .rw-raster { padding-top: 18px; }
  .rw-dokument { padding: 22px 16px 26px; border-radius: 14px; }
  .rw-kapitel-kopf { grid-template-columns: 1fr; gap: 8px; }
  .rw-kapitel-nr { justify-self: start; min-width: 0; padding: 4px 12px; font-size: 1rem; }
  .rw-kapitel-kopf h2, .rw-quiz-kopf h2 { font-size: 1.2rem; }
  .rw-quiz-kopf { grid-template-columns: 1fr; gap: 8px; }
  .rw-quiz-kopf .rw-kapitel-nr { justify-self: start; }
  .rw-regel-kopf { font-size: 1.04rem; }
  .rw-s1 { padding-left: 1.7em; text-indent: -1.7em; }
  .rw-s2 { padding-left: 3em; text-indent: -1.6em; }
  .rw-s3 { padding-left: 4.2em; text-indent: -1.5em; }
  .rw-s4 { padding-left: 5.2em; text-indent: -1.3em; }
  .rw-regel.rw-markiert { margin: 0 -10px; padding-inline: 10px; }
  .rw-r-regel, .rw-kapitel.rw-r-zustand-neu, .rw-kapitel.rw-r-zustand-geaendert, .rw-kapitel.rw-r-zustand-entfernen { padding-left: 10px; margin-left: -10px; }
  .rw-aktionen, .rw-regel-fuss .rw-r-knoepfe { margin-left: 0; }
  .rw-zwei { grid-template-columns: 1fr; }
  .rw-leiste { position: static; }
  .rw-leiste-knoepfe { margin-left: 0; }
  .rw-diff-feld { grid-template-columns: 1fr; gap: 2px; }
  .rw-inhalt-liste { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rw-regel { transition: none; }
}

/* ------------------------------ Druck ------------------------------ */
@media print {
  body { background: #fff; color: #000; }
  body::before, .site-header, .footer, .rw-inhalt, .rw-seite, .rw-aktionen, .rw-leiste, .rw-toast, .skip-link, .rw-suche, .rw-held-marke, .rw-trefferzahl { display: none !important; }
  main { padding-top: 0; }
  .rw-held { padding: 0 0 12px; border: 0; background: none; color: #000; }
  .rw-held-innen { display: block; }
  .rw-held-text, .rw-stand, .eyebrow { color: #333; }
  .rw-raster { display: block; padding: 0; }
  .rw-dokument { padding: 0; border: 0; box-shadow: none; background: #fff; }
  .rw-text, .rw-kapitel-text, .rw-sanktion, .rw-beispiele .rw-text, .rw-praeambel .rw-text { color: #111; }
  .rw-nr, .rw-praeambel h2, .rw-beispiele-titel { color: #000; }
  .rw-kapitel-nr { border: 1px solid #000; background: none; color: #000; }
  .rw-praeambel, .rw-beispiele { background: #f4f4f4; }
  .rw-regel { break-inside: avoid; }
  .rw-kapitel-kopf { break-after: avoid; }
  a { text-decoration: none; }
}
