:root{--blue:#3569e8;--ink:#182337;--muted:#8490a3;--line:#e6eaf1;--bg:#f3f6fb}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px 'Segoe UI','Microsoft YaHei',sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;background:white;border:1px solid var(--line);border-radius:8px;padding:9px 13px;color:var(--ink);transition:.15s}button:hover{border-color:#9eb8f5;background:#f7faff}button:disabled{opacity:.5;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.dropzone:focus-visible{outline:3px solid #91b2ff;outline-offset:2px}[hidden]{display:none!important}header{display:flex;align-items:center;justify-content:space-between;padding:22px 30px;background:white;border-bottom:1px solid var(--line);gap:20px}.brand{display:flex;align-items:center;gap:13px}.logo{background:linear-gradient(145deg,#427ef4,#2450c6);box-shadow:0 5px 14px #3168df33;border-radius:13px;width:49px;height:49px;display:grid;place-items:center;color:white;font-size:29px;font-weight:700}.brand strong{font-size:22px}.brand small{font-size:14px;letter-spacing:1px;font-weight:400;color:var(--muted)}.brand p{margin:5px 0 0;color:var(--muted);font-size:12px}nav{display:flex;align-items:center;gap:9px}.status{font-size:12px;background:#f6f8fc;border:1px solid var(--line);border-radius:22px;padding:10px 13px;color:#77859c;margin-right:10px}.status i{display:inline-block;width:7px;height:7px;background:#e9aa43;border-radius:50%;margin-right:6px}.intro{display:flex;align-items:center;justify-content:space-between;margin:29px 30px 24px}.eyebrow{font-size:10px;letter-spacing:2px;color:#6e8cc0}h1{font-size:25px;letter-spacing:.4px;margin:8px 0 9px}.intro p{color:var(--muted);margin:0;font-size:13px}.version{color:var(--muted);font-size:12px}.version b{background:#e7edfa;padding:5px 9px;margin-left:8px;border-radius:5px;color:#5673a7}main{display:grid;grid-template-columns:292px minmax(390px,1fr) minmax(330px,.86fr);align-items:start;gap:20px;margin:0 30px}aside,.results{display:grid;gap:18px}.card{background:white;border:1px solid var(--line);border-radius:15px;padding:21px;box-shadow:0 3px 8px #20345804}h2{font-size:15px;margin:0 0 18px;font-weight:650}.step{font-size:11px;display:inline-grid;place-items:center;width:22px;height:22px;background:#edf2ff;color:var(--blue);border-radius:7px;margin-right:5px}.dropzone{border:1.5px dashed #c6d4ed;border-radius:11px;background:#f9fbff;display:flex;align-items:center;justify-content:center;flex-direction:column;height:181px;cursor:pointer;gap:9px;text-align:center}.dropzone.drag{border-color:var(--blue);background:#edf3ff}.dropzone svg{width:32px;height:32px;color:var(--blue);margin-bottom:5px}.dropzone strong{font-size:16px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropzone span{font-size:12px;color:#8995a8}.dropzone small{font-size:10px;color:#9ba5b5}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:18px 0 14px}label{font-size:12px;color:#65738b}select,textarea,input:not([type=checkbox]){border:1px solid var(--line);background:white;border-radius:7px;padding:9px;color:var(--ink);width:100%;margin-top:7px}textarea{resize:vertical;line-height:1.7}.field small{float:right;color:var(--muted)}.primary{background:var(--blue);color:white;border-color:var(--blue)}.primary:hover{background:#2559d6;color:white}.full{width:100%;margin-top:15px;padding:12px}.full span{float:right}.fine{font-size:11px;line-height:1.7;color:var(--muted);margin:10px 0 0}.divider{height:1px;background:var(--line);margin:19px 0}.sectionlabel{font-size:12px;color:#7c889b;margin-bottom:11px}.sectionlabel>span{float:right;font-size:10px;border-radius:4px;background:#fff4e2;color:#bd8533;padding:2px 6px}.sample{display:flex;align-items:center;width:100%;text-align:left;padding:11px 8px;gap:8px}.sample b{color:#5977b6;background:#edf2fc;border-radius:5px;padding:4px 7px}.sample span{font-size:11px;flex:1}.sample small{display:block;color:var(--muted);font-size:10px;margin-top:5px}.sample>span:last-child{flex:0;color:var(--muted)}.muted{color:var(--muted);font-size:12px}.track{height:5px;background:#eef1f7;border-radius:5px;margin:15px 0}.track span{display:block;height:100%;background:var(--blue);border-radius:5px}.trust{display:flex;gap:11px;padding:0 8px;color:#7e8ca4;font-size:11px;line-height:1.8}.trust>span{font-size:23px;color:#7b9cdb}.trust p{margin:2px 0}.summary h2{font-size:22px;margin:0 0 8px}.summarytop{display:flex;gap:18px;align-items:center}.ring{flex-shrink:0;border:7px solid #edf1fa;border-top-color:var(--blue);border-right-color:var(--blue);width:90px;height:90px;border-radius:50%;display:flex;justify-content:center;align-items:center;flex-direction:column}.ring b{font-size:25px;color:var(--blue)}.ring small{font-size:10px;color:var(--muted)}.badge,.tag{border-radius:5px;padding:4px 7px;font-size:10px;background:#edf3ff;color:#5a7abd;display:inline-block}.badge{background:#fff3dd;color:#b18334;margin-top:8px}.stats{display:flex;gap:8px;margin:18px 0}.stats span{background:#f8faff;border:1px solid var(--line);border-radius:8px;padding:9px 11px;font-size:12px;flex:1;white-space:nowrap}.stats b{font-size:16px;margin-left:5px}.notice{background:#eff5ff;color:#5574a8;border-radius:8px;padding:12px;font-size:12px;line-height:1.8}.sectionhead{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:18px}.sectionhead h2{margin:0}.sectionhead>.muted{font-size:10px}.sectionhead select{margin:0;width:auto;font-size:11px;padding:5px}.fieldcards{display:grid;grid-template-columns:1fr 1fr;gap:10px}.fieldcard{padding:15px 12px;background:#fafcff;border:1px solid var(--line);border-radius:9px}.fieldcard small{display:block;color:var(--muted);font-size:11px;margin-bottom:8px}.fieldcard b{font-size:13px}.empty{padding:30px 12px;text-align:center;color:#94a0b4;font-size:12px;line-height:1.9}.count{background:#edf2ff;color:var(--blue);padding:2px 6px;border-radius:4px;margin-left:5px;font-size:11px}.risk{border:1px solid var(--line);border-radius:10px;padding:15px;margin-top:12px}.riskhead{display:flex;align-items:center;gap:7px}.riskhead b{font-size:13px}.level{color:#ca5a5a;background:#fff0f0;font-size:10px;padding:3px 5px;border-radius:4px}.level.medium{color:#b38b3c;background:#fff6e5}.risk blockquote{margin:12px 0;padding:10px 12px;border-left:2px solid #dae2f1;background:#f8faff;font-size:12px;line-height:1.8;color:#758199}.suggestion{font-size:12px;line-height:1.9;color:#476280}.riskfoot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}.riskfoot small{font-size:10px;color:#98a2b4}.riskfoot button{font-size:11px;padding:5px 8px}.exportbar{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted);gap:10px}.exportbar button{font-size:11px}.preview{position:sticky;top:16px;padding:18px}.pagecontrols{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px;gap:8px;color:#8793a7;font-size:11px}.pagecontrols>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:60%}.pagecontrols>div{display:flex;align-items:center;gap:8px}.pagecontrols button{padding:2px 8px}.previewempty{height:510px;display:flex;justify-content:center;align-items:center;flex-direction:column;color:#a1afc4;text-align:center}.previewempty>span{font-size:55px;color:#c5d2e8}.previewempty h3{font-size:14px;font-weight:500}.previewempty p{font-size:11px}.paper{background:white;padding:33px 28px;min-height:510px;white-space:pre-wrap;font-family:'SimSun',serif;font-size:12px;line-height:2.4;overflow-wrap:anywhere;box-shadow:0 2px 10px #2034580a}.paper h3{text-align:center;font-size:18px}#paperWrap{background:#eef2f8;border:1px solid var(--line);border-radius:9px;padding:12px;max-height:650px;overflow:auto}#paperWrap iframe{width:100%;height:560px;border:0}#paperWrap img{width:100%}mark{background:#fff0b3;padding:3px 0;border-bottom:2px solid #e9bb4d}.previewfoot{display:flex;align-items:center;justify-content:space-between;margin-top:14px}.previewfoot button{font-size:11px;padding:5px 9px}footer{display:flex;justify-content:space-between;margin:28px 30px;font-size:10px;color:#98a4b6}dialog{border:1px solid var(--line);border-radius:17px;width:570px;max-width:94vw;padding:26px;box-shadow:0 30px 100px #14274b40}dialog::backdrop{background:#17284466;backdrop-filter:blur(3px)}.modalhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.modalhead h2{margin:0;font-size:20px}.modalhead button{border:0;font-size:25px;padding:0 5px}#modalBody{max-height:70vh;overflow:auto}#modalBody p{font-size:13px;color:#7c889b;line-height:1.9}#modalBody label{display:block;margin:12px 0}#modalBody h3{font-size:14px;margin-top:25px}.historyitem{display:block;width:100%;text-align:left;margin:9px 0;padding:15px}.historyitem small{display:block;color:var(--muted);margin-top:7px}#toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);background:#213453;color:white;border-radius:9px;padding:13px 22px;font-size:13px;box-shadow:0 8px 25px #23304f33;display:none;z-index:100}#toast.visible{display:block}@media(min-width:1700px){main{grid-template-columns:330px minmax(500px,1fr) minmax(440px,.8fr);gap:24px}.card{padding:25px}.paper{min-height:650px;font-size:14px}}@media(max-width:1180px){header{flex-wrap:wrap}.status{display:none}main{grid-template-columns:260px minmax(360px,1fr)}.preview{grid-column:2;position:static}.intro{margin-top:20px}.version{display:none}}@media(max-width:700px){header{padding:16px}nav{flex-wrap:wrap}nav button{font-size:11px}main{display:flex;flex-direction:column;margin:0 14px}aside,.results,.preview{width:100%}.intro{margin:20px 16px}h1{font-size:20px}.intro p{font-size:11px}.summarytop{gap:12px}.stats{flex-wrap:wrap}.stats span{flex:1 0 40%}footer{flex-direction:column;gap:8px;margin:25px 15px}.exportbar{flex-wrap:wrap}.card{padding:18px}.previewempty{height:280px}}

/* Prominent, wider risk summary cards. */
#summary .stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:24px 0}
#summary .stats>span{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:88px;padding:18px 22px;font-size:16px;font-weight:650;border-radius:12px;border:1px solid #d9e4f8;border-left:5px solid #6489cd;background:#f0f5ff;box-shadow:0 3px 8px #23447708;white-space:normal}
#summary .stats>span b{font-size:34px;line-height:1.1;font-weight:750;margin:0;color:#315c9b}
#summary .stats>span:nth-child(1){border-color:#f0cfcd;border-left-color:#d26460;background:#fff4f3;color:#9f403b}
#summary .stats>span:nth-child(2){border-color:#eeddb8;border-left-color:#cc9a45;background:#fff9ed;color:#92651f}
#summary .stats>span:nth-child(3){border-color:#cce2d9;border-left-color:#61a18b;background:#f0f9f5;color:#367661}
@media(max-width:480px){#summary .stats{gap:10px}#summary .stats>span{font-size:14px;padding:15px 12px;min-height:78px;gap:8px}#summary .stats>span b{font-size:29px}}

/* Independent scrolling for contract risk results; keep heading outside. */
#risks{max-height:clamp(420px,72vh,860px);overflow-y:scroll;overflow-x:hidden;scrollbar-gutter:stable;overscroll-behavior-y:contain;padding-right:16px;scrollbar-width:auto;scrollbar-color:#92a9cb #edf2f8}
#risks::-webkit-scrollbar{width:12px}
#risks::-webkit-scrollbar-track{background:#edf2f8;border-radius:8px}
#risks::-webkit-scrollbar-thumb{background:#92a9cb;border:2px solid #edf2f8;border-radius:8px}
#risks::-webkit-scrollbar-thumb:hover{background:#6487b9}
#risks:focus-visible{outline:2px solid #91b2ff;outline-offset:4px;border-radius:6px}
@media(max-width:700px){#risks{max-height:65vh;padding-right:10px}}
@media print{#risks{max-height:none;overflow:visible;padding-right:0}}

.deliverables{border-color:#cbdafa;background:linear-gradient(120deg,#f1f6ff,#ffffff);box-shadow:0 4px 16px #3569e810}
.deliverable-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:15px}
.deliverable-heading h2{margin:0;font-size:17px;color:#294c87}
.deliverable-heading span{font-size:11px;color:#8293af}
.deliverable-actions{display:flex;gap:12px;flex-wrap:wrap}
.deliverable-actions button{padding:14px 20px;font-size:15px;font-weight:650;border-radius:10px;min-height:50px}
.deliverable-actions .primary{flex:1;box-shadow:0 4px 12px #3569e825}
.deliverable-actions button:not(.primary){border-color:#c7d6f0;color:#385e96;background:white}
@media(max-width:700px){.deliverable-heading{flex-wrap:wrap}.deliverable-actions button{width:100%}}

.top-export-actions{display:flex;justify-content:flex-end;align-items:center;gap:12px;flex-wrap:wrap;margin-left:20px}
.top-export-actions button{background:transparent;color:#284267;border:1px solid #ced9e9;border-radius:10px;padding:12px 17px;font-size:14px;font-weight:500;box-shadow:none;min-height:46px}
.top-export-actions button:hover:not(:disabled){background:transparent;color:#285dba;border-color:#91add8}
@media(max-width:900px){.intro{flex-wrap:wrap;gap:18px}.top-export-actions{margin-left:0;width:100%;justify-content:flex-start}}
@media(max-width:500px){.top-export-actions{gap:9px}.top-export-actions button{font-size:12px;padding:10px 12px}}

.export-choice{display:flex;align-items:center;gap:11px;padding:8px 10px 8px 15px;border:1px solid #ced9e9;border-radius:11px;background:transparent;min-height:54px;color:#284267}
.export-choice>span{font-size:13px;white-space:nowrap}
.export-choice select{width:auto;max-width:150px;margin:0;padding:8px 7px;border:0;background:transparent;color:#284267;font-size:14px;cursor:pointer}
.top-export-actions .export-choice button{min-height:34px;border:0;border-left:1px solid #d8e1ee;border-radius:0;padding:6px 10px;font-size:13px;background:transparent;white-space:nowrap}
.top-export-actions .export-choice button:hover:not(:disabled){background:transparent;color:#285dba}
@media(max-width:500px){.export-choice{width:100%;justify-content:space-between}.export-choice select{flex:1}.top-export-actions .export-choice button{width:auto}}

.export-choice>.export-function-label{display:inline-flex;align-items:center;gap:8px;font-size:15px;font-weight:750;color:#1f5196;border-right:1px solid #cdd9eb;padding:7px 15px 7px 0;line-height:1.5}
.export-function-label svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
@media(max-width:500px){.export-choice>.export-function-label{font-size:13px;padding-right:10px;gap:5px}.export-function-label svg{width:18px;height:18px}}
#progress .progress-file{overflow-wrap:anywhere}#progress .progress-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:16px 0 12px}#progress .progress-heading strong{font-size:16px;color:#173451}#progress .progress-heading>b{white-space:nowrap;color:#3565de;font-size:15px}#progress .track{height:10px;margin:12px 0 16px;background:#e8eefb;border-radius:8px;overflow:hidden}#progress .track span{display:block;height:100%;background:#3565ee;transition:width .5s ease}#progress .progress-times{display:flex;flex-wrap:wrap;gap:8px 20px;font-size:13px;margin-bottom:12px;color:#61748b}#progress small{display:block;line-height:1.7}#progress .progress-error{font-size:13px;line-height:1.7;color:#b84d37}#retryUpload,#cancelReview{margin-top:12px}#cancelReview{border-color:#e3b7b1;color:#a8483c}#cancelReview:hover{background:#fdf3f1;border-color:#d3928a}
.history-row{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;margin:9px 0;padding:5px 10px 5px 0}.history-row .historyitem{flex:1;min-width:0;width:auto;border:0;margin:0;overflow-wrap:anywhere}.history-delete{flex-shrink:0;color:#b54b43;border-color:#ebc8c5;font-size:13px;padding:8px 12px}.history-delete:hover{background:#fff2f0;border-color:#ce8b83}.history-delete:disabled{opacity:.5}
.top-export-actions{flex-wrap:wrap}.word-export-hint{flex-basis:100%;margin:3px 0 0;font-size:12px!important;line-height:1.7;color:#6d7f98;text-align:right;max-width:100%;overflow-wrap:anywhere}
