/* Genver Video Pro 고유 화면.
 * app.css(형제앱 공통 셸)를 건드리지 않고 여기에만 추가한다.
 * 새로 만든 토큰은 원가 표시용 --money 하나뿐이다. */

:root {
  --money: #9a5700;
  --money-subtle: #fdf2e4;
}

.money {
  color: var(--money);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── 1열: 원가 칩 (model-chip 과 같은 계열) ─────────────────── */

.cost-chip {
  padding: 8px 9px 7px;
  margin-bottom: 6px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  background: var(--bg-panel);
}
.cc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.cc-label {
  font-size: 10px;
  color: var(--text-3);
}
.cc-value {
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--money);
  font-variant-numeric: tabular-nums;
}
.cc-meter {
  position: relative;
  height: 4px;
  margin: 6px 0 5px;
  border-radius: 2px;
  background: var(--bg-subtle);
  overflow: hidden;
}
.cc-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--accent);
}
.cc-foot {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.model-chip.is-dev {
  margin-top: 6px;
  background: var(--money-subtle);
  border-color: #f0dcbe;
}
.model-chip.is-dev .dot {
  background: var(--money);
  box-shadow: 0 0 0 3px #f7e7cd;
}
.model-chip.is-dev strong {
  color: var(--money);
}

/* ── 2열: 단계 목록 푸터 (docs .toc-foot 패턴) ──────────────── */

.detail-foot {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-1);
  background: var(--bg-panel);
}
.detail-foot .btn {
  flex: 1;
}

.dt-row .dt-gate {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-text);
}
.dt-row .dt-cost {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ── 3열: 대화 안의 승인 카드 ───────────────────────────────── */

.ask-card {
  margin-top: 10px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r-10);
  background: var(--accent-subtle);
  overflow: hidden;
}
.ask-card.is-warn {
  border-color: #f0dcbe;
  background: var(--money-subtle);
}
.ask-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px 7px;
  font-size: var(--fs-11);
  font-weight: 700;
  color: var(--accent-text);
}
.ask-card.is-warn .ask-head {
  color: var(--money);
}
.ask-lines {
  padding: 0 11px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ask-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-12);
  color: var(--text-2);
}
.ask-line b {
  font-weight: 600;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.ask-line.is-total {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid var(--accent-border);
  color: var(--text-1);
  font-weight: 600;
}
.ask-card.is-warn .ask-line.is-total {
  border-top-color: #f0dcbe;
}

/* 단계 액션 바 — 대화와 입력창 사이. 진행 버튼은 여기에만 있다. */

.step-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 11px;
  border-top: 1px solid var(--accent-border);
  background: var(--accent-subtle);
}
.sa-text {
  font-size: var(--fs-11);
  line-height: 1.55;
  color: var(--accent-text);
  word-break: keep-all;
}
.sa-btns {
  display: flex;
  gap: 6px;
}
.sa-btns .btn {
  flex: 1;
}
.sa-btns .btn.primary {
  flex: 1.4;
}

.msg .kit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 10px;
}
.kit-sw {
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  overflow: hidden;
  background: var(--bg-panel);
}
.kit-sw i {
  display: block;
  height: 26px;
}
.kit-sw span {
  display: block;
  padding: 3px 5px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ── 4열: 작업판 ────────────────────────────────────────────────
 * 형제앱의 미리보기 열처럼, 박스를 늘어놓지 않고 종이 한 장을
 * 가라앉은 배경 위에 올린다. 구획은 테두리가 아니라 실선 한 줄로 나눈다.
 * ------------------------------------------------------------ */

.work {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.work > * {
  flex: none;
}

.sheet {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  border: 1px solid var(--border-1);
  border-radius: var(--r-10);
  background: var(--bg-panel);
  box-shadow: var(--sh-paper);
  overflow: hidden;
}

.sheet-head {
  padding: 20px 24px 17px;
  border-bottom: 1px solid var(--border-1);
}
.sheet-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--accent-text);
}
.sheet-title {
  margin-top: 3px;
  font-size: var(--fs-17);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.sheet-lead {
  max-width: 64ch;
  margin-top: 6px;
  font-size: var(--fs-12);
  line-height: 1.6;
  color: var(--text-2);
  word-break: keep-all;
}

.ed-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  font-size: var(--fs-11);
  color: var(--text-3);
}
.ed-hint svg {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--accent-text);
}

