/* Fränkische Kleinplaneten – Ergänzungen zum Museums-Theme (theme.9.css).
   Alle eigenen Klassen beginnen mit "kp-", damit nichts mit YOOtheme/UIkit kollidiert. */

.kp {
  --kp-gold: #ffb830;
  --kp-mono: ui-monospace, 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, 'DejaVu Sans Mono', monospace;
  --kp-gold-dunkel: #e1a32f;
  --kp-nacht: #1d1c2b;
  --kp-nacht-2: #161521;
  --kp-rand: #2e2e3d;
  --kp-text: #a9a6b3;
  --kp-text-hell: #fdfcff;
  --kp-text-leise: #787789;
  --kp-panel: rgba(22, 21, 33, 0.86);
  --kp-vh: 100vh;
  --kp-nav-h: 60px;
  background: #000;
  font-family: Montserrat, "Trebuchet MS", Verdana, sans-serif;
}
/* dvh berücksichtigt die ein- und ausfahrende Adressleiste am Handy */
@supports (height: 100dvh) { .kp { --kp-vh: 100dvh; } }

.kp-dachzeile {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kp-text-leise);
}
.kp-lead { color: var(--kp-text); }

/* ------------------------------------------------------------ Blöcke: immer nur einer sichtbar
   Block + Navigation füllen zusammen genau den Bildschirm; längere Blöcke scrollen, die Navigation bleibt unten. */
.kp-seite { display: flex; flex-direction: column; min-height: var(--kp-vh); }
.kp-bloecke { flex: 1 0 auto; }
.kp-block {
  position: relative;              /* hält auch absolut positionierte Inhalte beim Zuklappen zurück */
  box-sizing: border-box;
  display: flex; flex-direction: column;
  width: 90vw; margin-inline: auto;
  min-height: calc(var(--kp-vh) - var(--kp-nav-h));
  padding-bottom: 16px;
  background: #000;
}
.kp-block-voll { width: 100%; padding-bottom: 0; }
/* Zuklappen statt display:none: Diagramme, Karte und 3D-Szene behalten so ihre echten Maße (siehe js/bloecke.js) */
.kp-block-zu { display: block; height: 0; min-height: 0; padding-bottom: 0; overflow: hidden; visibility: hidden; }
.kp-block > .kp-dkarte { flex: 1 0 auto; margin: 0; }
.kp-block > .kp-dkarte:first-child { margin-top: 16px; }
/* Blöcke mit wenig Inhalt: mittig statt oben mit viel Leerraum darunter */
.kp-block-mittig > .kp-dkarte { display: flex; flex-direction: column; justify-content: center; }
.kp-block-mittig > .kp-dkarte > * { width: 100%; max-width: 960px; margin-inline: auto; box-sizing: border-box; }
.kp-block-mittig > .kp-dkarte > h2 { font-size: clamp(1.8rem, 3.2vw, 3rem); }
.kp-block-mittig > .kp-dkarte > p { font-size: 16px; }
.kp-block-mittig > .kp-dkarte > .kp-quelle-d, .kp-block-mittig > .kp-dkarte > .uk-text-small { font-size: 13px; }

