/* youpartments Gästeportal · stay.youpartments.com
   ==========================================================================
   Dokumentierte Ausnahme vom Dark-Standard: öffentliche Gast-App im hellen
   Theme nach Projekt 20 (Tokens unverändert übernommen); Dark Mode folgt
   automatisch prefers-color-scheme (gleiche Struktur, nur Tokens umgeschaltet).
   Farben stehen ausschließlich in den Token-Blöcken (Kontrast AA, geprüft in
   tests/frontend/test_pwa.js). Systemschriften, keine externen Ressourcen,
   keine Inline-Styles (CSP 'self'). Mobil zuerst, 16-px-Gutter, 8-px-Raster,
   dvh + Safe-Area, sichtbare Fokusringe. Bewegung ≤ 240 ms (inkl. Stagger),
   prefers-reduced-motion schaltet alles auf sofort.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Farben (Projekt 20) */
  --text: #16211d;
  --text-2: #3d4a45;
  --muted: #667069;
  --line: #e4e7e5;
  --line-stark: #d3d8d5;
  --accent: #2f4f43;
  --accent-dunkel: #223b32;
  --accent-tint: #eef3f0;
  --accent-tint-2: #f6f9f7;
  --erfolg: #2b7a55;
  --erfolg-tint: #eaf4ee;
  --warn: #8a4b1f;
  --warn-tint: #fbf3ec;
  --flaeche: #f3f5f4;
  --karte: #ffffff;
  /* Ergänzungen für Fehler/Info (gleiche Temperatur) */
  --fehler: #9b2c2c;
  --fehler-tint: #fbefee;
  --info: #2f5b7a;
  --info-tint: #eef4f8;
  /* Text auf Akzentfläche, Toast, Offline-Banner, Pillenränder, Skeleton (v2, Task 3.5) */
  --auf-akzent: #ffffff;
  --toast-bg: #16211d;
  --toast-text: #ffffff;
  --offline-bg: #fbf3ec;
  --offline-text: #8a4b1f;
  --pill-info-rand: #cfe0ec;
  --pill-ok-rand: #cde6d7;
  --pill-warn-rand: #f0dcc8;
  --dot-warn: #c27a3d;
  --sk: #e6eae8;
  /* Rahmen von Bedienelementen (Häkchen): Nicht-Text-Kontrast ≥ 3:1 gegen --karte (WCAG 1.4.11) */
  --rand-kontrolle: #8a948f;
  /* Logo (Corporate Design: „you“ Salbei, „partments“ Dunkelgrün; im Dark Mode hell) */
  --logo-you: #b9c6b0;
  --logo-word: #003c32;
  --sheet-backdrop: rgba(10, 14, 12, 0.45);
  --popover-backdrop: rgba(10, 14, 12, 0.12);
  --kopf-hoehe: 56px;
  --leiste-hoehe: 60px;

  /* 8-px-Raster */
  --r1: 8px;
  --r2: 16px;
  --r3: 24px;
  --r4: 32px;
  --r5: 40px;
  --r6: 56px;

  /* Form */
  --rund-gross: 16px;
  --rund: 12px;
  --rund-klein: 10px;
  --schatten: 0 1px 2px rgba(22, 33, 29, 0.04),
              0 8px 20px -14px rgba(22, 33, 29, 0.22);
  --schatten-hoch: 0 1px 2px rgba(22, 33, 29, 0.05),
                   0 14px 32px -18px rgba(22, 33, 29, 0.30);
  --fokus: 0 0 0 3px #ffffff, 0 0 0 5px var(--accent);
  --schatten-leiste: 0 -8px 20px -16px rgba(22, 33, 29, 0.3);

  /* Bewegung */
  --zeit: 180ms;
  --zeit-lang: 200ms;
  --kurve: cubic-bezier(0.32, 0.72, 0, 1);

  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Dark Mode: gleiche Struktur, Tokens umgeschaltet (Spec §8). Jede Farbvariable aus :root steht hier. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --text: #e7ede9;
    --text-2: #c3cdc8;
    --muted: #9aa7a1;
    --line: #2a3531;
    --line-stark: #3b4843;
    --accent: #8fc9ad;
    --accent-dunkel: #b1dcc7;
    --accent-tint: #1f2e28;
    --accent-tint-2: #1b2723;
    --erfolg: #74d3a1;
    --erfolg-tint: #15291f;
    --warn: #ebb183;
    --warn-tint: #2d2219;
    --flaeche: #0f1513;
    --karte: #18201d;
    --fehler: #f4a3a3;
    --fehler-tint: #2f1b1b;
    --info: #97c6e6;
    --info-tint: #16232d;
    --auf-akzent: #0d1a14;
    --toast-bg: #e7ede9;
    --toast-text: #16211d;
    --offline-bg: #2d2219;
    --offline-text: #ebb183;
    --pill-info-rand: #2b4558;
    --pill-ok-rand: #24473a;
    --pill-warn-rand: #4d3826;
    --dot-warn: #d9925a;
    --sk: #232d29;
    --rand-kontrolle: #6f7c76;
    --logo-you: #cbd5c4;
    --logo-word: #e7ede9;
    --sheet-backdrop: rgba(0, 0, 0, 0.6);
    --popover-backdrop: rgba(0, 0, 0, 0.35);
    --schatten: 0 1px 2px rgba(0, 0, 0, 0.3),
                0 8px 20px -14px rgba(0, 0, 0, 0.7);
    --schatten-hoch: 0 1px 2px rgba(0, 0, 0, 0.35),
                     0 14px 32px -18px rgba(0, 0, 0, 0.8);
    --schatten-leiste: 0 -8px 20px -16px rgba(0, 0, 0, 0.8);
    --fokus: 0 0 0 3px #0f1513, 0 0 0 5px var(--accent);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf-hoehe) + 12px); scroll-padding-bottom: calc(var(--leiste-hoehe) + 16px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--flaeche);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  width: min(1080px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  /* Querformat mit Notch: Inhalt aus den seitlichen Safe-Areas halten */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.main { flex: 1 0 auto; padding: var(--r2) 0 var(--r4); outline: none; }

p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dunkel); }

:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: 6px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { box-shadow: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: var(--r1); z-index: 30;
  background: var(--karte); padding: 12px var(--r2); border-radius: var(--rund-klein);
  border: 2px solid var(--accent); color: var(--accent); font-weight: 600;
}
.skip-link:focus { left: var(--gutter); }

