/* ============================================================
   Stadtrauschen – Design (übernommen aus hoerstoff_app_redesign)
   Creme-Grund mit Mint/Amber-Verläufen, Glas-Cards, Serifen-
   Headlines (Georgia), Inter, Mint-Gradient-Buttons.
   ============================================================ */
:root {
  --paper: #F6F1E6;
  --surface: #FFFDF8;
  --ink: #123F36;
  --muted: #6F8179;
  --line: #E4DFD0;
  --mint: #639a86;
  --mint-deep: #639a86;
  --mint-soft: #CFE5DB;
  --sage: #A9B98D;
  --sage-soft: #D8DFC5;
  --amber: #EEC76B;
  --amber-soft: #F7E8C8;
  --amber-ink: #A8792B;
  --lavender: #D8DFC5;
  --rose: #F4DDD8;
  --sky: #C9DDD1;
  --danger: #E98255;
  --radius: 26px;
  --radius-sm: 16px;
  --shadow: 0 18px 45px rgba(18,63,54,.12);
  --shadow-soft: 0 14px 35px rgba(18,63,54,.10);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 76px;
  --hdr-h: 75px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --display-ink: #123F36;
  
  --color-bg: #F6F1E6;
  --color-surface: #FFFDF8;

  --color-primary: #123F36;
  --color-primary-soft: #6FB9A5;
  --color-primary-dark: #3E9483;

  --color-text: #123F36;
  --color-text-muted: #6F8179;

  --color-mint-light: #CFE5DB;
  --color-sage: #A9B98D;
  --color-sage-light: #D8DFC5;
  --color-olive: #7F935F;
  --color-olive-dark: #3F5F35;

  --color-accent-orange: #E98255;
  --color-accent-yellow: #EEC76B;
  --color-scan-bg: #F7E8C8;
  --color-scan-icon: #A8792B;

  --color-path: #EFE5C8;
  --color-water: #C9DDD1;

  --shadow-soft: 0 14px 35px rgba(18, 63, 54, 0.10);
  --shadow-card: 0 18px 45px rgba(18, 63, 54, 0.12);
}
/* Design ist bewusst hell – auch bei Dark-Scheme */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #F6F1E6; --surface: #FFFDF8; --ink: #123F36; --muted: #6F8179;
    --line: #E4DFD0; --mint: #6FB9A5; --mint-deep: #3E9483; --mint-soft: #CFE5DB;
    --sage: #A9B98D; --sage-soft: #D8DFC5; --amber: #EEC76B; --amber-soft: #F7E8C8;
    --amber-ink: #A8792B; --rose: #F4DDD8; --sky: #C9DDD1;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(  --color-bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font); font-size: 15.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.015em; }
button { font: inherit; cursor: pointer; }
a { color: var(--mint-deep); }
[hidden] { display: none !important; }

#app { min-height: 100dvh; }

/* ---------- Bausteine ---------- */
.page {
  padding: 0 18px calc(var(--nav-h) + 30px + var(--safe-b));
  max-width: 720px; margin: 0 auto;
  position: relative; overflow-x: clip;
}
.page-head { padding: calc(26px + var(--safe-t)) 0 18px; }
.page-head h1 {
  font-family: var(--font-display); color: var(--display-ink);
  font-size: clamp(28px, 8vw, 38px); letter-spacing: -.035em; font-weight: 700;
}
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

.btn {
  border: 0; border-radius: 18px;
  padding: 14px 24px; font-weight: 750; font-size: 15px;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #fff;
  box-shadow: 0 10px 22px rgba(94,156,142,.25);
  transition: transform .12s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); filter: brightness(.96); }
.btn-amber { background: var(--amber); color: #4A3510; box-shadow: 0 10px 22px rgba(243,199,123,.35); }
.btn-ghost { background: rgba(255,255,255,.85); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); box-shadow: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; }
.icon-btn {
  border: 0; background: var(--mint-soft); color: var(--mint-deep);
  width: 44px; height: 44px; border-radius: 15px;
  display: grid; place-items: center; font-size: 16px;
}
.linklike { border: 0; background: none; color: var(--mint-deep); font-weight: 750; font-size: 13px; padding: 6px 0; }

