/*
 * 좌측하단 코너 토스트 (재사용 모듈) — corner_toast_controller.js
 * bottom-anchored 컨테이너 → 신규 토스트는 append(아래/코너쪽), 기존은 위로 밀려 적층.
 * 데스크톱 전용 (모바일은 소식함으로 대체).
 */
#corner-toast-root {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 11000;            /* 모달/태스크바 위로 항상 노출 */
  display: flex;
  flex-direction: column;    /* 마지막(최신) 자식이 맨 아래(코너) */
  gap: 8px;
  max-width: 320px;
  pointer-events: none;      /* 컨테이너 자체는 클릭 통과, 아이템만 클릭 */
}

.corner-toast-item {
  pointer-events: auto;
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #3e6187;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  padding: 12px 54px 12px 14px;   /* 우측: 고정(핀) + 닫기(X) 두 버튼 공간 */
  cursor: pointer;
  user-select: none;              /* 드래그로 순서 변경 시 텍스트 선택 방지 */
  opacity: 0;
  transform: translateX(-16px);
  transform-origin: center top;   /* 스택 접힘 시 위쪽 빼꼼 정렬 유지(scale 기준점) */
  transition: opacity 0.25s ease, transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.corner-toast-item.corner-toast-show {
  opacity: 1;
  transform: translateX(0);
}

/* 우측 하단 노출 — 위치 + 등장 애니메이션 방향(오른쪽에서) */
#corner-toast-root.corner-toast-pos-right {
  left: auto;
  right: 16px;
  align-items: flex-end;
}
.corner-toast-pos-right .corner-toast-item { transform: translateX(16px); }
.corner-toast-pos-right .corner-toast-item.corner-toast-show { transform: translateX(0); }

/* 드래그로 순서 변경 중 */
.corner-toast-item.corner-toast-dragging {
  cursor: grabbing;
  opacity: 0.92;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  transition: none;
  z-index: 1;
}
.corner-toast-item:hover {
  border-color: #cbd5e1;
  border-left-color: #2f4d6e;
}

.corner-toast-ws {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.corner-toast-ws-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
}
.corner-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}
.corner-toast-body {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
  word-break: break-word;
}
.corner-toast-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  line-height: 1;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 17px;
  cursor: pointer;
  border-radius: 4px;
}
.corner-toast-close:hover { background: #f1f5f9; color: #475569; }

/* 개별 고정(핀) 버튼 — 닫기(X) 왼쪽 */
.corner-toast-pin {
  position: absolute;
  top: 6px;
  right: 28px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
}
.corner-toast-pin svg { width: 13px; height: 13px; }
.corner-toast-pin:hover { background: #f1f5f9; color: #475569; }
.corner-toast-pin.is-pinned { color: #d97706; }                 /* 고정됨 = 주황 */
.corner-toast-pin.is-pinned svg { fill: #d97706; stroke: #d97706; }

/* 커스텀 UI 토스트(전체 색칠) — 아이콘 hover 배경을 반투명 중립색으로.
   기본 hover(#f1f5f9 연회색)는 밝은 글자색 아이콘을 가려 안 보이므로, 밝은/어두운 배경 모두에서
   대비되는 반투명 회색으로 덮는다. 아이콘 색(글자색)은 인라인으로 유지되어 그대로 보인다. */
.corner-toast-colored .corner-toast-close:hover,
.corner-toast-colored .corner-toast-pin:hover {
  background: rgba(127, 127, 127, 0.28);
}

/* 모바일: 코너 토스트 미노출 (소식함으로 대체) */
@media (max-width: 768px) {
  #corner-toast-root { display: none !important; }
}

/* ───────────────────────────────────────────────
   알림 UI 선택기 (예약 폼 / 상담예약 상세) — 프로필형 배지 라디오
   ─────────────────────────────────────────────── */
.rsv-ui-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rsv-ui-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 60px;
  cursor: pointer;
  padding: 6px 4px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.rsv-ui-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.rsv-ui-opt:has(input:checked) {
  border-color: #3e6187;
  background: #f1f5f9;
}
.rsv-ui-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.rsv-ui-opt:has(input:checked) .rsv-ui-circle {
  outline: 2px solid #3e6187;
  outline-offset: 1.5px;
}
.rsv-ui-name {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* 소식함 알림 — UI 배지(아이콘 원 대체) */
.inbox-ui-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

/* 다크 모드 */
html.dark .corner-toast-item {
  background: #1e293b;
  border-color: #334155;
  border-left-color: #60a5fa;
}
html.dark .corner-toast-ws { color: #94a3b8; }
html.dark .corner-toast-title { color: #f1f5f9; }
html.dark .corner-toast-body { color: #cbd5e1; }
html.dark .corner-toast-close:hover { background: #334155; color: #e2e8f0; }
html.dark .corner-toast-pin:hover { background: #334155; color: #e2e8f0; }
html.dark .corner-toast-pin.is-pinned { color: #fbbf24; }
html.dark .corner-toast-pin.is-pinned svg { fill: #fbbf24; stroke: #fbbf24; }
