/* thumb.css — 구멍이 썸네일. 공통 색·버튼은 app.css 를 그대로 쓴다.
 * 글자 크기는 5단계만 쓴다: 28(제목) · 18(구역) · 16(본문) · 14(보조) · 12(표시)
 * 간격은 4의 배수만 쓴다.
 */
.thumb-body { padding-bottom: calc(var(--bottom-h) + 24px + env(safe-area-inset-bottom)); }
.tb-wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 32px; }
.tb-col * { min-width: 0; }
.tb-wrap * { min-width: 0; }
.m-only { display: none; }

/* 머리글 */
.top-back { color: var(--primary); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; }
.thumb-body .top-in { gap: 8px; }
.thumb-body .top-r { flex: none; gap: 4px; }
@media (max-width: 760px) {
  .thumb-body .brand span { display: none; }
  .thumb-body .top-back { font-size: 14px; }
}

/* ---------- 1단계: 사진 올리기 ---------- */
#stepPick { max-width: 560px; margin: 0 auto; }
.tb-hero { text-align: center; padding: 16px 0 28px; }
.tb-badge { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .2px; }
.tb-h1 { margin: 16px 0 12px; font-size: 28px; line-height: 1.32; font-weight: 800; letter-spacing: -0.8px; color: var(--ink); }
.tb-h1 em { font-style: normal; color: var(--primary); }
.tb-lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-soft); }

.tb-drop { border-radius: 24px; transition: box-shadow .15s; }
.tb-drop.over { box-shadow: 0 0 0 3px var(--primary); }
.tb-pick { width: 100%; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #c7d6f7; border-radius: 24px; background: #fff; transition: background .15s, border-color .15s; }
.tb-pick:hover { background: #f8fbff; border-color: var(--primary); }
.tb-pick-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--primary); color: #fff; margin-bottom: 8px; box-shadow: 0 6px 16px rgba(37,99,235,.25); }
.tb-pick-t { font-size: 18px; font-weight: 800; color: var(--ink); }
.tb-pick-s { font-size: 14px; color: var(--ink-faint); }

.tb-name { display: block; margin-top: 24px; }
.tb-name-l { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.tb-opt { font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.tb-name input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; font-size: 16px; }
.tb-name input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.tb-name-h { display: block; margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-faint); }

.tb-tips { list-style: none; margin: 24px 0 0; padding: 16px; display: grid; gap: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.tb-tips li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-soft); }
.tb-tip-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #f2f4f6; font-size: 12px; font-weight: 800; color: var(--ink-soft); }