.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  padding: 18px; margin-bottom: 14px;
}
.card h3 { font-size: 16px; font-weight: 800; }
.hint { font-size: 13px; color: var(--muted); }

label { display: block; font-weight: 700; font-size: 12.5px; margin: 14px 0 5px; color: #51605B; }
input[type=text], input[type=password], input[type=email], input[type=number], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; font: inherit; background: rgba(255,255,255,.8); color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--mint); border-color: var(--mint); }

.section-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 2px 13px; font-weight: 800; font-size: 15px;
}
.section-row svg { color: var(--mint-deep); }
.mini-tag {
  display: inline-flex; align-items: center;
  background: var(--mint-soft); color: var(--mint-deep);
  border-radius: 999px; padding: 3px 11px;
  font-size: 11.5px; font-weight: 750;
}
.mini-tag.amber { background: var(--amber-soft); color: var(--amber-ink); }
.mini-tag.pro { background: var(--lavender); color: #6B5CA8; }

.bubble {
  flex: none; width: 48px; height: 48px; border-radius: 18px;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}
.bubble-mint { background: var(--mint-soft); color: var(--mint-deep); }
.bubble-amber { background: var(--amber-soft); color: var(--amber-ink); }
.bubble-sage { background: var(--sage-soft); color: #708C7E; }
.bubble-lavender { background: var(--lavender); color: #6B5CA8; }
.bubble-sky { background: var(--sky); color: #3D6FB0; }
.bubble-rose { background: var(--rose); color: #B77B6E; }

.empty-state { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty-state h2 { color: var(--display-ink); font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; }
.loader { display: grid; place-items: center; padding: 60px 0; color: var(--muted); }
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3.5px solid var(--mint-soft); border-top-color: var(--mint);
  animation: spin .8s linear infinite; margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   BOTTOM-NAVIGATION (Glas, Scan zentral)
   ============================================================ */
.bottom-nav {
  position: fixed; z-index: 880;
  left: 14px; right: 14px; bottom: calc(12px + var(--safe-b));
  display: flex; align-items: stretch; justify-content: space-around;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.8);
  backdrop-filter: blur(18px);
  border-radius: 26px;
  box-shadow: 0 14px 36px rgba(49,72,65,.16);
  padding: 10px 8px;
  height: var(--nav-h);
}
.nav-btn {
  flex: 1; display: grid; place-items: center; gap: 2px;
  text-decoration: none; color: var(--muted);
  font-size: 10.5px; font-weight: 750;
  border-radius: var(--radius-sm); padding-top: 4px;
}
.nav-btn.active { color: var(--mint-deep); }
.nav-scan {
  flex: none; align-self: center;
  width: 56px; height: 56px; border-radius: 19px;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #fff;
  display: grid; place-items: center;
  margin: -24px 8px 0;
  box-shadow: 0 12px 28px rgba(94,156,142,.4);
  text-decoration: none;
  transition: transform .12s ease;
}
.nav-scan:active { transform: scale(.94); }
.nav-scan.active { filter: brightness(.95); }

/* ============================================================
   ENTDECKEN
   ============================================================ */

.home-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 0 18px;
  position: relative; z-index: 1;
}
.home-greet { min-width: 0; }
.brand-row { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  flex: none; width: 54px; height: 54px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mint), #B7DED4);
  color: #fff; font-weight: 900; font-size: 26px;
  box-shadow: 0 12px 28px rgba(94,156,142,.24);
}
.hello { color: var(--muted); font-size: 13.5px; font-weight: 650; }
.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 34px);
  color: var(--display-ink);
  letter-spacing: -.03em; font-weight: 700; margin-top: 2px;
}
.help-btn {
  flex: none; width: 48px; height: 48px;
  border: 0; border-radius: 17px;
  background: var(--amber-soft); color: var(--amber-ink);
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft); text-decoration: none;
}
.help-btn:active { transform: scale(.95); }

