/* ============================================================
   Tauschke App — Komponenten-Styles
   Mobil: Fullscreen-App. Desktop (≥800px): Phone-Rahmen in
   animierter Naturszene.
   ============================================================ */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #14100D;
  overscroll-behavior: none;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Keyframes ---------- */

@keyframes cardIn  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes msgIn   { from { opacity: 0; transform: translateY(8px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes dotPulse { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
@keyframes fadeHint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Stage & App-Spalte ---------- */

.stage {
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: 100dvh;
  position: relative;
}

.app {
  width: 100%;
  max-width: 480px;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: var(--shadow-3);
}

.screen { display: none; flex: 1; min-height: 0; }
.screen.active { display: flex; flex-direction: column; }

/* ============================================================
   Phase 1 — Start
   ============================================================ */

.start {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: cardIn var(--dur-slow) var(--ease-out);
  background: var(--paper);
}

.start__hero {
  position: relative;
  padding: calc(var(--safe-top) + var(--s-6)) var(--s-6) var(--s-5);
  background:
    linear-gradient(175deg, rgba(238, 242, 235, 0.55) 0%, rgba(251, 248, 243, 0.88) 55%, var(--paper) 100%),
    url("../assets/img/praxis.jpeg") center 30% / cover no-repeat;
}

.start__hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(107, 142, 106, 0.10), rgba(251, 248, 243, 0) 60%);
  pointer-events: none;
}

.start__logo { height: 52px; max-width: 100%; width: auto; display: block; margin: 0 auto; object-fit: contain; position: relative; z-index: 1; }

.start__body { padding: var(--s-5) var(--s-6) 0; display: flex; flex-direction: column; }

.start__eyebrow {
  font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--sage-dark); margin-bottom: var(--s-3);
}

.start__title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(28px, 8vw, 34px); line-height: 1.12; letter-spacing: -0.01em;
  margin: 0 0 var(--s-3); color: var(--ink); text-wrap: balance;
}

.start__lead { margin: 0 0 var(--s-5); font-size: 15px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

.choices { display: flex; flex-direction: column; gap: var(--s-3); }

.choice {
  display: flex; align-items: center; gap: var(--s-3);
  text-align: left; padding: var(--s-3) var(--s-4);
  min-height: 76px; width: 100%;
  background: var(--bg-elevated); border: none; border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); cursor: pointer; font-family: var(--font-sans);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.choice:hover  { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.choice:active { transform: scale(0.98); box-shadow: var(--shadow-1); }

.choice__icon {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--sage-wash);
}
.choice__icon svg { width: 24px; height: 24px; display: block; }
.choice--other .choice__icon { background: var(--terracotta-soft); }

.choice__txt { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice__title { font-family: var(--font-serif); font-size: 17px; line-height: 1.25; color: var(--ink); }
.choice__sub { font-size: 13px; color: var(--ink-3); }
.choice__arrow { color: var(--sage-dark); font-size: 18px; flex: 0 0 auto; }

/* --- INTEAMATE. — Klienten-Login (App-Kachel unter den Momenten) --- */

.app-login { margin-top: var(--s-6); }
.app-login__label {
  font-size: var(--fs-xs); color: var(--ink-3);
  letter-spacing: 0.02em; margin-bottom: var(--s-2);
}
.choice--app {
  text-decoration: none; color: inherit;
  background: var(--paper-2); border: 1.5px solid var(--paper-3);
  box-shadow: var(--shadow-1);
}
.choice__icon--app { background: var(--ink); }
.inteamate-mini {
  font-family: var(--font-brand); font-weight: 700; font-size: 15px;
  color: #FFFFFF; letter-spacing: 0.02em;
}
.choice__title--brand {
  font-family: var(--font-brand); font-weight: 700;
  font-size: 18px; letter-spacing: 0.04em; color: var(--ink);
}

/* ============================================================
   Artikel-Kacheln aus dem Website-CMS („Zum Weiterlesen")
   ============================================================ */

.reads { margin-top: var(--s-7); display: flex; flex-direction: column; }

.reads__eyebrow {
  font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--sage-dark); margin-bottom: var(--s-2);
}
.reads__title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 24px; line-height: 1.15; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 var(--s-4);
}

/* --- Gemeinsame Kachel-Basis: Bild + dunkler Verlauf + Text darüber --- */