/* ── 편집 가능한 값 ───────────────────────────────────────────────────────
 * 고칠 수 있는 곳만 점선을 깔아 둔다. 읽을 때는 조용하고, 손을 대면 응답한다.
 * ---------------------------------------------------------------------- */

.ed {
  border-radius: 3px;
  cursor: text;
  /* 밑줄은 글줄 높이를 건드리지 않는 text-decoration 으로 그린다 */
  text-decoration: underline dashed var(--text-3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: none;
  transition: background 0.12s;
}
.ed.block {
  display: block;
}
.ed:hover {
  background: var(--bg-hover);
  text-decoration-color: var(--accent);
}
.ed:focus {
  outline: none;
  background: rgba(13, 148, 136, 0.08);
  box-shadow: var(--ring);
  text-decoration-color: var(--accent);
}
.ed:empty::before {
  content: "비어 있음";
  color: var(--text-3);
}

.ed-num {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}
.ed-num input {
  width: 34px;
  padding: 1px 0 1px 3px;
  border: 1px solid transparent;
  border-radius: var(--r-6);
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  -moz-appearance: textfield;
}
.ed-num input::-webkit-outer-spin-button,
.ed-num input::-webkit-inner-spin-button {
  margin: 0;
  opacity: 0;
}
.ed-num:hover input {
  border-color: var(--border-2);
  background: var(--bg-panel);
}
.ed-num input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-panel);
  box-shadow: var(--ring);
  opacity: 1;
}
.ed-num input:focus::-webkit-inner-spin-button {
  opacity: 1;
}

/* 툴바의 편집 표시 — 몇 개를 고쳤고, 어떻게 되돌리는가 */

.ed-count {
  color: var(--accent-text);
  font-weight: 600;
}
.ed-reset {
  height: 19px;
  margin-left: 2px;
  padding: 0 7px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-2);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.ed-reset:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* 구획 */

.sec {
  padding: 18px 24px 20px;
}
.sec + .sec {
  border-top: 1px solid var(--border-1);
}
.sec.flush {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 4px;
}
.sec.flush > .sec-head {
  padding: 0 24px;
}
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.sec-title {
  font-size: var(--fs-13);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.sec-note {
  font-size: var(--fs-11);
  color: var(--text-3);
  text-align: right;
  word-break: keep-all;
}
.sec-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-1);
  font-size: var(--fs-11);
  color: var(--text-3);
}
.sec.flush > .sec-foot {
  margin: 0 24px;
}
.sec-body-note {
  margin-top: 11px;
  font-size: var(--fs-11);
  line-height: 1.65;
  color: var(--text-3);
  word-break: keep-all;
}

.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 30px;
}
.cols.c3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cols.split {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}
.col-title {
  margin-bottom: 9px;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
}

/* 큰 숫자 — 견적과 정산의 결론 */

.figs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-sidebar);
}
.fig {
  padding: 15px 20px 16px;
  min-width: 0;
}
.fig + .fig {
  border-left: 1px solid var(--border-1);
}
.fig-label {
  display: block;
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fig-value {
  display: block;
  margin-top: 3px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.fig.is-money .fig-value {
  color: var(--money);
}
.fig-sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.fig-value.ok {
  color: var(--success);
}
.fig-value.over {
  color: var(--danger);
}
.fig-value.sm {
  font-size: var(--fs-14);
  letter-spacing: -0.01em;
}

/* 표 */

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-12);
}
.tbl th {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-3);
  white-space: nowrap;
}
.tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-1);
  vertical-align: middle;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