/* ---------- Kopf: schmal und dauerhaft sichtbar (Kilian 27.10.2026) ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--karte); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--r2); min-height: var(--kopf-hoehe); }
.brand { display: inline-flex; align-items: center; min-height: 44px; border-radius: 6px; }
.brand-logo { display: block; height: 22px; width: auto; }
.logo-you { fill: var(--logo-you); }
.logo-word { fill: var(--logo-word); }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-stark); border-radius: 999px; background: var(--karte); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; cursor: pointer;
  transition: background var(--zeit) var(--kurve), border-color var(--zeit) var(--kurve);
}
.lang-btn .icon { color: var(--accent); width: 18px; height: 18px; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { background: var(--accent-tint-2); border-color: var(--accent); }
/* Rechtsseiten: nur DE/EN als kleiner Umschalter */
.lang-switch { display: inline-flex; gap: 4px; }
.lang-seg[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--auf-akzent); }

/* Sprachauswahl: mobil Sheet unten, ab 640 px Popover oben rechts (lang.js) */
.lang-sheet {
  margin: auto 0 0; width: 100%; max-width: 100%; max-height: 80dvh; padding: 0; border: 0;
  border-radius: var(--rund-gross) var(--rund-gross) 0 0; background: var(--karte); color: var(--text);
  box-shadow: var(--schatten-hoch); overflow: auto;
}
.lang-sheet[open] { animation: sheet-up var(--zeit-lang) var(--kurve) both; }
.lang-sheet::backdrop { background: var(--sheet-backdrop); }
.lang-panel { padding: var(--r1) var(--r2) calc(var(--r2) + env(safe-area-inset-bottom, 0px)); }
.lang-head { display: flex; align-items: center; justify-content: space-between; gap: var(--r1); padding: 4px 0 var(--r1); }
.lang-title { font-size: 16px; }
.lang-close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--accent-tint-2); color: var(--text); cursor: pointer;
}
.lang-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lang-option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 12px;
  border: 0; border-radius: var(--rund-klein); background: transparent; color: var(--text);
  font: inherit; font-size: 16px; text-align: left; cursor: pointer;
}
.lang-option:hover { background: var(--accent-tint-2); }
.lang-option[aria-current="true"] { background: var(--accent-tint); font-weight: 600; }
.lang-name { flex: 1 1 auto; }
.lang-code { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.lang-check { color: var(--accent); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .lang-sheet {
    margin: calc(var(--kopf-hoehe) + 8px) max(var(--gutter), calc((100vw - 1080px) / 2)) auto auto;
    width: 300px; border-radius: var(--rund-gross); border: 1px solid var(--line);
  }
  .lang-sheet::backdrop { background: var(--popover-backdrop); }
  .lang-panel { padding: var(--r1) 12px 12px; }
}

/* ---------- Typografie ---------- */

h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0; outline: none; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.008em; line-height: 1.3; margin: 0; outline: none; }

.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--r1); text-wrap: balance;
}
.lead { color: var(--text-2); margin-top: var(--r1); max-width: 62ch; }
.prose { color: var(--text-2); white-space: pre-line; max-width: 68ch; text-wrap: pretty; }
.prose + .prose { margin-top: 12px; }
.note { color: var(--muted); font-size: 13.5px; text-wrap: pretty; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---------- Pillen / Status ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.4;
  border: 1px solid var(--line-stark); background: var(--accent-tint-2); color: var(--text-2);
}
.pill-info { background: var(--info-tint); border-color: var(--pill-info-rand); color: var(--info); }
.pill-ok { background: var(--erfolg-tint); border-color: var(--pill-ok-rand); color: var(--erfolg); }
.pill-warn { background: var(--warn-tint); border-color: var(--pill-warn-rand); color: var(--warn); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot-ok { background: var(--erfolg); }
.dot-warn { background: var(--dot-warn); }
.dot-info { background: var(--info); }
.dot-muted { background: var(--line-stark); }
.status-line { display: flex; align-items: center; gap: 10px; margin-bottom: var(--r1); }
.status-chip { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--r1);
  min-height: 48px; padding: 0 20px;
  border-radius: var(--rund); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2;
  cursor: pointer;
  transition: background var(--zeit) var(--kurve), border-color var(--zeit) var(--kurve),
              transform var(--zeit) var(--kurve), box-shadow var(--zeit) var(--kurve);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--auf-akzent); }
.btn-primary:hover:not([disabled]) { background: var(--accent-dunkel); color: var(--auf-akzent); }
.btn-secondary { background: var(--karte); border-color: var(--line-stark); color: var(--accent); }
.btn-secondary:hover:not([disabled]) { background: var(--accent-tint-2); border-color: var(--accent); color: var(--accent-dunkel); }
.btn-ghost {
  min-height: 40px; padding: 0 12px; background: transparent; color: var(--accent);
  border-color: transparent; font-size: 14px;
}
.btn-ghost:hover:not([disabled]) { background: var(--accent-tint); }
.btn-danger { color: var(--fehler); }
.btn-danger:hover:not([disabled]) { background: var(--fehler-tint); }
.btn-arrow::after { content: "→"; content: "→" / ""; transition: transform var(--zeit) var(--kurve); }
.btn-arrow:hover::after { transform: translateX(4px); }
.btn-back::before { content: "←"; content: "←" / ""; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: var(--r2); }
.actions-end { justify-content: flex-end; margin-top: var(--r1); }

.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " ↗"; content: " ↗" / ""; }
.link-arrow:hover { text-decoration: underline; }
.link-back { font-weight: 600; text-decoration: none; font-size: 14px; }
.link-back::before { content: "← "; content: "← " / ""; }

/* ---------- Karten ---------- */

.card {
  background: var(--karte); border: 1px solid var(--line); border-radius: var(--rund-gross);
  box-shadow: var(--schatten); padding: 20px;
}
.card-title { margin-bottom: 12px; }
.card-title-icon { display: flex; align-items: center; gap: var(--r1); }
.card-accent { border-top: 3px solid var(--accent); }
.card-cta { background: linear-gradient(180deg, var(--accent-tint-2), var(--karte) 60%); }

