/* =============================================================
   TreffRadar – Gestaltung
   Asphalt-Grau, Scheinwerfer-Gelb, Datum im Stil der
   österreichischen Kennzeichentafel (weiß mit rotem Rand).
   ============================================================= */

:root {
  --asphalt: #1D2227;
  --asphalt-2: #252B31;
  --asphalt-3: #313941;
  --line: #3A434C;
  --chalk: #ECEDE8;
  --chalk-dim: #A9B1B8;
  --chalk-faint: #79838C;
  --signal: #F5C330;
  --signal-ink: #1D2227;
  --plate: #FAFAF5;
  --plate-ink: #16191C;
  --plate-red: #D3262B;
  --danger: #FF7A6B;

  --display: 'Barlow Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --top-h: 60px;
  --filter-h: 52px;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  /* Unten reicht ein Teil des Home-Balken-Abstands, sonst wird die Leiste zu hoch */
  --safe-bar: max(calc(var(--safe-b) - 14px), 0px);
  --maxw: 680px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { overflow-x: hidden; background: var(--asphalt); overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body {
  background: var(--asphalt);
  color: var(--chalk);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: var(--maxw); margin: 0 auto; min-height: 100%; position: relative; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--asphalt);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 9px; display: block; }
.brand-name {
  font-family: var(--display); font-weight: 800; font-size: 26px;
  letter-spacing: 0.01em; font-style: italic;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--asphalt-2);
  font-family: var(--display); font-weight: 700; font-size: 18px;
  display: grid; place-items: center;
}

/* ---------- Filter ---------- */
.filters {
  position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 29;
  height: var(--filter-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 0 0 16px;
  background: var(--asphalt);
  border-bottom: 1px solid var(--line);
}
.chips {
  flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0; mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 17px;
  border: 1.5px solid var(--line); background: transparent;
  font-weight: 600; font-size: 14px; color: var(--chalk-dim);
  white-space: nowrap;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--chalk); border-color: var(--chalk); color: var(--asphalt); }
.radius { flex: none; padding-right: 12px; }
.radius select {
  appearance: none; -webkit-appearance: none;
  height: 34px; padding: 0 30px 0 12px; border-radius: 17px;
  border: 1.5px solid var(--line); font-weight: 600; font-size: 14px;
  background: var(--asphalt-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A9B1B8' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 11px center / 11px;
}

.demo-note {
  margin: 12px 16px 0; padding: 10px 14px; border-radius: 10px;
  background: rgba(245, 195, 48, 0.1); color: #E9D38E;
  font-size: 14px; border: 1px dashed rgba(245, 195, 48, 0.4);
}

/* ---------- Liste ---------- */
main { padding-bottom: calc(var(--tab-h) + var(--safe-bar) + 16px); }
.feed { padding: 4px 16px 24px; }
.day-head {
  font-family: var(--display); font-weight: 700; font-size: 22px;
  margin: 22px 0 6px; color: var(--chalk);
}
.day-head small { font-weight: 600; font-size: 16px; color: var(--chalk-faint); margin-left: 8px; }

.event-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  width: 100%; text-align: left; padding: 12px 0; border: 0; background: none;
  border-bottom: 1px solid var(--line);
}
.event-row:last-child { border-bottom: 0; }
.event-row:active { background: var(--asphalt-2); }

/* Datum als Kennzeichentafel */
.plate {
  background: var(--plate); color: var(--plate-ink);
  border-radius: 6px; border: 2px solid var(--plate-ink);
  box-shadow: inset 0 5px 0 var(--plate-red), inset 0 -5px 0 var(--plate-red);
  text-align: center; font-family: var(--display); line-height: 1;
  padding: 8px 0 7px;
}
.plate .wd { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; margin-top: 2px; }
.plate .d { display: block; font-size: 28px; font-weight: 800; margin: 2px 0 1px; }
.plate .m { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }

.ev-body { min-width: 0; display: block; }
.ev-title {
  font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.15;
  margin: 0 0 3px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ev-meta { display: block; font-size: 14px; color: var(--chalk-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-foot { display: flex; align-items: center; gap: 12px; margin-top: 5px; font-size: 13px; color: var(--chalk-dim); }
.type-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--chalk); }
.type-tag .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.going { display: inline-flex; align-items: center; gap: 4px; }
.going.is-me { color: var(--signal); font-weight: 600; }
.ev-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--asphalt-3); }

.empty { text-align: center; padding: 56px 20px; color: var(--chalk-dim); }
.empty h2 { font-family: var(--display); font-size: 26px; color: var(--chalk); margin: 0 0 6px; }
.empty p { margin: 0 0 20px; }

.skeleton { height: 82px; border-radius: 10px; margin: 12px 0; background: linear-gradient(90deg, var(--asphalt-2), var(--asphalt-3), var(--asphalt-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Karte ---------- */
#mapView {
  position: fixed; left: 0; right: 0;
  top: calc(var(--top-h) + var(--filter-h) + var(--safe-t));
  bottom: calc(var(--tab-h) + var(--safe-bar));
  max-width: var(--maxw); margin: 0 auto;
  z-index: 1; /* hält die Karte unter den Overlays */
}
.map { position: absolute; inset: 0; background: #2A3036; }
.leaflet-container { font-family: var(--body); background: #2A3036; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(0.92) contrast(0.88) saturate(0.6); }
.leaflet-control-attribution { background: rgba(29, 34, 39, 0.8) !important; color: var(--chalk-faint) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--chalk-dim) !important; }
.leaflet-bar a { background: var(--asphalt-2); color: var(--chalk); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--asphalt-3); }

.pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); border: 2.5px solid var(--asphalt);
  display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}
