/* Continuous demonstrations first; decode only while their cards are visible. */
.posture-panel.has-motion,.care-photo-slot.has-motion{height:auto;min-height:0;min-width:0;display:block;padding:10px;background:#fff}
.motion-viewer{width:100%;min-width:0;color:#334155;font-size:12px;line-height:1.65}
.motion-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:9px}
.motion-head>b{font-size:12px}.motion-modes{display:flex;gap:5px}
.motion-modes button,.motion-controls button,.motion-speed,.library-motion-btn{min-height:42px;padding:8px 12px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#475569;font:inherit;font-weight:700;cursor:pointer}
.motion-modes .active{background:#eff6ff;border-color:#2563eb;color:#1d4ed8}
.motion-modes{flex-wrap:wrap;justify-content:flex-end}
.motion-mode{white-space:nowrap}
.motion-unavailable{margin:4px 0;color:#64748b;font-size:11px}
.motion-viewer[data-motion-mode="video"] .motion-video{background:transparent}
.motion-modes button:disabled{cursor:default;color:#94a3b8;background:#f8fafc;border-color:#e2e8f0}
.library-exercise>.cropped-visual{width:64px;height:74px;display:block;background:#f8fafc;border-radius:7px}
@media(max-width:780px){.library-exercise>.cropped-visual{width:54px;height:65px}}
.motion-still{height:360px;min-width:0;position:relative;padding-bottom:20px;box-sizing:border-box;background:#fff}
.motion-still>.cropped-visual,.motion-still>.care-photo{width:100%;height:100%;display:block;object-fit:contain;max-height:none}
.care-photo-slot .motion-still{height:430px}
.motion-photo-angle{font-size:11px;text-align:center;color:#64748b;margin:5px 0 0}
.motion-stage{height:auto;overflow:visible;min-width:0;position:relative;border:1px solid #e2e8f0;border-radius:10px;padding:8px;background:#fff}
.motion-gif,.motion-video{display:block;width:100%;height:360px;object-fit:contain;background:#fff}
.motion-pending{height:360px;display:flex;align-items:center;justify-content:center;background:#f8fafc;color:#64748b;border-radius:6px;text-align:center;padding:12px;box-sizing:border-box}
.motion-fallback-photo{display:block;width:100%;height:360px;object-fit:contain;background:#fff}
.motion-retry{min-height:42px;margin-top:9px;padding:8px 12px;border:1px solid #cbd5e1;border-radius:9px;background:#eff6ff;color:#1d4ed8;font:inherit;font-weight:700;cursor:pointer}
.motion-play-retry{color:#1d4ed8;background:#eff6ff}
.care-warmup-photo .motion-viewer{margin-top:12px}
.motion-frame{display:block;width:100%;aspect-ratio:16/9;min-height:230px;border:0;background:#fff;border-radius:6px}
.motion-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:9px}
.motion-controls label{display:flex;align-items:center;gap:5px;min-width:0}
.motion-sequence-label{display:block;font-size:12px;color:#1d4ed8;margin-bottom:8px}
.motion-sequence-picture{height:360px;overflow:hidden;background:#fff}
.motion-sequence-picture>svg,.motion-sequence-picture>img{display:block;width:100%;height:100%;object-fit:contain}
.motion-step-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.motion-step-tabs button{min-height:42px;border:1px solid #cbd5e1;border-radius:9px;padding:8px 10px;background:#fff;color:#475569;font:inherit;cursor:pointer}
.motion-step-tabs .active{background:#eff6ff;color:#1d4ed8;border-color:#2563eb}
.motion-step-cue{font-weight:700;margin:8px 0 0;color:#1e40af}
.motion-sequence-note{font-size:11px;color:#64748b;margin:6px 0 0}
.motion-dialog .motion-sequence-picture{height:min(64dvh,540px)}
.motion-speed{font-weight:400;max-width:100%}.motion-controls .motion-expand{color:#1d4ed8;background:#eff6ff;border-color:#bfdbfe}
.motion-targets{display:grid;gap:4px;margin:10px 0}
.motion-targets p{display:flex;gap:8px;align-items:flex-start;margin:0;font-size:12px;overflow-wrap:anywhere}
.motion-targets b{flex:0 0 100px;color:#334155}.motion-targets span{min-width:0}
.motion-cue{font-size:12px;color:#475569;margin:6px 0}
.motion-source{display:flex;flex-wrap:wrap;gap:5px 12px;align-items:center;margin:8px 0;font-size:11px;color:#64748b}
.motion-source-link{color:#2563eb;font-weight:700}
.motion-help,.motion-reference-note{font-size:11px;color:#64748b;line-height:1.7;margin:6px 0}
.motion-error{font-size:12px;line-height:1.7;color:#92400e;margin:8px 0 0;overflow-wrap:anywhere}.motion-error a{color:#2563eb}
.motion-viewer button:focus-visible,.library-motion-btn:focus-visible,.motion-close:focus-visible{outline:3px solid #2563eb;outline-offset:2px}
.library-motion-btn{display:block;margin-top:7px;color:#1d4ed8;background:#eff6ff;border-color:#bfdbfe;font-size:11px}
.motion-dialog{width:min(1000px,calc(100vw - 26px));max-height:calc(100dvh - 28px);border:0;border-radius:15px;padding:16px;box-sizing:border-box;overflow:auto;color:#334155;background:#fff}
.motion-dialog::backdrop{background:rgba(15,23,42,.75)}
.motion-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.motion-dialog-head h2{font-size:16px;line-height:1.6;margin:0;overflow-wrap:anywhere}
.motion-close{min-height:44px;padding:8px 14px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#475569;font:inherit;cursor:pointer;flex-shrink:0}
.motion-dialog-grid{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:16px}
.motion-dialog-anatomy{border:1px solid #e2e8f0;border-radius:10px;padding:10px;min-width:0;text-align:center}
.motion-dialog-anatomy>b{display:block;font-size:13px}.motion-dialog-anatomy img{display:block;width:100%;height:440px;object-fit:contain;background:#fff}
.motion-dialog-anatomy p{margin:4px 0;color:#64748b;font-size:11px}
.motion-dialog .motion-gif,.motion-dialog .motion-video,.motion-dialog .motion-still{height:min(64dvh,540px)}
.motion-dialog .motion-pending,.motion-dialog .motion-fallback-photo{height:min(64dvh,540px)}
.motion-dialog .motion-expand{display:none}
.motion-dialog .care-photo{cursor:default}
.exercise-form{margin-top:12px;border:1px solid #dbe4ee;border-radius:11px;padding:12px;background:#f8fafc;color:#334155}
.exercise-form h4{margin:0 0 9px;font-size:13px}
.exercise-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.exercise-form-grid p{display:flex;flex-direction:column;gap:4px;margin:0;min-width:0;line-height:1.75;font-size:12px}
.exercise-form-grid b{color:#1d4ed8;font-size:12px}
.exercise-form-avoid{display:flex;gap:8px;align-items:flex-start;margin:10px 0 0;padding-top:9px;border-top:1px solid #e2e8f0;font-size:11px;line-height:1.7;color:#64748b}
.exercise-form-avoid>b{flex:0 0 76px;color:#475569}
@media(max-width:680px){
  .posture-panel.has-motion,.care-photo-slot.has-motion{padding:8px}
  .motion-head{gap:5px}.motion-modes button{padding:7px 10px}
  .motion-still{height:330px}.care-photo-slot .motion-still{height:420px}
  .motion-gif,.motion-video{height:330px}.motion-frame{min-height:190px}
  .motion-pending,.motion-fallback-photo{height:330px}
  .motion-sequence-picture{height:330px}
  .motion-dialog-grid{grid-template-columns:1fr}.motion-dialog-anatomy img{height:340px}
  .exercise-form-grid{grid-template-columns:1fr}.exercise-form{padding:10px}
}

/* v14.44: fit the full movement bounds, rather than a small figure in a wide frame. */
.motion-viewer{--motion-height:560px}
.motion-viewport{display:grid;place-items:center;min-width:0;width:100%;background:#fff}
.motion-crop{position:relative;flex:none;width:min(100%,calc(var(--motion-height) * var(--motion-ratio)));aspect-ratio:var(--motion-ratio);overflow:hidden;background:#fff;border-radius:6px}
.motion-crop>.motion-gif,.motion-crop>.motion-video{position:absolute;display:block;max-width:none!important;max-height:none!important;object-fit:fill;background:#fff}
.posture-panel .motion-still,.care-photo-slot .motion-still{height:var(--motion-height);max-height:none}
.motion-viewer .motion-pending,.motion-viewer .motion-fallback-photo{height:var(--motion-height)}
.motion-stage{padding:5px}
.motion-targets b{flex-basis:108px}
.equipment-grip{margin:12px 0 0;padding:11px 12px 0;border:1px solid #99f6e4;border-radius:10px;background:#f0fdfa}
.equipment-grip figcaption{font-size:12px;font-weight:750;color:#115e59;line-height:1.6}
.equipment-grip svg{display:block;width:100%;height:auto;max-height:155px}
.motion-dialog{width:min(1280px,calc(100vw - 26px))}
.motion-dialog-grid{grid-template-columns:minmax(0,1fr) 300px}
.motion-dialog .motion-viewer{--motion-height:min(78dvh,760px)}
.motion-dialog .motion-gif,.motion-dialog .motion-video,.motion-dialog .motion-still,.motion-dialog .motion-pending,.motion-dialog .motion-fallback-photo{height:var(--motion-height)}
.motion-dialog-anatomy img{height:620px}
@media(max-width:680px){
  .motion-viewer{--motion-height:500px}
  .motion-dialog-grid{grid-template-columns:1fr}
  .motion-dialog .motion-viewer{--motion-height:min(72dvh,650px)}
  .motion-dialog-anatomy img{height:540px}
  .motion-targets p{display:grid;grid-template-columns:100px minmax(0,1fr);gap:7px}
}

/* v14.45: short credits and optional technique details. */
.motion-info{display:flex;justify-content:flex-end;min-height:20px}
.motion-source{margin:5px 0 0;font-size:10px;gap:8px}
.motion-view-tag{padding:2px 6px;border-radius:5px;background:#f1f5f9;font-size:10px;color:#64748b}
.equipment-grip{padding-top:8px;margin-top:8px}.equipment-grip figcaption{font-size:11px}
.motion-dialog .motion-method{margin-top:10px}
.motion-dialog-anatomy>b{font-size:12px}

.motion-reference-note{color:#92400e;font-size:11px;font-weight:700}

/* v14.52: inspect the filmed movement without leaving the exercise. */
.motion-controls .motion-play{min-width:84px;color:#1d4ed8;background:#eff6ff;border-color:#bfdbfe}
.motion-speed-label{font-size:12px;white-space:nowrap}
.motion-controls .motion-speed{width:92px;min-height:42px;font-size:12px;background:#fff}
.motion-playback-note{margin:8px 0 2px;color:#64748b;font-size:11px;line-height:1.65}
.motion-controls .motion-video-choice-label{flex:1 0 100%;display:flex;align-items:center;gap:8px;font-size:12px}
.motion-video-choice{flex:1;min-width:0;max-width:320px;min-height:42px;padding:8px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#334155;font:inherit}

/* v14.55: larger default media, with the full movement kept in frame. */
.motion-viewer{--motion-height:720px}
.posture-panel.has-motion,.care-photo-slot.has-motion{padding:5px}
.motion-stage{padding:3px}
.motion-dialog{width:min(1720px,calc(100vw - 16px));max-height:calc(100dvh - 16px);padding:12px}
.motion-dialog-grid{grid-template-columns:minmax(0,1fr)}
.motion-dialog .motion-viewer{--motion-height:min(82dvh,1050px)}
.motion-dialog-anatomy{max-width:700px;width:100%;margin:0 auto}
.motion-dialog-anatomy img{height:min(55dvh,560px)}
@media(max-width:680px){
  .posture-panel.has-motion,.care-photo-slot.has-motion{padding:2px}
  .motion-stage{padding:2px}
  .motion-viewer{--motion-height:680px}
  .motion-dialog{width:calc(100vw - 6px);max-height:calc(100dvh - 8px);padding:7px}
  .motion-dialog .motion-viewer{--motion-height:82dvh}
}

/* v14.56: preserve media geometry while idle, loading or playing. */
.motion-placeholder{position:absolute;inset:0;display:grid;place-items:center;color:#94a3b8;background:#f8fafc;font-size:12px}
.motion-crop>.motion-fallback-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