.grid { display: grid; grid-template-columns: 1fr; gap: var(--r2); margin-top: var(--r3); }

/* ---------- Zustände ---------- */

.state-message { max-width: 620px; padding: var(--r4) 0; }
.state-message h1 { margin-bottom: var(--r2); }
.state-message .prose { margin-bottom: 12px; }

/* Skeleton statt Spinner: ruhige Flächen in Form der Startseite (Begrüßung, Essentials-Raster),
   einmal eingeblendet, ohne Endlosanimation. */
/* Ladeansicht mindestens bildschirmhoch: der Fuß liegt schon unter dem Rand und springt nicht (CLS). */
.state-loading { min-height: 100vh; min-height: 100dvh; }
.skeleton { display: grid; gap: 12px; padding-top: var(--r1); animation: fade var(--zeit-lang) var(--kurve) both; }
.sk { background: var(--sk); border-radius: var(--rund-klein); }
.sk-line { height: 12px; }
.sk-short { width: 30%; }
.sk-title { height: 28px; width: 70%; }
.sk-phase { width: 85%; height: 16px; }
.sk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: var(--r2); }
.sk-tile { height: 112px; border-radius: var(--rund-gross); }
.sk-wide { grid-column: 1 / -1; height: 148px; }

/* ---------- Aufenthalt ---------- */

.home-hero { padding: var(--r1) 0 0; }
/* Objektname in normaler Schreibung (Versalien machten aus „m²“ „M²“), ruhig und ohne Waisenwort. */
.home-hero .eyebrow { margin-bottom: 6px; font-size: 13.5px; font-weight: 650; letter-spacing: 0.01em; text-transform: none; }
.phase-line { color: var(--text-2); margin-top: var(--r1); font-size: 16px; max-width: 62ch; text-wrap: balance; }
/* Personen und Nächte als ruhige Zeile im Kopf (Kilian: Personenzahl früh sichtbar) */
.stay-facts { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.stay-facts .icon { width: 16px; height: 16px; color: var(--accent); }
.home-hero + .home-card, .home-hero + .after-invoice { margin-top: var(--r2); }

/* Raster ohne Löcher: Spaltenbreiten kommen aus GP.plan.layoutTiles (jede Zeile voll), Kacheln einer
   Zeile gleich hoch. Mobil 2 Spalten (tile-m2 = volle Breite), ab 960 px 3 Spalten (tile-d2/-d3). */
.essentials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: var(--r3); }
.essentials > .tile { grid-column: span 1; }
.essentials > .tile-m2 { grid-column: span 2; }
.tile {
  min-width: 0; display: grid; align-content: start; gap: 10px; padding: var(--r2);
  background: var(--karte); border: 1px solid var(--line); border-radius: var(--rund-gross);
  box-shadow: var(--schatten); scroll-margin-top: var(--r2);
}
.tile-primary { border-top: 3px solid var(--accent); background: linear-gradient(180deg, var(--accent-tint-2), var(--karte) 70%); }
.tile-head {
  display: flex; align-items: center; gap: var(--r1); margin: 0;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.tile-head .icon { width: 20px; height: 20px; color: var(--accent); }
.tile-body { display: grid; gap: var(--r1); min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.tile-label { font-weight: 600; color: var(--text); }
.tile-hint { color: var(--text-2); font-size: 14px; line-height: 1.4; text-wrap: pretty; }
.tile-text, .tile-body > p { text-wrap: pretty; }
.tile-strong { font-weight: 600; color: var(--text); }
.tile-meta {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; max-width: 100%;
  padding: 4px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--text);
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
}
.tile-meta .icon { width: 16px; height: 16px; flex: none; color: var(--accent); }
.tile-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
/* Vor der Freigabe: Kalender-Plakette, Datum groß, Countdown – die Kachel wirkt nicht leer. */
.lock-panel { display: flex; align-items: flex-start; gap: var(--r2); }
.lock-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px;
  border-radius: var(--rund); background: var(--accent-tint); color: var(--accent);
}
.lock-badge .icon { width: 26px; height: 26px; }
.lock-text { display: grid; gap: 4px; min-width: 0; }
.lock-text .tile-label { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.lock-when { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; color: var(--text); }
.lock-text .countdown { font-weight: 600; color: var(--accent); }
.lock-text .note { margin-top: 4px; }
/* Abnahme 29.10.: eine Zeile ab 320 px; Codeschrift ~ (Zeilenbreite − Türschild/Icon) / Zeichenzahl (data-len) */
.code-row { display: flex; align-items: center; gap: 8px; container-type: inline-size; --code-side: 56px; --code-em: 4.1; }
.code-row.has-unit { --code-side: 146px; }
.code-row > .btn-copy-icon { margin-left: auto; }
.code-value[data-len="7"] { --code-em: 4.8; }
.code-value[data-len="8"] { --code-em: 5.45; }
.code-value[data-len="9"] { --code-em: 6.1; }
.code-value[data-len="10"] { --code-em: 6.8; }
/* Türschild: Einheitswort klein, Nummer groß – direkt am Code (Vertrag V1) */
.unit-plate {
  display: inline-grid; justify-items: center; align-content: center; flex: none; min-width: 60px; min-height: 60px; padding: 4px 8px;
  border-radius: var(--rund); background: var(--accent); color: var(--auf-akzent); line-height: 1;
}
.unit-noun { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.unit-number { margin-top: 4px; font-size: 30px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.unit-row { display: flex; align-items: center; gap: 12px; }
.unit-floor { font-size: 14px; font-weight: 600; color: var(--text-2); }
.code-value {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700;
  font-size: clamp(16px, calc((100cqi - var(--code-side)) / var(--code-em)), 34px); min-width: 0;
  letter-spacing: 0.06em; line-height: 1.1; color: var(--text); user-select: all; -webkit-user-select: all;
}
.countdown { font-variant-numeric: tabular-nums; }
.tile-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 100%; font-weight: 600; text-decoration: none; justify-self: start; }
/* Nur kurze Sprunglinks („Details ›“) bleiben einzeilig; längere (Anruf-Hilfe) dürfen in schmalen Kacheln umbrechen. */
.tile-link-short { white-space: nowrap; }
.tile-link:hover { text-decoration: underline; }
.tile-actions { display: flex; flex-wrap: wrap; gap: var(--r1); }
.btn-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-stark); border-radius: var(--rund-klein); background: var(--karte);
  color: var(--accent); font-weight: 600; text-decoration: none;
}
.btn-chip:hover { background: var(--accent-tint-2); border-color: var(--accent); color: var(--accent-dunkel); }
.tile-address { display: grid; font-style: normal; font-weight: 600; color: var(--text); min-width: 0; }
/* Adresse: Text ist der Navigationslink (dezent unterstrichen), Kopieren direkt rechts, Karten-Knöpfe in einer Zeile */
.addr-row { display: flex; align-items: center; gap: 8px; }
.addr-link { display: grid; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-stark); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.addr-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.addr-line { text-decoration: inherit; }
.map-row { display: flex; flex-wrap: nowrap; gap: var(--r1); min-width: 0; }
.map-chip { min-width: 0; white-space: nowrap; font-size: 14px; padding: 0 10px; }
.map-chip .icon { width: 18px; height: 18px; }
.btn-copy-icon { padding: 0; width: 44px; justify-content: center; flex: none; }
.btn-copy-icon .copy-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-chip-primary { background: var(--accent); border-color: var(--accent); color: var(--auf-akzent); }
.btn-chip-primary:hover { background: var(--accent-dunkel); border-color: var(--accent-dunkel); color: var(--auf-akzent); }
.parking-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.parking-line:empty { display: none; }
.parking-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.parking-actions-row:empty, .parking-actions:empty, .parking-video:empty, .video-slot:empty { display: none; }
.time-list, .wifi-list { display: grid; gap: 12px; margin: 0; }
.time-row dt, .wifi-row dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.time-row dd { display: grid; margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.time-hour { font-weight: 400; color: var(--text-2); }
.time-row.is-today dt, .time-row.is-key dt { color: var(--accent); }
.time-row.is-today .time-hour, .time-row.is-key .time-hour { font-weight: 600; color: var(--text); }
/* Im Aufenthalt: Check-in zurückgenommen (vergangen), Check-out betont (QA-Runde 3). */
.time-row.is-past dd { font-weight: 400; color: var(--text-2); }
.time-row.is-past .time-hour { color: var(--muted); }
/* Hilfe und Schlüsselübergabe: Text oben, Knöpfe/Sprunglink unten – gleich hohe Rasterzeile ohne Leerfläche
   unter dem Inhalt; der Hilfe-Satz ohne Waisenwort. */
.tile-help, .tile-access.is-pickup { grid-template-rows: auto 1fr; }
.tile-help > .tile-body, .tile-access.is-pickup > .tile-body { align-content: space-between; }
.tile-help .tile-text { text-wrap: balance; }
.tile-stack { display: grid; gap: var(--r1); }
/* Nach dem Aufenthalt: Zugang nur als ruhiger Hinweis. */
.tile-quiet .tile-body { color: var(--muted); font-size: 14px; }
/* WLAN kompakt: „Netzwerk: <SSID> [kopieren]“ / „Passwort: … [kopieren]“ (Kilian 27.10.2026) */
.wifi-list { gap: 2px; }
.wifi-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
.wifi-row dt { font-size: 14px; font-weight: 400; color: var(--text-2); }
.wifi-row dt::after { content: ":"; }
.wifi-dd { display: flex; align-items: center; gap: 4px; margin: 0; min-width: 0; }
.wifi-value {
  margin: 0; font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text);
  overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}
