/* Shared desktop theme. Original-page coordinates remain owned by original-pages.js. */
:root {
  --ink:#303a36;--ink-strong:#18251f;--muted:#64706a;--faint:#6c7771;
  --base:#f4f5f2;--surface:#fff;--surface-soft:#f7f8f5;--line:#e2e6df;--line-strong:#c6d0c7;
  --brand:#256249;--brand-dark:#194b37;--brand-soft:#eaf2ec;--navy:#203c30;--navy-light:#345344;
  --shadow:0 16px 48px #18251f10;--shadow-small:#18251f0a;--shadow-soft:#18251f08;--shadow-strong:#18251f1f;
  --drawer-overlay:#18251f55;--review-overlay:#18251f66;--brand-glow:#25624910;
  --radius:10px;--fast:140ms;--medium:240ms;
}
body{background:var(--base);color:var(--ink);line-height:1.6}
button{font-weight:500;min-height:40px;letter-spacing:.01em}
button:disabled{cursor:not-allowed}button[aria-busy=true]{cursor:progress}
input,select,textarea{font-size:14px;min-height:44px;background:var(--surface)}
label{font-size:13px}h1,h2,h3{color:var(--ink-strong)}
.quiet,.secondary{color:var(--ink)}.eyebrow{font-size:11px;letter-spacing:.12em}
.app-sidebar{width:216px;background:var(--surface);color:var(--ink);padding:28px 16px;border-right:1px solid var(--line)}
.app-brand{color:var(--ink-strong);padding:0 8px 26px;font-size:17px;gap:12px}
.app-brand .brand-mark{color:var(--brand);background:var(--brand-soft);border:0;border-radius:10px;width:40px;height:44px}
.app-brand small{color:var(--muted);font-size:11px;margin-top:5px;letter-spacing:.06em}
.app-sidebar nav{gap:7px;margin-top:28px}.nav-item{color:var(--muted);padding:12px 14px;font-size:14px;min-height:46px;gap:12px;position:relative}
.nav-item:hover{color:var(--brand-dark);background:var(--surface-soft);box-shadow:none}
.nav-item.is-current{color:var(--brand-dark);background:var(--brand-soft);font-weight:600}
.nav-item.is-current::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:3px;background:var(--brand);border-radius:2px}
.nav-item span{display:flex;width:20px;opacity:1}.nav-item svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.sidebar-bottom{color:var(--muted);border-color:var(--line);padding:20px 8px 0;font-size:11px}.sidebar-bottom p{color:var(--faint);font-size:11px}.local-dot{background:var(--success)}
.app-content{margin-left:216px}.app-header{height:82px;padding:16px 36px;background:var(--surface);backdrop-filter:none}
.app-header h1{font-size:21px;font-weight:600}.app-user #identity strong{font-size:12px}.app-user #identity small{font-size:11px}
.workbench-content{max-width:1600px;padding:32px 36px 48px}.workbench-welcome{padding:8px 0 28px;align-items:center}
.workbench-welcome h2{font-size:28px;font-weight:600;letter-spacing:-.04em;margin-bottom:8px}.workbench-welcome p{font-size:13px}
.primary-action{min-height:46px;padding:12px 22px;border-radius:8px}.welcome-actions{display:flex;gap:10px;flex-shrink:0}
.cards{gap:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;margin-bottom:28px}
.task-stat{border:0;border-right:1px solid var(--line);border-radius:0;min-height:126px;padding:18px 24px;box-shadow:none}
.task-stat:last-child{border-right:0}.task-stat>span{font-size:13px}.task-stat strong{font-size:32px;font-family:"Segoe UI",sans-serif;margin:7px 0 5px;font-weight:500;letter-spacing:-.04em}
.task-stat small{font-size:11px}.task-stat:hover{background:var(--surface-soft);box-shadow:none}.stat-skeleton{height:126px;border-radius:0}
.panel{padding:26px;border:1px solid var(--line);box-shadow:none}.section-heading h2{font-size:18px}.section-heading p{font-size:12px}
.display-toggle button{font-size:12px;min-height:30px}.library-tabs{gap:28px;margin-bottom:20px}.library-tabs button{font-size:13px;padding-bottom:14px}
.search-form{grid-template-columns:minmax(200px,1fr) 130px 116px auto auto;gap:12px}.search-form input,.search-form select{background:var(--surface);font-size:13px}
.search-key kbd{top:13px;font-size:10px}.search-form button{font-size:13px;min-height:44px}.amount-filter{font-size:12px}
.contract-table{font-size:13px}.contract-table th{font-size:12px;padding:12px;font-weight:500;color:var(--muted)}.contract-table td{padding:20px 12px}
.table-title{font-size:14px;line-height:1.7;font-weight:500}.contract-id{font-size:11px}.contract-cell{gap:14px}.file-badge{width:36px;height:44px;font-size:9px}
.amount-cell{font-size:13px}.contract-table td>small,.amount-cell small{font-size:11px}.contract-state{font-size:11px;padding:4px 8px;border-radius:5px;min-width:60px;justify-content:center}
.row-actions>.quiet{font-size:12px}.row-actions details a,.row-actions details button{font-size:12px}.contract-tile{padding:22px}.tile-title{font-size:15px}
.contract-tile>p:not(.contract-id){font-size:12px}.tile-meta,.contract-tile footer,.contract-tile footer button{font-size:12px}.tile-meta strong{font-size:16px}
.stable-status{font-size:12px}.contract-library{overflow:visible}#contractList{overflow-x:auto;min-height:280px;scrollbar-width:thin}
.intake-drawer{width:min(760px,100vw);border-radius:16px 0 0 16px}.drawer-header{padding:22px 30px}.drawer-header h2{font-size:22px}.icon-close{width:36px;min-height:36px}
.intake-steps{padding:20px 30px}.intake-steps li{font-size:13px}.intake-form{padding:30px}.intake-form .contract-form label{font-size:13px}
.file-drop{min-height:270px;background:var(--surface-soft)}.file-drop>span:not(.file-drop-icon),#fileHelp{font-size:12px}.file-drop strong{font-size:17px}
.file-drop-icon{color:var(--brand);border-color:var(--line-strong)}.drawer-footer{position:sticky;bottom:-30px;z-index:1;margin:26px -30px -30px;padding:18px 30px;box-shadow:0 -8px 24px var(--shadow-soft)}
.drawer-footer p,.intake-result p,.intake-result button,.intake-excerpt,.intake-form [data-evidence]{font-size:12px}.intake-result strong{font-size:14px}.intake-form [data-evidence]:empty{min-height:0}
#workspace{padding:28px}#workspaceStatus:empty{height:0;margin:0}#sourceTitle{font-size:25px}#sourceMetadata{font-size:12px;line-height:1.9}
.review-start{background:var(--surface-soft);padding:28px}.review-start-heading h3{font-size:20px}.review-start-heading p,#runLegalReview label{font-size:13px}
.review-scope,.review-scope button,.review-stance-help{font-size:12px}.review-run>p{font-size:14px}.review-run-head strong{font-size:13px}.review-run-head p,.review-run-progress,.review-run details{font-size:12px}
.review-run-actions button,.text-action{font-size:13px}.source-extra{font-size:13px}.source-segment{padding:20px}.source-segment h4{font-size:14px}.source-segment p{font-size:13px}.source-segment textarea{font-size:15px}
.template-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.template-heading h3{font-size:22px;margin:0}.template-heading p{font-size:12px;color:var(--muted);margin:4px 0 0}
#templateList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:22px 0}.template-card{border:1px solid var(--line);padding:20px;border-radius:8px;background:var(--surface)}
.template-card button{display:block;width:100%;text-align:left;background:none;color:var(--ink-strong);padding:0;margin:0;min-height:32px;font-size:15px;box-shadow:none}
.template-card button:hover{color:var(--brand)}.template-card p{font-size:12px;color:var(--muted);margin:8px 0 0}.template-card:focus-within{border-color:var(--brand)}
#templateEditor{border-top:1px solid var(--line);padding-top:20px;margin-top:24px}#templateEditor>summary{font-size:13px;color:var(--brand);width:max-content;cursor:pointer}#templateForm{margin-top:20px;background:var(--surface-soft);padding:22px;border-radius:8px}
#templateForm textarea{line-height:1.9}.audit{font-size:13px}.audit th{font-size:12px;color:var(--muted)}.audit td{padding:16px 12px}#auditLogs{overflow:auto}
.review-dialog{color:var(--ink)}.annotation-header{background:var(--surface);border-color:var(--line);padding:18px 28px}.annotation-header h2{font-size:21px!important;color:var(--ink-strong)}.annotation-header p{font-size:12px!important;color:var(--muted)}
.annotation-toolbar,.page-controls{background:var(--surface);border-color:var(--line);padding:12px 28px;font-size:12px}.annotation-toolbar button,.page-controls button{font-size:12px;min-height:32px}
.annotation-body.original-view{background:#e9ece7}.annotation-count{color:var(--ink)}.annotation-note{border-color:var(--line);border-radius:8px;box-shadow:none}.annotation-note h4{font-size:14px}.annotation-note p{font-size:13px;line-height:1.8}
.annotation-analysis,.annotation-human{border-color:var(--line);border-radius:8px}.annotation-human label{font-size:13px}.annotation-law{font-size:12px}.annotation-law blockquote{font-size:14px;line-height:1.9}
.app-toast{border:1px solid var(--line);border-radius:10px;font-size:13px;box-shadow:var(--shadow);max-width:min(460px,calc(100vw - 32px))}.toast-icon{flex-shrink:0}
.login{max-width:1020px;min-height:590px;margin:8vh auto;border-radius:14px;box-shadow:var(--shadow)}.login-intro{padding:52px}.login-lead{font-size:32px}.login-fields{padding:52px}.login-fields h2{font-size:26px}.login-fields small{font-size:12px}
@media(min-width:1500px){.workbench-content{padding:38px 48px}.app-header{padding-inline:48px}.contract-table td{padding-block:22px}}
@media(max-width:1100px){.app-sidebar{width:188px;padding-inline:12px}.app-content{margin-left:188px}.app-brand{font-size:15px;gap:8px}.app-brand .brand-mark{width:34px}.nav-item{font-size:13px;padding-inline:12px}.app-header{padding-inline:24px}.workbench-content{padding:26px 24px}.workbench-welcome h2{font-size:24px}.welcome-actions{flex-direction:column}.task-stat{padding:16px}.search-form{grid-template-columns:minmax(180px,1fr) 120px 100px}.search-form button{grid-row:2}.search-form .amount-filter{grid-row:3}.contract-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.app-sidebar{width:auto;position:sticky;inset:0 0 auto;z-index:25;display:block;padding:10px 12px 0;border-right:0;border-bottom:1px solid var(--line)}.app-brand{display:none}.app-sidebar nav{display:flex;gap:6px;margin:0;overflow:auto;justify-content:flex-start;padding-bottom:10px}.nav-item{width:auto;flex:0 0 auto;font-size:12px;min-height:40px;height:auto;padding:8px 12px;gap:6px}.nav-item span{width:16px;font-size:16px}.nav-item svg{width:16px;height:16px}.nav-item.is-current::before{display:none}.sidebar-bottom{display:none}#appPanel{display:block}.app-content{margin-left:0}.app-header{position:relative;height:78px;padding:16px 20px}.app-header h1{font-size:20px}.workbench-content{padding:24px 20px}.workbench-welcome{align-items:flex-start;gap:16px}.workbench-welcome h2{font-size:24px}.workbench-welcome p{font-size:13px;max-width:320px}.primary-action{font-size:13px}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.task-stat:nth-child(2){border-right:0}.task-stat:nth-child(-n+2){border-bottom:1px solid var(--line)}.task-stat{min-height:120px}.stat-skeleton{height:120px}.panel,#workspace{padding:22px}.login{margin:5vh 20px}.login-intro{padding:32px}.login-fields{padding:32px}.login-lead{font-size:26px}.annotation-header{padding-inline:18px}.annotation-toolbar,.page-controls{padding-inline:18px}}
@media(max-width:560px){.app-header{padding-inline:16px}.app-user #identity small{display:none}.app-user #identity strong{font-size:11px;max-width:115px}.app-user>button{font-size:12px;min-height:34px}.workbench-content{padding:20px 14px}.workbench-welcome{display:block;padding-bottom:22px}.workbench-welcome h2{font-size:25px}.workbench-welcome p{max-width:none;margin-bottom:18px}.welcome-actions{flex-direction:row}.welcome-actions button{flex:1;justify-content:center;font-size:13px;min-height:44px}.task-stat{padding:16px 18px}.task-stat>span{font-size:12px}.task-stat small{font-size:11px}.task-stat strong{font-size:29px}.panel,#workspace{padding:18px}.section-heading h2{font-size:18px}.section-heading p{font-size:12px}.library-tabs{gap:22px;overflow:auto}.library-tabs button{font-size:12px}.search-form{grid-template-columns:1fr 1fr;gap:10px}.search-key{grid-column:1/-1}.search-form button{grid-row:auto}.search-form .amount-filter{grid-row:auto}.contract-grid{grid-template-columns:1fr}.contract-tile{padding:20px}.intake-drawer{border-radius:0}.drawer-header{padding:20px}.intake-steps{padding:18px 20px}.intake-steps li{font-size:12px}.intake-form{padding:20px}.drawer-footer{bottom:-20px;margin:24px -20px -20px;padding:16px 20px}.drawer-footer p{font-size:11px}.file-step-actions button{font-size:12px}.file-drop strong{font-size:16px}.intake-form .contract-form{gap:16px}.review-start{padding:18px}#sourceTitle{font-size:22px}#sourceMetadata{font-size:12px}#runLegalReview{flex-wrap:wrap}.review-scope{font-size:12px}.review-run-actions button{font-size:13px}.review-run-progress{font-size:12px}.template-heading h3{font-size:20px}#templateList{grid-template-columns:1fr}#templateForm{padding:16px}.login{display:block;margin:20px 14px;min-height:0}.login-intro{padding:28px}.login-intro .brand-mark,.login-paper,.login-intro>small{display:none}.login h1{margin:6px 0 16px}.login-lead{font-size:24px;margin-bottom:0}.login-fields{padding:28px}.annotation-header h2{font-size:17px!important}.annotation-header p{font-size:11px!important}.annotation-toolbar .annotation-count{font-size:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.file-badge{white-space:nowrap;overflow-wrap:normal}
@media(min-width:561px) and (max-width:800px){.search-form{grid-template-columns:minmax(180px,1fr) 120px 100px}.search-key{grid-column:1/-1}.search-form button{grid-row:auto}.search-form .amount-filter{grid-row:auto}}

.page-note-rail .annotation-note{border-radius:8px;padding:16px}.page-note-rail .annotation-note p{font-size:13px;line-height:1.8}.annotation-locate{font-size:14px}.annotation-law summary{color:var(--brand-dark)}

.app-sidebar nav{scrollbar-width:none}.app-sidebar nav::-webkit-scrollbar{display:none}

/* Explicit per-review cloud consent belongs to the review form. */
#runLegalReview{flex-wrap:wrap}
#runLegalReview .ai-review-option{flex:1 0 100%;display:flex;flex-direction:row;align-items:flex-start;gap:12px;padding:16px;border:1px solid var(--line);border-radius:8px;background:var(--surface-soft);cursor:pointer;box-sizing:border-box;min-width:0}
.ai-review-option input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;margin:3px 0 0;accent-color:var(--brand)}
.ai-review-option span{min-width:0}.ai-review-option strong{display:block;font-size:14px}.ai-review-option small{display:block;margin-top:6px;font-weight:400;line-height:1.7;overflow-wrap:anywhere;color:var(--muted)}
.ai-note-source{font-size:12px!important;color:var(--brand-dark)!important}.finding-guidance p{white-space:pre-wrap}.ai-analysis{border-left:3px solid var(--brand);padding:4px 18px;margin:18px 0}.ai-analysis small{color:var(--muted);overflow-wrap:anywhere}.ai-review-summary{white-space:pre-wrap}
.annotation-locate:hover,.annotation-locate:focus-visible{background:var(--brand-soft);color:var(--ink-strong);box-shadow:none}
