/* ═══════════════════════════════════════════════════════════
   MODAL & TOAST — Overlay Components
   GeniusHub v21 — Redesign
   Ruhig, kein Glassmorphism.
   ═══════════════════════════════════════════════════════════ */

/* ── Edit Modal Backdrop ── */
#em {
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: rgba(0, 0, 0, .55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: emFade .18s var(--ease) both;
}
#em.on { display: flex; }
@keyframes emFade {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* ── Modal Box ── */
.em-box {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 22px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: emSlideUp .22s var(--ease) both;
  color: var(--fg);
  font-family: var(--f-sans);
}
@keyframes emSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 600px) {
  #em { align-items: center; padding: 20px; }
  .em-box {
    border-radius: var(--r-lg);
    border-bottom: 1px solid var(--line);
    max-height: 80vh;
    box-shadow: 0 24px 48px rgba(0, 0, 0, .35);
  }
}

html.white-mode .em-box {
  box-shadow: 0 24px 48px rgba(15, 23, 42, .12);
}


/* ── Toast Notification ── */
#toast {
  position: fixed;
  bottom: calc(14px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 16px;
  font-size: 12px;
  color: var(--fg);
  z-index: 99999;
  opacity: 0;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  pointer-events: none;
  white-space: nowrap;
  font-weight: 500;
  font-family: var(--f-sans);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}
#toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
html.white-mode #toast {
  box-shadow: 0 12px 24px rgba(15, 23, 42, .12);
}
#toast.toast-ok { color: var(--ok); border-color: color-mix(in oklab, var(--ok) 30%, var(--line)); }
#toast.toast-err { color: var(--err); border-color: color-mix(in oklab, var(--err) 30%, var(--line)); }
