/*
 * Cluvico Web-App – Grundlagen, Hülle und gemeinsame Bausteine.
 * Farben, Radien und Abstände kommen aus der App (lib/theme/app_theme.dart,
 * lib/theme/chat_bubbles_colour.dart, lib/widgets/home_navigation_bar.dart).
 * Vor dem Login gilt wie in der App immer die Palette „Sunset“.
 * Seiten-spezifische Regeln liegen in page-*.css.
 */

/* ---------- Tokens: Dunkel (Standard) ---------- */
:root {
  color-scheme: dark;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --accent-1: #FF3B8E;
  --accent-2: #FFB020;
  --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --accent-solid: #FF7A00;
  --on-accent: #FFFFFF;
  /* Verlauf für Text: dunkel wie die Flächen, hell kräftiger (Lesbarkeit). */
  --accent-text-gradient: var(--accent-gradient);
  --focus-ring: #FF7A00;
  --accent-tint: linear-gradient(135deg, rgba(255, 59, 142, .24), rgba(255, 176, 32, .24));
  --accent-tint-border: linear-gradient(135deg, rgba(255, 59, 142, .60), rgba(255, 176, 32, .60));

  --bg: #000000;
  --page-gradient: linear-gradient(180deg, #050509 0%, #08080C 50%, #000000 100%);
  --surface: #0B0B0B;
  --surface-soft: #141414;
  --text: #FFFFFF;
  --text-2: rgba(255, 255, 255, .70);
  --text-3: rgba(255, 255, 255, .595);
  --border: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .07);
  --input-fill: #101010;
  --quiet-fill: rgba(255, 255, 255, .12);
  --overlay: rgba(0, 0, 0, .54);
  --danger: #FF5252;
  --success: #4CAF50;
  --skeleton: rgba(255, 255, 255, .07);
  --skeleton-shine: rgba(255, 255, 255, .13);
  --placeholder: linear-gradient(160deg, #1A1A1F 0%, #0E0E12 100%);

  --ring-unseen: linear-gradient(135deg, #E9548F, #F0443C, #FFA53D);

  --glass-blur: 12px;
  --nav-glass: linear-gradient(180deg, rgba(29, 32, 35, .58), rgba(18, 22, 25, .50), rgba(16, 20, 22, .58));
  --nav-surface: #121619;
  --nav-border: rgba(255, 255, 255, .16);
  --nav-selection: rgba(255, 255, 255, .22);
  --nav-shadow: 0 4px 16px rgba(0, 0, 0, .28);
  --glass-btn: rgba(0, 0, 0, .65);
  --glass-btn-border: rgba(255, 255, 255, .18);
  --header-fade: linear-gradient(180deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .86) 78%, rgba(0, 0, 0, 0) 100%);
  --media-pill: rgba(0, 0, 0, .40);
  --media-pill-border: rgba(255, 255, 255, .18);
  --sheet-bg: #0B0B0B;
  --sheet-edge: rgba(255, 255, 255, .16);
  --sheet-handle: rgba(255, 255, 255, .22);
  --wall-backdrop: rgba(0, 0, 0, .58);

  --r-pill: 999px;
  --r-button: 16px;
  --r-input: 18px;
  --r-dialog: 22px;
  --r-sheet: 26px;
  --r-media: 20px;
  --gutter: 16px;
  --section-gap: 26px;
  --col: 480px;
  --col-wide: 600px;
  --rail-w: 320px;
  --sidebar-w: 0px;
  --tabbar-h: 60px;
  --tabbar-space: calc(var(--tabbar-h) + 16px + max(16px, env(safe-area-inset-bottom)));
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Tokens: Hell ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --accent-solid: #FF4D8D;
  --accent-text-gradient: linear-gradient(135deg, #C2185B, #A65300);
  --focus-ring: #C2185B;
  --accent-tint: linear-gradient(135deg, rgba(255, 59, 142, .16), rgba(255, 176, 32, .16));
  --bg: #F7F7F7;
  --page-gradient: linear-gradient(180deg, #FFFFFF, #F7F7F7);
  --surface: #FFFFFF;
  --surface-soft: #F0F0F0;
  --text: #111111;
  --text-2: #666666;
  --text-3: #6B6B6B;
  --border: rgba(0, 0, 0, .133);
  --line: rgba(0, 0, 0, .125);
  --line-soft: rgba(0, 0, 0, .10);
  --input-fill: #F3F3F3;
  --quiet-fill: rgba(102, 102, 102, .12);
  --overlay: rgba(0, 0, 0, .38);
  --skeleton: rgba(0, 0, 0, .06);
  --skeleton-shine: rgba(0, 0, 0, .10);
  --placeholder: linear-gradient(160deg, #ECECEF 0%, #DCDCE0 100%);
  --nav-glass: linear-gradient(180deg, rgba(245, 247, 247, .58), rgba(245, 247, 247, .50), rgba(221, 222, 222, .58));
  --nav-surface: #F5F7F7;
  --nav-border: rgba(17, 17, 17, .12);
  --nav-selection: rgba(17, 17, 17, .10);
  --nav-shadow: 0 4px 16px rgba(0, 0, 0, .10);
  --glass-btn: rgba(247, 247, 247, .86);
  --glass-btn-border: rgba(17, 17, 17, .18);
  --header-fade: linear-gradient(180deg, rgba(247, 247, 247, .94) 0%, rgba(247, 247, 247, .86) 78%, rgba(247, 247, 247, 0) 100%);
  --sheet-bg: #FFFFFF;
  --sheet-edge: rgba(0, 0, 0, .08);
  --sheet-handle: rgba(102, 102, 102, .22);
  --wall-backdrop: rgba(0, 0, 0, .42);
}

/* Ohne JavaScript setzt niemand data-theme: dann gilt die Systemeinstellung. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #F7F7F7;
    --page-gradient: linear-gradient(180deg, #FFFFFF, #F7F7F7);
    --surface: #FFFFFF;
    --text: #111111;
    --text-2: #666666;
    --text-3: #6B6B6B;
    --line: rgba(0, 0, 0, .125);
    --accent-text-gradient: linear-gradient(135deg, #C2185B, #A65300);
    --focus-ring: #C2185B;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  background: var(--page-gradient) fixed, var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html.wall-open,
html.wall-open body { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button,
input,
select,
textarea { font: inherit; color: inherit; }
button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.cv-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

.noscript {
  max-width: 480px;
  margin: 0 auto;
  padding: 72px 24px;
  text-align: center;
}
.noscript__brand { font-size: 30px; font-weight: 900; letter-spacing: 2px; margin-bottom: 18px; }
.noscript h1 { font-size: 22px; margin-bottom: 10px; }
.noscript p { color: var(--text-2); margin-bottom: 12px; }
.noscript a { text-decoration: underline; color: var(--text); }
.noscript__links { font-size: 13px; }

/* ---------- Symbole ---------- */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}
.icon--stroke {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--accent { fill: url(#cv-accent); }
.icon--stroke.icon--accent { fill: none; stroke: url(#cv-accent); }

.text-accent {
  background: var(--accent-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Hülle ---------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
}

.layout {
  display: flex;
  justify-content: center;
  gap: 56px;
  padding-left: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
}

.main {
  flex: 0 1 var(--col);
  min-width: 0;
  width: 100%;
  max-width: var(--col);
  padding-bottom: var(--tabbar-space);
}
.main:focus { outline: none; }
.layout.is-wide .main { max-width: var(--col-wide); flex-basis: var(--col-wide); }
.layout.is-full .main { max-width: none; flex: 1 1 auto; padding-bottom: 0; }
.layout.is-full .rail { display: none; }

.boot { min-height: 60vh; }

.page {
  position: relative;
  min-height: 100%;
}

/* ---------- Seitenkopf wie LiquidGlassAppBar ---------- */
.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) 8px 6px var(--gutter);
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -14px;
  z-index: -1;
  background: var(--header-fade);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.page-header.is-scrolled::before { opacity: 1; }
.page-header__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-header__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

/* Runder Glas-Knopf (feed_header_action_surface.dart) */
.glass-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text);
}
.glass-btn--solid,
.page-header.is-scrolled .glass-btn {
  background: var(--glass-btn);
  border: 1px solid var(--glass-btn-border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.glass-btn .icon { width: 25px; height: 25px; }
.glass-btn__badge {
  position: absolute;
  right: 4px;
  top: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  border: 1.2px solid var(--bg);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 15.6px;
  text-align: center;
}
/* Ab Tablet übernimmt die Seitenleiste den Kopf: nur noch für Screenreader (h1 bleibt). */
@media (min-width: 768px) {
  .page-header--mobile-only {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .page-header--mobile-only .page-header__actions { display: none; }
}

/* ---------- Seitenleiste (Desktop/Tablet) ---------- */
.sidebar { display: none; }

@media (min-width: 768px) {
  :root { --sidebar-w: 76px; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    padding: 22px 12px 18px;
    border-right: 1px solid var(--line-soft);
    background: var(--bg);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
}
@media (min-width: 1264px) {
  :root { --sidebar-w: 244px; }
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 10px;
  margin-bottom: 18px;
  border-radius: 14px;
}
.sidebar__logo {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: #070707;
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 3px;
  object-fit: contain;
}
:root[data-theme="light"] .sidebar__logo { border-color: rgba(0, 0, 0, .10); }
.sidebar__wordmark {
  display: none;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 1.6px;
}
.sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 500;
  text-align: left;
  transition: background-color .15s ease;
}
.sidebar__item:hover { background: var(--line-soft); }
.sidebar__item .icon { width: 27px; height: 27px; color: var(--text-2); }
.sidebar__item.is-active { font-weight: 800; }
.sidebar__item.is-active .icon { fill: url(#cv-accent); color: inherit; }
.sidebar__label { display: none; }
.sidebar__spacer { flex: 1 1 auto; }

@media (min-width: 1264px) {
  .sidebar { padding: 26px 14px 20px; }
  .sidebar__wordmark,
  .sidebar__label { display: inline; }
}

/* ---------- Untere Leiste (Mobil), schwebende Glas-Kapsel ---------- */
.tabbar {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: max(16px, calc(env(safe-area-inset-bottom) - 12px));
  z-index: 50;
  height: var(--tabbar-h);
  border-radius: 30px;
  padding: 0 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: var(--nav-surface);
  background: var(--nav-glass);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  transform-origin: 50% 100%;
  transition: transform .25s var(--ease-out);
  max-width: 520px;
  margin: 0 auto;
}
.tabbar.is-compact { transform: scale(.84); }
.tabbar__pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 25px;
  background: var(--nav-selection);
  pointer-events: none;
}
.tabbar.is-ready .tabbar__pill {
  transition: transform .18s cubic-bezier(.33, 1, .68, 1), width .18s cubic-bezier(.33, 1, .68, 1);
}
.tabbar__item {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 50px;
  color: var(--text-2);
}
.tabbar__item .icon { width: 27px; height: 27px; }
.tabbar__item.is-active .icon { fill: url(#cv-accent); }
.tabbar__item.is-active .avatar { box-shadow: 0 0 0 2px var(--accent-1), 0 0 0 2px var(--accent-2); }

@media (min-width: 768px) {
  .tabbar { display: none; }
  :root { --tabbar-space: 48px; }
}

/* ---------- Rechte Spalte (breiter Desktop) ---------- */
.rail { display: none; }
@media (min-width: 1160px) {
  .rail {
    display: block;
    flex: 0 0 var(--rail-w);
    width: var(--rail-w);
    padding: 36px 0 32px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
}
.rail__section + .rail__section { margin-top: 28px; }
.rail__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-2);
}
.rail__heading a { color: var(--text); font-size: 12.5px; font-weight: 700; }
.rail__event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  width: 100%;
  text-align: left;
}
.rail__thumb {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 12px;
  background: var(--placeholder);
  object-fit: cover;
}
.rail__meta { display: block; flex: 1 1 auto; min-width: 0; }
.rail__title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail__sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail__app {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rail__app-text { font-size: 13.5px; color: var(--text-2); line-height: 1.4; }
.rail__app-text strong { display: block; color: var(--text); font-size: 14px; }
.rail__qr {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
}

/* Fußzeile mit Rechtslinks (Rail und Mehr-Menü) */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--text-3);
}
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.legal-note { margin-top: 12px; font-size: 12px; color: var(--text-3); }

/* ---------- Knöpfe ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 13px 20px;
  border-radius: var(--r-button);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: transform .12s ease, opacity .15s ease;
}
.btn:active { transform: scale(.985); }
.btn--block { display: flex; width: 100%; }
.btn--primary {
  color: var(--on-accent);
  background: var(--accent-gradient);
}
.btn--social {
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.btn--social:hover { border-color: var(--border); background: var(--quiet-fill); }
.btn--outline {
  color: var(--text);
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--accent-gradient) border-box;
}
.btn--small {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 800;
}
.btn__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  object-fit: contain;
}
.btn__icon.icon { color: var(--text); }

.link-btn {
  display: inline;
  font-weight: 900;
  padding: 2px 0;
}

/* ---------- Pillen und Filter ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 7px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  background: var(--media-pill);
  border: 1px solid var(--media-pill-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill .icon { width: 15px; height: 15px; }

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--gutter);
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-2);
  background: var(--quiet-fill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip .icon { width: 17px; height: 17px; }
.chip.is-active {
  color: var(--text);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    var(--accent-tint-border) border-box;
}
.chip.is-active > span {
  background: var(--accent-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chip.is-active .icon { fill: url(#cv-accent); }

/* Filter-Pille über die volle Breite (filter_ui.dart) */
.filter-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    var(--accent-tint-border) border-box;
}
.filter-pill .icon { width: 20px; height: 20px; fill: url(#cv-accent); }

/* Umschalter „Events | Clubs“ */
.segmented {
  display: inline-flex;
  flex: none;
  height: 34px;
  padding: 3px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
}
:root[data-theme="light"] .segmented {
  background: rgba(255, 255, 255, .42);
  border-color: rgba(0, 0, 0, .10);
}
.segmented__item {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-2);
}
.segmented__item.is-active {
  color: var(--on-accent);
  background: var(--accent-gradient);
}

/* Suchfeld (app_search_decoration.dart) */
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--quiet-fill);
  color: var(--text-2);
  font-size: 14.5px;
}
.search-field .icon { width: 19px; height: 19px; }
.search-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--text);
}
.search-field input::placeholder { color: var(--text-2); }

/* ---------- Avatare ---------- */
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--placeholder);
  color: var(--text-2);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .icon { width: 58%; height: 58%; }
.avatar--initial {
  font-weight: 900;
  color: #fff;
  background: var(--accent-gradient);
}
.avatar-ring {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  padding: 3px;
  background: var(--ring-unseen);
}
.avatar-ring > .avatar { box-shadow: 0 0 0 2px var(--bg); }
.avatar-ring--accent { background: var(--accent-gradient); }
.avatar-ring--seen { background: var(--line); padding: 1.5px; }

/* ---------- Platzhalter beim Laden ---------- */
.sk {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--skeleton);
  border-radius: 8px;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  animation: sk-shine 1.6s ease-in-out infinite;
}
.sk--circle { border-radius: 50%; }
.sk--line { height: 12px; border-radius: 6px; }
.sk--pill { height: 36px; border-radius: var(--r-pill); }
@keyframes sk-shine { to { transform: translateX(100%); } }

/* ---------- Leere Zustände (EmptyStateIllustration) ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px 24px;
}
.empty__art {
  width: min(260px, 70%);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 16px;
}
.empty__title { font-size: 17px; font-weight: 800; }
.empty__text { margin-top: 6px; font-size: 14px; color: var(--text-2); max-width: 320px; }
.empty .btn { margin-top: 18px; }

/* ---------- Abschnittsüberschrift (flat_page_chrome.dart) ---------- */
.section { padding: 0 var(--gutter); margin-top: var(--section-gap); }
.section__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 122, 0, .16);
}
:root[data-theme="light"] .section__icon { background: rgba(255, 77, 141, .12); }
.section__icon .icon { width: 17px; height: 17px; fill: url(#cv-accent); }
.section__title { font-size: 17px; font-weight: 800; }
.section__sub { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }

/* ---------- Mehr-Menü (Popover) ---------- */
.menu {
  position: fixed;
  z-index: 60;
  min-width: 260px;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.menu[hidden] { display: none; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
}
.menu__item:hover { background: var(--line-soft); }
.menu__item .icon { width: 21px; height: 21px; color: var(--text-2); }
.menu__sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }
.menu__legal { padding: 8px 12px 6px; }

/* ---------- Hinweis-Leiste (Snackbar) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-space) + 4px);
  z-index: 70;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  transform: translate(-50%, 0);
  animation: toast-in .22s var(--ease-out);
}
/* Liegt unten ein schwebender Knopf (Event-Seite), die Leiste darüber zeigen. */
html.has-floating-action .toast { bottom: calc(var(--tabbar-space) + 84px); }
@media (min-width: 768px) {
  html.has-floating-action .toast { bottom: 110px; }
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Login-Hinweis (Wall) ---------- */
dialog.wall {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-dialog);
  background: var(--sheet-bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: contain;
}
dialog.wall[open] { display: flex; flex-direction: column; }
dialog.wall::backdrop {
  background: var(--wall-backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
dialog.wall[open] { animation: wall-in .32s var(--ease-out); }
@keyframes wall-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }

.wall__scroll {
  overflow-y: auto;
  padding: 26px 24px 18px;
}
.wall__handle { display: none; }
/* Schließen nur beim Gast-Hinweis (wall--hint); das Pflicht-Fenster hat keinen Knopf. */
.wall__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  color: var(--text-2);
}
.wall__close .icon { width: 22px; height: 22px; }
.wall__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.wall__badge {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #070707;
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 10px;
  object-fit: contain;
}
:root[data-theme="light"] .wall__badge { border-color: rgba(0, 0, 0, .10); }
.wall__wordmark {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
}
.wall__title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}
.wall__title:focus { outline: none; }
.wall__sub {
  margin: 8px auto 0;
  max-width: 330px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
}
.wall__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
.wall__switch {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--text-2);
  text-align: center;
}
.wall__terms {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
  text-align: center;
}
.wall__terms a { color: var(--text-2); text-decoration: underline; }
.wall__footer {
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
}
.wall__footer .legal-links { justify-content: center; }
.wall__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 10px -6px;
  padding: 6px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}
.wall__back .icon { width: 18px; height: 18px; }
.wall__qr {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.wall__qr img {
  width: 108px;
  height: 108px;
  flex: none;
  border-radius: 14px;
  background: #fff;
  padding: 6px;
}
.wall__qr p { font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.wall__qr strong { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 2px; }
.wall__hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}
.wall__preview {
  margin-top: 14px;
  width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-3);
  text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
  .only-touch { display: none !important; }
}
@media not all and (hover: hover) and (pointer: fine) {
  .only-desktop { display: none !important; }
}

/* Auf dem Handy als Sheet von unten (wie die Bottom-Sheets der App). */
@media (max-width: 559px) {
  dialog.wall {
    width: 100%;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    border-width: 1px 0 0;
    border-color: var(--sheet-edge);
  }
  dialog.wall[open] { animation-name: sheet-in; }
  .wall__handle {
    display: block;
    width: 44px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--sheet-handle);
    flex: none;
  }
  .wall__scroll { padding: 16px 20px 16px; }
  .wall__brand { margin-bottom: 14px; }
  .wall__badge { width: 60px; height: 60px; padding: 8px; }
  .wall__wordmark { font-size: 26px; }
  .wall__title { font-size: 20px; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

/* Fallback ohne <dialog>.showModal (sehr alte Browser): trotzdem fest über der Seite. */
dialog.wall.wall--inline {
  position: fixed;
  inset: 0;
  z-index: 1000;
  height: fit-content;
  margin: auto;
}
@media (max-width: 559px) {
  dialog.wall.wall--inline { inset: auto 0 0 0; margin: 0; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   Phase 2: Formulare, Sheets, Dialoge (gemeinsam für alle Seiten)
   ===================================================================== */

/* Eingabefelder wie auth_ui.dart (Radius 18, Fläche inputFill, Fokus mit Verlaufsrand) */
.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field__row { position: relative; display: flex; align-items: center; }
.field__input,
.field__textarea,
.field__select {
  width: 100%;
  min-height: 50px;
  padding: 14px 16px;
  border-radius: var(--r-input);
  border: 1px solid var(--line-soft);
  background: var(--input-fill);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color .15s ease;
}
.field__textarea { min-height: 110px; resize: vertical; line-height: 1.45; font-weight: 500; }
.field__input::placeholder,
.field__textarea::placeholder { color: var(--text-3); font-weight: 500; }
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  border-color: transparent;
  background:
    linear-gradient(var(--input-fill), var(--input-fill)) padding-box,
    var(--accent-gradient) border-box;
  border-width: 1.5px;
}
.field__row .field__input { padding-right: 52px; }
.field__toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--text-2);
}
.field__hint { font-size: 12.5px; color: var(--text-3); }
.field__hint.is-ok { color: var(--success); }
.field__hint.is-bad { color: var(--danger); }

.form-error,
.wall__error {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 82, 82, .12);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
}
.form-note { font-size: 13px; color: var(--text-2); line-height: 1.45; }

