/* ==========================================================================
   Hoamatchronik · "Spatial Alpine Glass"
   Eigenständiges Design-System ohne Build-Step. Das Layout hängt bewusst an
   keinem zur Laufzeit erzeugten Stylesheet, damit die Kartencontainer beim
   Start von MapLibre bereits ihre endgültige Größe haben.
   ========================================================================== */

:root {
  /* Farben */
  --bg: #05080f;
  --glass: rgba(10, 15, 28, 0.72);
  --glass-solid: rgba(10, 15, 28, 0.9);
  --ink: #f3f6fb;
  --ink-2: #b4c0d4;
  --ink-3: #7b89a2;
  --line: rgba(255, 255, 255, 0.09);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --sky: #7dd3fc;

  /* Akzent: Farbton wandert mit dem Sonnenbogen (Mittag kühl-gold, Dämmerung orange) */
  --accent-h: 44;
  --accent: hsl(var(--accent-h) 96% 62%);
  --accent-ink: hsl(var(--accent-h) 100% 78%);
  --accent-soft: hsl(var(--accent-h) 96% 62% / 0.16);
  --accent-glow: hsl(var(--accent-h) 96% 62% / 0.55);

  /* Form & Bewegung */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Laufzeit-Variablen (werden von app.js gesetzt) */
  --curtain-x: 50%;
  --lens-x: 50vw;
  --lens-y: 40vh;
  --lens-r: 140px;
  --sheet-vis: 112px;
  --sheet-full: 78vh;
  --sheet-body-h: 0px;
  --spec-angle: 145deg;
  --wash-o: 0;
  --wash-x: 50%;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --topbar-h: 112px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
}

h2,
p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lucide,
i[data-lucide] {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
  pointer-events: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ---------- Karten ---------- */
.map-layer {
  position: fixed;
  inset: 0;
}

#map-main {
  z-index: 0;
}