.tile-primary.is-revealing .tile-icon { animation: unlock 240ms var(--kurve) both; }
@keyframes unlock { 50% { transform: scale(1.25) rotate(-8deg); } }

.home-rest { margin-top: var(--r3); }

/* Unterleiste: dauerhaft unten (fixed, Safe-Area), Sprungmarken auf die Kacheln; Desktop als schwebende Leiste.
   Der Körper hält unten Platz frei, damit nichts verdeckt wird (die Fußkachel liegt darüber). */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 4px max(var(--r1), env(safe-area-inset-left, 0px)) calc(4px + env(safe-area-inset-bottom, 0px));
  background: var(--karte); border-top: 1px solid var(--line); box-shadow: var(--schatten-leiste);
}
.bottom-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px;
  border-radius: var(--rund-klein); font-size: 11.5px; font-weight: 600; color: var(--text-2); text-decoration: none;
}
.bottom-link .icon { color: var(--accent); }
.bottom-link:hover { background: var(--accent-tint-2); color: var(--text); }
body:has(.bottom-bar) { padding-bottom: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom, 0px)); }
body:has(.bottom-bar) .toast { bottom: calc(var(--leiste-hoehe) + 12px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) {
  .bottom-bar {
    left: 50%; right: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(520px, 100% - 2 * var(--gutter));
    transform: translateX(-50%); padding: 4px; border: 1px solid var(--line); border-radius: var(--rund-gross); box-shadow: var(--schatten-hoch);
  }
  body:has(.bottom-bar) { padding-bottom: calc(var(--leiste-hoehe) + 24px); }
}
/* Mobil/Tablet: Zeiten-Kachel über die volle Breite, Check-in und Check-out nebeneinander (kompakt). */
@media (max-width: 959px) {
  .tile-times.tile-m2 .time-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--r2); }
}

/* ---------- Status ---------- */

.view-status { max-width: 680px; }
.card-status { padding: var(--r3) 20px; }
.card-status h1 { margin-bottom: 12px; }
.card-status .note { margin-top: var(--r2); }

.timeline { list-style: none; margin: var(--r3) 0 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--muted); }
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: 7px; top: 30px; bottom: -10px; width: 2px; background: var(--line);
}
.tl-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-stark); background: var(--karte); flex: none; }
.tl-done { color: var(--text-2); }
.tl-done .tl-dot { background: var(--erfolg); border-color: var(--erfolg); }
.tl-done:not(:last-child)::after { background: var(--erfolg); }
.tl-current { color: var(--text); font-weight: 600; }
.tl-current .tl-label { color: var(--text); }
.tl-todo .tl-label { color: var(--text-2); }
.tl-current .tl-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); background: var(--accent); }

/* ---------- Wizard ---------- */

.view-checkin { max-width: 760px; }
.wizard-head { padding-top: var(--r1); }

