*{box-sizing:border-box}
:root{--bg:#f4f7fb;--surface:#fff;--surface2:#f8fafc;--line:#e6eaf0;--text:#172033;--muted:#6d7788;--accent:#4f63ff;--accent2:#16b8e8;--danger:#dc4b5f;--shadow:0 18px 50px rgba(31,45,72,.10)}
html{background:var(--bg);scroll-behavior:smooth}body{margin:0;background:linear-gradient(180deg,#f8faff 0%,#f3f6fa 100%);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}a{text-decoration:none;color:inherit}button,input{font:inherit}button{cursor:pointer}
.top{height:76px;padding:0 5vw;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);background:rgba(255,255,255,.86);backdrop-filter:blur(18px);position:sticky;top:0;z-index:20;box-shadow:0 2px 18px rgba(30,45,70,.04)}
.brand{display:flex;gap:11px;align-items:center}.brand-logo{width:54px;height:46px;border-radius:11px;background:#fff;display:grid;place-items:center;overflow:hidden;box-shadow:0 5px 18px rgba(20,35,60,.12);border:1px solid #e8ebf1}.brand-logo img{width:100%;height:100%;object-fit:contain;padding:2px}.brand-copy{font-weight:800;line-height:1.1;color:#172033}.brand-copy small{display:block;color:#8a94a4;font-size:10px;font-weight:500;margin-top:4px}.top nav{display:flex;gap:5px;align-items:center}.top nav a,.top nav button{border:0;background:transparent;color:#697487;padding:9px 11px;border-radius:9px;cursor:pointer}.top nav a:hover,.top nav button:hover{background:#eef2f8;color:#172033}.inline{display:inline}
.page{max-width:1500px;margin:auto;padding:0 5vw 80px}.hero{display:flex;justify-content:space-between;align-items:end;gap:25px;padding:55px 0 25px}.eyebrow{font-size:10px;letter-spacing:.18em;color:#596cf4;font-weight:800}.hero h1{font-size:clamp(35px,5vw,58px);line-height:1.02;letter-spacing:-.045em;margin:8px 0;color:#111a2d}.hero p{color:#707b8c;max-width:720px;font-size:14px}.upload{text-align:center}.upload label{display:block;padding:13px 18px;border-radius:12px;background:linear-gradient(135deg,#5368ff,#437cf2);color:#fff;font-weight:800;position:relative;overflow:hidden;cursor:pointer;box-shadow:0 12px 28px rgba(70,96,235,.24);transition:.2s}.upload label:hover{transform:translateY(-2px);box-shadow:0 16px 34px rgba(70,96,235,.28)}.upload input{position:absolute;inset:0;opacity:0;cursor:pointer}.upload small{display:block;color:#8791a0;font-size:10px;margin-top:7px}
.toolbar{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:24px}.tabs{display:flex;gap:5px;overflow:auto;padding:3px}.tabs a{padding:8px 11px;border-radius:9px;color:#7b8595;white-space:nowrap;font-size:12px;transition:.18s}.tabs a:hover{background:#e9edf4;color:#263249}.tabs a.active{background:#fff;color:#263249;box-shadow:0 3px 12px rgba(31,45,72,.08)}.tabs small{opacity:.6}details summary{cursor:pointer;color:#596579;font-size:12px;list-style:none;padding:9px 11px;border-radius:9px;background:#fff;border:1px solid var(--line);box-shadow:0 3px 10px rgba(31,45,72,.04)}details summary::-webkit-details-marker{display:none}details form{position:absolute;background:#fff;padding:9px;border-radius:12px;display:flex;gap:5px;margin-top:8px;right:0;z-index:10;border:1px solid var(--line);box-shadow:var(--shadow)}details{position:relative}input{border:1px solid #dfe4ec;background:#fff;color:#172033;border-radius:9px;padding:9px 10px;outline:none}input:focus{border-color:#8090ff;box-shadow:0 0 0 3px rgba(83,104,255,.10)}.primary{border:0;background:#172033;color:#fff;border-radius:9px;padding:10px 14px;font-weight:800;cursor:pointer}.small{padding:8px 10px;font-size:11px}
.grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.photo{border:1px solid #e4e8ef;padding:0;aspect-ratio:1;overflow:hidden;border-radius:14px;background:#e9edf3;position:relative;cursor:pointer;box-shadow:0 5px 16px rgba(35,49,75,.06);transition:transform .2s,box-shadow .2s,border-color .2s}.photo:hover{transform:translateY(-4px);box-shadow:0 15px 30px rgba(35,49,75,.13);border-color:#d6dcea}.photo:focus-visible{outline:3px solid rgba(79,99,255,.3);outline-offset:3px}.photo img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s}.photo:hover img{transform:scale(1.045)}.photo:after{content:'View';position:absolute;inset:auto 10px 10px auto;background:rgba(17,25,40,.78);color:#fff;padding:6px 9px;border-radius:8px;font-size:10px;font-weight:700;opacity:0;transform:translateY(5px);transition:.2s}.photo:hover:after{opacity:1;transform:translateY(0)}.photo span{position:absolute;left:8px;bottom:8px;right:auto;background:rgba(17,25,40,.72);color:#fff;padding:4px 7px;border-radius:7px;font-size:9px;backdrop-filter:blur(6px)}
.empty{margin:60px 0;padding:70px 30px;text-align:center;border:1px dashed #cfd6e1;border-radius:20px;background:rgba(255,255,255,.55);color:#7b8595}.empty h2{margin:0 0 7px;color:#344055}.flash{padding:10px 13px;border-radius:10px;margin-bottom:18px;background:#e9f9ef;color:#247a45;font-size:12px}.flash.bad,.error{background:#fff0f1;color:#b33b4a;border:1px solid #ffd8dc}
/* Image viewer */
.viewer{position:fixed;inset:0;background:rgba(24,31,45,.58);backdrop-filter:blur(14px);display:none;z-index:100;align-items:center;justify-content:center;padding:28px}.viewer.open{display:flex}.viewer-shell{width:min(1180px,96vw);height:min(760px,90vh);display:grid;grid-template-columns:minmax(0,1fr) 330px;background:#fff;border-radius:24px;overflow:hidden;box-shadow:0 35px 100px rgba(10,20,40,.28);border:1px solid rgba(255,255,255,.7)}.viewer-stage{min-width:0;position:relative;background:#eef2f7;display:flex;align-items:center;justify-content:center;padding:34px}.viewer> .viewer-shell .viewer-image{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;user-select:none;border-radius:8px;box-shadow:0 12px 35px rgba(20,30,50,.12)}.viewer-info{background:#fff;border-left:1px solid #e7ebf1;padding:28px 24px;display:flex;flex-direction:column}.viewer-info .v-eyebrow{font-size:10px;letter-spacing:.16em;color:#6576e9;font-weight:800;margin-bottom:8px}.viewer-info h2{font-size:20px;line-height:1.25;margin:0 0 22px;word-break:break-word;color:#172033}.detail-list{display:grid;gap:13px}.detail{padding:12px 13px;border:1px solid #e7ebf1;border-radius:12px;background:#fafbfd}.detail-label{display:block;font-size:10px;color:#8b95a4;margin-bottom:4px}.detail-value{font-size:13px;font-weight:700;color:#263249;word-break:break-word}.viewer-actions{margin-top:auto;display:grid;gap:8px}.viewer-actions a,.viewer-actions button{width:100%;padding:11px 13px;border-radius:10px;border:1px solid #e0e5ed;background:#f7f9fc;color:#263249;font-weight:700;text-align:center}.viewer-actions a:hover,.viewer-actions button:hover{background:#edf1f7}.viewer-actions .danger{color:#b83d4c!important;background:#fff2f3!important;border-color:#ffd9dd!important}.vtop{position:absolute;top:14px;left:14px;right:14px;display:flex;justify-content:flex-end;z-index:3}.vtop button{width:42px;height:42px;background:rgba(255,255,255,.9);color:#263249;border:1px solid #dfe4ec;border-radius:11px;font-size:24px;cursor:pointer;box-shadow:0 6px 18px rgba(20,30,50,.10)}.vnav{position:absolute;top:50%;transform:translateY(-50%);width:48px;height:58px;background:rgba(255,255,255,.9);border:1px solid #dfe4ec;border-radius:12px;color:#263249;font-size:40px;cursor:pointer;box-shadow:0 7px 20px rgba(20,30,50,.10);z-index:2}.vnav:hover{background:#fff;transform:translateY(-50%) scale(1.04)}.vnav:first-of-type{left:16px}.vnav:nth-of-type(2){right:16px}.lock{overflow:hidden}
.auth{min-height:calc(100vh - 76px);display:grid;place-items:center;padding:25px}.card{width:min(440px,100%);padding:34px;background:rgba(255,255,255,.92);border:1px solid #e2e7ef;border-radius:22px;box-shadow:var(--shadow)}.card.wide{width:min(650px,100%)}.logo-card{width:min(250px,70%);height:110px;background:#fff;border-radius:18px;display:grid;place-items:center;overflow:hidden;margin-bottom:24px;border:1px solid #e5e9ef}.logo-card img{width:100%;height:100%;object-fit:contain;padding:8px}.card h1{font-size:32px;margin:5px 0;color:#172033}.card p{color:#7a8494;font-size:13px;line-height:1.6}.form{display:grid;gap:14px;margin-top:22px}.form label{display:grid;gap:6px;color:#6f7989;font-size:11px}.form input{width:100%}.notice,.error{padding:10px 12px;border-radius:9px;font-size:12px;margin-top:15px}.notice{background:#eef1ff;color:#5363c8}.notice a{color:#24335c;text-decoration:underline}.uploading{opacity:.7;pointer-events:none}.uploading label:after{content:'  Uploading…';font-weight:600}
@media(max-width:1000px){.grid{grid-template-columns:repeat(4,1fr)}.viewer-shell{grid-template-columns:minmax(0,1fr) 290px}}
@media(max-width:700px){.top{padding:0 18px;height:70px}.brand-logo{width:48px;height:42px}.brand-copy{font-size:14px}.top nav{gap:0}.top nav a,.top nav button{padding:8px 6px;font-size:12px}.page{padding:0 18px 60px}.hero{display:block;padding-top:38px}.upload{margin-top:20px}.upload label{text-align:center}.toolbar{align-items:flex-start;flex-direction:column}.grid{grid-template-columns:repeat(3,1fr);gap:7px}.photo{border-radius:9px}.photo:after{display:none}.viewer{padding:10px}.viewer-shell{height:min(94vh,800px);width:96vw;display:flex;flex-direction:column}.viewer-stage{height:58%;padding:26px 18px 18px}.viewer-info{height:42%;border-left:0;border-top:1px solid #e7ebf1;padding:17px 18px;overflow:auto}.viewer-info h2{font-size:17px;margin-bottom:12px}.detail-list{grid-template-columns:repeat(2,1fr);gap:8px}.detail{padding:9px}.viewer-actions{margin-top:12px;grid-template-columns:1fr 1fr}.viewer-actions form{grid-column:1/-1}.vnav{width:42px;height:50px;font-size:34px}.vnav:first-of-type{left:7px}.vnav:nth-of-type(2){right:7px}}
@media(max-width:430px){.brand-copy small{display:none}.grid{grid-template-columns:repeat(2,1fr)}.hero h1{font-size:36px}.card{padding:26px 22px}.detail-list{grid-template-columns:1fr}.viewer-stage{height:50%}.viewer-info{height:50%}}

/* Album dashboard */
.album-section{margin-top:18px}.section-heading{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:18px}.section-heading h2{margin:4px 0 0;font-size:25px;letter-spacing:-.03em;color:#172033}.album-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.album-card{position:relative;min-height:210px;padding:22px;background:linear-gradient(145deg,#fff,#f8faff);border:1px solid #e1e6ee;border-radius:20px;box-shadow:0 10px 28px rgba(31,45,72,.07);transition:transform .2s,box-shadow .2s,border-color .2s;overflow:hidden}.album-card:hover{transform:translateY(-5px);border-color:#cfd7e5;box-shadow:0 18px 38px rgba(31,45,72,.12)}.folder-art{width:78px;height:64px;position:relative;margin-bottom:26px}.folder-back,.folder-front{position:absolute;display:block;border-radius:9px}.folder-back{left:3px;top:8px;width:56px;height:43px;background:linear-gradient(135deg,#dce7ff,#cbd8ff)}.folder-back:before{content:'';position:absolute;left:0;top:-6px;width:25px;height:11px;border-radius:7px 7px 0 0;background:#cbd8ff}.folder-front{left:0;top:16px;width:70px;height:43px;background:linear-gradient(135deg,#6177ff,#4c63e9);border-radius:8px 10px 11px 11px;box-shadow:0 9px 18px rgba(79,99,255,.22);transform:skewY(-2deg)}.folder-mark{position:absolute;left:27px;top:24px;color:#fff;font-size:16px;font-weight:900;z-index:2}.all-art .folder-back{background:linear-gradient(135deg,#d8f5fb,#c9eaff)}.all-art .folder-back:before{background:#c9eaff}.all-art .folder-front{background:linear-gradient(135deg,#18b8e8,#4f63ff)}.album-copy h3{margin:0 28px 5px 0;font-size:19px;color:#172033;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.album-copy p{margin:0;color:#7d8797;font-size:12px}.album-arrow{position:absolute;right:20px;bottom:20px;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#f0f3f8;color:#4d5b71;font-weight:800;transition:.2s}.album-card:hover .album-arrow{background:#172033;color:#fff;transform:translateX(2px)}.new-album-card{display:block;padding:0;background:linear-gradient(145deg,#fbfcff,#f5f7fb);cursor:pointer}.new-album-card>summary{display:flex;align-items:center;gap:15px;min-height:210px;padding:22px;list-style:none}.new-album-card>summary::-webkit-details-marker{display:none}.new-album-card[open]>summary{min-height:auto;border-bottom:1px solid #e6eaf0}.new-album-icon{width:52px;height:52px;border-radius:15px;display:grid;place-items:center;background:#edf0ff;color:#5368f5;font-size:27px;font-weight:300}.new-album-card .album-copy h3{margin-bottom:5px}.album-create-form{display:grid;grid-template-columns:1fr auto;gap:8px;padding:16px 20px 20px}.album-create-form input{min-width:0}.album-toolbar{display:flex;justify-content:space-between;align-items:center;margin:8px 0 22px}.back-link{font-size:12px;color:#5363d8;font-weight:800;padding:9px 12px;border-radius:9px;background:#eef1ff}.back-link:hover{background:#e5e9ff}.album-count{font-size:12px;color:#7b8595}.empty-icon{width:54px;height:54px;margin:0 auto 14px;border-radius:16px;display:grid;place-items:center;background:#edf1f7;color:#5368f5;font-size:26px}.empty{margin:35px 0}

/* Smaller, correctly contained login branding */
.logo-card{width:170px;height:86px;margin-bottom:22px;border-radius:15px}.logo-card img{width:145px;height:auto;max-height:72px;object-fit:contain;padding:0}

@media(max-width:900px){.album-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.section-heading{align-items:flex-start;flex-direction:column}.album-grid{grid-template-columns:1fr}.album-card,.new-album-card>summary{min-height:185px}.album-create-form{grid-template-columns:1fr}.album-toolbar{margin-top:4px}.logo-card{width:155px;height:80px}.logo-card img{width:135px;max-height:68px}}

/* v5 nested folders + thumbnail gallery improvements */
.library-section{margin-top:8px}
.album-card{cursor:pointer}
.album-grid.compact{grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.compact-card{min-height:180px;padding:18px}
.compact-card .folder-art{margin-bottom:18px;transform:scale(.88);transform-origin:left top}
.small-folder{width:70px;height:54px}
.album-kicker{display:block;margin-bottom:5px;color:#8a94a4;font-size:9px;font-weight:850;letter-spacing:.13em}
.album-header-actions{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.subalbum-create{position:relative}
.subalbum-create summary{list-style:none;cursor:pointer;padding:10px 12px;border:1px solid #dfe5ec;border-radius:11px;background:#fff;color:#5b687c;font-size:12px;font-weight:800;box-shadow:0 6px 16px rgba(30,45,70,.05)}
.subalbum-create summary::-webkit-details-marker{display:none}
.subalbum-create form{position:absolute;right:0;top:45px;z-index:30;display:grid;grid-template-columns:1fr auto;gap:7px;padding:10px;background:#fff;border:1px solid #dfe5ec;border-radius:12px;box-shadow:0 18px 40px rgba(35,48,72,.15);min-width:290px}
.subalbum-create input{min-width:0}
.breadcrumbs{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:7px 0 11px;color:#8490a1;font-size:11px}
.breadcrumbs a{color:#6074d9;font-weight:700}
.breadcrumbs b{color:#566175}
.subfolder-section{margin:7px 0 28px}
.subfolder-title{font-size:11px;font-weight:850;letter-spacing:.12em;color:#778396;text-transform:uppercase;margin-bottom:12px}
.photo-section-header{display:flex;align-items:flex-end;justify-content:space-between;margin:30px 0 14px}
.photo-section-header h2{margin:4px 0 0;color:#26344a;font-size:22px;letter-spacing:-.02em}
.photo img{background:#e9edf3}
@media(max-width:1050px){.album-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
    .album-header-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;justify-content:stretch;margin-top:16px}
    .album-header-actions>*{width:100%}
    .subalbum-create summary{width:100%;text-align:center}
    .subalbum-create form{left:0;right:auto;top:44px;min-width:260px;width:calc(100vw - 30px);grid-template-columns:1fr}
    .album-grid.compact{grid-template-columns:1fr 1fr;gap:8px}
    .compact-card{min-height:150px;padding:15px;border-radius:15px}
    .compact-card .folder-art{margin-bottom:12px;transform:scale(.75)}
    .compact-card .album-copy h3{font-size:16px}
    .photo-section-header{margin-top:23px}
}


/* v6: full-image viewer + move-photo controls */
.viewer-stage{min-height:0;overflow:hidden;isolation:isolate}
.viewer-image{display:block!important;width:auto!important;height:auto!important;max-width:calc(100% - 24px)!important;max-height:calc(100% - 24px)!important;object-fit:contain!important;object-position:center!important;flex:0 1 auto}
.move-form{display:grid;gap:7px;padding:10px 11px;border:1px solid #e0e5ed;border-radius:11px;background:#fafbfd}
.move-form>label{font-size:10px;color:#8a94a3;font-weight:700}
.move-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
.move-row select{min-width:0;width:100%;padding:10px 10px;border:1px solid #dfe5ed;border-radius:9px;background:#fff;color:#263249;font-size:12px;outline:none}
.move-row select:focus{border-color:#7b8cf1;box-shadow:0 0 0 3px rgba(79,99,255,.1)}
.move-submit{width:auto!important;min-width:64px!important;padding:10px 12px!important;background:#172033!important;color:#fff!important;border-color:#172033!important}
.viewer-actions .move-form+.viewer-actions{}
@media(max-width:760px){
  .viewer-stage{height:56%;flex-basis:56%;padding:24px 14px 12px}
  .viewer-image{max-width:calc(100% - 28px)!important;max-height:calc(100% - 28px)!important}
  .move-form{padding:9px 10px}
  .move-row{grid-template-columns:minmax(0,1fr) auto}
}
@media(max-width:430px){
  .viewer-stage{height:50%;flex-basis:50%}
  .move-row{grid-template-columns:1fr}
  .move-submit{width:100%!important}
}


/* FINAL FIXES */
.mobile-nav{display:none}
.viewer-stage{min-width:0!important;min-height:0!important;overflow:hidden!important;}
.viewer-image-wrap{width:100%;height:100%;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.viewer-image-wrap .viewer-image{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;}
.move-form{display:grid;gap:7px;padding:10px 11px;border:1px solid #e0e5ed;border-radius:11px;background:#fafbfd}
.move-label-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.move-label-row label{font-size:10px;color:#6e7a8d;font-weight:800}
.move-label-row span{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:#9aa3af;text-align:right}
.move-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
.move-row select{min-width:0;width:100%;padding:10px;border:1px solid #dfe5ed;border-radius:9px;background:#fff;color:#263249;font-size:12px;outline:none}
.move-submit{width:auto!important;min-width:66px!important;padding:10px 12px!important;background:#172033!important;color:#fff!important;border-color:#172033!important}
@media(max-width:700px){
 .mobile-nav{display:flex}
 .viewer-stage{height:56%!important;flex-basis:56%!important;padding:30px 46px 16px!important}
 .viewer-info{height:44%!important;overflow:auto}
}
@media(max-width:430px){
 .viewer-stage{height:51%!important;flex-basis:51%!important;padding:28px 40px 12px!important}
 .viewer-info{height:49%!important}
 .detail-list{grid-template-columns:1fr}
 .move-row{grid-template-columns:1fr}
 .move-submit{width:100%!important}
 .move-label-row{align-items:flex-start;flex-direction:column;gap:3px}
 .move-label-row span{max-width:100%}
}



/* v7.1: clear multi-select toolbar and strong selection controls */
.bulk-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:11px 13px;
    margin:0 0 14px;
    border:1px solid #d7dfea;
    border-radius:13px;
    background:rgba(255,255,255,.98);
    box-shadow:0 8px 24px rgba(35,49,75,.08);
}

.bulk-selection-info{
    display:flex;
    align-items:center;
    gap:7px;
    color:#56647a;
    font-size:12px;
    white-space:nowrap;
}

.bulk-selection-info strong{
    color:#172033;
    font-size:13px;
}

.bulk-checkmark{
    width:23px;
    height:23px;
    display:grid;
    place-items:center;
    border-radius:7px;
    color:#fff;
    background:#5369ef;
    font-size:12px;
    font-weight:900;
}

.bulk-link{
    padding:5px 7px;
    border:0;
    background:transparent;
    color:#4f63dc;
    font-size:11px;
    font-weight:800;
}

.bulk-link:hover{
    background:#eef1ff;
    border-radius:7px;
}

.bulk-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

.bulk-actions form{
    display:flex;
    align-items:center;
    gap:7px;
    margin:0;
}

.bulk-move-form select{
    min-width:220px;
    max-width:310px;
    padding:9px 11px;
    border:1px solid #d6deea;
    border-radius:9px;
    background:#fff;
    color:#263249;
    font-size:11px;
    outline:none;
}

.bulk-action{
    min-height:36px;
    padding:8px 12px;
    border-radius:9px;
    font-size:11px;
    font-weight:800;
    cursor:pointer;
    border:1px solid #d7dee8;
    background:#f6f8fb;
    color:#2a374c;
    transition:.16s ease;
}

.bulk-action:disabled{
    opacity:.42;
    cursor:not-allowed;
    transform:none!important;
    box-shadow:none!important;
}

.bulk-action.move{
    border-color:#d5dcff;
    background:#edf0ff;
    color:#4b60dc;
}

.bulk-action.move:not(:disabled):hover{
    background:#e1e6ff;
    transform:translateY(-1px);
}

.bulk-action.delete{
    border-color:#ffd7dc;
    background:#fff0f2;
    color:#b83e50;
}

.bulk-action.delete:not(:disabled):hover{
    background:#ffe2e6;
    transform:translateY(-1px);
}

.photo{
    position:relative;
}

.photo.selected{
    border-color:#5369ef;
    box-shadow:
        0 0 0 3px rgba(83,105,239,.18),
        0 13px 28px rgba(35,49,75,.13);
}

.photo-select{
    position:absolute;
    top:9px;
    left:9px;
    z-index:4;
    width:31px;
    height:31px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:9px;
    background:rgba(255,255,255,.96);
    border:2px solid #c4cedb;
    box-shadow:
        0 5px 14px rgba(20,30,50,.14);
    cursor:pointer;
    transition:
        border-color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.photo-select:hover{
    border-color:#667af1;
    transform:scale(1.03);
}

.photo-select input{
    position:absolute!important;
    opacity:0!important;
    width:1px!important;
    height:1px!important;
    pointer-events:none!important;
}

.photo-select span{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    display:block!important;
    width:18px!important;
    height:18px!important;
    min-width:18px!important;
    min-height:18px!important;
    padding:0!important;
    margin:0!important;
    border-radius:5px!important;
    border:2px solid #69778b!important;
    background:#fff!important;
    color:transparent!important;
    box-shadow:none!important;
    font-size:0!important;
}

.photo-select input:checked + span{
    border-color:#5369ef!important;
    background:#5369ef!important;
}

.photo-select input:checked + span:after{
    content:'✓';
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    color:#fff;
    font-size:12px;
    font-weight:900;
}

/* Make selected thumbnail visually obvious without hiding the image */
.photo.selected .photo-select{
    border-color:#5369ef;
    background:#f2f4ff;
}

@media(max-width:760px){

    .bulk-bar{
        position:sticky;
        top:76px;
        z-index:35;
        display:block;
        padding:10px;
        margin-bottom:12px;
        border-radius:13px;
    }

    .bulk-selection-info{
        justify-content:flex-start;
        flex-wrap:wrap;
    }

    .bulk-actions{
        margin-top:9px;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:7px;
    }

    .bulk-actions form{
        min-width:0;
        display:flex;
    }

    .bulk-move-form{
        grid-column:1 / -1;
        display:grid!important;
        grid-template-columns:1fr auto;
    }

    .bulk-move-form select{
        min-width:0;
        max-width:none;
        width:100%;
    }

    .bulk-action{
        width:100%;
        min-height:40px;
    }

    .photo-select{
        width:34px;
        height:34px;
        top:6px;
        left:6px;
    }

    .photo-select span{
        width:20px!important;
        height:20px!important;
        min-width:20px!important;
        min-height:20px!important;
    }
}

@media(max-width:430px){

    .bulk-selection-info{
        font-size:11px;
        gap:5px;
    }

    .bulk-link{
        font-size:10px;
    }

    .bulk-move-form{
        grid-template-columns:1fr;
    }
}


/* Folder management */
.folder-card{
    position:relative;
}

.folder-card .album-open{
    position:relative;
    display:block;
    min-height:100%;
    color:inherit;
}

.folder-actions{
    position:absolute;
    top:13px;
    right:13px;
    z-index:8;
}

.folder-actions>summary{
    width:34px;
    height:34px;
    padding:0!important;
    display:grid;
    place-items:center;
    border:1px solid #e0e6ef!important;
    border-radius:10px!important;
    background:rgba(255,255,255,.94)!important;
    color:#68758a!important;
    font-size:20px!important;
    line-height:1!important;
    box-shadow:0 5px 16px rgba(31,45,72,.08)!important;
}

.folder-actions>summary:hover{
    background:#fff!important;
    color:#253147!important;
}

.folder-menu{
    position:absolute;
    top:40px;
    right:0;
    width:245px;
    padding:10px;
    display:grid;
    gap:9px;
    border:1px solid #dde4ed;
    border-radius:13px;
    background:#fff;
    box-shadow:0 18px 45px rgba(31,45,72,.16);
}

.folder-menu form{
    display:grid;
    gap:7px;
}

.rename-form{
    margin:0;
}

.folder-menu input{
    width:100%;
    padding:9px 10px;
    border:1px solid #dce3ed;
    border-radius:9px;
    background:#fafbfd;
    color:#172033;
    font-size:11px;
    outline:none;
}

.folder-menu input:focus{
    border-color:#7789f4;
    box-shadow:0 0 0 3px rgba(83,104,255,.10);
}

.folder-menu-btn{
    width:100%;
    min-height:34px;
    padding:7px 9px;
    border:1px solid #dce3ed;
    border-radius:8px;
    background:#f7f9fc;
    color:#2b374b;
    font-size:11px;
    font-weight:800;
}

.folder-menu-btn:hover{
    background:#edf1f7;
}

.folder-menu-btn.danger-text{
    border-color:#ffd9de;
    background:#fff2f4;
    color:#b43e4f;
}

.folder-menu-btn.danger-text:hover{
    background:#ffe6ea;
}

.folder-manage{
    position:relative;
}

.folder-manage>summary{
    padding:11px 13px!important;
    background:#fff!important;
    border:1px solid #dfe5ec!important;
    color:#56657a!important;
    font-weight:800!important;
}

.folder-manage-panel{
    position:absolute;
    top:44px;
    right:0;
    width:290px;
    padding:11px;
    display:grid;
    gap:9px;
    border:1px solid #dde4ed;
    border-radius:13px;
    background:#fff;
    box-shadow:0 18px 45px rgba(31,45,72,.16);
    z-index:40;
}

.folder-manage-panel .rename-form{
    display:grid;
    grid-template-columns:1fr auto;
    gap:7px;
}

.folder-manage-panel .rename-form input{
    min-width:0;
}

.folder-manage-panel form:last-child{
    margin:0;
}

@media(max-width:760px){

    .folder-actions{
        top:9px;
        right:9px;
    }

    .folder-actions>summary{
        width:36px;
        height:36px;
    }

    .folder-menu{
        right:-4px;
        width:min(250px,calc(100vw - 46px));
    }

    .folder-manage-panel{
        position:fixed;
        left:15px;
        right:15px;
        top:auto;
        bottom:82px;
        width:auto;
        box-shadow:0 20px 60px rgba(31,45,72,.18);
    }

    .folder-manage-panel .rename-form{
        grid-template-columns:1fr;
    }

    .compact-card .folder-actions{
        top:8px;
        right:8px;
    }
}


/* Final: no options menu on folder/album cards.
   Folder options inside an opened folder (.folder-manage) remain available. */
.folder-actions{
    display:none !important;
}
