/* Visual results live next to the players; all existing sidebar tools stay open. */
.screen-ready.has-key-moments .video-editor { grid-template-rows: minmax(0,1fr) auto; }
.screen-ready.has-key-moments .drawing-toolbar { grid-row: 1 / 3; }
.key-moment-strip { grid-row: 2; grid-column: 2; min-width: 0; padding: 8px; border: 1px solid #cddac1; border-radius: 9px; background: #fff; }
.key-moment-strip header { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.key-moment-strip h2 { margin: 0; font-size: 18px; letter-spacing: -.4px; }
.key-moment-strip header > span { font-size: 14px; color: #58704f; }
.key-enlarge { margin-left: auto; font-size: 14px; min-height: 32px; padding: 3px 8px; }
.key-filmstrip { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; }
.key-card { min-width: 0; border: 1px solid #d6dfce; border-radius: 6px; overflow: hidden; background: #f2f5ed; }
.key-card-title { min-height: 34px; padding: 4px; width: 100%; border: 0; border-radius: 0; text-align: left; font-size: 14px; font-weight: 650; line-height: 1.2; }
.key-card-frames { display: grid; min-width: 0; }
.key-card.paired .key-card-frames { grid-template-columns: 1fr 1fr; gap: 1px; }
.key-frame { display: block; min-width: 0; width: 100%; border: 0; padding: 0; border-radius: 0; }
.key-frame:disabled { opacity: 1; cursor: default; }
.key-frame-image { position: relative; display: block; height: clamp(88px,13dvh,190px); background: #17261e; color: #d8e5d0; }
.key-frame canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.key-frame-placeholder { position: absolute; inset: 30% 0 auto; padding: 4px; font-size: 14px; }
.key-slot-badge { position: absolute; inset: auto 0 0; background: #12261bdd; color: #e2edda; font-size: 14px; padding: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-frame-time { display: block; font-size: 14px; padding: 4px 2px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.key-card.paired .key-frame-time { overflow-wrap: anywhere; }
.key-strip-note, .key-empty-hint { font-size: 14px; line-height: 1.35; color: #58704f; margin: 6px 0 0; }
.key-empty-hint { margin: 0 0 8px; }
.key-review-dialog { width: min(1380px,calc(100vw - 32px)); max-height: calc(100dvh - 24px); padding: 20px; border: 1px solid #9bac91; border-radius: 16px; box-shadow: 0 20px 80px #10211755; background: #f3f5ee; color: #253e2e; }
.key-review-dialog::backdrop { background: #102117aa; }
.key-review-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.key-review-dialog h2 { margin: 3px 0 12px; font-size: 28px; }
.key-eyebrow { font-size: 14px; letter-spacing: 1px; font-weight: 650; color: #5b734c; }
.key-review-close { min-width: 44px; min-height: 44px; font-size: 26px; }
.key-review-dialog nav { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; }
.key-review-dialog nav button { font-size: 16px; min-height: 42px; padding: 5px; }
.key-review-dialog nav button[aria-current=true] { background: #344f3c; color: #fff; border-color: #344f3c; }
.key-review-note { font-size: 14px; margin: 10px 0; }
.key-review-panels { display: flex; gap: 14px; }
.key-review-panel { flex: 1; min-width: 0; border: 1px solid #cad8bd; border-radius: 9px; overflow: hidden; background: #fff; }
.key-review-panel h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; padding: 9px 12px; font-size: 18px; }
.key-source { border-radius: 4px; background: #eff3e9; font-size: 14px; padding: 3px 8px; font-weight: 500; }
.key-large-frame { position: relative; height: clamp(180px,49dvh,700px); background: #15261e; }
.key-large-frame canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.key-large-frame p { position: absolute; inset: 35% 12px auto; text-align: center; color: #dbe6d5; font-size: 16px; }
.key-detail-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 10px 12px 0; }
.key-detail-time { font-size: 16px; }
.key-detail-metrics { font-size: 14px; color: #56714b; }
.key-edit-controls, .key-review-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; }
.key-edit-controls { padding-bottom: 0; }
.key-edit-controls button, .key-review-actions button { font-size: 16px; min-height: 36px; padding: 4px 10px; }
.key-edit-controls label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.key-edit-controls input { width: 86px; min-height: 36px; padding: 4px; font-size: 16px; }
.key-play-from { background: #354f3d; color: #fff; border-color: #354f3d; }
.key-review-error { color: #a33223; font-size: 16px; }
@media (min-width: 901px) and (max-width: 1600px) {
  .key-moment-strip header > span { display: none; }
  .key-card-title { min-height: 43px; }
  .key-card.paired .key-card-frames { grid-template-columns: 1fr; }
  .key-card.paired .key-frame-image { height: clamp(45px,6.5dvh,90px); }
  .key-card.paired .key-slot-badge { inset: auto auto 0 0; max-width: 100%; font-size: 14px; }
  .key-card.paired .key-frame-time { padding-block: 1px; }
}
@media (max-width: 900px) {
  .screen-ready.has-key-moments .video-editor { grid-template-rows: minmax(0,1fr); }
  .screen-ready.has-key-moments .drawing-toolbar { grid-row: 1; }
  .key-moment-strip { grid-column: 1; grid-row: 4; margin: 6px; }
  .has-key-moments.persistent-sidebar .analysis-panel { grid-row: 5; }
  .key-filmstrip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .key-frame-image { height: 112px; }
  .key-review-dialog { padding: 12px; width: calc(100vw - 16px); }
  .key-review-dialog nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .key-moment-strip header > span { display: none; }
  .key-enlarge { padding: 4px; }
  .key-card-title { min-height: 44px; }
  .key-card.paired .key-card-frames { grid-template-columns: 1fr; }
  .key-frame-time { overflow-wrap: anywhere; }
  .key-review-dialog h2 { font-size: 24px; }
  .key-review-panels { flex-direction: column; }
  .key-large-frame { height: 300px; }
  .key-review-dialog nav button { font-size: 14px; }
  .key-review-dialog > header { position: sticky; top: -12px; z-index: 2; background: #f3f5ee; padding-top: 4px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .key-review-dialog { padding: 10px; }
  .key-review-dialog h2 { font-size: 21px; margin-bottom: 6px; }
  .key-eyebrow { display: none; }
  .key-review-dialog nav { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .key-review-dialog nav button { font-size: 14px; }
  .key-large-frame { height: 200px; }
}
.key-review-dialog { max-width: none; }
.key-review-dialog button, .key-enlarge { border: 1px solid #bdcdb2; border-radius: 6px; background: #fff; }
.key-review-dialog .key-play-from { background: #354f3d; color: #fff; border-color: #354f3d; }
.key-review-dialog nav button[aria-current=true] { background: #354f3d; color: #fff; }
.key-moment-strip header { flex-wrap: wrap; }
@media (min-width: 1180px) {
  .screen-ready.has-key-moments.key-portrait:not(.is-compare) .video-editor { grid-template-columns: 50px minmax(0,1.1fr) minmax(280px,.9fr); grid-template-rows: minmax(0,1fr); }
  .screen-ready.has-key-moments.key-portrait:not(.is-compare) .video-grid { grid-column: 2; }
  .screen-ready.has-key-moments.key-portrait:not(.is-compare) .drawing-toolbar { grid-row: 1; }
  .key-portrait:not(.is-compare) .key-moment-strip { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; min-height: 0; }
  .key-portrait:not(.is-compare) .key-filmstrip { flex: 1; min-height: 0; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); }
  .key-portrait:not(.is-compare) .key-card { display: flex; flex-direction: column; }
  .key-portrait:not(.is-compare) .key-card-frames { flex: 1; min-height: 0; }
  .key-portrait:not(.is-compare) .key-frame { display: flex; flex-direction: column; min-height: 0; }
  .key-portrait:not(.is-compare) .key-frame-image { flex: 1; min-height: 0; height: auto; width: 100%; }
  .key-portrait:not(.is-compare) .key-frame-image canvas { position: absolute; inset: 0; }
  .key-portrait:not(.is-compare) .key-frame-time { flex: none; width: 100%; }
}
@media (max-width: 600px) {
  .moment-dialog { padding: 10px; }
  .moment-dialog p { line-height: 1.25; margin: 6px 0; }
  .moment-edit-row { grid-template-columns: minmax(0,1fr) 60px 58px 24px; gap: 3px; padding-top: 4px; }
  .moment-rows { gap: 4px; }
  .moment-jump span { letter-spacing: -.5px; }
}
@media (min-width: 601px) and (max-height: 500px) {
  .moment-dialog { max-width: none; }
  .moment-dialog p { line-height: 1.2; margin: 6px 0; }
  .moment-rows { gap: 4px 12px; }
  .moment-edit-row { padding-top: 4px; }
  .moment-edit-row .moment-jump { padding: 0; min-height: 28px; }
}
@media (max-width: 360px) {
  .persistent-sidebar .screen-transport .transport-row { column-gap: 3px; }
  .persistent-sidebar .screen-transport .speed-label select { width: 54px; padding-inline: 3px; }
}
@media (min-width: 601px) and (max-height: 500px) {
  .moment-edit-row label { display: flex; align-items: center; gap: 6px; }
  .moment-edit-row label input { width: 0; min-width: 0; flex: 1; }
}