.kp-nav {
  position: sticky; bottom: 0; z-index: 20;
  box-sizing: border-box; height: var(--kp-nav-h);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 8px 5vw;
  background: var(--kp-nacht-2); border-top: 1px solid var(--kp-rand);
}
.kp-nav[hidden] { display: none; }
.kp-nav-knopf {
  display: inline-flex; align-items: center; gap: 10px;
  max-width: 100%; height: 44px; padding: 0 14px;
  font-family: Montserrat, sans-serif; text-align: left;
}
.kp-nav-zurueck { justify-self: start; }
.kp-nav-weiter { justify-self: end; text-align: right; }
.kp-nav-knopf:disabled { opacity: 0.35; cursor: default; }
.kp-nav-knopf:disabled:hover { border-color: var(--kp-rand); color: var(--kp-text-hell); }
.kp-nav-pfeil { font-size: 24px; line-height: 1; }
.kp-nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.kp-nav-text small { font-size: 11px; opacity: 0.8; }
.kp-nav-text b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-nav-wahl { width: 100%; max-width: 300px; height: 44px; }
.kp-nav-auswahl {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 8px 16px;
  background: var(--kp-nacht); color: var(--kp-gold);
  border: 1px solid var(--kp-gold-dunkel); border-radius: 999px;
  font: 500 13px/1.2 Montserrat, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.kp-nav-auswahl:hover, .kp-nav-auswahl:focus-visible { background: var(--kp-gold-dunkel); color: var(--kp-nacht); outline: none; }
.kp-nurleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------ Bühne */
.kp-buehne {
  position: relative;
  height: calc(var(--kp-vh) - var(--kp-nav-h));
  min-height: 520px;
  background: #000;
  overflow: hidden;
}
.kp-canvas, .kp-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kp-canvas canvas { touch-action: none; cursor: grab; }
.kp-labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; } /* eigener Stapelkontext */

.kp-anker { width: 0; height: 0; position: relative; }
.kp-label {
  position: absolute; left: 9px; top: 0;
  transform: translateY(-50%);       /* rechts neben den Punkt */
  font-size: 11px;
  color: var(--kp-text);           /* Schrift nie in Datenfarbe – der Punkt trägt die Farbe */
  white-space: nowrap;
  text-shadow: 0 0 3px #000, 0 0 6px #000;
  opacity: 0.85;
}
.kp-label-aktiv { font-size: 13px; font-weight: 500; opacity: 1; color: var(--kp-text-hell); }
.kp-label-planet { color: var(--kp-text-hell); font-size: 12px; opacity: 0.75; }

/* ------------------------------------------------------------ Panels */
.kp-panel {
  position: absolute;
  background: var(--kp-panel);
  border: 1px solid var(--kp-rand);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--kp-text);
  font-size: 14px;
  backdrop-filter: blur(6px);
  z-index: 2;
  scrollbar-color: var(--kp-rand) transparent;
  scrollbar-width: thin;
}
.kp-willkommen {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  box-sizing: border-box; width: min(620px, calc(100% - 32px)); max-height: calc(100% - 32px);
  overflow-y: auto; padding: 24px 28px;
  background: rgba(22, 21, 33, 0.94);
  z-index: 6;
}
.kp-titel { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; }
.kp-willkommen .kp-lead { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.55; }
.kp-willkommen-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.kp-willkommen-knoepfe .uk-button { line-height: 1.3; padding-block: 11px; }
.kp-zeit { top: 16px; left: 16px; }
.kp-ansicht { top: 16px; right: 16px; width: 230px; }
.kp-steckbrief {
  left: 16px; top: 172px; bottom: 36px;
  width: 360px;
  overflow-y: auto;
  z-index: 3;
}

