/* ============================================
   LOCAL PEAK — KLICKSTRECKE SICHTBARKEITS-CHECK
   Handy: Vollbild. Ab 641 px: Karte ueber abgedunkelter Seite.
   Nutzt die Tokens aus styles.css (--accent, --font-display, --font-body).
   ============================================ */
.ks {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ks[hidden] { display: none; }
html.ks-offen, html.ks-offen body { overflow: hidden; }

.ks__hinten {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.ks__karte {
  position: relative;
  box-sizing: border-box;
  width: min(560px, 100%);
  max-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.ks__kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem 0.9rem 1.5rem;
  border-bottom: 1px solid #ececdf;
}
.ks__marke {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #111;
}
.ks__marke span { color: #8fa81c; }
.ks__zu {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.ks__zu:hover { background: #f2f2ea; }
.ks__inhalt {
  box-sizing: border-box;
  padding: 1.5rem 1.5rem 1.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .ks { align-items: stretch; }
  .ks__karte {
    width: 100%;
    max-height: none;
    height: 100%;
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .ks__inhalt { padding: 1.25rem 1rem 1.5rem; flex: 1; }
  .ks__kopf { padding-left: 1rem; }
}

/* ---------- Inhalt ---------- */
.ks-titel {
  font-family: var(--font-display);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  margin: 0 0 0.9rem;
  text-wrap: balance;
  outline: none;
}
.ks-titel--frage { font-size: clamp(1.5rem, 5vw, 1.9rem); }
.ks-text { font-size: 1rem; line-height: 1.55; margin: 0 0 1rem; }
.ks-hinweis { font-size: 0.92rem; color: #5f5f48; margin: -0.4rem 0 1rem; }
.ks-klein { font-size: 0.85rem; line-height: 1.5; color: #5f5f48; margin: 0.9rem 0 0; }
.ks-klein a { color: inherit; text-decoration: underline; }

.ks-fortschritt { font-size: 0.85rem; font-weight: 600; color: #5f5f48; margin: 0 0 0.4rem; }
.ks-balken { height: 6px; background: #efefe4; border-radius: 3px; margin: 0 0 1.25rem; overflow: hidden; }
.ks-balken i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.25s; }

.ks-opts { display: grid; gap: 0.6rem; margin: 0 0 1rem; }
.ks-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  padding: 0.8rem 1rem;
  text-align: left;
  font: 500 1rem/1.35 var(--font-body);
  color: #111;
  background: #fff;
  border: 2px solid #e2e2d4;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ks-opt:hover { border-color: #b8d62a; background: #fafaf2; }
.ks-opt.is-an { border-color: var(--accent); background: #f5f9de; font-weight: 600; }
.ks-haken {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 2px solid #c9c9b8;
  border-radius: 5px;
  box-sizing: border-box;
  position: relative;
}
.ks-opt.is-an .ks-haken { background: var(--accent); border-color: var(--accent); }
.ks-opt.is-an .ks-haken::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #111;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ks-cta {
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 0.25rem 0 0;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: 9999px;
  background: var(--accent);
  color: #000;
  font: 700 1.05rem/1.25 var(--font-body);
  text-transform: uppercase;
  cursor: pointer;
}
.ks-cta:hover { background: var(--accent-hover, #b8d62a); }
.ks-cta:disabled { opacity: 0.45; cursor: default; }
.ks-cta--leise { background: #111; color: #fff; }
.ks-cta--leise:hover { background: #333; }

.ks-link {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.5rem 0;
  min-height: 44px;
  background: none;
  border: 0;
  font: 500 0.95rem var(--font-body);
  color: #5f5f48;
  text-decoration: underline;
  cursor: pointer;
}
.ks-warum { font-size: 0.88rem; color: #5f5f48; margin: 1rem 0 0; line-height: 1.5; }
.ks-warum span { font-style: italic; }

/* Kontakt */
.ks-form { display: block; }
.ks-label { display: block; font-size: 0.9rem; font-weight: 600; margin: 0.9rem 0 0.35rem; padding: 0; }
.ks-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  padding: 0 0.9rem;
  font: 400 1rem var(--font-body);
  color: #111;
  background: #fff;
  border: 2px solid #e2e2d4;
  border-radius: 10px;
}
.ks-input:focus { outline: none; border-color: #8fa81c; }
.ks-input.is-fehler { border-color: #b3261e; }
.ks-fehler { color: #b3261e; font-size: 0.85rem; margin: 0.3rem 0 0; }
.ks-fehler--block { margin: 0.9rem 0; font-weight: 600; }
.ks-chips { border: 0; margin: 0; padding: 0; min-width: 0; }
.ks-chips > div { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ks-chip {
  min-height: 44px;
  padding: 0.55rem 1rem;
  font: 500 0.95rem var(--font-body);
  color: #111;
  background: #fff;
  border: 2px solid #e2e2d4;
  border-radius: 10px;
  cursor: pointer;
}
.ks-chip:hover { border-color: #b8d62a; }
.ks-chip.is-an { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.ks-form .ks-cta { margin-top: 1.4rem; }
.ks-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Termine */
.ks-termine { display: grid; gap: 1rem; margin: 0.5rem 0 1.25rem; }
.ks-tag__name { font-weight: 700; font-size: 0.95rem; margin: 0 0 0.45rem; }
.ks-tag__zeiten { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ks-chip--zeit { min-width: 92px; }
.ks-laden { color: #5f5f48; }

/* Absage */
.ks-tipps { padding-left: 1.25rem; margin: 0 0 1rem; display: grid; gap: 0.6rem; line-height: 1.5; }

/* Handbuch-Feld nach Absage (Weische P55, 28.11.2026) */
.ks-buch { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 1rem; align-items: start; margin: 1.4rem 0 1.25rem; padding: 1.1rem; background: #f5f9de; border: 1px solid #dde9a8; border-radius: 14px; }
.ks-buch__cover { box-sizing: border-box; width: 84px; max-width: 100%; aspect-ratio: 3 / 4; padding: 0.55rem 0.5rem; background: #111; color: #fff; border-radius: 4px 8px 8px 4px; box-shadow: inset 5px 0 0 #2a2a2a, 0 8px 18px rgba(0, 0, 0, 0.22); display: flex; flex-direction: column; justify-content: space-between; }
.ks-buch__cover b { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: 1.05rem; line-height: 0.92; letter-spacing: -0.02em; }
.ks-buch__cover b span { display: block; color: var(--accent); font-size: 1.6rem; }
.ks-buch__cover small { font-size: 0.5rem; letter-spacing: 0.06em; text-transform: uppercase; color: #bbb; }
.ks-buch__text { min-width: 0; }
.ks-buch__titel { font-weight: 700; font-size: 1rem; line-height: 1.35; margin: 0 0 0.3rem; outline: none; }
.ks-buch__text .ks-text { font-size: 0.95rem; margin: 0; }
.ks-buch__form { grid-column: 1 / -1; }
.ks-buch .ks-label { margin-top: 0; }
.ks-buch .ks-cta { margin-top: 0.7rem; }
.ks-buch--fertig { display: block; }
.ks-buch--fertig .ks-text { margin: 0; }
.ks-buch__hake { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); font-weight: 800; margin-bottom: 0.5rem; }

.ks button:focus-visible,
.ks a:focus-visible,
.ks-input:focus-visible { outline: 3px solid #8fa81c; outline-offset: 2px; }

/* ---------- Hero: Fehler, ohne Website, Wiedereinstieg ---------- */
.ks-webfehler { color: #ffb4a8; font-size: 0.95rem; font-weight: 600; margin: 0.6rem 0 0; }
.ks-ohne-website {
  display: inline-block;
  margin: 0.7rem 0 0;
  padding: 0.35rem 0;
  min-height: 44px;
  background: none;
  border: 0;
  color: #c9c9c9;
  font: 500 0.95rem var(--font-body);
  text-decoration: underline;
  cursor: pointer;
}
.ks-ohne-website:hover { color: #fff; }
.ks-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  max-width: 620px;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  background: rgba(200, 230, 54, 0.14);
  border: 1px solid rgba(200, 230, 54, 0.55);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
}
.ks-resume[hidden] { display: none; }
.ks-resume p { margin: 0; flex: 1 1 14rem; }
.ks-resume button {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font: 700 0.9rem var(--font-body);
  cursor: pointer;
}
.ks-resume [data-ks-weiter] { background: var(--accent); color: #000; border: 0; }
.ks-resume [data-ks-neu] { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); }

@media (prefers-reduced-motion: reduce) {
  .ks-balken i, .ks-opt { transition: none; }
}