.sec.flush .tbl th:first-child,
.sec.flush .tbl td:first-child {
  padding-left: 24px;
}
.sec.flush .tbl th:last-child,
.sec.flush .tbl td:last-child {
  padding-right: 24px;
}
.tbl .r {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbl .idx {
  width: 22px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.tbl .sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-3);
}
.tbl tr.dim td,
.tbl tr.dim .r {
  color: var(--text-3);
}
.tbl tr.total td {
  border-top: 1px solid var(--border-2);
  border-bottom: 0;
  font-weight: 650;
  background: var(--bg-sidebar);
}
.tbl select {
  height: 24px;
  max-width: 100%;
  padding: 0 4px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-4);
  background: var(--bg-panel);
  font: inherit;
  font-size: var(--fs-11);
}

/* 이름 · 값 목록 */

.dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 14px;
  font-size: var(--fs-12);
}
.dl dt {
  color: var(--text-3);
  white-space: nowrap;
}
.dl dd {
  text-align: right;
  font-weight: 500;
  word-break: keep-all;
}

/* 색상 팔레트 */

.pal {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.pal-item i {
  display: block;
  height: 58px;
  border-radius: var(--r-8);
  /* 밝은 색이 흰 종이 위에서 사라지지 않게 윤곽을 남긴다. */
  box-shadow: inset 0 0 0 1px rgba(20, 20, 35, 0.14);
}
.pal-item b {
  display: block;
  margin-top: 7px;
  font-size: var(--fs-12);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pal-item span {
  display: block;
  font-size: 10px;
  color: var(--text-3);
}

/* 입력 */

.fld + .fld {
  margin-top: 16px;
}
.fld-label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
}
.fld input[type="url"],
.fld textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  font: inherit;
  font-size: var(--fs-12);
  resize: vertical;
}
.fld input[type="url"]:focus,
.fld textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pill {
  height: 25px;
  padding: 0 11px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-11);
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}
.pill:hover {
  border-color: var(--border-3);
  color: var(--text-1);
}
.pill.on {
  background: var(--accent);
  border-color: transparent;
  color: var(--text-inv);
  font-weight: 600;
}

/* 첨부 파일 · 수집 로그 — 테두리 없이 실선 한 줄로만 구분 */

.files {
  list-style: none;
}
.files li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-1);
}
.files li:last-child {
  border-bottom: 0;
}
.files .ext {
  padding: 3px 0;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}