/* ---------- 2단계: 결과 ---------- */
.tb-src { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.tb-src img { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #f2f4f6; }
.tb-src-t { display: flex; flex-direction: column; gap: 4px; }
.tb-src-t b { font-size: 16px; font-weight: 800; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-src-t span { font-size: 14px; color: var(--ink-faint); }
.tb-src-t span.done { color: var(--primary); font-weight: 700; }

.tb-note { margin-top: 12px; padding: 12px 16px; border-radius: 14px; background: #fff8e6; color: #8a5a00; font-size: 14px; line-height: 1.5; font-weight: 600; }

.tb-sec { margin-top: 32px; }
.tb-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.tb-sec-h h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.4px; color: var(--ink); }
.tb-sec-s { font-size: 12px; font-weight: 600; color: var(--ink-faint); white-space: nowrap; }

.tb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .tb-grid { grid-template-columns: repeat(2, 1fr); } }

.tb-card { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: #fff; overflow: hidden; text-align: left; transition: transform .15s, box-shadow .15s; }
.tb-card:not([disabled]):hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17,24,39,.08); }
.tb-card[disabled] { cursor: default; }
.tb-card-img { position: relative; aspect-ratio: 1; background: #f7f8fa; }
.tb-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-card-b { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; padding: 0 12px; }
.tb-card-l { font-size: 14px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-tag { flex: none; height: 20px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; }
.tb-tag.ai { background: linear-gradient(90deg, #2563eb, #7c3aed); color: #fff; }
.tb-tag.auto { background: #f2f4f6; color: var(--ink-soft); }

/* 만드는 중: 반짝이는 자리 */
.tb-skel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(110deg, #f2f4f6 30%, #fafbfc 50%, #f2f4f6 70%); background-size: 200% 100%; animation: tb-shine 1.4s linear infinite; color: var(--ink-faint); font-size: 12px; font-weight: 700; }
.tb-skel.ai { background-image: linear-gradient(110deg, #eef2ff 30%, #f8f7ff 50%, #eef2ff 70%); color: #6d5bd0; }
.tb-skel svg { animation: tb-spin 1.2s linear infinite; }
@keyframes tb-shine { to { background-position: -200% 0; } }
@keyframes tb-spin { to { transform: rotate(360deg); } }
.tb-fail { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; background: #fafafa; color: var(--ink-faint); font-size: 12px; line-height: 1.5; }
.tb-retry { min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 12px; font-weight: 700; color: var(--ink-soft); }

.tb-more { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tb-more-l { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.tb-more-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-more-b { min-height: 44px; padding: 0 16px; border: 1px solid #d9d2fb; border-radius: 999px; background: #faf8ff; color: #5b47c9; font-size: 14px; font-weight: 700; }
.tb-more-b::before { content: '+ '; }
.tb-more-b:hover { background: #f1edff; }
.tb-caution { margin: 16px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-faint); }

.thumb-body .bottom-in { max-width: 880px; }
@media (min-width: 1101px) { .thumb-body .bottom-in { max-width: 1200px; padding-right: calc(16px + 412px); } }
.thumb-body .bottom-in .btn-ghost { flex: none; }
.thumb-body .bottom-in .btn-primary { flex: 1; }

/* ---------- 넓은 화면: 왼쪽 작업, 오른쪽 내 썸네일 ---------- */
.tb-layout { max-width: 1200px; margin: 0 auto; padding: 24px 16px 32px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.tb-col { min-width: 0; max-width: 840px; width: 100%; justify-self: center; }
.tb-side { position: sticky; top: calc(var(--top-h) + 24px); max-height: calc(100vh - var(--top-h) - var(--bottom-h) - 48px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 16px; }
.tb-side-h { display: flex; align-items: center; gap: 8px; }
.tb-side-h h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.4px; }
.tb-side-n { font-size: 14px; font-weight: 800; color: var(--primary); }
.tb-side-x { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f2f4f6; color: var(--ink); place-items: center; }
.tb-side-s { margin: 4px 0 12px; font-size: 12px; color: var(--ink-faint); }
.tb-side-new { min-height: 44px; border: 1px dashed #c7d6f7; border-radius: 12px; background: #f8fbff; color: var(--primary); font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.tb-side-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 0 -4px; padding: 0 4px 4px; }
.tb-side-empty { padding: 24px 8px; text-align: center; font-size: 14px; line-height: 1.6; color: var(--ink-faint); }
.tb-saved { display: flex; align-items: center; gap: 4px; border-radius: 14px; border: 1px solid transparent; transition: background .15s; }
.tb-saved:hover { background: #f7f8fa; }
.tb-saved.on { background: var(--primary-soft); border-color: #cfe0ff; }
.tb-saved-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px; border: 0; background: none; text-align: left; border-radius: 14px; }
.tb-saved-open img { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #f2f4f6; border: 1px solid var(--border); }
.tb-saved-t { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tb-saved-t b { font-size: 14px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-saved-t span { font-size: 12px; color: var(--ink-faint); }
.tb-saved-del { flex: none; min-width: 44px; height: 44px; padding: 0 8px; border: 0; border-radius: 12px; background: none; color: var(--ink-faint); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.tb-saved-del:hover { background: #fff; color: var(--danger); }
.tb-saved-del.ask { background: var(--danger); color: #fff; }
.top-list { display: none; align-items: center; gap: 6px; color: var(--ink); }
.top-list-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.top-list-n:empty { display: none; }
.tb-side-bg { position: fixed; inset: 0; z-index: 60; background: rgba(17,24,39,.45); }

@media (max-width: 1100px) {
  .tb-layout { display: block; max-width: 880px; }
  .top-list:not([hidden]) { display: inline-flex; }
  .tb-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 61; max-height: 78vh; border-radius: 24px 24px 0 0; border: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0,0,0,.18); transform: translateY(105%); transition: transform .25s ease; }
  .tb-side.open { transform: none; }
  .tb-side-x { display: grid; }
}
@media (max-width: 760px) { .top-list .t { display: none; } .top-list { min-width: 44px; justify-content: center; padding: 0 6px; } }

/* ---------- 크게 보기: 옆으로 넘기기 ---------- */
.tb-view { position: fixed; inset: 0; z-index: 80; background: rgba(17,24,39,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tb-view-box { position: relative; width: 100%; max-width: 760px; background: #fff; border-radius: 24px; padding: 12px 0 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.tb-view-top { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 8px 20px; }
.tb-view-n { font-size: 14px; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tb-view-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f2f4f6; color: var(--ink); display: grid; place-items: center; }
.tb-view-stage { position: relative; }
.tb-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 16%; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tb-track::-webkit-scrollbar { display: none; }
.tb-slide { flex: 0 0 68%; scroll-snap-align: center; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #f7f8fa; opacity: .45; transform: scale(.92); transition: opacity .2s, transform .2s; cursor: pointer; }
.tb-slide.cur { opacity: 1; transform: none; cursor: default; box-shadow: 0 8px 24px rgba(17,24,39,.12); }
.tb-slide img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; -webkit-user-drag: none; }
.tb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--ink); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.tb-nav.prev { left: 12px; } .tb-nav.next { right: 12px; }
.tb-nav:disabled { opacity: 0; pointer-events: none; }
.tb-view-t { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 20px 12px; text-align: center; }
.tb-view-t b { font-size: 18px; font-weight: 800; color: var(--ink); }
.tb-view-t span { font-size: 14px; color: var(--ink-faint); }
.tb-view-acts { display: flex; gap: 8px; padding: 0 20px; max-width: 520px; margin: 0 auto; }
.tb-view-acts .btn-primary { flex: 1; }

/* 준비 중 안내 (관리자만 들어올 수 있을 때) */
.tb-gate { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px 28px; min-height: 220px; justify-content: center; }
.tb-gate-spin { margin: 20px auto; }
.tb-gate-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 16px; }
.tb-gate-h { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin: 0 0 8px; color: var(--ink); }
.tb-gate-p { max-width: 360px; margin: 0 0 20px; }
.tb-gate-warn { margin: -8px 0 16px; font-size: 14px; font-weight: 700; color: var(--danger); }
.tb-gate-go { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; width: 100%; max-width: 320px; border-radius: 14px; text-decoration: none; }
.tb-gate-admin { margin-top: 12px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--ink-faint); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tb-gate-admin:disabled { opacity: .5; }

@media (max-width: 560px) {
  .tb-wrap, .tb-layout { padding-top: 16px; }
  .tb-hero { padding: 8px 0 24px; }
  .tb-h1 { font-size: 26px; }
  .m-only { display: inline; }
  .tb-pick { min-height: 176px; }
  .tb-sec { margin-top: 28px; }
  .tb-sec-h { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tb-view { align-items: flex-end; padding: 0; }
  .tb-view-box { border-radius: 24px 24px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .tb-track { padding: 0 9%; gap: 8px; }
  .tb-slide { flex-basis: 82%; }
  .tb-nav { display: none; }
  .tb-view-acts { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { .tb-skel, .tb-skel svg { animation: none; } .tb-card { transition: none; } }
.tb-cost { margin: 8px 4px 0; font-size: 12px; font-weight: 600; color: var(--ink-faint); }

/* 상세페이지로 넘기기 */
.tb-src-new { flex: none; margin-left: auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.tb-src-new:hover { border-color: var(--primary); color: var(--primary); }
.thumb-body .bottom-in .btn-ghost { flex: none; }
.tb-go { position: fixed; inset: 0; z-index: 90; background: rgba(17,24,39,.55); display: grid; place-items: center; padding: 16px; }
.tb-go-box { width: 100%; max-width: 340px; background: #fff; border-radius: 24px; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.tb-go-box b { font-size: 18px; font-weight: 800; color: var(--ink); }
.tb-go-box span { font-size: 14px; color: var(--ink-faint); line-height: 1.5; }

/* 이름 바꾸기 */
.tb-saved-ren { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--ink-faint); display: grid; place-items: center; }
.tb-saved-ren:hover { background: #fff; color: var(--primary); }
.tb-saved .tb-saved-del { min-width: 40px; }
.tb-ren-in { width: 100%; height: 36px; padding: 0 10px; border: 1.5px solid var(--primary); border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: #fff; outline: none; }
.tb-src-nm { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tb-src-nm b { min-width: 0; }
.tb-src-ren { flex: none; width: 36px; height: 36px; margin: -6px 0; border: 0; border-radius: 10px; background: none; color: var(--ink-faint); display: grid; place-items: center; }
.tb-src-ren:hover { background: #f2f4f6; color: var(--primary); }
.tb-src-t { flex: 1; }

/* 골라서 받기 */
.tb-ck { position: absolute; top: 8px; left: 8px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; background: rgba(17,24,39,.28); color: transparent; display: grid; place-items: center; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.tb-ck::before { content: ''; position: absolute; inset: -6px; }   /* 누르는 자리 44px */
.tb-ck:hover { background: rgba(17,24,39,.45); }
.tb-ck.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tb-card.sel { box-shadow: 0 0 0 2px var(--primary); border-color: var(--primary); }
.tb-selbar { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--primary-soft); }
.tb-selbar b { flex: 1; font-size: 14px; font-weight: 800; color: var(--primary); }
.tb-selbar button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.tb-selbar button:hover { color: var(--primary); }

/* AI 4장 더 만들기 */
.tb-more { display: block; }
.tb-more-btn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1.5px dashed #c9bdf8; border-radius: 16px; background: #faf8ff; text-align: left; color: #5b47c9; }
.tb-more-btn:hover:not(:disabled) { background: #f3efff; border-color: #a996f2; }
.tb-more-btn:disabled { opacity: .55; cursor: default; }
.tb-more-ic { flex: none; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; line-height: 1; }
.tb-more-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tb-more-t b { font-size: 15px; font-weight: 800; }
.tb-more-t small { font-size: 12px; color: #7a6bc9; }

/* 움직이는 사진으로 넘어가기 */
.tb-motion { width: 100%; margin-top: 16px; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 16px; background: #fff; text-align: left; transition: background .15s; }
.tb-motion:hover { background: #f8fbff; }
.tb-motion-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.tb-motion-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tb-motion-t b { font-size: 16px; font-weight: 800; color: var(--ink); }
.tb-motion-t small { font-size: 14px; color: var(--ink-faint); }
.tb-motion-go { flex: none; color: var(--ink-faint); }

/* 상세페이지 안 "썸네일" 탭으로 열렸을 때: 머리글은 상세페이지 것을 쓴다 */
.tb-embed .top { display: none; }
.tb-embed body { --top-h: 0px; }
.tb-embed .tb-wrap, .tb-embed .tb-layout { padding-top: 16px; }

/* "상세페이지 만들기"를 숨긴 동안은 "전체 받기"가 아래 줄을 채운다 */
.thumb-body .bottom-in .btn-ghost { flex: 1; }

/* 연출컷 줄 끝의 "AI 사진 4장 더" 점선 카드 */
.tb-card-more { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; border: 1.5px dashed #c9bdf8; background: #faf8ff; color: #5b47c9; text-align: center; cursor: pointer; }
.tb-card-more:hover:not(:disabled) { background: #f3efff; border-color: #a996f2; transform: translateY(-2px); }
.tb-card-more:disabled { opacity: .55; cursor: default; }
.tb-card-more .tb-more-ic { width: 40px; height: 40px; border-radius: 14px; }
.tb-card-more b { font-size: 15px; font-weight: 800; }
.tb-card-more small { font-size: 12px; line-height: 1.4; color: #7a6bc9; }

/* 상세페이지 안 탭(폰)에서 내 썸네일 열기 */
.tb-listrow { display: none; justify-content: flex-end; margin: -8px 0 8px; }
.tb-listrow .top-list { display: inline-flex; min-width: 44px; }
.tb-listrow .top-list .t { display: inline; }
@media (max-width: 1100px) { .tb-embed .tb-listrow:not([hidden]) { display: flex; } }

/* 내 포인트 한 줄 (사진 올리기 아래) */
.tb-pt { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-size: 15px; color: var(--ink-soft); }
.tb-pt b { color: var(--ink); }
.tb-pt-go { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-size: 14px; font-weight: 800; }
.tb-more-p { color: var(--primary); font-weight: 800; }
/* 품목 이름·판매 구성은 사진 올리기 위에 (사진을 올리면 바로 AI 가 만들기 시작한다) */
.tb-hero + .tb-name { margin-top: 0; }
.tb-name + .tb-drop { margin-top: 24px; }

/* ---------- 만들 AI 사진 고르기 (20가지 · 4장/8장) ---------- */
.tb-choose { margin-top: 24px; }
.tb-choose + .tb-drop { margin-top: 20px; }
.tb-ch-seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: #eceef1; margin-bottom: 10px; }
.tb-ch-n { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.tb-ch-n.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(17,24,39,.12); }
.tb-ch-n:disabled { opacity: .4; }
.tb-ch-h { margin: 0 0 10px; font-size: 14px; color: var(--ink-faint); }
.tb-ch-h b { color: var(--primary); }
.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-ch { min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.tb-ch.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; box-shadow: 0 0 0 1px var(--primary) inset; }
.tb-ch.white:not(.on) { background: #fafafa; }
.tb-ch small { font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.tb-ch[data-nopack] { opacity: .6; }
.tb-chooser { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: #fff; border-radius: 24px 24px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
@media (min-width: 640px) { .tb-chooser { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 520px; border-radius: 24px; padding: 24px; } }
.tb-chooser-h { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tb-chooser-h h2 { margin: 0; flex: 1; font-size: 19px; font-weight: 800; color: var(--ink); }
.tb-chooser .tb-side-x { display: grid; }
.tb-ch-go { width: 100%; margin-top: 16px; }

/* 아래 받기 버튼 두 개: 골라서 받기(연한 파랑) + 전체 받기(파랑) */
.thumb-body .bottom-in .tb-btn-sel { flex: 1; min-height: 52px; padding: 0 16px; border: 0; border-radius: 14px; background: #e8f0fe; color: var(--primary); font-size: 17px; font-weight: 700; cursor: pointer; }
.thumb-body .bottom-in .tb-btn-sel:hover:not(:disabled) { filter: brightness(.97); }
.thumb-body .bottom-in .tb-btn-sel.on { box-shadow: inset 0 0 0 2px var(--primary); }
.thumb-body .bottom-in .tb-btn-sel:disabled { opacity: .5; cursor: default; }
/* 상세페이지에 넣기(파랑)가 가장 크게. 받기 두 개는 연한 파랑 */
.thumb-body .bottom-in .tb-btn-go { flex: 1.4; white-space: nowrap; }
.thumb-body .bottom-in .tb-btn-go.tb-wait { opacity: .75; }
.thumb-body .bottom-in .tb-btn-sel { white-space: nowrap; }
/* 폰: 위 줄에 상세페이지에 넣기, 아래 줄에 받기 두 개 */
@media (max-width: 600px) {
  .thumb-body { --bottom-h: 128px; }
  .thumb-body .bottom-in { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .thumb-body .bottom-in .tb-btn-go { order: -1; flex: 1 1 100%; min-height: 50px; font-size: 16px; }
  .thumb-body .bottom-in .tb-btn-sel { flex: 1 1 0; min-height: 46px; font-size: 15px; padding: 0 8px; }
}
/* 고르기 줄: 늘 보이고, 고르면 파랗게 */
.tb-selbar { background: #f2f4f6; }
.tb-selbar b { color: var(--ink-soft); font-weight: 700; }
.tb-selbar.on { background: var(--primary-soft); }
.tb-selbar.on b { color: var(--primary); font-weight: 800; }
.tb-selbar #selAll { color: var(--primary); }
/* "골라서 받기"를 아무것도 안 고르고 누르면 동그라미가 한 번 깜빡인다 */
.tb-ck.hint { animation: tbCkHint .9s ease 2; }
@keyframes tbCkHint { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.25); background: var(--primary); border-color: var(--primary); } }
@media (prefers-reduced-motion: reduce) { .tb-ck.hint { animation: none; } }

/* 배경 바꾸기 (2026-11-04) */
.tb-bgs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 8px; margin: 0 -4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.tb-bg { flex: none; width: 96px; padding: 0; border: 0; background: none; text-align: center; scroll-snap-align: start; cursor: pointer; }
.tb-bg img { display: block; width: 96px; height: 96px; border-radius: 14px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s, transform .15s; }
.tb-bg span { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-bg:not(:disabled):hover img { transform: translateY(-2px); }
.tb-bg.on img { box-shadow: 0 0 0 3px var(--primary); }
.tb-bg.on span { color: var(--primary-dark); }
.tb-bg:disabled { cursor: default; opacity: .5; }
.tb-bg:focus-visible { outline: none; }
.tb-bg:focus-visible img { box-shadow: 0 0 0 3px var(--primary); }
.tb-bg-note { margin: 4px 0 0; font-size: 13px; color: var(--ink-faint); }
.tb-grid-bg { margin-top: 12px; }
.tb-tag.bg { background: #ecfdf5; color: #047857; }
.tb-tag.bgai { background: linear-gradient(90deg, #059669, #2563eb); color: #fff; }
.tb-pol { position: absolute; left: 8px; right: 8px; bottom: 8px; min-height: 36px; border: 0; border-radius: 10px; background: rgba(17,24,39,.72); color: #fff; font-size: 13px; font-weight: 800; backdrop-filter: blur(4px); cursor: pointer; }
.tb-pol:hover { background: rgba(37,99,235,.9); }
.tb-busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(255,255,255,.62); color: var(--primary-dark); font-size: 13px; font-weight: 800; }
.tb-busy svg { animation: tbspin .9s linear infinite; }
@keyframes tbspin { to { transform: rotate(360deg); } }
.tb-card.flash { animation: tbflash 1s ease; }
@keyframes tbflash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--primary); } }
.tb-bgcv { display: block; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; border-radius: 16px; touch-action: none; cursor: grab; background: #f2f4f6; }
.tb-bgcv:active { cursor: grabbing; }
.tb-bgsize { display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 16px auto 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.tb-bgsize input { flex: 1; accent-color: var(--primary); min-height: 44px; }
.tb-bgedit .tb-bg-note { text-align: center; }
.tb-bgedit-acts { display: flex; gap: 8px; max-width: 420px; margin: 16px auto 0; }
.tb-bgedit-acts .btn-primary { flex: 1; }

/* AI로 고치기 (2026-11-04) — 크게 보기(z 80) 위에 뜬다 */
.tb-fix-bg { z-index: 84; }
.tb-fix { z-index: 85; }
.tb-fix-top { display: flex; gap: 12px; margin-bottom: 14px; }
.tb-fix-top img { flex: none; width: 112px; height: 112px; border-radius: 12px; object-fit: cover; background: #f2f4f6; }
.tb-fix-in { position: relative; flex: 1; min-width: 0; }
.tb-fix-in textarea { width: 100%; height: 112px; box-sizing: border-box; resize: none; padding: 12px 12px 26px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink); }
.tb-fix-in textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.tb-fix-n { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: var(--ink-faint); }
.tb-fix .tb-bg-note { margin-top: 12px; }
@media (max-width: 420px) { .tb-fix-top { flex-direction: column; } .tb-fix-top img { width: 100%; height: auto; aspect-ratio: 1; max-height: 40vh; } }
.tb-view-acts .tb-fix-b { white-space: nowrap; }
@media (max-width: 520px) {
  .tb-view-acts { flex-wrap: wrap; }
  .tb-view-acts .btn-ghost { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
  .tb-view-acts .btn-primary { flex: 1 1 100%; }
}

/* 크게 보기: 고르기·전체 선택·마우스로 끌어 넘기기 (2026-11-04) */
.tb-view-top { gap: 8px; }
.tb-view-n { flex: 1; }
.tb-view-all { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-size: 14px; font-weight: 800; cursor: pointer; }
.tb-view-all:hover { background: #dbeafe; }
.tb-slide { position: relative; }
.tb-slide .tb-ck { top: 12px; left: 12px; width: 36px; height: 36px; }
.tb-slide:not(.cur) .tb-ck { opacity: 0; pointer-events: none; }
.tb-track.drag { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.tb-track.drag .tb-slide { transition: none; }
@media (hover: hover) and (pointer: fine) { .tb-track { cursor: grab; } }
.toast { z-index: 100; }   /* 크게 보기·고치기 창 위에서도 보이게 */

/* 사진 고른 뒤 확인 (2026-11-04) */
.tb-ok-img { display: block; width: 100%; max-width: 320px; max-height: 42vh; aspect-ratio: 1; object-fit: contain; margin: 0 auto 14px; border-radius: 16px; background: #f2f4f6; }
.tb-ok-t { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 10px; }
.tb-ok-t b { font-size: 17px; font-weight: 800; color: var(--ink); }
.tb-ok-t span { font-size: 14px; color: var(--ink-soft); }
.tb-ok-k { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.tb-ok-k span { padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; font-weight: 700; }
.tb-ok .tb-ch-h { text-align: center; }

/* 구도 고르기: 무리별 (2026-11-05) */
.tb-ch-g + .tb-ch-g { margin-top: 14px; }
.tb-ch-gt { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
/* 크게 보기 아래 버튼: 글자가 두 줄로 꺾이지 않게 */
.tb-view-acts { max-width: 640px; }
.tb-view-acts button { white-space: nowrap; }
.tb-view-acts .btn-primary { flex: 1 0 auto; min-width: 140px; padding-left: 20px; padding-right: 20px; }
@media (max-width: 520px) { .tb-view-acts .btn-primary { flex: 1 1 100%; } }
.tb-embed { scrollbar-gutter: stable both-edges; }   /* 스크롤 막대가 있어도 가운데가 바깥 탭 줄과 맞게 */
/* 첫 화면: 고른 구도만 짧게 + "구도 바꾸기" (2026-11-05) */
.tb-pick-sel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tb-ch-s { cursor: default; }
.tb-pick-more { min-height: 44px; padding: 0 16px; border: 1px dashed var(--primary); border-radius: 999px; background: #fff; color: var(--primary-dark); font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tb-pick-more small { font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.tb-pick-more:hover { background: var(--primary-soft); }
/* 상세페이지 썸네일 탭 + 넓은 화면(왼쪽에 구멍이 서비스 칸): 썸네일 칸을 꽉 채워 위 탭 줄 양끝과 맞춘다 (app.js 가 tb-wide 를 붙인다) */
.tb-embed.tb-wide { scrollbar-gutter: auto; }
.tb-embed.tb-wide .tb-layout { max-width: none; }
/* 2026-11-06 QA */
.tb-saved > .tb-ren-in { flex: 1; min-width: 0; height: 44px; margin: 6px 0 6px 6px; }
.tb-ok .tb-bgedit-acts button { white-space: nowrap; }
.tb-ok .tb-bgedit-acts .btn-ghost { flex: none; padding-left: 14px; padding-right: 14px; }
.tb-ok .tb-bgedit-acts .btn-primary { min-width: 0; }
@media (max-width: 520px) {
  /* 크게 보기 아래 버튼: 되돌리기까지 3개면 두 줄로 (글자가 잘리지 않게) */
  .tb-view-acts .btn-ghost { flex: 1 1 40%; }
}