.wall__form { display: grid; gap: 14px; margin-top: 18px; }
.wall__form .wall__actions { margin-top: 4px; }
.wall__forgot { justify-self: end; font-size: 13px; font-weight: 700; color: var(--text-2); }
.wall__app { margin-top: 10px; font-size: 12.5px; color: var(--text-3); text-align: center; }
.wall__app a { color: var(--text-2); text-decoration: underline; }
.is-busy { opacity: .7; pointer-events: none; }

/* Schalter (palette_gradient.dart: 51×31, an = Verlauf) */
.switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  border-radius: 15.5px;
  background: rgba(255, 255, 255, .16);
  transition: background .2s ease;
}
:root[data-theme="light"] .switch { background: rgba(0, 0, 0, .12); }
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  transition: transform .2s var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--accent-gradient); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* Auswahl-Kreis (SelectionCircle) */
.sel-circle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .45);
  color: #fff;
}
:root[data-theme="light"] .sel-circle { border-color: rgba(0, 0, 0, .28); }
.sel-circle.is-on { border-color: transparent; background: var(--accent-gradient); }
.sel-circle .icon { width: 16px; height: 16px; }

/* Flache Zeilen (Einstellungen, Listen): 16 Rand, Symbol in 40er-Spalte, 14 Abstand */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 8px var(--gutter);
  text-align: left;
  color: var(--text);
}
.row__icon { display: grid; place-items: center; width: 40px; flex: none; color: var(--text-2); }
.row__text { flex: 1 1 auto; min-width: 0; }
.row__title { display: block; font-size: 15px; font-weight: 600; }
.row__sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.row__end { flex: none; color: var(--text-3); }
.row--danger, .row--danger .row__icon { color: var(--danger); }
@media (hover: hover) and (pointer: fine) {
  a.row:hover, button.row:hover { background: var(--line-soft); }
}