.steps {
  list-style: none; margin: var(--r3) 0 var(--r2); padding: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
}
.steps li { min-width: 0; }
.step-count { margin: var(--r3) 0 0; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.step-count + .steps { margin-top: var(--r1); }
.step-btn {
  display: flex; flex-direction: column; gap: 6px; width: 100%; min-height: 44px;
  padding: 0 0 2px; background: none; border: 0; font: inherit; text-align: left; color: var(--muted);
}
button.step-btn { cursor: pointer; }
.step-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px;
  background: var(--flaeche); color: var(--muted);
  transition: background-color var(--zeit) var(--kurve), color var(--zeit) var(--kurve);
}
.step-icon .icon { width: 16px; height: 16px; }
.is-current .step-icon { background: var(--accent); color: var(--auf-akzent); }
.is-done .step-icon { background: var(--erfolg-tint); color: var(--erfolg); }
button.step-btn:hover .step-label { color: var(--accent); text-decoration: underline; }
.step-btn::before { content: ""; height: 4px; border-radius: 999px; background: var(--line); order: -1; }
.is-done .step-btn::before { background: var(--erfolg); }
.is-current .step-btn::before { background: var(--accent); }
.step-num { display: none; }
.step-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-current .step-label { color: var(--text); }
.is-done .step-label { color: var(--text-2); }

.wizard { display: grid; gap: var(--r2); }
.step-body { display: grid; gap: var(--r2); }

.subcard {
  margin: 0; min-width: 0; padding: 18px 16px 16px;
  background: var(--karte); border: 1px solid var(--line); border-radius: var(--rund-gross); box-shadow: var(--schatten);
  display: grid; gap: 14px;
}
.subcard legend {
  float: left; width: 100%; padding: 0; margin-bottom: 2px;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--r1); justify-content: space-between;
  font-size: 16px; font-weight: 600;
}
.subcard legend + * { clear: both; }
.subcard-head { display: flex; align-items: center; justify-content: space-between; gap: var(--r1); }
.subcard-title { font-size: 16px; }

.row-2, .row-zip { display: grid; gap: 14px; grid-template-columns: 1fr; }

.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 14px; color: var(--text); }
.field-help { font-size: 13px; color: var(--muted); }
.field-hint:empty, .field-error:empty { display: none; }
.field-hint { font-size: 13px; color: var(--warn); background: var(--warn-tint); border-radius: var(--rund-klein); padding: 6px 10px; }
.field-error { font-size: 13.5px; color: var(--fehler); font-weight: 600; }
.field-error::before { content: "! "; content: "! " / ""; }
.inline-row { display: flex; gap: var(--r1); align-items: center; }
.inline-row select { flex: 1; min-width: 0; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--karte); border: 1px solid var(--line-stark); border-radius: var(--rund-klein);
  transition: border-color var(--zeit) var(--kurve), box-shadow var(--zeit) var(--kurve);
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { border-color: var(--accent); border-radius: var(--rund-klein); }
input[readonly] { background: var(--flaeche); color: var(--text-2); }
[aria-invalid="true"] { border-color: var(--fehler); background-color: var(--fehler-tint); }

.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
/* Eigene Häkchen: native Kästchen wirken im Dark Mode hellgrau und fremd. */
.check-box {
  -webkit-appearance: none; appearance: none; display: inline-grid; place-content: center; flex: none;
  width: 22px; height: 22px; margin: 1px 0 0; border: 2px solid var(--rand-kontrolle); border-radius: 6px;
  background: var(--karte); cursor: pointer; transition: background var(--zeit) var(--kurve), border-color var(--zeit) var(--kurve);
}
.check-box::before {
  content: ""; width: 11px; height: 6px; margin-top: -3px; border: solid var(--auf-akzent); border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg) scale(0); transition: transform var(--zeit) var(--kurve);
}
.check-box:hover { border-color: var(--accent); }
.check-box:checked { background: var(--accent); border-color: var(--accent); }
.check-box:checked::before { transform: rotate(-45deg) scale(1); }
.check-box:focus-visible { outline: none; box-shadow: var(--fokus); }
.check-box[aria-invalid="true"] { border-color: var(--fehler); background-color: var(--fehler-tint); }
@media (forced-colors: active) {
  .check-box { -webkit-appearance: auto; appearance: auto; }
  .check-box::before { content: none; }
}
.check label { font-weight: 600; }

details.rules { border: 1px solid var(--line); border-radius: var(--rund-klein); padding: 10px 12px; background: var(--accent-tint-2); }
details.rules summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.rules .prose { margin-top: var(--r1); }

.review-list { margin: 0; display: grid; gap: 12px; }
.review-row dt { font-weight: 600; }
.review-row dd { margin: 2px 0 0; display: grid; color: var(--text-2); font-variant-numeric: tabular-nums; }

.wizard-actions {
  display: flex; flex-wrap: wrap-reverse; gap: 12px; justify-content: space-between; align-items: center;
  padding-top: var(--r1);
}
.wizard-actions .btn { flex: 1 1 160px; }

.save-state { margin-top: var(--r2); font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.save-state .icon { width: 16px; height: 16px; flex: none; }
.save-saved .icon { color: var(--erfolg); }
.save-error, .save-tooLarge { color: var(--warn); }

/* Erfolg nach dem Absenden (≤ 240 ms, reduced-motion: sofort) */
.view-success { max-width: 760px; }
.card-success { display: grid; gap: var(--r2); justify-items: start; }
.success-mark {
  display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 999px;
  background: var(--erfolg-tint); color: var(--erfolg); animation: success-pop 240ms var(--kurve) both;
}
.success-mark .icon { width: 32px; height: 32px; stroke-width: 2.5; }
@keyframes success-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }

.msg { border-radius: var(--rund); padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-tint-2); }
.msg p + p { margin-top: 6px; }
.msg-title { font-weight: 600; margin-bottom: 4px; }
.msg-info { border-left-color: var(--info); background: var(--info-tint); color: var(--text-2); }
.msg-error { border-left-color: var(--fehler); background: var(--fehler-tint); color: var(--text); margin-bottom: var(--r2); outline: none; }
.msg-error ul { margin: 6px 0 0; padding-left: 18px; }
.msg-error a { color: var(--fehler); font-weight: 600; }

/* ---------- Rechtsseiten ---------- */