#map-historic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#map-historic-container {
  z-index: 1;
  pointer-events: none;
  will-change: clip-path;
  transition: opacity 0.3s ease;
}
#map-historic-container[data-mode="curtain"] {
  clip-path: inset(0 calc(100% - var(--curtain-x)) 0 0);
}
#map-historic-container[data-mode="lens"] {
  clip-path: circle(var(--lens-r) at var(--lens-x) var(--lens-y));
}
#map-historic-container[data-mode="off"] {
  opacity: 0;
  visibility: hidden;
}
/* Das Bild der gewählten Epoche lädt noch: das bisherige bleibt gedämpft stehen */
#map-historic-container canvas {
  transition: filter 0.35s var(--ease-out);
}
#map-historic-container.is-buffering canvas {
  filter: saturate(0.55) brightness(0.72);
}
#map-historic-container.epoch-flip {
  animation: epoch-flip 0.5s var(--ease-out);
}
@keyframes epoch-flip {
  from {
    opacity: 0.35;
    filter: brightness(1.5);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

#light-wash {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--wash-o);
  mix-blend-mode: soft-light;
  background: radial-gradient(130% 95% at var(--wash-x) 0%, hsl(26 100% 60%), hsl(16 90% 45% / 0.5) 45%, transparent 75%);
}

/* Nur für Screenreader und Crawler: sachlicher Text zur Karte (index.html, #about) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Quellenangabe: immer sichtbar, über beiden Karten */
.map-credit {
  position: fixed;
  z-index: 4;
  left: 10px;
  top: calc(var(--safe-t) + var(--topbar-h) + 10px);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(10, 15, 28, 0.6);
  color: var(--ink-2);
  max-width: calc(100vw - 20px);
  font-size: 10px;
  line-height: 1.5;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@media (max-width: 600px) {
  /* rechts steht die Werkzeugleiste: Zeile umbrechen statt darunter verschwinden */
  .map-credit { border-radius: 12px; max-width: calc(100vw - 92px); }
}
.map-credit a {
  color: inherit;
}
/* Breite Fenster: Zeile als dezenter Fußtext in die freie untere linke Ecke, neben Dial und Dossier
   (die sind max. 720px breit und mittig), statt unter der Topbar über der Karte. */
@media (min-width: 1100px) {
  .map-credit {
    top: auto;
    left: 12px;
    bottom: calc(var(--safe-b) + 10px);
    max-width: calc((100vw - 720px) / 2 - 28px);
    border-radius: 12px;
    padding: 5px 10px;
    background: rgba(10, 15, 28, 0.5);
    opacity: 0.8;
    transition: opacity 0.2s ease;
  }
  .map-credit:hover,
  .map-credit:focus-within {
    opacity: 1;
  }
}

/* Standort-Marker */
.pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #0b1020;
  box-shadow: 0 0 0 2px var(--accent), 0 0 18px 4px var(--accent-glow);
}
.pin::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pin-pulse 2.4s var(--ease-out) infinite;
}
@keyframes pin-pulse {
  from {
    transform: scale(0.8);
    opacity: 0.9;
  }
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

/* ---------- Glas ---------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 18px 48px -14px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
/* 1px-Specular-Border: Verlauf dreht sich mit dem Sonnenstand (--spec-angle) */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    var(--spec-angle),
    rgba(255, 255, 255, 0.42),
    rgba(255, 255, 255, 0.07) 32%,
    rgba(255, 255, 255, 0.03) 62%,
    hsl(var(--accent-h) 96% 70% / 0.28)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Immersion: bei Kartenbewegung / Vorhang- oder Linsen-Drag tritt das UI zurück */
.ui-fade {
  transition: opacity 0.32s ease, scale 0.5s var(--ease-spring);
}
body.is-immersed .ui-fade {
  opacity: 0.25;
  scale: 0.98;
}

/* ---------- Topbar / Omnibox ---------- */
.topbar {
  position: fixed;
  z-index: 12;
  top: calc(var(--safe-t) + 10px);
  left: 50%;
  translate: -50% 0;
  width: min(calc(100% - 20px), 640px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  transform-origin: 50% 0;
}
.topbar > * {
  pointer-events: auto;
}

.omnibox {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 6px 0 14px;
  border-radius: var(--r-lg);
}
.omnibox:focus-within {
  box-shadow: 0 18px 48px -14px rgba(0, 0, 0, 0.7), 0 0 0 1.5px var(--accent), 0 0 32px -6px var(--accent-glow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}
.brand-mark {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #0a0f1c;
  box-shadow: 0 0 0 1px var(--line), 0 0 12px -2px var(--accent-glow);
}
/* Wortmarke: „Hoamat“ kräftig, „chronik“ leichter im Akzent */
.brand-text {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
}
.brand-text-2 {
  font-weight: 500;
  color: var(--accent-ink);
}
.omnibox-icon {
  color: var(--ink-3);
}
#address-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  user-select: text;
  -webkit-user-select: text;
}
#address-input::placeholder {
  color: var(--ink-3);
}
.kbd {
  flex: none;
  padding: 3px 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-3);
  font: 600 11px/1.2 ui-sans-serif, system-ui, sans-serif;
}
.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
.icon-btn.is-busy {
  color: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

.omni-menu {
  /* schwebt über den Pills, statt sie nach unten zu schieben */
  position: absolute;
  z-index: 2;
  top: 60px;
  left: 0;
  right: 0;
  max-height: min(56vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--r-lg);
  padding: 6px;
  background: var(--glass-solid);
  animation: menu-in 0.28s var(--ease-spring);
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}
.omni-heading {
  padding: 8px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.omni-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.omni-option .lucide,
.omni-option i[data-lucide] {
  color: var(--accent-ink);
}
.omni-option[aria-selected="true"],
.omni-option:hover {
  background: rgba(255, 255, 255, 0.08);
}
.omni-option[aria-selected="true"] {
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.omni-text {
  flex: 1;
  min-width: 0;
}
.omni-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.omni-hint {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.omni-type {
  flex: none;
  max-width: 38%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.omni-empty {
  padding: 14px 12px;
  color: var(--ink-2);
  font-size: 13px;
}
.omni-foot {
  display: flex;
  gap: 14px;
  padding: 8px 10px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
}

.pill-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  scroll-snap-type: x proximity;
}
.preset-pill {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  scroll-snap-align: start;
  transition: color 0.2s, translate 0.3s var(--ease-spring);
}
.preset-pill::after {
  /* Touch-Target auf 44px erweitern */
  content: "";
  position: absolute;
  inset: -2px 0;
}
.preset-pill .lucide,
.preset-pill i[data-lucide] {
  width: 15px;
  height: 15px;
  color: var(--accent-ink);
}
.preset-pill:hover {
  translate: 0 -1px;
}
.preset-pill.is-active {
  color: var(--accent-ink);
  box-shadow: 0 0 0 1.5px var(--accent), 0 8px 24px -8px var(--accent-glow);
}

/* ---------- Werkzeug-Rail ---------- */
.rail {
  position: fixed;
  z-index: 10;
  top: calc(var(--safe-t) + var(--topbar-h) + 10px);
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform-origin: 100% 0;
}
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 0.2s, translate 0.3s var(--ease-spring), box-shadow 0.3s;
}
.rail-btn:hover {
  color: var(--ink);
  translate: -1px 0;
}
.rail-btn:active {
  scale: 0.95;
}
.rail-btn[aria-pressed="true"],
.rail-btn[aria-expanded="true"] {
  color: var(--accent-ink);
  box-shadow: 0 0 0 1.5px var(--accent), 0 10px 28px -10px var(--accent-glow);
}

/* Kompass: die Rose dreht sich gegen die Kartendrehung, Norden bleibt oben markiert */
.compass-rose {
  width: 22px;
  height: 22px;
  rotate: calc(var(--bearing, 0) * -1deg);
}
#btn-compass[data-north="true"] { color: var(--ink-3, var(--ink-2)); }

/* ---------- Vorhang ---------- */
#curtain-divider {
  position: fixed;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: var(--curtain-x);
  width: 16px;
  margin-left: -8px;
  cursor: ew-resize;
  touch-action: none;
}
#curtain-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--accent) 14%, var(--accent) 86%, transparent);
  box-shadow: 0 0 18px 1px var(--accent-glow);
}
.curtain-handle {
  position: absolute;
  left: 50%;
  top: calc((100% - var(--sheet-vis)) * 0.5 + var(--safe-t) * 0.5 + 24px);
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-solid);
  color: var(--accent-ink);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 30px -6px rgba(0, 0, 0, 0.8), 0 0 26px -2px var(--accent-glow);
  transition: top 0.5s var(--ease-spring), scale 0.3s var(--ease-spring), box-shadow 0.3s;
}
#curtain-divider.is-dragging .curtain-handle {
  scale: 1.12;
}
#curtain-divider.is-snapped .curtain-handle {
  box-shadow: 0 0 0 3px #fff, 0 10px 30px -6px rgba(0, 0, 0, 0.8), 0 0 36px 2px var(--accent-glow);
}
.epoch-badge {
  position: absolute;
  top: calc((100% - var(--sheet-vis)) * 0.5 + var(--safe-t) * 0.5 + 24px);
  translate: 0 -50%;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--glass-solid);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  transition: top 0.5s var(--ease-spring), opacity 0.25s;
}
.epoch-badge--left {
  right: calc(50% + 34px);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px hsl(var(--accent-h) 96% 62% / 0.45);
}
/* Ladeanzeige am Etikett der historischen Seite */
.epoch-badge.is-loading::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  vertical-align: -1px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.epoch-badge--right {
  left: calc(50% + 34px);
  color: #a7f3d0;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.45);
}

