:root {
    --bg: #f3f5fa;
    --surface: rgba(255, 255, 255, .92);
    --surface-solid: #fff;
    --text: #182036;
    --muted: #687089;
    --line: #e3e7f0;
    --primary: #5b4df5;
    --primary-dark: #4738dc;
    --success: #168a5b;
    --danger: #cf3f55;
    --shadow: 0 24px 70px rgba(43, 50, 88, .12);
    --radius: 24px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}
button, input, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.background-orb {
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(8px);
    opacity: .52;
}
.orb-one { width: 440px; height: 440px; background: #dcd8ff; top: -180px; right: -100px; }
.orb-two { width: 360px; height: 360px; background: #d6f1e9; bottom: -180px; left: -120px; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 28px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.eyebrow { display: inline-flex; padding: 7px 11px; border-radius: 99px; background: #ebe9ff; color: var(--primary-dark); font-weight: 800; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 15px 0 12px; font-size: clamp(2.35rem, 5vw, 4.5rem); line-height: .98; letter-spacing: -.055em; }
h1 span { color: var(--primary); }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.privacy-card { display: flex; align-items: center; gap: 12px; min-width: 270px; padding: 16px 18px; border: 1px solid rgba(255,255,255,.9); border-radius: 18px; background: rgba(255,255,255,.66); backdrop-filter: blur(15px); }
.privacy-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; background: #dff6ec; color: var(--success); font-weight: 900; }
.privacy-card strong, .privacy-card span { display: block; }
.privacy-card strong { font-size: .91rem; }
.privacy-card span { margin-top: 3px; color: var(--muted); font-size: .78rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.upload-panel, .summary-panel { border: 1px solid rgba(255,255,255,.82); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.upload-panel { min-height: 570px; padding: 20px; border-radius: var(--radius); }
.summary-panel { position: sticky; top: 20px; padding: 24px; border-radius: var(--radius); }

.drop-zone { display: flex; width: 100%; min-height: 205px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; border: 1.5px dashed #bbb8ed; border-radius: 19px; background: linear-gradient(150deg, #f8f7ff, #f3f5ff); cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--primary); background: #f0efff; transform: translateY(-1px); }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 15px; background: var(--primary); color: #fff; font-size: 1.45rem; box-shadow: 0 12px 24px rgba(91,77,245,.25); }
.drop-zone strong { font-size: 1.1rem; }
.drop-zone > span:not(.upload-icon) { color: var(--muted); font-size: .9rem; }
.drop-zone small { margin-top: 8px; color: #9298aa; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 12px; }
.toolbar-group { display: flex; gap: 10px; }
.button, .select { min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 750; font-size: .88rem; transition: .18s ease; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 15px; cursor: pointer; text-decoration: none; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-secondary:hover { border-color: #c4c1e7; background: #fafaff; }
.button-danger-ghost { color: var(--danger); background: transparent; border-color: transparent; }
.button-danger-ghost:hover { background: #fff0f2; }
.select { padding: 0 34px 0 12px; color: var(--text); cursor: pointer; }

.empty-state { display: grid; min-height: 210px; place-items: center; align-content: center; border-radius: 16px; color: var(--muted); text-align: center; }
.empty-state span { font-weight: 800; color: #737b91; }
.empty-state p { max-width: 350px; margin: 7px 0 0; font-size: .87rem; }
.file-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.file-item { display: grid; grid-template-columns: 32px 46px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); box-shadow: 0 5px 17px rgba(38,46,77,.045); transition: .15s ease; }
.file-item.dragging { opacity: .45; }
.file-item.drag-over { border-color: var(--primary); transform: translateY(2px); }
.drag-handle { display: grid; place-items: center; width: 30px; height: 34px; border: 0; background: transparent; color: #9aa0b2; cursor: grab; font-size: 1.2rem; }
.drag-handle:active { cursor: grabbing; }
.pdf-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff0f2; color: var(--danger); font-weight: 900; font-size: .72rem; }
.file-info { min-width: 0; }
.file-name { overflow: hidden; color: #30384e; font-weight: 750; font-size: .91rem; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.file-actions { display: flex; gap: 5px; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #7d8497; cursor: pointer; }
.icon-button:hover { background: #f1f3f8; color: var(--text); }
.icon-button.delete:hover { background: #fff0f2; color: var(--danger); }

.upload-queue { margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.queue-header { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: .82rem; font-weight: 750; }
.queue-track, .progress-track { overflow: hidden; height: 8px; border-radius: 99px; background: #e9ebf3; }
.queue-bar, .progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #887cfb); transition: width .2s ease; }
.queue-detail { margin-top: 7px; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.summary-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 17px; border-bottom: 1px solid var(--line); font-weight: 850; }
.badge { padding: 6px 10px; border-radius: 99px; background: #eeeff5; color: #71788c; font-size: .71rem; }
.badge.processing { background: #eeeaff; color: var(--primary-dark); }
.badge.success { background: #e3f7ee; color: var(--success); }
.badge.failed { background: #fff0f2; color: var(--danger); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 19px 0; }
.stat { padding: 14px; border-radius: 15px; background: #f6f7fa; }
.stat span, .stat strong { display: block; }
.stat span { color: var(--muted); font-size: .72rem; }
.stat strong { margin-top: 4px; font-size: 1.25rem; letter-spacing: -.02em; }
.field { display: block; margin: 20px 0; }
.field > span { display: block; margin-bottom: 8px; color: #596177; font-size: .78rem; font-weight: 750; }
.filename-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.filename-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,77,245,.09); }
.filename-input input { min-width: 0; width: 100%; height: 44px; padding: 0 4px 0 13px; border: 0; outline: 0; background: transparent; color: var(--text); }
.filename-input span { padding-right: 13px; color: var(--muted); font-size: .84rem; }
.progress-card { margin: 0 0 14px; padding: 13px; border: 1px solid #dedbf9; border-radius: 14px; background: #f8f7ff; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: .78rem; }
.progress-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-label strong { color: var(--primary-dark); }
.progress-card small { display: block; margin-top: 7px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button-large { width: 100%; min-height: 52px; border-radius: 15px; font-size: .95rem; }
.button-primary { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 12px 24px rgba(91,77,245,.23); }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); }
.button-success { border-color: var(--success); background: var(--success); color: #fff; }
.summary-note { margin: 14px 2px 0; color: var(--muted); font-size: .72rem; line-height: 1.5; text-align: center; }
footer { display: flex; justify-content: space-between; padding: 24px 4px 0; color: #8a91a4; font-size: .75rem; }

.toast-container { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 9px; width: min(390px, calc(100% - 40px)); }
.toast { padding: 13px 15px; border-radius: 13px; background: #222a3e; color: #fff; box-shadow: 0 13px 35px rgba(18,25,45,.25); font-size: .85rem; animation: toast-in .2s ease; }
.toast.error { background: #a72f43; }
.toast.success { background: #14724e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
    .container { padding-top: 34px; }
    .hero { align-items: flex-start; flex-direction: column; }
    .privacy-card { width: 100%; }
    .workspace { grid-template-columns: 1fr; }
    .summary-panel { position: static; }
}
@media (max-width: 600px) {
    .container { width: min(100% - 20px, 1180px); }
    .hero { margin-bottom: 23px; }
    h1 { font-size: 2.55rem; }
    .upload-panel, .summary-panel { padding: 14px; border-radius: 19px; }
    .drop-zone { min-height: 180px; padding: 18px; }
    .toolbar, .toolbar-group { align-items: stretch; flex-direction: column; }
    .button, .select { width: 100%; }
    .file-item { grid-template-columns: 28px 40px minmax(0, 1fr) auto; gap: 7px; padding: 9px 7px; }
    .pdf-icon { width: 38px; height: 38px; }
    .file-actions .move-button { display: none; }
    footer { flex-direction: column; gap: 5px; text-align: center; }
}

.password-details { margin-top: 7px; max-width: 430px; }
.password-details summary { width: fit-content; color: #777f94; cursor: pointer; font-size: .7rem; font-weight: 750; user-select: none; }
.password-details summary:hover { color: var(--primary-dark); }
.password-wrap { display: flex; align-items: center; gap: 8px; margin-top: 7px; max-width: 390px; }
.password-wrap > span { flex: 0 0 auto; color: #777f94; font-size: .7rem; font-weight: 700; }
.password-input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: #f8f9fc; color: var(--text); font: inherit; font-size: .78rem; outline: none; }
.password-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,85,230,.11); background: #fff; }
@media (max-width: 620px) { .password-wrap { align-items: stretch; flex-direction: column; gap: 4px; } }
