/* 해금 이미지 갤러리 v1 (docs/unlock_gallery_v1/spec.md §4·§5·§6)
   - 새 요소는 모두 .cg-root 안의 .ul-* . 기존 .cg-* 규칙은 style.css 그대로 쓴다(토큰 --cg-*, 모서리 10/6px)
   - 시트·모달·라이트박스·토스트는 JS가 body 에 붙이는 .cg-root.ul-layer 안에 그린다(루트 배경은 투명 유지)
   - 글자 대비: 블러·실루엣 카드 위 흰 글자는 45% 막 + 가운데 스크림으로 4.5:1 이상 */
.cg-root {
  --cg-affection: #e0667e;          /* 하트·진행 막대(글자에는 쓰지 않음) */
  --cg-affection-ink: #b8385a;      /* 로즈 위 흰 글자/로즈 글자용 진한 값(대비 4.5:1+) */
  --cg-affection-soft: #fdeef1;
  --ul-mark-red: #e0202e;
  --ul-btn-h: 48px;
  --ul-card-radius: var(--cg-radius-sm, 6px);
}

/* ---------- 패널 머리 ---------- */
.cg-root .ul-panel { display: flex; flex-direction: column; min-width: 0; }
.cg-root .ul-fakebar { margin: 0 0 12px; padding: 6px 10px; font-size: 0.75rem; font-weight: 700; line-height: 1.45; color: #6b4a00; background: #fff3d6; border: 1px dashed #e2b458; border-radius: var(--cg-radius-sm); }
.cg-root .ul-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 6px; }
.cg-root .ul-title { margin: 0; min-width: 0; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; color: var(--cg-text); }
.cg-root .ul-title__cnt { white-space: nowrap; }
.cg-root .ul-title b { color: var(--cg-affection-ink); font-weight: 800; }
.cg-root .ul-title__cnt span { color: var(--cg-text-2); font-weight: 700; }
.cg-root .ul-how { display: inline-flex; flex-shrink: 0; align-items: center; gap: 4px; min-height: 44px; margin-right: -4px; padding: 0 4px; border: 0; background: none; color: var(--cg-text-2); font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; border-radius: var(--cg-radius-sm); }
.cg-root .ul-how:focus-visible { outline: 2px solid var(--cg-primary); outline-offset: 2px; }
.cg-root .ul-how__ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.cg-root .ul-body { min-width: 0; }