.acard {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r-lg); background: var(--sage-dark);
  text-decoration: none; box-shadow: var(--shadow-2);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.acard:hover  { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.acard:active { transform: scale(0.98); }
.acard:focus-visible { outline: none; box-shadow: var(--shadow-focus), var(--shadow-3); }

.acard__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.acard:hover .acard__img { transform: scale(1.04); }
.acard__img--empty {
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(217, 183, 122, 0.35), transparent 55%),
    linear-gradient(160deg, var(--sage) 0%, var(--sage-dark) 70%);
}

.acard__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 13, 0) 30%, rgba(20, 16, 13, 0.42) 62%, rgba(20, 16, 13, 0.82) 100%);
}

/* Kontrast-Variante für helle Bilder (z. B. JobGlück-Kachel): Verlauf setzt
   früher ein und dunkelt auch die Bildmitte ab, damit Text lesbar bleibt. */
.acard--contrast .acard__shade {
  background: linear-gradient(180deg, rgba(20, 16, 13, 0.22) 0%, rgba(20, 16, 13, 0.55) 45%, rgba(20, 16, 13, 0.88) 100%);
}

/* Das Seitenverhältnis liegt auf dem Inhalt-Container: ist der Text höher,
   wächst die Kachel nach unten mit, statt oben abgeschnitten zu werden. */
.acard__body {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  justify-content: flex-end;
  padding: var(--s-4);
}

.acard__chip {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--paper); background: rgba(251, 248, 243, 0.18);
  border: 1px solid rgba(251, 248, 243, 0.35);
  backdrop-filter: blur(3px);
  padding: 3px 10px; border-radius: var(--r-pill);
}

.acard__title {
  font-family: var(--font-serif); color: var(--paper);
  text-wrap: balance; text-shadow: 0 1px 12px rgba(20, 16, 13, 0.45);
}
.acard__meta { font-size: 12px; color: rgba(251, 248, 243, 0.75); letter-spacing: 0.02em; }

.acard__cta {
  margin-top: var(--s-2);
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cta); color: var(--cta-fg);
  font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-2);
}

/* --- Hero: volle Breite --- */

.acard--hero { margin-bottom: var(--s-4); }
.acard--hero .acard__body { aspect-ratio: 16 / 11; }
.acard--hero .acard__title { font-size: 22px; line-height: 1.2; }

/* --- Minis: horizontale Scroll-Reihe, blutet an den Screenrand aus --- */

.acard-row {
  display: flex; gap: var(--s-3);
  overflow-x: auto;
  margin: 0 calc(-1 * var(--s-6));
  padding: 2px var(--s-6) var(--s-3);
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--s-6);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.acard-row::-webkit-scrollbar { display: none; }

/* Maus-Bedienung: Snapping würde Rad-/Zieh-Scrolling zurückschnappen lassen;
   Touch behält es (dort scrollt der Finger nativ). */
@media (hover: hover) and (pointer: fine) {
  .acard-row { scroll-snap-type: none; cursor: grab; }
  .acard-row.is-dragging { cursor: grabbing; }
  .acard-row.is-dragging .acard { pointer-events: none; }
}

.acard--mini {
  flex: 0 0 58%; max-width: 240px;
  scroll-snap-align: start;
}
.acard--mini .acard__body { padding: var(--s-3); aspect-ratio: 4 / 5; }
.acard--mini .acard__title { font-size: 17px; line-height: 1.22; }
.acard--mini .acard__meta { font-size: 11px; }
.acard--mini .acard__chip { font-size: 10px; padding: 2px 8px; }

.start__footer {
  margin-top: auto;
  padding: var(--s-6) var(--s-6) calc(var(--safe-bottom) + var(--s-5));
  display: flex; flex-direction: column; gap: var(--s-2);
}
.start__sig { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.02em; }
.legal-links { font-size: var(--fs-xs); color: var(--ink-3); }
.legal-links a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.legal-links a:hover { color: var(--terracotta-dark); }

/* ============================================================
   Phase 2 — Story
   ============================================================ */

.story {
  flex: 1; display: flex; flex-direction: column;
  color: var(--paper); position: relative;
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(78, 109, 78, 0.35), rgba(30, 26, 22, 0) 60%),
    radial-gradient(140% 100% at 50% -20%, rgba(74, 66, 56, 0.55), rgba(30, 26, 22, 0) 55%),
    linear-gradient(180deg, #26211B 0%, #1E1A16 45%, #191511 100%);
}

