@import url("tokens.css");

/* ==========================================================================
   VoiceLove – Basis
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  background-image: var(--grad-stage);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }

/* Eigene display-Werte dürfen [hidden] nicht aushebeln – sonst blitzen
   Dialoge und Overlays beim Laden kurz auf oder bleiben sichtbar. */
[hidden] { display: none !important; }

input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: rgba(255, 92, 138, 0.32); color: var(--text); }

/* Scrollbars dezent halten */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-full);
}

/* ==========================================================================
   Typografie
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 680;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(1.75rem, 1.3rem + 2.2vw, var(--fs-3xl)); }
h2 { font-size: clamp(1.375rem, 1.1rem + 1.4vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); font-weight: 640; }

p { text-wrap: pretty; }

.display {
  font-size: clamp(2.5rem, 1.4rem + 5.2vw, var(--fs-5xl));
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-soft);
}

.eyebrow {
  font-size: var(--fs-2xs);
  font-weight: 640;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.strong { font-weight: 640; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }

/* ==========================================================================
   Layout
   ========================================================================== */

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

.shell--narrow { max-width: var(--content-max); }
.shell--wide { max-width: 1360px; }

.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-6); }
.stack-xl > * + * { margin-top: var(--s-8); }

.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.row--between { justify-content: space-between; }
.row--center { justify-content: center; }
.row--top { align-items: flex-start; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

.grid { display: grid; gap: var(--s-4); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.app-body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-main {
  flex: 1 1 auto;
  padding-top: calc(var(--header-height) + var(--safe-top) + var(--s-4));
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--s-8));
}

@media (min-width: 900px) {
  .app-main {
    padding-bottom: var(--s-10);
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.page-head__title { display: grid; gap: var(--s-1); }

/* ==========================================================================
   Kopfzeile
   ========================================================================== */

.appbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  height: calc(var(--header-height) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.appbar__inner {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.brand__mark { color: var(--accent); }

.brand-glyph {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--grad-brand);
  box-shadow: var(--shadow-accent);
  color: #fff;
  flex: none;
}

/* ==========================================================================
   Untere Navigation (mobil)
   ========================================================================== */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-nav);
  padding-bottom: var(--safe-bottom);
  background: var(--surface-glass-strong);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border-top: 1px solid var(--line);
}

.tabbar__inner {
  max-width: 560px;
  margin-inline: auto;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
}

.tab {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: var(--s-2) var(--s-1);
  font-size: var(--fs-2xs);
  font-weight: 560;
  color: var(--text-faint);
  transition: color var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.tab__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  transition: transform var(--dur-base) var(--ease-spring);
}

.tab:hover { color: var(--text-soft); }
.tab.is-active { color: var(--accent); }
.tab.is-active .tab__icon { transform: translateY(-2px) scale(1.06); }

.tab.is-active::before {
  content: "";
  position: absolute;
  top: 4px;
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  animation: tabPop var(--dur-base) var(--ease-spring);
}

.tab__badge {
  position: absolute;
  top: -2px; right: -6px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--surface-1);
  border-radius: var(--r-full);
  animation: badgeIn var(--dur-base) var(--ease-spring);
}

@media (min-width: 900px) {
  .tabbar {
    inset: auto auto 0 0;
    width: 100%;
  }
  .tabbar__inner { max-width: 620px; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 46px;
  padding: 0 var(--s-6);
  font-size: var(--fs-base);
  font-weight: 620;
  letter-spacing: var(--tracking-snug);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}

.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active { transform: scale(0.972); }

.btn[disabled],
.btn.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.btn--primary {
  color: var(--text-on-accent);
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover {
  background: var(--grad-brand);
  filter: brightness(1.07);
  box-shadow: 0 22px 52px rgba(237, 61, 114, 0.42);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--surface-2); }

.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  padding-inline: var(--s-3);
}
.btn--quiet:hover { color: var(--text); background: var(--surface-2); }

.btn--danger {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
}
.btn--danger:hover { filter: brightness(1.08); background: var(--danger); }

.btn--credit {
  color: #26170a;
  background: var(--grad-credit);
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(255, 180, 87, 0.3);
}

.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding-inline: var(--s-4); font-size: var(--fs-sm); }
.btn--lg { min-height: 54px; padding-inline: var(--s-8); font-size: var(--fs-md); }

.btn--icon {
  width: 46px;
  padding: 0;
  flex: none;
}
.btn--icon.btn--sm { width: 36px; }
.btn--icon.btn--lg { width: 54px; }

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--r-full);
  animation: spin 720ms linear infinite;
}
.btn.is-loading > * { opacity: 0; }

/* ==========================================================================
   Karten und Flächen
   ========================================================================== */