/* ---------- Zeit-Lupe ---------- */
#time-lens {
  position: fixed;
  z-index: 5;
  left: 0;
  top: 0;
  width: calc(var(--lens-r) * 2);
  height: calc(var(--lens-r) * 2);
  transform: translate3d(calc(var(--lens-x) - var(--lens-r)), calc(var(--lens-y) - var(--lens-r)), 0);
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  background: radial-gradient(120% 120% at 26% 16%, rgba(255, 255, 255, 0.16), transparent 42%);
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 34px 3px var(--accent-glow), 0 24px 60px -10px rgba(0, 0, 0, 0.75),
    inset 0 0 0 7px rgba(255, 255, 255, 0.045), inset 0 0 40px rgba(0, 0, 0, 0.5);
  animation: lens-in 0.5s var(--ease-spring);
}
@keyframes lens-in {
  from {
    opacity: 0;
    scale: 0.7;
  }
}
/* Skalenkranz wie an einem Objektivring */
#time-lens::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg, hsl(var(--accent-h) 96% 72% / 0.8) 0 0.8deg, transparent 0.8deg 7.5deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
}
#time-lens.is-dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 2px #fff, 0 0 46px 6px var(--accent-glow), 0 30px 70px -10px rgba(0, 0, 0, 0.8),
    inset 0 0 0 7px rgba(255, 255, 255, 0.06), inset 0 0 40px rgba(0, 0, 0, 0.45);
}
.lens-label {
  position: absolute;
  left: 50%;
  top: -10px;
  translate: -50% -100%;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--glass-solid);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px hsl(var(--accent-h) 96% 62% / 0.45);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}
