/* THV_PHOTO_REORDER_V1 */
.photo-slot[data-thv-photo]{cursor:grab;position:relative}
.photo-slot[data-thv-photo] button.photo-drag-handle{position:absolute;top:auto;left:5px;right:auto;bottom:5px;background:#fff;color:#17435e;border:0;border-radius:50%;padding:7px;box-sizing:border-box;width:32px;height:32px;min-width:32px;min-height:32px;cursor:grab;touch-action:none;z-index:2}
.photo-slot[data-thv-photo] .photo-main-label{position:absolute;left:4px;bottom:40px;background:#17435e;color:#fff;border-radius:3px;padding:3px 6px;font-size:11px;pointer-events:none}
.photo-slot.photo-sorting{opacity:.6;cursor:grabbing;outline:2px dashed #1b729a}
.photo-slot.photo-sort-target{outline:3px solid #008570;outline-offset:2px}
.photo-slot[data-thv-photo] .photo-drag-handle:focus-visible{outline:3px solid #008570;outline-offset:2px}
/* THV_PHOTO_ROTATE_UI_V1 — small circular controls and a real rotation dialog. */
.photo-layout{display:block}
.photo-layout>div:first-child{width:100%}
.photo-grid{width:100%;max-width:none;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
.photo-grid .photo-slot,.photo-grid .photo-add{height:auto;aspect-ratio:1;border-radius:7px;overflow:hidden}
.photo-grid .photo-slot{order:0}
.photo-grid .photo-add{order:1;border:2px dashed #e0e4e7}
.photo-grid .photo-empty{display:none}
.photo-layout .photo-advice{max-width:none;margin-top:12px}
.photo-layout .photo-advice p{display:inline;margin-left:6px}
.photo-slot[data-thv-photo] button.photo-rotate-button,.photo-slot[data-thv-photo] button.photo-delete-button{position:absolute;left:auto;right:8px;bottom:auto;top:8px;width:32px;height:32px;min-width:32px;min-height:32px;display:grid;place-items:center;border:0;border-radius:50%;background:#fff;padding:8px;color:#263a46;box-shadow:0 1px 3px #0002;z-index:2}
.photo-slot[data-thv-photo] button.photo-delete-button{top:46px}
.photo-slot[data-thv-photo] button img{width:16px;height:16px;object-fit:contain;border-radius:0;pointer-events:none}
.photo-slot[data-thv-photo] button:focus-visible{outline:3px solid #007daa;outline-offset:2px}
.photo-slot[data-thv-photo]>img[role=button]:focus-visible{outline:3px solid #007daa;outline-offset:-3px}
.thv-photo-dialog{box-sizing:border-box;width:min(580px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:0;border-radius:9px;background:#fff;color:#30404d;overflow:auto;box-shadow:0 12px 50px #0003}
.thv-photo-dialog::backdrop{background:#0009}
.thv-photo-dialog .photo-dialog-header{display:flex;align-items:center;justify-content:center;position:relative;padding:20px 45px}
.thv-photo-dialog h2{font-family:inherit;font-size:18px;line-height:1.4;margin:0;font-weight:700}
.thv-photo-dialog button.photo-dialog-close{position:absolute;right:12px;top:12px;width:32px;height:32px;padding:8px;border:0;border-radius:50%;background:white;display:grid;place-items:center}
.thv-photo-dialog button.photo-dialog-close img{width:18px;height:18px}
.photo-rotate-preview{margin:6px 40px 20px;height:clamp(80px,calc(100dvh - 186px),498px);display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:9px;background:#f3f3f1}
.photo-rotate-preview img{max-width:none!important;max-height:none!important;object-fit:contain;flex-shrink:0;transition:transform .15s ease}
.photo-rotate-status{min-height:18px;margin:8px 40px;font-size:13px}
.photo-rotate-status[role=alert]{color:#ac2330}
.photo-rotate-status:empty{display:none}
.thv-photo-dialog .photo-dialog-actions{display:flex;gap:8px;justify-content:flex-end;border-top:1px solid #e4e4e4;padding:12px 16px;margin:0;background:#fff}
.thv-photo-dialog .photo-dialog-actions button{position:static;display:flex;align-items:center;justify-content:center;gap:6px;width:auto;height:auto;min-width:124px;min-height:44px;border-radius:7px;padding:10px 18px;font-weight:700;font-size:15px;border:1px solid #146eaa;background:#fff;color:#146eaa}
.thv-photo-dialog .photo-dialog-actions button img{width:18px;height:18px;filter:invert(32%) sepia(49%) saturate(1385%) hue-rotate(168deg)}
.thv-photo-dialog .photo-dialog-actions .photo-dialog-done{background:#146eaa;color:#fff}
.thv-photo-dialog button:disabled{opacity:.65;cursor:wait}
@media(max-width:600px){.photo-rotate-preview{margin:6px 16px 0}.photo-rotate-status{margin:8px 16px}.thv-photo-dialog .photo-dialog-actions button{min-width:100px}}
/* THV_PHOTO_CROP_UI_V1 */
.photo-rotate-preview img[hidden]{display:none!important}
.photo-preview-advanced{height:clamp(120px,32dvh,270px);margin-bottom:10px}
.photo-preview-advanced canvas{max-width:100%;max-height:100%;object-fit:contain;display:block}
.photo-edit-tools{margin:0 40px 14px;font-size:13px}
.thv-photo-dialog .photo-edit-tools button{position:static;width:auto;height:auto;min-height:36px;border:1px solid #ccd8df;border-radius:5px;padding:7px 10px;background:#fff;color:#146eaa;font-size:13px}
.photo-edit-settings{display:grid;grid-template-columns:1fr 1fr;gap:8px 20px;margin-top:8px}
.photo-edit-settings label{display:grid;gap:4px;font-size:13px}
.photo-edit-settings input[type=range]{width:100%;margin:0;accent-color:#146eaa;min-height:26px}
.photo-edit-settings .photo-straighten,.photo-edit-settings p{grid-column:1/-1}
.photo-edit-settings p{margin:0;font-size:12px}
.thv-photo-dialog .photo-dialog-actions{position:sticky;bottom:0;z-index:5}
@media(max-width:600px){.photo-edit-tools{margin:10px 16px}.photo-edit-settings{gap:8px 12px}}

/* THV_PHOTO_DIALOG_ISOLATION_20261020: editor actions are not a website footer. */
html body #root .thv-photo-dialog .photo-dialog-header{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:18px 44px;background:#fff;color:#30404d}
html body #root .thv-photo-dialog .photo-dialog-actions{box-sizing:border-box;position:sticky;bottom:0;z-index:8;display:flex!important;flex-wrap:nowrap!important;align-items:center;justify-content:flex-end;gap:12px;width:100%;padding:12px 16px!important;margin:0!important;border-top:1px solid #dce3e7;background:#fff!important;color:#146eaa;isolation:isolate}
html body #root .thv-photo-dialog .photo-dialog-actions>button{box-sizing:border-box;position:static!important;inset:auto!important;display:inline-flex!important;align-items:center;justify-content:center;flex:1 1 0;gap:7px;width:auto!important;min-width:0!important;max-width:none!important;height:44px!important;min-height:44px!important;max-height:none!important;margin:0!important;padding:10px 14px!important;border:1px solid #146eaa!important;border-radius:7px!important;background:#fff!important;color:#146eaa!important;font-family:inherit;font-size:15px!important;line-height:1.3!important;font-weight:700!important;text-indent:0!important;letter-spacing:normal!important;white-space:nowrap;opacity:1;visibility:visible;cursor:pointer;touch-action:manipulation}
html body #root .thv-photo-dialog .photo-dialog-actions>.photo-dialog-done{background:#146eaa!important;color:#fff!important}
html body #root .thv-photo-dialog .photo-dialog-actions>button:disabled{opacity:.65;cursor:wait}
html body #root .thv-photo-dialog .photo-dialog-actions>button img{position:static!important;width:18px!important;height:18px!important;min-width:18px;max-width:18px;object-fit:contain;pointer-events:none}
html body #root .thv-photo-dialog .photo-dialog-actions>button:focus-visible{outline:3px solid #008570;outline-offset:2px}
html body #root .thv-photo-dialog .photo-rotate-preview{height:clamp(120px,calc(100dvh - 250px),498px)}
html body #root .thv-photo-dialog .photo-preview-advanced{height:clamp(120px,32dvh,270px)}
@media(max-width:600px){html body #root .thv-photo-dialog .photo-dialog-actions{padding:12px!important;gap:10px}}

/* Direct previews while the original upload continues. */
#root .photo-upload-preview{position:relative;min-width:0;aspect-ratio:1;border:1px solid #a5bac6;border-radius:8px;overflow:hidden;background:#edf2f5;isolation:isolate}#root .photo-upload-preview>img{width:100%;height:100%;object-fit:cover;display:block}#root .photo-upload-overlay{position:absolute;inset:auto 0 0;display:grid;gap:5px;padding:7px;background:rgba(255,255,255,.96);color:#173f55;font-size:12px;line-height:1.3;overflow-wrap:anywhere}#root .photo-upload-overlay progress{width:100%;height:8px;accent-color:#146eaa}#root .photo-upload-failed{border:2px solid #b3261e}#root .photo-upload-failed .photo-upload-overlay{color:#8b1711}#root .photo-upload-overlay button{display:block;position:static;width:auto;height:auto;min-height:36px;max-width:100%;padding:5px;border:1px solid currentColor;border-radius:5px;background:white;color:#8b1711;font-size:12px;line-height:1.2;white-space:normal;cursor:pointer}