/* Intro-Card: Bild als Cover oben, Text-Panel darunter */
.intro-card {
  background: var(--surface);

  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 0;
  position: relative; z-index: 1; overflow: hidden;
  margin-bottom: 4px;
}
.intro-card::after { display: none; }
.intro-illustration {
  width: 100%; aspect-ratio: 4 / 3;
  overflow: hidden; line-height: 0;
}
.intro-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro-copy {
  position: relative;
  margin-top: -34px;
  background: var(--surface);
  border-radius: 30px 30px 0 0;
  padding: 24px 22px 22px;
  text-align: center;
}
.intro-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 8vw, 36px);
  color: var(--display-ink);
  margin: 0 0 10px; letter-spacing: -.035em;
}
.intro-copy p { margin: 0 auto 18px; color: var(--muted); font-size: 14.5px; max-width: 30ch; }
.intro-copy .btn { width: 100%; }
.city-lines {
  position: absolute; inset: 44px 8px 34px;
  background:
    linear-gradient(to top, rgba(94,156,142,.18), rgba(94,156,142,.18)) 12% 100%/10px 42px no-repeat,
    linear-gradient(to top, rgba(94,156,142,.16), rgba(94,156,142,.16)) 26% 100%/15px 62px no-repeat,
    linear-gradient(to top, rgba(94,156,142,.16), rgba(94,156,142,.16)) 82% 100%/13px 50px no-repeat,
    linear-gradient(to top, rgba(94,156,142,.18), rgba(94,156,142,.18)) 72% 100%/18px 74px no-repeat;
  border-bottom: 2px solid rgba(94,156,142,.13);
  opacity: .9;
}
.shirt-art { position: relative; width: 118px; height: 120px; z-index: 2; }
.hanger {
  position: absolute; left: 49px; top: -4px;
  width: 23px; height: 22px;
  border: 3px solid #2D403A; border-bottom: 0;
  border-radius: 16px 16px 0 0;
}
.hanger::after {
  content: ""; position: absolute; left: -41px; top: 18px;
  width: 101px; height: 2px; background: #2D403A;
  transform: rotate(-12deg);
}
.shirt-body {
  position: absolute; left: 13px; top: 31px;
  width: 92px; height: 78px;
  background: linear-gradient(135deg, #A8D9CF, #7FBFB1);
  border-radius: 17px 17px 24px 24px;
  box-shadow: 0 12px 26px rgba(94,156,142,.18);
}
.shirt-body::before, .shirt-body::after {
  content: ""; position: absolute; top: 6px;
  width: 38px; height: 42px;
  background: #97CEC3; border-radius: 13px;
}
.shirt-body::before { left: -19px; transform: rotate(24deg); }
.shirt-body::after { right: -19px; transform: rotate(-24deg); }
.qr-patch {
  position: absolute; right: 16px; top: 55px;
  width: 31px; height: 31px; border-radius: 5px;
  background:
    linear-gradient(90deg,#1F302B 50%,transparent 0) 4px 4px/8px 8px,
    linear-gradient(#1F302B 50%,transparent 0) 14px 4px/8px 8px,
    #fff;
  border: 2px solid rgba(31,48,43,.18);
}
.float-dot { position: absolute; width: 9px; height: 9px; background: var(--mint-deep); border-radius: 50%; opacity: .7; }
.dot-one { top: 18px; left: 42px; }
.dot-two { bottom: 22px; right: 36px; background: var(--amber); }
.float-pill {
  position: absolute; top: 24px; right: 18px;
  width: 36px; height: 18px;
  border-radius: 18px 18px 0 18px;
  background: var(--amber); opacity: .65;
}

/* Kategorie-Chips */
.cat-row {
  display: flex; gap: 9px; overflow-x: auto;
  padding: 18px 2px 14px; scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; padding: 10px 16px; border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  color: #51605B; font-weight: 750; font-size: 13px;
}
.cat-chip.active {
  background: var(--mint); color: #fff; border-color: transparent;
  box-shadow: 0 8px 18px rgba(94,156,142,.22);
}

/* Story-Karten */
.story-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 25px; overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  transition: transform .15s ease;
}
.story-card:active { transform: scale(.985); }
.story-img {
  height: 150px; background-size: cover; background-position: center;
  position: relative;
}
.story-img.noimg {
  background:
    radial-gradient(circle at 70% 20%, rgba(255,255,255,.72), transparent 28%),
    var(--mint-soft);
}
.lock-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.94); color: var(--amber-ink);
  border-radius: 999px; padding: 4px 12px;
  font-size: 11.5px; font-weight: 800;
}
.story-body { padding: 14px 16px 16px; }
.story-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.story-body h3 { font-size: 16px; font-weight: 850; }
.story-body p {
  color: var(--muted); font-size: 12.5px; margin: 5px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.story-place { display: block; color: #51605B; font-size: 12px; font-weight: 650; margin-top: 9px; }

/* Zuletzt gescannt */
.recent-row {
  display: flex; gap: 12px; overflow-x: auto;
  margin: 0 -18px; padding: 2px 18px 8px; scrollbar-width: none;
}
.recent-row::-webkit-scrollbar { display: none; }
.recent-item { flex: none; width: 124px; text-decoration: none; color: inherit; }
.recent-img {
  height: 86px; border-radius: 20px;
  background-size: cover; background-position: center;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow-soft);
}
.recent-img.noimg { background: var(--sage-soft); }
.recent-item span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12px; font-weight: 750; margin-top: 6px;
}