.lens-grip {
  position: absolute;
  left: 50%;
  bottom: -14px;
  translate: -50% 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--glass-solid);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1.5px var(--accent);
  pointer-events: none;
}
.lens-grip .lucide,
.lens-grip i[data-lucide] {
  width: 14px;
  height: 14px;
}

/* ---------- Sonnenbogen ---------- */
.sun-panel {
  position: fixed;
  z-index: 13;
  top: calc(var(--safe-t) + var(--topbar-h) + 10px);
  right: 72px;
  width: min(280px, calc(100vw - 92px));
  padding: 14px 14px 12px;
  border-radius: var(--r-lg);
  transform-origin: 100% 0;
  animation: menu-in 0.32s var(--ease-spring);
}
.sun-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow .lucide,
.eyebrow i[data-lucide] {
  width: 15px;
  height: 15px;
}
.sun-time {
  padding: 3px 9px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 700 15px/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
#sun-arc {
  display: block;
  width: 100%;
  margin-top: 6px;
  overflow: visible;
  cursor: grab;
  touch-action: none;
  border-radius: 12px;
}
.sun-horizon {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.sun-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 3;
  stroke-linecap: round;
}
.sun-progress {
  fill: none;
  stroke: url(#sun-arc-grad);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px hsl(var(--accent-h) 96% 62% / 0.8));
}
.sun-tick {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 1;
}
.sun-core {
  fill: #fffbe8;
  stroke: var(--accent);
  stroke-width: 2;
}
.sun-axis {
  fill: var(--ink-3);
  font-size: 9px;
  font-weight: 600;
}
.sun-mood {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-2);
}

/* ---------- Chrono-Dial ---------- */
.chrono {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  width: min(calc(100% - 20px), 560px);
  transform: translate3d(0, calc(-1 * var(--sheet-vis) - 10px), 0);
  transform-origin: 50% 100%;
  transition: transform 0.5s var(--ease-spring), opacity 0.32s ease, scale 0.5s var(--ease-spring);
}
body.sheet-dragging .chrono {
  transition: opacity 0.32s ease;
}
body[data-sheet="full"] .chrono {
  opacity: 0;
  pointer-events: none;
}
.chrono-capsule {
  padding: 10px;
  border-radius: 26px;
}
.chrono-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 8px 6px;
}
.chrono-text {
  min-width: 0;
}
.chrono-title {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chrono-desc {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chrono-desc.is-warning {
  color: var(--warn);
}

.segmented {
  flex: none;
  display: flex;
  padding: 3px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--line);
}
.segmented button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 11px;
  border-radius: 11px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.25s, color 0.25s;
}
.segmented button[aria-checked="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px hsl(var(--accent-h) 96% 62% / 0.55);
}
.segmented .lucide,
.segmented i[data-lucide] {
  width: 16px;
  height: 16px;
}

