.hffu{position:relative;max-width:760px;padding:24px;border:1px solid #e2e2e2;border-radius:12px;background:#fff;box-sizing:border-box}.hffu *{box-sizing:border-box}.hffu-title{margin:0 0 22px}.hffu-field,.hffu-step{margin:0 0 20px}.hffu label,.hffu-step>label{display:block;margin:0 0 7px;font-weight:600}.hffu select,.hffu input[type=text],.hffu input[type=password]{width:100%;min-height:46px;padding:9px 12px;border:1px solid #cfcfcf;border-radius:7px;background:#fff;font-size:16px}.hffu-choice{display:flex;flex-direction:column;align-items:center;gap:12px;max-width:420px;margin:0 auto}.hffu-choice-button{width:100%;min-height:54px;border:1px solid #bbb;border-radius:8px;font-size:17px;font-weight:600;cursor:pointer;padding:12px 20px}
.hffu .hffu-choice-button{background:#fff!important;color:#222!important;}.hffu-choice-button:hover{background:#f5f5f5}.hffu-folder-row{display:flex;gap:10px;align-items:center}.hffu-folder-row select{flex:1}.hffu-button{border:1px solid #b8b8b8;border-radius:7px;min-height:44px;padding:9px 14px;font-size:15px;cursor:pointer}.hffu-button-primary{border-color:#222}.hffu-button-danger{border-color:#a61b1b}
/* Qualified with the .hffu root (not just the bare class) so these beat a theme's own
   button color reset even when the theme's rule also uses !important: with two rules of
   equal !important weight, the more specific selector wins regardless of load order. */
.hffu .hffu-button{background:#fff!important;color:#222!important;}
.hffu .hffu-button:hover{background:#f4f4f4!important;}
.hffu .hffu-button-primary{background:#222!important;color:#fff!important;}
.hffu .hffu-button-primary:hover{background:#000!important;}
.hffu .hffu-button-danger{background:#a61b1b!important;color:#fff!important;}
.hffu .hffu-button-danger:hover{background:#8f1616!important;}.hffu-folder-row .button{white-space:nowrap}.hffu-new-folder-box{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;align-items:center}.hffu-new-folder-box input{flex:1 1 auto;min-width:0}.hffu-new-folder-actions{display:flex;gap:8px}.hffu-dropzone{position:relative;min-height:170px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:24px;text-align:center;border:2px dashed #c8c8c8;border-radius:12px;background:#fafafa;cursor:pointer;transition:.15s ease}.hffu-dropzone:hover,.hffu-dropzone:focus,.hffu-dropzone.is-dragging{border-color:#777;background:#f3f3f3;outline:none}.hffu-dropzone span{color:#666;font-size:14px}.hffu-drop-icon{font-size:34px;line-height:1}.hffu-drop-title{font-size:17px}.hffu-files{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.hffu-files-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin-top:12px}.hffu-file{display:flex;align-items:center;gap:10px;padding:9px;border:1px solid #e3e3e3;border-radius:8px;background:#fff;min-width:0}.hffu-file img{width:58px;height:58px;flex:0 0 58px;object-fit:cover;border-radius:6px}.hffu-file-info{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.hffu-file-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hffu-file-info span{font-size:12px;color:#777}.hffu-remove{border:0;background:transparent;cursor:pointer;font-size:24px;line-height:1;color:#777;padding:5px}.hffu-remove:hover{color:#000}.hffu-actions{margin-top:20px}.hffu-upload{min-height:46px;padding-left:20px!important;padding-right:20px!important}.hffu-status,.hffu-remove-status{min-height:22px;margin-top:12px;font-size:14px}.hffu-status-success,.hffu-remove-status.success{color:#237a3b}.hffu-status-error,.hffu-remove-status.error{color:#b42318}.hffu-status-warning{color:#8a5a00}.hffu-status-working{color:#555}.hffu-progress-wrap{margin-top:16px}.hffu-progress{height:10px;background:#e8e8e8;border-radius:999px;overflow:hidden}.hffu-progress span{display:block;height:100%;width:0;background:#333;transition:width .1s linear}.hffu-progress-text{font-size:12px;text-align:right;margin-top:5px;color:#555}.hffu-notice{padding:14px 16px;border-radius:8px}.hffu-notice.hffu-error{background:#fff2f2;color:#8a1c1c;border:1px solid #f0c5c5}.hffu-busy{opacity:.85}.hffu-help{color:#666;margin-top:-10px}.hffu-album-tools{display:flex;gap:8px;margin:0 0 10px}.hffu-albums-list{border:1px solid #ddd;border-radius:8px;overflow:hidden;margin-bottom:18px}.hffu-album-item{display:grid!important;grid-template-columns:24px 1fr auto;align-items:center;gap:8px;padding:12px 14px;margin:0!important;padding-left:calc(14px + (var(--hffu-depth, 0) * 24px));border-bottom:1px solid #eee;font-weight:400!important;cursor:pointer}.hffu-album-item:last-child{border-bottom:0}.hffu-album-item:hover{background:#fafafa}.hffu-album-name{font-weight:600}.hffu-album-item small{color:#777}.hffu-empty{padding:16px;color:#666}.hffu-delete-options{border:1px solid #ddd;border-radius:8px;padding:14px;margin:0 0 18px}.hffu-delete-options legend{padding:0 6px;font-weight:600}.hffu-delete-options label{font-weight:400;margin:0 0 10px}.hffu-delete-options label:last-child{margin-bottom:0}.hffu-subfolder-option{margin-top:12px;padding-top:12px;border-top:1px solid #eee}.hffu-login{max-width:480px;margin:0 auto;padding:24px;border:1px solid #ddd;border-radius:12px;background:#fff}.hffu-login-inner h3{margin-top:0}.hffu-login-inner>p{color:#666}.hffu-remember{font-weight:400!important;margin:0 0 16px!important}.hffu-login .hffu-login-link{display:block;width:100%;box-sizing:border-box;margin:18px 0 0;padding:12px 16px;min-height:44px;border:1px solid #222;border-radius:7px;background:#222!important;color:#fff!important;font-size:16px;font-weight:600;line-height:1.3;text-align:center;text-decoration:none!important;cursor:pointer;transition:background .15s ease}
.hffu-login .hffu-login-link:hover,.hffu-login .hffu-login-link:focus{background:#000!important;color:#fff!important;text-decoration:none!important}
.hffu-login .hffu-login-link:focus-visible{outline:2px solid #2271b1;outline-offset:2px}.hffu-notice{margin-bottom:15px}.hffu-panel[hidden],.hffu-step[hidden],.hffu-choice[hidden],.hffu-progress-wrap[hidden],.hffu-new-folder-box[hidden],.hffu-albums-step[hidden]{display:none!important}@media(max-width:600px){.hffu{padding:16px}.hffu-folder-row,.hffu-new-folder-box{flex-direction:column;align-items:stretch}.hffu-folder-row .button,.hffu-new-folder-actions .hffu-button{width:100%}.hffu-new-folder-actions{flex-direction:column}.hffu-files-list{grid-template-columns:1fr}.hffu-album-tools{flex-direction:column}.hffu-album-tools .hffu-button{width:100%}}

.hffu-new-folder-context{flex:0 0 100%;width:100%;padding:10px 12px;border:1px solid #e5e5e5;border-radius:7px;background:#f7f7f7;font-size:14px;color:#555}.hffu-new-folder-context strong{color:#222}.hffu-button:disabled{opacity:.55;cursor:not-allowed}.hffu-button:disabled:hover{background:inherit}

/* 0.2.9: left-align album/folder names while preserving nested hierarchy. */
.hffu-album-item{padding-left:14px!important;}
.hffu-album-name{display:block;min-width:0;text-align:left;padding-left:calc(var(--hffu-depth, 0) * 24px);}
.hffu-album-item small{display:block;text-align:right;white-space:nowrap;}

/* 0.2.10: navigation back to the main Add/Remove menu. */
.hffu-back-menu{display:block;margin:0 0 18px auto;}
@media(max-width:600px){.hffu-back-menu{width:100%;margin:0 0 14px;}}

/* 0.2.23: "Form Alignment" positions the whole form box on the page (left/center/right).
   It must never change the alignment of anything *inside* the form — labels, buttons,
   and fields always stay left-aligned regardless of this setting. */
.hffu.hffu-form-align-left{margin-left:0;margin-right:auto;}
.hffu.hffu-form-align-center{margin-left:auto;margin-right:auto;}
.hffu.hffu-form-align-right{margin-left:auto;margin-right:0;}

/* 0.2.13: admin-controlled form outline visibility. */
.hffu-outline-hidden{border:0!important;}
/* 0.2.15: individual photo deletion UI */
.hffu-remove-mode-switch{display:flex;justify-content:center;gap:8px;margin:0 0 18px;}
.hffu-remove-mode{min-width:150px;}
.hffu-remove-mode-active{background:#222;color:#fff;border-color:#222;}.hffu-remove-mode-active:hover{background:#f4f4f4;color:#222;border-color:#222;}
.hffu-photo-album{border:1px solid #ddd;border-radius:8px;margin:0 0 10px;overflow:hidden;}
.hffu-photo-album-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;background:#fafafa;}
.hffu-photo-album-header strong{flex:1;text-align:left;}
.hffu-photo-album-toggle{white-space:nowrap;}
/* One photo per row (not a multi-column grid), left-aligned, with an
   admin-configurable thumbnail size (--hffu-photo-thumb-size, set from JS
   using the "Photo thumbnail size" setting). display:flex + !important
   guards this against theme CSS (Divi, Avada, etc.) that broadly resets
   label/input/img display and positioning. */
.hffu-photo-list{display:flex!important;flex-direction:column!important;gap:10px;padding:10px;}
.hffu-photo-item{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;text-align:left!important;gap:14px;width:100%;border:1px solid #e5e5e5;border-radius:7px;padding:12px;background:#fff;box-sizing:border-box;}
.hffu-photo-item img{width:var(--hffu-photo-thumb-size,120px);height:var(--hffu-photo-thumb-size,120px);flex:0 0 var(--hffu-photo-thumb-size,120px);object-fit:cover;border-radius:6px;background:#eee;}
.hffu-photo-item-info{min-width:0;flex:1 1 auto;text-align:left!important;}
.hffu-photo-item-info strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;text-align:left!important;}
.hffu-photo-item-info small{display:block;color:#777;margin-top:3px;text-align:left!important;}
.hffu-photo-tools{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px;}
.hffu-photo-delete-warning{padding:10px 12px;border:1px solid #ead5a0;background:#fff8df;border-radius:7px;color:#765b00;margin:0 0 12px;}
.hffu-photo-empty{padding:12px;color:#777;text-align:left;}
@media(max-width:600px){.hffu-remove-mode-switch{flex-direction:column;}.hffu-remove-mode{width:100%;}.hffu-photo-item img{width:var(--hffu-photo-thumb-size,88px);height:var(--hffu-photo-thumb-size,88px);flex-basis:var(--hffu-photo-thumb-size,88px);}}

/* Defensive reset: some themes (Divi, Avada, etc.) globally restyle checkboxes
   with position:absolute/opacity:0 for their own custom toggle graphics. That
   collides with our plain checkboxes here and makes them appear detached from
   their row. Force plain, in-flow native checkboxes inside this plugin's UI. */
.hffu input[type=checkbox]{position:static!important;float:none!important;display:inline-block!important;width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;margin:0!important;opacity:1!important;vertical-align:middle!important;flex:0 0 18px;}

/* 0.2.23: front-end drag-to-reorder photos UI (replaces the old rename-based ordering). */
.hffu-reorder-photo-list{padding:10px;display:flex!important;flex-direction:column!important;gap:10px}
.hffu-reorder-item{display:flex!important;flex-direction:row!important;align-items:center!important;text-align:left!important;gap:14px;width:100%;border:1px solid #e5e5e5;border-radius:7px;padding:12px;background:#fff;box-sizing:border-box;touch-action:pan-y}
.hffu-reorder-position{flex:0 0 24px;font-size:12px;font-weight:600;color:#888;text-align:center}
.hffu-reorder-handle{flex:0 0 auto;cursor:grab;touch-action:none;font-size:20px;line-height:1;color:#888;padding:6px;background:transparent;border:0;user-select:none}
.hffu-reorder-handle:hover{color:#333}
.hffu-reorder-item img{width:var(--hffu-photo-thumb-size,120px);height:var(--hffu-photo-thumb-size,120px);flex:0 0 var(--hffu-photo-thumb-size,120px);object-fit:cover;border-radius:6px;background:#eee}
.hffu-reorder-photo-info{min-width:0;flex:1 1 auto;text-align:left!important}
.hffu-reorder-photo-info strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;text-align:left!important}
.hffu-reorder-item.hffu-dragging{opacity:.55;background:#f5f5f5;border-color:#bbb}
.hffu-reorder-status{min-height:22px;margin-top:12px;font-size:14px;color:#237a3b}
.hffu-remove-mode-switch{flex-wrap:wrap}
@media(max-width:600px){.hffu-reorder-item img{width:var(--hffu-photo-thumb-size,88px);height:var(--hffu-photo-thumb-size,88px);flex-basis:var(--hffu-photo-thumb-size,88px);}}

/* CSS display:grid overrides the browser's default [hidden] behavior. Explicitly restore it. */
.hffu-photo-list[hidden],
.hffu-reorder-photo-list[hidden]{display:none!important;}

/* 0.2.28: unified "Manage Photos & Albums" screen — search/expand-collapse toolbar,
   a single nested tree of albums (replacing the old Remove Albums / Delete Photos /
   Reorder Photos tabs), per-album kebab menu, and inline photo rename/reorder/move/delete. */
/* Search sits on its own full-width row, with the action buttons always on the row
   below — a fixed two-row layout rather than one that only wraps at narrow widths. */
.hffu-manage-toolbar{display:flex;flex-direction:column;gap:10px;margin:0 0 14px;}
.hffu-manage-search{width:100%;min-width:0;}
.hffu-album-search{width:100%;min-height:44px;padding:9px 12px;border:1px solid #cfcfcf;border-radius:7px;font-size:15px;}
.hffu-manage-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap;}
.hffu-manage-tree{border:1px solid #ddd;border-radius:8px;overflow:hidden;margin-bottom:16px;}
.hffu-tree-row{display:flex!important;align-items:center!important;gap:10px;padding:12px 14px;padding-left:calc(14px + (var(--hffu-depth, 0) * 22px));border-bottom:1px solid #eee;background:#fff;}
.hffu-manage-tree>.hffu-tree-row:last-child,.hffu-manage-tree>.hffu-tree-photos:last-child+.hffu-tree-row{border-bottom:1px solid #eee;}
/* Everything but the checkbox, move arrows and kebab: title line + photo-count line,
   the whole thing clickable/tappable to open that album's own photos (see the click
   and keydown handlers in createAlbumRow) — a bigger, easier target than a bare arrow. */
.hffu-tree-content{flex:1 1 auto;min-width:0;cursor:pointer;padding:2px 0;}
.hffu-tree-content:focus-visible{outline:2px solid #4a90d9;outline-offset:2px;border-radius:4px;}
.hffu-tree-title-row{display:flex;align-items:center;gap:8px;}
.hffu-tree-name{flex:1 1 auto;min-width:0;font-weight:600;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* Points right when collapsed, down when this album's photos are showing. */
.hffu-tree-chevron{flex:0 0 auto;color:#888;font-size:12px;}
.hffu-tree-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:3px;}
.hffu-tree-count{flex:0 0 auto;color:#777;font-size:13px;white-space:nowrap;}
/* A separate, explicit control from the title above — expands/collapses just this
   album's own subfolders (collapsed by default), and must not also open its photos,
   so its click handler stops the click from reaching .hffu-tree-content. */
.hffu-tree-subfolders{flex:0 0 auto;border:1px solid #d5d5d5;border-radius:14px;padding:3px 10px;font-size:12px;line-height:1.6;cursor:pointer;}
.hffu .hffu-tree-subfolders{background:#fff!important;color:#444!important;}
.hffu .hffu-tree-subfolders:hover{background:#f4f4f4!important;}
/* Match the up/down move buttons' 30x30 footprint so the checkbox sits at the same
   size and vertically centers with them and the title, instead of looking like a
   stray, undersized native checkbox next to much larger buttons. Needs the extra
   .hffu ancestor + !important to beat the 18px checkbox-sizing rule above, same
   specificity trick used elsewhere in this file. */
.hffu input[type=checkbox].hffu-tree-select{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;flex:0 0 30px!important;margin:0!important;}
/* Shown checked-but-faded on a subfolder whose parent album is already selected for
   export — that subfolder is included automatically, so its own box isn't actionable.
   Needs !important + the extra .hffu ancestor to beat the opacity:1!important rule
   above (a same-specificity !important loses to a higher-specificity one, not to
   source order), the same trick used for the white-button CSS. */
.hffu input[type=checkbox].hffu-tree-select-implied{opacity:.4!important;cursor:default;}
.hffu-tree-kebab-wrap{position:relative;flex:0 0 auto;}
.hffu-tree-kebab{border:0;background:transparent;cursor:pointer;font-size:18px;line-height:1;padding:6px 8px;color:#555;border-radius:6px;}
.hffu-tree-kebab:hover{background:#f0f0f0;}
.hffu-tree-menu{position:absolute;right:0;top:100%;margin-top:4px;background:#fff;border:1px solid #ddd;border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,.12);z-index:50;min-width:140px;overflow:hidden;}
.hffu-tree-menu button{display:block;width:100%;text-align:left;padding:10px 14px;border:0;background:#fff;cursor:pointer;font-size:14px;}
.hffu-tree-menu button:hover{background:#f5f5f5;}
.hffu-tree-menu-danger{color:#a61b1b;}
.hffu-tree-rename-wrap{flex:1 1 auto;display:flex!important;align-items:center;gap:6px;min-width:0;}
.hffu-tree-rename-input{flex:1 1 auto;min-height:36px;padding:6px 10px;border:1px solid #cfcfcf;border-radius:6px;font-size:14px;}
.hffu-tree-photos{padding:10px 14px 16px;background:#fafafa;border-bottom:1px solid #eee;}
.hffu-photo-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px;}
.hffu-manage-photo-rows{display:flex!important;flex-direction:column!important;gap:10px;}
/* Desktop: checkbox, up/down arrows and thumbnail on the left; name (above) and size
   (below) stacked in one column to the right of the thumbnail; confirm/cancel on
   the far right, vertically centered across both text lines. */
.hffu-manage-photo-row{display:grid!important;grid-template-columns:auto auto var(--hffu-photo-thumb-size,120px) minmax(0,1fr) auto auto;grid-template-areas:"handle cb thumb name confirm cancel" "handle cb thumb caption confirm cancel" "handle cb thumb size confirm cancel";align-items:center;column-gap:12px;row-gap:2px;width:100%;min-width:0;max-width:100%;border:1px solid #e5e5e5;border-radius:7px;padding:10px;background:#fff;box-sizing:border-box;touch-action:pan-y;text-align:left!important;overflow:hidden;}
.hffu-manage-photo-row .hffu-manage-photo-check{grid-area:cb;}
.hffu-manage-photo-thumb{grid-area:thumb;width:var(--hffu-photo-thumb-size,120px);height:var(--hffu-photo-thumb-size,120px);object-fit:cover;border-radius:6px;background:#eee;}
.hffu-manage-photo-name{grid-area:name;width:100%;min-width:0;min-height:38px;padding:6px 10px;border:1px solid #cfcfcf;border-radius:6px;font-size:14px;box-sizing:border-box;}
.hffu-manage-photo-size{grid-area:size;color:#777;}
.hffu-manage-photo-row .hffu-inline-confirm{grid-area:confirm;}
.hffu-manage-photo-row .hffu-inline-cancel{grid-area:cancel;}
.hffu-inline-confirm,.hffu-inline-cancel{flex:0 0 auto;border:1px solid #ccc;background:#fff;border-radius:6px;width:34px;height:34px;font-size:15px;line-height:1;cursor:pointer;}
.hffu-inline-confirm{color:#237a3b;border-color:#bfe3c8;}
.hffu-inline-confirm:hover{background:#eefaf1;}
.hffu-inline-cancel{color:#a61b1b;border-color:#f0c5c5;}
.hffu-inline-cancel:hover{background:#fff2f2;}
.hffu-tree-photo-status{min-height:20px;margin-top:10px;font-size:13px;color:#237a3b;}
.hffu-empty{padding:14px;color:#666;}
/* Small modal used for Move photos/album and Delete album confirmation. */
.hffu-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;padding:20px;z-index:9999;}
.hffu-modal{background:#fff;border-radius:10px;max-width:420px;width:100%;max-height:85vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.3);}
.hffu-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid #eee;}
.hffu-modal-header h4{margin:0;font-size:16px;}
.hffu-modal-close{border:0;background:transparent;font-size:22px;line-height:1;cursor:pointer;color:#666;padding:2px 6px;}
.hffu-modal-body{padding:16px 18px;}
.hffu-modal-body label{font-weight:400;}
.hffu-modal-body select,.hffu-modal-body input[type=text]{width:100%;min-height:44px;padding:9px 12px;border:1px solid #cfcfcf;border-radius:7px;font-size:15px;}
.hffu-modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:14px 18px;border-top:1px solid #eee;}
.hffu-picker-new-folder{margin-top:14px;}
.hffu-picker-new-folder>div{margin-top:8px;display:flex;flex-direction:column;gap:8px;}
.hffu-picker-status{font-size:13px;color:#b42318;min-height:18px;}
/* Import modal: file picker + batch-progress bar shown while a zip is imported. */
.hffu-modal-body input[type=file]{width:100%;padding:9px 0;font-size:14px;}
.hffu-import-progress{margin-top:14px;}
.hffu-import-progress-bar{display:block;width:100%;height:10px;border-radius:6px;background:#eee;overflow:hidden;}
.hffu-import-progress-bar>span{display:block;height:100%;width:0;background:#2f7a3d;border-radius:6px;transition:width .2s ease;}
.hffu-import-progress-text{margin-top:6px;font-size:13px;color:#555;}
.hffu-tree-row{position:relative;}
/* Per-row up/down arrow buttons for reordering albums and photos. */
.hffu-arrow-btn{flex:0 0 auto;border:1px solid #d5d5d5;border-radius:6px;width:30px;height:30px;font-size:13px;line-height:1;cursor:pointer;padding:0;}
.hffu .hffu-arrow-btn{background:#fff!important;color:#444!important;}
.hffu .hffu-arrow-btn:hover{background:#f4f4f4!important;}
.hffu-arrow-btn:disabled{opacity:.35;cursor:not-allowed;}
.hffu-arrow-btn-group{display:flex;flex-direction:row;gap:4px;order:-1;}
.hffu-manage-photo-row .hffu-arrow-btn-group{grid-area:handle;}
/* A dimmed overlay with a "working" message shown over the whole form while a Manage
   screen action (rename, move, delete, reorder, create folder) is saving, so it's clear
   something is happening instead of the form just sitting there unresponsive. */
.hffu.hffu-dimmed>*:not(.hffu-working-overlay){opacity:.35;filter:saturate(55%);pointer-events:none;transition:opacity .15s ease;}
.hffu-working-overlay{position:absolute;inset:0;z-index:60;display:none;align-items:center;justify-content:center;padding:20px;pointer-events:none;}
.hffu-working-box{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #ddd;border-radius:10px;padding:14px 20px;box-shadow:0 12px 34px rgba(0,0,0,.2);font-size:15px;font-weight:600;color:#222;}
.hffu-working-spinner{flex:0 0 auto;width:18px;height:18px;border:2px solid #d8d8d8;border-top-color:#333;border-radius:50%;animation:hffu-spin .7s linear infinite;}
@keyframes hffu-spin{to{transform:rotate(360deg);}}

@media(max-width:600px){
  .hffu-manage-toolbar{flex-direction:column;align-items:stretch;}
  .hffu-manage-toolbar-actions{flex-direction:column;}
  .hffu-manage-toolbar-actions .hffu-button{width:100%;}
  .hffu-photo-toolbar{flex-direction:column;}
  .hffu-photo-toolbar .hffu-button{width:100%;}
  /* Three rows: (1) checkbox/handle/thumbnail/size, (2) the filename box at full
     width so long names scroll inside the box instead of overflowing the card,
     (3) confirm/cancel left-aligned underneath the filename. */
  .hffu-manage-photo-row{grid-template-columns:auto auto var(--hffu-photo-thumb-size,88px) minmax(0,1fr);grid-template-areas:"handle cb thumb size" "name name name name" "caption caption caption caption" "confirm cancel . .";row-gap:8px;column-gap:10px;}
  .hffu-manage-photo-thumb{width:var(--hffu-photo-thumb-size,88px);height:var(--hffu-photo-thumb-size,88px);}
  .hffu-manage-photo-size{white-space:nowrap;font-size:12px;}
  .hffu-manage-photo-row .hffu-inline-confirm,.hffu-manage-photo-row .hffu-inline-cancel{justify-self:start;}
  .hffu-inline-confirm,.hffu-inline-cancel{width:34px;height:34px;font-size:14px;}
  .hffu-modal{max-width:none;}
}

/* Captions */
.hffu .hffu-manage-photo-caption{grid-area:caption;width:100%;min-width:0;min-height:56px;padding:6px 10px;border:1px solid #cfcfcf;border-radius:6px;font-size:14px;line-height:1.35;box-sizing:border-box;resize:vertical;font-family:inherit;margin:6px 0 2px;}
.hffu .hffu-file{flex-wrap:wrap}
.hffu .hffu-file-caption{flex:1 1 100%;width:100%;min-height:48px;padding:6px 10px;border:1px solid #cfcfcf;border-radius:6px;font-size:14px;line-height:1.35;box-sizing:border-box;resize:vertical;font-family:inherit}

/* ---- Album photo rows: compact list row, tap to open (Apple style) ---- */
.hffu .hffu-manage-photo-rows{gap:8px!important}
.hffu .hffu-manage-photo-row.hffu-prow{display:block!important;position:relative;padding:0;border:1px solid #e5e5ea;border-radius:12px;background:#fff;overflow:visible}
.hffu-prow-head{display:flex;align-items:center;gap:10px;padding:8px 10px;min-height:64px}
.hffu .hffu-grip{flex:0 0 32px;height:44px;border:0!important;background:none!important;color:#8e8e93!important;font-size:22px;line-height:1;padding:0;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.hffu .hffu-grip:hover{color:#1c1c1e!important}
.hffu-prow .hffu-manage-photo-check{flex:0 0 auto;width:22px;height:22px;margin:0}
.hffu-prow .hffu-manage-photo-thumb{flex:0 0 auto;width:min(var(--hffu-photo-thumb-size,120px),64px);height:min(var(--hffu-photo-thumb-size,120px),64px);border-radius:8px;object-fit:cover;cursor:pointer}
.hffu .hffu-prow-main{flex:1 1 auto;min-width:0;display:block;text-align:left;border:0!important;background:none!important;box-shadow:none!important;padding:6px 4px;margin:0;cursor:pointer;color:inherit!important;min-height:44px}
.hffu-prow-title{display:block;font-size:16px;line-height:1.3;color:#1c1c1e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hffu-prow-meta{display:block;font-size:13px;line-height:1.3;color:#6e6e73;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;grid-area:auto}
.hffu-prow .hffu-arrow-btn-group{order:0;flex:0 0 auto;gap:6px}
.hffu .hffu-prow .hffu-arrow-btn{width:34px;height:34px;border:0;border-radius:17px;background:#f2f2f7!important;color:#007aff!important;font-size:12px}
.hffu .hffu-prow .hffu-arrow-btn:disabled{opacity:.3}
.hffu .hffu-chev{flex:0 0 24px;height:44px;border:0!important;background:none!important;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center}
.hffu-chev span{width:8px;height:8px;border-right:2px solid #c7c7cc;border-bottom:2px solid #c7c7cc;transform:rotate(-45deg);transition:transform .15s}
.hffu-prow.is-open .hffu-chev span{transform:rotate(45deg)}
.hffu-prow-body{padding:2px 14px 14px 14px;display:grid;gap:8px;border-top:1px solid #f0f0f3}
.hffu-prow-body[hidden]{display:none}
.hffu .hffu-prow-body .hffu-manage-photo-name,.hffu .hffu-prow-body .hffu-manage-photo-caption{width:100%;margin:0;border:0;border-radius:10px;background:#f2f2f7;min-height:44px;padding:10px 12px;font-size:16px;box-sizing:border-box}
.hffu .hffu-prow-body .hffu-manage-photo-caption{min-height:72px}
.hffu-prow-saved{min-height:1.2em;font-size:13px;color:#1a7f37}
.hffu-prow-saved.is-bad{color:#b32d2e}
/* drag */
.hffu-prow.hffu-dragging{opacity:.5}
.hffu-prow.hffu-drop-before::after,.hffu-prow.hffu-drop-after::after{content:"";position:absolute;left:0;right:0;height:3px;background:#007aff;border-radius:0;pointer-events:none;z-index:2}
.hffu-prow.hffu-drop-before::after{top:-5px}
.hffu-prow.hffu-drop-after::after{bottom:-5px}
body.hffu-grabbing,body.hffu-grabbing *{cursor:grabbing!important;user-select:none!important}
@media (max-width:600px){
  .hffu-prow-head{gap:6px;padding:8px 6px}
  .hffu .hffu-grip{flex-basis:26px}
  .hffu-prow .hffu-manage-photo-thumb{width:52px;height:52px}
  .hffu .hffu-prow .hffu-arrow-btn{width:32px;height:32px}
  .hffu .hffu-chev{flex-basis:16px}
}

.hffu .hffu-prow-move{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:48px;padding:0 14px;border:0!important;border-radius:10px;background:#f2f2f7!important;color:#007aff!important;font-size:16px;text-align:left;cursor:pointer;box-shadow:none!important}
.hffu-prow-move i{width:8px;height:8px;border-right:2px solid #c7c7cc;border-bottom:2px solid #c7c7cc;transform:rotate(-45deg)}
.hffu .hffu-prow-body .hffu-manage-photo-name,.hffu .hffu-prow-body .hffu-manage-photo-caption,.hffu .hffu-prow-body .hffu-prow-move,.hffu .hffu-prow-body .hffu-prow-saved{grid-area:auto!important;grid-column:1!important}

/* ---- Album rows: same layout as the photo rows ---- */
.hffu .hffu-tree-row{gap:8px;padding-top:10px;padding-bottom:10px;padding-right:8px;min-height:64px;position:relative}
.hffu .hffu-tree-row .hffu-grip{flex:0 0 32px;margin-left:-6px}
.hffu .hffu-tree-row .hffu-arrow-btn-group{order:0;flex:0 0 auto;gap:6px}
.hffu .hffu-tree-row .hffu-arrow-btn{width:34px;height:34px;border:0;border-radius:17px;background:#f2f2f7!important;color:#007aff!important;font-size:12px}
.hffu .hffu-tree-row .hffu-arrow-btn:disabled{opacity:.3}
.hffu .hffu-tree-name{font-size:16px;font-weight:500;color:#1c1c1e}
.hffu .hffu-tree-count{font-size:13px;color:#6e6e73}
.hffu button.hffu-tree-chevron{flex:0 0 24px;height:44px;border:0!important;background:none!important;padding:0;color:#c7c7cc!important;font-size:14px;cursor:pointer;line-height:1}
.hffu .hffu-tree-row .hffu-tree-kebab{width:36px;height:44px;color:#8e8e93}
.hffu-tree-row.hffu-dragging{opacity:.5}
.hffu-tree-row.hffu-drop-before::after,.hffu-tree-row.hffu-drop-after::after{content:"";position:absolute;left:0;right:0;height:3px;background:#007aff;border-radius:0;pointer-events:none;z-index:3}
.hffu-tree-row.hffu-drop-before::after{top:-2px}
.hffu-tree-row.hffu-drop-after::after{bottom:-2px}
.hffu-tree-row.hffu-drop-into{background:#e6f0ff!important;box-shadow:inset 0 0 0 2px #007aff}
@media (max-width:600px){
  .hffu .hffu-tree-row{gap:4px;padding-right:4px}
  .hffu .hffu-tree-row .hffu-grip{flex-basis:24px;margin-left:-8px}
  .hffu .hffu-tree-row .hffu-arrow-btn{width:32px;height:32px}
  .hffu button.hffu-tree-chevron{flex-basis:16px}
  .hffu .hffu-tree-row input[type=checkbox].hffu-tree-select{width:26px!important;height:26px!important;min-width:26px!important;flex-basis:26px!important}
}

/* ======== Manage screen: phone layout (grouped lists, Edit mode, bottom bar, photo sheet) ======== */
.hffu .hffu-albums-head,.hffu .hffu-more-btn,.hffu .hffu-sheet-head,.hffu .hffu-sheet-preview,.hffu .hffu-sheet-pos,.hffu .hffu-sheet-del,.hffu .hffu-selcount{display:none}
.hffu .hffu-more-menu,.hffu .hffu-selrow,.hffu .hffu-actionbar{display:contents}
@media (max-width:640px){
  .hffu .hffu-albums-head{display:flex;align-items:center;justify-content:space-between;margin:6px 0 8px;padding:0 4px}
  .hffu .hffu-albums-label{font-size:13px;letter-spacing:.02em;text-transform:uppercase;color:#6c6c70}
  .hffu .hffu-edit-toggle{border:0!important;background:none!important;box-shadow:none!important;color:#0060df!important;font-size:17px;font-weight:600;min-height:44px;padding:0 6px;cursor:pointer}
  /* toolbar: search + ⋯, then one big New folder button */
  .hffu .hffu-manage-toolbar{display:flex;flex-direction:column;gap:10px;align-items:stretch}
  .hffu .hffu-manage-search{display:flex;gap:8px;position:relative}
  .hffu .hffu-manage-search input[type=search]{flex:1 1 auto;min-width:0;height:44px;border:0;border-radius:12px;background:#e3e3e8;padding:0 14px;font-size:17px;box-sizing:border-box}
  .hffu .hffu-more-btn{display:flex;align-items:center;justify-content:center;flex:0 0 44px;height:44px;border:0!important;border-radius:12px;background:#e3e3e8!important;color:#1c1c1e!important;padding:0;cursor:pointer}
  .hffu .hffu-manage-toolbar-actions{display:block;position:relative}
  .hffu .hffu-manage-new-folder{width:100%;height:48px;border:0!important;border-radius:12px;background:#0060df!important;color:#fff!important;font-size:17px;font-weight:600}
  .hffu .hffu-more-menu{display:none;position:absolute;right:0;bottom:calc(100% + 10px);transform:translateY(-100%);margin-bottom:-4px;z-index:50;min-width:210px;background:#fff;border-radius:14px;box-shadow:0 10px 36px rgba(0,0,0,.28);overflow:hidden;flex-direction:column}
  .hffu .hffu-more-menu.is-open{display:flex}
  .hffu .hffu-more-menu .hffu-button{width:100%;min-height:50px;border:0!important;border-bottom:1px solid #ececf0!important;border-radius:0!important;background:#fff!important;color:#1c1c1e!important;text-align:left;padding:0 16px;font-size:17px;box-shadow:none!important}
  .hffu .hffu-more-menu .hffu-button:last-child{border-bottom:0!important}
  .hffu .hffu-more-menu .hffu-button[hidden]{display:none}

  /* albums: one rounded list */
  .hffu .hffu-manage-tree{background:#fff;border-radius:12px;overflow:hidden;border:0}
  .hffu .hffu-tree-row{border:0!important;border-bottom:1px solid #e5e5ea!important;border-radius:0!important;background:#fff;min-height:64px;padding:8px 4px 8px 12px;gap:8px;align-items:center}
  .hffu .hffu-tree-row .hffu-grip,.hffu .hffu-tree-row .hffu-arrow-btn-group,.hffu .hffu-tree-row input.hffu-tree-select{display:none!important}
  .hffu .hffu-editing .hffu-tree-row .hffu-grip{display:block!important}
  .hffu .hffu-editing .hffu-tree-row .hffu-arrow-btn-group{display:flex!important;flex:0 0 auto;gap:4px}
  .hffu .hffu-editing .hffu-tree-row .hffu-arrow-btn{width:30px;height:30px}
  .hffu .hffu-editing .hffu-tree-row .hffu-tree-chevron,.hffu .hffu-editing .hffu-tree-row .hffu-tree-kebab-wrap{display:none!important}
  .hffu .hffu-editing .hffu-tree-row{flex-wrap:nowrap}
  .hffu .hffu-editing .hffu-tree-content{flex:1 1 0;min-width:0}
  .hffu .hffu-editing .hffu-tree-row input.hffu-tree-select{display:inline-block!important}
  .hffu .hffu-tree-content{flex:1 1 auto;min-width:0;display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:12px;align-items:center}
  .hffu .hffu-tree-content::before{content:"";grid-row:1/3;width:44px;height:44px;border-radius:10px;background:#e8f0fd url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230060df' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/></svg>") center/24px no-repeat}
  .hffu .hffu-tree-title-row{grid-column:2}
  .hffu .hffu-tree-meta{grid-column:2;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
  .hffu .hffu-tree-name{display:block;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;font-size:17px;line-height:22px;font-weight:500;color:#1c1c1e}
  .hffu .hffu-tree-count{font-size:14px;color:#6c6c70}
  .hffu button.hffu-tree-chevron{flex:0 0 20px;height:44px}
  .hffu .hffu-tree-row .hffu-tree-kebab{width:40px;height:44px}
  .hffu .hffu-tree-row input.hffu-tree-select{width:26px;height:26px;flex:0 0 26px;margin:0}
  .hffu .hffu-tree-photos{background:#f7f7fa;padding:8px 8px 12px;border-bottom:1px solid #e5e5ea}

  /* photos in an album: flat rows, no selection UI until Edit */
  .hffu .hffu-manage-photo-rows{gap:0!important;background:#fff;border-radius:12px;overflow:hidden}
  .hffu .hffu-manage-photo-row.hffu-prow{border:0;border-bottom:1px solid #e5e5ea;border-radius:0}
  .hffu .hffu-manage-photo-row.hffu-prow:last-child{border-bottom:0}
  .hffu .hffu-prow-head{min-height:76px;padding:8px 4px 8px 12px;gap:12px}
  .hffu .hffu-prow .hffu-manage-photo-thumb{width:60px;height:60px;border-radius:8px}
  .hffu .hffu-prow-title{white-space:normal;overflow:visible;font-size:17px;font-weight:500;line-height:22px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .hffu .hffu-prow-meta{font-size:14px;line-height:19px;white-space:normal}
  .hffu .hffu-prow .hffu-grip,.hffu .hffu-prow .hffu-arrow-btn-group,.hffu .hffu-prow .hffu-manage-photo-check{display:none!important}
  .hffu .hffu-editing .hffu-prow .hffu-grip{display:flex!important;align-items:center;justify-content:center;order:5}
  .hffu .hffu-editing .hffu-prow .hffu-manage-photo-check{display:block!important;order:-1;width:26px;height:26px}
  .hffu .hffu-editing .hffu-prow .hffu-chev{display:none}
  .hffu .hffu-prow .hffu-grip{flex-basis:40px}

  /* select row + bottom action bar (Edit mode only) */
  .hffu .hffu-photo-toolbar{display:none!important}
  .hffu .hffu-editing .hffu-photo-toolbar{display:block!important;margin:0 0 8px}
  .hffu .hffu-selrow{display:flex;gap:16px;padding:0 4px}
  .hffu .hffu-selrow .hffu-button{border:0!important;background:none!important;color:#0060df!important;box-shadow:none!important;font-size:16px;min-height:40px;padding:0;width:auto!important}
  .hffu .hffu-actionbar{display:none;position:fixed;left:0;right:0;bottom:0;z-index:9990;gap:10px;align-items:center;padding:12px 16px calc(14px + env(safe-area-inset-bottom));background:rgba(249,249,251,.96);border-top:1px solid #d1d1d6;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}
  .hffu .hffu-actionbar.is-on{display:flex;flex-wrap:wrap}
  .hffu .hffu-actionbar .hffu-selcount{display:block;flex:0 0 100%;font-size:13px;color:#6c6c70;text-align:center;margin-bottom:-2px}
  .hffu .hffu-actionbar .hffu-button{flex:1;height:52px;border:0!important;border-radius:12px;background:#e3e3e8!important;color:#0060df!important;font-size:17px;font-weight:600;width:auto!important}
  .hffu .hffu-actionbar .hffu-button-danger{background:#fdecea!important;color:#b3261e!important}
  .hffu .hffu-actionbar .hffu-button:disabled{opacity:.4}

  /* open photo = bottom sheet */
  body.hffu-sheet-open{overflow:hidden}
  .hffu .hffu-prow.is-open::before{content:"";position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:9980}
  .hffu .hffu-prow.is-open .hffu-prow-body{position:fixed;left:0;right:0;bottom:0;top:70px;z-index:9990;overflow:auto;-webkit-overflow-scrolling:touch;background:#f2f2f7;border-radius:20px 20px 0 0;padding:0 16px calc(24px + env(safe-area-inset-bottom));display:flex!important;flex-direction:column;gap:14px;border-top:0}
  .hffu .hffu-prow.is-open .hffu-prow-body[hidden]{display:none!important}
  .hffu .hffu-sheet-head{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:#f2f2f7;padding:18px 0 4px;z-index:2}
  .hffu .hffu-sheet-grab{position:absolute;top:8px;left:50%;width:40px;height:5px;margin-left:-20px;border-radius:3px;background:#c7c7cc}
  .hffu .hffu-sheet-title{flex:1;text-align:center;font-size:17px;font-weight:600;color:#1c1c1e}
  .hffu .hffu-sheet-done{display:block;width:100%;height:48px;flex:0 0 auto;border:0!important;border-radius:12px;background:#0060df!important;color:#fff!important;font-size:17px;font-weight:600;cursor:pointer;box-shadow:none!important}
  .hffu .hffu-sheet-preview{display:block;width:100%;max-height:230px;object-fit:cover;border-radius:12px;background:#e3e3e8}
  .hffu .hffu-prow-body .hffu-manage-photo-name,.hffu .hffu-prow-body .hffu-manage-photo-caption{background:#fff!important;font-size:17px}
  .hffu .hffu-prow-body .hffu-prow-move{background:#fff!important;min-height:52px;font-size:17px}
  .hffu .hffu-sheet-pos{display:flex;align-items:center;justify-content:space-between;min-height:52px;padding:0 16px;border-radius:12px;background:#fff;font-size:17px;color:#1c1c1e}
  .hffu .hffu-sheet-posbtns{display:flex;gap:8px}
  .hffu .hffu-sheet-arrow{width:52px;height:38px;border:0!important;border-radius:10px;background:#e8f0fd!important;color:#0060df!important;font-size:14px;padding:0;cursor:pointer}
  .hffu .hffu-sheet-arrow:disabled{opacity:.35}
  .hffu .hffu-sheet-del{display:block;height:52px;border:0!important;border-radius:12px;background:#fff!important;color:#b3261e!important;font-size:17px;font-weight:600;cursor:pointer}
}
