/* crewmade.io – Rundgang /meineinnung/rundgang (MI-56 v4, v5: Startfrage nach dem Gewerk).
   Jede Klasse und id trägt rg-, jeder Selektor gilt nur im Rundgang: Site-Kopf und -Fuß bleiben unberührt.
   Farben nur über Site-Tokens (site.css) oder die --rg-Tokens unten; Schrift = var(--sans) von body.
   Den Inhalt zwischen <!-- rundgang:inhalt:start/ende --> erzeugt craftsmancrew (docs/rundgang/bauen.mjs crewmade).
   Teil 1: Tokens, Wurzel, statische Fassung. Teil 2: Viewer (Port von craftsmancrew docs/rundgang/vorlage.html),
   sichtbar erst, wenn rundgang.js html.rg-js gesetzt hat. */
:root {
  --rg-akzent: var(--a-innung);
  --rg-akzent-hell: color-mix(in srgb, var(--a-innung) 12%, var(--bg));
  --rg-akzent-tinte: var(--bg);
  --rg-akzent-stark: color-mix(in srgb, var(--a-innung) 84%, var(--ink));
  /* Punkte liegen in beiden Modi auf hellen Bildschirmfotos, darum feste Werte */
  --rg-punkt: #B3261E;
  --rg-punkt-tinte: #FFFFFF;
  --rg-punkt-offen: #16181B;
  --rg-punkt-ring: #FFFFFF;
  --rg-punkt-schatten: 0 1px 4px rgba(0, 0, 0, .35);
  /* Flächen und Schatten der Site */
  --rg-flaeche: var(--menu-bg);
  --rg-flaeche-2: var(--putz);
  --rg-chrom: var(--putz);
  --rg-chrom-punkt: color-mix(in srgb, var(--ink) 22%, var(--putz));
  --rg-schatten: var(--shadow);
  --rg-schatten-karte: var(--shadow);
  /* fest wie im Artifact: Gerät, Bildgrund, Nachweis (liegt auf dem Foto), Schatten von Handy-Rahmen und Blatt */
  --rg-geraet: #17191C;
  --rg-geraet-kante: inset 0 0 0 1px rgba(255, 255, 255, .08);
  --rg-bild-grund: #FFFFFF;
  --rg-nachweis-grund: rgba(255, 255, 255, .86);
  --rg-nachweis-tinte: #3D4148;
  --rg-schatten-rahmen-m: 0 1px 2px rgba(28, 27, 25, .06), 0 6px 18px rgba(28, 27, 25, .08);
  --rg-schatten-blatt: 0 -6px 24px rgba(28, 27, 25, .14);
  /* header.bar 52 px + Linie */
  --rg-bar: 53px;
  --rg-kopf-h: 104px;
  --rg-nav-m: 64px;
  --rg-blatt-h: 0px;
}

/* Wurzel: Rand wie .wrap (16 px, Safe-Area), Breite höchstens 1280 px */
.rg {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  font-size: 16px;
  line-height: 1.5;
}
/* :where hält die Spezifität bei einer Klasse, damit .rg-zu & Co. ihre Farbe behalten (wie im Artifact) */
.rg :where(button), .rg :where(select) { font: inherit; color: inherit; }
.rg :where(button) { cursor: pointer; }
.rg img { display: block; }
.rg [hidden] { display: none !important; }

/* Umschalten: ohne Skript nur die statische Fassung, mit Skript nur der Viewer (rundgang.js setzt html.rg-js) */
html:not(.rg-js) .rg-nur-js { display: none !important; }
html.rg-js .rg-statisch { display: none; }