.pro-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--amber-soft);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius); padding: 16px 18px;
  margin: 16px 0;
}
.pro-banner strong { display: block; font-size: 15px; color: var(--amber-ink); font-weight: 850; }
.pro-banner span { font-size: 12.5px; color: var(--amber-ink); opacity: .85; }
.pro-banner div { flex: 1; }

/* ============================================================
   SCANNER
   ============================================================ */
.scan-frame {
  position: relative; border-radius: var(--radius);
  overflow: hidden; background: #1F302B;
  aspect-ratio: 3/4; max-height: 56dvh;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.6);
  margin-bottom: 16px;
}
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-corners { position: absolute; inset: 14%; pointer-events: none; }
.scan-corners::before, .scan-corners::after,
.scan-frame .scan-laser::before, .scan-frame .scan-laser::after { content: ""; position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 8px; }
.scan-corners::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scan-corners::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scan-laser::before { bottom: 0; left: 14%; border-right: 0; border-top: 0; }
.scan-laser::after { bottom: 0; right: 14%; border-left: 0; border-top: 0; }
.scan-laser {
  position: absolute; left: 18%; right: 18%; top: 20%;
  height: 3px; border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber);
  animation: laser 2.2s ease-in-out infinite;
}
@keyframes laser { 0%,100% { top: 20%; } 50% { top: 76%; } }
.scan-msg {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  background: rgba(255,255,255,.96); color: var(--ink);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13.5px; font-weight: 600; text-align: center;
}
.manual-row { display: flex; gap: 8px; margin-top: 10px; }
.manual-row input { flex: 1; }

/* ============================================================
   STORY-DETAIL
   ============================================================ */
.story-page { padding-left: 0; padding-right: 0; max-width: 760px; }
.story-hero {
  height: 38dvh; min-height: 240px;
  background-size: cover; background-position: center;
  position: relative;
}
.story-hero.noimg {
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.5) 0 70px, transparent 71px),
    radial-gradient(circle at 15% 100%, rgba(255,255,255,.3) 0 110px, transparent 111px),
    linear-gradient(135deg, var(--sage), var(--mint));
}
.hero-btn {
  position: relative; border: 0;
  width: 42px; height: 42px; border-radius: 15px;
  background: rgba(255,255,255,.94); color: var(--ink);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  display: grid; place-items: center; font-size: 17px;
}
.story-hero > .hero-btn { position: absolute; top: calc(14px + var(--safe-t)); left: 16px; }
.hero-actions {
  position: absolute; top: calc(14px + var(--safe-t)); right: 16px;
  display: flex; gap: 10px;
}
.hero-btn.fav-on { color: var(--danger); }