.files .nm {
  font-size: var(--fs-12);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files .mt {
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.loglist {
  list-style: none;
}
.loglist li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-1);
  font-size: var(--fs-12);
}
.loglist li:last-child {
  border-bottom: 0;
}
.loglist svg {
  width: 12px;
  height: 12px;
  color: var(--success);
  transform: translateY(2px);
}
.loglist em {
  font-style: normal;
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 기획 — 구성과 원고 */

.beats {
  list-style: none;
}
.beats li {
  display: grid;
  grid-template-columns: 54px auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-1);
  font-size: var(--fs-12);
  color: var(--text-2);
}
.beats li:last-child {
  border-bottom: 0;
}
.beats .bt {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.beats .bn {
  font-size: var(--fs-11);
  font-weight: 650;
  color: var(--accent-text);
}

.script p {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  font-size: var(--fs-12);
  line-height: 1.7;
  word-break: keep-all;
}
.script p + p {
  margin-top: 9px;
}
.script .ts {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 트랙 배지 */

.track {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-2);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.track.gen {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent-text);
}
.track.still {
  border-color: #d9d3ef;
  background: #f5f2fd;
  color: #5b45a8;
}
.track.graphic {
  border-color: transparent;
  background: var(--bg-subtle);
  color: var(--text-3);
  cursor: default;
}

/* 콘티 — 컨택트 시트 */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 18px 16px;
}
.shot-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: var(--fs-11);
}
.shot-head .no {
  font-weight: 650;
}
.shot-head .tm {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.cands {
  display: grid;
  gap: 3px;
}
.cand {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  border-radius: var(--r-6);
  background: var(--bg-subtle);
  cursor: pointer;
  overflow: hidden;
}
.cand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cand .ph {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 6px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-3);
  text-align: center;
  word-break: keep-all;
}
.cand::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-6);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 35, 0.08);
}
.cand.on::after {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.cand .tag {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 5px;
  padding: 0 5px;
  border-radius: 3px;
  background: rgba(15, 15, 20, 0.55);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.shot-foot {
  margin-top: 7px;
}
.shot-foot .ttl {
  display: block;
  font-size: var(--fs-12);
  font-weight: 600;
}
.shot-foot .pr {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-3);
  word-break: keep-all;
}
.shot-foot .rw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
}
.shot-foot .rw span {
  font-size: 10px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 예상 대비 실제 */

.delta {
  font-size: var(--fs-11);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.delta.up {
  color: var(--danger);
}
.delta.down {
  color: var(--success);
}
.delta.same {
  color: var(--text-3);
  font-weight: 400;
}
.verdict {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.verdict.ok {
  background: var(--success-subtle);
  color: var(--success);
}
.verdict.over {
  background: var(--danger-subtle);
  color: var(--danger);
}

/* 납품 */

.stage {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
}
.stage-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding: 0 2px;
  font-size: var(--fs-11);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.stage-meta b {
  font-weight: 600;
  color: var(--text-2);
}

.deliv {
  list-style: none;
}
.deliv li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-1);
}
.deliv li:last-child {
  border-bottom: 0;
}
.deliv .tb {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: var(--r-6);
  background: var(--bg-subtle);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
}
.deliv .nm {
  font-size: var(--fs-12);
  font-weight: 600;
}
.deliv .mt {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-3);
}
.deliv .r {
  font-size: var(--fs-12);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 좁은 화면: docs 패턴대로 메뉴를 아이콘 레일로 접고 3·4열을 2행으로 */

@media (max-width: 1340px) {
  .app {
    grid-template-columns:
      52px var(--split-w)
      minmax(220px, var(--detail-w)) var(--split-w)
      minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
  .menu {
    grid-row: 1 / -1;
    padding: 12px 8px;
  }
  .splitter[data-split="menu"] {
    grid-row: 1 / -1;
  }
  .detail {
    grid-row: 1 / -1;
  }
  .splitter[data-split="detail"] {
    grid-row: 1 / -1;
  }
  .splitter[data-split="chat"] {
    display: none;
  }
  .chat {
    grid-column: 5;
    grid-row: 1;
    border-right: 0;
  }
  .preview {
    grid-column: 5;
    grid-row: 2;
    border-top: 1px solid var(--border-2);
  }
  .brand .txt,
  .nav-label,
  .menu-foot {
    display: none;
  }
  .nav-item span:not(.ico) {
    display: none;
  }
  .cols,
  .cols.c3,
  .cols.split {
    grid-template-columns: minmax(0, 1fr);
  }
  .figs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fig:nth-child(3) {
    border-left: 0;
  }
  .fig:nth-child(n + 3) {
    border-top: 1px solid var(--border-1);
  }
}

/* ── 실제 서버에 붙이면서 더한 것 ─────────────────────────────────────
 * 서버가 돌려준 detail 문장을 대화에 그대로 띄운다. 조용한 실패가 없어야
 * 하므로 눈에 띄어야 하고, 대화 흐름을 끊지는 않아야 한다. */

.msg.assistant .bubble.is-warn {
  border-color: #f0dcbe;
  background: var(--money-subtle);
  color: var(--money);
}

/* 4열 폼 안의 입력. .fld 규칙이 url/textarea 만 잡고 있어 text·number 를 더한다. */
.fld input[type="text"],
.fld input[type="number"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  font: inherit;
  font-size: var(--fs-12);
}

/* 후보 격자에 영상이 들어온다. 6단계는 스틸이 아니라 클립을 고른다. */
.cand video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 파일 첨부는 label 안에 감춘 input 이라 버튼 정렬만 맞춰 준다. */
label.btn {
  cursor: pointer;
}

.sec audio {
  width: 100%;
}

/* ── 후보 비교 창 ──────────────────────────────────────────────────────
 *
 * 컨택트 시트의 카드는 작아도 된다. 거기서는 "무엇이 있는지" 만 보면 되고, 고르는
 * 일은 이 창에서 한다. 그래서 여기서는 화면을 거의 다 쓴다. 후보 두 개를 나란히
 * 놓아도 각각 가로 절반을 차지하도록 두었다. */

body.vw-open {
  overflow: hidden;
}

.vw {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  /* 여기서부터 묶어야 한다. 기본 auto 행은 내용에 맞춰 창보다 커지고, 그러면
     아래의 height:100% 가 그 커진 값을 물려받아 소용이 없어진다. */
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
}
.vw-back {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 27, 0.62);
  backdrop-filter: blur(2px);
}
.vw-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1680px, 100%);
  /* 높이를 창에서 받아 확정한다. 내용에 맡기면 무대 높이가 <video> 의 고유 크기에
     달리게 되는데, 메타데이터가 오기 전의 <video> 는 기본값 150px 다. 그래서
     파일이 큰 환경에서는 후보가 150px 로 주그러든 채 열린다. 실제로 그랬다. */
  height: 100%;
  padding: 14px 16px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-10);
  background: var(--bg-panel);
  box-shadow: 0 24px 70px rgba(12, 14, 22, 0.34);
}

