/* Quick measurements stay visible. Each frame owns its full report toggle. */
.moment-actions { display:flex; flex:none; container-type:inline-size; min-width:0; }
.moment-cell .moment-actions .moment-mark { flex:1; width:auto; min-width:0; white-space:nowrap; }
.moment-analysis-toggle { display:flex; align-items:center; justify-content:center; gap:4px; min-width:26px; min-height:32px; padding:3px; border:0; border-top:1px solid #c8d3be; border-left:1px solid #c8d3be; border-radius:0; background:#eaf0e2; font-size:14px; transition:none; }
.moment-analysis-toggle svg { width:19px; height:19px; flex:none; }
.moment-analysis-toggle span { display:none; }
.moment-analysis-toggle:hover { background:#d9e7c9; }
.moment-analysis-toggle[aria-expanded=true],.moment-analysis-toggle[aria-expanded=true]:hover:not(:disabled) { background:#354f3d; color:white; }
.moment-analysis-toggle:focus-visible { outline:3px solid #254831; outline-offset:-3px; }
@container (min-width:115px) { .moment-analysis-toggle span { display:inline; } .moment-analysis-toggle svg { display:none; } }
@container (min-width:150px) { .moment-analysis-toggle svg { display:block; } }
.key-inline-reports { display:none; min-width:0; }
.key-card.has-analysis { grid-column:1/-1; }
.key-card.has-analysis .key-inline-reports { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:10px; padding:10px; border-top:1px solid #cad8bd; }
.key-card.has-analysis .key-frame-results { display:none; }
.key-inline-analysis { min-width:0; padding:0; }
.key-inline-analysis h4 { margin:0 0 8px; }
.key-inline-analysis .key-posture-notes { margin:8px 0; }
.key-inline-analysis:focus-visible { outline:2px solid #354f3d; outline-offset:3px; }
/* Long reports scroll inside their existing gallery, keeping the video and
   playback dock fixed. The normal seven-card layout returns on close. */
@media(min-width:901px) {
  .has-inline-analysis .key-filmstrip { position:relative; height:var(--gallery-height); max-height:var(--gallery-height); overflow:auto; overscroll-behavior:contain; align-content:start; align-items:start; }
  .key-portrait:not(.is-compare) .has-inline-analysis .key-filmstrip { flex:1; }
  .has-inline-analysis .key-filmstrip,.key-portrait:not(.is-compare) .has-inline-analysis .key-filmstrip { grid-template-rows:none; grid-auto-rows:max-content; }
  .has-inline-analysis .key-card { flex:none; }
  .has-inline-analysis .key-card:not(.has-analysis) .key-frame-image { flex:none; height:80px; }
  .has-inline-analysis .key-card.has-analysis { display:grid; grid-template-columns:minmax(115px,.4fr) minmax(270px,1fr); grid-template-rows:auto minmax(0,1fr); height:min(var(--gallery-height),560px); }
  .has-inline-analysis .key-card.has-analysis .key-card-title { grid-column:1; grid-row:1; }
  .has-inline-analysis .key-card.has-analysis .key-card-frames { grid-column:1; grid-row:2; min-height:0; }
  .has-inline-analysis .key-card.has-analysis .key-frame { display:flex; flex-direction:column; min-height:0; }
  .has-inline-analysis .key-card.has-analysis .key-frame-image { flex:1; min-height:0; height:auto; width:100%; }
  .has-inline-analysis .key-card.has-analysis .key-frame-image canvas { position:absolute; inset:0; }
  .has-inline-analysis .key-card.has-analysis .key-inline-reports { grid-column:2; grid-row:1/3; min-height:0; overflow:auto; overscroll-behavior:contain; align-content:start; grid-auto-rows:max-content; border-top:0; border-left:1px solid #cad8bd; }
}
.key-frame-results { flex:none; padding:2px 5px 5px; border-top:1px solid #d1ddc8; background:#f6f8f2; }
.key-frame-results table { width:100%; border-collapse:collapse; font-size:14px; line-height:1.25; }
.key-frame-results th { text-align:left; font-weight:400; }
.key-frame-results td,.key-frame-results thead th:not(:first-child) { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.key-frame-results td { font-weight:650; }
.key-frame-results th,.key-frame-results td { padding:2px 0; }
.key-frame-results td+td { padding-left:5px; }
.metric-compact-label { display:none; }
.key-card.paired:not(.range-preview) .moment-assignment { display:none; }
.key-frame-results button { min-height:28px; padding:1px 0; border:0; background:transparent; font-size:14px; white-space:nowrap; text-decoration:underline; text-underline-offset:3px; }
.key-results-guide { font-size:14px; line-height:1.25; margin:4px 0 0; color:#4f6451; }
.key-detail-results { padding:10px 12px 0; }
.key-detail-results h4 { margin:0 0 5px; font-size:18px; }
.key-phase-guide { margin:0 0 5px; padding:6px 8px; border-left:3px solid var(--moment-color); background:#f0f5e9; font-size:16px; }
.key-detail-results .key-posture-notes { padding-left:20px; font-size:16px; line-height:1.4; margin:6px 0; }
.key-detail-metrics { width:100%; border-collapse:collapse; font-size:16px; color:#253e2e; }
.key-detail-metrics th { text-align:left; font-weight:400; }
.key-detail-metrics td,.key-detail-metrics thead th:not(:first-child) { text-align:right; font-variant-numeric:tabular-nums; }
.key-detail-metrics td,.key-detail-metrics th { padding:4px 6px; }
.key-detail-metrics thead { background:#e8efdf; }
.key-detail-metrics tbody tr:nth-child(even) { background:#f3f6ee; }
/* Paired results use one table so labels do not repeat in narrow A/B cells.
   The adjacent Results action opens both complete frame analyses together. */
@media(min-width:901px) {
  .is-compare .key-frame-results { padding:1px 3px 3px; }
  .is-compare .key-frame-results tbody th { max-width:64px; }
}
@media(min-width:1351px) and (min-height:821px) and (max-height:1000px) {
  .studio.persistent-sidebar.is-compare.has-key-moments { grid-template-columns:minmax(0,1fr) 420px; }
}
@media(min-width:1180px) and (max-height:820px) {
  .is-compare .clip-view-settings { grid-template-columns:236px minmax(0,1fr); }
  .persistent-sidebar.is-compare .clip-timing label { flex-direction:row; gap:3px; }
  .persistent-sidebar.is-compare .clip-timing { gap:6px; padding:2px 4px; }
  .persistent-sidebar.is-compare .clip-timing select { width:60px; font-size:14px; }
  .persistent-sidebar.is-compare .zoom-controls { grid-template-columns:auto 28px 48px 28px 28px; gap:0 2px; padding:2px 0; }
  .persistent-sidebar.is-compare .zoom-label { grid-column:1; grid-row:1; }
  .persistent-sidebar.is-compare .zoom-out { grid-column:2; grid-row:1; }
  .persistent-sidebar.is-compare .zoom-value { grid-column:3; grid-row:1; font-size:14px; }
  .persistent-sidebar.is-compare .zoom-in { grid-column:4; grid-row:1; }
  .persistent-sidebar.is-compare .zoom-fit { grid-column:5; grid-row:1; }
  .persistent-sidebar.is-compare .zoom-slider { display:none; }
  .is-compare .key-frame-time span:first-child { display:none; }
  .persistent-sidebar.is-compare .clip-transport:not(.timeline-compact) .timeline-review { flex-basis:0; }
  .persistent-sidebar.is-compare .clip-transport:not(.timeline-compact) .clip-duration { width:auto; font-family:inherit; font-size:14px; }
  .persistent-sidebar.is-compare .clip-transport .timeline-moments button { min-height:12px; height:12px; }
  .is-compare .key-frame-results .metric-full-label { display:none; }
  .is-compare .key-frame-results .metric-compact-label { display:inline; }
  .is-compare .key-frame-results tbody th { white-space:nowrap; }
  .is-compare .key-frame-results table { table-layout:auto; }
  .is-compare .key-frame-results td+td { padding-left:2px; }
  .is-compare .key-frame-results thead button { font-size:14px; }
  .is-compare .key-frame-results th,.is-compare .key-frame-results td { padding-block:1px; }
}
/* Full analysis belongs alongside the enlarged frame, with its edit controls.
   This avoids pushing the measurements and navigation below a tall image. */
@media(min-width:1000px) {
  .key-review-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(310px,.85fr); align-content:start; }
  .key-review-panel>h3 { grid-column:1/-1; }
  .key-large-frame { grid-column:1; grid-row:2/6; height:100%; min-height:0; }
  .key-large-frame canvas { position:absolute; inset:0; }
  .key-detail-line { grid-column:2; grid-row:2; }
  .key-review-panel>.key-detail-results { grid-column:2; grid-row:3; }
  .key-edit-controls { grid-column:2; grid-row:4; }
  .key-review-actions { grid-column:2; grid-row:5; }
  .key-review-panel:has(canvas[hidden]) .key-large-frame { min-height:200px; }
}
@media(min-width:1000px) and (max-width:1399px) {
  .paired-review .key-review-panel { display:block; }
  .paired-review .key-large-frame { height:240px; }
}
@media(max-width:900px) {
  .key-filmstrip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .is-compare .key-card.paired .key-card-frames { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:420px) {
  .is-compare .key-filmstrip { grid-template-columns:1fr; }
  .key-detail-metrics { font-size:14px; }
  .key-detail-metrics td,.key-detail-metrics th { padding:4px 3px; }
}