.story-sheet-body {
  background: linear-gradient(180deg, #F7F5EF 0%, #FBFAF6 60%, #EEF6F2 100%);
  border-radius: 34px 34px 0 0;
  margin-top: -30px; position: relative;
  padding: 26px 18px 10px;
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.story-sheet-body h1 {
  font-family: var(--font-display); color: var(--display-ink);
  font-size: clamp(26px, 7.5vw, 36px); font-weight: 700;
  letter-spacing: -.035em; margin: 10px 0 4px;
}
.story-teaser { color: #51605B; font-size: 14px; }
.story-text {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 18px; margin-top: 16px;
  font-size: 14.5px;
}
.story-video, .yt-frame {
  width: 100%; border: 0; border-radius: 24px;
  margin-top: 14px; aspect-ratio: 16/9; background: #000;
  box-shadow: var(--shadow-soft);
}
.story-map, .all-map {
  height: 220px; border-radius: 24px;
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
}
.all-map { height: calc(100dvh - var(--nav-h) - 180px); min-height: 320px; }

/* Audio-Player */
.player {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  padding: 14px 16px; margin-top: 16px;
}
.player-btn {
  flex: none; width: 54px; height: 54px; border-radius: 19px;
  border: 0; background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(94,156,142,.35);
}
.player-btn:active { transform: scale(.94); }
.player-main { flex: 1; min-width: 0; }
.player input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--mint-soft); outline: none; padding: 0; border: 0;
}
.player input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--mint-deep); border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.25); cursor: pointer;
}
.player input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--mint-deep); border: 3px solid #fff; cursor: pointer;
}
.player-time { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

.locked-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 26px 20px; margin-top: 16px; text-align: center;
}
.locked-card h3 { font-family: var(--font-display); color: var(--display-ink); font-size: 20px; letter-spacing: -.03em; }
.locked-card p { color: var(--muted); font-size: 13.5px; margin: 6px 0 16px; }

/* ---------- Profil ---------- */
.profile-card { display: flex; gap: 14px; align-items: center; }
.profile-card .main { flex: 1; min-width: 0; }
.auth-links { display: flex; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Sheets / Install / Toast ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 950;
  background: rgba(31,48,43,.22); animation: fade-in .2s ease;
}
.story-sheet {
  position: fixed; z-index: 960; left: 0; right: 0; bottom: 0;
  max-height: 82dvh; overflow-y: auto;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.78);
  backdrop-filter: blur(16px);
  border-radius: 34px 34px 0 0;
  box-shadow: 0 -22px 48px rgba(49,72,65,.18);
  padding: 16px 22px calc(28px + var(--safe-b));
  animation: sheet-up .32s cubic-bezier(.2,.9,.3,1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--amber-soft); color: var(--amber-ink);
  border-radius: 999px; padding: 6px 14px;
  font-size: 11.5px; font-weight: 750;
  letter-spacing: .08em; text-transform: uppercase;
}
.sheet-head .icon-btn { margin-left: auto; flex: none; }
.story-sheet h2 {
  font-family: var(--font-display); color: var(--display-ink);
  font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin: 14px 0 0;
}
.sheet-actions { margin-top: 22px; display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1; }
.help-steps { display: grid; gap: 14px; margin-top: 18px; }
.help-step { display: flex; gap: 14px; align-items: flex-start; }
.help-step .bubble { width: 40px; height: 40px; font-size: 14px; border-radius: 14px; }
.help-step p { margin: 6px 0 0; font-size: 14px; }

.install-bar {
  position: fixed; z-index: 900;
  left: 14px; right: 14px; bottom: calc(var(--nav-h) + 14px + var(--safe-b));
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.78);
  backdrop-filter: blur(16px);
  border-radius: 24px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px 14px 18px;
}
.install-text { display: grid; flex: 1; min-width: 0; }
.install-text strong { font-size: 14.5px; font-weight: 800; }
.install-text span { color: var(--muted); font-size: 12.5px; }

.toast {
  position: fixed; z-index: 990; left: 50%;
  bottom: calc(var(--nav-h) + 18px + var(--safe-b));
  transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: 13.5px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }

.leaflet-container { font-family: var(--font); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 430px) {
  .intro-card { grid-template-columns: 1fr; text-align: center; }
  .intro-illustration { min-height: 165px; }
  .intro-copy .btn { width: 100%; }
}