/* Statische Fassung: der ganze Rundgang als Lesetext (ohne JavaScript, für Suchmaschinen und Leser ohne Skript) */
.rg-statisch { max-width: 760px; margin-inline: auto; padding-bottom: clamp(48px, 8vw, 80px); }
/* v5: Satz mit allen Gewerken vor der Maler-Fassung (wie der Text unter einem Schritt-Titel) */
.rg-st-gewerke { margin-top: 8px; color: var(--ink2); }
.rg-st-kapitel { margin-top: clamp(40px, 6vw, 64px); }
.rg-st-kapitel > h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.15; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rg-st-schritt { margin-top: 32px; }
.rg-st-teil { margin-bottom: 4px; font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--rg-akzent); }
.rg-st-schritt h3 { font-size: 1.25rem; line-height: 1.25; }
.rg-st-schritt h3 + p { margin-top: 8px; color: var(--ink2); }
.rg-st-bild { margin: 16px 0 0; }
.rg-st-bild img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--putz); }
/* Handy-Aufnahmen (405 × 880) in voller Spaltenbreite wären am Schreibtisch über 1600 px hoch */
.rg-st-app img { max-width: 360px; border-radius: 24px; }
.rg-st-bild figcaption { margin-top: 8px; font-size: .8125rem; line-height: 1.4; color: var(--ink2); }
.rg-st-punkte, .rg-st-stufen { display: grid; gap: 8px; margin: 16px 0 0; padding-left: 1.5em; }
.rg-st-punkte li::marker, .rg-st-stufen li::marker { color: var(--rg-akzent); font-weight: 600; }
.rg-st-punkte b { font-weight: 600; }
.rg-st-stufen { gap: 12px; }
.rg-st-stufen h4 { margin: 0; font-size: 1.0625rem; }
.rg-st-stufen p { margin-top: 2px; color: var(--ink2); }
.rg-st-knoepfe { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 20px; }

/* ---------- Viewer: Kopf (klebt unter header.bar) ---------- */
.rg-kopf {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + var(--rg-bar));
  z-index: 9;
  background: var(--bg);
  height: var(--rg-kopf-h);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}
.rg-kopf-zeile { display: flex; align-items: center; gap: 20px; height: 58px; min-width: 0; }
.rg-marke { display: flex; align-items: baseline; gap: 10px; flex: none; min-width: 0; margin: 0; font-size: 20px; letter-spacing: -.01em; }
.rg-marke-wort { font-weight: 700; }
.rg-marke-wort span { color: var(--rg-akzent); }
.rg-marke-sub { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink2); padding-left: 10px; border-left: 1px solid var(--line); }
/* Ohne Skript: Kopf = Überschrift über der Lesespalte, klebt nicht */
html:not(.rg-js) .rg-kopf { position: static; height: auto; max-width: 760px; margin-inline: auto; padding-block: 24px 4px; border-bottom: 0; }
html:not(.rg-js) .rg-kopf-zeile { height: auto; }
html:not(.rg-js) .rg-marke { flex-wrap: wrap; font-size: 1.375rem; line-height: 1.2; }

.rg-beispiel {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.rg-beispiel b { color: var(--ink); font-weight: 600; }
/* Gewerk-Auswahl (alle Breiten): Anzeige „Name ▾“, darüber unsichtbar das native select (Muster der Kapitel-Auswahl) */
.rg-gewerk-wahl {
  flex: none;
  position: relative;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--rg-flaeche);
}
.rg-gewerk-wahl:has(select:focus-visible) { outline: 2px solid var(--rg-akzent); outline-offset: 2px; }
.rg-gewerk-anzeige {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 10px 0 16px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.rg-gewerk-anzeige svg { flex: none; color: var(--ink2); }
.rg-gewerk-wahl select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
  border: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.rg-kapitel-leiste { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.rg-kapitel-leiste::-webkit-scrollbar { display: none; }
.rg-kapitel-leiste ol { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; height: 45px; align-items: stretch; }
.rg-kapitel-leiste button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 10px 0 0;
  margin-right: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink2);
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
}
.rg-kapitel-leiste .rg-nr {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rg-kapitel-leiste button:hover { color: var(--ink); }
.rg-kapitel-leiste button.rg-erledigt .rg-nr { background: var(--rg-akzent-hell); border-color: transparent; color: var(--rg-akzent); }
.rg-kapitel-leiste button[aria-current="step"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--rg-akzent); }
.rg-kapitel-leiste button[aria-current="step"] .rg-nr { background: var(--rg-akzent); border-color: var(--rg-akzent); color: var(--rg-akzent-tinte); }