.chrono-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.play-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(160deg, hsl(var(--accent-h) 100% 72%), hsl(var(--accent-h) 96% 54%));
  color: #0b1020;
  box-shadow: 0 10px 26px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: scale 0.25s var(--ease-spring);
}
.play-btn:active {
  scale: 0.93;
}
.play-btn .lucide,
.play-btn i[data-lucide] {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.play-btn .icon-pause,
.play-btn[aria-pressed="true"] .icon-play {
  display: none;
}
.play-btn[aria-pressed="true"] .icon-pause {
  display: inline-block;
}
.play-btn[aria-pressed="true"] {
  animation: play-glow 2.6s ease-in-out infinite;
}
.play-btn.is-loading {
  position: relative;
  animation: play-glow 1s ease-in-out infinite;
}
.play-btn.is-loading::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: spin 0.8s linear infinite;
  pointer-events: none;
}
@keyframes play-glow {
  50% {
    box-shadow: 0 0 0 6px var(--accent-soft), 0 10px 30px -6px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dial {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 56px;
  border-radius: 18px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  /* Zylinder-Anmutung: oben Lichtkante, unten Schatten, Ränder laufen weg */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 42%, rgba(0, 0, 0, 0.32));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -10px 16px -10px rgba(0, 0, 0, 0.7),
    inset 14px 0 14px -12px rgba(0, 0, 0, 0.7), inset -14px 0 14px -12px rgba(0, 0, 0, 0.7);
}
.dial.is-dragging {
  cursor: grabbing;
}
.dial-ticks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 7px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.34) 0 1px, transparent 1px 2.5%);
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
/* Breite und Lage der Markierung setzt app.js (setDialPos): die Zahl der Stopps hängt vom Ort ab */
.dial-pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: var(--dial-pill-w, 20%);
  border-radius: 13px;
  transform: translate3d(var(--dial-x, 0px), 0, 0);
  transition: transform 0.55s var(--ease-spring), width 0.3s var(--ease-out);
  background: linear-gradient(180deg, hsl(var(--accent-h) 96% 62% / 0.38), hsl(var(--accent-h) 96% 62% / 0.12));
  box-shadow: inset 0 0 0 1.5px hsl(var(--accent-h) 96% 66% / 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 20px -4px var(--accent-glow);
}
.dial.is-dragging .dial-pill {
  transition: none;
}
.dial-stops {
  position: absolute;
  inset: 0 20px; /* Rand wie DIAL_PAD in app.js: Platz für die Beschriftung der Randstopps */
  display: grid;
  grid-template-columns: repeat(var(--dial-count, 4), minmax(0, 1fr));
}
.dial-stop {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  transition: color 0.3s, scale 0.4s var(--ease-spring);
}
/* Mittig über dem Skalenstrich, auch wenn die Jahreszahl breiter ist als ihr Stopp */
.dial-label {
  position: absolute;
  left: 50%;
  top: calc(50% - 4px);
  translate: -50% -50%;
  white-space: nowrap;
  transition: opacity 0.25s;
}
/* Viele Jahrgänge auf engem Raum: nur der Skalenstrich bleibt, die Jahreszahl zeigt der aktive Stopp */
.dial-stop.is-minor .dial-label {
  opacity: 0;
}
.dial-stop.is-minor::after {
  height: 7px;
  background: rgba(255, 255, 255, 0.32);
}
.dial-stop::after {
  /* Haupt-Skalenstrich */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 2px;
  height: 11px;
  margin-left: -1px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.3s;
}
.dial-stop.is-active {
  color: #fff;
  scale: 1.08;
}
.dial-stop.is-active::after {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
/* Epoche, deren Datenquelle gerade keine Kacheln liefert */
.dial-stop.is-offline {
  color: rgba(251, 191, 36, 0.55);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* ---------- Bottom-Sheet ---------- */
.sheet {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: -40px;
  translate: -50% 0;
  width: min(100%, 720px);
  height: calc(var(--sheet-full) + 40px);
  transform: translate3d(0, calc(var(--sheet-full) - var(--sheet-vis)), 0);
  transform-origin: 50% 100%;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: rgba(10, 15, 28, 0.8);
  box-shadow: 0 -18px 50px -10px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.5s var(--ease-spring), opacity 0.32s ease, scale 0.5s var(--ease-spring);
}
.sheet.is-dragging {
  transition: opacity 0.32s ease;
}
.sheet-head {
  padding: 8px 16px 10px;
  cursor: grab;
  touch-action: none;
}
.sheet-head:focus-visible {
  outline-offset: -3px;
  border-radius: var(--r-xl);
}
.sheet-grabber {
  display: block;
  width: 40px;
  height: 5px;
  margin: 0 auto 9px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 0.3s var(--ease-spring), background 0.3s;
}
.sheet.is-dragging .sheet-grabber,
.sheet-head:hover .sheet-grabber {
  width: 56px;
  background: var(--accent);
}
.sheet-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 24px;
}
.tag {
  flex: none;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(52, 211, 153, 0.14);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sheet-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-toggle {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}
#dossier-chevron {
  transition: rotate 0.4s var(--ease-spring);
}
.sheet[data-snap="full"] #dossier-chevron {
  rotate: 180deg;
}