/* ---------- Tour-Navigation (Wegpunkte) ---------- */
.nav-status { display: flex; align-items: center; gap: 14px; }
.nav-status .main { flex: 1; min-width: 0; }
.nav-status strong { display: block; font-size: 15px; font-weight: 800; }
.nav-status .btn-sm { padding: 10px 16px; font-size: 13px; flex: none; }
.wp-item { cursor: pointer; padding: 14px 16px; }
.wp-item:active { transform: scale(.985); }

/* ---------- Segment-Umschalter + Tourenverlauf + Foto ---------- */
.seg { display: flex; gap: 6px; background: var(--mint-soft); border-radius: 14px; padding: 4px; margin-top: 16px; }
.seg-btn { flex: 1; border: 0; background: transparent; color: var(--mint-deep); font-weight: 750; font-size: 13.5px; padding: 9px; border-radius: 11px; }
.seg-btn.active { background: #fff; box-shadow: var(--shadow-soft); }

.verlauf { padding: 4px 0; }
.verlauf-row { display: flex; gap: 14px; }
.verlauf-rail { display: flex; flex-direction: column; align-items: center; flex: none; width: 32px; }
.verlauf-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--mint-deep); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.verlauf-line { flex: 1; width: 2px; background: var(--line); margin: 4px 0; min-height: 30px; }
.verlauf-body { flex: 1; padding-bottom: 18px; min-width: 0; }
.verlauf-dist { display: inline-block; font-size: 11px; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.verlauf-body strong { display: block; font-size: 15px; }
.verlauf-img { height: 150px; border-radius: 16px; background-size: cover; background-position: center; margin-top: 8px; box-shadow: var(--shadow-soft); }
.verlauf-icons { font-size: 14px; margin-top: 6px; letter-spacing: 4px; }

.photo-up-btn { display: block; text-align: center; margin-top: 18px; background: var(--surface); border: 1.5px dashed var(--mint); border-radius: 18px; padding: 16px; font-weight: 750; color: var(--mint-deep); cursor: pointer; }
.photo-up-btn:active { transform: scale(.98); }

/* ---------- Navigations-Modus (Turn-by-Turn) ---------- */
.nav-figure {
  width: 38px; height: 38px; display: grid; place-items: center;
  font-size: 22px; background: #fff; border-radius: 50%;
  border: 3px solid var(--mint-deep);
  box-shadow: 0 0 0 6px rgba(94,156,142,.22), var(--shadow-soft);
}
.nav-banner {
  position: fixed; z-index: 970;
  top: calc(12px + var(--safe-t)); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 16px;
  background: var(--mint-deep); color: #fff;
  border-radius: 20px; padding: 16px 20px;
  box-shadow: 0 14px 34px rgba(49,72,65,.3);
  animation: fade-in .2s ease;
}
.nav-arrow { font-size: 38px; line-height: 1; flex: none; }
.nav-instr { display: grid; }
.nav-instr strong { font-size: 20px; font-weight: 800; }
.nav-instr span { font-size: 14px; opacity: .92; }

/* ============================================================
   Desktop: App in Handy-Rahmen mittig (wie KetoFlow)
   Mobile bleibt unverändert Vollbild.
   ============================================================ */
@media (min-width: 760px) {
  body {
    /* ruhiger Hintergrund hinter dem Phone */
    background:
      radial-gradient(circle at 20% 10%, rgba(111,185,165,.16), transparent 40%),
      radial-gradient(circle at 90% 90%, rgba(238,199,107,.13), transparent 40%),
      #EFEAD9;
    background-attachment: fixed;
    display: flex; align-items: center; justify-content: center;
    min-height: 100dvh; padding: 24px 0;
  }
  #phone {
    position: relative;            /* verankert die fixed-Kinder im Rahmen */
    width: 412px; height: 880px; max-height: calc(100dvh - 48px);
    background: var(--paper);
    border-radius: 20px;
    box-shadow: 0 40px 90px rgba(31,48,43,.34), 0 0 0 11px #1f2522, 0 0 0 13px #34403b;
    overflow: hidden;
    transform: translateZ(0);      /* macht position:fixed-Kinder relativ zu #phone */
  }
  /* App scrollt innerhalb des Rahmens */
  #phone #app {
    height: 100%; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  /* Fixed-Overlays an den Rahmen binden (statt Viewport) */
  #phone .bottom-nav,
  #phone .sheet-backdrop,
  #phone .story-sheet,
  #phone .install-bar,
  #phone .toast,
  #phone .nav-banner {
    position: absolute;
  }

  /* etwas Platz unter dem Notch */
  #phone #app { padding-top: 0; }
}