.pin span {
  transform: rotate(45deg); font-family: var(--display); font-weight: 800; font-size: 15px;
  color: var(--asphalt); line-height: 1;
}
.pin.is-active { outline: 3px solid var(--chalk); outline-offset: 1px; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #4C9BFF; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(76, 155, 255, 0.25); }

.locate-btn {
  position: absolute; right: 12px; top: 12px; z-index: 500;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--asphalt-2); border: 1.5px solid var(--line); color: var(--chalk);
  display: grid; place-items: center;
}
.map-peek {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 500;
  background: var(--asphalt-2); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 4px 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.map-peek .event-row { border: 0; }

/* ---------- Untere Leiste ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: var(--maxw); margin: 0 auto;
  height: calc(var(--tab-h) + var(--safe-bar)); padding-bottom: var(--safe-bar);
  padding-left: var(--safe-l); padding-right: var(--safe-r);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--asphalt-2); border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; color: var(--chalk-faint);
  font-size: 12px; font-weight: 600; padding: 8px 0;
}
.tab.is-active { color: var(--chalk); }
.add-btn {
  display: flex; align-items: center; gap: 6px;
  height: 48px; padding: 0 20px 0 16px; border-radius: 24px; border: 0;
  background: var(--signal); color: var(--signal-ink);
  font-family: var(--display); font-weight: 800; font-size: 19px;
  box-shadow: 0 4px 14px rgba(245, 195, 48, 0.25);
}
.add-btn:active { transform: scale(0.97); }

/* ---------- Overlays ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 100;
  background: var(--asphalt);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  animation: sheet-in 0.24s cubic-bezier(.2, .8, .2, 1);
}
.sheet > .sheet-inner { max-width: var(--maxw); margin: 0 auto; padding-bottom: calc(32px + var(--safe-b)); }
.sheet--small { background: rgba(10, 12, 14, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet--small > .sheet-inner {
  width: 100%; background: var(--asphalt-2); border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(24px + var(--safe-b));
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .skeleton { animation: none; } }

.sheet-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  background: var(--asphalt);
}
.sheet-bar h2 { font-family: var(--display); font-weight: 800; font-size: 24px; margin: 0; flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--asphalt-2); color: var(--chalk);
  display: grid; place-items: center; flex: none;
}
.sheet-bar.over-image {
  position: sticky; top: 0; left: 0; right: 0; background: none;
  margin-bottom: calc(-64px - var(--safe-t)); pointer-events: none;
}
.sheet-bar.over-image > * { pointer-events: auto; }
.sheet-bar.over-image .icon-btn { background: rgba(20, 24, 28, 0.7); backdrop-filter: blur(6px); }

/* Detail */
.detail-hero { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--asphalt-3); }
.detail-hero--empty {
  display: grid; place-items: center; aspect-ratio: 16 / 7;
  background:
    repeating-linear-gradient(-45deg, transparent 0 22px, rgba(255, 255, 255, 0.025) 22px 44px),
    var(--asphalt-2);
  border-bottom: 4px solid var(--c);
}
.detail-hero--empty img { width: 72px; opacity: 0.9; }
.detail { padding: 18px 20px 0; }
.detail h1 { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.05; margin: 10px 0 18px; }

.plate-wide {
  display: flex; align-items: stretch; gap: 0;
  background: var(--plate); color: var(--plate-ink); border: 2.5px solid var(--plate-ink);
  border-radius: 8px; overflow: hidden;
  box-shadow: inset 0 6px 0 var(--plate-red), inset 0 -6px 0 var(--plate-red);
  font-family: var(--display); line-height: 1.05;
}
.plate-wide .pd { padding: 14px 16px 12px; flex: 1; }
.plate-wide .pd strong { display: block; font-size: 24px; font-weight: 800; }
.plate-wide .pd span { display: block; font-size: 17px; font-weight: 600; color: #3C4248; margin-top: 3px; }
.plate-wide .pd + .pd { border-left: 2px solid var(--plate-ink); flex: 0 0 auto; text-align: center; min-width: 108px; }

.place { margin: 18px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.place strong { display: block; font-size: 18px; font-weight: 600; }
.place span { color: var(--chalk-dim); font-size: 15px; }
.place .dist { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--chalk); white-space: nowrap; }

.mini-map, .pick-map { position: relative; z-index: 0; isolation: isolate; }
.mini-map { height: 160px; border-radius: 12px; margin-top: 14px; overflow: hidden; border: 1px solid var(--line); }

.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--asphalt-2); color: var(--chalk);
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.btn svg { flex: none; }
.btn--primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-family: var(--display); font-weight: 800; font-size: 20px; }
.btn--going { background: transparent; border-color: var(--signal); color: var(--signal); }
.btn--wide { grid-column: 1 / -1; width: 100%; }
.btn--text { background: none; border: 0; min-height: 44px; padding: 0; color: var(--chalk-dim); font-weight: 500; }
.btn--danger { color: var(--danger); }
.btn:disabled { opacity: 0.55; }

