@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root{--green:#27b566;--green-dark:#21a45b;--red:#ff4545;--text:#252a35;--muted:#687085;--line:#e4e8ef;--soft:#f7f8fa;--pdf-bg:#fff0f0;--pdf-border:#ffd9d9;}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;color:var(--text);background:#fff;min-height:100vh}.home-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:40px 20px}.hero{text-align:center;transform:translateY(-12px)}.pill{display:inline-block;background:#e4f8ed;color:var(--green);border-radius:999px;padding:7px 13px;font-size:12px;font-weight:700;letter-spacing:.08em;margin-bottom:20px}.hero h1{font-size:37px;line-height:1.08;margin:0 0 16px;font-weight:800;letter-spacing:-.04em}.hero h1 span{color:var(--green)}.hero p{margin:0;color:#60687a;font-size:15.5px;line-height:1.65}.pdf-preview-row{display:flex;gap:38px;justify-content:center;align-items:flex-start;margin:42px 0 31px;min-height:86px}.pdf-preview{width:58px;text-align:center}.pdf-icon-box{width:56px;height:64px;border-radius:8px;background:var(--pdf-bg);border:1px solid var(--pdf-border);display:flex;align-items:center;justify-content:center;margin:0 auto 7px}.pdf-icon,.file-pdf{width:27px;height:27px;fill:none;stroke:var(--red);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.pdf-name{font-size:11px;color:#323846;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.download-btn,.confirm-btn{border:0;background:var(--green);color:white;border-radius:18px;padding:12px 29px;font-weight:700;font-size:14px;text-decoration:none;display:inline-flex;gap:12px;align-items:center;justify-content:center;box-shadow:0 12px 22px rgba(39,181,102,.25);transition:.15s}.download-btn:hover,.confirm-btn:hover{background:var(--green-dark);transform:translateY(-1px)}.download-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.download-btn.disabled,.confirm-btn:disabled{opacity:.55;pointer-events:none}.empty-small{color:var(--muted);font-size:14px}.admin-wrap{max-width:577px;margin:38px auto 70px;padding:0 16px}.admin-header{text-align:center;margin-bottom:26px}.admin-header h1{font-size:24px;line-height:1.15;margin:0 0 8px;font-weight:800;letter-spacing:-.03em}.admin-header p{margin:0;color:#697287;font-size:14px}.card{background:#fff;border:1px solid #dfe3eb;border-radius:11px;box-shadow:0 2px 6px rgba(18,25,38,.13);padding:25px;margin-bottom:24px}.card h2{font-size:16px;margin:0 0 16px;font-weight:700}.dropzone{min-height:151px;border:2px dashed #dce2eb;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;cursor:pointer;padding:24px;color:#111827}.dropzone:hover{border-color:#cbd5e1;background:#fbfcfd}.dropzone input{display:none}.dropzone svg{width:32px;height:32px;fill:none;stroke:#778195;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;margin-bottom:13px}.dropzone strong{font-size:14px;font-weight:600}.dropzone span{font-size:12px;color:#717a8d;margin-top:6px}.confirm-btn{margin-top:16px;border-radius:14px;cursor:pointer}.files-card{padding-bottom:17px}.file-row{height:61px;background:#f6f6f7;border-radius:8px;margin-bottom:8px;padding:0 25px 0 17px;display:flex;align-items:center;justify-content:space-between}.file-left{display:flex;align-items:center;gap:16px;min-width:0}.file-left span{font-size:14px;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-pdf{width:21px;height:21px;flex:0 0 auto}.delete-btn{border:0;background:transparent;padding:6px;cursor:pointer;color:#7b8495}.delete-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.delete-btn:hover{color:var(--red)}.notice{border-radius:10px;padding:12px 14px;margin-bottom:15px;font-size:14px}.success{background:#eaf8f0;color:#177a43}.error{background:#fff1f1;color:#b42318}.empty-list{background:#f6f6f7;border-radius:8px;padding:22px;text-align:center;color:var(--muted);font-size:14px}@media(max-width:560px){.hero h1{font-size:31px}.desktop-only{display:none}.pdf-preview-row{gap:20px;flex-wrap:wrap}.admin-wrap{margin-top:28px}.card{padding:20px}.file-row{padding-right:13px}.file-left span{max-width:250px}}
.selected-wrap{margin-top:20px}.selected-count{font-size:14px;font-weight:700;color:#111827;margin-bottom:10px}.selected-file-row{height:36px;background:#f1f1f3;border-radius:8px;margin-bottom:8px;padding:0 13px;display:flex;align-items:center;justify-content:space-between}.selected-file-row .file-left{gap:12px}.selected-file-row .file-left span{font-size:14px;color:#111827;max-width:440px}.remove-selected{border:0;background:transparent;color:#687085;font-size:24px;line-height:1;cursor:pointer;padding:2px 0 4px 8px}.remove-selected:hover{color:#ff4545}#confirmUpload{width:100%;border-radius:18px;margin-top:8px}

/* Improved pending-upload list + loading state */
.selected-wrap{margin-top:20px;width:100%}
.selected-count{font-size:14px;font-weight:700;color:#111827;margin-bottom:10px}
.selected-list{width:100%;display:flex;flex-direction:column;gap:8px}
.selected-file-row{width:100%;min-height:36px;background:#f1f1f3;border-radius:8px;margin:0;padding:0 13px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.selected-file-row .file-left{display:flex;align-items:center;gap:12px;min-width:0;flex:1 1 auto}
.selected-file-row .file-left span{display:block;font-size:14px;color:#111827;min-width:0;max-width:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.remove-selected{flex:0 0 auto;border:0;background:transparent;color:#687085;font-size:24px;line-height:1;cursor:pointer;padding:2px 0 4px 8px}
.remove-selected:hover{color:#ff4545}
#confirmUpload{width:100%;border-radius:18px;margin-top:16px}
.loading-overlay{position:fixed;inset:0;z-index:9999;background:rgba(255,255,255,.72);display:flex;align-items:center;justify-content:center;backdrop-filter:blur(2px)}
.loading-overlay[hidden]{display:none!important}.loading-box{background:#fff;border:1px solid #dfe3eb;border-radius:16px;box-shadow:0 20px 50px rgba(18,25,38,.18);padding:28px 34px;text-align:center;font-weight:700;color:#252a35}.spinner{width:44px;height:44px;border-radius:50%;border:4px solid #dfe3eb;border-top-color:var(--green);margin:0 auto 14px;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
@media(min-width:561px){.selected-file-row{min-height:36px}.selected-file-row .file-pdf{width:21px;height:21px}.selected-file-row .file-left span{font-size:14px}}
@media(max-width:560px){.selected-file-row{min-height:56px;padding:0 22px 0 28px;border-radius:12px}.selected-file-row .file-left{gap:22px}.selected-file-row .file-left span{font-size:18px}.selected-file-row .file-pdf{width:28px;height:28px}.remove-selected{font-size:34px}}
body.is-uploading{overflow:hidden;touch-action:none}
.loading-box{min-width:180px}

/* V5 loading overlay fix: class-based, no hidden attribute dependency */
.loading-overlay{display:none;position:fixed;inset:0;width:100vw;height:100vh;z-index:2147483647;background:rgba(255,255,255,.72);align-items:center;justify-content:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.loading-overlay.is-visible{display:flex!important}
.loading-overlay .loading-box{background:#fff;border:1px solid #dfe3eb;border-radius:16px;box-shadow:0 20px 50px rgba(18,25,38,.18);padding:28px 34px;text-align:center;font-weight:700;color:#252a35;min-width:180px}
.loading-overlay .spinner{width:44px;height:44px;border-radius:50%;border:4px solid #dfe3eb;border-top-color:var(--green);margin:0 auto 14px;animation:spin .8s linear infinite}