/* Sheet von unten / Dialog in der Mitte (deckend, wie die App-Sheets) */
dialog.sheet {
  width: min(560px, 100vw);
  max-width: none;
  max-height: min(86dvh, 820px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-dialog);
  background: var(--sheet-bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: contain;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: wall-in .28s var(--ease-out); }
dialog.sheet::backdrop { background: var(--overlay); }
.sheet__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 6px 8px 6px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet__title { flex: 1 1 auto; font-size: 15.5px; font-weight: 900; }
.sheet__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.sheet__foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); }
dialog.sheet--full { width: min(980px, 100vw); height: min(92dvh, 900px); }
@media (max-width: 559px) {
  dialog.sheet {
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    border-width: 1px 0 0;
    border-color: var(--sheet-edge);
  }
  dialog.sheet[open] { animation-name: sheet-in; }
  dialog.sheet--full { height: 100dvh; max-height: 100dvh; border-radius: 0; }
}

/* Bestätigungs-Dialog (PaletteDialog) */
dialog.confirm {
  width: min(380px, calc(100vw - 32px));
  padding: 22px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-dialog);
  background: var(--surface);
  color: var(--text);
}
dialog.confirm::backdrop { background: var(--overlay); }
.confirm__title { font-size: 18px; font-weight: 800; }
.guest-age .confirm__title:focus { outline: none; }
.confirm__text { margin-top: 8px; font-size: 14.5px; line-height: 1.4; color: var(--text-2); }
.confirm__actions { display: flex; gap: 10px; margin-top: 18px; }
.confirm__actions .btn { flex: 1 1 0; min-height: 46px; }
.btn--danger { color: #fff; background: var(--danger); }

/* Medien, die noch laden */
img.is-pending { opacity: 0; }
img.is-broken { visibility: hidden; }

/* Anmelde- und Pflichtseiten: ohne Navigation, ganze Breite (wie die Login-Seite der App) */
html.is-bare .sidebar,
html.is-bare .tabbar,
html.is-bare .rail { display: none !important; }
html.is-bare .layout { padding-left: 0; }
html.is-bare .main { padding-bottom: 32px; }

.menu__group:empty { display: none; }

/* Zähler an Navigationspunkten (Herz-Badge der App; Chat = Punkt) */
.sidebar__item, .tabbar__item { position: relative; }
.nav-badge {
  position: absolute;
  top: 6px;
  left: 30px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  border: 1.2px solid var(--bg);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 15.6px;
  text-align: center;
}
.tabbar__item .nav-badge { top: 8px; left: calc(50% + 6px); }
.nav-badge--dot { min-width: 8px; width: 8px; height: 8px; padding: 0; border: 0; top: 10px; }
:root[data-theme="light"] .nav-badge--dot { background: #FF5252; }

/* hidden-Attribut gilt immer (Klassen wie .btn setzen sonst display) */
[hidden] { display: none !important; }