.legal { max-width: 760px; }
.legal h1 { margin-bottom: 4px; }
.legal .link-back { display: inline-block; margin-bottom: var(--r2); }
.legal-card { margin-top: var(--r3); display: grid; gap: var(--r3); }
.legal-section h2 { margin-bottom: var(--r1); }
.legal-section p, .legal-section li, .legal-section address { color: var(--text-2); }
.legal-section p + p, .legal-section ul + p, .legal-section p + ul { margin-top: var(--r1); }
.legal-section ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal-section address { font-style: normal; margin-bottom: var(--r1); }

/* ---------- Fuß: kompakte, zentrierte Kachel ganz unten (über der Unterleiste) ---------- */

.footer { padding: 0 var(--gutter) var(--r3); }
.footer-card {
  display: grid; justify-items: center; max-width: 440px; margin: 0 auto; padding: 10px var(--r2) 4px;
  background: var(--karte); border: 1px solid var(--line); border-radius: var(--rund-gross); text-align: center;
}
.footer-operator { font-size: 12.5px; color: var(--muted); text-wrap: balance; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--r2); font-size: 13.5px; }
.footer-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; text-decoration: none; font-weight: 600; }
.footer-links a:hover, .footer-links a[aria-current="page"] { text-decoration: underline; }

/* ---------- Einblendung (einmalig) ---------- */

.view > *, .state-message, .legal-card { animation: rise var(--zeit-lang) var(--kurve) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Stagger: Verzögerung + Dauer je Element ≤ 240 ms */
.grid > * { animation: rise var(--zeit-lang) var(--kurve) both; }
.grid > *:nth-child(2) { animation-delay: 15ms; }
.grid > *:nth-child(3) { animation-delay: 30ms; }
.grid > *:nth-child(n+4) { animation-delay: 40ms; }
.essentials > .tile { animation: rise var(--zeit) var(--kurve) both; }
.essentials > .tile:nth-child(3) { animation-delay: 20ms; }
.essentials > .tile:nth-child(4) { animation-delay: 40ms; }
.essentials > .tile:nth-child(n+5) { animation-delay: 60ms; }
/* Neu gerenderte Kacheln nach einem Zugangs-Refresh blenden nicht erneut ein (nur die Schloss-Enthüllung). */
.is-update, .is-update .tile { animation: none; }

/* ---------- Breiter ---------- */

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  h1 { font-size: 32px; }
  .row-2 { grid-template-columns: 1fr 1fr; }
  .row-zip { grid-template-columns: 140px 1fr; }
  .subcard { padding: 22px 24px 24px; }
  .card { padding: 24px; }
  .step-num { display: inline; }
  .step-icon { flex: none; }
  .step-num::after { content: ". "; content: ". " / ""; }
  .step-btn { flex-direction: row; flex-wrap: wrap; column-gap: 4px; }
  .step-btn::before { flex: 1 0 100%; }
  .wizard-actions .btn { flex: 0 0 auto; }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > .card-cta, .grid > .card-accent { grid-column: 1 / -1; }
  .essentials { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--r2); }
  .essentials > .tile, .essentials > .tile-m2 { grid-column: span 1; }
  .essentials > .tile-d2 { grid-column: span 2; }
  .essentials > .tile-d3 { grid-column: span 3; }
  .tile { padding: 20px; }
  /* Breite Kacheln nutzen die Breite: Adresse links, Knöpfe rechts. */
  .tile-address.tile-d2 > .tile-body, .tile-address.tile-d3 > .tile-body {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--r1) var(--r3);
  }
}

/* ---------- Icons, Kopieren, Toast, Akkordeon (v2, Task 3.1) ---------- */

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -0.2em; fill: none; stroke: currentColor; }

.btn-copy {
  display: inline-flex; align-items: center; gap: var(--r1);
  min-height: 44px; min-width: 44px; padding: 0 12px;
  border: 1px solid var(--line-stark); border-radius: var(--rund-klein);
  background: var(--karte); color: var(--accent); font: inherit; cursor: pointer;
  transition: background var(--zeit) var(--kurve), border-color var(--zeit) var(--kurve), color var(--zeit) var(--kurve);
}
.btn-copy:hover { background: var(--accent-tint-2); border-color: var(--accent); }
.btn-copy:focus-visible { outline: none; box-shadow: var(--fokus); }
.btn-copy .icon { transition: transform var(--zeit) var(--kurve); }
.btn-copy.is-copied { color: var(--erfolg); border-color: var(--erfolg); background: var(--erfolg-tint); }
.btn-copy.is-copied .icon { transform: scale(1.12); }
.copy-buffer { position: fixed; top: 0; left: -9999px; opacity: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--r3) + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: calc(100% - 2 * var(--gutter)); padding: 10px 16px;
  border-radius: var(--rund); background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--schatten-hoch);
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  transition: opacity var(--zeit) var(--kurve), transform var(--zeit) var(--kurve);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.accordion { border-top: 1px solid var(--line); }
.accordion-summary {
  display: flex; align-items: center; gap: var(--r1); min-height: 44px; padding: 10px 0;
  cursor: pointer; list-style: none; font-weight: 600;
}
.accordion-summary::-webkit-details-marker { display: none; }
.accordion-summary:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: var(--rund-klein); }
.accordion-title { flex: 1 1 auto; }
.accordion-chevron { transition: transform var(--zeit) var(--kurve); }
.accordion[open] .accordion-chevron { transform: rotate(180deg); }
.accordion-body { overflow: hidden; padding-bottom: var(--r2); }

/* ---------- Inhaltsabschnitte, Galerie, Lightbox (v2, Task 3.3) ---------- */

[hidden] { display: none !important; }

.sections { display: grid; gap: var(--r2); margin-top: var(--r2); }
.section { display: grid; gap: 12px; align-content: start; min-width: 0; scroll-margin-top: var(--r2); }
.section-title { display: flex; align-items: center; gap: var(--r1); margin: 0; }
.section-icon { width: 22px; height: 22px; color: var(--accent); }
.sub-title { margin: 0 0 var(--r1); font-size: 15px; font-weight: 700; color: var(--text); }
.apartment-name { margin: 0; font-size: 18px; }
.info-list { display: grid; gap: 12px; margin: 0; }
.info-row dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.info-row dd { margin: 2px 0 0; color: var(--text); overflow-wrap: anywhere; }
.step-list, .bullets { display: grid; gap: 6px; margin: 0; padding-left: 1.25em; color: var(--text-2); }
.steps-block .note { margin-top: var(--r1); }