/* ---------- 호감도 카드 ---------- */
.cg-root .ul-aff { padding: 12px 14px; background: var(--cg-affection-soft); border-radius: var(--cg-radius-sm); }
/* 채팅에서 점수가 오르면 1초 강조(spec §4.3, NEW 카드와 같은 로즈 테두리) */
.cg-root .ul-aff.is-bump { box-shadow: 0 0 0 2px var(--cg-affection); }
.cg-root .ul-aff__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cg-root .ul-aff__lv { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.875rem; font-weight: 700; color: var(--cg-text-2); }
.cg-root .ul-aff__lv strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cg-text); font-weight: 800; }
.cg-root .ul-aff__lvno { flex-shrink: 0; white-space: nowrap; }
.cg-root .ul-aff__num { flex-shrink: 0; font-size: 0.8125rem; color: var(--cg-text-2); white-space: nowrap; }
.cg-root .ul-aff__num b { color: var(--cg-text); font-size: 0.9375rem; }
.cg-root .ul-aff__sub { margin: 8px 0 0; font-size: 0.75rem; line-height: 1.5; color: #5f5a54; }
/* 항목마다 줄바꿈 금지 + 구분점은 다음 항목 앞에 붙여서, 줄이 바뀌어도 줄 끝에 "·"가 남지 않게 (inline-block = 항목 사이에서만 줄바꿈) */
.cg-root .ul-aff__sub > span { display: inline-block; white-space: nowrap; }
.cg-root .ul-aff__sub > span + span::before { content: "·"; margin: 0 5px; color: var(--cg-text-3); }
.cg-root .ul-aff__sub.is-cap > span { display: inline; white-space: normal; }
.cg-root .ul-aff__sub.is-cap > span::before { content: none; }
.cg-root .ul-aff__note { margin: 6px 0 0; font-size: 0.75rem; line-height: 1.5; color: #5f5a54; }
.cg-root .ul-aff__note.is-warn { color: #8a4b00; font-weight: 600; }
.cg-root .ul-aff--guest { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; }
.cg-root .ul-aff--guest p { flex: 1 1 180px; min-width: 0; margin: 0; font-size: 0.8125rem; line-height: 1.5; color: var(--cg-text); }
.cg-root .ul-aff--guest .cg-btn { flex-shrink: 0; min-height: 44px; }
.cg-root .ul-heart { width: 18px; height: 18px; flex-shrink: 0; fill: var(--cg-affection); stroke: var(--cg-affection); stroke-width: 1.5; }
.cg-root .ul-bar { position: relative; height: 8px; margin-top: 8px; background: rgba(224, 102, 126, 0.18); border-radius: 999px; overflow: hidden; }
.cg-root .ul-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cg-affection); border-radius: 999px; }

/* ---------- 그룹 + 그리드 ---------- */
.cg-root .ul-group { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 16px 0 8px; font-size: 0.8125rem; font-weight: 700; line-height: 1.4; color: var(--cg-text-2); letter-spacing: 0.02em; }
.cg-root .ul-group span { color: var(--cg-text); font-weight: 700; }
.cg-root .ul-group .ul-mark { width: 18px; height: 18px; flex-shrink: 0; }
.cg-root .ul-note { margin: -4px 0 8px; font-size: 0.75rem; line-height: 1.5; color: var(--cg-text-2); word-break: keep-all; text-wrap: balance; }
.cg-root .ul-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cg-root .ul-grid > li { min-width: 0; margin: 0; padding: 0; }
@media (min-width: 900px) { .cg-root .ul-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; } }