.peek-row {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  overflow: hidden;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip .lucide,
.chip i[data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}
.chip--zoning {
  flex: 0 1 auto;
}
.chip:not(.chip--zoning) {
  flex: none;
}
.live-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}
.chip--zoning[data-state="live"] .live-dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse 2s ease-in-out infinite;
}
.chip--zoning[data-state="fallback"] .live-dot {
  background: var(--warn);
}
.chip--zoning[data-state="error"] .live-dot {
  background: var(--bad);
}
.mini-bar {
  flex: none;
  width: 40px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}
#peek-built-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--bad);
  transition: width 0.8s var(--ease-out);
}

.sheet-body {
  height: var(--sheet-body-h);
  padding: 4px 16px calc(24px + var(--safe-b));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card-head > span:first-of-type {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-head .lucide,
.card-head i[data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--accent-ink);
}
.card-value {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.card-value--xl {
  font-size: 22px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.card-sub--mono {
  font: 500 11px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
}
.card-foot {
  margin-top: auto;
  padding-top: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.card-foot--body {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}
/* Namensnennung neben einem Wert (zum Beispiel Open-Meteo als Ersatzquelle der Höhe) */
.credit-note {
  margin: 4px 0 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.credit-note[hidden] { display: none; }
.credit-note a { color: inherit; }
.omni-credit { color: inherit; margin-left: 6px; }
.code-badge {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
  font: 700 11px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
}
.src-chip,
.demo-chip,
.canopy-chip {
  flex: none;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.src-chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-2);
}
.src-chip[data-state="live"] {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}
.src-chip[data-state="fallback"] {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}
/* Kennzeichnet Werte, die das Backend noch nicht live ermittelt */
.demo-chip {
  background: rgba(125, 211, 252, 0.12);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.3);
  color: var(--sky);
  cursor: help;
}
.demo-chip:not([hidden]) + .canopy-chip {
  margin-left: 0;
}
.canopy-chip {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}
.eyebrow .demo-chip {
  margin-left: 4px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.mini-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.mini-btn .lucide,
.mini-btn i[data-lucide] {
  width: 15px;
  height: 15px;
}
.mini-btn .icon-check,
.mini-btn.is-done .icon-copy {
  display: none;
}
.mini-btn.is-done .icon-check {
  display: inline-block;
}
.mini-btn.is-done {
  color: #6ee7b7;
}

.hazard-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hazard-text {
  min-width: 0;
}
.traffic {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 1px var(--line);
}
.traffic span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.4s, box-shadow 0.4s;
}
.traffic[data-level="high"] span:nth-child(1) {
  background: var(--bad);
  box-shadow: 0 0 10px var(--bad);
}
.traffic[data-level="mid"] span:nth-child(2) {
  background: var(--warn);
  box-shadow: 0 0 10px var(--warn);
}
.traffic[data-level="low"] span:nth-child(3) {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.full-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
/* Flächennutzung im Umkreis: gestapelter Balken mit Legende */
.landuse-bar {
  display: flex;
  height: 20px;
  margin-top: 4px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  transition: opacity 0.3s;
}
.landuse-seg {
  flex: none;
  width: 0;
  box-shadow: inset -1.5px 0 0 #0b1020;
  transition: width 0.9s var(--ease-out);
}
.landuse-bar.is-drawn .landuse-seg {
  width: var(--w);
}
.landuse-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 14px;
  margin: 8px 0 2px;
  padding: 0;
  list-style: none;
  font-size: 12px;
}
.landuse-legend li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.landuse-legend i {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}
.landuse-legend span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.landuse-legend b {
  font-variant-numeric: tabular-nums;
}

/* Archiv-Ticket mit Perforation */
.ticket {
  display: flex;
  min-height: 92px;
  border-radius: var(--r-md);
  color: #1c1608;
  background: linear-gradient(135deg, #fde9b0, #f6c964 70%, #eeb04a);
  box-shadow: 0 12px 30px -14px rgba(251, 191, 36, 0.6);
  -webkit-mask: radial-gradient(circle 9px at calc(100% - 76px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 9px at calc(100% - 76px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle 9px at calc(100% - 76px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 9px at calc(100% - 76px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-main {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
}
.ticket .eyebrow {
  color: #7a5a12;
}
.ticket .demo-chip {
  background: rgba(28, 22, 8, 0.12);
  box-shadow: inset 0 0 0 1px rgba(28, 22, 8, 0.3);
  color: #4a3608;
}
.ticket-id {
  margin-top: 4px;
  font: 800 19px/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.02em;
}
.ticket-id.is-long {
  font-size: 15px;
}
.ticket-line {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
}
.ticket-line--dim {
  font-weight: 500;
  opacity: 0.72;
}
.ticket-stub {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 76px;
  border-left: 2px dashed rgba(28, 22, 8, 0.35);
  font: 800 17px/1 ui-monospace, "SF Mono", Menlo, monospace;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, hsl(var(--accent-h) 100% 72%), hsl(var(--accent-h) 96% 54%));
  color: #0b1020;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 14px 32px -12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: scale 0.25s var(--ease-spring), opacity 0.2s;
}
.share-btn:active {
  scale: 0.98;
}
.share-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Video-Export */
.video-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s, scale 0.25s var(--ease-spring);
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.ghost-btn:active {
  scale: 0.98;
}
.ghost-btn .lucide,
.ghost-btn i[data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--accent-ink);
}

.rec-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  cursor: progress;
  touch-action: none;
}
.rec-pill {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-t) + 14px);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--glass-solid);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(251, 113, 133, 0.55);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 10px var(--bad);
  animation: pulse 1s ease-in-out infinite;
}

.video-result {
  position: fixed;
  z-index: 41;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(calc(100% - 32px), 440px);
  max-height: calc(100% - 32px);
  padding: 16px;
  border-radius: var(--r-xl);
  background: var(--glass-solid);
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.9), 0 0 0 100vmax rgba(5, 8, 15, 0.55);
  animation: menu-in 0.32s var(--ease-spring);
}
.video-result-title {
  font-size: 16px;
  font-weight: 800;
}
.video-preview {
  width: 100%;
  min-height: 0;
  max-height: 56vh;
  border-radius: var(--r-md);
  background: #000;
  object-fit: contain;
}
.video-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.video-actions .share-btn {
  min-height: 48px;
}
.fineprint {
  padding: 2px 2px 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* Shimmer-Skeletons während /api/dossier lädt */
.sheet.is-loading [data-skel] {
  width: fit-content;
  min-width: 7ch;
  max-width: 100%;
  border-radius: 6px;
  color: transparent !important;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.07) 30%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0.07) 70%) 0 0 / 220%
    100%;
  box-shadow: none;
  animation: shimmer 1.15s linear infinite;
  user-select: none;
  -webkit-user-select: none;
}
.sheet.is-loading .chip [data-skel] {
  min-width: 5ch;
}
.sheet.is-loading .landuse-bar,
.sheet.is-loading .landuse-legend,
.sheet.is-loading .mini-bar,
.sheet.is-loading .traffic {
  opacity: 0.3;
}
@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: calc(var(--safe-t) + var(--topbar-h) + 14px);
  translate: -50% -12px;
  max-width: min(calc(100% - 32px), 440px);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--glass-solid);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px var(--line);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, translate 0.45s var(--ease-spring);
}
.toast.is-visible {
  opacity: 1;
  translate: -50% 0;
}
.toast[data-tone="warn"] {
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(251, 191, 36, 0.55);
  color: #fde68a;
}
.toast[data-tone="ok"] {
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
}

