/* 콘텐츠 탭 — 릴스 만들기 (scenes/reels.html). 틀은 ta.css, 여기서는 .s-reels 아래만. */
.s-reels .rl-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.s-reels .ta-app { --ta-side: 1.2fr; }

/* 영상 폴더 목록 */
.s-reels .rl-list { position: absolute; inset: 0; padding: 10px 10px 0; display: grid; align-content: start; gap: 2px; background: #fff; }
.s-reels .rl-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; transition: background .25s, box-shadow .25s; }
.s-reels .rl-row.lit { background: #e9f0ff; box-shadow: inset 0 0 0 1px rgba(22, 89, 239, .28); }
.s-reels .rl-th { position: relative; flex: none; width: 30px; height: 40px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.s-reels .rl-th svg { width: 100%; height: 100%; display: block; }
.s-reels .rl-th::after { content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -4px 0 0 -2px; border-left: 7px solid rgba(255, 255, 255, .92); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.s-reels .rl-th.rl-jpg::after { display: none; }
.s-reels .rl-pick { margin-left: auto; flex: none; padding: 3px 8px; border-radius: 999px; background: #efeafd; color: #5b3fc4; font-style: normal; font-size: 11px; font-weight: 700; opacity: 0; transform: scale(.8); transition: opacity .25s, transform .4s var(--ta-spring); }
.s-reels .rl-row.lit .rl-pick, .s-reels .rl-row.checked .rl-pick { opacity: 1; transform: none; }
.s-reels .ta-ftab:not(:has(.rl-ftab.in)) .rl-all { color: var(--ta-tx); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ta-tx); }
.s-reels .rl-ftab { display: none; }
.s-reels .rl-ftab.in { display: inline-grid; animation: rl-tab .35s var(--ta-glide) both; }
@keyframes rl-tab { from { opacity: 0; transform: translateY(6px); } }

/* 편집 화면 */
.s-reels .rl-ed { position: absolute; inset: 0; display: grid; grid-template-rows: 36px minmax(0, 1fr) auto; background: #fff; opacity: 0; transform: translateY(12px); transition: opacity .35s, transform .55s var(--ta-glide); }
.s-reels .rl-ed.in { opacity: 1; transform: none; }
.s-reels .rl-ed-h { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border-bottom: 1px solid #ececef; white-space: nowrap; }
.s-reels .rl-ed-h b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 700; }
.s-reels .rl-undo { margin-left: auto; flex: none; display: grid; }
.s-reels .rl-undo svg { width: 13px; height: 13px; fill: none; stroke: #8a8a8e; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.s-reels .rl-export { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 7px; background: #5b4ae0; color: #fff; font-size: 11px; font-weight: 700; transition: transform .2s var(--ta-spring); }
.s-reels .rl-export svg { width: 11px; height: 11px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.s-reels .rl-main { display: grid; grid-template-columns: 42px minmax(0, 1fr) 112px; min-height: 0; }
.s-reels .rl-rail { display: grid; align-content: start; gap: 4px; padding: 8px 4px; border-right: 1px solid #f1f1f3; }
.s-reels .rl-rail li { display: grid; justify-items: center; gap: 2px; padding: 5px 0; border-radius: 8px; font-size: 11px; color: var(--ta-sub); }
.s-reels .rl-rail li.on { background: #f1effd; color: #4a3bc4; font-weight: 700; }
.s-reels .rl-rail svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.s-reels .rl-pv { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 4px; padding: 8px 6px 6px; background: #ececef; min-height: 0; }
.s-reels .rl-frame { position: relative; height: 100%; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: #2b2b30; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .5); }
.s-reels .rl-sc { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s; }
.s-reels .rl-frame[data-s="1"] .rl-sc1, .s-reels .rl-frame[data-s="2"] .rl-sc2, .s-reels .rl-frame[data-s="3"] .rl-sc3, .s-reels .rl-frame[data-s="4"] .rl-sc4 { opacity: 1; }
.s-reels .rl-frame[data-s="1"] .rl-sc1 { animation: rl-ken 4s linear both; }
.s-reels .rl-frame[data-s="2"] .rl-sc2 { animation: rl-ken 4s linear both; }
@keyframes rl-ken { from { transform: scale(1.06); } to { transform: scale(1); } }
.s-reels .rl-sub { position: absolute; left: 6px; right: 6px; bottom: 12%; display: grid; text-align: center; }
.s-reels .rl-sub span { grid-area: 1 / 1; align-self: end; justify-self: center; padding: 2px 5px; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; line-height: 1.35; font-weight: 700; word-break: keep-all; opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .35s var(--ta-spring); }
.s-reels .rl-frame[data-sub="1"] .rl-sub span:nth-child(1), .s-reels .rl-frame[data-sub="2"] .rl-sub span:nth-child(2), .s-reels .rl-frame[data-sub="3"] .rl-sub span:nth-child(3), .s-reels .rl-frame[data-sub="4"] .rl-sub span:nth-child(4) { opacity: 1; transform: none; }
.s-reels .rl-time { font-size: 11px; color: var(--ta-sub); font-variant-numeric: tabular-nums; }
.s-reels .rl-time b { color: var(--ta-tx); font-weight: 600; }

.s-reels .rl-set { display: grid; align-content: start; gap: 6px; padding: 10px 10px 0; border-left: 1px solid #f1f1f3; }
.s-reels .rl-k { font-size: 11px; color: var(--ta-faint); }
.s-reels .rl-chips, .s-reels .rl-ratio { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 4px !important; }
.s-reels .rl-chips span { padding: 3px 0; border-radius: 999px; background: #f1f1f3; text-align: center; font-size: 11px; font-weight: 600; color: #3a3a3c; }
.s-reels .rl-ratio { padding: 3px; border-radius: 9px; background: #f1f1f3; gap: 2px; }
.s-reels .rl-ratio span { padding: 3px 0; border-radius: 7px; text-align: center; font-size: 11px; color: var(--ta-sub); }
.s-reels .rl-ratio span.on { background: #fff; color: var(--ta-tx); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* 타임라인 */
.s-reels .rl-tl { border-top: 1px solid #ececef; padding: 0 8px 8px; background: #fbfbfc; }
.s-reels .rl-tool { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; height: 24px; }
.s-reels .rl-tool > svg { width: 13px; height: 13px; fill: none; stroke: #55555a; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.s-reels .rl-ruler { position: relative; height: 24px; font-size: 11px; line-height: 24px; color: var(--ta-faint); font-variant-numeric: tabular-nums; }
.s-reels .rl-ruler span { position: absolute; top: 0; }
.s-reels .rl-ruler span::before { content: ""; position: absolute; left: 50%; bottom: 1px; width: 1px; height: 4px; background: #c9c9ce; }
.s-reels .rl-ruler span:nth-child(1) { left: 0; }
.s-reels .rl-ruler span:nth-child(1)::before { left: 0; }
.s-reels .rl-ruler span:nth-child(2) { left: 33.33%; transform: translateX(-50%); }
.s-reels .rl-ruler span:nth-child(3) { left: 66.66%; transform: translateX(-50%); }
.s-reels .rl-ruler span:nth-child(4) { right: 0; }
.s-reels .rl-ruler span:nth-child(4)::before { left: auto; right: 0; }
.s-reels .rl-tracks { position: relative; display: grid; gap: 4px; }
.s-reels .rl-tr { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; }
.s-reels .rl-ti { display: grid; place-items: center; }
.s-reels .rl-ti svg { width: 12px; height: 12px; fill: none; stroke: #8a8a8e; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.s-reels .rl-lane { position: relative; display: block; height: 22px; border-radius: 6px; background: #f1f1f4; }
.s-reels .rl-tr-vid .rl-lane { height: 34px; }

.s-reels .rl-chip { position: absolute; top: 2px; bottom: 2px; left: var(--x); width: var(--w); display: flex; align-items: center; padding: 0 6px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.3px #6a57e6; color: #3f2fb4; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; opacity: 0; transform: scale(.7); transition: opacity .25s, transform .45s var(--ta-spring); }
.s-reels .rl-chip.in { opacity: 1; transform: none; }
.s-reels .rl-chip.rl-card { background: #fff8e3; box-shadow: inset 0 0 0 1.3px #d9a21e; color: #7a5200; }
.s-reels .rl-clip { position: absolute; top: 0; bottom: 0; left: var(--x); width: var(--w); display: flex; align-items: center; gap: 5px; padding-right: 6px; border-radius: 6px; overflow: hidden; background: #3d2f62; box-shadow: inset 0 0 0 1.5px #6a57e6; color: #fff; opacity: 0; transform: translateY(-10px) scaleX(1.3); transform-origin: left center; transition: opacity .3s, transform .55s var(--ta-glide); }
.s-reels .rl-clip.in { opacity: 1; transform: none; }
.s-reels .rl-clip svg { flex: none; width: 19px; height: 34px; display: block; }
.s-reels .rl-clip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.s-reels .rl-wave { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; padding: 0 6px; border-radius: 6px; background: #e3f4ea; clip-path: inset(0 100% 0 0 round 6px); transition: clip-path 1.1s var(--ta-inout); }
.s-reels .rl-wave.in { clip-path: inset(0 0 0 0 round 6px); }
.s-reels .rl-wave svg { position: absolute; inset: 1px 4px; width: calc(100% - 8px); height: 20px; fill: none; stroke: #63b487; stroke-width: 1.6; stroke-linecap: round; }
.s-reels .rl-wave b { position: relative; padding: 0 5px; border-radius: 4px; background: rgba(227, 244, 234, .92); font-size: 11px; font-weight: 600; color: #22603d; white-space: nowrap; }
.s-reels .rl-head { position: absolute; top: -4px; bottom: -2px; left: 26px; width: 2px; margin-left: -1px; background: #ff3b30; border-radius: 1px; opacity: 0; transition-property: left, opacity; transition-duration: 0s, .2s; transition-timing-function: linear, ease; }
.s-reels .rl-head::before { content: ""; position: absolute; left: -4px; top: -3px; width: 10px; height: 8px; border-radius: 2px 2px 5px 5px; background: #ff3b30; }
.s-reels .rl-head.show { opacity: 1; }

.s-reels .rl-file.hit { animation: rl-flash 1.4s var(--ta-glide) both; }
@keyframes rl-flash { 0% { box-shadow: inset 0 0 0 1px var(--ta-bd), 0 0 0 0 rgba(22, 89, 239, .4); } 40% { box-shadow: inset 0 0 0 1.5px var(--cobalt), 0 0 0 6px rgba(22, 89, 239, .12); } 100% { box-shadow: inset 0 0 0 1px var(--ta-bd), 0 0 0 0 rgba(22, 89, 239, 0); } }

/* 휴대폰: 편집 화면이 거의 다 덮고, 왼쪽 도구 줄·설정 칸은 뺀다 */
@container tadesk (max-width: 700px) {
  .s-reels .ta-side { inset: 7% 0 0 0; }
  .s-reels .ta-tabs { display: none; }
  .s-reels .ta-ft { font-size: 12px; }
  .s-reels .rl-main { grid-template-columns: minmax(0, 1fr); }
  .s-reels .rl-rail, .s-reels .rl-set { display: none; }
  .s-reels .rl-ed-h b, .s-reels .rl-export, .s-reels .rl-time, .s-reels .rl-ruler, .s-reels .rl-chip, .s-reels .rl-clip b, .s-reels .rl-wave b, .s-reels .rl-pick, .s-reels .rl-sub span { font-size: 12px; }
}
/* 좁은 휴대폰: 자막 칩이 좁아 글자 대신 '자막'만 */
@container tadesk (max-width: 520px) {
  .s-reels .rl-chip { justify-content: center; padding: 0 4px; }
  .s-reels .rl-chip > span { display: none; }
  .s-reels .rl-chip::before { content: "자막"; }
}
@media (max-width: 860px) {
  .s-reels .ta-desk { --ta-h: 470px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-reels .rl-ed, .s-reels .rl-clip, .s-reels .rl-chip, .s-reels .rl-wave, .s-reels .rl-sc, .s-reels .rl-ftab.in { transition: none; animation: none; }
}