/* ---------- 카드 공통 ---------- */
.cg-root .ul-card { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; margin: 0; padding: 0; border: 0; border-radius: var(--ul-card-radius); overflow: hidden; background: var(--cg-surface-2); color: #fff; font: inherit; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cg-root .ul-card:focus-visible { outline: 2px solid var(--cg-primary); outline-offset: 2px; }
.cg-root .ul-card img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.cg-root .ul-card__img { object-position: center 20%; }
/* 열림 */
.cg-root .ul-card.is-open::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.72) 100%); pointer-events: none; }
.cg-root .ul-num { position: absolute; left: 7px; bottom: 6px; z-index: 2; font-size: 11px; font-weight: 800; line-height: 1.3; letter-spacing: 0.02em; color: #fff; }
.cg-root .ul-new { position: absolute; right: 6px; top: 6px; z-index: 3; padding: 1px 6px; font-size: 10px; font-weight: 800; line-height: 1.5; color: #fff; background: var(--cg-affection-ink); border-radius: 999px; box-shadow: 0 0 0 1.5px #fff; }
/* 방금 열림: 요란한 효과 없이 얇은 로즈 테두리만 */
.cg-root .ul-card.is-new { box-shadow: 0 0 0 2px var(--cg-affection); }
@media (prefers-reduced-motion: no-preference) {
  .cg-root .ul-card.is-new { transition: box-shadow 0.4s ease; }
}
/* 잠김(대화) — 서버 32px 블러 JPG를 늘리고 CSS blur 로 계단을 지운다 */
.cg-root .ul-card__blur { inset: -10px !important; width: calc(100% + 20px) !important; height: calc(100% + 20px) !important; filter: blur(8px) saturate(0.85); transform: translateZ(0); }
.cg-root .ul-card.is-locked::before,
.cg-root .ul-card.is-adult::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(75% 48% at 50% 50%, rgba(12, 10, 14, 0.42), rgba(12, 10, 14, 0) 100%), rgba(22, 18, 24, 0.45); }
.cg-root .ul-lockwrap { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 6px 10px; color: #fff; }
.cg-root .ul-lock { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cg-root .ul-cond { display: flex; flex-direction: column; align-items: center; gap: 1px; max-width: 100%; font-size: 12px; font-weight: 800; line-height: 1.3; color: #fff; }
.cg-root .ul-cond > span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-root .ul-cond .ul-cond__sub { font-size: 11px; font-weight: 700; }
.cg-root .ul-cond--sm > span { font-size: 11px; font-weight: 700; line-height: 1.35; }
.cg-root .ul-mini { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; height: 4px; background: rgba(255, 255, 255, 0.3); border-radius: 999px; overflow: hidden; }
.cg-root .ul-mini > i { position: absolute; left: 0; top: 0; bottom: 0; background: #ffa3b5; border-radius: 999px; }
/* 잠김(17금 공통 카드) */
.cg-root .ul-card .ul-mark { position: absolute; left: 6px; top: 6px; z-index: 3; width: 22px; height: 22px; }
@media (min-width: 900px) { .cg-root .ul-card .ul-mark { left: 8px; top: 8px; width: 24px; height: 24px; } }
.cg-root .ul-adminband { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 3px 2px; overflow: hidden; font-size: 10px; font-weight: 800; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; color: #fff; background: #a8121f; }
.cg-root .ul-card.is-adminadult .ul-num { bottom: 24px; }
/* 준비 중(ui_active=0) */
.cg-root .ul-card.is-inactive { cursor: default; background: #ebe7e1; color: #5f5a54; }
.cg-root .ul-card.is-inactive .ul-cond { color: #5f5a54; font-weight: 700; }
/* 준비 중 칸 묶음 줄: 카드 대신 그룹 그리드 뒤 한 줄(펼치기 없음). 위 간격 = 그리드 칸 간격(8/10px) */
.cg-root .ul-soon { display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 8px 0 0; padding: 0 12px; border: 1px dashed var(--cg-border-strong); border-radius: var(--cg-radius-sm); font-size: 0.75rem; font-weight: 600; line-height: 1.4; color: var(--cg-text-2); text-align: center; white-space: nowrap; }
@media (min-width: 900px) { .cg-root .ul-soon { margin-top: 10px; } }

/* ---------- 상태: 로딩 · 오류 · 빈 목록 ---------- */
.cg-root .ul-skel { display: flex; flex-direction: column; gap: 12px; }
.cg-root .ul-skel__aff { display: block; height: 70px; border-radius: var(--cg-radius-sm); background: #f3eeea; }
.cg-root .ul-skel__line { display: block; width: 38%; height: 12px; margin-top: 4px; border-radius: 999px; background: #efebe6; }
.cg-root .ul-skel__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cg-root .ul-skel__grid i { display: block; aspect-ratio: 3 / 4; border-radius: var(--ul-card-radius); background: #efebe6; }
@media (min-width: 900px) { .cg-root .ul-skel__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 899px) { .cg-root .ul-skel__grid i:nth-child(n+4) { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .cg-root .ul-skel__aff, .cg-root .ul-skel__line, .cg-root .ul-skel__grid i { animation: ul-pulse 1.4s ease-in-out infinite; }
}
@keyframes ul-pulse { 50% { opacity: 0.55; } }
.cg-root .ul-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 12px 20px; text-align: center; background: var(--cg-bg); border-radius: var(--cg-radius-sm); }
.cg-root .ul-state__ico { width: 40px; height: 40px; margin-bottom: 4px; padding: 9px; border-radius: 50%; background: var(--cg-surface); fill: none; stroke: var(--cg-text-2); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.cg-root .ul-state__title { margin: 0; font-size: 0.9375rem; font-weight: 700; line-height: 1.45; color: var(--cg-text); }
.cg-root .ul-state__desc { margin: 0; font-size: 0.8125rem; line-height: 1.5; color: var(--cg-text-2); }
.cg-root .ul-state .cg-btn { margin-top: 10px; min-height: var(--ul-btn-h); min-width: 140px; }

/* ---------- 레이어 공통(딤 · 시트 · 모달 · 라이트박스 · 토스트) ---------- */
.cg-root.ul-layer { position: fixed; inset: 0; z-index: 10001; background: transparent; }
.cg-root.ul-layer[hidden] { display: none !important; }
.cg-root .ul-dim { position: absolute; inset: 0; background: rgba(20, 18, 24, 0.5); }
.cg-root .ul-x { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--cg-text-2); cursor: pointer; }
.cg-root .ul-x:hover { background: var(--cg-surface-2); }
.cg-root .ul-x:focus-visible, .cg-root .ul-layer button:focus-visible { outline: 2px solid var(--cg-primary); outline-offset: 2px; }
.cg-root .ul-x__ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.cg-root .ul-btn48 { min-height: var(--ul-btn-h); font-size: 0.9375rem; }
.cg-root .ul-btn__ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; }

/* 하단 시트(모바일) / 가운데 대화상자(PC) */
.cg-root .ul-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--cg-surface); color: var(--cg-text); border-radius: 16px 16px 0 0; box-shadow: var(--cg-shadow-lg); }
.cg-root .ul-sheet__grip { display: block; width: 40px; height: 4px; margin: 0 auto 12px; background: var(--cg-border-strong); border-radius: 999px; }
@media (min-width: 900px) {
  .cg-root .ul-sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: 420px; max-height: calc(100% - 48px); transform: translate(-50%, -50%); padding: 20px 24px 24px; border-radius: var(--cg-radius); }
  .cg-root .ul-sheet__grip { display: none; }
}
.cg-root .ul-sheet__top { display: flex; align-items: center; gap: 12px; }
.cg-root .ul-sheet__thumb { position: relative; flex: 0 0 54px; width: 54px; height: 72px; overflow: hidden; border-radius: var(--cg-radius-sm); background: #3a3440; display: flex; align-items: center; justify-content: center; }
.cg-root .ul-sheet__thumb img { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); max-width: none; object-fit: cover; filter: blur(5px); }
.cg-root .ul-sheet__thumb::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(22, 18, 24, 0.45); }
.cg-root .ul-sheet__thumb .ul-lock { position: relative; z-index: 2; width: 20px; height: 20px; }
.cg-root .ul-sheet__thumb .ul-mark { position: relative; z-index: 2; width: 40px; height: 40px; }
.cg-root .ul-sheet__txt { flex: 1; min-width: 0; }
.cg-root .ul-sheet__eyebrow { margin: 0; font-size: 0.8125rem; font-weight: 700; color: var(--cg-text-2); }
.cg-root .ul-sheet__title { margin: 2px 0 0; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; color: var(--cg-text); word-break: keep-all; overflow-wrap: anywhere; }
.cg-root .ul-sheet__top .ul-x { align-self: flex-start; margin: -6px -8px 0 0; }
.cg-root .ul-sheet__prog { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding: 12px 14px; background: var(--cg-affection-soft); border-radius: var(--cg-radius-sm); }
.cg-root .ul-sheet__row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8125rem; font-weight: 600; color: #5f5a54; }
.cg-root .ul-sheet__row b { color: var(--cg-text); font-size: 0.9375rem; }
.cg-root .ul-sheet__row > span:last-child { white-space: nowrap; }
.cg-root .ul-sheet__prog .ul-bar { margin-top: 6px; }
.cg-root .ul-sheet__tip { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 0.8125rem; line-height: 1.5; color: #5f5a54; }
.cg-root .ul-sheet__tip b { color: var(--cg-text); white-space: nowrap; }
.cg-root .ul-tip__ico { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: #a4805f; stroke-width: 1.8; stroke-linejoin: round; }
.cg-root .ul-sheet__warn { margin: 12px 0 0; padding: 10px 12px; font-size: 0.8125rem; font-weight: 600; line-height: 1.5; color: #8a4b00; background: #fff5e5; border-radius: var(--cg-radius-sm); }
.cg-root .ul-sheet__btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.cg-root .ul-sheet__body { margin: 12px 0 0; font-size: 0.9375rem; line-height: 1.6; color: var(--cg-text); }
.cg-root .ul-sheet__list { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cg-root .ul-sheet__list li { position: relative; padding-left: 14px; font-size: 0.8125rem; line-height: 1.5; color: #5f5a54; }
.cg-root .ul-sheet__list li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 4px; height: 4px; border-radius: 50%; background: var(--cg-affection); }

/* 성인 인증 목업 모달 */
.cg-root .ul-modal { position: absolute; left: 50%; top: 50%; z-index: 1; width: min(400px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; transform: translate(-50%, -50%); padding: 24px 20px 20px; background: var(--cg-surface); color: var(--cg-text); border-radius: var(--cg-radius); box-shadow: var(--cg-shadow-lg); text-align: center; }
.cg-root .ul-modal__x { position: absolute; right: 8px; top: 8px; }
.cg-root .ul-modal__mark { display: flex; justify-content: center; margin-bottom: 10px; }
.cg-root .ul-modal__mark .ul-mark { width: 40px; height: 40px; }
.cg-root .ul-modal__title { margin: 0; font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.02em; color: var(--cg-text); }
.cg-root .ul-modal__body { margin: 8px 0 0; font-size: 0.875rem; line-height: 1.6; color: #5f5a54; word-break: keep-all; }
.cg-root .ul-modal__body strong { color: var(--cg-text); }
.cg-root .ul-modal__status { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0; padding: 4px 10px; font-size: 0.75rem; font-weight: 700; color: #7a4a00; background: #fff3dc; border-radius: 999px; }
.cg-root .ul-verify { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cg-root .ul-verify__btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--ul-btn-h); padding: 0 14px; border: 1px dashed var(--cg-border-strong); border-radius: var(--cg-radius-sm); background: var(--cg-surface-2); color: #625d56; font: inherit; font-size: 0.9375rem; font-weight: 700; text-align: left; cursor: not-allowed; }
.cg-root .ul-verify__btn span { flex: 1; min-width: 0; }
.cg-root .ul-verify__btn em { flex-shrink: 0; padding: 2px 8px; font-size: 11px; font-style: normal; font-weight: 800; color: #7a4a00; background: #fff3dc; border-radius: 999px; white-space: nowrap; }
.cg-root .ul-verify__ico { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.cg-root .ul-modal__fine { display: flex; gap: 6px; align-items: flex-start; margin: 14px 0 16px; font-size: 0.75rem; line-height: 1.5; color: var(--cg-text-2); text-align: left; }
.cg-root .ul-fine__ico { flex-shrink: 0; width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }

/* 라이트박스 */
.cg-root.ul-layer--lb { z-index: 10002; }
.cg-root .ul-lb { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0b0b0d; color: #fff; touch-action: pan-y; }
.cg-root .ul-lb__top { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px 6px 16px; padding-top: calc(6px + env(safe-area-inset-top, 0px)); background: #0b0b0d; }
.cg-root .ul-lb__cnt { font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cg-root .ul-adminpill { padding: 2px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; background: #b0101e; border-radius: 999px; }
.cg-root .ul-lb .ul-x { margin-left: auto; color: #fff; }
.cg-root .ul-lb .ul-x:hover { background: rgba(255, 255, 255, 0.12); }
.cg-root .ul-lb button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cg-root .ul-lb__stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.cg-root .ul-lb__fig { position: relative; height: 100%; max-height: 100%; max-width: 100%; aspect-ratio: 3 / 4; margin: 0; overflow: hidden; border-radius: var(--cg-radius-sm); background: #1b1a1f; }
.cg-root .ul-lb__fig img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
/* 좁은 화면(스테이지가 3:4보다 세로로 길 때) 그림 틀이 사진보다 길어져 위아래 회색 띠·각진 사진 모서리가 보이던 것 보정: 틀을 스테이지 안 3:4 최대 크기로 */
@supports (width: 1cqh) {
  .cg-root .ul-lb__stage { container-type: size; }
  .cg-root .ul-lb__fig { width: min(100cqw, 100cqh * 3 / 4); height: auto; }
}
.cg-root .ul-lb__fig .ul-mark { position: absolute; left: 12px; top: 12px; z-index: 2; width: 32px; height: 32px; }
.cg-root .ul-lb__nav { display: none; }
@media (min-width: 900px) {
  .cg-root .ul-lb__nav { position: absolute; top: 50%; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer; transform: translateY(-50%); }
  .cg-root .ul-lb__nav:hover { background: rgba(255, 255, 255, 0.24); }
  .cg-root .ul-lb__nav:disabled { opacity: 0.35; cursor: default; }
  .cg-root .ul-lb__nav--prev { left: 24px; }
  .cg-root .ul-lb__nav--next { right: 24px; }
  .cg-root .ul-lb__stage { padding: 0 96px; }
}
.cg-root .ul-nav__ico { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cg-root .ul-lb__bottom { padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.cg-root .ul-lb__title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.45; color: #fff; word-break: keep-all; overflow-wrap: anywhere; }
.cg-root .ul-lb__dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cg-root .ul-lb__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.cg-root .ul-lb__dots i.on { width: 16px; border-radius: 999px; background: #fff; }
.cg-root .ul-lb__hint { margin: 8px 0 0; font-size: 0.75rem; color: rgba(255, 255, 255, 0.72); }
/* 스와이프 안내는 터치 기기에서만 (마우스·트랙패드는 화살표 버튼·키보드로 넘김) */
@media (hover: hover) and (pointer: fine) { .cg-root .ul-lb__hint { display: none; } }

/* 상세 화면 토스트(다른 탭·채팅에서 열린 뒤 돌아왔을 때). 모바일은 하단 탭(#mob_bar) 위 */
.cg-root.ul-toastwrap { position: fixed; left: 12px; right: 12px; bottom: calc(var(--mob-bar-h, 60px) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 10003; display: flex; justify-content: center; pointer-events: none; background: transparent; }
@media (min-width: 900px) { .cg-root.ul-toastwrap { bottom: 24px; } }
.cg-root .ul-toast { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; padding: 10px; background: #1c1c1c; color: #fff; border-radius: var(--cg-radius); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); pointer-events: auto; }
@media (prefers-reduced-motion: no-preference) {
  .cg-root .ul-toast { animation: ul-rise 0.24s ease-out; }
}
@keyframes ul-rise { from { transform: translateY(12px); opacity: 0; } }
.cg-root .ul-toast__thumb { position: relative; flex: 0 0 48px; width: 48px; height: 64px; overflow: hidden; border-radius: var(--cg-radius-xs); background: #3a3440; }
.cg-root .ul-toast__thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.cg-root .ul-toast__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cg-root .ul-toast__txt strong { font-size: 0.9375rem; font-weight: 800; line-height: 1.35; }
.cg-root .ul-toast__txt span { overflow: hidden; font-size: 0.75rem; line-height: 1.4; color: rgba(255, 255, 255, 0.8); text-overflow: ellipsis; white-space: nowrap; }
/* 조건·레벨 문구는 잘리면 뜻이 없어져서 줄바꿈 허용 */
.cg-root .ul-toast__txt .ul-toast__cond, .cg-root .ul-toast__txt .ul-toast__lv { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.cg-root .ul-toast .cg-btn { flex-shrink: 0; min-height: 44px; padding: 0 16px; background: #fff; color: #1c1c1c; }
/* s9fix: 검은 토스트 위에서 보이는 키보드 포커스 링(마우스 클릭엔 없음) */
.cg-root .ul-toast .cg-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 359px) {
  .cg-root .ul-cond { font-size: 11px; }
  .cg-root .ul-cond .ul-cond__sub { font-size: 10px; }
  .cg-root .ul-cond--sm > span { font-size: 10px; }
  .cg-root .ul-lockwrap { padding: 0 4px 10px; gap: 4px; }
  .cg-root .ul-sheet__title { font-size: 1.0625rem; }
}