/* ---------- Status-Banner ---------- */
.status-banner {
  position: fixed;
  z-index: 31;
  left: 50%;
  top: calc(var(--safe-t) + var(--topbar-h) + 14px);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(calc(100% - 24px), 520px);
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  background: var(--glass-solid);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(251, 191, 36, 0.6);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fde68a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.status-banner .lucide,
.status-banner i[data-lucide] {
  color: var(--warn);
}
.status-banner-action {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  background: var(--warn);
  color: #1c1608;
  font-size: 13px;
  font-weight: 800;
}
.retry-btn {
  width: 100%;
  margin-bottom: 10px;
}

#safe-probe {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 0;
  height: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  visibility: hidden;
  pointer-events: none;
}

.boot-error {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink-2);
  text-align: center;
}

/* ---------- Responsiv ---------- */
@media (min-width: 640px) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .sheet {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }
}

@media (max-width: 480px) {
  .brand-text,
  .seg-label,
  #dossier-toggle-text {
    display: none;
  }
  .brand {
    padding-right: 8px;
  }
  .segmented button {
    padding: 0 8px;
  }
}

/* Tastatur-Hinweise nur auf Geräten mit Maus/Trackpad */
@media (hover: none), (max-width: 480px) {
  .kbd,
  .omni-foot {
    display: none;
  }
}

/* Halb geöffnetes Dossier auf dem Smartphone: Timeline kompakt, Karte bleibt sichtbar */
@media (max-width: 720px) {
  body[data-sheet="half"] .chrono-meta {
    display: none;
  }
  body[data-sheet="half"] .rail,
  body[data-sheet="half"] .sun-panel {
    opacity: 0;
    pointer-events: none;
  }
  /* Kompakte Karten, damit das 2×2-Raster nahe 45vh bleibt; die volle Fußzeile steht in "Full" */
  .sheet[data-snap="half"] .card-foot {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
  }
}
body[data-sheet="full"] .rail,
body[data-sheet="full"] .sun-panel {
  opacity: 0;
  pointer-events: none;
}
@media (min-width: 900px) {
  body[data-sheet="full"] .rail {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