.story__top { position: relative; z-index: 6; padding: calc(var(--safe-top) + var(--s-3)) var(--s-4) 0; }

.story__segs { display: flex; gap: 4px; }
.seg { flex: 1; height: 3px; border-radius: var(--r-pill); background: rgba(251, 248, 243, 0.22); overflow: hidden; }
.seg__fill { height: 100%; border-radius: var(--r-pill); background: var(--paper); width: 0%; transition: width var(--dur-base) var(--ease-in-out); }

.story__bar { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-2); }
.story__label { font-size: var(--fs-xs); letter-spacing: 0.18em; text-transform: uppercase; color: var(--sage-soft); }
.story__close {
  width: 44px; height: 44px; margin-right: -10px;
  background: none; border: none; color: var(--ink-line);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.story__close:active { transform: scale(0.9); }

.tap-l { position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 34%; cursor: pointer; }
.tap-r { position: absolute; z-index: 1; right: 0; top: 0; bottom: 0; width: 66%; cursor: pointer; }

.story__card {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: var(--s-6); animation: cardIn var(--dur-slow) var(--ease-out);
  pointer-events: none; position: relative; z-index: 2;
}
.card__eyebrow { font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sage-soft); margin-bottom: var(--s-4); }
.card__title { font-family: var(--font-serif); font-size: clamp(28px, 7.5vw, 36px); line-height: 1.15; letter-spacing: -0.01em; color: var(--paper); text-wrap: balance; margin-bottom: var(--s-4); }
.card__body { font-size: 17px; line-height: 1.65; color: var(--ink-line); text-wrap: pretty; max-width: 42ch; }
.card__sig { font-family: var(--font-script); font-size: 30px; color: var(--sand); margin-top: var(--s-5); }

.card__ctawrap { margin-top: var(--s-6); pointer-events: auto; position: relative; z-index: 5; }
.card__cta {
  width: 100%; min-height: 56px; padding: var(--s-4) var(--s-5);
  background: var(--cta); color: var(--cta-fg); border: none; border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: 17px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-2); transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.card__cta:hover { background: var(--terracotta-dark); }
.card__cta:active { transform: scale(0.98); }

.story__hint {
  position: relative; z-index: 0; text-align: center;
  padding-bottom: calc(var(--safe-bottom) + var(--s-4));
  font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.04em;
  animation: fadeHint 5s var(--ease-out) forwards;
}

/* ============================================================
   Phase 3 — Chat
   ============================================================ */

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.chat__header {
  background: var(--sage-dark); color: #FFFFFF;
  padding: calc(var(--safe-top) + var(--s-2)) var(--s-3) var(--s-2);
  display: flex; align-items: center; gap: var(--s-2);
  box-shadow: var(--shadow-2); position: relative; z-index: 2;
}
.chat__back { width: 40px; height: 44px; background: none; border: none; color: #FFFFFF; font-size: 20px; cursor: pointer; }
.chat__back:active { transform: scale(0.9); }
.chat__avatar {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--sage-soft);
  flex: 0 0 auto; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.55);
}
.chat__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.chat__id { display: flex; flex-direction: column; gap: 1px; }
.chat__name { font-size: 16px; font-weight: 600; }
.chat__status { font-size: 12px; color: rgba(255, 255, 255, 0.75); }

.chat__scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  background: var(--paper-2);
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}

.chip-day {
  align-self: center; font-size: var(--fs-xs); color: var(--ink-3);
  background: var(--paper-3); border-radius: var(--r-pill);
  padding: 4px 12px; margin-bottom: var(--s-2);
}

.msg { max-width: 84%; border-radius: 14px; padding: 10px 14px 6px; box-shadow: var(--shadow-1); animation: msgIn var(--dur-base) var(--ease-out); }
.msg--daniel { align-self: flex-start; background: var(--bg-elevated); border-top-left-radius: 4px; }
.msg--me { align-self: flex-end; background: var(--sage-soft); border-top-right-radius: 4px; }
.msg__text { font-size: 15px; line-height: 1.5; color: var(--ink); text-wrap: pretty; overflow-wrap: break-word; }
.msg__time { font-size: 11px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.msg--me .msg__time { color: var(--ink-2); }

.typing {
  align-self: flex-start; background: var(--bg-elevated);
  border-radius: 14px; border-top-left-radius: 4px;
  padding: 14px 16px; box-shadow: var(--shadow-1);
  display: flex; gap: 5px; animation: msgIn var(--dur-base) var(--ease-out);
}
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: dotPulse 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }

/* --- In-Chat-Cards (Buchung, Praxis, Formular, Fallback) --- */

.card-msg {
  align-self: flex-start; max-width: 92%; width: 320px;
  background: var(--bg-elevated); border-radius: 14px; border-top-left-radius: 4px;
  padding: var(--s-4); box-shadow: var(--shadow-2);
  animation: msgIn var(--dur-base) var(--ease-out);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.card-msg__eyebrow { font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sage-dark); }
.card-msg__title { font-family: var(--font-serif); font-size: 20px; color: var(--ink); }
.card-msg__text { font-size: 13px; line-height: 1.5; color: var(--ink-2); }

.btn-cta, .btn-line {
  display: block; text-align: center; padding: 13px 16px; min-height: 44px;
  border-radius: var(--r-md); font-family: var(--font-sans); font-size: 15px;
  text-decoration: none; cursor: pointer; transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.btn-cta { background: var(--cta); color: var(--cta-fg); border: none; font-weight: 600; }
.btn-cta:hover { background: var(--terracotta-dark); color: var(--cta-fg); }
.btn-cta:active { transform: scale(0.98); }
.btn-line { background: transparent; color: var(--sage-dark); border: 1.5px solid var(--sage); font-weight: 500; }
.btn-line:hover { color: var(--terracotta-dark); border-color: var(--terracotta); }
.btn-line:active { transform: scale(0.98); }

/* Fotos & Badges in Chat-Cards — feste Maße, damit nichts überläuft */
.card-msg__photo { width: 100%; max-width: 100%; height: auto; border-radius: var(--r-md); display: block; }
.photo-row { display: flex; gap: 6px; }
.photo-row img { width: calc(50% - 3px); min-width: 0; height: 90px; object-fit: cover; border-radius: var(--r-md); display: block; }
.card-msg .cert-row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: nowrap; }
.card-msg .cert-row img { width: 44px; height: 44px; flex: 0 0 44px; border-radius: var(--r-sm); object-fit: contain; }

/* --- Formular in der Chat-Card --- */

.form-card .field { display: flex; flex-direction: column; gap: 4px; }
.form-card label { font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: 0.02em; }
.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="tel"],
.form-card textarea {
  font-family: var(--font-sans); font-size: 15px; color: var(--ink);
  padding: 11px 12px; border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--paper); outline: none; width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.form-card input:focus, .form-card textarea:focus { border-color: var(--sage); box-shadow: var(--shadow-focus); }
.form-card textarea { resize: vertical; min-height: 60px; }

.form-card .consent { display: flex; align-items: flex-start; gap: var(--s-2); font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.form-card .consent input { margin-top: 2px; accent-color: var(--sage-dark); width: 16px; height: 16px; flex: 0 0 auto; }
.form-card .consent a { color: var(--sage-dark); }

.form-card .form-error { font-size: 12px; color: var(--danger); display: none; }
.form-card .form-error.show { display: block; }
.form-card .btn-cta[disabled] { opacity: 0.6; cursor: wait; }

/* Honeypot: für Menschen unsichtbar */
.form-card .hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; overflow: hidden; }

/* --- Quick Replies --- */