.kp-datum {
  /* feste Zeichenbreite, damit das Datum beim Abspielen nicht springt; Breite reicht für "30. September 2026" */
  font-family: var(--kp-mono);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  white-space: pre;
  min-width: 18ch;
  color: var(--kp-gold);
  line-height: 1.2;
  margin-bottom: 8px;
}
.kp-zeit-knoepfe { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

.kp-knopf {
  background: var(--kp-nacht);
  color: var(--kp-text-hell);
  border: 1px solid var(--kp-rand);
  border-radius: 4px;
  min-width: 38px; height: 34px;
  font-size: 15px;
  cursor: pointer;
}
.kp-knopf:hover, .kp-knopf:focus-visible { border-color: var(--kp-gold); color: var(--kp-gold); outline: none; }
.kp-knopf.aktiv { background: var(--kp-gold-dunkel); color: var(--kp-nacht); border-color: transparent; }
.kp-knopf-haupt { background: var(--kp-gold-dunkel); color: var(--kp-nacht); border-color: transparent; }
.kp-knopf-haupt:hover, .kp-knopf-haupt:focus-visible { background: var(--kp-gold); color: var(--kp-nacht); }
.kp-knopf-haupt:focus-visible { outline: 2px solid var(--kp-text-hell); outline-offset: 2px; }
.kp-knopf-text { padding: 0 12px; font-size: 13px; font-family: Montserrat, sans-serif; }
.kp-knopf-klein { height: 28px; margin-top: 10px; width: 100%; }

.kp-auswahl {
  background: var(--kp-nacht);
  color: var(--kp-text-hell);
  border: 1px solid var(--kp-rand);
  border-radius: 4px;
  height: 34px;
  padding: 0 6px;
  font: inherit; font-size: 13px;
  color-scheme: dark;
}
.kp-warnung { margin-top: 8px; max-width: 280px; font-size: 12px; color: #fe6b45; }

.kp-umschalter { display: flex; border: 1px solid var(--kp-rand); border-radius: 4px; overflow: hidden; }
.kp-umschalter-knopf {
  flex: 1;
  background: var(--kp-nacht); color: var(--kp-text);
  border: 0; padding: 7px 4px;
  font: inherit; font-size: 12px; cursor: pointer;
}
.kp-umschalter-knopf.aktiv { background: var(--kp-gold-dunkel); color: var(--kp-nacht); font-weight: 500; }
.kp-hinweis { font-size: 12px; line-height: 1.45; margin: 8px 0 10px; color: var(--kp-text); }

.kp-filter { display: flex; flex-direction: column; gap: 4px; }
.kp-filter-knopf {
  --kp-farbe: #fff;
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 3px 0;
  color: var(--kp-text-hell); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.kp-filter-knopf::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--kp-farbe); box-shadow: 0 0 6px var(--kp-farbe); flex: none;
}
.kp-filter-knopf .kp-anzahl { color: var(--kp-text-leise); margin-left: auto; }
.kp-filter-knopf[aria-pressed="false"] { color: var(--kp-text-leise); text-decoration: line-through; }
.kp-filter-knopf[aria-pressed="false"]::before { background: transparent; box-shadow: inset 0 0 0 1px var(--kp-farbe); }
/* "alle Namen zeigen" – gleiche Optik wie die Filterzeilen darüber */
.kp-check {
  display: flex; align-items: center; gap: 8px; padding: 3px 0; margin-top: 6px;
  font-size: 13px; color: var(--kp-text-leise); cursor: pointer;
}
.kp-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.kp-check span { display: flex; align-items: center; gap: 8px; }
.kp-check span::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1px var(--kp-text-hell);
}
.kp-check input:checked + span { color: var(--kp-text-hell); }
.kp-check input:checked + span::before { background: var(--kp-text-hell); box-shadow: 0 0 6px var(--kp-text-hell); }
.kp-check input:focus-visible + span { outline: 1px solid var(--kp-gold-dunkel); outline-offset: 3px; border-radius: 2px; }

.kp-bedienhinweis {
  position: absolute; left: 16px; bottom: 8px; margin: 0;
  font-size: 12px; color: var(--kp-text-leise); pointer-events: none;
}
/* ------------------------------------------------------------ Hilfe */
.kp-hilfe-knopf {
  position: absolute; right: 16px; bottom: 16px; z-index: 4;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--kp-panel); border: 1px solid var(--kp-rand);
  color: var(--kp-text-hell); font: 600 17px/1 Montserrat, sans-serif; cursor: pointer;
}
.kp-hilfe-knopf:hover, .kp-hilfe-knopf:focus-visible, .kp-hilfe-knopf[aria-expanded="true"] {
  border-color: var(--kp-gold); color: var(--kp-gold); outline: none;
}
.kp-hilfe {
  right: 16px; bottom: 62px; width: 360px; max-height: calc(100% - 80px);
  overflow-y: auto; z-index: 5;
}
.kp-hilfe h3 { margin: 0 0 10px; font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--kp-gold); }
.kp-hilfe-liste { margin: 0; }
.kp-hilfe-liste dt { color: var(--kp-text-hell); font-weight: 600; font-size: 13px; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.kp-hilfe-liste dd { margin: 2px 0 0 30px; font-size: 13px; line-height: 1.45; }
.kp-hz { flex: none; width: 22px; height: 10px; position: relative; }
.kp-hz-punkt::before { content: ''; position: absolute; left: 6px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--kp-gold); }
.kp-hz-bahn { border-top: 2px solid rgba(255, 184, 48, 0.45); height: 0; }
.kp-hz-planet { border-top: 2px solid #5a5970; height: 0; }
.kp-hz-lot { border-top: 2px dashed var(--kp-text-hell); height: 0; }
.kp-hz-stern::before { content: ''; position: absolute; left: 8px; top: 2px; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.5); }
.kp-hilfe-fuss { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--kp-rand); font-size: 12px; color: var(--kp-text-leise); line-height: 1.5; }
.kp-hilfe-fuss b { color: var(--kp-text); }

