:root { color-scheme: light; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #f2f6f8; color: #10334b; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.app { max-width: 620px; min-height: 100vh; margin: auto; background: #fff; box-shadow: 0 0 35px #123a5512; }
.topbar { min-height: 66px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; background: #103b56; color: #fff; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; direction: ltr; letter-spacing: .02em; }
.brand-mark { width: 29px; height: 29px; display: inline-grid; place-items: center; border: 2px solid #84d6e7; border-radius: 7px; color: #84d6e7; font-size: 20px; line-height: 1; }
.private-badge { padding: 5px 11px; border-radius: 99px; background: #ffffff1d; color: #e1f4f7; font-size: 13px; }
.workbench { padding: 30px 20px 46px; }
h1 { margin: 0; font-size: clamp(26px, 7vw, 34px); line-height: 1.3; }
.intro { margin: 6px 0 28px; color: #587185; font-size: 16px; }
.scan-button { display: flex; gap: 13px; align-items: center; justify-content: center; width: 100%; min-height: 84px; border: 0; border-radius: 19px; color: #fff; background: #116e97; box-shadow: 0 7px 0 #0a4d6c; font-size: 22px; font-weight: 800; }
.scan-button:active { transform: translateY(4px); box-shadow: 0 3px 0 #0a4d6c; }
.camera-icon { font-size: 29px; }
.scan-help, .hint { margin: 14px 2px 0; color: #677f90; font-size: 14px; line-height: 1.6; }
.preview-area, .review-card { margin-top: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
h2 { margin: 0; font-size: 20px; }
.text-button { border: 0; background: transparent; color: #116e97; font-weight: 700; padding: 8px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 12px; }
.page { position: relative; border: 1px solid #d5e1e7; border-radius: 13px; overflow: hidden; background: #edf3f6; }
.page img { width: 100%; height: 154px; display: block; object-fit: contain; }
.page .page-label { display: block; padding: 5px 8px; color: #4f697b; font-size: 13px; }
.page .page-tools { display: flex; border-top: 1px solid #d5e1e7; }
.page button { flex: 1; min-height: 34px; border: 0; background: #fff; color: #174e6d; font-size: 12px; }
.page button + button { border-right: 1px solid #d5e1e7; }
.review-card { padding: 19px; background: #f8fbfc; border: 1px solid #d9e5eb; border-radius: 18px; }
.status-badge { color: #116e97; font-size: 13px; }
label { display: block; margin: 17px 0 7px; font-size: 15px; font-weight: 700; }
input:not([type=file]) { display: block; width: 100%; height: 55px; border: 1.5px solid #bdcdd5; border-radius: 11px; background: #fff; padding: 0 14px; color: #10334b; font-size: 19px; font-weight: 700; text-align: left; }
input:focus { outline: 3px solid #90d8e5; border-color: #116e97; }
.filename { margin: 19px 0; padding: 14px; background: #e3f3f8; border-radius: 10px; color: #0d516e; font-size: 14px; overflow-wrap: anywhere; text-align: left; }
.validation { color: #b3261e; font-size: 14px; }
.primary-button, .secondary-button { display: block; width: 100%; min-height: 55px; border-radius: 12px; font-size: 17px; font-weight: 800; }
.primary-button { border: 0; color: #fff; background: #0a8a69; }
.secondary-button { margin-top: 10px; border: 1.5px solid #116e97; color: #116e97; background: #fff; }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: wait; }
.status { margin: 22px 4px; text-align: center; color: #647e8f; font-size: 14px; }
[hidden] { display: none !important; }
@media (min-width: 620px) { .app { min-height: calc(100vh - 40px); margin: 20px auto; border-radius: 22px; overflow: hidden; } .workbench { padding: 40px; } }

.pages {grid-template-columns:repeat(auto-fill,minmax(230px,1fr));} .page img {height:270px;} .page select {width:100%;padding:10px;border:0;background:white;color:#10334b;font:inherit;} .crop-dialog {width:min(96vw,620px);max-height:95vh;border:0;border-radius:18px;padding:18px;color:#10334b;} .crop-dialog::backdrop {background:#001c38b0;} .corner-canvas {display:block;width:100%;height:auto;touch-action:none;margin:12px auto;}

.page .page-tools {flex-wrap:wrap;} .page .page-tools button {flex:1 1 45%;min-height:44px;border-bottom:1px solid #d5e1e7;}

.brand-logo{width:48px;height:58px;object-fit:contain;background:#faf7ef;border-radius:8px;padding:3px}.topbar{background:#392a17}.brand{direction:rtl}.scan-button{background:#9a741f;box-shadow:0 7px 0 #624812}.primary-button{background:#9a741f}.page .strength-label{margin:8px 12px;font-size:13px}.page input[type=range]{height:30px;width:90%;margin:0 5% 10px;padding:0;accent-color:#9a741f}.page button:disabled,.page select:disabled{opacity:.5;cursor:wait}

#outputFormat{width:100%;padding:14px;border:1px solid #bdcdd5;border-radius:10px;margin-bottom:16px;font:inherit;background:white;color:#10334b}

.archive-card{margin-top:28px;padding:18px;background:#faf7ef;border:1px solid #ddcda8;border-radius:14px}.archive-card summary{font-weight:800;cursor:pointer}.archive-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #dfd8c8}.archive-row input[type=checkbox]{width:22px;height:22px;flex:none}.archive-row span{flex:1;overflow-wrap:anywhere;font-size:14px}.archive-row button{padding:9px;border:1px solid #cbb888;background:white;border-radius:8px}.archive-card select,#saveFolder{width:100%;padding:12px;font:inherit;border:1px solid #cbb888;border-radius:8px}#shareZip{margin-top:12px}

:root{background:#eeeae2;color:#30281b}.app{max-width:760px}.topbar{background:#242119;padding:16px 24px}.brand-logo{width:54px;height:62px}.brand{font-size:19px}.private-badge{color:#e6c477;background:#ffffff12;letter-spacing:2px}.workbench{padding:28px 22px}.scan-button{min-height:72px;border-radius:16px;background:linear-gradient(135deg,#c9a34d,#987024);box-shadow:0 5px 0 #76591f}.review-card{background:#faf8f2;border-color:#e4dcc8}.section-heading h2{font-size:18px}.page{background:#fff;border-color:#e3ddcf;box-shadow:0 4px 18px #30281b09}.page img{height:300px;background:#f1eee7}.page .filter-title{display:block;padding:10px 12px 4px;font-size:14px}.filter-chips{display:flex;gap:6px;overflow-x:auto;padding:8px 10px 12px}.page .filter-chips button{flex:none;white-space:nowrap;border:1px solid #ded6c6;border-radius:99px;padding:9px 12px;font-size:12px;min-height:38px;color:#514631;background:#fff}.page .filter-chips button.active{background:#342c1e;color:#f5dd9c;border-color:#342c1e}.library-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.library-heading span{font-size:12px;color:#95732c}.archive-card{background:#fff;padding:20px;border-color:#ded7c7}#archiveList{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;margin:18px 0}.document-card{position:relative;border:1px solid #e0d9cb;border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:8px;background:#faf9f5}.document-card input[type=checkbox]{position:absolute;top:12px;right:12px;z-index:1;width:22px;height:22px;accent-color:#9a741f}.document-preview{height:170px;width:100%;border:0;background:#eae6db;border-radius:8px;color:#9a741f;font-size:36px;font-weight:800;overflow:hidden}.document-preview img{width:100%;height:100%;object-fit:contain}.document-card strong{font-size:13px;direction:auto;overflow-wrap:anywhere}.document-card small{font-size:11px;color:#8b7d66}.document-actions{display:flex;gap:6px}.document-actions button{flex:1;padding:8px;border:1px solid #dcd1b9;background:white;color:#69501d;border-radius:7px}.secondary-button{border-color:#bfa674;color:#755923}.primary-button{background:#9a741f}.page .page-tools button{color:#755923}

button svg{vertical-align:middle;margin-inline-end:7px;flex-shrink:0}.page .page-tools button{display:flex;align-items:center;justify-content:center;gap:4px}.page .page-tools button svg{margin:0}