.replies {
  background: var(--paper); border-top: 1px solid var(--border);
  padding: var(--s-3) var(--s-4) calc(var(--safe-bottom) + var(--s-3));
  display: flex; flex-wrap: wrap; gap: var(--s-2); min-height: 52px;
}
.reply {
  min-height: 46px; padding: 11px 18px;
  background: var(--bg-elevated); color: var(--sage-dark);
  border: 1.5px solid var(--sage); border-radius: var(--r-pill);
  font-family: var(--font-sans); font-size: 15px; font-weight: 500; cursor: pointer;
  animation: msgIn var(--dur-base) var(--ease-out);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.reply:hover { background: var(--sage-wash); }
.reply:active { transform: scale(0.96); }
.reply--cta { background: var(--cta); color: var(--cta-fg); border: none; font-weight: 600; }
.reply--cta:hover { background: var(--terracotta-dark); }

/* --- In-App-Sheet (Overlay für „Zum Nachlesen" im Chat) --- */

@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sheet {
  position: absolute; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: var(--paper);
  animation: sheetIn var(--dur-base) var(--ease-out);
}
.sheet__bar {
  background: var(--sage-dark); color: #FFFFFF;
  padding: calc(var(--safe-top) + var(--s-2)) var(--s-4) var(--s-2);
  display: flex; align-items: center; gap: var(--s-2);
  box-shadow: var(--shadow-2); flex: 0 0 auto;
}
.sheet__close {
  background: none; border: none; color: #FFFFFF;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  min-height: 44px; padding: 0; cursor: pointer;
  display: flex; align-items: center; gap: var(--s-2);
}
.sheet__close:active { transform: scale(0.97); }
.sheet iframe { flex: 1; width: 100%; border: none; background: var(--paper); }

/* ============================================================
   Artikelansicht (öffentliche Seite /artikel/…)
   ============================================================ */

.artikel-page {
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(107, 142, 106, 0.22), transparent 55%),
    linear-gradient(180deg, #1B1712 0%, #14100D 100%);
}

.artview { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); animation: cardIn var(--dur-slow) var(--ease-out); }
.artview__scroll { flex: 1; min-height: 0; overflow-y: auto; }

.artview__cover {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-dark) 70%);
}
.artview__cover--empty { aspect-ratio: auto; height: calc(var(--safe-top) + 76px); }
.artview__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.artview__cover-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 13, 0.35) 0%, rgba(20, 16, 13, 0) 40%);
}

.artview__back {
  position: absolute; z-index: 2;
  top: calc(var(--safe-top) + 10px); left: 14px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(251, 248, 243, 0.92); color: var(--ink);
  border-radius: var(--r-pill); text-decoration: none;
  font-size: 19px; box-shadow: var(--shadow-2);
  transition: transform var(--dur-fast) var(--ease-out);
}
.artview__back:hover { color: var(--terracotta-dark); }
.artview__back:active { transform: scale(0.92); }
.artview__back-inline { display: inline-block; margin-bottom: var(--s-5); font-size: 14px; }

.artview__content { padding: var(--s-5) var(--s-6) calc(var(--safe-bottom) + var(--s-6)); }

.artview__chip {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--sage-dark); background: var(--sage-wash);
  padding: 4px 12px; border-radius: var(--r-pill);
  margin-bottom: var(--s-3);
}

.artview__title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(26px, 7vw, 32px); line-height: 1.15; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 var(--s-2); text-wrap: balance;
}
.artview__meta { font-size: 13px; color: var(--ink-3); margin-bottom: var(--s-5); }

/* --- Fließtext (gerendertes Markdown) --- */

.prose { font-family: var(--font-sans); color: var(--ink); }
.prose p { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 var(--s-4); }
.prose h2 { font: 400 22px/1.25 var(--font-serif); color: var(--ink); margin: var(--s-6) 0 var(--s-3); }
.prose h3 { font: 500 19px/1.3 var(--font-serif); color: var(--ink); margin: var(--s-5) 0 var(--s-2); }
.prose h4 { font: 600 16px/1.35 var(--font-sans); color: var(--ink); margin: var(--s-5) 0 var(--s-2); }
.prose ul, .prose ol { margin: 0 0 var(--s-4); padding-left: 1.3em; }
.prose li { font-size: 16px; line-height: 1.65; color: var(--ink-2); margin-bottom: var(--s-1); }
.prose blockquote {
  margin: var(--s-5) 0; padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--sage);
  background: var(--sage-wash); border-radius: 0 var(--r-md) var(--r-md) 0;
}
.prose blockquote p { font-family: var(--font-serif); font-style: italic; font-size: 17px; color: var(--ink); margin: 0; }
.prose hr { border: none; border-top: 1px solid var(--paper-3); margin: var(--s-6) 0; }
.prose code { background: var(--paper-2); border-radius: var(--r-xs); padding: 1px 5px; font-family: var(--font-mono); font-size: 0.9em; }
.prose a { color: var(--sage-dark); }
.prose a:hover { color: var(--terracotta-dark); }