.block-title { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 26px 0 8px; }
.who { display: flex; flex-wrap: wrap; gap: 6px; }
.who span { padding: 5px 11px; border-radius: 14px; background: var(--asphalt-2); border: 1px solid var(--line); font-size: 14px; }
.who .me { border-color: var(--signal); color: var(--signal); }
.desc { white-space: pre-line; color: var(--chalk); margin: 0; }
.source-link { display: inline-flex; margin-top: 12px; color: var(--signal); font-weight: 600; text-underline-offset: 3px; }
.detail-foot {
  margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 14px; color: var(--chalk-faint);
}

/* Formular */
.form { padding: 4px 20px 0; }
.field { margin: 0 0 18px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 7px; }
.field .hint { font-size: 13px; color: var(--chalk-faint); margin-top: 6px; }
.input, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--asphalt-2); font-size: 16px;
}
.textarea { min-height: 100px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--signal); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 14px; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.type-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pick input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick label {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
  border-radius: 20px; border: 1.5px solid var(--line); font-weight: 600; font-size: 15px; color: var(--chalk-dim);
}
.type-pick label .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.type-pick input:checked + label { border-color: var(--c); color: var(--chalk); background: color-mix(in srgb, var(--c) 14%, transparent); }
.type-pick input:focus-visible + label { outline: 2.5px solid var(--signal); outline-offset: 2px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.results { list-style: none; margin: 8px 0 0; padding: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.results:empty { display: none; }
.results button { width: 100%; text-align: left; padding: 12px 14px; border: 0; background: var(--asphalt-2); border-bottom: 1px solid var(--line); font-size: 15px; }
.results li:last-child button { border-bottom: 0; }
.pick-map { height: 220px; border-radius: 12px; margin-top: 10px; border: 1.5px solid var(--line); overflow: hidden; }
.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-pick img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.form-actions { margin-top: 8px; }

/* Profil */
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 14px; }
.sheet--small h2 { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 0 0 6px; }
.sheet--small p { color: var(--chalk-dim); margin: 0 0 16px; }
.stack { display: grid; gap: 10px; }
.install-steps { background: var(--asphalt); border-radius: 12px; padding: 12px 14px; font-size: 15px; color: var(--chalk-dim); }
.install-steps strong { color: var(--chalk); }

/* Hinweis unten */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + var(--safe-bar) + 14px); z-index: 200;
  background: var(--chalk); color: var(--asphalt);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.toast.is-error { background: var(--danger); color: #2A0A06; }

@media (min-width: 700px) {
  .feed { padding: 4px 20px 24px; }
  .event-row { border-radius: 10px; padding: 12px 10px; }
}

/* Bei offenem Overlay sitzt der Hinweis ganz unten */
body:has(.sheet:not([hidden])) .toast { bottom: calc(18px + var(--safe-b)); }

/* =============================================================
   Version 2: Abgesagt, Crews, Neuigkeiten, Sammelpunkte, Fotos,
   Wetter, Regeln, Veranstalter, Profil-Einstellungen
   ============================================================= */
.muted { color: var(--chalk-faint); font-size: 15px; margin: 0; }
.ev-foot { flex-wrap: wrap; row-gap: 3px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--chalk-dim);
}
.tag--cancelled { color: #fff; background: var(--plate-red); padding: 1px 8px; border-radius: 6px; }
.tag--crew { color: #9FD0F5; }
.tag--verified { color: var(--signal); }
.going.is-crew { color: #9FD0F5; font-weight: 600; }
.fav-mark { color: var(--signal); margin-right: 5px; display: inline-flex; vertical-align: 1px; }

.event-row.is-cancelled .ev-title { text-decoration: line-through; text-decoration-color: var(--plate-red); text-decoration-thickness: 2px; color: var(--chalk-dim); }
.event-row.is-cancelled .plate { opacity: 0.55; }

/* Detail-Kopf */
.sheet-bar .spacer { flex: 1; }
.sheet-bar.over-image { display: flex; }
.fav-btn.is-on { color: var(--signal); --star-fill: var(--signal); }
.cancel-banner {
  background: var(--plate-red); color: #fff; padding: 12px 20px; font-size: 16px;
}
.cancel-banner strong { font-family: var(--display); font-size: 20px; margin-right: 6px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.detail h1.is-struck { text-decoration: line-through; text-decoration-color: var(--plate-red); text-decoration-thickness: 3px; }

.weather {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 10px 14px; border-radius: 10px; background: var(--asphalt-2);
  font-size: 15px; color: var(--chalk-dim); min-height: 46px;
}
.weather strong { color: var(--chalk); font-weight: 600; }
.weather-emoji { font-size: 24px; line-height: 1; }
.weather-muted { color: var(--chalk-faint); }

.btn--small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn--tiny { min-height: 32px; font-size: 13px; }
.btn--outline { background: transparent; margin-top: 10px; }
.btn--danger-fill { background: var(--plate-red); border-color: var(--plate-red); color: #fff; }
.icon-btn--small { width: 38px; height: 38px; }
.icon-btn:disabled { opacity: 0.3; }

/* Neuigkeiten */
.update-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.textarea--short { min-height: 50px; height: 50px; }
.updates { display: grid; gap: 8px; }
.update {
  border-left: 4px solid var(--signal); background: var(--asphalt-2);
  border-radius: 0 10px 10px 0; padding: 10px 14px 6px;
}
.update p { margin: 0; white-space: pre-line; }
.update footer { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--chalk-faint); }

/* Wer ist dabei */
.who .crew { border-color: #9FD0F5; color: #9FD0F5; }
.who .more { background: transparent; border-style: dashed; color: var(--chalk-dim); }

/* Sammelpunkte */
.convoys { display: grid; gap: 10px; }
.convoy { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.convoy-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.convoy-head strong { display: block; font-size: 17px; }
.convoy-head span { font-size: 14px; color: var(--chalk-dim); }
.convoy-note { margin: 8px 0 0; font-size: 15px; }
.convoy-who { margin: 8px 0 0; font-size: 14px; color: var(--chalk-dim); display: flex; gap: 6px; align-items: center; }
.convoy-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

/* Regeln */
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules li { display: flex; gap: 10px; align-items: flex-start; }
.rules svg { color: var(--signal); flex: none; margin-top: 2px; }

/* Fotos */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.photos .muted { grid-column: 1 / -1; }
.photo { padding: 0; border: 0; background: var(--asphalt-3); aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet--photo { background: #050607; display: flex; align-items: center; justify-content: center; }
.photo-view { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.photo-view > img { max-width: 100%; max-height: calc(100% - 140px); object-fit: contain; }
.photo-bar {
  position: absolute; top: 0; left: 0; right: 0; padding: calc(10px + var(--safe-t)) 12px 10px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  font-size: 14px; color: var(--chalk-dim); text-align: center;
}
.photo-nav { position: absolute; bottom: calc(24px + var(--safe-b)); display: flex; gap: 24px; }
.flip svg { transform: scaleX(-1); }

/* Eigentümer-Aktionen */
.detail-foot .by { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Formular-Ergänzungen */
.note { background: var(--asphalt-2); border-radius: 10px; padding: 10px 14px; color: var(--chalk-dim); margin: 0 0 16px; }
.field-label { font-weight: 600; font-size: 15px; margin-bottom: -4px; }
.rule-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-pick input { position: absolute; opacity: 0; pointer-events: none; }
.rule-pick label {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border-radius: 19px;
  border: 1.5px solid var(--line); font-size: 14px; font-weight: 500; color: var(--chalk-dim);
}
.rule-pick input:checked + label { border-color: var(--signal); color: var(--chalk); background: rgba(245, 195, 48, 0.12); }
.rule-pick input:focus-visible + label { outline: 2.5px solid var(--signal); outline-offset: 2px; }
select.input { appearance: none; -webkit-appearance: none; background: var(--asphalt-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A9B1B8' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center / 12px; padding-right: 36px; }

/* Profil */
.sheet-inner--scroll { max-height: 92vh; overflow-y: auto; }
.profile-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.profile-section h3 { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 21px; margin: 0 0 10px; }
.profile-section h3 svg { color: var(--signal); }
.crew-forms { display: grid; gap: 8px; margin-top: 12px; }
.crew { background: var(--asphalt); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.crew-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.crew-head strong { font-size: 17px; }
.crew-head span, .crew-members { font-size: 14px; color: var(--chalk-dim); }
.crew-members { margin: 4px 0 8px !important; }
.crew-actions { display: flex; align-items: center; gap: 10px; }
.crew-actions .code { flex: 1; font-size: 14px; color: var(--chalk-dim); }
.crew-actions .code strong { font-family: var(--display); font-size: 19px; color: var(--chalk); letter-spacing: 0.08em; margin-left: 4px; }
.id-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; }
.id-row code { font-size: 12px; background: var(--asphalt); padding: 10px; border-radius: 8px; overflow-wrap: anywhere; color: var(--chalk-dim); }
.switch-row { display: flex; justify-content: space-between; align-items: center; min-height: 48px; font-weight: 600; }
.switch-row input, .check-row input { width: 22px; height: 22px; accent-color: var(--signal); flex: none; }
.push-prefs { display: grid; gap: 10px; margin-top: 6px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--chalk-dim); }
.inline-select { background: var(--asphalt); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; color: var(--chalk); }
.btn--primary:disabled { background: var(--asphalt-3); border-color: var(--asphalt-3); color: var(--chalk-dim); opacity: 1; }

/* Schließen-Knopf in kleinen Overlays (wichtig in der installierten App ohne Zurück-Taste) */
.sheet--small > .sheet-inner { position: relative; }
.sheet-x {
  position: sticky; top: 0; float: right; z-index: 3;
  width: 40px; height: 40px; margin: 2px -6px 0 8px;
  background: var(--asphalt-3);
}
.sheet-inner--scroll { max-height: calc(100vh - var(--safe-t) - 56px); max-height: calc(100dvh - var(--safe-t) - 56px); }

/* =============================================================
   Version 3: Suche, Live-Check-in, Car of the Meet, Bewertung,
   Garage, Story-Bild, Kalender, Admin, Rechtliches
   ============================================================= */
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn--plain { background: transparent; color: var(--chalk-dim); width: 40px; height: 40px; }
.icon-btn--plain.is-on { color: var(--signal); }
.searchbar {
  position: sticky; top: calc(var(--top-h) + var(--filter-h) + var(--safe-t)); z-index: 28;
  padding: 10px 16px; background: var(--asphalt); border-bottom: 1px solid var(--line);
}
.searchbar .input { min-height: 44px; }
#searchBar:not([hidden]) ~ main #mapView { top: calc(var(--top-h) + var(--filter-h) + var(--safe-t) + 65px); }

.tag--live { color: #1D2227; background: #59D98E; padding: 1px 8px; border-radius: 6px; }
.tag--live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #0E5B2F; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .tag--live::before, .live-dot { animation: none; } }

.series-rating { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; color: var(--chalk-dim); font-size: 15px; }
.series-rating svg { color: #59D98E; flex: none; }
.series-rating strong { color: var(--chalk); }

.actions { margin-bottom: 10px; }
.action-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--asphalt-2);
  color: var(--chalk); text-decoration: none; font-size: 13px; font-weight: 600;
}
.act svg { color: var(--signal); }

.block-title svg { vertical-align: -3px; color: var(--signal); margin-right: 4px; }

/* Live vor Ort */
.live-box {
  margin: 16px 0 4px; padding: 16px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(89, 217, 142, 0.14), rgba(89, 217, 142, 0.03));
  border: 1.5px solid rgba(89, 217, 142, 0.45);
}
.live-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.live-head span { color: var(--chalk-dim); font-size: 15px; margin-left: 6px; }
.live-dot { width: 14px; height: 14px; border-radius: 50%; background: #59D98E; box-shadow: 0 0 0 6px rgba(89, 217, 142, 0.2); animation: pulse 1.6s infinite; }
.live-count { font-family: var(--display); font-size: 44px; line-height: 1; }
.live-box .btn { margin-top: 12px; }
.live-box .hint { margin: 8px 0 0; font-size: 13px; color: var(--chalk-faint); }
.who--small { margin-bottom: 4px; }

.who-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0;
  padding: 5px 12px; border-radius: 12px; background: var(--asphalt-2); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.2; text-align: left;
}
.who-chip small { font-size: 12px; color: var(--chalk-faint); }
.who-chip.me { border-color: var(--signal); color: var(--signal); }
.who-chip.crew { border-color: #9FD0F5; color: #9FD0F5; }

/* Car of the Meet */
.winner {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; width: 100%;
  padding: 12px; margin-bottom: 12px; border-radius: 14px; text-align: left;
  border: 2px solid var(--signal); background: rgba(245, 195, 48, 0.1);
}
.winner img, .winner-icon { width: 96px; height: 72px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--asphalt-3); color: var(--signal); }
.winner small { display: block; color: var(--signal); font-weight: 700; font-size: 13px; }
.winner strong { display: block; font-family: var(--display); font-size: 24px; line-height: 1.1; }
.winner span span, .winner > span > span { color: var(--chalk-dim); font-size: 14px; }
.cotm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cotm-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--asphalt-2);
}
.cotm-list li.is-mine { outline: 1.5px solid var(--signal); }
.cotm-car { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; }
.cotm-car img, .car-ph { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--asphalt-3); color: var(--chalk-faint); }
.cotm-car strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cotm-car small { display: block; font-size: 12px; color: var(--chalk-faint); }
.cotm-car > span { min-width: 0; }
.cotm-bar { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 3px; background: var(--asphalt-3); overflow: hidden; }
.cotm-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--signal); border-radius: 3px; }
.hint { font-size: 13px; color: var(--chalk-faint); margin: 0 0 10px; }

/* Bewertung */
.rating-summary { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; margin-bottom: 12px; }
.rating-summary strong { font-family: var(--display); font-size: 38px; line-height: 1; color: #59D98E; }
.rating-summary span { color: var(--chalk-dim); font-size: 15px; }
.rating-bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--plate-red); position: relative; overflow: hidden; margin-top: 6px; }
.rating-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: #59D98E; }
.rate-form { display: grid; gap: 10px; margin-bottom: 14px; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.thumb {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--asphalt-2); font-weight: 600;
}
.thumb--down svg { transform: rotate(180deg); }
.thumb.is-on { border-color: #59D98E; color: #59D98E; background: rgba(89, 217, 142, 0.1); }
.thumb--down.is-on { border-color: var(--danger); color: var(--danger); background: rgba(255, 122, 107, 0.1); }
.rate-actions { display: flex; justify-content: space-between; align-items: center; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comments li { display: flex; gap: 10px; }
.comments p { margin: 2px 0 0; }
.c-thumb { color: #59D98E; flex: none; margin-top: 2px; }
.c-thumb.is-down { color: var(--danger); }
.c-thumb.is-down svg { transform: rotate(180deg); }

/* Auto */
.car-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; margin: 4px 0 12px; display: block; }
.car-photo--empty { display: grid; place-items: center; background: var(--asphalt); color: var(--chalk-faint); }
.car-photo--empty svg { width: 64px; height: 64px; }
#carTitle small { font-size: 18px; color: var(--chalk-faint); font-weight: 600; }
.mini-title { font-family: var(--display); font-size: 19px; margin: 14px 0 4px; }
.garage { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 8px; }
.garage-car {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 8px; border-radius: 12px; background: var(--asphalt); border: 0; text-align: left;
}
.garage-car img, .garage-car .car-ph { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; }
.garage-car strong { display: block; }
.garage-car small { color: var(--chalk-faint); font-size: 13px; }
.garage-car .edit { font-size: 13px; color: var(--signal); font-weight: 600; }

/* Story-Bild */
.story-view { flex-direction: column; gap: 14px; padding: calc(64px + var(--safe-t)) 16px calc(20px + var(--safe-b)); }
.story-img { max-height: calc(100% - 90px); max-width: 100%; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.story-actions { display: flex; gap: 10px; }

/* Rechtliches & Admin */
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.legal { padding: 0 20px; max-width: 70ch; }
.legal h2 { font-family: var(--display); font-size: 30px; margin: 4px 0 2px; }
.legal h3 { font-family: var(--display); font-size: 20px; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--chalk-dim); }
.legal ul { padding-left: 20px; display: grid; gap: 6px; }
.legal strong { color: var(--chalk); }
.legal a { color: var(--signal); }
.legal-sub { font-size: 14px; color: var(--chalk-faint) !important; margin-top: 0; }
.admin { padding: 0 16px; }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--asphalt-2); margin-bottom: 14px; }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--chalk-dim); font-weight: 600; font-size: 14px; }
.seg button[aria-selected="true"] { background: var(--chalk); color: var(--asphalt); }
.admin-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.admin-card-head strong { display: block; font-size: 17px; }
.admin-card-head span { display: block; font-size: 14px; color: var(--chalk-dim); }
.admin-card-head code { display: block; font-size: 11px; color: var(--chalk-faint); margin-top: 4px; overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.report-line { margin: 8px 0 0; color: var(--danger); font-size: 14px; }
.who .who-chip > span, .who .who-chip > small { padding: 0; border: 0; background: none; border-radius: 0; }

/* Admin: Crews */
.admin-card-head strong svg { vertical-align: -1px; color: #9FD0F5; }
.crew-events { margin-top: 12px; display: grid; gap: 8px; }
.crew-event { padding: 10px 12px; border-radius: 10px; background: var(--asphalt-2); }
.crew-event strong { display: block; }
.crew-event span { display: block; font-size: 14px; color: var(--chalk-dim); }
.crew-event p { margin: 6px 0 0; font-size: 14px; }
.crew-event.is-cancelled strong { text-decoration: line-through; text-decoration-color: var(--plate-red); }

/* =============================================================
   Version 4: Konto, Szenen, Profile, Chat, Statistik, Cluster
   ============================================================= */
.radius.scene-filter { padding-right: 0; }
.radius.scene-filter select { max-width: 118px; text-overflow: ellipsis; }
.radius select { max-width: 104px; }

.scene-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.scene-tags span { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: var(--asphalt-3); color: var(--chalk); }

.link-btn { background: none; border: 0; padding: 0; color: var(--signal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats > div { background: var(--asphalt-2); border-radius: 12px; padding: 10px 12px; }
.stats strong { display: block; font-family: var(--display); font-size: 28px; line-height: 1; }
.stats span { font-size: 13px; color: var(--chalk-dim); }
.stats .hint { grid-column: 1 / -1; margin: 4px 0 0; }

.account-box { background: var(--asphalt); border-radius: 14px; padding: 12px 14px; margin: 4px 0 16px; }
.account-box p { margin: 0 0 10px; font-size: 15px; }
.code-input { font-family: var(--display); font-size: 30px; letter-spacing: 0.3em; text-align: center; }

.user-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.user-head h2 { margin: 0 !important; }
.user-head p { margin: 2px 0 0 !important; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-avatar {
  width: 60px; height: 60px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--signal); color: var(--asphalt); font-family: var(--display); font-weight: 800; font-size: 30px;
}
.user-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 4px; }
.user-stats div { background: var(--asphalt); border-radius: 12px; padding: 10px; text-align: center; }
.user-stats strong { display: block; font-family: var(--display); font-size: 28px; line-height: 1; }
.user-stats span { font-size: 12px; color: var(--chalk-dim); }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.badges li { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--asphalt); opacity: 0.4; filter: grayscale(1); }
.badges li.is-on { opacity: 1; filter: none; outline: 1.5px solid rgba(245, 195, 48, 0.5); }
.b-icon { grid-row: 1 / 3; font-size: 24px; text-align: center; }
.badges strong { font-size: 14px; line-height: 1.2; }
.badges small { font-size: 12px; color: var(--chalk-faint); line-height: 1.2; }

/* Chat */
.chat { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--asphalt-2); }
.chat-list { max-height: 320px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-list .muted { text-align: center; padding: 10px 0; }
.msg { max-width: 82%; align-self: flex-start; background: var(--asphalt-3); border-radius: 14px 14px 14px 4px; padding: 7px 12px 6px; }
.msg.is-me { align-self: flex-end; background: rgba(245, 195, 48, 0.18); border-radius: 14px 14px 4px 14px; }
.msg p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.msg-name { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 700; color: var(--signal); }
.msg-meta { display: block; font-size: 11px; color: var(--chalk-faint); margin-top: 2px; }
.msg-del { background: none; border: 0; padding: 0 0 0 6px; font-size: 11px; color: var(--chalk-faint); text-decoration: underline; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px; border-top: 1px solid var(--line); background: var(--asphalt); }
.btn--send { min-height: 50px; width: 52px; padding: 0; }
.btn--send svg { transform: rotate(90deg); }
.chat-sheet { display: flex; flex-direction: column; height: 100%; }
.chat--full { flex: 1; margin: 0 12px calc(12px + var(--safe-b)); display: flex; flex-direction: column; min-height: 0; }
.chat--full .chat-list { max-height: none; flex: 1; }
#chatTitle svg { vertical-align: -1px; color: #9FD0F5; }
#chatSheet .sheet-inner { padding-bottom: 0; }

/* Gebündelte Pins */
.cluster {
  width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center;
  background: var(--asphalt); border: 3px solid var(--signal); box-shadow: 0 0 0 5px rgba(245, 195, 48, 0.25), 0 3px 10px rgba(0, 0, 0, 0.5);
}
.cluster span { font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--signal); }

/* Filterleiste: Auswahlfelder und Chips scrollen gemeinsam */
.filters { padding: 0; }
.filter-scroll {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  overflow-x: auto; scrollbar-width: none; padding: 8px 16px;
  mask-image: linear-gradient(90deg, #000 90%, transparent);
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-scroll .chips { flex: none; overflow: visible; padding: 0; mask-image: none; }
.filter-scroll .radius { padding: 0; flex: none; }
.filter-scroll .radius select { max-width: none; }
.filter-sep { flex: none; width: 1px; height: 22px; background: var(--line); }

/* =============================================================
   Version 5: Handy-Ränder, Profilbilder
   ============================================================= */
/* Statusleiste (Uhr, Akku) bei offenen Vollbild-Fenstern abdecken,
   damit beim Scrollen nichts darunter durchläuft */
.sheet:not(.sheet--small):not(.sheet--photo)::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--safe-t); background: var(--asphalt); pointer-events: none;
}
/* Kleine Fenster nie höher als der Bildschirm, Inhalt scrollt innen */
.sheet--small > .sheet-inner {
  max-height: calc(100vh - var(--safe-t) - 24px);
  max-height: calc(100dvh - var(--safe-t) - 24px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding-left: calc(20px + var(--safe-l)); padding-right: calc(20px + var(--safe-r));
}
.sheet-inner--scroll { max-height: calc(100dvh - var(--safe-t) - 56px); }
/* Querformat: Rundungen und Kamera-Aussparung seitlich */
.topbar { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
.filters { padding-left: calc(16px + var(--safe-l)); }
.feed { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
.sheet:not(.sheet--small) > .sheet-inner { padding-left: var(--safe-l); padding-right: var(--safe-r); }
.account-box .btn { white-space: nowrap; }
.account-box .btn-row, .account-box .search-row { gap: 8px; }

/* Profilbilder */
.avatar { overflow: hidden; padding: 0; }
.avatar #avatarLetter { display: grid; place-items: center; width: 100%; height: 100%; }
.avatar img, .user-avatar img, .av img, .avatar-big img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar.has-img { border-color: var(--signal); }
.user-avatar { overflow: hidden; }
.av {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  width: 26px; height: 26px; background: var(--asphalt-3); color: var(--chalk);
  font-family: var(--display); font-weight: 800; font-size: 14px; line-height: 1;
}
.av--letter { background: var(--asphalt-3); color: var(--chalk-dim); }
.who-chip { flex-direction: row; align-items: center; gap: 8px; padding-left: 6px; }
.who-chip .who-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.who .who-chip span, .who .who-chip small { padding: 0; border: 0; background: none; border-radius: 0; }
.who .who-chip .av { padding: 0; border-radius: 50%; background: var(--asphalt-3); font-size: 13px; }
.who .who-chip .av img { border-radius: 50%; }
.who-chip.me .av--letter { color: var(--signal); }
.msg-name { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.av--msg { width: 20px; height: 20px; font-size: 11px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin: 4px 0 16px; }
.avatar-edit.is-busy { opacity: 0.5; pointer-events: none; }
.avatar-big {
  position: relative; width: 76px; height: 76px; border-radius: 50%; flex: none; cursor: pointer;
  background: var(--signal); color: var(--asphalt); display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 36px;
}
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--asphalt); border: 2px solid var(--asphalt-2); color: var(--chalk);
  display: grid; place-items: center;
}
.avatar-cam svg { width: 16px; height: 16px; }
.avatar-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.avatar-actions strong { font-size: 16px; }
.avatar-actions .btn--text { padding-left: 0; }

/* =============================================================
   Version 6: Crew-Manager
   ============================================================= */
.tag--lead {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: rgba(159, 208, 245, 0.15); color: #9FD0F5;
}
.crew .tag--lead { margin-top: 4px; }
.member-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.member-list li {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 6px 10px; border-radius: 12px; background: var(--asphalt);
}
.member-name { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; font-weight: 600; }
.member-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name .av { width: 32px; height: 32px; font-size: 15px; }
.member-list .btn--text { color: var(--danger); padding: 0 4px; }
.member-list--admin li { background: var(--asphalt-2); flex-wrap: wrap; }
.member-list--admin .btn { margin-left: auto; }
.crew-code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.crew-code-row strong { font-family: var(--display); font-size: 22px; letter-spacing: 0.08em; margin-left: 6px; }
#crewSheet .hint { margin-top: 6px; }
#crewTitle svg { vertical-align: -1px; color: #9FD0F5; }
.manager-note { flex-basis: 100%; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #9FD0F5; margin-bottom: 4px; }
.manager-note svg { width: 15px; height: 15px; }
.crew-code-row .btn { white-space: nowrap; flex: none; }

/* =============================================================
   Version 7: Profilbild zuschneiden, Zusagen verwalten
   ============================================================= */
.crop-stage {
  position: relative; width: min(100%, 320px); aspect-ratio: 1; margin: 6px auto 12px;
  border-radius: 16px; overflow: hidden; background: var(--asphalt);
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { display: block; width: 100%; height: 100%; }
.crop-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 999px rgba(10, 12, 14, 0.62), inset 0 0 0 2px rgba(245, 195, 48, 0.9);
}
.crop-tools { display: flex; align-items: center; gap: 12px; max-width: 320px; margin: 0 auto 14px; }
.crop-tools input[type=range] { flex: 1; accent-color: var(--signal); height: 32px; }
.crop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-attend-btn { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }
.admin-attend-btn svg { width: 16px; height: 16px; color: var(--signal); }

/* =============================================================
   Version 7.1: Crew-Karte neu angeordnet, kein seitliches Verschieben
   ============================================================= */
.crew-head strong { min-width: 0; overflow-wrap: anywhere; }
.crew-head span { flex: none; }
.crew-members { overflow-wrap: anywhere; }
.crew-code-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.crew-code-line .code { font-size: 14px; color: var(--chalk-dim); white-space: nowrap; }
.crew-code-line .code strong { font-family: var(--display); font-size: 20px; color: var(--chalk); letter-spacing: 0.08em; margin-left: 6px; }
.crew-leave { color: var(--chalk-faint); flex: none; padding: 0 2px; }
.crew-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.crew-actions .btn { min-width: 0; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Fenster lassen sich nur noch nach oben/unten schieben, nie seitlich */
.sheet, .sheet-inner, .sheet-inner--scroll { overflow-x: hidden; }
.sheet-inner > * { max-width: 100%; }
.id-row code { min-width: 0; word-break: break-all; }

/* =============================================================
   Version 8: Nutzerliste im Admin-Bereich
   ============================================================= */
.seg--admin { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.user-search { display: grid; gap: 8px; margin-bottom: 10px; }
.user-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.av--lg { width: 44px; height: 44px; font-size: 20px; }
.user-card-txt { min-width: 0; display: flex; flex-direction: column; }
.user-card-txt strong { font-size: 17px; overflow-wrap: anywhere; }
.user-card-txt > span { font-size: 14px; color: var(--chalk-dim); overflow-wrap: anywhere; }
.user-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.user-tags:empty { display: none; }
.user-meta { margin: 8px 0 0; font-size: 13px; color: var(--chalk-faint); }

/* Version 9: Wochen-Kontingent */
.quota-hint { text-align: center; margin: 10px 0 0; }
.quota-hint.is-empty { color: var(--danger); }

/* =============================================================
   Version 10: Sperrbildschirm
   ============================================================= */
.lock-screen {
  position: fixed; inset: 0; z-index: 9999; background: var(--asphalt);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(24px + var(--safe-t)) 28px calc(24px + var(--safe-b));
}
.lock-screen img { border-radius: 18px; margin-bottom: 18px; }
.lock-screen h1 { font-family: var(--display); font-size: 34px; margin: 0 0 10px; }
.lock-screen p { color: var(--chalk-dim); margin: 0 0 10px; max-width: 360px; }
.lock-screen .lock-reason { color: var(--chalk); }
.lock-screen a { color: var(--signal); }

/* =============================================================
   Version 10.1: Ausgleich für iOS-26-Lücke unten (siehe fixViewportGap in app.js)
   ============================================================= */
:root { --vp-gap: 0px; }
.tabbar { bottom: calc(-1 * var(--vp-gap)); }
#mapView { bottom: calc(var(--tab-h) + var(--safe-bar) - var(--vp-gap)); }
.sheet { bottom: calc(-1 * var(--vp-gap)); }
.toast { bottom: calc(var(--tab-h) + var(--safe-bar) + 14px - var(--vp-gap)); }
body:has(.sheet:not([hidden])) .toast { bottom: calc(18px + var(--safe-b) - var(--vp-gap)); }
/* Absicherung: Fläche unter der Leiste in ihrer Farbe füllen, falls doch eine Lücke bleibt */
.tabbar::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 120px;
  background: var(--asphalt-2); pointer-events: none;
}
.sheet--small > .sheet-inner { box-shadow: 0 120px 0 0 var(--asphalt-2); }
