/* 방법 구역 "한 장면으로 본 처리 순서" 시안 A9 (2026-11-20, BRIEF_A9_h2_fix_ko.md 방법 구역). style.css 뒤에 읽는다.
   ①과 ②는 한 줄에 둘이고 사진 높이(--m9-ph)와 사진 아래 줄 높이(34px)를 같게 맞춘다. ① 장면 사진은 4:3, ② 사진은 ③ 칸과 같은 비율(192:480).
   ③은 줄 전체 폭이고 제목, 문장, 전환, 띠를 위에서 아래로 쌓는다. 띠의 바깥 테두리 선(칸 바깥 7px)과 트랙 이름이 본문 왼쪽 선(①의 사진 왼쪽 끝)에 온다.
   띠는 격자 하나: 1줄 트랙 이름, 2줄 사진 칸 넷, 3줄 시각. 테두리는 2줄 위에 겹쳐 놓는다. 좁은 화면에서는 2x2(1~3줄과 4~6줄)이고
   TraceMend 출력에서 두 줄을 각각 보라 테두리로 두른다.
   색은 토큰만 쓴다: 테두리 --tb-target(보라)과 --tb-cand(라즈베리), 칸 안 상자 --vid-*, 글 --text, --muted, --accent, --cand, 가려진 칸의 덮개 --bg. */

:root { --m9-ph: 272px; --fs-cw: 176px; }