.kp-fehler { position: absolute; inset: 40% 10% auto; text-align: center; color: #fe6b45; }

/* ------------------------------------------------------------ Steckbrief */
.kp-schliessen {
  position: sticky; top: 0; float: right;
  background: none; border: 0; color: var(--kp-text); font-size: 26px; line-height: 1; cursor: pointer;
}
.kp-schliessen:hover { color: var(--kp-gold); }
.kp-steckbrief h3 { margin: 0 0 6px; font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--kp-gold); }
.kp-steckbrief h3 .kp-nr { color: var(--kp-text-leise); font-size: 1rem; font-family: Montserrat, sans-serif; }
.kp-steckbrief h4 {
  margin: 16px 0 6px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--kp-text-leise); font-family: Montserrat, sans-serif;
}
.kp-steckbrief p { margin: 0 0 8px; line-height: 1.5; }
.kp-marke {
  --kp-farbe: #a9a6b3;
  display: inline-flex; align-items: center; gap: 6px; margin: 0 4px 6px 0; padding: 2px 8px;
  border: 1px solid var(--kp-rand); border-radius: 999px;
  color: var(--kp-text-hell); font-size: 11px;
}
.kp-marke::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--kp-farbe); }
.kp-widmung { color: var(--kp-text-hell); }
.kp-werte { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.kp-werte dt { color: var(--kp-text-leise); font-weight: 400; }
.kp-werte dd { margin: 0; color: var(--kp-text-hell); font-variant-numeric: tabular-nums; }
.kp-werte dd small { color: var(--kp-text); }
.kp-jetzt { background: rgba(255, 184, 48, 0.07); border-left: 2px solid var(--kp-gold); padding: 8px 10px; border-radius: 0 4px 4px 0; }
.kp-erklaer { font-size: 12px; color: var(--kp-text); }
.kp-steckbrief details { margin-top: 12px; font-size: 13px; }
.kp-steckbrief summary { cursor: pointer; color: var(--kp-gold); }
.kp-steckbrief a { color: var(--kp-gold); }
.kp-luecke { color: #fe6b45; font-style: italic; }

/* ------------------------------------------------------------ Liste */
.kp-suche { max-width: 420px; margin: 8px 0 24px; }
.kp-gruppe { margin-bottom: 32px; }
.kp-gruppe-titel { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; }
.kp-gruppe-titel::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--kp-farbe);
}
.kp-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.kp-karte {
  --kp-farbe: #fff;
  text-align: left;
  background: #000; color: var(--kp-text);
  border: 1px solid var(--kp-rand); border-left: 3px solid var(--kp-farbe);
  border-radius: 4px; padding: 10px 12px;
  font: inherit; font-size: 13px; line-height: 1.45; cursor: pointer;
}
.kp-karte:hover, .kp-karte:focus-visible { border-color: var(--kp-farbe); outline: none; }
.kp-karte.kp-markiert { border-color: var(--kp-text-hell); border-left-color: var(--kp-farbe);
  background: #1d1c2b; box-shadow: 0 0 0 1px var(--kp-text-hell); }
.kp-karte strong { display: block; color: var(--kp-text-hell); font-size: 15px; font-weight: 500; }
.kp-karte .kp-nr { color: var(--kp-text-leise); font-weight: 400; }
.kp-karte span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.kp-quellen ul { font-size: 14px; }
.kp-quellen a { color: var(--kp-gold); }

/* ------------------------------------------------------------ Geschichte */
.kp-knopf-geschichte {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: auto; min-height: 44px;
  margin-top: 10px; padding: 8px 12px;
  background: var(--kp-gold-dunkel); color: var(--kp-nacht); border-color: transparent;
  font-family: Montserrat, sans-serif; font-size: 13px; font-weight: 500; line-height: 1.25; text-align: left;
}
.kp-knopf-geschichte:hover, .kp-knopf-geschichte:focus-visible { background: var(--kp-gold); color: var(--kp-nacht); }
.kp-knopf-geschichte span { display: flex; flex-direction: column; }
.kp-knopf-geschichte small { font-size: 11px; font-weight: 400; opacity: 0.8; }
.kp-geschichte {
  left: 16px; top: 172px;
  max-height: calc(100% - 208px);
  width: 380px;
  overflow-y: auto;
  z-index: 3;
  display: flex; flex-direction: column;
  padding: 14px 18px 16px;
}
.kp-geschichte[hidden] { display: none; }
.kp-buehne.kp-gs-aktiv .kp-steckbrief { display: none; }
.kp-gs-kopf { display: flex; justify-content: space-between; align-items: center; }
.kp-gs-zaehler { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--kp-text-leise); }
.kp-gs-kopf .kp-schliessen { position: static; float: none; }
.kp-gs-inhalt { transition: opacity 1s ease; }
.kp-gs-inhalt.kp-gs-ausblenden { opacity: 0; }
.kp-gs-bild { margin: 8px 0 10px; }
.kp-gs-bild img { width: 100%; height: 200px; object-fit: cover; border-radius: 4px; display: block; }
.kp-gs-bild figcaption { font-size: 11px; color: var(--kp-text-leise); margin-top: 4px; }
.kp-geschichte h3 { margin: 6px 0 8px; font-family: 'Playfair Display', serif; font-size: 1.55rem; color: var(--kp-gold); line-height: 1.2; }
.kp-gs-text { flex: 1 0 auto; }
.kp-gs-text p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--kp-text-hell); }
.kp-gs-text b { color: var(--kp-gold); font-weight: 500; }
.kp-gs-link { color: var(--kp-gold); }
.kp-gs-punkte { display: flex; gap: 6px; margin: 10px 0 12px; flex-wrap: wrap; }
.kp-gs-punkt {
  width: 10px; height: 10px; padding: 0; border-radius: 50%;
  border: 1px solid var(--kp-text-leise); background: transparent; cursor: pointer;
}
.kp-gs-punkt[aria-current="true"] { background: var(--kp-gold); border-color: var(--kp-gold); }
.kp-gs-knoepfe { display: flex; justify-content: space-between; gap: 8px; }
.kp-gs-knoepfe .kp-knopf { flex: 1; height: 38px; }
.kp-gs-knoepfe .kp-knopf:disabled { opacity: 0.35; cursor: default; }