.card {
  position: relative;
  padding: var(--s-6);
  background: var(--surface-1);
  background-image: var(--grad-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card--flush { padding: 0; overflow: hidden; }
.card--glass {
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}
.card--accent {
  border-color: var(--line-accent);
  box-shadow: var(--glow-accent);
}

.card--interactive {
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.card--interactive:active { transform: translateY(-1px) scale(0.995); }

.panel {
  padding: var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin-block: var(--s-5);
}

.section-label {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  font-size: var(--fs-xs);
  font-weight: 640;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ==========================================================================
   Chips, Badges, Pills
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 34px;
  padding: 0 var(--s-4);
  font-size: var(--fs-sm);
  font-weight: 560;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }

.chip.is-selected,
.chip[aria-pressed="true"] {
  color: var(--text-on-accent);
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(237, 61, 114, 0.28);
}

.chip--static { cursor: default; }
.chip--static:hover { border-color: var(--line); color: var(--text-soft); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--s-3);
  font-size: var(--fs-2xs);
  font-weight: 660;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-soft);
}
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--credit { background: var(--warning-soft); color: var(--credit); }

.dot {
  width: 7px; height: 7px;
  border-radius: var(--r-full);
  background: var(--text-faint);
  flex: none;
}
.dot--live { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot--accent { background: var(--accent); }

/* ==========================================================================
   Formulare
   ========================================================================== */

.field { display: grid; gap: var(--s-2); }

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-soft);
}

.field__hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: var(--lh-snug);
}

.field__error {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xs);
  font-weight: 560;
  color: var(--danger);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-md);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
  appearance: none;
}

.input::placeholder,
.textarea::placeholder { color: var(--text-faint); }

.input:hover,
.textarea:hover,
.select:hover { border-color: var(--line-strong); }

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface-3);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-normal); }

.select {
  padding-right: var(--s-9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a90ac' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s-4) center;
}

.input-group { position: relative; }
.input-group .input { padding-right: var(--s-11); }
.input-group__action {
  position: absolute;
  right: var(--s-2);
  top: 50%;
  transform: translateY(-50%);
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-sm);
}
.input-group__action:hover { color: var(--text); background: var(--surface-3); }

/* Checkbox / Radio */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  margin-inline: calc(var(--s-3) * -1);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.check:hover { background: var(--surface-2); }

.check input[type="checkbox"],
.check input[type="radio"] {
  flex: none;
  width: 21px; height: 21px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}

.check__text { font-size: var(--fs-sm); line-height: var(--lh-snug); color: var(--text-soft); }
.check__text strong { color: var(--text); font-weight: 600; }

/* Umschalter */
.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 46px; height: 27px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch__track {
  width: 100%; height: 100%;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.switch__thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  background: var(--text-muted);
  border-radius: var(--r-full);
  transition: transform var(--dur-base) var(--ease-spring), background var(--dur-base) var(--ease-out);
}
.switch input:checked ~ .switch__track { background: var(--grad-brand); border-color: transparent; }
.switch input:checked ~ .switch__thumb { transform: translateX(19px); background: #fff; }
.switch input:focus-visible ~ .switch__track { box-shadow: 0 0 0 4px var(--accent-soft); }

/* Bereichsregler */
.range {
  width: 100%;
  height: 28px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--r-full);
  background: linear-gradient(to right, var(--accent) var(--range-fill, 50%), var(--surface-3) var(--range-fill, 50%));
}
.range::-moz-range-track {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--surface-3);
}
.range::-moz-range-progress {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--accent);
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  margin-top: -8px;
  border: 3px solid var(--bg);
  border-radius: var(--r-full);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px;
  border: 3px solid var(--bg);
  border-radius: var(--r-full);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.range:active::-webkit-slider-thumb { transform: scale(1.18); }

/* ==========================================================================
   Meldungen
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  animation: slideDown var(--dur-base) var(--ease-out);
}
.alert__icon { flex: none; margin-top: 1px; }
.alert--success { background: var(--success-soft); border-color: rgba(52, 201, 154, 0.3); color: var(--success); }
.alert--error   { background: var(--danger-soft);  border-color: rgba(255, 95, 109, 0.3);  color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: rgba(255, 180, 87, 0.3);  color: var(--warning); }
.alert--info    { background: var(--accent-soft);  border-color: var(--line-accent);       color: var(--accent); }

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--s-4));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: grid;
  gap: var(--s-2);
  width: min(440px, calc(100vw - var(--s-8)));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  font-size: var(--fs-sm);
  font-weight: 560;
  color: var(--text);
  background: var(--surface-glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--dur-slow) var(--ease-spring);
}
.toast.is-leaving { animation: toastOut var(--dur-base) var(--ease-in-out) forwards; }
.toast--success { border-color: rgba(52, 201, 154, 0.4); }
.toast--error { border-color: rgba(255, 95, 109, 0.4); }

/* ==========================================================================
   Leere Zustände
   ========================================================================== */

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  padding: var(--s-10) var(--s-5);
  text-align: center;
}

