/* ── 스토리보드 3×3 시트(9패널) ── storyboardSheet.js · storyboardPanelList.js · storyboardPanelZoom.js
   컷 셀의 기본 골격(.sb-cell / .sb-cell-media / .sb-cell-info)은 components.css 가 소유한다.
   여기에는 "시트 1장 = 9패널" 때문에 새로 생긴 것만 둔다(번호 오버레이·패널표·패널 확대).
   feature CSS 를 파일로 분리하는 건 이 repo 컨벤션이다(audioDrama.css · planHub.css · feed.css). */

/* 시트 모드 미디어 — 오버레이 격자가 이미지 칸과 정확히 겹쳐야 하므로 박스를 9:16 으로 고정한다.
   (align-self:stretch 로 늘어나면 박스 비율이 9:16 에서 어긋나 object-fit:cover 가 패널 가장자리를 잘라내고,
    번호가 옆 칸으로 밀린다. 3×3 시트의 패널 한 칸도 9:16 이라 시트 전체 비율과 같다.) */
.sb-cell-media--sheet { align-self: start; height: auto; aspect-ratio: 9 / 16; }

/* 번호 오버레이 — 3×3 히트존. 강조는 전부 CSS :hover 가 담당한다(JS 리페인트가 click 을 삼킨 전례) */
.sb-sheet-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
}
.sb-sheet-cell {
  appearance: none; -webkit-appearance: none; position: relative;
  margin: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in;
  transition: background var(--t-fast, 0.15s) var(--ease), box-shadow var(--t-fast, 0.15s) var(--ease);
}
.sb-sheet-cell:hover, .sb-sheet-cell:focus-visible {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  outline: none;
}
.sb-sheet-no {
  position: absolute; left: 4px; top: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  color: #fff; background: color-mix(in srgb, #000 62%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.5);
  opacity: 0.9; pointer-events: none;
}
.sb-sheet-cell:hover .sb-sheet-no { opacity: 1; background: var(--accent); }

/* 셀 헤더의 패널 개수 배지 */
.sb-cell-pcount {
  font-size: 10px; font-weight: 600; color: var(--accent);
  padding: 1px 7px; border-radius: var(--r-pill, 999px);
  background: var(--accent-soft); border: 1px solid var(--accent-ring);
}

/* 패널표(우측) — 레퍼런스 콘티의 컷/대사/감정 표. 9행이 셀 안에 들어가도록 촘촘하게. */
.sb-plist { display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow-y: auto; }
.sb-plist-head, .sb-plist-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 74px; gap: 8px; align-items: center;
}
.sb-plist-head { padding: 2px 4px 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 2px; }
.sb-plist-h { font-size: 9px; font-weight: 700; letter-spacing: 0.03em; color: var(--ink-48); }
.sb-plist-h--emo { text-align: right; }
.sb-plist-row {
  appearance: none; -webkit-appearance: none; text-align: left;
  margin: 0; padding: 3px 4px; border: 0; border-radius: var(--r-sm, 7px);
  background: transparent; cursor: zoom-in;
  transition: background var(--t-fast, 0.15s) var(--ease);
}
.sb-plist-row:hover, .sb-plist-row:focus-visible { background: var(--accent-soft); outline: none; }
.sb-plist-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-ring);
}
.sb-plist-mid { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sb-plist-dialogue, .sb-plist-shot, .sb-plist-emo {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-plist-dialogue { font-size: 11px; line-height: 1.35; color: var(--ink-80); }
.sb-plist-shot { font-size: 9px; line-height: 1.3; color: var(--ink-48); }
.sb-plist-emo { font-size: 10px; line-height: 1.3; color: var(--ink); text-align: right; }

/* 패널 확대 — 시트에서 한 칸만 크롭해 전체화면. 이미지 라이트박스(3000)보다 위, 검색 팔레트(3200)보다 위. */
.sb-pz {
  position: fixed; inset: 0; z-index: 3400;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 28px; background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sb-pz-stage { display: flex; justify-content: center; min-height: 0; }
/* 패널 한 칸도 9:16 — 높이를 먼저 잡고 aspect-ratio 로 폭을 도출한다(가로 넘침 방지).
   background-size/position 은 storyboardSheetGeom.panelZoomStyle 이 인라인으로 넣는다(크롭 좌표 단일 소스). */
.sb-pz-frame {
  height: min(70vh, 860px); aspect-ratio: 9 / 16; max-width: 92vw;
  background-repeat: no-repeat; background-color: #000;
  border-radius: var(--r-md, 11px); box-shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.8);
}
.sb-pz-meta { max-width: min(92vw, 620px); display: flex; flex-direction: column; gap: 4px; text-align: center; }
.sb-pz-head { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.sb-pz-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  color: #fff; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35);
}
.sb-pz-shot { font-size: 12px; color: rgba(255, 255, 255, 0.62); }
.sb-pz-dialogue { margin: 0; font-size: 15px; line-height: 1.5; color: #fff; }
.sb-pz-emotion { margin: 0; font-size: 12px; color: rgba(255, 255, 255, 0.62); }
.btn.sb-pz-close { position: absolute; top: 16px; right: 16px; color: #fff; }
.btn.sb-pz-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; min-width: 44px; height: 44px; border-radius: 50%;
  color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn.sb-pz-nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
/* ⚠️ .btn 의 hover scale 이 translateY 를 덮어 버튼이 튀는 것 방지(cf-nav 와 동일 이슈) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn.sb-pz-nav:hover:not(:disabled) { transform: translateY(-50%) scale(1.06); }
}
.btn.sb-pz-nav:active:not(:disabled) { transform: translateY(-50%) scale(0.96); }
.sb-pz-nav--prev { left: 14px; }
.sb-pz-nav--next { right: 14px; }

@media (max-width: 720px) {
  .sb-pz-frame { height: min(58vh, 620px); }
  .sb-pz-nav--prev { left: 6px; }
  .sb-pz-nav--next { right: 6px; }
}