/* ------------------------------------------------------------ Diagramme */
.kp-kopfzeile {
  position: sticky; top: 0; z-index: 4;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px;
  padding: 10px 0; margin-bottom: 16px;
  background: #000; border-bottom: 1px solid var(--kp-rand);
  color: var(--kp-text-hell); font-size: 13px;
}
.kp-kopfzeile { align-items: center; }
.kp-kopf-auswahl { color: var(--kp-text); }
.kp-kopf-wahl { height: 30px; max-width: 220px; margin-left: 4px; color: var(--kp-gold); }
.kp-dkarte {
  background: #0b0a12;
  border: 1px solid var(--kp-rand);
  border-radius: 6px;
  padding: 20px 22px 16px;
  margin-bottom: 24px;
  min-width: 0;
}
.kp-dkarte h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 2.2vw, 2.1rem); line-height: 1.2; }
.kp-dkarte > p { max-width: 50em; font-size: 14px; line-height: 1.6; margin: 0 0 14px; }
.kp-dkarte > .kp-dachzeile { margin-bottom: 4px; font-size: 0.75rem; }
.kp-diagramm-flaeche { position: relative; width: 100%; }
.kp-diagramm-canvas, .kp-diagramm-svg { position: absolute; inset: 0; display: block; }
.kp-diagramm-svg { overflow: visible; font-family: Montserrat, sans-serif; }
#kp-erdabstand .kp-diagramm-svg { position: static; }
.kp-tick { fill: var(--kp-text-leise); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.kp-halo { paint-order: stroke; stroke: #0b0a12; stroke-width: 3px; stroke-linejoin: round; }
.kp-dot { transition: r 0.12s; }
.kp-dot-hover { r: 6.5; }
/* Datumseingabe ebenfalls mit fester Zeichenbreite (wie das Datum darüber) */
#kp-datum-eingabe { font-family: var(--kp-mono); font-variant-numeric: tabular-nums; color-scheme: dark; }

.kp-auswahl-ring { pointer-events: none; }
.kp-quelle-d { font-size: 12px; color: var(--kp-text-leise); }

.kp-legende { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; font-size: 12px; color: var(--kp-text); }
.kp-legende span { display: inline-flex; align-items: center; gap: 6px; }
.kp-legende i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.kp-legende i.kp-leg-flaeche { border-radius: 2px; }
.kp-legende-unten { margin: 8px 0 0; }
.kp-leg-voll { background: var(--kp-text-hell); }
.kp-leg-hohl { box-shadow: inset 0 0 0 2px var(--kp-text-hell); }
.kp-leg-spanne { width: 2px !important; height: 14px !important; border-radius: 1px !important; background: var(--kp-text); }

.kp-regler { margin: 0 0 12px; font-size: 13px; }
.kp-regler label { display: block; margin-bottom: 4px; }
.kp-regler b { color: var(--kp-text-hell); }
.kp-regler input[type=range] { width: min(100%, 420px); accent-color: var(--kp-gold-dunkel); }
.kp-regler-skala { display: flex; justify-content: space-between; width: min(100%, 420px); font-size: 11px; color: var(--kp-text-leise); }

.kp-tabelle { margin-top: 10px; font-size: 13px; }
.kp-tabelle summary { cursor: pointer; color: var(--kp-text); }
.kp-tabelle summary:hover { color: var(--kp-gold); }
.kp-tab-box { max-height: 340px; overflow: auto; margin-top: 8px; }
.kp-tab { font-size: 13px; }
.kp-tab th { color: var(--kp-text-leise); font-size: 11px; position: sticky; top: 0; background: #0b0a12; }
.kp-tab td { color: var(--kp-text-hell); font-variant-numeric: tabular-nums; }
.kp-tab-name { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.kp-tab-name:hover { color: var(--kp-gold); }
.kp-tab tr.kp-markiert td { background: rgba(253, 252, 255, 0.08); color: var(--kp-text-hell); }
.kp-tab tr.kp-markiert .kp-tab-name { font-weight: 600; }
.kp-tab-name i, .kp-tt-gruppe i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.kp-tooltip {
  position: fixed; z-index: 1000; pointer-events: none;
  background: #1a1927; border: 1px solid #3a3950; border-radius: 6px;
  padding: 8px 10px; min-width: 160px; max-width: 260px;
  font: 12px/1.45 Montserrat, sans-serif; color: var(--kp-text, #a9a6b3);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.kp-tooltip strong { color: #fdfcff; font-size: 13px; font-weight: 500; }
.kp-tt-nr { color: #787789; }
.kp-tt-gruppe { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; }
.kp-tt-zeile { display: flex; justify-content: space-between; gap: 12px; }
.kp-tt-zeile b { color: #fdfcff; font-weight: 500; font-variant-numeric: tabular-nums; }
.kp-tt-text { margin-top: 4px; font-size: 11px; color: #a9a6b3; }
.kp-block[data-block="karte"] .kp-dkarte > p { max-width: none; }   /* volle Breite, damit die Karte mehr Höhe bekommt */
.kp-karte-vergleich { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.kp-karte-vergleich label:first-child { margin: 0; }
.kp-karte-vergleich select { max-width: 360px; color-scheme: dark; }
/* Karte bis zur Navigation; Hinweis und Tabelle liegen darunter. isolation: Leaflets hohe z-index bleiben unter der Navigation */
.kp-leaflet {
  height: 380px;   /* Startwert; die tatsächliche Höhe setzt frankenkarte() in js/diagramme.js */
  border: 1px solid var(--kp-rand); border-radius: 4px; background: #0b0a12;
  isolation: isolate;
}
/* helle OSM-Kacheln in eine dunkle Karte verwandeln */
.kp-leaflet .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.85) saturate(0.35); }
.kp-leaflet .leaflet-control-attribution { background: rgba(11, 10, 18, 0.8); color: #787789; font-size: 10px; }
.kp-leaflet .leaflet-control-attribution a { color: #a9a6b3; }
.kp-leaflet .leaflet-bar a { background: #1d1c2b; color: #fdfcff; border-color: #2e2e3d; }
.kp-leaflet .leaflet-bar a:hover { background: #2e2e3d; }
.kp-leaflet .leaflet-control-scale-line { background: rgba(11, 10, 18, 0.7); border-color: #a9a6b3; color: #a9a6b3; }
.kp-tooltip-leaflet { position: absolute; white-space: normal; width: 230px; }
.kp-tooltip-leaflet::before { display: none; }
.kp-kreis-label { background: rgba(11, 10, 18, 0.88); border: 1px solid #3a3950; border-radius: 4px; color: #a9a6b3;
  padding: 6px 10px; font: 12px/1.4 Montserrat, sans-serif; display: flex; align-items: center; gap: 6px; }
.kp-kreis-label[hidden] { display: none; }
.kp-leaflet { position: relative; }
.kp-ortname span {
  position: absolute; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 500 11px/1 Montserrat, sans-serif; color: #fdfcff;
  text-shadow: 0 0 3px #0b0a12, 0 0 3px #0b0a12, 0 0 2px #0b0a12;
}
.kp-karte-hinweis { margin-top: 6px; font-size: 12px; }
.kp-karte-tipp {
  position: absolute; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; background: rgba(11, 10, 18, 0.6); color: #fdfcff;
  font: 500 15px/1.4 Montserrat, sans-serif; pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.kp-karte-tipp.sichtbar { opacity: 1; }
.kp-popup .leaflet-popup-content-wrapper, .kp-popup .leaflet-popup-tip {
  background: rgba(22, 21, 33, 0.96); color: #a9a6b3; border: 1px solid #2e2e3d; box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.kp-popup .leaflet-popup-content { margin: 10px 12px; font: 13px/1.45 Montserrat, sans-serif; }
.kp-popup a.leaflet-popup-close-button { color: #a9a6b3; }
.kp-popup-3d { margin-top: 8px; height: 30px; width: 100%; }
.kp-kreis-label b { color: #fdfcff; font-weight: 500; }
.kp-kreis-label i { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Alter */
.kp-alter-eingabe { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; font-size: 13px; }
.kp-alter-eingabe label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; }
.kp-alter-eingabe .uk-input, .kp-alter-eingabe .uk-select { color-scheme: dark; }
.kp-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kp-kachel { border: 1px solid var(--kp-rand); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; }
.kp-kachel span { font-size: 12px; color: var(--kp-text); }
.kp-kachel b { font-size: 2.2rem; font-weight: 500; color: var(--kp-text-hell); line-height: 1.2; }
.kp-kachel b.kp-kachel-datum { font-size: 1.5rem; }
/* Im eigenen Block ist Platz: Ergebnis groß zeigen */
.kp-block-mittig .kp-alter-eingabe { font-size: 15px; }
.kp-block-mittig .kp-kachel { padding: 16px 20px; }
.kp-block-mittig .kp-kachel b { font-size: clamp(2.2rem, 5vw, 3.75rem); }
.kp-block-mittig .kp-kachel b.kp-kachel-datum { font-size: clamp(1.5rem, 3.2vw, 2.5rem); }
.kp-block-mittig .kp-ab-zeile { font-size: 14px; margin-bottom: 10px; }
.kp-block-mittig .kp-ab-spur, .kp-block-mittig .kp-ab-spur i { height: 14px; }
.kp-kachel small { font-size: 11px; color: var(--kp-text-leise); }
.kp-ab-zeile { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 12px; margin-bottom: 6px; }
.kp-ab-spur { height: 10px; }
.kp-ab-spur i { display: block; height: 10px; border-radius: 0 4px 4px 0; }
.kp-ab-zeile b { color: var(--kp-text-hell); font-weight: 500; font-variant-numeric: tabular-nums; }

#kp-erdabstand { margin-top: 4px; }

/* ------------------------------------------------------------ Mobil */
@media (max-width: 760px) {
  .kp-buehne { min-height: 560px; }
  .kp-block { padding-bottom: 56px; }   /* Platz für den Auswahl-Knopf über der Navigation */
  .kp-block-voll { padding-bottom: 0; }
  .kp-block-zu { padding-bottom: 0; }
  .kp-buehne:has(.kp-willkommen:not([hidden])) .kp-ansicht { display: none; }
  /* Navigation: nur Pfeile, dazwischen die Blockauswahl */
  .kp-nav { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .kp-nav-knopf { justify-content: center; width: 48px; padding: 0; }
  .kp-nav-text { display: none; }
  .kp-nav-wahl { max-width: none; }
  .kp-willkommen { padding: 16px 18px; }
  .kp-willkommen .kp-lead { font-size: 0.95rem; margin-bottom: 14px; }
  .kp-willkommen-knoepfe .uk-button { width: 100%; }
  .kp-dkarte { padding: 16px 12px 12px; }
  .kp-zeit { top: 8px; left: 8px; right: 8px; padding: 8px 10px; }
  .kp-datum { font-size: 1.15rem; margin-bottom: 4px; }
  .kp-ansicht { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; padding: 8px 10px; }
  .kp-ansicht .kp-check, .kp-ansicht .kp-knopf-klein { display: none; }
  .kp-filter { flex-direction: row; flex-wrap: wrap; gap: 2px 12px; margin-top: 8px; }
  .kp-filter-knopf { font-size: 12px; }
  .kp-filter-knopf .kp-anzahl { display: none; }
  .kp-steckbrief { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 62%; }
  .kp-buehne:has(.kp-steckbrief:not([hidden])) .kp-ansicht { display: none; }
  .kp-buehne.kp-gs-aktiv .kp-ansicht { display: none; }
  .kp-geschichte { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 58%; padding: 10px 12px 12px; }
  .kp-gs-bild img { height: 120px; }
  .kp-geschichte h3 { font-size: 1.25rem; }
  .kp-gs-text p { font-size: 13px; }
  .kp-bedienhinweis { display: none; }
  .kp-hilfe-knopf { top: 12px; right: 12px; bottom: auto; width: 30px; height: 30px; font-size: 15px; }
  .kp-hilfe { left: 8px; right: 8px; top: 8px; bottom: 8px; width: auto; max-height: none; }
}

/* ------------------------------------------------------------ Drucken: alle Blöcke außer der 3D-Ansicht */
@media print {
  .kp-block, .kp-block-zu {
    display: block; width: 100%; height: auto; min-height: 0;
    padding-bottom: 16px; overflow: visible; visibility: visible;
  }
  .kp-nav, .kp-kopfzeile, .kp-block.kp-block-voll { display: none; }
}
