/* Photo/GIF framing. Encoding stays in the bounded server decoder. */
body.beta #study-main .cover-picker-preview {touch-action:none;cursor:move;}
body.beta #study-main .cover-picker-preview.is-avatar {aspect-ratio:1;width:min(100%,260px);margin-inline:auto;border-radius:50%;}
body.beta #study-main .cover-picker-preview img {transition:none;}
body.beta #study-main .media-crop-controls {display:grid;gap:10px;margin:16px 0 20px;}
body.beta #study-main .media-crop-controls label {display:grid;grid-template-columns:120px minmax(0,1fr);align-items:center;gap:12px;font-size:12px;color:var(--ui-muted);}
body.beta #study-main .media-crop-controls input {width:100%;height:28px;margin:0;padding:0;accent-color:var(--ui-accent);}
body.beta #study-main .media-crop-controls small {font-size:11px;color:var(--ui-muted);}
body.beta #study-main .media-remove {display:block;margin:12px auto 0;min-height:40px;background:transparent;border:0;color:var(--ui-danger,#a73048);font:inherit;font-size:13px;}
body.beta .profile-media-viewer {position:fixed;inset:0;z-index:200;display:grid;place-items:center;box-sizing:border-box;padding:calc(var(--app-safe-top,0px) + 12px) 16px calc(var(--app-safe-bottom,0px) + 12px);background:#101828b8;overscroll-behavior:contain;}
body.beta .profile-media-viewer>section {display:grid;grid-template-rows:auto minmax(0,1fr) auto;box-sizing:border-box;width:min(100%,960px);height:min(820px,calc(100dvh - var(--app-safe-top,0px) - var(--app-safe-bottom,0px) - 24px));padding:16px;border-radius:22px;background:var(--ui-surface);color:var(--ui-text);overflow:hidden;}
body.beta .profile-media-viewer header {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 0 12px;}
body.beta .profile-media-viewer h2 {margin:0;font-size:18px;line-height:1.3;}
body.beta .profile-media-viewer button {display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;box-sizing:border-box;padding:10px;border:0;border-radius:12px;background:var(--ui-soft);color:var(--ui-accent);font:inherit;font-size:13px;cursor:pointer;}
body.beta .profile-media-viewer button svg {width:20px;height:20px;}
body.beta .profile-media-viewer .profile-media-stage {min-height:0;overflow:auto;border-radius:14px;background:var(--ui-soft);}
body.beta .profile-media-image-wrap {display:grid;place-items:center;min-width:100%;min-height:100%;width:max-content;height:max-content;}
body.beta .profile-media-image-wrap img {display:block;max-width:none;max-height:none;object-fit:contain;}
body.beta .profile-media-viewer footer {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding-top:14px;}
body.beta .profile-media-viewer footer label {display:flex;align-items:center;gap:12px;max-width:100%;font-size:13px;}
body.beta .profile-media-viewer input {width:180px;max-width:100%;accent-color:var(--ui-accent);}
body.beta .profile-media-viewer [role=status] {font-size:13px;color:var(--ui-muted);}
body.beta .profile-media-viewer [hidden] {display:none;}
body.beta .profile-media-viewer :is(button,input):focus-visible {outline:2px solid var(--ui-accent);outline-offset:2px;}
body.beta #study-main .banner-editor-overlay.cover-picker-overlay[data-banner-editor] {position:fixed;inset:0;z-index:120;display:flex;align-items:center;justify-content:center;padding:24px;background:#10182866;overflow:auto;overscroll-behavior:contain;}
body.beta #study-main .cover-picker {width:100%;max-width:560px;max-height:calc(100dvh - 48px);overflow:auto;box-sizing:border-box;padding:22px;border-radius:26px;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 18px 70px #10182822;}
body.beta #study-main .cover-picker [hidden] {display:none;}
body.beta #study-main .cover-picker-header {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;}
body.beta #study-main .cover-picker-header h2 {margin:0;font-size:22px;letter-spacing:-.5px;}
body.beta #study-main .cover-picker-header button {display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:var(--ui-soft);color:var(--ui-muted);}
body.beta #study-main .cover-picker svg {width:22px;height:22px;flex-shrink:0;}
body.beta #study-main .cover-picker-preview {aspect-ratio:3/1;position:relative;overflow:hidden;border-radius:18px;background:var(--ui-soft);border:1px solid var(--ui-border);}
body.beta #study-main .cover-picker-preview img {width:100%;height:100%;object-fit:cover;display:block;}
body.beta #study-main [data-banner-empty] {height:100%;display:flex;align-items:center;justify-content:center;gap:10px;color:var(--ui-muted);font-size:13px;}
body.beta #study-main .cover-picker-hint {font-size:11px;line-height:1.5;color:var(--ui-muted);margin:10px 0 18px;}
body.beta #study-main .cover-picker-file {display:flex;align-items:center;gap:12px;position:relative;padding:12px;border-radius:16px;background:var(--ui-soft);cursor:pointer;overflow:hidden;}
body.beta #study-main .cover-picker-file-icon {display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--ui-accent-soft);color:var(--ui-accent);flex-shrink:0;}
body.beta #study-main .cover-picker-file>span:nth-child(2) {flex:1;min-width:0;}
body.beta #study-main .cover-picker-file strong {display:block;font-size:14px;font-weight:600;color:var(--ui-accent);}
body.beta #study-main .cover-picker-file small {display:block;font-size:11px;line-height:1.5;color:var(--ui-muted);margin-top:3px;}
body.beta #study-main .cover-picker-file>svg {width:16px;color:var(--ui-muted);}
body.beta #study-main .cover-picker-file input {position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;}
body.beta #study-main .cover-picker button {font-family:inherit;cursor:pointer;}
body.beta #study-main .cover-picker button:disabled,.cover-picker-file:has(input:disabled) {opacity:.45;cursor:default;}
body.beta #study-main .cover-picker button:focus-visible,.cover-picker-file:focus-within {outline:2px solid var(--ui-accent);outline-offset:3px;}
body.beta #study-main .cover-picker-save {width:100%;min-height:48px;margin-top:20px;border:0;border-radius:14px;font-size:15px;font-weight:600;background:var(--ui-accent);color:var(--ui-on-accent,#fff);}
body.beta #study-main .cover-picker-error {font-size:13px;line-height:1.5;color:var(--ui-danger);margin:12px 0 0;}
body.beta #study-main .cover-picker-status {font-size:12px;color:var(--ui-muted);margin:8px 0 0;}
body.beta #study-main .cover-picker-status:empty {display:none;}
body.beta #study-main .cover-picker-confirm h3 {font-size:18px;margin:0 0 8px;}
body.beta #study-main .cover-picker-confirm p {font-size:13px;color:var(--ui-muted);margin:0 0 20px;}
body.beta #study-main .cover-picker-confirm button {width:100%;min-height:44px;border:0;border-radius:14px;font-size:14px;font-weight:600;margin-top:8px;color:var(--ui-accent);background:var(--ui-accent-soft);}
body.beta #study-main .cover-picker-confirm [data-banner-action=discard] {color:var(--ui-danger);background:var(--ui-soft);}
@media(max-width:600px) {body.beta #study-main .banner-editor-overlay.cover-picker-overlay[data-banner-editor] {align-items:flex-end;padding:12px 10px max(12px,env(safe-area-inset-bottom));}body.beta #study-main .cover-picker {padding:18px;max-height:calc(100dvh - 32px);border-radius:24px;}body.beta #study-main .cover-picker-header {margin-bottom:14px;}}

body.beta #study-main .cover-picker:focus {outline:none;}
body.beta #study-main .banner-editor-overlay.cover-picker-overlay[data-banner-editor] {box-sizing:border-box;padding-top:calc(var(--app-safe-top,0px) + 12px);padding-bottom:calc(var(--app-safe-bottom,0px) + 12px);}
body.beta #study-main .cover-picker {max-height:calc(100dvh - var(--app-safe-top,0px) - var(--app-safe-bottom,0px) - 24px);}
body.beta #study-main .cover-picker-header button {flex:0 0 44px;min-width:44px;}
body.beta #study-main .cover-picker-header h2 {min-width:0;line-height:1.25;}
@media(max-width:399px) {body.beta #study-main .cover-picker-preview.is-avatar {width:min(100%,220px);}}
