/* Photo tools are isolated from coaching charts, forms and progress media. */
.cm-photo-editor-dialog { max-width: 760px; }
.cm-photo-editor { display: grid; gap: 12px; }
.cm-photo-edit-viewport { display: grid; place-items: center; background: #101511; border-radius: 10px; overflow: hidden; width: 100%; }
.cm-photo-edit-stage { position: relative; touch-action: none; overflow: hidden; cursor: grab; outline-offset: -3px; }
.cm-photo-edit-stage:active { cursor: grabbing; }
.cm-photo-edit-stage canvas { display: block; width: 100%; height: 100%; }
.cm-photo-ratios { display: flex; justify-content: center; gap: 8px; }
.cm-photo-ratios button, .cm-photo-control { min-height: 44px; min-width: 44px; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-card); color: var(--p-text); font: inherit; font-size: 13px; padding: 8px 12px; cursor: pointer; }
.cm-photo-ratios button[aria-pressed="true"] { background: var(--p-lime); color: var(--p-lime-ink); border-color: var(--p-lime); }
.cm-photo-control { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.cm-photo-control svg { width: 18px; height: 18px; }
.cm-photo-zoom { display: flex; align-items: center; gap: 8px; }
.cm-photo-zoom input[type="range"] { flex: 1; min-width: 40px; min-height: 44px; accent-color: var(--p-text); }
.cm-photo-zoom output { font-size: 12px; min-width: 42px; color: var(--p-text-2); text-align: right; }
.cm-photo-edit-actions { display: flex; gap: 8px; justify-content: center; }
.cm-photo-expand { position: absolute; top: 8px; right: 8px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #FFFFFF; cursor: pointer; }
.cm-photo-expand svg { width: 19px; height: 19px; }
dialog.cm-photo-view-dialog, dialog.cm-photo-view-dialog.wide { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #05070D; color: #FFFFFF; }
.cm-photo-view-dialog .modal { display: flex; flex-direction: column; width: 100%; height: 100%; border-radius: 0; max-height: none; background: #05070D; }
.cm-photo-view-dialog .sheet-handle { display: none; }
.cm-photo-view-dialog .modal-head { flex: none; padding-top: max(12px, env(safe-area-inset-top)); color: #FFFFFF; border: 0; }
.cm-photo-view-dialog .modal-head h2, .cm-photo-view-dialog .modal-head button { color: #FFFFFF; }
.cm-photo-view-dialog .modal-body { display: flex; flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.cm-photo-fullscreen { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cm-photo-view-stage { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; }
.cm-photo-view-stage:active { cursor: grabbing; }
.cm-photo-view-stage img { flex: none; max-width: none; max-height: none; object-fit: contain; transform-origin: center; user-select: none; -webkit-user-select: none; }
.cm-photo-view-tools { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); flex: none; }
.cm-photo-view-tools .cm-photo-control { background: #222A24; color: #FFFFFF; border-color: #465047; }
.cm-photo-view-tools output { min-width: 44px; font-size: 12px; text-align: center; }
.cm-media-draft { display: grid; min-width: 0; border: 1px solid var(--p-line); border-radius: 10px; overflow: hidden; }
.cm-media-draft-preview { aspect-ratio: 1; position: relative; overflow: hidden; background: var(--p-raised); }
.cm-media-draft-preview img, .cm-media-draft-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cm-media-order { position: absolute; top: 5px; left: 5px; min-width: 22px; height: 22px; padding: 0 5px; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #FFFFFF; border-radius: 6px; font-size: 11px; }
.cm-media-uploading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #FFFFFF; font-size: 12px; }
.cm-media-draft-tools { display: flex; align-items: center; justify-content: space-around; min-width: 0; }
.cm-media-draft-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 44px; min-width: 44px; padding: 3px; border: 0; background: transparent; color: var(--p-text); font: inherit; font-size: 12px; cursor: pointer; }
.cm-media-draft-tools button svg { width: 17px; height: 17px; }
.cm-media-draft-tools button:disabled { opacity: .35; cursor: default; }
.cm-story-media-tools { position: absolute; bottom: 12px; left: 12px; right: 12px; display: flex; justify-content: center; gap: 8px; }
.cm-story-media-tools button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: rgba(0,0,0,.65); color: #FFFFFF; font: inherit; font-size: 13px; cursor: pointer; }
.cm-story-media-tools button svg { width: 17px; height: 17px; }
@media (max-width: 420px) { .cm-tiles:has(.cm-media-draft) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-card-fields { display: grid; gap: 12px; }
.cm-card-field-pair { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
.cm-card-draft-tools { display: flex; flex-direction: column; gap: 4px; }
.cm-card-draft-tools button { min-height: 40px; border: 0; border-radius: 6px; background: var(--p-raised); color: var(--p-text); font: inherit; font-size: 12px; padding: 8px; cursor: pointer; }
.cm-card-draft-tools button:disabled { opacity: .5; }
.cm-card-publish-preview { width: 100%; max-width: 480px; display: grid; gap: 8px; margin: 8px auto; }
.cm-card-publish-preview[hidden] { display: none; }
.cm-card-publish-preview h2, .cm-card-publish-preview p { margin: 0; }
.cm-card-publish-preview figure { margin: 0; display: grid; gap: 6px; }
.cm-card-publish-preview img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 10px; }
.cm-card-publish-preview figcaption { text-align: center; }
.cm-photo-card-dialog .cm-photo-edit-viewport { background: #101511; }
.cm-media .track { touch-action: pan-y; }
.cm-media .slide { overflow: hidden; }
.cm-media .slide img { transform-origin: center; }
.cm-media .cm-photo-expand { left: 8px; right: auto; }
.cm-media .cm-sound { width: 44px; height: 44px; bottom: 52px; }
.cm-media .cm-sound[hidden], .cm-media .cm-dots[hidden], .cm-media .cm-count[hidden] { display: none; }
.cm-inline-reset { position: absolute; bottom: 12px; left: 12px; z-index: 2; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: rgba(0,0,0,.65); color: #FFFFFF; font: inherit; font-size: 12px; }
.cm-inline-reset[hidden] { display: none; }
.cm-gallery-nav { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 6px 12px; }
.cm-gallery-position { min-width: 48px; text-align: center; color: #FFFFFF; font-size: 13px; }
.cm-gallery-nav .cm-photo-control { background: #222A24; color: #FFFFFF; border-color: #465047; }
.cm-gallery-nav button:disabled { opacity: .35; }
.cm-act-btn.cm-selected { color: var(--p-text); background: var(--p-raised); }
.cm-act-btn.cm-selected svg { fill: currentColor; }