/* Kapitel-Auswahl + Fortschritt (nur Handy) */
.rg-kapitel-wahl, .rg-fortschritt { display: none; }

/* ---------- Startfrage: Gewerk wählen (rundgang.js setzt html.rg-frage-offen, solange sie steht) ---------- */
html.rg-js.rg-frage-offen .rg-inhalt,
html.rg-js.rg-frage-offen .rg-kapitel-leiste,
html.rg-js.rg-frage-offen .rg-kapitel-wahl,
html.rg-js.rg-frage-offen .rg-fortschritt,
html.rg-js.rg-frage-offen .rg-beispiel,
html.rg-js.rg-frage-offen .rg-gewerk-wahl { display: none; }
html.rg-js.rg-frage-offen .rg-kopf { height: auto; }
.rg-frage { max-width: 860px; padding-block: clamp(28px, 5vw, 56px) clamp(40px, 7vw, 72px); }
#rg-frage-titel {
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.rg-frage .rg-lead { max-width: 640px; margin-bottom: 28px; }
.rg-frage-liste { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.rg-frage-liste li { display: grid; min-width: 0; }
.rg-frage-anderes { grid-column: 1 / -1; }
.rg-frage-wahl {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--rg-flaeche);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.rg-frage-wahl:hover { border-color: var(--rg-akzent); text-decoration: none; }
.rg-frage-wahl small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--ink2); }
/* Fokus per Skript (nach der Wahl bzw. Zurück auf die Frage): Überschriften ohne Ring */
#rg-frage-titel:focus, #rg-titel:focus { outline: none; }

/* ---------- Viewer: Inhalt ---------- */
.rg-inhalt {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 36px;
  padding-block: 22px 20px;
  height: calc(100vh - var(--rg-kopf-h) - var(--rg-bar) - env(safe-area-inset-top, 0px));
  min-height: 520px;
}
.rg-text-spalte { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rg-ort {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rg-akzent);
}
.rg-ort span { color: var(--ink2); font-weight: 500; }
.rg-teil {
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--rg-akzent-hell);
  color: var(--rg-akzent);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}
#rg-titel {
  font-weight: 600;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.rg-lead { margin: 0 0 18px; color: var(--ink2); font-size: 16px; text-wrap: pretty; }
.rg-hinweis-zeile {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 13.5px;
  color: var(--ink2);
}
.rg-hinweis-zeile::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rg-akzent);
  box-shadow: 0 0 0 1.5px var(--rg-flaeche), 0 0 0 2.5px var(--line);
}
.rg-beispiel-m { display: none; }

