/* 토스트 ds-toast · 영역 ds-toast-region — 오른쪽 위(제목 줄 아래) · 새 것 맨 위 · 4초 · 최대 3장 (DESIGN 6-3-4 · C9 · C26 · X7 · 사용자 테스트 12 2026-10-29) */

/* 영역 — 띄운 문서(업무 화면이면 그 탭 iframe) 뷰포트에 fixed. 기본 top-right
   위 = 그 문서 제목 줄(.ds-titlebar) 아래 끝 + 16 · 없으면(셸) 탭 줄(.ds-tabbar) 아래 끝 + 16 · 둘 다 안 보이면 위 16 · 오른쪽 16.
   --ds-toast-top 은 toast.js 가 영역이 빌 때마다(첫 장을 띄울 때) 제목 줄 아래 끝을 재서 넣는다 */
.ds-toast-region {
  position: fixed;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 0;
  top: calc(var(--ds-toast-top, 0px) + var(--space-4));
  right: var(--space-4);
}
.ds-toast-region[hidden] { display: none; }
/* 위치 옵션(position) — 기본은 top-right(사용자 2026-10-29). 나머지는 기존 API 호환용 · bottom-center 는 없앴다(주면 top-right) */
.ds-toast-region--top-center { left: 50%; right: auto; transform: translateX(-50%); align-items: center; }
.ds-toast-region--top-left,
.ds-toast-region--bottom-left { left: var(--space-4); right: auto; align-items: flex-start; }
.ds-toast-region--bottom-right,
.ds-toast-region--bottom-left { top: auto; bottom: var(--space-4); }

/* 한 장 — 떠 있는 면 · 두 줄까지 */
.ds-toast {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 360px;   /* 고정 — 오른쪽 끝으로 쌓일 때 왼쪽 끝이 들쭉날쭉하지 않게 */
  max-width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 5px var(--space-1-5) 5px var(--space-3);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-shadow);
  font-size: var(--fs-13);
  line-height: 1.45;
  text-align: left;
  animation: ds-toast-in var(--dur-modal) var(--ease-out);
}
.ds-toast > .ds-ic { width: 14px; height: 14px; }
.ds-toast--ok > .ds-ic { color: var(--ok); }
.ds-toast--info > .ds-ic { color: var(--info); }
.ds-toast--warn > .ds-ic { color: var(--warn); }
.ds-toast--bad > .ds-ic { color: var(--bad); }
.ds-toast__text {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-1) 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* 동작 「실행 취소」 — 글자 버튼 28 · 0 8 · 13/600 · --accent-text (모양은 ds-btn--text, 여기서는 크기만) */
.ds-toast__action {
  flex: none;
  height: 28px;
  min-height: 28px;
  padding: 0 var(--space-2);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  color: var(--accent-text);
}
/* 닫기 28(아이콘 12) */
.ds-toast__close { flex: none; width: 28px; height: 28px; min-height: 28px; color: var(--muted); }
.ds-toast__close .ds-ic { width: 12px; height: 12px; }

/* 열림만 — 오른쪽 16 에서 들어옴(--dur-modal · 움직임 줄이기면 base.css 가 0) · 닫힘은 바로 */
@keyframes ds-toast-in { from { opacity: 0; transform: translateX(16px); } }
