.dlg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.dlg-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 24px 20px 20px;
  /* Wide enough for a cancel button next to a long primary one ("Réinitialiser votre
     mot de passe" in the profile view), which used to overflow the box on the left. */
  max-width: 400px;
  width: 100%;
  box-shadow: var(--sh-lg);
}

.dlg-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--t1);
  margin-bottom: 10px;
}

.dlg-msg {
  font-size: 0.875rem;
  color: var(--t2);
  line-height: 1.6;
  margin-bottom: 20px;
  /* Messages are escaped, not HTML: line breaks are the only formatting they can carry. */
  white-space: pre-line;
}

.dlg-btns {
  display: flex;
  /* Buttons never shrink (nowrap labels): on a phone, where the box is narrower than
     its max-width, a pair too wide for one line goes on two rather than out of the box. */
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Action sheet ────────────────────────────────────────────────────── */
.dlg-sheet-overlay {
  align-items: flex-end;
  padding: 0;
  opacity: 0;
  transition: opacity .25s ease;
}

.dlg-sheet-overlay.visible {
  opacity: 1;
}

.dlg-sheet {
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 8px 0 max(16px, var(--sab));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--sh-lg);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.25, .8, .25, 1);
}

.dlg-sheet-overlay.visible .dlg-sheet {
  transform: translateY(0);
}

.dlg-sheet-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--t3);
  text-align: center;
  padding: 8px 20px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.dlg-sheet-item {
  display: block;
  width: 100%;
  padding: 15px 20px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--t1);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.dlg-sheet-item:hover { background: var(--raised); }
.dlg-sheet-destructive { color: var(--err); }

/* ── Toast ───────────────────────────────────────────────────────────── */
.dlg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--t1);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 12px 20px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  max-width: min(340px, calc(100vw - 32px));
  text-align: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.dlg-toast-clickable.visible {
  pointer-events: auto;
  cursor: pointer;
}
.dlg-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
