/* ============================================================
   DESIGN SYSTEM — feedback channel (DsSnackbar) + irreversible confirm
   (DsDialog). The single themed surfaces for the interaction canon
   (DESIGN-SYSTEM.md section 2). Token-driven; never the native look.
   ============================================================ */

/* ---- DsSnackbar : bottom-center host, one at a time -------------------- */
.ds-snackbar-host {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 9000;                 /* above tab bar + sheets, below nothing else */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2, 8px);
  width: min(560px, calc(100vw - 32px));
  pointer-events: none;          /* host is a passthrough; the bar re-enables */
}

.ds-snackbar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  width: 100%;
  padding: 12px 12px 12px 16px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  font-size: 14px;
  line-height: 1.4;
  /* Enter from below + fade. Driven by .is-in / .is-out toggles. */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.ds-snackbar.is-in { opacity: 1; transform: translateY(0); }
.ds-snackbar.is-out { opacity: 0; transform: translateY(12px); }

.ds-snackbar-msg {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The action (e.g. Undo) is the gold accent — the one confident interactive
   colour. >=44px tall hit target. */
.ds-snackbar-action {
  flex: 0 0 auto;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent-2-strong);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--tap), color var(--tap);
}
.ds-snackbar-action:hover { background: var(--accent-2-soft); }
.ds-snackbar-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-2-soft);
}

/* ---- DsDialog : themed irreversible confirm --------------------------- */
.ds-dialog-host {
  position: fixed;
  inset: 0;
  z-index: 9500;                 /* above the snackbar host */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ds-dialog-host.is-in { opacity: 1; }
.ds-dialog-host.is-out { opacity: 0; }

.ds-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.ds-dialog {
  position: relative;
  width: min(420px, 100%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  padding: 24px;
  transform: translateY(8px) scale(0.98);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ds-dialog-host.is-in .ds-dialog { transform: translateY(0) scale(1); }

.ds-dialog-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ds-dialog-message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-wrap;
}

.ds-dialog-actions {
  display: flex;
  justify-content: flex-end;     /* Cancel left, confirm right within the row */
  gap: var(--space-3, 12px);
}
/* Dialog buttons are now DsButtons (.ds-btn .ds-btn--secondary / --destructive
   / --primary, set in dialog.js). The .ds-dialog-* classes are positioning/role
   hooks only; the visual (44px target, secondary surface, red destructive tier)
   comes from the canonical DsButton in components.css. Just guarantee a min
   touch target in case the variant class is ever absent. */
.ds-dialog-btn { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .ds-snackbar, .ds-dialog-host, .ds-dialog { transition: none; }
}
