.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  background: #000;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ctxmenu {
  position: fixed;
  z-index: 99;
  min-width: 160px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 10px;
  padding: 6px;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  flex-direction: column;
}
.ctxmenu.show { display: flex; }
.ctxmenu button {
  appearance: none;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 6px;
  color: #000;
  cursor: pointer;
}
.ctxmenu button:hover { background: #f0f0f0; }
.ctxmenu button.danger { color: #b00; }
.ctxmenu button.danger:hover { background: #fbeaea; }

.btn-danger { background: #b00; color: #fff; border-color: #b00; }
.btn-danger:hover { background: #900; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .15s ease;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border: 1px solid #000;
  border-radius: 14px;
  width: min(360px, 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp .18s cubic-bezier(.2,.8,.2,1);
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-message { font-size: 15px; color: #333; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.modal-actions .btn { padding: 10px 16px; font-size: 14px; min-width: 80px; }

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