.gallery { min-width: 0; }
.gallery-frame { position: relative; }
.gallery-nav { display: none; }
.gallery-track {
  display: flex; gap: 10px; margin: 0; padding: 0 0 4px; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin;
}
.gallery-slide { flex: 0 0 86%; min-width: 0; scroll-snap-align: start; }
.gallery-item {
  display: grid; gap: 6px; width: 100%; padding: 0; border: 0; border-radius: var(--rund);
  background: none; color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: zoom-in;
}
.gallery-item img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--rund); background: var(--accent-tint); }
.gallery-item:focus-visible { outline: none; box-shadow: var(--fokus); }
.gallery-hint { margin-top: 6px; }

.lightbox { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 14, 12, 0.95); color: #fff; }
.lightbox[open] {
  position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  animation: fade var(--zeit) var(--kurve) both;
}
.lightbox::backdrop { background: rgba(10, 14, 12, 0.95); }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; padding: var(--r1) var(--gutter); }
.lightbox-counter { font-size: 14px; font-variant-numeric: tabular-nums; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 var(--r1); touch-action: pan-y; }
.lightbox-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox-foot { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: var(--r1); padding: var(--r1) var(--gutter) var(--r2); }
.lightbox-caption { grid-column: 2; margin: 0; font-size: 14px; text-align: center; color: rgba(255, 255, 255, 0.85); }
.lightbox-prev { grid-column: 1; }
.lightbox-next { grid-column: 3; }
.lightbox-nav, .lightbox-close {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer;
}
.lightbox-nav:focus-visible, .lightbox-close:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff; }
body:has(.lightbox[open]) { overflow: hidden; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.facts { display: flex; flex-wrap: wrap; gap: var(--r1); margin: 0; padding: 0; list-style: none; }
.fact { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent-tint); color: var(--text); font-size: 14px; font-weight: 600; }
.fact .icon, .amenity .icon, .amenity-group-title .icon { color: var(--accent); }

.amenity-groups { display: grid; gap: var(--r2); }
.amenity-group-title {
  display: flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.amenity-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.amenity { display: flex; align-items: center; gap: var(--r1); color: var(--text-2); }
.btn-more { margin-top: 12px; }

.accordion-group > .accordion:last-child { border-bottom: 1px solid var(--line); }
.check-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.check-item { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; color: var(--text); cursor: pointer; }
.check-box:checked + span { color: var(--muted); text-decoration: line-through; }
.faq-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--r1); }
.faq-contact-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
  font-weight: 600; white-space: nowrap; text-decoration: none;
}
.faq-contact-link:hover { text-decoration: underline; }
.note-inline { display: flex; align-items: flex-start; gap: 6px; color: var(--text-2); }
.note-inline .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.home-card { margin-top: var(--r3); }
/* Rechnung kompakt nach den Kacheln (vor dem Aufenthaltsende), mit Icon */
.invoice-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px var(--r2); padding: var(--r2); }
.invoice-card > .card-title { margin: 0; font-size: 16px; }
.invoice-card > .prose { grid-column: 1; font-size: 14px; }
.invoice-card > .actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.invoice-card .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
@media (max-width: 479px) {
  .invoice-card { grid-template-columns: 1fr; }
  .invoice-card > .actions { grid-column: 1; grid-row: auto; margin-top: 6px; }
}
.essentials > .tile-checkin { margin: 0; }
/* Gastwünsche (Lane REQUESTS): Slot nach den Kacheln. Leer ein Block ohne Höhe (kein display:none – sonst sähe
   GP.lazy.mount/IntersectionObserver ihn nie); Abstand erst mit Inhalt. */
.home-top > .requests-slot:not(:empty) { margin-top: var(--r2); }
.invoice-block { padding-top: var(--r2); border-top: 1px solid var(--line); }

@media (min-width: 640px) {
  .gallery-slide { flex-basis: 62%; }
  .amenity-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Desktop (ab 1024 px): Lesebreite, Abschnitte zweispaltig, Galerie als Reihe ---------- */

.split, .split-main, .split-side { display: grid; gap: var(--r2); align-content: start; min-width: 0; }

.section .prose, .section .bullets, .section .step-list, .section .note, .section .info-row dd, .section .lead { max-width: 72ch; }

@media (min-width: 1024px) {
  h1 { font-size: 34px; }
  .phase-line { font-size: 17px; }
  /* Halbe Karten oben ausgerichtet: aufklappbare Inhalte ändern die Höhe, keine leeren Flächen in Karten. */
  .sections { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--r3); margin-top: var(--r3); }
  .sections > .section { grid-column: 1 / -1; }
  .sections > .section-half { grid-column: span 1; }
  .card.section { padding: 28px; }
  .split.has-side { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--r4); align-items: start; }
  .split-main.is-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--r4); }
  /* Anreise mit Videos: Anfahrt und Videos links, Schritte rechts (wie ohne Videos), DOM-Reihenfolge bleibt. */
  .split-arrival { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: var(--r4); align-items: start; }
  .split-arrival > .steps-block { grid-column: 2; grid-row: 1 / span 2; }
  .split-arrival > .videos { grid-column: 1; grid-row: 2; }
  /* „Ihre Buchung“ über die volle Breite (nach dem Aufenthalt): Angaben nebeneinander statt gestapelt. */
  .sections > .section-booking:not(.section-half) .info-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: var(--r3); }
  .sections > .section-booking:not(.section-half) .info-row:first-child { grid-column: span 2; }
  .section-apartment .split { margin-top: var(--r1); }
  .gallery-slide { flex-basis: calc((100% - 20px) / 3); }
  /* Karte „Nächster Schritt“ / Rechnung: Text links, Knopf rechts statt halb leerer Breite. */
  .home-rest > .card-cta, .home-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--r4); align-items: center; }
  .home-rest > .card-cta > :not(.actions), .home-card > :not(.actions) { grid-column: 1; }
  .home-rest > .card-cta > .actions, .home-card > .actions { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
}
/* Maus/Trackpad: Pfeile über der Galerie (Wischen gibt es dort nicht). */
@media (min-width: 640px) and (hover: hover) and (pointer: fine) {
  .gallery-nav {
    position: absolute; top: calc(50% - 26px); z-index: 2; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-stark);
    background: var(--karte); color: var(--text); box-shadow: var(--schatten-hoch); cursor: pointer;
    transition: opacity var(--zeit) var(--kurve), transform var(--zeit) var(--kurve);
  }
  .gallery-prev { left: 10px; }
  .gallery-next { right: 10px; }
  .gallery-nav:hover:not([disabled]) { transform: scale(1.06); }
  .gallery-nav[disabled] { opacity: 0; pointer-events: none; }
}

