/* 영상 그래프 #/graph. 값은 tokens.css 토큰만 쓴다 (Design.md) */
.gv-host { display: grid; grid-template-columns: minmax(0, 1fr); }
main.is-graph { max-width: none; padding: 0; }
main.is-graph > .page { display: block; padding: 0; }
.gv { --gv-foot: 44px; --gv-side: 288px; --gv-info: 360px; display: grid; grid-template-columns: minmax(0, 1fr); }
.gv-stage { position: relative; display: flex; height: calc(100dvh - var(--topbar-h) - var(--gv-foot)); min-height: 320px; overflow: hidden; }
.gv-canvas-wrap { position: relative; flex: 1; min-width: 0; }
.gv-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.gv-canvas:active { cursor: grabbing; }

/* 왼쪽 설정 */
.gv-side { flex: none; width: var(--gv-side); display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--surface); border-right: 1px solid var(--border); }
.gv[data-side="closed"] .gv-side { display: none; }
.gv-side-toggle { position: absolute; top: var(--sp-3); left: var(--sp-3); }
.gv[data-side="open"] .gv-side-toggle { display: none; }
.gv-side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-4); border-bottom: 1px solid var(--border); }
.gv-side-head h2 { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; letter-spacing: 0; font-family: inherit; }
.gv-side-body { overflow-y: auto; overscroll-behavior: contain; }
.gv-group { border-bottom: 1px solid var(--border); }
.gv-group > summary { display: flex; align-items: center; min-height: var(--hit-min); padding: 0 var(--sp-4); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.gv-group > summary:hover { background: var(--surface-2); }
.gv-group > summary:focus-visible { outline-offset: -2px; }
.gv-group-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); padding: var(--sp-1) var(--sp-4) var(--sp-4); }
.gv-side .chip { min-height: 28px; padding: 0 var(--sp-2); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.gv-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.gv-check { display: flex; align-items: center; gap: var(--sp-2); min-height: 28px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); cursor: pointer; }
.gv-check input { accent-color: var(--accent); margin: 0; }
.gv-note { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.gv-note:empty { display: none; }
.gv-slider .label { display: flex; justify-content: space-between; gap: var(--sp-2); }
.gv-slider output { color: var(--text-3); font-variant-numeric: tabular-nums; }
.gv-slider input { width: 100%; margin: 0; accent-color: var(--accent); }
.gv-side .seg { display: flex; }
.gv-side .seg button { flex: 1; }
.gv-reset { justify-self: start; }
.gv-play-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.gv-month { font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 캔버스 위 */
.gv-banner { position: absolute; top: var(--sp-3); left: 50%; transform: translateX(-50%); display: grid; gap: var(--sp-1); max-width: calc(100% - var(--sp-8)); padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); z-index: 1; }
.gv-banner-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.gv-banner-text { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 500; }
.gv-none { position: absolute; top: 40%; left: 0; right: 0; padding: 0 var(--sp-6); text-align: center; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); pointer-events: none; }
.gv-zoom { position: absolute; right: var(--sp-3); bottom: var(--sp-3); display: flex; gap: var(--sp-1); }
.gv-zoom .btn:not(:last-child) { width: 32px; padding: 0; }

/* 오른쪽 정보 */
.gv-info { flex: none; width: var(--gv-info); background: var(--surface); border-left: 1px solid var(--border); min-height: 0; }
.gv-info-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--sp-3); height: 100%; padding: var(--sp-3) var(--sp-4) var(--sp-6); overflow-y: auto; overscroll-behavior: contain; }
.gv-info-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2); align-items: start; }
.gv-info-title { font-size: var(--fs-body); line-height: var(--lh-h3); font-weight: 600; letter-spacing: 0; font-family: inherit; padding-top: var(--sp-2); }
.gv-info-title a { color: var(--text); text-decoration: none; }
.gv-info-title a:hover { color: var(--accent); text-decoration: underline; }
.gv-info-h3 { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; letter-spacing: 0; font-family: inherit; margin-top: var(--sp-2); }
.gv-info-h3 span { font-weight: 400; color: var(--text-2); margin-left: var(--sp-1); }
.gv-info .chip { min-height: 28px; padding: 0 var(--sp-2); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.gv-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.gv-rels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.gv-rel { display: grid; gap: var(--sp-1); padding: var(--sp-2) 0; border-top: 1px solid var(--border); }
.gv-rel-title { padding: 0; background: none; border: 0; font: inherit; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text); text-align: left; cursor: pointer; }
.gv-rel-title:hover { color: var(--accent); text-decoration: underline; }
.gv-rel-meta { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }

/* 아래 줄 */
.gv-foot { position: relative; min-height: var(--gv-foot); padding: 0 var(--gutter); border-top: 1px solid var(--border); background: var(--surface); }
.gv-list > summary { display: flex; align-items: center; width: max-content; min-height: var(--gv-foot); font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.gv-list > summary:hover { color: var(--text); }
.gv-status { position: absolute; top: 0; right: var(--gutter); line-height: var(--gv-foot); font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.gv-list-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); padding: var(--sp-3) 0 var(--sp-8); max-width: var(--container); }
.gv-list-group { display: grid; gap: var(--sp-2); }
.gv-list-group h2 { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; letter-spacing: 0; font-family: inherit; }
.gv-list-group h2 span { font-weight: 400; color: var(--text-2); margin-left: var(--sp-1); }
.gv-list-group ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-1); font-size: var(--fs-sm); line-height: var(--lh-sm); }

/* 다른 페이지에 넣는 작은 판 */
.gv-compact { position: relative; width: 100%; height: 100%; min-height: 240px; }
.gv-compact .gv-canvas { touch-action: pan-y pinch-zoom; cursor: pointer; }

.gv-loading { display: grid; gap: var(--sp-3); padding: var(--sp-8) var(--gutter); max-width: var(--container); margin: 0 auto; }
.gv-loading .sk-block { height: 60dvh; }

@media (max-width: 1024px) {
  .gv { --gv-info: 320px; --gv-side: 264px; }
}
@media (max-width: 640px) {
  /* 모바일: 설정은 캔버스를 덮는 시트, 정보는 아래 시트 */
  .gv-stage { height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--gv-foot)); }
  .gv { padding-bottom: var(--tabbar-h); }
  .gv-side { position: absolute; inset: 0; width: auto; z-index: 2; border-right: 0; }
  .gv-info { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 58%; height: 58%; z-index: 1; border-left: 0; border-top: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-pop); }
  .gv-info-body { padding-bottom: var(--sp-4); }
  .gv-side .chip, .gv-info .chip { min-height: var(--hit-min); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
  .gv-rel-title { min-height: var(--hit-min); }
  .gv-group > summary { min-height: 48px; }
  .gv-banner { left: auto; right: var(--sp-3); top: var(--sp-3); transform: none; max-width: calc(100% - 96px); }
  .gv-zoom .btn:not(:last-child) { width: var(--hit-min); }
  .gv-slider input { min-height: var(--hit-min); }
  .gv-check { min-height: var(--hit-min); }
}
