/*
 * SwingCheck AI — Motion V2 analysis styling (investor-deck direction).
 * Dark navy stage, glass metric chips over the video, electric-blue controls,
 * green skeleton (drawn by sc_skeleton_v2.js). Every rule is scoped under .mv2 so
 * nothing here can restyle the existing report.
 */
.mv2 {
  --mv2-bg: #050b18;
  --mv2-panel: rgba(8, 18, 40, 0.88);
  --mv2-glass: rgba(10, 22, 48, 0.62);
  --mv2-edge: rgba(56, 189, 248, 0.35);
  --mv2-blue: #1e7bff;
  --mv2-cyan: #38bdf8;
  --mv2-green: #22c55e;
  --mv2-amber: #f59e0b;
  --mv2-text: #f1f5f9;
  --mv2-dim: rgba(241, 245, 249, 0.62);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  color: var(--mv2-text);
  background: var(--mv2-bg);
  border: 1px solid var(--mv2-edge);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(30, 123, 255, 0.12), 0 18px 48px rgba(2, 8, 23, 0.55);
  outline: none;
}
.mv2:focus-visible { box-shadow: 0 0 0 2px var(--mv2-cyan); }

.mv2-stage { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 72vh; background: #000; }
.mv2-video, .mv2-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.mv2-video { object-fit: contain; background: #000; }
.mv2-overlay { pointer-events: none; }

.mv2-chips { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; max-width: 46%; }
.mv2-chip {
  display: grid; grid-template-columns: 1fr; gap: 1px;
  padding: 7px 10px; border-radius: 10px;
  background: var(--mv2-glass); border: 1px solid var(--mv2-edge);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  text-align: right;
}
.mv2-chip-l { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mv2-dim); }
.mv2-chip-v { font-size: 20px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mv2-chip-v small { font-size: 11px; font-weight: 700; margin-left: 3px; color: var(--mv2-dim); }
.mv2-chip-v.mv2-none { font-size: 12px; font-weight: 700; color: var(--mv2-dim); }
.mv2-chip-s { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.mv2-tracked .mv2-chip-s, .mv2-measured .mv2-chip-s { color: var(--mv2-green); }
.mv2-estimate .mv2-chip-s { color: var(--mv2-amber); }
.mv2-unmeasured { border-style: dashed; }

.mv2-sync {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  background: var(--mv2-glass); border: 1px solid var(--mv2-edge); color: var(--mv2-dim);
}
.mv2-sync[data-source="measured"], .mv2-sync[data-source="given"] { color: var(--mv2-green); }

.mv2-ctl {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--mv2-panel); border-top: 1px solid var(--mv2-edge);
}
.mv2-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  border: 1px solid var(--mv2-edge); background: rgba(30, 123, 255, 0.16); color: var(--mv2-text);
  font-size: 18px; font-weight: 800; cursor: pointer; touch-action: manipulation;
}
.mv2-play { background: linear-gradient(135deg, #1e7bff, #0b4fd6); border-color: transparent; }
.mv2-btn:active { transform: scale(0.96); }
.mv2-track { position: relative; flex: 1 1 140px; min-width: 120px; height: 28px; display: flex; align-items: center; }
.mv2-scrub { width: 100%; accent-color: var(--mv2-blue); }
.mv2-mark {
  position: absolute; top: 2px; width: 2px; height: 8px; margin-left: -1px; border-radius: 1px;
  background: var(--mv2-cyan); pointer-events: none;
}
.mv2-time { min-width: 46px; font: 600 12px 'JetBrains Mono', ui-monospace, monospace; color: var(--mv2-dim); }
.mv2-rates, .mv2-toggles { display: flex; gap: 4px; }
/* narrow screens: the layer toggles wrap instead of running off the right edge */
.mv2-toggles { flex-wrap: wrap; }
.mv2-tog { white-space: nowrap; }
.mv2-rate, .mv2-tog {
  height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer; touch-action: manipulation;
  border: 1px solid var(--mv2-edge); background: transparent; color: var(--mv2-dim);
  font: 700 11px 'Outfit', system-ui, sans-serif;
}
.mv2-rate.on, .mv2-tog.on { background: rgba(30, 123, 255, 0.28); color: var(--mv2-text); border-color: var(--mv2-blue); }

.mv2-3d { position: relative; aspect-ratio: 1 / 1; max-height: 60vh; background: #0b111a; border-top: 1px solid var(--mv2-edge); }
.mv2-3d[hidden] { display: none; }
/* Inside V2 the 3D viewer is driven by the player's clock, so its own play bar and
   jump row would fight it. Hidden here only (the 3D Replay card is unaffected); the
   view buttons (Face/Side/Top) and its "estimate" disclaimer stay. */
.mv2-3d .sa-ctl, .mv2-3d .sa-sub { display: none !important; }
.mv2-note { padding: 16px; font-size: 13px; line-height: 1.5; color: var(--mv2-dim); }

@media (max-width: 420px) {
  .mv2-chip-v { font-size: 17px; }
  .mv2-ctl { gap: 6px; padding: 8px; }
  .mv2-btn { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .mv2-btn:active { transform: none; }
}

/* anatomical 3D view: the WebGL canvas fills the panel exactly (sized from the panel,
   never stretched), with the "estimate" label over it */
.mv2-a3d { position: absolute; inset: 0; }
.mv2-a3d canvas { display: block; width: 100%; height: 100%; }
.mv2-a3d-label {
  position: absolute; top: 8px; left: 10px; z-index: 1; padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: var(--mv2-dim, rgba(241,245,249,.62));
  background: rgba(10, 22, 48, 0.62); border: 1px solid rgba(56, 189, 248, 0.35); pointer-events: none;
}

/* ── anatomical rig (sc_anatomy_rig_v2.js) ─────────────────────────────── */
.mv2-rig { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.mv2-rig canvas, .mv2-3d-rig canvas { display: block; width: 100% !important; height: 100% !important; }
.mv2-stage .mv2-overlay { z-index: 2; }
.mv2-stage .mv2-chips, .mv2-stage .mv2-sync { z-index: 3; }
.mv2-3d-rig { background: #02060f; }
/* video and 3D side by side (stacked on narrow screens) */
.mv2-side .mv2-views { display: grid; grid-template-columns: 1fr; gap: 0; }
.mv2-side .mv2-3d { border-top: 1px solid var(--mv2-edge); aspect-ratio: 1 / 1; max-height: 70vh; }
@media (min-width: 760px) {
  .mv2-side .mv2-views { grid-template-columns: 1fr 1fr; }
  .mv2-side .mv2-stage { max-height: 78vh; }
  .mv2-side .mv2-3d { aspect-ratio: auto; max-height: none; height: 100%; border-top: 0; border-left: 1px solid var(--mv2-edge); }
}
.mv2-stage { overflow: hidden; }
.mv2-layer { position: absolute; inset: 0; transition: transform 0.25s ease; }
.mv2-layer .mv2-video, .mv2-layer .mv2-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
/* 3D view controls (rig): view presets + follow */
.mv2-3d-rig { position: relative; }
.mv2-3d-views { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }
.mv2-3d-views button { min-width: 36px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--mv2-edge); background: rgba(8, 18, 40, 0.82); color: #cbd5e1; font: 700 12px 'Outfit', system-ui, sans-serif; cursor: pointer; }
.mv2-3d-views button.on { background: #1e40af; color: #fff; border-color: #3b82f6; }
.mv2-3d-views .mv2-3d-follow { margin-left: 6px; }
