/* 4단계 콘티 제작 · 5단계 콘티 공유 */

.ct-form { display: grid; gap: var(--s4); }
.ct-form-tools { display: flex; align-items: center; gap: var(--s2); }
.ct-fs-list { display: grid; gap: var(--s3); }
.ct-fs { display: grid; gap: var(--s3); }
.ct-fs-head { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--s2) var(--s3); }
.ct-fs-title { min-width: 0; overflow-wrap: anywhere; }
.ct-fs-form { margin: 0; }

.ct-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-height: 32px; }
.ct-chip { cursor: grab; }
.ct-chip:not(.badge--hue) { color: var(--tx); }
.ct-chip[aria-pressed="true"] { outline: 2px solid var(--sky-a); outline-offset: 2px; }
.ct-chip:focus-visible { outline: 2px solid var(--sky-a); outline-offset: 2px; }
.ct-chip[draggable="true"]:active { cursor: grabbing; }
.ct-add-btn { margin: 0; }
.ct-sep { margin: var(--s2) 0; border: 0; border-top: 1px solid var(--bd); }

.ct-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3); border: 1px solid var(--bd); border-radius: var(--r-ctl); background: var(--sf-2); }
.ct-tools-row > select { width: auto; }
.ct-bars { display: inline-flex; align-items: center; gap: var(--s2); }
.ct-bars input { width: 80px; }

.ct-lyr { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.ct-lyr-row { display: flex; align-items: flex-start; gap: var(--s3); }
.ct-lyr-text { line-height: 1.6; overflow-wrap: anywhere; }

/* 5단계: 위쪽 탭 줄(텍스트 · 콘티 악보 · PPT), 아래는 고른 탭의 내용 하나 */
.ct-share { display: grid; gap: var(--s3); min-width: 0; }
.ct-share > * { margin: 0; }
.ct-share-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.ct-share-top > .tabs { min-width: 0; }
.ct-share-top > .btn { flex: 0 0 auto; }
.ct-panel { display: grid; gap: var(--s3); min-width: 0; }
.ct-panel[hidden] { display: none; }

/* 텍스트 탭: 복사·다시 만들기 아이콘은 글칸(최대 760px) 오른쪽 끝에 둔다 */
.ct-text-tools { display: flex; justify-content: flex-end; gap: var(--s1); max-width: 760px; }
.ct-text { width: 100%; max-width: 760px; box-sizing: border-box; resize: vertical; font: 400 15px/24px var(--font-sans); }

/* 콘티 악보 탭: 도구 한 줄(좁으면 줄바꿈) */
.ct-sheet-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.ct-sheet-tools > .seg button { display: inline-flex; align-items: center; justify-content: center; }
.ct-sheet-tools > input { flex: 0 0 auto; min-width: 0; }
.ct-sheet-tools > .ct-size { width: 72px; }
/* 색칸은 한 칸짜리 색 견본 (native 색 선택기) */
.ct-sheet-tools > .ct-color { width: 44px; height: 36px; padding: 3px; }
.ct-tog[aria-pressed="true"] { color: var(--sky-a); border-color: var(--sky-a); }

/* 악보 썸네일 격자: 곡마다 묶음, 넓으면 한 줄에 여러 장. 안쪽이 삐져나와도 가로 스크롤이 생기지 않게 자른다 */
.ct-prev { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); min-width: 0; overflow-x: clip; }
.ct-prev[hidden] { display: none; }
.ct-grp { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); min-width: 0; }
.ct-grp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-width: 0; }
.ct-grp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/20px var(--font-sans); color: var(--tx-2); }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); min-width: 0; }
.ct-thumb { min-height: 60px; border: 1px solid var(--bd); border-radius: var(--r-ctl); background: var(--sf-2); overflow: hidden; }
.ct-canvas { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

.ct-none { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.ct-none > .btn { margin: 0; }

@media (min-width: 1024px) {
    .ct-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 639px) {
    .ct-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .ct-share-top > .tabs { flex: 1 1 auto; }
}
