/* Standortring (zentraler Baustein, nur ab 1024 px, nur auf Seiten mit Front-Matter `standortring: true`).
   Ersetzt den Scrollbalken durch einen Ring unten rechts: je Abschnitt ein Punkt an seiner echten Startposition, wachsender Bogen,
   Abschnittsnummer in der Mitte, Tafel aller Abschnitte, „Zurück“ nach jedem Sprung. Farben nur über Token (main-v2.css), Hell und Dunkel.
   Skript: rk-standort.js. Ohne Skript und unter 1024 px bleibt alles wie vorher. */
.rk-standort {
  --rks-bogen: var(--text-primary);
  --rks-ring: 76px;
  --rks-unten: var(--rk-fab-gap, 24px); /* Platz des früheren Nach-oben-Knopfs */
}

@media (min-width: 1024px) {
  html.hat-standort { scrollbar-width: none; }
  html.hat-standort::-webkit-scrollbar, html.hat-standort body::-webkit-scrollbar { display: none; }
  /* Der Standortring ersetzt den Nach-oben-Knopf vollständig (Sprung nach oben: Ring, Tafel, Pos1) */
  body[data-standortring] .rk-totop { display: none !important; }
  [data-standortring] [data-ort] { scroll-margin-top: var(--rks-versatz, 96px); }
}

.rk-standort { position: fixed; right: var(--rk-fab-gap, 24px); bottom: calc(var(--rks-unten) + env(safe-area-inset-bottom, 0px)); z-index: 8990; display: flex; align-items: center; justify-content: flex-end; gap: var(--rk-space-3, 12px); pointer-events: none; font-family: var(--font-ui); }
.rk-standort > * { pointer-events: auto; }
.rk-standort[hidden] { display: none; }

.rk-standort__ring { position: relative; flex: none; display: grid; place-items: center; width: var(--rks-ring); height: var(--rks-ring); padding: 0; border: 1px solid var(--rk-line, currentColor); border-radius: 50%; background: var(--surface-card); color: var(--text-primary); box-shadow: var(--rk-shadow-card, var(--rk-shadow-sm)); cursor: pointer; transition: transform .2s var(--rk-ease-out, ease); }
.rk-standort__ring:active { transform: scale(.94); }
.rk-standort__ring:focus-visible, .rk-standort__zurueck:focus-visible, .rk-standort__tafel button:focus-visible { outline: 2px solid var(--rk-focus-color); outline-offset: 3px; }
.rk-standort__ring svg { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); overflow: visible; pointer-events: none; }
.rk-standort__spur { fill: none; stroke: var(--rk-line, currentColor); stroke-width: 1.5; }
.rk-standort__weg { fill: none; stroke: var(--rks-bogen); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dasharray .12s linear; }
.rk-standort__punkt { fill: var(--surface-card); stroke: var(--text-muted); stroke-width: 1.2; transition: fill .2s ease, stroke .2s ease, r .2s ease; }
.rk-standort__punkt[data-durch] { fill: var(--rks-bogen); stroke: var(--rks-bogen); }
.rk-standort__punkt[data-hier] { r: 3.6; fill: var(--text-primary); stroke: var(--text-primary); }
.rk-standort__signal { fill: var(--text-primary); stroke: var(--surface-card); stroke-width: 1.6; transition: cx .12s linear, cy .12s linear; }
.rk-standort__zahl { position: relative; font-size: 1.125rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.rk-standort__name, .rk-standort__zurueck { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: var(--rk-radius-pill, 999px); font-size: var(--rk-fs-sm, 14px); line-height: 1; }
.rk-standort__name { padding: 12px 16px; background: var(--surface-card); color: var(--text-primary); border: 1px solid var(--rk-line, currentColor); box-shadow: var(--rk-shadow-sm); font-weight: 600; opacity: 0; transform: translateX(8px); transition: opacity .22s ease, transform .22s ease; pointer-events: none; }
.rk-standort__name[data-da] { opacity: 1; transform: none; }
.rk-standort__zurueck { min-height: 48px; padding: 0 18px; border: 1.5px solid var(--text-primary); background: var(--surface-card); color: var(--text-primary); font-weight: 700; box-shadow: var(--rk-shadow-sm); cursor: pointer; }
.rk-standort__zurueck:hover { background: var(--surface-hover); }
.rk-standort__zurueck[hidden], .rk-standort__tafel[hidden] { display: none; }
.rk-standort__zurueck:not([hidden]) + .rk-standort__name { display: none; }

.rk-standort__tafel { position: absolute; right: 0; bottom: calc(var(--rks-ring) + 12px); width: 300px; max-height: min(70vh, 560px); overflow-y: auto; scrollbar-width: thin; padding: var(--rk-space-3, 12px); border: 1px solid var(--rk-line, currentColor); border-radius: var(--rk-radius-lg, 16px); background: var(--surface-card); color: var(--text-primary); box-shadow: var(--rk-shadow-card, var(--rk-shadow-sm)); }
.rk-standort__kopf { display: flex; justify-content: space-between; gap: var(--rk-space-3, 12px); margin: 0; padding: 2px var(--rk-space-2, 8px) var(--rk-space-3, 12px); font-size: var(--rk-fs-xs, 14px); line-height: 1.4; color: var(--text-muted); }
.rk-standort__anteil { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-standort__tafel ol { position: relative; display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.rk-standort__tafel button { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: var(--rk-space-3, 12px); width: 100%; min-height: 44px; padding: 4px var(--rk-space-2, 8px); border: 0; border-radius: var(--rk-radius-sm, 8px); background: none; color: var(--text-primary); font: 500 1rem/1.25 var(--font-ui); text-align: left; cursor: pointer; }
.rk-standort__nr { display: grid; place-items: center; width: 30px; height: 24px; border-radius: 6px; border: 1.2px solid var(--rk-line, currentColor); font-size: var(--rk-fs-xs, 14px); font-weight: 700; line-height: 1; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.rk-standort__tafel button[aria-current="true"] { background: var(--surface-active); font-weight: 700; }
.rk-standort__tafel button[aria-current="true"] .rk-standort__nr { background: var(--text-primary); border-color: var(--text-primary); color: var(--surface-card); }
@media (hover: hover) and (pointer: fine) { .rk-standort__tafel button:hover { background: var(--surface-hover); } }

@media (prefers-reduced-motion: reduce) { .rk-standort, .rk-standort * { transition: none !important; } }
html.no-motion .rk-standort, html.no-motion .rk-standort *, html[data-motion="reduced"] .rk-standort, html[data-motion="reduced"] .rk-standort * { transition: none !important; }
@media print { .rk-standort { display: none; } }