.prose-img { margin: var(--s-5) calc(-1 * var(--s-2)); }
.prose-img img { width: 100%; height: auto; display: block; border-radius: var(--r-md); box-shadow: var(--shadow-2); }

/* --- Artikel-Fuß --- */

.artview__foot {
  margin-top: var(--s-7); padding-top: var(--s-5);
  border-top: 1px solid var(--paper-3);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.artview__sig { font-family: var(--font-script); font-size: 34px; color: var(--sand); line-height: 1; }
.artview__home { margin: var(--s-3) 0 var(--s-2); }

/* ============================================================
   Rechtsseiten (Impressum / Datenschutz)
   ============================================================ */

.legal {
  flex: 1; overflow-y: auto;
  padding: calc(var(--safe-top) + var(--s-6)) var(--s-6) calc(var(--safe-bottom) + var(--s-8));
  background: var(--paper);
}
.legal h1 { font-size: var(--fs-xl); }
.legal h2 { font-size: var(--fs-lg); margin-top: var(--s-6); }
.legal p, .legal li { font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.legal .backlink { display: inline-block; margin-bottom: var(--s-5); font-size: 14px; }

/* ============================================================
   Desktop (≥ 800px): Phone in animierter Naturszene
   ============================================================ */

#scene { display: none; }
.desk-hint { display: none; }
.desk-topbar { display: none; }
.phone-island { display: none; }

@media (min-width: 800px) {
  body { overflow: hidden; }

  .stage { align-items: center; }

  #scene {
    display: block;
    position: fixed; inset: 0; z-index: 0;
  }
  #scene svg { width: 100%; height: 100%; display: block; }

  .app {
    /* Phone-Gehäuse */
    --safe-top: 44px;
    --safe-bottom: 16px;
    position: relative; z-index: 2;
    width: 390px; max-width: 390px;
    height: min(820px, calc(100dvh - 56px));
    border-radius: 48px;
    border: 11px solid #23201C;
    outline: 2px solid #4A4238;
    outline-offset: -1px;
    box-shadow:
      0 40px 80px rgba(20, 16, 13, 0.45),
      0 12px 28px rgba(20, 16, 13, 0.30),
      inset 0 0 2px rgba(255, 255, 255, 0.35);
    animation: phoneFloat 7s var(--ease-in-out) infinite alternate;
  }

  /* Dynamic-Island-Pille */
  .phone-island {
    display: block;
    position: absolute; z-index: 50;
    top: 12px; left: 50%; transform: translateX(-50%);
    width: 110px; height: 26px; border-radius: var(--r-pill);
    background: #14100D;
    pointer-events: none;
  }

  /* Seitentasten */
  .app::before, .app::after {
    content: ""; position: absolute; background: #23201C; border-radius: 3px; z-index: 60;
  }
  .app::before { left: -14px; top: 120px; width: 4px; height: 64px; }   /* Lautstärke */
  .app::after  { right: -14px; top: 150px; width: 4px; height: 84px; }  /* Power */

  .desk-hint {
    display: block;
    position: fixed; z-index: 2;
    left: 50%; transform: translateX(-50%);
    bottom: 22px;
    font-size: 13px; color: rgba(30, 26, 22, 0.55);
    letter-spacing: 0.03em;
    background: rgba(251, 248, 243, 0.55);
    padding: 6px 14px; border-radius: var(--r-pill);
    backdrop-filter: blur(4px);
  }

  /* --- Topbar: Logo links, INTEAMATE-Login rechts --- */
  .desk-topbar {
    display: flex;
    position: fixed; z-index: 3;
    top: 0; left: 0; right: 0;
    align-items: center; justify-content: space-between;
    padding: var(--s-4) var(--s-6);
    pointer-events: none;   /* Klicks nur auf Logo & Button, nicht auf die Leiste */
  }
  .desk-topbar a { pointer-events: auto; }

  .desk-topbar__logo { display: block; }
  .desk-topbar__logo img { height: 48px; width: auto; display: block; }

  .desk-topbar__login {
    display: inline-flex; align-items: center; gap: var(--s-2);
    min-height: 44px; padding: 8px 18px 8px 10px;
    background: var(--ink); color: #FFFFFF;
    border-radius: var(--r-pill); text-decoration: none;
    font-family: var(--font-brand); font-weight: 700;
    font-size: 15px; letter-spacing: 0.04em;
    box-shadow: var(--shadow-2);
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  }
  .desk-topbar__login:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); color: #FFFFFF; }
  .desk-topbar__login:active { transform: scale(0.97); }

  .desk-topbar__login-mark {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.16);
    font-size: 13px;
  }
}