/* ①②: 사진과 아래 줄 */
.flow.flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fl-vis.is-a9 { display: block; height: auto; margin-top: 16px; }
.m9 { display: block; }
.m9-row { display: flex; align-items: center; height: 34px; margin-top: 8px; }
.m9-1 { display: grid; width: calc(var(--m9-ph) * 4 / 3); max-width: 100%; }
.m1-ph { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--face); }
.m1-ph svg { display: block; width: 100%; height: 100%; }
.m1-scale { align-items: flex-start; }
.m1-scale svg { display: block; overflow: visible; }
.m1-base { stroke: var(--line); stroke-width: 1.5; }
.m1-tick { stroke: var(--line); stroke-width: 1.5; }
.m1-mark { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.m1-lab { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.m1-lab.is-mark { fill: var(--accent); font-weight: 600; }
.m9-ring { fill: none; stroke: var(--vid-ring); stroke-width: 5; }
.m9-line { fill: none; stroke-width: 2.4; }
.m9-line.is-cand { stroke: var(--vid-cand); }
.m9-chip-ring { fill: none; stroke: var(--vid-ring); stroke-width: 2.5; }
.m9-chip-face.is-cand { fill: var(--vid-cand); }
.m9-chip-t { fill: var(--vid-ink); font-family: "Wanted Sans", system-ui, sans-serif; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.m2-pair { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.m2-c { display: flex; flex-direction: column; align-items: flex-start; }
.m2-ph { display: block; height: var(--m9-ph); aspect-ratio: 192 / 480; border-radius: 10px; border: 2px solid var(--tb-target); overflow: hidden; background: var(--face); }
.m2-c.is-top .m2-ph { border-color: var(--tb-cand); }
.m2-ph img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.m2-cap { font-size: 13px; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m2-cap b { font-weight: 600; margin-left: 4px; }
.m2-c.is-ref .m2-cap b { color: var(--accent); }
.m2-c.is-top .m2-cap b { color: var(--cand); }
.m2-more { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ③: 제목과 문장, 전환, 띠를 쌓는다 */
.fl.is-fs {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 18px;
  padding: 26px 0 0; margin-top: 30px; border-left: 0; border-top: 1px solid var(--line);
}
.fl.is-fs .fl-b { max-width: 720px; }
.fs { min-width: 0; }
.fs-tabs { display: flex; gap: 22px; margin-bottom: 16px; }
.fs-tab {
  height: 30px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.fs-tab:hover { color: var(--text); }
.fs-tab[aria-selected="true"] { color: var(--text); font-weight: 600; }
.fs-tab[data-view="tracker"][aria-selected="true"] { border-bottom-color: var(--cand); }
.fs-tab[data-view="trace"][aria-selected="true"] { border-bottom-color: var(--accent); }

.fs-scroll { min-width: 0; }
.fs-row {
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, var(--fs-cw))); grid-template-rows: auto auto auto;
  column-gap: 28px; padding: 0 7px; justify-content: start;
}
.c1 { grid-column: 1; } .c2 { grid-column: 2; } .c3 { grid-column: 3; } .c4 { grid-column: 4; }

/* 트랙 이름: 칩이 아닌 글. 30번 칸 위 이름은 TraceMend 출력에서 "4번"과 취소선 "30번"(첫 화면 이름표와 같은 꼴) */
.fs-lab { grid-row: 1; margin: 0 0 14px -7px; font-size: 15px; font-weight: 600; line-height: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-lab.is-a { grid-column: 1; color: var(--accent); }
.fs-lab.is-b { grid-column: 3 / 5; display: grid; justify-items: start; }
.fs-lab .v-tr, .fs-lab .v-tm, .fs-id .v-tr, .fs-id .v-tm { grid-area: 1 / 1; }
.fs-lab .v-tr, .fs-lab .v-tm { transition: opacity 0.5s ease; }
.fs-lab .v-tr, .fs-id .v-tr { color: var(--cand); }
.v-new { color: var(--accent); }
.v-old { margin-left: 7px; color: var(--cand); font-size: 0.87em; font-weight: 500; text-decoration-thickness: 1.5px; }
.fs-row[data-view="tracker"] .fs-lab .v-tm, .fs-row[data-view="trace"] .fs-lab .v-tr { opacity: 0; }

/* 사진 칸: 같은 비율(192:480), 둥근 모서리. 마우스를 올리거나 초점을 두면 1.03배(위아래로 테두리 안쪽까지만) */
.fs-cell { grid-row: 2; margin: 0; min-width: 0; position: relative; z-index: 1; outline: none; }
.fs-ph { display: block; aspect-ratio: 192 / 480; border-radius: 10px; overflow: hidden; background: var(--face); transition: transform 0.16s ease; }
.fs-ph svg { display: block; width: 100%; height: 100%; }
.fs-cell.is-hot { z-index: 3; }
.fs-cell.is-hot .fs-ph { transform: scale(1.03); }
.fs-cell:focus-visible .fs-ph { outline: 2px solid var(--accent); outline-offset: 3px; }
.fs-ring { fill: none; stroke: var(--vid-ring); stroke-width: 3.5; vector-effect: non-scaling-stroke; }
.fs-box { fill: none; stroke: var(--vid-accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; transition: stroke 0.5s ease; }
.fs-row[data-view="tracker"] .fs-cell.is-b .fs-box { stroke: var(--vid-cand); }
.fs-veil { fill: var(--bg); opacity: 0.3; }
/* 비교용(A9_GAP_MODE = 'outline'): 대상 자리 윤곽만 아주 옅게 */
.fs-box.is-place { stroke: var(--vid-ring); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: 0.55; }

/* 테두리: 2줄 위에 겹쳐 칸 바깥 7px에 그린다. 추적기 출력은 트랙마다 하나, TraceMend 출력은 한 트랙 하나 */
.fs-bd { grid-row: 2; margin: -7px; border: 2px solid transparent; border-radius: 15px; pointer-events: none; z-index: 2; transition: border-color 0.5s ease; }
.fs-bd.is-a { grid-column: 1 / 2; }
.fs-bd.is-b { grid-column: 3 / 5; }
.fs-bd.is-all { grid-column: 1 / 5; }
.fs-row[data-view="tracker"] .fs-bd.is-a { border-color: var(--tb-target); }
.fs-row[data-view="tracker"] .fs-bd.is-b { border-color: var(--tb-cand); }
.fs-row[data-view="trace"] .fs-bd.is-all { border-color: var(--tb-target); }

/* 시각(늘 보임)과 트랙 ID(올렸을 때). 가려진 칸은 시각과 까닭 한 줄 */
.fs-cap { grid-row: 3; margin: 14px 0 0; min-width: 0; font-size: 13px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.fs-t, .fs-id, .fs-note { display: block; }
.fs-id { display: grid; justify-items: start; margin-top: 2px; color: var(--text); font-weight: 600; opacity: 0; transition: opacity 0.16s ease; }
.fs-id.is-a, .fs-cap.is-a .fs-id { color: var(--accent); }
.fs-cap.is-hot .fs-t { color: var(--text); }
.fs-cap.is-hot .fs-id { opacity: 1; }
.fs-row[data-view="tracker"] .fs-id .v-tm, .fs-row[data-view="trace"] .fs-id .v-tr { visibility: hidden; }
.fs-note { margin-top: 2px; color: var(--text); }
.fs-nw { white-space: nowrap; }

.fs-row.is-instant *, .fs-row.is-instant { transition: none !important; }

@media (max-width: 1099px) {
  :root { --m9-ph: 236px; }
  .fs-row { column-gap: 20px; }
}
@media (max-width: 719px) {
  :root { --m9-ph: 236px; --fs-cw: 150px; }
  .flow.flow { grid-template-columns: minmax(0, 1fr); }
  .m9-1 { width: 100%; }
  .fl.is-fs { margin-top: 0; padding: 18px 0; row-gap: 14px; }
  /* 2x2: 1줄 4번 이름, 2줄 칸 1과 2, 3줄 시각, 4줄 30번 이름, 5줄 칸 3과 4, 6줄 시각 */
  .fs-row { grid-template-columns: repeat(2, minmax(0, var(--fs-cw))); grid-template-rows: auto auto auto auto auto auto; column-gap: 18px; }
  .c3 { grid-column: 1; } .c4 { grid-column: 2; }
  .fs-cell.c3, .fs-cell.c4 { grid-row: 5; }
  .fs-cap.c3, .fs-cap.c4 { grid-row: 6; }
  .fs-lab.is-b { grid-column: 1 / 3; grid-row: 4; margin-top: 22px; }
  .fs-bd.is-b { grid-column: 1 / 3; grid-row: 5; }
  /* TraceMend 출력: 두 줄을 각각 보라 테두리로 두른다(한 테두리로 두 줄을 두르면 가운데 30번 이름이 테두리 선에 걸림) */
  .fs-bd.is-all { grid-column: 1 / 3; grid-row: 2; }
  .fs-row[data-view="trace"] .fs-bd.is-b { border-color: var(--tb-target); }
  .fs-lab { font-size: 14px; }
  .fs-cap { font-size: 12px; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .fs-ph, .fs-box, .fs-bd, .fs-lab .v-tr, .fs-lab .v-tm, .fs-id { transition: none; }
}