.rg-nav { margin-top: auto; padding-top: 20px; display: flex; align-items: center; gap: 12px; }
.rg-nav button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--rg-flaeche);
}
.rg-nav button:disabled { opacity: .4; cursor: default; }
.rg-nav #rg-weiter { background: var(--rg-akzent); border-color: var(--rg-akzent); color: var(--rg-akzent-tinte); margin-left: auto; }
.rg-nav #rg-weiter:not(:disabled):hover { background: var(--rg-akzent-stark); }
.rg-zaehler { font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Viewer: Bühne ---------- */
.rg-buehne {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rg-rahmen { margin: 0; position: relative; }
.rg-rahmen.rg-web {
  width: min(100%, calc((100vh - var(--rg-kopf-h) - var(--rg-bar) - 42px - 30px) * 1.6));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--rg-chrom);
  box-shadow: var(--rg-schatten);
}
.rg-browser-leiste {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
}
.rg-browser-leiste i { width: 9px; height: 9px; border-radius: 50%; background: var(--rg-chrom-punkt); }
.rg-browser-leiste .rg-adresse {
  margin-left: 12px;
  flex: 0 1 260px;
  min-width: 0;
  height: 18px;
  border-radius: 5px;
  background: var(--rg-flaeche);
  font-size: 11px;
  line-height: 18px;
  color: var(--ink2);
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
}
.rg-rahmen.rg-app .rg-browser-leiste { display: none; }
.rg-bild-feld { position: relative; }
/* <picture> ohne eigene Box: das Bild füllt das Bildfeld wie im Artifact */
.rg-bild-feld picture { display: contents; }
.rg-nachweis {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 6px 0 11px 0;
  background: var(--rg-nachweis-grund);
  color: var(--rg-nachweis-tinte);
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rg-rahmen.rg-web .rg-bild-feld { aspect-ratio: 1440 / 900; }
.rg-rahmen.rg-web img { width: 100%; height: 100%; border-radius: 0 0 11px 11px; background: var(--rg-flaeche); }
.rg-rahmen.rg-app {
  height: calc(100vh - var(--rg-kopf-h) - var(--rg-bar) - 42px);
  aspect-ratio: 421 / 896;
  max-height: 760px;
  padding: 8px;
  border-radius: 38px;
  background: var(--rg-geraet);
  box-shadow: var(--rg-schatten), var(--rg-geraet-kante);
}
.rg-rahmen.rg-app .rg-bild-feld { height: 100%; aspect-ratio: 405 / 880; }
.rg-rahmen.rg-app img { width: 100%; height: 100%; border-radius: 30px; background: var(--rg-bild-grund); }

/* Hinweis-Punkte: 40 px Trefferfläche, 20 px sichtbar */
.rg-punkt {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  border-radius: 50%;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.rg-punkt .rg-nr {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--rg-punkt);
  color: var(--rg-punkt-tinte);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1.5px var(--rg-punkt-ring), var(--rg-punkt-schatten);
  transition: transform .15s ease, background-color .15s ease;
}
.rg-punkt:hover .rg-nr { transform: scale(1.15); }
.rg-punkt:focus-visible { outline: none; }
.rg-punkt:focus-visible .rg-nr { outline: 2px solid var(--rg-punkt-offen); outline-offset: 2px; }
.rg-punkt[aria-expanded="true"] .rg-nr { background: var(--rg-punkt-offen); transform: scale(1.15); }

/* Erklärung: Sprechblase am Punkt (breit) / Blatt von unten (Handy) */
.rg-karte {
  position: absolute;
  z-index: 5;
  width: 300px;
  max-width: calc(100% - 16px);
  left: var(--kx, 0px);
  top: var(--ky, 0px);
  padding: 12px 14px 14px;
  border-radius: 10px;
  background: var(--rg-flaeche);
  border: 1px solid var(--line);
  box-shadow: var(--rg-schatten-karte);
  animation: rg-auf .14s ease-out;
}
.rg-karte::before {
  content: "";
  position: absolute;
  top: calc(var(--py, 24px) - 6px);
  width: 12px;
  height: 12px;
  background: var(--rg-flaeche);
  border: 0 solid var(--line);
  transform: rotate(45deg);
}
.rg-karte.rg-rechts::before { left: -7px; border-width: 0 0 1px 1px; }
.rg-karte.rg-links::before { right: -7px; border-width: 1px 1px 0 0; }
.rg-karte.rg-ohne-pfeil::before { display: none; }
.rg-karte-kopf { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.rg-karte-kopf .rg-nr {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--rg-punkt-offen); color: var(--rg-punkt-tinte);
  box-shadow: 0 0 0 1.5px var(--rg-punkt-ring);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rg-karte h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.rg-karte p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.rg-zu, .rg-karte-fuss button {
  flex: none;
  width: 32px; height: 32px;
  border: 0; background: transparent; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink2);
}
.rg-zu { margin: -6px -8px -4px 0; }
.rg-zu:hover, .rg-karte-fuss button:not(:disabled):hover { background: var(--rg-flaeche-2); color: var(--ink); }
.rg-karte-fuss { display: none; }
@keyframes rg-auf { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes rg-hoch { from { transform: translateY(100%); } to { transform: none; } }
@keyframes rg-rein-vor { from { opacity: .3; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes rg-rein-zurueck { from { opacity: .3; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* Abschluss: So startet Ihre Innung (Knöpfe = .pill der Site) */
.rg-start { width: 100%; max-width: 860px; align-self: flex-start; }
.rg-stufen { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rg-stufen li {
  background: var(--rg-flaeche);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 24px;
  min-width: 0;
}
.rg-stufen .rg-nr {
  display: block;
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--rg-akzent);
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
.rg-stufen h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; }
.rg-stufen p { margin: 0; font-size: 15px; color: var(--ink2); }
.rg-knoepfe { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Handy: schmal oder niedrig (Gegenstück zu matchMedia in rundgang.js) ---------- */
@media (max-width: 899px), (max-height: 559px) {
  :root { --rg-kopf-h: auto; }
  .rg-kopf { height: auto; border-bottom: 0; padding-bottom: 6px; }
  .rg-kopf-zeile { height: 52px; gap: 10px; }
  .rg-marke { flex: 1 1 auto; gap: 8px; font-size: 18px; }
  .rg-marke-sub { font-size: 12px; padding-left: 8px; }
  .rg-beispiel { display: none; }
  .rg-gewerk-wahl { height: 40px; }
  .rg-gewerk-anzeige { padding: 0 8px 0 14px; font-size: 13.5px; }

  .rg-frage { padding-block: 20px 32px; }
  #rg-frage-titel { font-size: 24px; line-height: 1.2; margin-bottom: 8px; }
  .rg-frage .rg-lead { font-size: 15px; margin-bottom: 20px; }
  .rg-frage-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rg-frage-wahl { min-height: 56px; padding: 10px 14px; font-size: 15px; }

  .rg-kapitel-leiste { display: none; }
  .rg-kapitel-wahl {
    display: block;
    position: relative;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--rg-flaeche);
  }
  .rg-kapitel-wahl:has(select:focus-visible) { outline: 2px solid var(--rg-akzent); outline-offset: 2px; }
  .rg-kapitel-anzeige {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 10px 0 12px;
    font-size: 14px;
    font-weight: 500;
    min-width: 0;
  }
  .rg-kapitel-anzeige b { flex: none; color: var(--rg-akzent); font-weight: 600; font-variant-numeric: tabular-nums; }
  .rg-kapitel-anzeige .rg-trenner { flex: none; color: var(--ink2); opacity: .5; }
  .rg-kapitel-anzeige .rg-kw-titel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rg-kapitel-anzeige svg { flex: none; color: var(--ink2); }
  .rg-kapitel-wahl select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    font-size: 16px;
    border: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
  }
  .rg-fortschritt { display: flex; gap: 3px; height: 3px; margin: 10px 0 0; }
  .rg-fortschritt span { flex: 1; border-radius: 2px; background: var(--line); overflow: hidden; }
  .rg-fortschritt i { display: block; height: 100%; width: 0; background: var(--rg-akzent); transition: width .2s ease; }

  .rg-inhalt {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: auto;
    min-height: 0;
    padding-block: 10px calc(var(--rg-nav-m) + var(--rg-blatt-h) + 24px + env(safe-area-inset-bottom, 0px));
  }
  .rg-buehne { order: 0; }
  .rg-text-spalte { order: 1; }
  .rg-inhalt.rg-ohne-bild .rg-buehne { order: 2; }

  .rg-ort { display: none; }
  .rg-teil { font-size: 12px; margin-bottom: 8px; }
  #rg-titel { font-size: 22px; line-height: 1.2; margin-bottom: 8px; }
  .rg-lead { font-size: 15px; margin-bottom: 14px; }
  .rg-hinweis-zeile { font-size: 13px; }
  .rg-beispiel-m { display: block; margin: 10px 0 0; font-size: 12.5px; color: var(--ink2); }
  .rg-beispiel-m b { color: var(--ink); font-weight: 600; }

  .rg-rahmen { touch-action: pan-y pinch-zoom; }
  .rg-rahmen.rg-rein-vor { animation: rg-rein-vor .22s ease-out; }
  .rg-rahmen.rg-rein-zurueck { animation: rg-rein-zurueck .22s ease-out; }
  .rg-rahmen.rg-web { width: 100%; border-radius: 10px; box-shadow: var(--rg-schatten-rahmen-m); }
  .rg-browser-leiste { height: 16px; padding: 0 8px; gap: 4px; }
  .rg-browser-leiste i { width: 5px; height: 5px; }
  .rg-browser-leiste .rg-adresse { display: none; }
  .rg-rahmen.rg-web img { border-radius: 0 0 9px 9px; }
  .rg-nachweis { font-size: 9.5px; padding: 1px 6px; border-radius: 5px 0 9px 0; }
  /* Gerät passt samt Site-Kopf (--rg-bar) und Rundgang-Kopf in die Fensterhöhe */
  .rg-rahmen.rg-app {
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    width: min(300px, 100%, calc((100svh - 330px - var(--rg-bar)) * .46 + 8px));
    min-width: 220px;
    padding: 4px;
    border-radius: 28px;
  }
  .rg-rahmen.rg-app .rg-bild-feld { height: auto; }
  .rg-rahmen.rg-app img { border-radius: 24px; }

  .rg-karte {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(var(--rg-nav-m) + env(safe-area-inset-bottom, 0px));
    z-index: 7;
    width: auto;
    max-width: none;
    max-height: 50svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    box-shadow: var(--rg-schatten-blatt);
    animation: rg-hoch .2s ease-out;
  }
  .rg-karte::before { display: none; }
  .rg-karte-kopf { gap: 12px; margin-bottom: 6px; }
  .rg-karte-kopf .rg-nr { width: 24px; height: 24px; font-size: 12px; margin-top: 0; }
  .rg-karte h2 { font-size: 17px; line-height: 1.4; }
  .rg-karte p { font-size: 15px; }
  .rg-zu, .rg-karte-fuss button { width: 40px; height: 40px; }
  .rg-zu { margin: -9px -10px -6px 0; }
  .rg-karte-fuss {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 10px -10px 0 0;
    border-top: 1px solid var(--line);
    padding-top: 4px;
  }
  .rg-karte-fuss span { flex: 1; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
  .rg-karte-fuss button:disabled { opacity: .3; cursor: default; }

  .rg-stufen { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 20px; }
  .rg-stufen li { padding: 16px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
  .rg-stufen .rg-nr { font-size: 28px; margin: 0; grid-row: span 2; }
  .rg-knoepfe .pill { flex: 1 1 100%; }

  .rg-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 8;
    margin: 0;
    height: calc(var(--rg-nav-m) + env(safe-area-inset-bottom, 0px));
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .rg-nav button { flex: 1; }
  .rg-nav #rg-weiter { margin-left: 0; }

  /* Der feste Zurück/Weiter-Balken verdeckt am Seitenende nicht Impressum und Datenschutz */
  html.rg-js:not(.rg-frage-offen) footer.foot { padding-bottom: calc(var(--rg-nav-m) + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .rg-karte, .rg-rahmen.rg-rein-vor, .rg-rahmen.rg-rein-zurueck { animation: none; }
  .rg-punkt .rg-nr, .rg-fortschritt i { transition: none; }
}
