:root{
  --bg:#080b10;--panel:#0e131b;--panel2:#111823;--line:#202936;--text:#e8edf5;--muted:#7f8b9c;
  --accent:#ff6b3d;--accent2:#ff9b54;--green:#39d98a;--red:#ff5d6c;--blue:#54a9ff;--shadow:0 24px 70px rgba(0,0,0,.35);
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;background:
radial-gradient(circle at 80% 0%,rgba(255,107,61,.08),transparent 30%),var(--bg);color:var(--text)}
button,input,select{font:inherit}.hidden{display:none!important}.muted{color:var(--muted)}
.shell{display:flex;min-height:100vh}.sidebar{width:250px;border-right:1px solid var(--line);background:rgba(8,11,16,.92);padding:26px 18px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}
.brand{display:flex;align-items:center;gap:12px;padding:4px 8px 30px}.brand-mark{width:38px;height:38px;border:1px solid #3a4350;background:linear-gradient(135deg,#1b222d,#0e131b);display:grid;place-items:center;font-weight:900;font-size:12px;color:var(--accent)}
.brand-title{font-weight:800;letter-spacing:.2em;font-size:12px}.brand-sub{font-size:8px;letter-spacing:.16em;color:var(--muted);margin-top:3px}
.nav{display:grid;gap:6px}.nav-item{border:0;background:transparent;color:var(--muted);text-align:left;padding:12px 13px;border-radius:8px;cursor:pointer;display:flex;gap:12px;align-items:center}.nav-item:hover{background:#111720;color:var(--text)}.nav-item.active{background:#171d27;color:#fff;box-shadow:inset 2px 0 var(--accent)}.nav-item span{width:18px;text-align:center;color:var(--accent)}
.side-card{margin-top:34px;border:1px solid var(--line);background:#0b1017;padding:14px;border-radius:10px}.eyebrow{font-size:10px;letter-spacing:.16em;color:#7e8998;font-weight:800}.pipeline-row{display:grid;grid-template-columns:9px 1fr auto;gap:8px;align-items:center;margin-top:13px;font-size:11px}.pipeline-row strong{font-size:8px;color:#667383}.dot{width:7px;height:7px;border-radius:50%;background:#39424e}.dot.live{background:var(--green);box-shadow:0 0 12px rgba(57,217,138,.7)}
.side-footer{margin-top:auto;padding:12px 8px;font-size:10px;line-height:1.6}.main{margin-left:250px;width:calc(100% - 250px);padding:34px 42px 60px}.topbar{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:34px}.topbar h1{font-size:30px;letter-spacing:-.03em;margin:8px 0 0}.top-actions{display:flex;align-items:center;gap:10px}.api-pill,.route-badge,.status-badge{border:1px solid var(--line);background:#0c1118;padding:8px 11px;border-radius:999px;font-size:9px;letter-spacing:.12em;font-weight:800;display:flex;align-items:center;gap:7px}.ghost{background:transparent;border:1px solid var(--line);color:var(--muted);padding:9px 12px;border-radius:7px;cursor:pointer}.ghost:hover{color:#fff;border-color:#384352}
.hero-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(320px,.8fr);gap:18px}.panel{border:1px solid var(--line);background:linear-gradient(145deg,rgba(16,22,31,.98),rgba(10,14,20,.98));border-radius:14px;box-shadow:var(--shadow)}
.upload-panel{padding:26px}.panel-head{display:flex;justify-content:space-between;gap:20px}.panel h2,.section-head h2{margin:7px 0 6px;font-size:21px;letter-spacing:-.02em}.panel p,.section-head p{color:var(--muted);font-size:12px;margin:0;line-height:1.6}
.dropzone{margin-top:24px;min-height:285px;border:1px dashed #35404d;border-radius:12px;background:repeating-linear-gradient(135deg,rgba(255,255,255,.015) 0,rgba(255,255,255,.015) 1px,transparent 1px,transparent 8px),#0b1017;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:.2s;position:relative;overflow:hidden}.dropzone.drag{border-color:var(--accent);background:#151118}.drop-icon{width:52px;height:52px;border-radius:50%;border:1px solid #3b4655;display:grid;place-items:center;color:var(--accent);font-size:24px;margin-bottom:14px}.drop-title{font-weight:750}.drop-sub{font-size:10px;color:#657181;margin:7px 0 16px;letter-spacing:.08em}.primary,.analyze-btn{border:0;cursor:pointer;color:#0a0d11;font-weight:850}.primary{background:var(--text);padding:10px 18px;border-radius:7px}.selected-file{position:absolute;left:18px;right:18px;bottom:15px;background:#121923;border:1px solid #283241;border-radius:7px;padding:9px;font-size:11px;text-align:center;color:#cbd3df}
.controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.control{border:1px solid var(--line);padding:12px;border-radius:9px;background:#0c1118}.control label{display:block;color:#667383;font-size:9px;letter-spacing:.12em;text-transform:uppercase;margin-bottom:7px}.control select{width:100%;border:0;outline:0;background:transparent;color:#dbe2eb;font-size:12px}.route-preview{font-size:12px;color:var(--accent2);font-weight:700;padding:1px 0}
.analyze-btn{width:100%;margin-top:14px;padding:14px 16px;border-radius:8px;background:linear-gradient(100deg,var(--accent),#ff8a49);display:flex;justify-content:space-between;align-items:center;box-shadow:0 8px 30px rgba(255,107,61,.16)}.analyze-btn:disabled{opacity:.35;cursor:not-allowed}.progress{margin-top:14px}.progress-bar{height:3px;background:#1a222d;border-radius:99px;overflow:hidden}.progress-bar span{display:block;width:35%;height:100%;background:var(--accent);animation:load 1.2s infinite ease-in-out}.progress-label{font-size:10px;color:var(--muted);margin-top:7px}@keyframes load{0%{transform:translateX(-100%)}100%{transform:translateX(350%)}}
.overview{padding:24px}.logic-card{display:flex;gap:11px;align-items:center;padding:14px 0;border-bottom:1px solid #1b232e}.logic-icon{width:38px;height:30px;border:1px solid #303b49;display:grid;place-items:center;font-size:8px;font-weight:900;color:#aab4c2}.logic-card strong{display:block;font-size:12px}.logic-card span{display:block;font-size:10px;color:var(--muted);margin-top:4px}.logic-card b{color:var(--accent2)}.notice{margin-top:20px;padding:12px;background:#0b1017;border:1px solid #1d2631;border-radius:8px;display:flex;gap:10px}.notice>span{color:var(--blue);border:1px solid #2c4762;width:20px;height:20px;display:grid;place-items:center;border-radius:50%;font-size:10px}.notice strong{font-size:10px}.notice p{font-size:9px;margin-top:3px}
.results-section{margin-top:20px}.section-head{display:flex;justify-content:space-between;align-items:flex-end;margin:28px 0 12px}.status-badge.success{color:var(--green);border-color:#21523c}.status-badge.warn{color:var(--accent2);border-color:#5d3825}.result-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}.result-card{border:1px solid var(--line);background:#0e141d;border-radius:11px;padding:16px}.result-card .tag{font-size:8px;letter-spacing:.13em;color:var(--muted);font-weight:800}.result-card h3{margin:7px 0 12px;font-size:15px}.metric{display:flex;justify-content:space-between;padding:9px 0;border-top:1px solid #1b232e;font-size:11px}.metric span:first-child{color:#738093}.metric span:last-child{font-weight:700}.flag-yes{color:var(--red)}.flag-no{color:var(--green)}.view-btn{margin-top:12px;width:100%;background:#141b25;border:1px solid #293441;color:#dbe2eb;padding:9px;border-radius:7px;cursor:pointer;font-size:10px;font-weight:750}.json{background:#090d13;border:1px solid #1b232e;border-radius:7px;padding:10px;overflow:auto;max-height:250px;font-size:9px;color:#9fb0c5}
.history-list{display:grid;gap:9px}.history-item{border:1px solid var(--line);background:#0e141d;border-radius:10px;padding:14px;display:grid;grid-template-columns:1fr auto auto;gap:18px;align-items:center}.history-name{font-weight:700;font-size:12px}.history-meta{font-size:9px;color:var(--muted);margin-top:5px}.history-type{font-size:8px;letter-spacing:.12em;color:var(--accent2);border:1px solid #4a3125;padding:6px 8px;border-radius:99px}.history-open{background:#151c26;border:1px solid #293441;color:#dbe2eb;border-radius:6px;padding:7px 10px;font-size:9px;cursor:pointer}
.drawer{position:fixed;inset:0;z-index:20}.drawer-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.68);backdrop-filter:blur(4px)}.drawer-panel{position:absolute;right:0;top:0;bottom:0;width:min(620px,92vw);background:#0b1017;border-left:1px solid #293441;padding:24px;overflow:auto;box-shadow:-20px 0 70px rgba(0,0,0,.45)}.drawer-head{display:flex;justify-content:space-between;gap:20px;margin-bottom:18px}.drawer-head h2{margin:7px 0}.icon-btn{width:32px;height:32px;border:1px solid #2b3542;background:#111822;color:#dce3ec;border-radius:7px;font-size:20px;cursor:pointer}.kv{display:grid;grid-template-columns:160px 1fr;border-top:1px solid #1b232e;padding:9px 0;font-size:10px}.kv b{color:#718095}.timeline{border-left:1px solid #2c3745;margin:15px 0 20px;padding-left:16px}.timeline-item{position:relative;margin-bottom:14px;font-size:10px}.timeline-item:before{content:"";position:absolute;left:-21px;top:2px;width:8px;height:8px;border-radius:50%;background:var(--accent)}.timeline-item b{display:block}.timeline-item span{color:var(--muted)}
@media(max-width:1000px){.sidebar{width:210px}.main{margin-left:210px;width:calc(100% - 210px);padding:25px}.hero-grid{grid-template-columns:1fr}.topbar{flex-direction:column}.controls{grid-template-columns:1fr}}
@media(max-width:680px){.sidebar{position:static;width:100%;height:auto}.shell{display:block}.main{margin:0;width:100%;padding:18px}.nav{display:flex}.side-card,.side-footer{display:none}.hero-grid{display:block}.overview{margin-top:14px}.history-item{grid-template-columns:1fr}.top-actions{flex-wrap:wrap}.dropzone{min-height:240px}}

/* Evidence and result previews */
.evidence-preview{margin-top:14px;border:1px solid #242e3a;border-radius:11px;background:#090e15;overflow:hidden}
.preview-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid #1c2530}
.preview-head strong{display:block;font-size:11px;margin-top:4px;max-width:520px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.preview-type,.file-chip{font-size:8px;letter-spacing:.12em;font-weight:850;border:1px solid #354252;color:#9ba8b8;border-radius:99px;padding:5px 7px}
.preview-stage{height:380px;display:grid;place-items:center;background:#070b10;overflow:hidden}
.preview-frame{width:100%;height:100%;border:0;background:#fff}
.preview-image{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;display:block}
.preview-foot{padding:9px 14px;border-top:1px solid #1c2530;color:#657181;font-size:9px}
.preview-unavailable{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;color:#788698;padding:25px}
.preview-unavailable span{font-size:8px;letter-spacing:.16em;color:var(--accent)}
.preview-unavailable strong{font-size:11px;color:#cbd3de}.preview-unavailable small{font-size:9px;color:#657181;max-width:320px;line-height:1.5}
.result-card.analysis-card{grid-column:span 2}
.result-files{margin-top:13px;border-top:1px solid #1b232e;padding-top:12px}
.result-files-title{display:flex;justify-content:space-between;align-items:center;color:#718095;font-size:8px;letter-spacing:.13em;font-weight:850;margin-bottom:8px}
.result-files-title b{color:var(--accent2);font-size:9px}
.result-file-preview{border:1px solid #222d39;border-radius:8px;background:#080d13;overflow:hidden;margin-top:8px}
.result-file-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 9px;border-bottom:1px solid #1b2530}
.result-file-head>div{display:flex;align-items:center;gap:8px;min-width:0}.result-file-head strong{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-btn{border:1px solid #2a3542;background:#111822;color:#b8c2cf;border-radius:5px;padding:5px 7px;font-size:7px;font-weight:800;letter-spacing:.08em;cursor:pointer;flex:none}.mini-btn:hover{border-color:#485566;color:#fff}
.result-preview-frame{display:block;width:100%;height:300px;border:0;background:#fff}.result-preview-image{display:block;width:100%;height:300px;object-fit:contain;background:#070b10}.result-file-preview.compact .result-preview-frame{height:260px}.result-file-preview.compact .result-preview-image{height:260px}
.file-preview-modal{position:fixed;inset:0;z-index:40}.file-preview-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.78);backdrop-filter:blur(6px)}
.file-preview-panel{position:absolute;inset:4vh 5vw;background:#0b1017;border:1px solid #2b3643;border-radius:13px;box-shadow:0 30px 100px rgba(0,0,0,.65);padding:18px;display:flex;flex-direction:column}
.file-preview-panel .drawer-head{margin-bottom:12px}.file-preview-panel h2{font-size:16px;margin:7px 0;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-preview-body{flex:1;min-height:0;border:1px solid #202a35;border-radius:9px;overflow:hidden;background:#060a0f;display:grid;place-items:center}.modal-preview-frame{width:100%;height:100%;border:0;background:#fff}.modal-preview-image{max-width:100%;max-height:100%;object-fit:contain}
@media(max-width:1100px){.result-card.analysis-card{grid-column:span 1}}
@media(max-width:680px){.preview-stage{height:300px}.result-preview-frame,.result-preview-image{height:240px}.file-preview-panel{inset:2vh 2vw;padding:12px}.file-preview-panel h2{max-width:65vw}}

/* Gemini forensic intelligence layer */
.ai-toggle{margin-top:12px;padding:13px 14px;border:1px solid #2b3441;border-radius:9px;background:linear-gradient(120deg,#101721,#0d121a);display:flex;justify-content:space-between;align-items:center;gap:15px}.ai-toggle-copy{display:flex;align-items:center;gap:11px;min-width:0}.ai-toggle-copy>div:last-child{min-width:0}.ai-toggle-copy strong{display:block;font-size:11px}.ai-toggle-copy span{display:block;color:#687688;font-size:9px;line-height:1.45;margin-top:4px;max-width:600px}.ai-mark{width:28px;height:28px;display:grid;place-items:center;border-radius:7px;border:1px solid #49525e;color:#f1f4f7;font-weight:900;font-size:13px;flex:none;background:#161c25}.switch{position:relative;width:42px;height:22px;display:block;flex:none}.switch input{opacity:0;width:0;height:0}.switch span{position:absolute;inset:0;border:1px solid #34404e;border-radius:99px;background:#101720;cursor:pointer;transition:.2s}.switch span:before{content:"";position:absolute;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background:#657181;transition:.2s}.switch input:checked+span{border-color:#6b7684;background:#1b232e}.switch input:checked+span:before{transform:translateX(19px);background:#f1f4f7}.ai-notice{border-color:#303844}.ai-notice>span{color:#e8edf4;border-color:#3d4754}
.gemini-section{margin-top:18px}.ai-panel{border:1px solid #2a3542;background:linear-gradient(145deg,#0e151f,#0a0f16);border-radius:13px;padding:18px;box-shadow:0 15px 45px rgba(0,0,0,.18)}.ai-panel-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.ai-panel-head h2{margin:7px 0 3px;font-size:17px}.ai-panel-head p{margin:0;color:#6f7c8d;font-size:10px}.ai-brand{display:flex;align-items:center;gap:8px;font-size:9px;color:#aeb8c5;letter-spacing:.08em;text-transform:uppercase}.ai-brand .ai-mark{width:30px;height:30px}.ai-state{font-size:8px;letter-spacing:.1em;border:1px solid #394553;border-radius:99px;padding:6px 8px;color:#9ca9b9}.ai-message{margin:20px 0;color:#9ba8b8;font-size:11px;line-height:1.6}.ai-config{display:flex;justify-content:space-between;padding:8px 0;border-top:1px solid #1c2530;font-size:9px}.ai-config span{color:#697687}.ai-config b{color:#d5dce5}.ai-top-grid{display:grid;grid-template-columns:minmax(0,2fr) 170px 170px;gap:10px;margin-top:18px}.ai-verdict,.score-card{border:1px solid #222d39;background:#0a1017;border-radius:9px;padding:13px}.ai-label,.score-card>span{font-size:8px;letter-spacing:.13em;color:#718095;font-weight:850}.ai-verdict strong{display:block;font-size:17px;margin:7px 0;color:#dfe5ec}.ai-verdict p{font-size:10px;color:#8794a5;line-height:1.55;margin:0}.score-card>strong{font-size:30px;display:inline-block;margin-top:7px}.score-card>small{color:#647184;font-size:9px;margin-left:3px}.risk-low{color:var(--green)}.risk-medium{color:var(--accent2)}.risk-high{color:var(--red)}.score-track{height:3px;background:#1c2530;border-radius:99px;margin-top:11px;overflow:hidden}.score-track i{display:block;height:100%;background:var(--accent);border-radius:99px}.score-track.confidence i{background:#91a0b2}.ai-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.ai-columns>div,.ai-bottom-grid>div{border:1px solid #202a35;border-radius:9px;background:#090f16;padding:13px}.ai-subhead{font-size:8px;letter-spacing:.13em;color:#718095;font-weight:850;margin-bottom:8px;display:flex;justify-content:space-between}.ai-subhead b{color:#aeb8c5}.factor{padding:10px 0;border-top:1px solid #1a232d}.factor-line{display:flex;align-items:center;justify-content:space-between;gap:8px}.factor-line strong{font-size:10px}.factor-status{font-size:7px;letter-spacing:.08em;padding:4px 6px;border:1px solid #33404e;border-radius:99px}.factor-status.anomaly{color:var(--red);border-color:#5a2d2d}.factor-status.normal{color:var(--green);border-color:#27503d}.factor-status.not_determinable{color:#8794a5}.factor-finding{font-size:10px;color:#b5bfcc;line-height:1.45;margin-top:6px}.factor-evidence{font-size:9px;color:#6f7d8e;line-height:1.45;margin-top:4px}.anomaly{border-top:1px solid #1a232d;padding:10px 0}.anomaly>div{display:flex;align-items:center;gap:7px}.anomaly strong{font-size:10px}.anomaly>b{display:block;color:#788698;font-size:8px;margin-top:5px}.anomaly p{font-size:10px;line-height:1.45;color:#b7c1cd;margin:5px 0}.anomaly small{display:block;font-size:9px;color:#6e7b8b;line-height:1.4}.severity{font-size:7px;letter-spacing:.08em;padding:4px 6px;border-radius:99px;border:1px solid #37424f}.severity.high{color:var(--red);border-color:#5b2e2e}.severity.medium{color:var(--accent2);border-color:#594027}.severity.low{color:#8fa0b4}.ai-bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.ai-profile{margin:0;background:#070c12;border:1px solid #18212b;border-radius:7px;padding:10px;max-height:180px;overflow:auto;color:#9eacbc;font-size:9px}.ai-list{margin:0;padding-left:18px;color:#9da9b8;font-size:10px;line-height:1.65}.ai-list li{margin-bottom:4px}.empty-ai{font-size:10px;color:#626f80;padding:12px 0}.ai-limitations{margin-top:12px;padding:11px 12px;border:1px solid #2c3540;border-radius:8px;background:#0a0f15}.ai-limitations strong{font-size:8px;letter-spacing:.12em;color:#788596}.ai-limitations ul{margin:7px 0 0;padding-left:18px;color:#778495;font-size:9px;line-height:1.55}.ai-footer{display:flex;justify-content:space-between;gap:15px;margin-top:13px;padding-top:10px;border-top:1px solid #1b242e;color:#596777;font-size:8px}.ai-ok{border-color:#2b463a}.ai-muted{border-color:#303946}.ai-error{border-color:#573133}.ai-error .ai-state{color:#ff8a83;border-color:#573133}
@media(max-width:900px){.ai-top-grid{grid-template-columns:1fr 1fr}.ai-verdict{grid-column:span 2}.ai-columns,.ai-bottom-grid{grid-template-columns:1fr}}@media(max-width:680px){.ai-toggle{align-items:flex-start}.ai-top-grid{grid-template-columns:1fr}.ai-verdict{grid-column:span 1}.ai-footer{flex-direction:column}.ai-panel-head{flex-direction:column}}

/* Document comparison workspace */
.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.compare-upload-card{padding:14px}.compare-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.compare-card-head h3{margin:6px 0 0;font-size:13px}.compare-number{width:34px;height:34px;border:1px solid #34404d;border-radius:8px;display:grid;place-items:center;color:#aeb9c7;font-size:9px;font-weight:900;letter-spacing:.08em}.compare-dropzone{min-height:150px;border:1px dashed #34404e;border-radius:9px;background:#090f16;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;transition:.2s}.compare-dropzone.drag{border-color:var(--accent);background:#11171e}.compare-dropzone strong{font-size:11px}.compare-dropzone>span{font-size:9px;color:#697688}.compare-dropzone .ghost{margin-top:4px}.compare-file{margin-top:10px;padding:9px 10px;border:1px solid #202b37;border-radius:7px;background:#080d13;display:flex;justify-content:space-between;gap:10px;align-items:center}.compare-file strong{font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compare-file span{font-size:8px;color:#667486;flex:none}.compare-preview{margin-top:10px;height:270px;border:1px solid #202a35;border-radius:8px;overflow:hidden;background:#060a0f;display:grid;place-items:center}.compare-preview-frame{width:100%;height:100%;border:0;background:#fff}.compare-preview-image{max-width:100%;max-height:100%;object-fit:contain}.compare-action-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:14px}.compare-method{display:flex;align-items:center;gap:10px;border:1px solid #222d39;background:#0a1017;border-radius:9px;padding:10px 12px;flex:1}.compare-method strong{display:block;font-size:10px}.compare-method small{display:block;font-size:8px;color:#687688;margin-top:3px}.compare-btn{max-width:360px}.compare-results{margin-top:18px}.compare-result-panel{border:1px solid #2a3542;background:linear-gradient(145deg,#0e151f,#0a0f16);border-radius:13px;padding:18px;box-shadow:0 15px 45px rgba(0,0,0,.18)}.compare-result-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.compare-result-head h2{margin:7px 0 3px;font-size:19px}.compare-result-head p{margin:0;color:#778596;font-size:9px;word-break:break-word}.compare-result-head p span{color:#485565;padding:0 5px}.duplicate-score{min-width:180px;text-align:right}.duplicate-score span{display:block;font-size:8px;letter-spacing:.13em;color:#718095;font-weight:850}.duplicate-score strong{display:block;font-size:42px;line-height:1.05;margin-top:5px}.duplicate-score small{font-size:8px;color:#657181}.similar-mid{color:#d0a15a}.compare-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:18px}.compare-metrics>div{border:1px solid #222d39;background:#0a1017;border-radius:9px;padding:12px}.compare-metrics span{display:block;font-size:8px;letter-spacing:.12em;color:#718095;font-weight:850}.compare-metrics strong{display:block;font-size:19px;margin-top:7px;color:#dbe2ea}.compare-metrics small{display:block;color:#687688;font-size:8px;margin-top:4px}.compare-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.compare-columns>div{border:1px solid #202a35;border-radius:9px;background:#090f16;padding:13px}.compare-profile{margin:0;background:#070c12;border:1px solid #18212b;border-radius:7px;padding:10px;max-height:180px;overflow:auto;color:#9eacbc;font-size:9px;line-height:1.5}.compare-detail-list>div{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-top:1px solid #1a232d;color:#788698;font-size:9px}.compare-detail-list>div:first-child{border-top:0}.compare-detail-list b{color:#c5ced9;text-align:right}.compare-differences{margin-top:12px;border:1px solid #202a35;border-radius:9px;background:#090f16;padding:13px}.compare-disclaimer{margin-top:12px;padding:10px 12px;border:1px solid #2c3540;border-radius:8px;background:#0a0f15;color:#697687;font-size:9px;line-height:1.5}.history-vs{color:#8a97a8;font-weight:500;font-size:9px}.status-badge{white-space:nowrap}
@media(max-width:900px){.compare-grid,.compare-columns{grid-template-columns:1fr}.compare-metrics{grid-template-columns:1fr 1fr}.compare-action-row{flex-direction:column;align-items:stretch}.compare-btn{max-width:none}.duplicate-score{text-align:left;min-width:0}.compare-result-head{flex-direction:column}}
@media(max-width:680px){.compare-metrics{grid-template-columns:1fr}.compare-preview{height:220px}.compare-file{align-items:flex-start;flex-direction:column}}

.text-diff-panel,.visual-diff-panel{margin-top:12px;border:1px solid #202a35;border-radius:9px;background:#090f16;padding:13px}.diff-legend{display:flex;flex-wrap:wrap;gap:12px;margin:8px 0 12px;color:#718095;font-size:8px}.diff-legend span{display:inline-flex;align-items:center;gap:5px}.diff-swatch{width:10px;height:10px;border-radius:2px;display:inline-block;border:1px solid #35404d}.diff-same{background:#111923}.diff-removed{background:#5b252b}.diff-added{background:#214d39}.diff-changed{background:#5a4a1d}.text-diff-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.text-diff-grid>div{border:1px solid #1c2630;border-radius:8px;overflow:hidden;background:#070c12}.diff-doc-title{padding:8px 10px;border-bottom:1px solid #1c2630;color:#8b99aa;font-size:8px;font-weight:900;letter-spacing:.1em}.text-diff-content{padding:11px;line-height:1.75;font-size:10px;min-height:80px;max-height:340px;overflow:auto;color:#c7d0da;word-break:break-word}.diff-token{padding:2px 3px;border-radius:3px}.diff-token.diff-removed{background:rgba(174,55,66,.28);color:#ff9aa4;text-decoration:line-through}.diff-token.diff-added{background:rgba(44,137,91,.28);color:#8de0b5}.diff-token.diff-changed{background:rgba(191,146,47,.28);color:#f0d58a}.diff-token.diff-same{color:#c7d0da}.diff-note{margin-top:8px;color:#657181;font-size:8px}.visual-diff-card{margin-top:10px;border:1px solid #1c2630;border-radius:8px;overflow:hidden;background:#060a0f}.visual-diff-card img{display:block;width:100%;max-height:760px;object-fit:contain;background:#fff}.ai-config{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid #1b2530;color:#7a8797;font-size:9px}.ai-config b{color:#cbd4df}.ai-mark{min-width:28px;height:28px;padding:0 5px;border:1px solid #3a4653;border-radius:7px;display:grid;place-items:center;color:#d9e0e8;font-size:8px;font-weight:900;letter-spacing:.04em}
@media(max-width:900px){.text-diff-grid{grid-template-columns:1fr}}


/* =========================================================
   FORENSICS CONSOLE — CLEAN LIGHT THEME
   Theme layer intentionally placed last.
   ========================================================= */

:root{
  --bg:#f3f6fa;
  --panel:#ffffff;
  --panel2:#f8fafc;
  --line:#dce3eb;
  --text:#172033;
  --muted:#64748b;
  --accent:#f45f38;
  --accent2:#b86a08;
  --green:#16845d;
  --red:#c9364b;
  --blue:#246da8;
  --shadow:0 10px 30px rgba(15,23,42,.07);
}

html,body{
  background:#f3f6fa !important;
  color:#172033 !important;
}
body{
  background:linear-gradient(180deg,#f8fafc 0%,#eef3f8 100%) !important;
}

/* Sidebar */
.sidebar{
  background:#fff !important;
  border-right:1px solid #dce3eb !important;
  box-shadow:5px 0 22px rgba(15,23,42,.045) !important;
}
.brand-mark{
  background:#f8fafc !important;
  border-color:#d4dde7 !important;
}
.brand-title{color:#172033 !important}
.brand-sub{color:#8995a5 !important}
.nav-item{
  background:transparent !important;
  color:#64748b !important;
}
.nav-item:hover{
  background:#f5f7fa !important;
  color:#172033 !important;
}
.nav-item.active{
  background:#fff1eb !important;
  color:#172033 !important;
  box-shadow:inset 3px 0 #f45f38 !important;
}
.side-card{
  background:#f8fafc !important;
  border-color:#dce3eb !important;
}
.pipeline-row{color:#334155 !important}
.pipeline-row strong{color:#7b8797 !important}
.side-footer{color:#64748b !important}

/* Header */
.topbar h1{color:#142033 !important}
.api-pill,.route-badge,.status-badge{
  background:#fff !important;
  color:#526176 !important;
  border-color:#dce3eb !important;
}
.ghost{
  background:#fff !important;
  color:#526176 !important;
  border-color:#d6dee7 !important;
}
.ghost:hover{
  background:#f7f9fb !important;
  color:#172033 !important;
}

/* Main panels */
.panel{
  background:#fff !important;
  border-color:#dce3eb !important;
  box-shadow:0 10px 30px rgba(15,23,42,.07) !important;
}
.panel h2,.section-head h2{color:#172033 !important}
.panel p,.section-head p{color:#64748b !important}

/* Upload */
.dropzone{
  background:#f8fafc !important;
  border-color:#cbd5e1 !important;
}
.dropzone.drag{
  background:#fff4ef !important;
}
.drop-icon{
  background:#fff !important;
  border-color:#cbd5e1 !important;
}
.drop-title{color:#172033 !important}
.drop-sub{color:#7b8797 !important}
.primary{
  background:#172536 !important;
  color:#fff !important;
}
.selected-file{
  background:#fff !important;
  border-color:#dce3eb !important;
  color:#475569 !important;
}
.control{
  background:#f8fafc !important;
  border-color:#dce3eb !important;
}
.control label{color:#718096 !important}
.control select{color:#263548 !important}
.route-preview{color:#b85b0a !important}
.analyze-btn{
  background:linear-gradient(100deg,#f45f38,#ff8a4b) !important;
  color:#fff !important;
}
.progress-bar{background:#e5eaf0 !important}
.progress-label{color:#64748b !important}

/* System logic */
.logic-card{border-bottom-color:#e5eaf0 !important}
.logic-icon{
  background:#f8fafc !important;
  border-color:#d1dae4 !important;
  color:#536275 !important;
}
.logic-card strong{color:#172033 !important}
.logic-card span{color:#64748b !important}
.logic-card b{color:#b85b0a !important}
.notice{
  background:#f8fafc !important;
  border-color:#dfe6ed !important;
}
.notice>span{
  background:#fff !important;
  border-color:#c9d8e7 !important;
}
.notice strong{color:#263548 !important}
.notice p{color:#64748b !important}

/* Results */
.result-card{
  background:#fff !important;
  border-color:#dce3eb !important;
}
.result-card .tag{color:#7b8797 !important}
.result-card h3{color:#1c2a3a !important}
.metric{border-top-color:#e5eaf0 !important}
.metric span:first-child{color:#758294 !important}
.metric span:last-child{color:#334155 !important}
.json{
  background:#f5f7fa !important;
  border-color:#dce3ea !important;
  color:#475569 !important;
}
.view-btn{
  background:#f6f8fa !important;
  border-color:#d5dee7 !important;
  color:#425166 !important;
}
.history-item{
  background:#fff !important;
  border-color:#dce3eb !important;
}
.history-name{color:#172033 !important}
.history-meta{color:#64748b !important}
.history-type{
  background:#fff7f1 !important;
  border-color:#efd6c8 !important;
  color:#b65b14 !important;
}
.history-open{
  background:#f6f8fa !important;
  border-color:#d5dee7 !important;
  color:#425166 !important;
}

/* Previews */
.evidence-preview{
  background:#f8fafc !important;
  border-color:#dce3eb !important;
}
.preview-head,.result-file-head{
  border-bottom-color:#e1e7ed !important;
}
.preview-type,.file-chip{
  background:#fff !important;
  border-color:#d2dbe5 !important;
  color:#637185 !important;
}
.preview-stage{
  background:#eef2f6 !important;
}
.preview-foot{
  border-top-color:#e1e7ed !important;
  color:#64748b !important;
}
.preview-unavailable{color:#718092 !important}
.preview-unavailable strong{color:#354256 !important}
.preview-unavailable small{color:#718092 !important}
.result-files{border-top-color:#e1e7ed !important}
.result-files-title{color:#718092 !important}
.result-file-preview{
  background:#f8fafc !important;
  border-color:#dce4ec !important;
}
.result-file-head strong{color:#263548 !important}
.mini-btn{
  background:#fff !important;
  border-color:#d0dae5 !important;
  color:#526176 !important;
}
.result-preview-image{background:#eef2f6 !important}

/* Drawers / modal */
.drawer-backdrop{background:rgba(15,23,42,.30) !important}
.drawer-panel{
  background:#fff !important;
  border-left-color:#d8e1ea !important;
  box-shadow:-20px 0 60px rgba(15,23,42,.16) !important;
}
.icon-btn{
  background:#f6f8fa !important;
  border-color:#d5dee7 !important;
  color:#39495d !important;
}
.kv{border-top-color:#e4e9ef !important}
.kv b{color:#718092 !important}
.timeline{border-left-color:#d5dde6 !important}
.file-preview-backdrop{background:rgba(15,23,42,.40) !important}
.file-preview-panel{
  background:#fff !important;
  border-color:#d7e0e8 !important;
}
.file-preview-body{
  background:#eef2f6 !important;
  border-color:#dce4ec !important;
}

/* AI analysis */
.ai-toggle{
  background:#fff !important;
  border-color:#dbe3eb !important;
}
.ai-toggle-copy strong{color:#172033 !important}
.ai-toggle-copy span{color:#718092 !important}
.ai-mark{
  background:#f1f4f7 !important;
  border-color:#cdd6e0 !important;
  color:#273649 !important;
}
.switch span{
  background:#e9eef3 !important;
  border-color:#c8d2dd !important;
}
.switch span:before{background:#8997a7 !important}
.ai-panel{
  background:#fff !important;
  border-color:#dce4ec !important;
  box-shadow:0 10px 30px rgba(15,23,42,.07) !important;
}
.ai-panel-head h2{color:#172033 !important}
.ai-panel-head p,.ai-message{color:#718092 !important}
.ai-brand{color:#59687b !important}
.ai-state{
  background:#f8fafc !important;
  border-color:#d1dbe5 !important;
  color:#637184 !important;
}
.ai-config{border-top-color:#e1e7ed !important}
.ai-config span{color:#718092 !important}
.ai-config b{color:#334257 !important}
.ai-verdict,.score-card{
  background:#f8fafc !important;
  border-color:#dce4eb !important;
}
.ai-label,.score-card>span{color:#718095 !important}
.ai-verdict strong{color:#233247 !important}
.ai-verdict p{color:#6e7b8c !important}
.score-track{background:#dfe6ed !important}
.ai-columns>div,.ai-bottom-grid>div{
  background:#f8fafc !important;
  border-color:#dce4eb !important;
}
.ai-subhead{color:#718095 !important}
.ai-subhead b{color:#536275 !important}
.factor,.anomaly{border-top-color:#e1e7ed !important}
.factor-line strong,.anomaly strong{color:#172033 !important}
.factor-finding,.anomaly p{color:#526176 !important}
.factor-evidence,.anomaly small{color:#718092 !important}
.ai-profile{
  background:#f3f6f9 !important;
  border-color:#dbe3ea !important;
  color:#56667b !important;
}
.ai-list{color:#59697c !important}
.empty-ai{color:#7b8796 !important}
.ai-limitations{
  background:#f6f8fa !important;
  border-color:#d9e1e9 !important;
}
.ai-limitations strong{color:#68778a !important}
.ai-limitations ul{color:#6f7d8e !important}
.ai-footer{
  border-top-color:#e0e6ec !important;
  color:#748193 !important;
}

/* Comparison */
.compare-number{
  background:#f8fafc !important;
  border-color:#d1dae4 !important;
  color:#607084 !important;
}
.compare-dropzone{
  background:#f8fafc !important;
  border-color:#cbd6e1 !important;
}
.compare-dropzone.drag{background:#fff4ef !important}
.compare-dropzone strong{color:#172033 !important}
.compare-dropzone>span{color:#697688 !important}
.compare-file{
  background:#f7f9fb !important;
  border-color:#dce4eb !important;
}
.compare-file strong{color:#172033 !important}
.compare-file span{color:#667486 !important}
.compare-preview{
  background:#eef2f6 !important;
  border-color:#d9e2eb !important;
}
.compare-method{
  background:#f7f9fb !important;
  border-color:#dce4eb !important;
}
.compare-method strong{color:#172033 !important}
.compare-method small{color:#687688 !important}
.compare-result-panel{
  background:#fff !important;
  border-color:#d9e2ea !important;
  box-shadow:0 10px 30px rgba(15,23,42,.07) !important;
}
.compare-result-head h2{color:#172033 !important}
.compare-result-head p{color:#758294 !important}
.duplicate-score strong{color:#172033 !important}
.compare-metrics>div{
  background:#f7f9fb !important;
  border-color:#dce4eb !important;
}
.compare-metrics span{color:#718095 !important}
.compare-metrics strong{color:#253449 !important}
.compare-metrics small{color:#687688 !important}
.compare-columns>div{
  background:#f8fafc !important;
  border-color:#dce4eb !important;
}
.compare-profile{
  background:#f2f5f8 !important;
  border-color:#dbe3ea !important;
  color:#56667b !important;
}
.compare-detail-list>div{
  border-top-color:#e2e7ed !important;
  color:#788698 !important;
}
.compare-detail-list b{color:#334358 !important}
.compare-differences{
  background:#f8fafc !important;
  border-color:#dce4eb !important;
}
.compare-disclaimer{
  background:#f4f7fa !important;
  border-color:#d9e1e8 !important;
  color:#718092 !important;
}

/* Difference viewer */
.text-diff-panel,.visual-diff-panel{
  background:#f8fafc !important;
  border-color:#dce4eb !important;
}
.diff-legend{color:#718095 !important}
.diff-swatch{border-color:#cbd5df !important}
.diff-same{background:#e9eef3 !important}
.diff-removed{background:#f8dfe2 !important}
.diff-added{background:#dff2e8 !important}
.diff-changed{background:#f5e9c8 !important}
.text-diff-grid>div{
  background:#fff !important;
  border-color:#dce4eb !important;
}
.diff-doc-title{
  background:#f8fafc !important;
  border-bottom-color:#e0e6ec !important;
  color:#718092 !important;
}
.text-diff-content{color:#39495d !important}
.diff-token.diff-removed{
  background:rgba(201,54,75,.12) !important;
  color:#b72f3e !important;
}
.diff-token.diff-added{
  background:rgba(22,132,93,.12) !important;
  color:#11764f !important;
}
.diff-token.diff-changed{
  background:rgba(184,106,8,.13) !important;
  color:#9a5c06 !important;
}
.diff-token.diff-same{color:#39495d !important}
.diff-note{color:#657181 !important}
.visual-diff-card{
  background:#eef2f6 !important;
  border-color:#dce4eb !important;
}

/* Login */
.login-screen{
  background:linear-gradient(135deg,#f8fafc 0%,#edf3f9 55%,#f8fafc 100%) !important;
}
.login-card{
  background:rgba(255,255,255,.97) !important;
  border-color:#dce4ec !important;
}
.login-title,.login-card h1{color:#172536 !important}
.login-copy,.login-note{color:#6f7d8f !important}
.login-form label{color:#637186 !important}
.login-form input{
  background:#f9fbfd !important;
  border-color:#d5dee7 !important;
  color:#1e2c3f !important;
}
.login-note{border-top-color:#e5eaf0 !important}
.login-mark{background:#172536 !important;color:#fff !important}

/* Force embedded PDF/image preview surfaces to remain neutral */
.preview-frame,
.result-preview-frame,
.compare-preview-frame,
.modal-preview-frame{
  background:#fff !important;
}

/* Remove the dark palette from accidental generic containers */
.panel,
.side-card,
.result-card,
.history-item,
.compare-upload-card,
.compare-result-panel,
.ai-panel,
.evidence-preview,
.result-file-preview{
  color:#172033 !important;
}



/* =========================================================
   RESPONSIVE
   ========================================================= */
@media(max-width:1000px){
  .sidebar{width:210px}
  .main{margin-left:210px;width:calc(100% - 210px);padding:25px}
  .hero-grid{grid-template-columns:1fr}
  .topbar{flex-direction:column}
  .controls{grid-template-columns:1fr}
}
@media(max-width:900px){
  .ai-top-grid{grid-template-columns:1fr 1fr}
  .ai-verdict{grid-column:span 2}
  .ai-columns,.ai-bottom-grid{grid-template-columns:1fr}
  .compare-grid,.compare-columns{grid-template-columns:1fr}
  .compare-metrics{grid-template-columns:1fr 1fr}
  .compare-action-row{flex-direction:column;align-items:stretch}
  .compare-btn{max-width:none}
  .duplicate-score{text-align:left;min-width:0}
  .compare-result-head{flex-direction:column}
  .text-diff-grid{grid-template-columns:1fr}
}
@media(max-width:680px){
  .sidebar{position:static;width:100%;height:auto}
  .shell{display:block}
  .main{margin:0;width:100%;padding:18px}
  .nav{display:flex;overflow:auto}
  .side-card,.side-footer{display:none}
  .hero-grid{display:block}
  .overview{margin-top:14px}
  .history-item{grid-template-columns:1fr}
  .top-actions{flex-wrap:wrap}
  .dropzone{min-height:240px}
  .preview-stage{height:300px}
  .result-preview-frame,.result-preview-image{height:240px}
  .file-preview-panel{inset:2vh 2vw;padding:12px}
  .file-preview-panel h2{max-width:65vw}
  .ai-toggle{align-items:flex-start}
  .ai-top-grid{grid-template-columns:1fr}
  .ai-verdict{grid-column:span 1}
  .ai-footer{flex-direction:column}
  .ai-panel-head{flex-direction:column}
  .compare-metrics{grid-template-columns:1fr}
  .compare-preview{height:220px}
  .compare-file{align-items:flex-start;flex-direction:column}
  .login-card{padding:26px}
  .login-brand{margin-bottom:26px}
}



/* =========================================================
   FINAL LOGIN / AUTH VISIBILITY FIX
   ========================================================= */

/* When the demo login is active, the dashboard must be completely removed
   from layout. This is the class toggled by static/app.js. */
.app-locked{
  display:none !important;
}

/* Login must be a full-screen layer, not normal document content. */
.login-screen{
  position:fixed !important;
  inset:0 !important;
  z-index:9999 !important;
  width:100vw !important;
  min-height:100vh !important;
  display:grid !important;
  place-items:center !important;
  overflow:hidden !important;
  padding:24px !important;
  background:
    radial-gradient(circle at 82% 12%,rgba(244,95,56,.08),transparent 30%),
    radial-gradient(circle at 8% 88%,rgba(36,109,168,.05),transparent 28%),
    linear-gradient(135deg,#f8fafc 0%,#eef3f8 52%,#f8fafc 100%) !important;
}

/* Hidden is deliberately stronger than the login display rule above. */
.login-screen.hidden{
  display:none !important;
}

.login-screen::before{
  content:"";
  position:absolute;
  width:720px;
  height:720px;
  border:1px solid rgba(244,95,56,.07);
  border-radius:50%;
  right:-300px;
  top:-340px;
  pointer-events:none;
}

.login-screen::after{
  content:"";
  position:absolute;
  width:520px;
  height:520px;
  border:1px solid rgba(36,109,168,.06);
  border-radius:50%;
  left:-270px;
  bottom:-280px;
  pointer-events:none;
}

.login-card{
  position:relative !important;
  z-index:2 !important;
  width:min(440px,100%) !important;
  padding:34px !important;
  border:1px solid #d9e2eb !important;
  border-radius:18px !important;
  background:rgba(255,255,255,.98) !important;
  box-shadow:0 28px 80px rgba(23,37,54,.14) !important;
}

.login-brand{
  display:flex !important;
  align-items:center !important;
  gap:12px !important;
  margin-bottom:30px !important;
}

.login-mark{
  width:44px !important;
  height:44px !important;
  border-radius:10px !important;
  display:grid !important;
  place-items:center !important;
  background:#172536 !important;
  color:#fff !important;
  font-weight:900 !important;
  font-size:12px !important;
  flex:none !important;
}

.login-title{
  color:#172536 !important;
  font-weight:900 !important;
  letter-spacing:.18em !important;
  font-size:12px !important;
}

.login-subtitle{
  color:#8793a2 !important;
  font-size:8px !important;
  letter-spacing:.14em !important;
  margin-top:4px !important;
}

.login-card h1{
  margin:0 0 8px !important;
  color:#172536 !important;
  font-size:28px !important;
  line-height:1.15 !important;
  letter-spacing:-.035em !important;
}

.login-copy{
  margin:0 0 24px !important;
  color:#68778a !important;
  font-size:12px !important;
  line-height:1.6 !important;
}

.login-form{
  display:grid !important;
  gap:14px !important;
}

.login-form label{
  display:block !important;
  color:#5f6f82 !important;
  font-size:9px !important;
  line-height:1.2 !important;
  letter-spacing:.12em !important;
  font-weight:850 !important;
  text-transform:uppercase !important;
}

.login-form input{
  display:block !important;
  width:100% !important;
  height:43px !important;
  margin-top:7px !important;
  padding:0 12px !important;
  border:1px solid #d3dde7 !important;
  border-radius:8px !important;
  background:#f9fbfd !important;
  color:#1e2c3f !important;
  outline:none !important;
}

.login-form input:focus{
  border-color:#a9b6c5 !important;
  box-shadow:0 0 0 3px rgba(244,95,56,.08) !important;
}

.login-btn{
  width:100% !important;
  height:44px !important;
  border:0 !important;
  border-radius:8px !important;
  padding:0 15px !important;
  background:linear-gradient(100deg,#f45f38,#ff8a4b) !important;
  color:#fff !important;
  font-weight:900 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  cursor:pointer !important;
  box-shadow:0 9px 22px rgba(244,95,56,.17) !important;
}

.login-btn:hover{
  background:linear-gradient(100deg,#e9512b,#f8793e) !important;
}

.login-error{
  padding:9px 10px !important;
  border:1px solid #efc7cd !important;
  border-radius:7px !important;
  background:#fff4f5 !important;
  color:#b72f3e !important;
  font-size:9px !important;
}

.login-note{
  margin-top:18px !important;
  padding-top:14px !important;
  border-top:1px solid #e5eaf0 !important;
  color:#7a8797 !important;
  font-size:9px !important;
  line-height:1.55 !important;
}

.login-note span{
  color:#b85b16 !important;
  font-weight:900 !important;
  letter-spacing:.1em !important;
}

@media(max-width:520px){
  .login-screen{
    padding:16px !important;
  }
  .login-card{
    padding:25px !important;
    border-radius:14px !important;
  }
  .login-card h1{
    font-size:24px !important;
  }
}
