/* Shared feedback primitives: toasts, confirms and simple app modals. */
.rs-toast {
  position: fixed;
  z-index: var(--rst-z-toast);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(640px,calc(100vw - 48px));
  padding: 18px 22px;
  border: 1px solid var(--rst-ui-line-strong);
  border-radius: var(--rst-ui-radius-xl);
  background: var(--rst-ui-workspace-body);
  color: var(--rst-ui-text);
  box-shadow: var(--rst-ui-shadow-floating);
  font-size: 18px;
  line-height: 1.24;
  font-weight: var(--rst-fw-bold);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--rst-motion-ui) var(--rst-motion-smooth),transform var(--rst-motion-ui) var(--rst-motion-smooth);
}
.rs-toast.is-centered { top: 50%; left: 50%; min-width: min(560px,calc(100vw - 48px)); transform: translate(-50%,-46%) scale(.965); }
.rs-toast.is-corner { top: 86px; right: 28px; min-width: 300px; padding: 13px 16px; border-radius: var(--rst-ui-radius-lg); font-size: 14px; transform: translateY(-8px) scale(.985); }
.rs-toast.is-visible.is-centered { transform: translate(-50%,-50%) scale(1); opacity: 1; }
.rs-toast.is-visible.is-corner { transform: translateY(0) scale(1); opacity: 1; }

.rs-toast__icon,
.rs-modal-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--rst-ui-line);
  border-radius: var(--rst-ui-radius-lg);
  background: var(--rst-ui-divider-soft);
  color: var(--rst-state-info-text);
  font-size: 24px;
  font-weight: var(--rst-fw-display);
}
.rs-toast.is-corner .rs-toast__icon { width: 30px; height: 30px; border-radius: var(--rst-ui-radius-sm); font-size: 17px; }
.rs-toast__icon svg,
.rs-modal-icon svg { width: 24px; height: 24px; }
.rs-toast.is-corner .rs-toast__icon svg { width: 16px; height: 16px; }

.rs-toast.is-success { border-color: var(--rst-state-success-border); }
.rs-toast.is-success .rs-toast__icon { background: var(--rst-state-success-bg); color: var(--rst-state-success-text); border-color: var(--rst-state-success-border); }
.rs-toast.is-danger { border-color: var(--rst-state-danger-border); }
.rs-toast.is-danger .rs-toast__icon { background: var(--rst-state-danger-bg); color: var(--rst-state-danger-text); border-color: var(--rst-state-danger-border); }
.rs-toast.is-warning { border-color: var(--rst-state-warning-border); }
.rs-toast.is-warning .rs-toast__icon { background: var(--rst-state-warning-bg); color: var(--rst-state-warning-text); border-color: var(--rst-state-warning-border); }

.rs-modal {
  width: min(520px,calc(100vw - 36px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rst-ui-text);
}
.rs-modal::backdrop { background: var(--rst-overlay-bg); }
.rs-modal-card {
  display: grid;
  grid-template-columns: 52px minmax(0,1fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--rst-ui-line);
  border-radius: var(--rst-ui-radius-xl);
  background: var(--rst-ui-workspace-body);
  box-shadow: var(--rst-ui-shadow-floating);
  font-family: var(--rst-ui-font);
}
.rs-modal-copy { min-width: 0; display: grid; gap: 11px; }
.rs-modal h2 { margin: 0; color: var(--rst-ui-text); font-size: 20px; line-height: 1.1; font-weight: var(--rst-fw-display); }
.rs-modal p { margin: 0; color: var(--rst-ui-muted); font-size: 14px; line-height: 1.45; font-weight: var(--rst-fw-bold); }
.rs-modal-field { margin-top: 2px; }
.rs-modal-actions { grid-column: 2; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.rs-modal-btn {
  min-height: var(--rs-button-height-md,38px);
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rs-button-gap,8px);
  border: 1px solid var(--rst-ui-line);
  border-radius: var(--rst-ui-radius-md);
  background: var(--rst-ui-divider-soft);
  color: var(--rst-ui-text);
  font: inherit;
  font-size: 13px;
  font-weight: var(--rst-fw-display);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--rst-motion-ui) var(--rst-motion-smooth),border-color var(--rst-motion-ui) var(--rst-motion-smooth),transform var(--rst-motion-ui) var(--rst-motion-smooth),opacity var(--rst-motion-ui) var(--rst-motion-smooth);
}
.rs-modal-btn:is(:hover,:focus-visible) { transform: translateY(-1px); background: var(--rst-ui-section-row-hover); border-color: var(--rst-ui-line-strong); }
.rs-modal-btn:disabled { cursor: default; opacity: .45; transform: none; }
.rs-modal-btn.is-secondary { background: var(--rst-ui-divider-soft); }
.rs-modal-btn.is-primary { background: var(--module-accent,var(--rst-ui-action)); border-color: var(--rst-state-selected-border); color: var(--rst-on-accent-text); }
.rs-modal-btn.is-danger { color: var(--rst-state-danger-text); border-color: var(--rst-state-danger-border); background: var(--rst-state-danger-bg); }
.rs-modal-card[data-tone="danger"] .rs-modal-icon { background: var(--rst-state-danger-bg); color: var(--rst-state-danger-text); border-color: var(--rst-state-danger-border); }
.rs-modal-card[data-tone="success"] .rs-modal-icon { background: var(--rst-state-success-bg); color: var(--rst-state-success-text); border-color: var(--rst-state-success-border); }