/* ---------- Offline-Banner (v2, Task 3.5) ---------- */

.offline-banner {
  display: flex; align-items: center; justify-content: center; gap: var(--r1);
  padding: 10px max(var(--gutter), env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line);
  background: var(--offline-bg); color: var(--offline-text); font-size: 14px; font-weight: 600; text-align: center;
  animation: fade var(--zeit) var(--kurve) both;
}
.offline-banner .icon { flex: none; }

/* ---------- Bewegung reduzieren: alles sofort (Endzustand bleibt) ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Lane LOWER (27.10.2026): Unterseiten #/anreise und #/apartment, kleine
   Einstiegskachel „So kommen Sie hin“, Apartment-Übersicht, Chips in „Gut zu
   wissen“, Videoplayer. Signatur: Linienplan – die Anreisewege als Haltestellen
   an einer Linie in Akzentfarbe (zu Fuß gepunktet), die Einstiegskachel zeigt
   dieselben Haltestellen im Kleinen.
   ========================================================================== */
/* Unterseite: übriger Inhalt der Aufenthaltsansicht ausgeblendet (bleibt im DOM), Unterleiste bleibt. */
.view-stay.is-subpage > :not(.subpage):not(.bottom-bar) { display: none; }
.subpage { display: grid; gap: var(--r2); align-content: start; min-width: 0; max-width: 820px; }
.subpage-bar { display: flex; margin-left: -8px; }
.subpage-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px 0 8px;
  border: 0; border-radius: 999px; background: transparent; color: var(--accent);
  font: inherit; font-weight: 600; cursor: pointer;
}
.subpage-back:hover { background: var(--accent-tint); color: var(--accent-dunkel); }
.subpage-back:focus-visible { outline: none; box-shadow: var(--fokus); }
.subpage-title { margin-top: -4px; }
.subpage-body { display: grid; gap: var(--r3); min-width: 0; }
.subpage-body > .sub-name + .lead { margin-top: calc(-1 * var(--r2)); }
/* Linienplan */
/* Einstiegskachel „So kommen Sie hin“: eine Zeile, Haltestellen im Kleinen */
.card.section.is-entry { padding: 0; gap: 0; }
.entry-link {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px;
  border-radius: var(--rund-gross); color: var(--text); text-decoration: none;
}
.entry-link:hover { background: var(--accent-tint-2); color: var(--text); }
.entry-link:focus-visible { outline: none; box-shadow: var(--fokus); }
.entry-stops { position: relative; display: flex; flex: none; gap: 6px; }
.entry-stops::before { content: ""; position: absolute; left: 12px; right: 12px; top: calc(50% - 1px); height: 2px; background: var(--accent); }
.entry-stop {
  position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--karte); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent);
}
.entry-stop:first-child { background: var(--accent); color: var(--auf-akzent); }
.entry-stop .icon { width: 15px; height: 15px; }
.entry-text { display: grid; gap: 1px; flex: 1 1 auto; min-width: 0; }
.entry-title { font-size: 16px; font-weight: 650; }
.entry-sub { font-size: 13.5px; color: var(--muted); text-wrap: pretty; }
.entry-chevron { flex: none; color: var(--accent); transition: transform var(--zeit) var(--kurve); }
.entry-link:hover .entry-chevron { transform: translateX(3px); }
.entry-extra { padding: 0 16px 14px; }
/* Apartment-Übersicht: Titelbild + kleine Fotos, daneben Chips, Highlights, „Alle Details“ */
.apt-overview { display: grid; gap: var(--r2); min-width: 0; }
.apt-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border-radius: var(--rund); text-decoration: none; }
.apt-photos:focus-visible { outline: none; box-shadow: var(--fokus); }
.apt-photo { position: relative; display: block; overflow: hidden; border-radius: var(--rund-klein); background: var(--sk); aspect-ratio: 16 / 10; }
.apt-photo.is-main { grid-column: 1 / -1; aspect-ratio: 16 / 9; border-radius: var(--rund); }
.apt-photos:not(.has-thumbs) .apt-photo.is-main { aspect-ratio: 16 / 9; }
.apt-photos.t1 { grid-template-columns: minmax(0, 1fr); }
.apt-photos.t1 .apt-photo:not(.is-main) { aspect-ratio: 16 / 7; }
.apt-photos.t2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.apt-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--zeit-lang) var(--kurve); }
.apt-photos:hover img { transform: scale(1.02); }
.apt-more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--accent); opacity: 0.86; color: var(--auf-akzent); font-size: 17px; font-weight: 650;
}
.apt-info { display: grid; gap: 12px; align-content: start; min-width: 0; }
.apt-actions { margin-top: 4px; }
/* „Gut zu wissen“: Aufzug, Etage, Parken-Verweis als Chips ganz oben */
.gtk-quick { margin-bottom: 4px; }
.fact.is-off { background: var(--warn-tint); color: var(--warn); }
.fact.is-off .icon { color: var(--warn); }
.fact-parking { padding: 0; background: transparent; }
.fact-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px 6px 12px;
  border-radius: 999px; background: var(--accent-tint); color: var(--text); text-decoration: none;
}
.fact-link:hover { background: var(--accent-tint-2); box-shadow: inset 0 0 0 1px var(--accent); color: var(--text); }
.fact-link:focus-visible { outline: none; box-shadow: var(--fokus); }
.fact-chevron { width: 16px; height: 16px; }
@media (min-width: 640px) {
  .apt-overview.has-photos { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--r3); align-items: start; }
  .entry-link { padding: 14px 20px; }
  .entry-extra { padding: 0 20px 16px; }
}
@media (min-width: 1024px) {
  .card.section.is-entry { padding: 0; }
  .subpage-title { font-size: 34px; }
}
/* Videoplayer (immer dunkel wie die Lightbox) */