.empty__art {
  position: relative;
  width: 128px; height: 128px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--grad-brand-soft);
  color: var(--accent);
}
.empty__art::before,
.empty__art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--line-accent);
  animation: ripple 3.4s var(--ease-out) infinite;
}
.empty__art::after { animation-delay: 1.2s; }

.empty__title { font-size: var(--fs-xl); font-weight: 660; }
.empty__text { max-width: 40ch; color: var(--text-muted); line-height: var(--lh-relaxed); }
.empty__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; margin-top: var(--s-2); }

/* ==========================================================================
   Skelette und Ladezustände
   ========================================================================== */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 1.5s infinite;
}
.skeleton--text { height: 12px; margin-block: 6px; }
.skeleton--title { height: 22px; width: 58%; }
.skeleton--circle { border-radius: var(--r-full); }
.skeleton--card { height: 200px; border-radius: var(--r-lg); }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: var(--r-full);
  animation: spin 700ms linear infinite;
}

/* ==========================================================================
   Modale und Bottom Sheets
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--s-4);
  background: rgba(6, 4, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn var(--dur-base) var(--ease-out);
}
.overlay[hidden] { display: none !important; }
.overlay.is-closing { animation: fadeOut var(--dur-fast) var(--ease-in-out) forwards; }

.modal {
  width: min(480px, 100%);
  max-height: min(86dvh, 720px);
  overflow-y: auto;
  padding: var(--s-7);
  background: var(--surface-1);
  background-image: var(--grad-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  animation: modalIn var(--dur-slow) var(--ease-spring);
}
.overlay.is-closing .modal { animation: modalOut var(--dur-fast) var(--ease-in-out) forwards; }

.modal__head { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.modal__actions { display: flex; gap: var(--s-3); margin-top: var(--s-6); }
.modal__actions .btn { flex: 1; }

@media (max-width: 560px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-height: 88dvh;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    padding-bottom: calc(var(--s-7) + var(--safe-bottom));
    animation: sheetIn var(--dur-slow) var(--ease-spring);
  }
  .overlay.is-closing .modal { animation: sheetOut var(--dur-base) var(--ease-in-out) forwards; }
  .modal::before {
    content: "";
    display: block;
    width: 38px; height: 4px;
    margin: -8px auto var(--s-5);
    background: var(--line-strong);
    border-radius: var(--r-full);
  }
}

/* ==========================================================================
   Avatare
   ========================================================================== */

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 48px; height: 48px;
  font-size: var(--fs-lg);
  font-weight: 660;
  color: var(--text-on-accent);
  background: var(--grad-brand);
  border-radius: var(--r-full);
  overflow: hidden;
  user-select: none;
}
.avatar--sm { width: 36px; height: 36px; font-size: var(--fs-base); }
.avatar--lg { width: 72px; height: 72px; font-size: var(--fs-2xl); }
.avatar--xl { width: 108px; height: 108px; font-size: var(--fs-3xl); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar--locked {
  background: var(--surface-3);
  color: var(--text-faint);
  border: 1px dashed var(--line-strong);
}

/* ==========================================================================
   Bewegung
   ========================================================================== */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer { 100% { transform: translateX(100%); } }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes modalOut {
  to { opacity: 0; transform: translateY(10px) scale(0.98); }
}

@keyframes sheetIn {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes sheetOut {
  to { transform: translateY(100%); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px) scale(0.96); }
}

@keyframes tabPop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: none; }
}

@keyframes badgeIn {
  from { transform: scale(0); }
  to { transform: none; }
}

@keyframes ripple {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.45); opacity: 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 138, 0.5); }
  70% { box-shadow: 0 0 0 22px rgba(255, 92, 138, 0); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Eintrittsanimation für Listen */
.reveal-in {
  animation: slideUp var(--dur-slow) var(--ease-out) backwards;
}
.reveal-in:nth-child(1) { animation-delay: 0ms; }
.reveal-in:nth-child(2) { animation-delay: 45ms; }
.reveal-in:nth-child(3) { animation-delay: 90ms; }
.reveal-in:nth-child(4) { animation-delay: 135ms; }
.reveal-in:nth-child(5) { animation-delay: 180ms; }
.reveal-in:nth-child(6) { animation-delay: 225ms; }
.reveal-in:nth-child(7) { animation-delay: 270ms; }
.reveal-in:nth-child(8) { animation-delay: 315ms; }

/* Seitenübergang */
@view-transition { navigation: auto; }

.page-enter { animation: pageIn var(--dur-slow) var(--ease-out); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Reduzierte Bewegung respektieren
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .skeleton::after { animation: none; }
  .empty__art::before,
  .empty__art::after { animation: none; opacity: 0; }
}

/* ==========================================================================
   Druck
   ========================================================================== */

@media print {
  .appbar, .tabbar, .toast-stack, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