.vw-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.vw-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.vw-no {
  font-size: var(--fs-14);
  font-weight: 700;
}
.vw-of,
.vw-tm {
  font-size: var(--fs-11);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.vw-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.vw-x {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}
.vw-x:hover {
  background: var(--bg-hover);
}

/* 무대. 클립 하나가 창을 다 쓴다. */
.vw-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 12px;
  /* 행이 minmax(0, 1fr) 이어야 무대가 영상의 고유 높이 밑으로 줄어든다. 기본
     auto 행은 min-content 아래로 줄지 않으므로, 16:9 세로(917px)가 그대로 밀고
     나와 재생 손잡이를 화면 밖으로 밀어낸다. */
  grid-template-rows: minmax(0, 1fr);
}
.vw-media {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: var(--r-8);
  background: #0d1016;
  overflow: hidden;
}
.vw-media video,
.vw-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.vw-wait {
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.66);
  font-size: var(--fs-12);
}
.vw-cost {
  font-size: var(--fs-11);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 이동. */
.vw-transport {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.vw-play {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  color: var(--text-1);
  font-size: 11px;
  cursor: pointer;
}
.vw-seek {
  flex: 1;
  accent-color: var(--accent);
}
.vw-clock {
  font-size: var(--fs-11);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.vw-foot {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-1);
}
.vw-prompt {
  min-width: 0;
  flex: 1;
}
.vw-prompt b {
  display: block;
  font-size: var(--fs-12);
}
.vw-prompt span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vw-acts {
  display: flex;
  align-items: center;
  gap: 7px;
}
.vw-state {
  margin-right: 4px;
  font-size: var(--fs-11);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.vw-keys {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 10px;
  text-align: center;
}

/* 컨택트 시트 칸은 컷마다 클립 하나를 카드 폭 그대로 보여 준다. 칸 자체도 조금
   넓혔다 — 196px 은 사람 얼굴이 든 컷을 판단하기에 좁았다. */
.board {
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.cand-more {
  position: absolute;
  z-index: 1;
  right: 5px;
  bottom: 5px;
  padding: 1px 7px;
  border-radius: 3px;
  background: rgba(15, 15, 20, 0.62);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
}
.cand:hover .cand-more {
  background: var(--accent);
}
.shot-foot .rw-btns {
  display: flex;
  gap: 5px;
}

/* ── 3단계: 화면에 나오는 글자 ─────────────────────────────────────────
 *
 * 컷 줄 아래에 붙는 두 번째 줄. 컷 한 줄에 밀어 넣으면 여섯 칸이 서로를 누르고,
 * 접어 두면 만들기 전에 읽어야 하는 글자를 아무도 읽지 않는다. 그래서 펼친 채로
 * 컷과 한 덩어리로 보이게 묶는다. */

.tbl tr.ovf-on > td {
  border-bottom: 0;
  padding-bottom: 4px;
}
.tbl tr.ovf-row > td {
  padding-top: 0;
}
.ovf {
  padding: 9px 11px 10px;
  border: 1px solid var(--border-1);
  border-left: 2px solid var(--accent-border);
  border-radius: var(--r-6);
  background: var(--bg-sidebar);
}
.ovf-head {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-3);
}
.ovf-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 7px 20px;
}
.ovf-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  font-size: var(--fs-12);
}
.ovf-k {
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-3);
  word-break: keep-all;
}
.ovf-v {
  min-width: 0;
  word-break: keep-all;
}
.ovf-note {
  margin-top: 9px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-3);
  word-break: keep-all;
}
.ovf-note.is-miss {
  color: var(--danger);
}

