/* Exercise catalog and video consultation. Layout uses the shared dialog shell. */
.workout-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.library-toolbar { display: flex; align-items: flex-end; gap: 12px; }
.library-search { display: block; flex: 1; min-width: 0; }
.library-search > span, .library-filters label, .library-upload > label { display: block; font-size: 12px; color: var(--muted); }
.library-search input { margin-top: 7px; min-height: 48px; }
.library-filters { margin: 14px 0; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.library-filters summary, .library-upload summary, .execution-tips summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-size: 14px; font-weight: 600; }
.library-filters .form-grid { padding: 12px 0; }
.library-filters select { margin-top: 6px; min-height: 44px; }
.library-count, .library-hint { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 12px 0; }
.library-list { display: flex; flex-direction: column; }
.library-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.library-choice { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; padding: 16px 0; min-height: 70px; }
.library-row-text { display: block; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.library-choice strong { display: block; font-size: 14px; line-height: 1.45; }
.library-choice small { display: block; font-size: 11px; margin-top: 4px; }
.library-status { display: block; font-size: 11px; color: var(--green, #315f4f); margin-top: 5px; }
.library-row .icon-btn { min-width: 44px; min-height: 44px; }
.library-loading { padding: 36px 0; color: var(--muted); }
.exercise-library-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.exercise-library-link small { font-size: 11px; }
.exercise-library-link button { min-height: 44px; font-size: 12px; }
.execution-action { margin-top: 12px; }
.execution-action .btn { min-height: 44px; }
.execution-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.execution-layout > * { min-width: 0; }
.execution-media video { display: block; width: 100%; max-height: min(58dvh, 560px); aspect-ratio: 4 / 3; object-fit: contain; background: #101713; border-radius: 12px; }
.video-tools { display: grid; grid-template-columns: auto minmax(80px, 1fr) auto; gap: 8px; align-items: end; padding-top: 12px; }
.video-tools label { min-width: 0; font-size: 10px; color: var(--muted); }
.video-tools label > span { display: block; padding-bottom: 4px; }
.video-tools select { min-height: 44px; padding: 8px; }
.video-tools .btn { min-height: 44px; padding: 8px 10px; font-size: 12px; }
.execution-tips { border-bottom: 1px solid var(--line); }
.instruction-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; padding: 4px 0 18px; }
.video-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; justify-content: center; min-height: 170px; border: 1px dashed var(--line); border-radius: 12px; padding: 20px; }
.video-empty p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.library-admin { margin-top: 20px; }
.library-admin > .btn { width: 100%; }
.library-upload { margin-top: 10px; }
.library-upload input { margin: 8px 0; }
.library-upload .btn { margin: 8px 8px 8px 0; }
.library-upload .text-btn { min-height: 44px; }
.library-admin progress { width: 100%; margin-top: 8px; accent-color: #315f4f; }
.video-error { padding: 14px 0; font-size: 13px; line-height: 1.6; color: #9d3030; }
.video-error .text-btn { display: block; min-height: 44px; }
@media (min-width: 800px) {
  .execution-layout { grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 24px; }
}
@media (orientation: landscape) and (max-height: 550px) and (max-width: 1100px) {
  .execution-layout { grid-template-columns: minmax(0, 1.5fr) minmax(160px, 1fr); gap: 16px; }
  .execution-media video { max-height: min(52dvh, calc(var(--dialog-viewport-height, 100dvh) - 220px)); min-height: 100px; aspect-ratio: 16 / 9; }
  .video-tools { grid-template-columns: auto minmax(64px, 1fr) auto; gap: 6px; }
  .video-tools .btn { font-size: 11px; padding: 7px; }
  .library-admin > .btn { font-size: 12px; }
}
@media (max-width: 360px) {
  .library-choice { gap: 9px; }
  .library-choice .habit-mark { display: none; }
  .video-tools { gap: 6px; }
  .video-tools .btn { padding: 8px; }
}
/* v0.3 mobile-landscape: keep the complete playback control row above the
 * persistent dialog footer.  The native player remains large enough to inspect
 * execution, while the 44px custom controls stay reachable without scrolling. */
@media (orientation: landscape) and (max-height: 550px) and (max-width: 1100px) {
  .execution-media video {
    max-height: min(34dvh, calc(var(--dialog-viewport-height, 100dvh) - 270px));
    min-height: 88px;
  }
  .video-caption { margin-top: 4px; }
  .video-tools { padding-top: 6px; }
}