@keyframes phoneFloat { from { transform: translateY(-4px); } to { transform: translateY(6px); } }

/* ============================================================
   Szene: Tageszeit & Jahreszeit
   app.js setzt auf <body>: scene--morgen|tag|abend|nacht und
   season--fruehling|sommer|herbst|winter. Die Farben laufen über
   CSS-Variablen; Fallbacks = bisherige Sommer-Tag-Optik.
   Die Attribut-Selektoren matchen die SVG-Originalfarben.
   ============================================================ */

#scene #sky stop:nth-of-type(1) { stop-color: var(--sky1, #F6EEDC); }
#scene #sky stop:nth-of-type(2) { stop-color: var(--sky2, #F3EAD6); }
#scene #sky stop:nth-of-type(3) { stop-color: var(--sky3, #EDE3CB); }

#scene .sun circle:nth-of-type(2) { fill: var(--sun1, #F2E5C8); }
#scene .sun circle:nth-of-type(3) { fill: var(--sun2, #EFD9A8); }

#scene .cloud-a g, #scene .cloud-b g, #scene .cloud-c g { fill: var(--cloud, #FBF8F3); }

#scene .moon, #scene .stars { display: none; }
#scene .moon circle:nth-of-type(3) { fill: var(--sky1, #232B3F); }

#scene .land { filter: var(--land-filter, none); }

/* Hügel (Pfade) */
#scene .land path[fill="#CBD7C6"] { fill: var(--hill1, #CBD7C6); }
#scene .land path[fill="#9DB598"] { fill: var(--hill2, #9DB598); }
#scene .land path[fill="#6B8E6A"] { fill: var(--hill3, #6B8E6A); }
#scene .land path[fill="#4E6D4E"] { fill: var(--hill4, #4E6D4E); }
/* Baumkronen (Ellipsen) */
#scene .land ellipse[fill="#4E6D4E"] { fill: var(--leaf-d, #4E6D4E); }
#scene .land ellipse[fill="#5E8A5E"] { fill: var(--leaf-m, #5E8A5E); }
#scene .land ellipse[fill="#6B8E6A"] { fill: var(--leaf-l, #6B8E6A); }
/* Gräser */
#scene .land g[stroke="#3E5A3E"] { stroke: var(--grass, #3E5A3E); }

/* ---------- Tageszeiten ---------- */

.scene--morgen {
  --sky1: #F8E5CA; --sky2: #F7D9B4; --sky3: #F3CFA2;
  --sun1: #F7DFAC; --sun2: #F0C070;
  --land-filter: brightness(0.97) saturate(1.03);
}
.scene--morgen #scene .sun { transform: translate(-780px, 240px); }

.scene--abend {
  --sky1: #E2A47E; --sky2: #EFC498; --sky3: #F4DBAE;
  --sun1: #F4BC6C; --sun2: #EA9440;
  --cloud: #FBEBD8;
  --land-filter: brightness(0.8) saturate(1.05) hue-rotate(-8deg);
}
.scene--abend #scene .sun { transform: translate(-140px, 300px); }

.scene--nacht {
  --sky1: #232B3F; --sky2: #1B2233; --sky3: #141A29;
  --cloud: #3A425A;
  --land-filter: brightness(0.42) saturate(0.55);
}
.scene--nacht #scene .sun { display: none; }
.scene--nacht #scene .moon, .scene--nacht #scene .stars { display: block; }
.scene--nacht #scene .cloud-a { opacity: 0.3; }
.scene--nacht #scene .cloud-b { opacity: 0.22; }
.scene--nacht #scene .cloud-c { opacity: 0.18; }
.scene--nacht #scene .birds-a, .scene--nacht #scene .birds-b { display: none; }
.scene--nacht .desk-hint { color: rgba(251, 248, 243, 0.65); background: rgba(30, 26, 22, 0.45); }

/* ---------- Jahreszeiten ---------- */