/* Sehr hohe Fenster: Rahmen nicht überdehnen */
@media (min-width: 760px) and (min-height: 940px) {
  #phone { height: 880px; }
}

@media (min-width: 760px) {
  /* Karten/Hero-Höhen im Frame an die Rahmenhöhe binden statt an dvh */
  #phone .all-map { height: 460px; min-height: 0; }
  #phone .scan-frame { max-height: 60%; }
  #phone .story-hero { height: 280px; }
  #phone .story-sheet { max-height: 78%; }
  #phone #app { min-height: 0; }
}

/* ============================================================
   Scrollbar verstecken (App-weit, wie KetoFlow)
   ============================================================ */
#app { scrollbar-width: none; -ms-overflow-style: none; }
#app::-webkit-scrollbar { width: 0; height: 0; display: none; }
.story-sheet::-webkit-scrollbar { display: none; }
.story-sheet { scrollbar-width: none; }

/* ============================================================
   Karten-Seite: vollflächig, Titel schwebt darüber
   ============================================================ */
.map-fullpage {
  position: relative;
  /* volle Höhe bis knapp über die schwebende Nav */
  height: calc(100dvh - var(--nav-h) - -94px);
}
.all-map-full {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 0;
}
.map-title-overlay {
  position: absolute; z-index: 700;
  top: calc(14px + var(--safe-t)); left: 14px; right: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.8);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 12px 18px;
  pointer-events: none;
}
.map-title-overlay h1 {
  font-family: var(--font-display); color: var(--display-ink);
  font-size: 24px; font-weight: 700; letter-spacing: -.03em;
}
.map-title-overlay p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* Map-Seite sitzt bündig unter dem Header (kein zusätzliches #app-Padding doppeln);
   der Titel-Overlay rückt unter den Header. */
.map-title-overlay { top: calc(var(--hdr-h) + var(--safe-t) + 12px) !important; }

/* Im Handy-Frame an Rahmenhöhe binden */
@media (min-width: 760px) {
  #phone .map-fullpage { height: calc(100% - var(--nav-h) - -94px); }
}

/* ============================================================
   Navi-Vollbild-Modus (Tour läuft)
   ============================================================ */
.nav-overlay {
  position: fixed; inset: 0; z-index: 940;
  background: var(--paper);
}
.nav-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.nav-end-btn {
  position: absolute; z-index: 945;
  bottom: calc(108px + var(--safe-b)); left: 50%; transform: translateX(-50%);
  border: 0; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-weight: 800; font-size: 14px; padding: 12px 26px;
  box-shadow: 0 10px 24px rgba(226,114,91,.4);
}
.nav-end-btn:active { transform: translateX(-50%) scale(.96); }
.nav-mini {
  position: absolute; z-index: 945;
  bottom: calc(16px + var(--safe-b)); left: 14px; right: 14px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.8);
  backdrop-filter: blur(14px);
  border-radius: 22px; padding: 14px 18px;
  box-shadow: var(--shadow);
}
.nav-mini .main { flex: 1; min-width: 0; }
.nav-mini strong { display: block; font-size: 15px; font-weight: 800; }

/* Banner + Wegpunkt-Sheet über dem Navi-Overlay */
.nav-banner { z-index: 965 !important; }
.sheet-backdrop { z-index: 966 !important; }
.story-sheet { z-index: 967 !important; }

/* Im Handy-Frame: Overlay nur im Rahmen */
@media (min-width: 760px) {
  #phone .nav-overlay,
  #phone .nav-end-btn,
  #phone .nav-mini { position: absolute; }
}

/* ---------- Tour-Eckdaten (Länge / Dauer) ---------- */
.tour-stats {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; color: #51605B; font-size: 13.5px; font-weight: 700;
}
.tour-stats i { color: var(--muted); font-style: normal; }

