/* 썸네일 만들기 화면(#/thumb). style.css 의 :root 값(색·모서리 6/8/10/999)만 쓴다.
   캔버스 안의 색은 사용자가 고르는 내용이라 여기서 정하지 않는다. */
.th-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.th-stage { gap: 10px; }
.th-wrap { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--bg-subtle); }
.th-wrap canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: none; cursor: grab; outline: 0; }
.th-wrap canvas.dragging { cursor: grabbing; }
.th-wrap canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.th-sel { position: absolute; border: 1px dashed var(--text-2); border-radius: var(--r-sm); pointer-events: none; }
.th-drop { position: absolute; inset: 0; display: none; place-items: center; background: var(--glass); color: var(--text); font-weight: 500; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.th-wrap.over .th-drop { display: grid; }
.th-link { display: inline-flex; align-items: center; min-height: 24px; font-size: 12px; color: var(--text-3); text-decoration: underline; text-underline-offset: 3px; }
.th-link:hover { color: var(--text); }

.th-ctl { gap: 0; padding: 0; }
.th-grp { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-top: 1px solid var(--border); }
.th-grp:first-child { border-top: 0; }
.th-f { gap: 4px; min-width: 0; }
.th-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.th-ctl select { min-width: 0; width: 100%; }
.th-ctl textarea { min-height: 60px; }
.th-ctl .search { min-width: 0; }
.th-yt { flex-wrap: nowrap; }
.th-file { position: relative; }
.th-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-seg { display: flex; flex-wrap: wrap; }
.th-seg button { flex: 1 1 auto; white-space: nowrap; }
.th-seg button.on { box-shadow: inset 0 0 0 1px var(--border-strong); }
.th-check { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--text-2); cursor: pointer; }
.th-ctl input[type=range] { width: 100%; background: transparent; accent-color: var(--accent); cursor: pointer; margin: 0; height: 28px; }
.th-ctl input[type=range]:disabled { opacity: .4; cursor: default; }
.th-color input[type=color] { width: 100%; height: 32px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-surface); cursor: pointer; }
.th-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.th-color input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.th-in { height: 36px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text); outline: 0; width: 100%; }
.th-in:focus { border-color: rgba(122, 162, 255, .55); }
.th-in::placeholder { color: var(--text-4); }

/* 미리 보기: 실제 유튜브 표시 크기 그대로(좁은 화면에서는 이 칸만 옆으로 밀어 봄) */
.th-prev [hidden], .th-stage [hidden] { display: none; }
.th-pout { overflow-x: auto; min-width: 0; }
.th-pv { display: flex; flex-direction: column; gap: 16px; padding: 4px 2px; }
.th-it { display: flex; gap: 16px; min-width: 0; }
.th-im { flex: none; border-radius: var(--r-md); overflow: hidden; background: var(--bg-subtle); }
.th-im img { display: block; width: 100%; height: 100%; object-fit: cover; }
.th-it.mine .th-im { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.th-t { color: var(--text); font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.th-m { color: var(--text-4); font-size: 12px; }
.th-m:empty { display: none; }
.th-pv-search .th-it { width: 760px; }
.th-pv-search .th-t { font-size: 18px; line-height: 26px; font-weight: 400; }
.th-pv-home { display: grid; grid-template-columns: repeat(auto-fill, 320px); gap: 28px 16px; min-width: 320px; }
.th-pv-home .th-it { flex-direction: column; gap: 10px; width: 320px; }
.th-pv-home .th-t { font-size: 16px; line-height: 22px; }
.th-pv-phone { max-width: 420px; gap: 12px; }
.th-pv-phone .th-it { gap: 12px; }
.th-pv-phone .th-im { border-radius: var(--r-sm); }
.th-pv-phone .th-t { font-size: 14px; line-height: 20px; }

@media (max-width: 1100px) {
  .th-grid { grid-template-columns: minmax(0, 1fr); }
}
/* 휴대폰: 조절 칸은 캔버스 아래로, 누르는 칸은 44px */
@media (max-width: 640px) {
  .th-grp { padding: 14px; }
  .th-stage .head-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .th-link { min-height: 44px; display: inline-flex; align-items: center; }
  .th-ctl .btn, .th-prev .btn, #thGet { min-height: 44px; }
  .th-ctl .search, .th-prev .search { height: 44px; }
  .th-seg button, .th-prev .tabs button { min-height: 44px; }
  .th-ctl select, .th-in, .th-color input[type=color] { height: 44px; }
  .th-ctl input[type=range] { height: 44px; }
  .th-check { min-height: 44px; }
  .th-check input[type=checkbox] { width: 22px; height: 22px; }
  .th-pair { grid-template-columns: minmax(0, 1fr); }
  .th-pair:has(.th-color) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .th-yt .btn { flex: none; }
  .th-prev .tabs { flex-wrap: wrap; }
}