.season--fruehling {
  --hill1: #D9E4CD; --hill2: #A9C89B; --hill3: #7BA36C; --hill4: #587D50;
  --leaf-d: #5E8A54; --leaf-m: #74A768; --leaf-l: #8CBB7C;
  --grass: #4E7A44;
}
/* Sommer = Grundzustand (Fallback-Werte) */
.season--herbst {
  --hill1: #E2D6BB; --hill2: #C9B183; --hill3: #A3814F; --hill4: #7A5C36;
  --leaf-d: #A65B2B; --leaf-m: #C27A35; --leaf-l: #D19245;
  --grass: #8A6B3A;
}
.season--winter {
  --hill1: #E9ECF0; --hill2: #D3DAE2; --hill3: #B4C0CB; --hill4: #8E9DAB;
  --leaf-d: #4C5F55; --leaf-m: #5A7062; --leaf-l: #69816F;
  --grass: #8895A3;
}

/* Schneehauben auf den Baumkronen — nur im Winter sichtbar */
#scene .snow { display: none; }
.season--winter #scene .snow { display: block; fill: #EFF3F7; opacity: 0.96; }

/* ---------- Szenen-Animationen (SVG) ---------- */

.cloud-a { animation: cloudDrift 90s linear infinite; }
.cloud-b { animation: cloudDrift 130s linear infinite; animation-delay: -40s; }
.cloud-c { animation: cloudDrift 110s linear infinite; animation-delay: -75s; }
@keyframes cloudDrift {
  from { transform: translateX(-18%); }
  to   { transform: translateX(112%); }
}

.sun-glow { animation: sunPulse 9s var(--ease-in-out) infinite alternate; transform-origin: center; transform-box: fill-box; }
@keyframes sunPulse { from { opacity: 0.55; } to { opacity: 0.9; } }

.tree { transform-box: fill-box; transform-origin: 50% 100%; }
.tree--1 { animation: treeSway 5.2s var(--ease-in-out) infinite alternate; }
.tree--2 { animation: treeSway 6.4s var(--ease-in-out) infinite alternate; animation-delay: -1.8s; }
.tree--3 { animation: treeSway 4.6s var(--ease-in-out) infinite alternate; animation-delay: -0.9s; }
.tree--4 { animation: treeSway 7.1s var(--ease-in-out) infinite alternate; animation-delay: -3.2s; }
@keyframes treeSway {
  from { transform: rotate(-1.6deg) skewX(-1deg); }
  to   { transform: rotate(1.8deg) skewX(1.2deg); }
}

.grass { transform-box: fill-box; transform-origin: 50% 100%; }
.grass--1 { animation: grassSway 3.2s var(--ease-in-out) infinite alternate; }
.grass--2 { animation: grassSway 2.7s var(--ease-in-out) infinite alternate; animation-delay: -1.1s; }
.grass--3 { animation: grassSway 3.8s var(--ease-in-out) infinite alternate; animation-delay: -2s; }
@keyframes grassSway {
  from { transform: skewX(-4deg); }
  to   { transform: skewX(5deg); }
}

.birds-a { animation: birdsFly 38s linear infinite; }
.birds-b { animation: birdsFly 52s linear infinite; animation-delay: -26s; }
@keyframes birdsFly {
  0%   { transform: translate(-12%, 4%); opacity: 0; }
  4%   { opacity: 1; }
  46%  { opacity: 1; }
  50%  { transform: translate(115%, -6%); opacity: 0; }
  100% { transform: translate(115%, -6%); opacity: 0; }
}

.bird-wing { animation: wingFlap 0.85s var(--ease-in-out) infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes wingFlap { from { transform: scaleY(0.55); } to { transform: scaleY(1.15); } }

.hill-back { animation: hillBreeze 26s var(--ease-in-out) infinite alternate; }
@keyframes hillBreeze { from { transform: translateX(0); } to { transform: translateX(-14px); } }

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .cloud-a, .cloud-b, .cloud-c, .birds-a, .birds-b, .bird-wing,
  .tree--1, .tree--2, .tree--3, .tree--4,
  .grass--1, .grass--2, .grass--3, .hill-back, .sun-glow { animation: none !important; }
  .app { animation: none !important; }
  .story__hint { animation: none; opacity: 1; }
}