/* 고칠 수 없는 값 — 킷에서 온 것이다. 점선이 없어 옆의 고칠 수 있는 칸과 구별된다. */
.ro.is-empty {
  color: var(--text-3);
}
.kit-tag {
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: var(--bg-panel);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
}

/* 비어 있는 필수값. 값이 없으면 렌더에서 그 요소가 사라지므로 조용히 두면 안 된다. */
.miss,
.miss-count {
  font-style: normal;
  font-weight: 700;
  color: var(--danger);
}
.miss {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--danger-subtle);
  font-size: 9px;
}

/* 글자 수 상한. 넘긴 문구는 서버가 말없이 자르므로 고치는 동안 보여 준다. */
.lim {
  margin-left: 4px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  color: var(--text-4, var(--text-3));
}
.lim.is-over {
  font-weight: 700;
  color: var(--danger);
}

/* ── 6단계: 장면 목록 ─────────────────────────────────────────────────── */

.scn {
  list-style: none;
}
.scn li {
  display: grid;
  grid-template-columns: 22px 62px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-1);
}
.scn li:last-child {
  border-bottom: 0;
}
.scn .no {
  font-size: var(--fs-11);
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.scn .th {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-4);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 35, 0.08);
  overflow: hidden;
}
.scn .th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scn .ttl {
  display: block;
  font-size: var(--fs-12);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scn .mt {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.scn .bg {
  display: flex;
  align-items: center;
  gap: 5px;
}
.scn .ac {
  display: flex;
  gap: 5px;
}

/* 펼친 편집판. 줄 전체를 가로질러야 한다 — 격자 칸 하나에 들어가면 폭이 버튼 너비로
   줄어 한글이 한 글자씩 세로로 쪼개진다. */
.scn-ed {
  grid-column: 1 / -1;
  margin: 4px 0 10px 96px;
  padding: 11px 12px 12px;
  border: 1px solid var(--border-1);
  border-left: 2px solid var(--accent-border);
  border-radius: var(--r-6);
  background: var(--bg-sidebar);
}
.scn-ed .ovf {
  margin-top: 10px;
  border: 0;
  border-left: 0;
  padding: 0;
  background: none;
}
.scn-ed-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  font-size: var(--fs-12);
}
.scn-ed-row + .scn-ed-row {
  margin-top: 8px;
}
.scn-ed-k {
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-3);
  word-break: keep-all;
}
.scn-ed-v {
  min-width: 0;
  word-break: keep-all;
}
/* 말로 고치는 칸. 편집판에서 맨 위에 온다 — 부품 이름을 모르는 사람이 먼저 닿아야
   하는 자리다. */
.ask-scene {
  padding: 10px 11px 11px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r-6);
  background: var(--accent-subtle);
}
.ask-k {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
}
.ask-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.ask-in {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-4);
  background: var(--bg-app);
  font: inherit;
  font-size: var(--fs-12);
  line-height: 1.55;
  color: var(--text-1);
  resize: vertical;
  word-break: keep-all;
}
.ask-in:focus {
  outline: 2px solid var(--accent-border);
  outline-offset: -1px;
}
.ask-say {
  margin-top: 9px;
  padding: 8px 10px;
  border-left: 2px solid var(--accent-border);
  background: var(--bg-app);
  border-radius: var(--r-4);
  font-size: var(--fs-12);
  line-height: 1.65;
  word-break: keep-all;
}
.ask-note {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-3);
  word-break: keep-all;
}
.scn-ed-hint {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-3);
  word-break: keep-all;
}
.scn-ed-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border-1);
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-3);
}
.scn li.open {
  background: var(--bg-subtle);
}