/* ============================================================
   Fester App-Header (Burger + Logo + Profil)
   ============================================================ */
.app-header {
  position: fixed; z-index: 885;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--hdr-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0;
  background: rgba(247,245,239,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.hdr-btn {
  flex: none; width: 44px; height: 44px;
  border: 0; border-radius: 14px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.hdr-btn:active { transform: scale(.94); }
.hdr-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.hdr-mark {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mint), #B7DED4);
  color: #fff; font-weight: 900; font-size: 18px;
  box-shadow: 0 6px 16px rgba(94,156,142,.25);
}
.hdr-brand strong {
  font-family: var(--font-display); color: var(--display-ink);
  font-size: 20px; font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hdr-profile { background: var(--mint-soft); color: var(--mint-deep); }

/* Content unter den Header schieben */
#app { padding-top: calc(var(--hdr-h) + var(--safe-t)); }
/* Story-Detail (Vollbild-Hero) randlos -> kein Header-Versatz, Header transparent darüber */
body.story-view #app { padding-top: 0; }
body.story-view .app-header { display: none; }
/* Map vollflächig: kein Content-Padding, Karte beginnt oben; Header schwebt darüber */
body.map-view #app { padding-top: 0; }

/* Da der Header jetzt den oberen Rand stellt, die alten Seiten-Köpfe entlasten */
.page-head { padding-top: 18px; }
.home-hero { padding-top: 14px; }
.info-page .page-head { padding-top: 14px; }

/* ============================================================
   Flyout-Menü (Drawer)
   ============================================================ */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 974;
  background: rgba(31,48,43,.28);
  opacity: 0; transition: opacity .26s ease;
}
.drawer-backdrop.show { opacity: 1; }

.drawer {
  position: fixed; z-index: 975;
  top: 0; left: 0; bottom: 0;
  width: 82%; max-width: 320px;
  background: var(--paper);
  box-shadow: 12px 0 40px rgba(31,48,43,.22);
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.2,.9,.3,1);
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) 0 calc(16px + var(--safe-b));
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 18px 18px; border-bottom: 1px solid var(--line);
}
.drawer-mark { width: 44px; height: 44px; font-size: 20px; border-radius: 14px; }
.drawer-head strong { display: block; font-size: 16px; font-weight: 850; }
.drawer-head .drawer-close { margin-left: auto; }

.drawer-nav { display: flex; flex-direction: column; padding: 12px 12px; gap: 2px; flex: 1; }
.drawer-nav a, .drawer-nav button {
  display: flex; align-items: center; gap: 13px;
  text-decoration: none; color: var(--ink);
  font-size: 15px; font-weight: 700;
  padding: 14px 14px; border-radius: 16px;
  border: 0; background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.drawer-nav a:active, .drawer-nav button:active { background: var(--mint-soft); }
.drawer-nav span { flex: 1; }

.drawer-foot { padding: 14px 20px 0; border-top: 1px solid var(--line); }

/* Header + Drawer im Handy-Frame nur innerhalb des Rahmens */
@media (min-width: 760px) {
  #phone .app-header,
  #phone .drawer-backdrop,
  #phone .drawer { position: absolute; }
}

/* ---------- Info-/Menü-Seiten ---------- */
.info-page .page-head { padding-top: calc(70px + var(--safe-t)); }
.faq {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px; margin-bottom: 10px;
}
.faq summary { font-weight: 750; font-size: 14.5px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '＋'; float: right; color: var(--mint-deep); font-weight: 800; }
.faq[open] summary::after { content: '－'; }
.faq p { margin: 10px 0 0; color: #51605B; font-size: 13.5px; }

.set-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row > div { flex: 1; }
.set-row strong { display: block; font-size: 14.5px; }
.set-row .hint { font-size: 12.5px; }

/* Toggle-Switch */
.switch { position: relative; flex: none; width: 48px; height: 28px; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line); transition: background .2s;
}
.switch span::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .2s;
}
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::before { transform: translateX(20px); }



/* Demo-SVG in der Intro-Illustration */
.intro-svg { width: 100%; height: 100%; max-height: 200px; display: block; }
