/* --- Dialog & Toast --- */
dialog {
  border: none; border-radius: 12px; padding: 0;
  margin: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  max-width: 360px; width: 90%;
  font-family: inherit; color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,0.4); }
dialog[open] { animation: dialog-in .2s ease; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dlg-body { padding: 24px 24px 20px; }
.dlg-title {
  font-size: 1.1em; font-weight: 600; margin: 0 0 16px;
  text-align: center; color: var(--text);
}
.dlg-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.dlg-input {
  width: 100%; padding: 8px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 6px;
  outline: none; color: var(--text); background: #fff;
  transition: border-color .2s;
}
.dlg-input:focus { border-color: #37352f; }
.dlg-error {
  font-size: 13px; color: #dc3545; margin-top: 6px;
  min-height: 20px;
}
.dlg-text { font-size: 14px; color: #555; margin-bottom: 16px; text-align: center; }
.dlg-row {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 15px;
}
.dlg-row .dlg-input { width: 60px; text-align: center; }
.dlg-actions {
  display: flex; gap: 8px; justify-content: center;
  padding: 0 24px 20px;
}
.dlg-btn {
  padding: 8px 20px; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.dlg-btn-cancel { background: #e8e8ec; color: #444; }
.dlg-btn-cancel:hover { background: #ddd; }
.dlg-btn-confirm { background: #37352f; color: #fff; }
.dlg-btn-confirm:hover { background: #1a1a17; }
.dlg-btn-danger { background: #dc3545; color: #fff; }
.dlg-btn-danger:hover { background: #c82333; }

#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #37352f; color: #fff; padding: 10px 24px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
}
#toast.show {
  opacity: 1; pointer-events: auto;
  animation: toast-in .3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
