/* MarsAI modern UI runtime styles — toasts + in-page confirm dialog.
 * UI batch U02 (2026-11-16). Roles only; every colour comes from
 * ui/mars/mars-tokens.css. Dark-first (the panels are dark surfaces). */

.mars-toast-host {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

.mars-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--mars-bg-panel);
  border: 1px solid var(--mars-border-strong);
  border-left: 3px solid var(--mars-accent);
  border-radius: var(--mars-radius-lg);
  box-shadow: var(--mars-shadow-2);
  padding: 12px 14px;
  animation: marsToastIn var(--mars-dur-slow) var(--mars-ease);
}

.mars-toast--ok { border-left-color: var(--mars-ok); }
.mars-toast--error { border-left-color: var(--mars-bad); }
.mars-toast--info { border-left-color: var(--mars-accent); }

.mars-toast__icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: var(--mars-bg-raised);
  color: var(--mars-accent);
}

.mars-toast--ok .mars-toast__icon { color: var(--mars-ok); }
.mars-toast--error .mars-toast__icon { color: var(--mars-bad); }

.mars-toast__msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mars-text-body);
  overflow-wrap: anywhere;
}

.mars-toast__action {
  flex: 0 0 auto;
  align-self: center;
  background: none;
  border: 1px solid var(--mars-border-strong);
  border-radius: var(--mars-radius-pill);
  color: var(--mars-text);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: background var(--mars-dur) var(--mars-ease), border-color var(--mars-dur) var(--mars-ease);
}

.mars-toast__action:hover {
  background: var(--mars-bg-raised);
  border-color: var(--mars-accent);
}

.mars-toast__close {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: var(--mars-text-subtle);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color var(--mars-dur) var(--mars-ease);
}

.mars-toast__close:hover { color: var(--mars-text); }

.mars-toast--out {
  opacity: 0;
  transform: translateY(6px) scale(.98);
  transition: opacity .2s var(--mars-ease), transform .2s var(--mars-ease);
}

@keyframes marsToastIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.mars-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  animation: marsFadeIn .16s var(--mars-ease);
}

.mars-dialog {
  width: min(420px, 100%);
  background: var(--mars-bg-panel);
  border: 1px solid var(--mars-border-strong);
  border-radius: 18px;
  box-shadow: var(--mars-shadow-3);
  padding: 22px 22px 18px;
  animation: marsDialogIn var(--mars-dur-slow) var(--mars-ease);
}

.mars-dialog--danger { border-top: 3px solid var(--mars-accent-2); }

.mars-dialog__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--mars-text);
  letter-spacing: -.01em;
}

.mars-dialog__msg {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--mars-text-muted);
  overflow-wrap: anywhere;
}

.mars-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.mars-dialog__actions .btn,
.mars-dialog__actions .btn-ghost {
  font-size: 13px;
  padding: .5rem 1rem;
  cursor: pointer;
}

.mars-dialog--danger .mars-dialog__confirm {
  background: var(--mars-accent-2-fill);
}

@keyframes marsFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes marsDialogIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .mars-toast-host {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
  .mars-dialog__actions { flex-direction: column-reverse; }
  .mars-dialog__actions .btn,
  .mars-dialog__actions .btn-ghost { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .mars-toast,
  .mars-dialog-backdrop,
  .mars-dialog { animation: none; }
  .mars-toast--out { transition: none; }
}
