/* Shared overlays — toast + confirm modal (Night Atelier tokens). */

/* Legacy inline flash banners — toast bridge owns attention feedback. */
.ui-flash-toasts-active .admin-flash,
.ui-flash-toasts-active .ui-flash,
.ui-flash-toasts-active .admin-page-builder__flash,
.ui-flash-toasts-active .admin-page-builder__error,
.ui-flash-toasts-active .form-success--toasted {
  display: none !important;
}

.toast-host {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 1100;
  display: grid;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-lift);
}

.toast__row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.toast__icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-on-accent);
  background: var(--color-accent);
}

.toast__body {
  flex: 1 1 auto;
  min-width: 0;
}

.toast__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.toast__message {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.toast__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem;
}

.toast__action {
  justify-self: end;
  margin-block-start: 0.25rem;
}

.toast--success .toast__icon {
  background: var(--color-success);
  color: #fff;
}

.toast--error .toast__icon {
  background: var(--color-danger);
  color: #fff;
}

.toast--warning .toast__icon {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.toast--info .toast__icon {
  background: var(--color-muted);
  color: var(--color-surface);
}

.toast--error {
  border-color: color-mix(in srgb, var(--color-danger) 45%, var(--color-border));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: color-mix(in srgb, var(--color-theater-bg) 55%, transparent);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden],
.modal-backdrop[hidden] {
  display: none !important;
}

.modal__dialog {
  width: min(28rem, 100%);
  padding: 1.25rem 1.2rem 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.modal__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: color-mix(in srgb, var(--color-muted) 12%, transparent);
}

.modal__dialog--danger .modal__icon {
  background: color-mix(in srgb, var(--color-danger) 14%, transparent);
  color: var(--color-danger);
}

.modal__dialog--warning .modal__icon {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  color: var(--color-accent);
}

.modal__dialog--success .modal__icon {
  background: color-mix(in srgb, var(--color-success) 16%, transparent);
  color: var(--color-success);
}

.modal__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.modal__message {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-block-start: 1.1rem;
}

.modal__actions .btn {
  min-width: 6.5rem;
}

.modal__dialog--danger .modal__confirm {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

html.site-nav-open,
html.ui-modal-open {
  overflow: hidden;
}