/* 다시 렌더를 기다리는 장면. 실패도 성공도 아니라 「아직 반영되지 않았다」 다. */
.verdict.wait {
  background: var(--warning-subtle);
  color: var(--warning);
}

/* 내려받는 동안. 포스터가 구도는 보여 주지만 움직임은 아직 오지 않았다. */
.vw-load {
  position: absolute;
  z-index: 1;
  bottom: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: var(--r-4);
  background: rgba(12, 14, 20, 0.7);
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
}

/* 목록에 없는 영상 종류를 직접 적는 칸. 종류가 구성을 바꾸므로, 만들고 싶은 것이
   목록에 없을 때 비슷한 것을 고르게 두면 비슷한 영상이 나온다. */
.kind-free {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.kind-free input {
  flex: 1;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-4);
  background: var(--bg-app);
  font: inherit;
  font-size: var(--fs-12);
  color: var(--text-1);
}
.fld-note {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-3);
  word-break: keep-all;
}
.fld-note .dim {
  color: var(--text-3);
  opacity: 0.75;
}

/* 목소리 고르기. 이름만 늘어놓으면 무엇을 고르는지 알 수 없어 설명을 함께 세운다. */
.voices {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.voice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  background: var(--bg-app);
}
.voice.on {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.voice-pick {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.voice-pick b {
  display: block;
  font-size: var(--fs-12);
  font-weight: 600;
}
.voice-pick span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-3);
  word-break: keep-all;
}

/* 「이 단계부터 다시」. 고칠 대상을 보고 있는 자리에 둔다 — 대화창 아래까지 가지
   않아도 되도록. 뒤 단계가 무효가 된다는 것을 같은 줄에 적는다. */
.restart {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  background: var(--bg-subtle);
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-3);
  word-break: keep-all;
}

/* 영상 컨셉 3안. 대표 이미지가 이 화면의 핵심이므로 그림을 가장 크게 세운다 —
   「2D 플랫 모션그래픽」이라는 말로는 사람이 무엇을 고르는 것인지 알 수 없다. */
.sty-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  align-items: start;
}
.sty {
  margin: 0;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-8);
  background: var(--bg-app);
}
.sty.on {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.sty-img {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-6);
  overflow: hidden;
  background: var(--bg-subtle);
}
.sty-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sty figcaption {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}
.sty-name {
  font-size: var(--fs-13);
  font-weight: 650;
  color: var(--text-1);
}
.sty-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
}
.sty-why {
  font-size: var(--fs-12);
  line-height: 1.6;
  color: var(--text-2);
  word-break: keep-all;
}
.sty-meta,
.sty-note {
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-3);
  word-break: keep-all;
}
.sty figcaption .btn {
  margin-top: 4px;
  align-self: flex-start;
}

/* 효과 강도 소·중·대. 기획은 언제나 최대치이고 이 단추는 거르는 등급만 정한다. */
.dens {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}
.dens-btn {
  padding: 10px 11px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  background: var(--bg-app);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.dens-btn.on {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.dens-btn b {
  display: block;
  font-size: var(--fs-13);
  font-weight: 650;
}
.dens-btn span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--text-3);
  word-break: keep-all;
}

/* 컷에 기획된 효과 겹. 회색은 강도를 올리면 붙는 것이다 — 강도가 듣는지 보이지
   않으면 사람은 기능이 고장난 줄 안다. */
.lyr-row td {
  padding-top: 0 !important;
}
.lyr-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 8px;
}
.lyr {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px;
  border: 1px dashed var(--border-2);
  border-radius: 999px;
  opacity: 0.55;
}
.lyr.on {
  border-style: solid;
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  opacity: 1;
}
.lyr b {
  font-size: 10px;
  font-weight: 650;
  color: var(--text-2);
}
.lyr em {
  font-size: 9px;
  font-style: normal;
  color: var(--text-3);
}

/* 주소를 여러 개 넣는 줄. */
.add-row {
  display: flex;
  gap: 8px;
}
.add-row input {
  flex: 1;
  min-width: 0;
}
