/* title_view.css — 타이틀 상세 두 칸 화면 (링고 10-03 저녁 · 2.206.0 · 새 파일)
   왼쪽 카드 · 오른쪽 「제작 히스토리」. 넓으면 옆에 붙어 따로 구르고, 상세 칸이 1100px 아래면 카드 밑으로.
   ⚠ 기준은 화면 폭이 아니라 **상세 칸 폭**(컨테이너 질의) — 오른쪽 보기 판이 열리면 상세 칸이 좁아진다. */

#detail-tasks { container-type: inline-size; container-name: tdetail; }
/* ⭐ 10-04 밤 · 오른쪽 칸(제작 히스토리 · 리뷰·대화)을 약 1.5배로 — 옛 320~400px → 상세 칸의 40% · 480~600px (링고 「50% 정도 더 왼쪽으로 커져도 된다」)
   타이틀·컷·에셋이 같은 `.tv-wrap` 한 줄 · 상세 칸이 1100px 아래면 여태처럼 카드 밑으로 내려간다(아래 컨테이너 질의). */
.tv-wrap { display: grid; grid-template-columns: minmax(0, 1fr) clamp(480px, 40%, 600px); gap: 14px; align-items: start; }
.tv-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; container-type: inline-size; container-name: tvleft; }   /* 카드 안 칸은 왼쪽 칸 폭으로 잰다 */
.tv-cards { display: flex; flex-direction: column; gap: 14px; }
.tv-right { position: sticky; top: 4.2rem; max-height: calc(100vh - 5.2rem); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* 타이틀 오른쪽 = 리뷰·대화(고른 버전이 있을 때만 · 위) + 제작 히스토리(나머지) */
.sv-episode .tv-right > .sv-talk-card { flex: 0 0 auto; max-height: 45vh; }
.sv-episode .tv-right > .tv-history { flex: 1 1 auto; min-height: 200px; }
@container tdetail (max-width: 1100px) {
  .tv-wrap { grid-template-columns: minmax(0, 1fr); }
  .tv-right { position: static; max-height: none; }
  .sv-episode .tv-right > .sv-talk-card { max-height: none; }
}

/* 카드 틀 */
.tv-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.tv-card > .tv-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.tv-card.closed > .tv-head { border-bottom: 0; }
.tv-card.closed > .tv-body { display: none; }
.tv-card > .tv-head h2 { font-size: 15px; margin: 0; }
.tv-card > .tv-head[data-drag] { cursor: grab; user-select: none; }
.tv-card > .tv-head[data-drag] button, .tv-card > .tv-head[data-drag] input, .tv-card > .tv-head[data-drag] select { cursor: pointer; }
body.tv-grabbing, body.tv-grabbing * { cursor: grabbing !important; user-select: none; }
.tv-drop-line { position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; z-index: 5; }
.tv-card.dragging { opacity: .5; }
.tv-head .tv-count { font-size: 13px; }
.tv-head .spacer { flex: 1; }
.tv-card > .tv-body { padding: 12px 14px; min-width: 0; }
.tv-ibtn { width: 28px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.tv-ibtn .ic { width: 16px; height: 16px; }
.tv-card .tv-fold .ic { transition: transform .15s; }
.tv-card.closed .tv-fold .ic { transform: rotate(-90deg); }

/* 머리 카드 — 10-04 밤부터 컷·에셋 머리 옷(shot_view.css `.sv-hero`·`.sv-facts`·`.sv-band`)을 같이 입는다. 여기는 타이틀만의 것. */
.sv-facts.sv-facts-auto { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }   /* 10-12 · 담당·다음 마감을 빼 셋(컷·결과물·버전) — 5:5 왼쪽에서 한 줄에 서게 150 → 120 */
.sv-fact .tv-bar { height: 5px; margin-top: 5px; }
.tv-tplline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.tv-tplname { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-shotsteps { max-width: 560px; margin-bottom: 10px; }
.tv-shotsteps .tv-stepname { width: 104px; }
.tv-thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg); border: 1px solid var(--line);
            display: flex; align-items: center; justify-content: center; }
.tv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.tv-badge { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.tv-nothumb { font-size: 13px; }
.tv-side { gap: 8px; min-width: 0; }
.tv-hhead { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tv-code { font-weight: 800; font-size: 13px; padding: 1px 8px; border-radius: 6px; background: var(--line); }
.tv-title { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tv-side .ep-info { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tv-side .ep-info-row { display: inline-flex; align-items: center; gap: 6px; }
.tv-meta { font-size: 13px; }
.tv-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; display: flex; min-width: 40px; }
.tv-bar i { display: block; height: 100%; }
.tv-steprows { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; font-size: 12px; }
.tv-steprow { display: flex; align-items: center; gap: 6px; }
.tv-stepname { width: 76px; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tv-stepname b { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tv-stepnum { width: 34px; text-align: right; }
.tv-todo-box { margin: 0 14px 14px; padding: 9px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.tv-todo-box h3 { margin: 0 0 5px; font-size: 13px; }
.tv-todo { list-style: none; margin: 0; padding: 0; }
.tv-todo li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.tv-todo li .linkish { text-align: left; }
.tv-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.tv-dot.ok { background: var(--st-done); } .tv-dot.warn { background: var(--st-retake); } .tv-dot.miss { background: #e0457b; }

/* 태스크 카드 */
.tv-sw { width: 9px; height: 9px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; flex: none; }
.tv-quickrow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tv-quickrow.first .tv-quick { font-size: 14px; padding: .35rem .8rem; border-color: var(--accent); }
.tv-quick { display: inline-flex; align-items: center; gap: 6px; }
.tv-empty { margin: 4px 2px 8px; }
.tv-omit { font-size: 12px; }

/* 퍼블리시 카드 */
.tv-pubgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; max-width: 1100px; }   /* 10-04 밤 · 폭 줄이기 */
@container tvleft (max-width: 640px) { .tv-pubgrid { grid-template-columns: minmax(0, 1fr); } }
.tv-ways { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.tv-way { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.tv-way.on { border-color: var(--accent); }
.tv-way small { display: block; color: var(--muted); font-size: 11px; }
.tv-pubacts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tv-pubacts .off { opacity: .45; cursor: not-allowed; }
.tv-sub { font-size: 12px; margin-bottom: 4px; }

/* 행사 카드 */
.tv-settle { margin-top: 10px; }
.tv-settle h3 { font-size: 13px; margin: 0 0 4px; }
.tv-settle-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* 컷 카드 — 썸네일 격자(테두리 = 컷 상태) */
.tv-shotgrid.ep-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tv-shotgrid .ep-link-row.tv-shot { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0 0 4px; border: 2px solid var(--st, var(--line));
  border-radius: 8px; overflow: hidden; background: var(--bg); text-align: left; min-width: 0; }
.tv-shotgrid .tv-shot .thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 0; }
.tv-shotgrid .tv-shot .thumb.none { background: repeating-linear-gradient(45deg, var(--line) 0 6px, transparent 6px 12px); }
.tv-shotgrid .tv-shot b, .tv-shotgrid .tv-shot span { padding: 0 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 폴더 — 아이콘(누르면 열림 · 경로는 풍선 · ⋯ 에 경로 복사·바꾸기·구조 맞추기) */
.fi-wrap { display: flex; flex-direction: column; gap: 8px; }
.fi-groups { display: flex; flex-direction: column; gap: 8px; }
.fi-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fi-tile { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg); color: var(--fg); font-weight: 600; cursor: pointer; }
.fi-tile:hover { border-color: var(--accent); }
.fi-tile .ic { width: 18px; height: 18px; color: #e3b341; }
.fi-tile.small { height: 28px; font-weight: 500; font-size: 12px; padding: 0 9px; }
.fi-tile.small .ic { width: 15px; height: 15px; }
.fi-tile .deliv-dot { position: absolute; right: -3px; top: -3px; }
/* 10-07 · 실물 폴더가 없는 타일(폴더 아이콘 전부 — 타이틀·컷·에셋·품목 줄) = 흐리게 + 흑백 · 있는 것은 그대로 */
.tv-head h2 .ic { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.fi-missing { opacity: .5; filter: grayscale(1); }
.fi-missing:hover { opacity: .85; }
.fi-ok { position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--st-done); border: 2px solid var(--panel); }
.fi-kids { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 4px; padding-left: 10px; border-left: 2px solid var(--line); }
.fi-more { width: 28px; height: 26px; padding: 0; font-weight: 700; }
.fi-pop .origin-path { display: block; margin: 4px 0 8px; word-break: break-all; }
.fi-pop-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.deliv-folder-btn.icon-only { width: 28px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.deliv-folder-btn.icon-only .ic { width: 16px; height: 16px; color: #e3b341; }

/* 올릴 준비 */
.ready-box { max-width: 980px; }   /* 10-04 밤 · 폭 줄이기 — 항목 · 첫 줄 · 상태 · 단추가 화면 끝까지 퍼지지 않게(링고 「와이드하면 파악하기 힘들다」) */
.ready-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ready-head .tv-bar { height: 10px; }
.ready-old { color: var(--st-retake); font-size: 13px; }
.ready-title { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; }
.ready-title .spacer, .ready-cell .spacer, .ready-foot .spacer { flex: 1; }
.ready-table td:first-child { white-space: nowrap; }
.ready-table td:first-child .deliv-dot { margin-right: 6px; }
.ready-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ready-cell .ready-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: left; flex: 0 1 auto; }
.ready-row.warn td { background: color-mix(in srgb, var(--st-retake) 9%, transparent); }
.ready-state { font-size: 12px; padding: 0 8px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.ready-state.ok { color: var(--st-done); } .ready-state.warn { color: var(--st-retake); } .ready-state.miss { color: var(--muted); }
.ready-again { color: var(--st-retake); border-color: color-mix(in srgb, var(--st-retake) 60%, transparent); white-space: nowrap; }
.ready-copy { white-space: nowrap; }
.ready-copy .ic { width: 15px; height: 15px; }
.ready-foot { display: flex; gap: 10px; align-items: center; font-size: 12px; margin-top: 8px; }

/* 제작 히스토리 */
.tv-history { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.tv-history > .tv-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; }
@container tdetail (max-width: 1100px) { .tv-history > .tv-body { overflow: visible; } }
.hist-write { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--bg); }
.hist-write.drop-on { border-color: var(--accent); }
.hist-input { font: inherit; width: 100%; resize: vertical; min-height: 2.6em; box-sizing: border-box; }
.hist-write-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.hist-write-row .spacer { flex: 1; }
.hist-hint { font-size: 11px; }
.hist-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.hist-chip { border: 1px solid var(--line); background: transparent; color: var(--fg); border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.hist-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.hist-list { display: flex; flex-direction: column; }
.hist-row { display: flex; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.hist-row:hover { background: var(--bg); }
.hist-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--line); flex: none; }
.hist-ico .ic { width: 13px; height: 13px; }
.hist-row.k-review.v-approved .hist-ico { background: color-mix(in srgb, var(--st-done) 40%, transparent); }
.hist-row.k-review.v-rejected .hist-ico { background: color-mix(in srgb, var(--st-retake) 45%, transparent); }
.hist-row.k-post .hist-ico { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.hist-main { flex: 1; min-width: 0; }
.hist-line { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.hist-what { font-weight: 700; }
.hist-where { font-weight: 600; }
.hist-task { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.hist-task b { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.hist-tag { font-size: 11px; padding: 0 6px; border-radius: 5px; background: var(--line); color: var(--muted); }
.hist-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hist-meta { font-size: 11px; margin-top: 2px; }
.hist-status { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; font-size: 12px; }
.hist-pic { position: relative; width: 84px; flex: none; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.hist-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-strokes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hist-pics { display: flex; gap: 3px; flex: none; }
.hist-pics img { width: 48px; height: 48px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.hist-del { width: 24px; height: 24px; padding: 0; opacity: .6; }
.hist-del:hover { opacity: 1; }
.hist-del .ic { width: 14px; height: 14px; }
.hist-more { align-self: center; margin: 6px 0; }

/* 10-10 · 연결 넣는 줄 값 칸 드롭다운 */
.link-pick { position: absolute; z-index: 30; margin: 0; padding: 4px; list-style: none; max-height: 320px; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.link-pick[hidden] { display: none; }
.link-pick .link-pick-row { padding: 5px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.link-pick .link-pick-row.on { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
