/* Demo page – extends styles.css */
.h3{font-size:1.18rem}
.sr{position:absolute;left:-9999px}
.demo-notices{display:grid;gap:10px;margin-top:22px;max-width:860px}
section.demo{padding-top:40px}
.demo-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:22px;align-items:start}
.dropzone{border:2px dashed #9DB8DA;border-radius:14px;background:var(--bg-soft);padding:26px 20px;text-align:center;cursor:pointer;transition:.15s}
.dropzone:hover,.dropzone:focus,.dropzone.over{border-color:var(--blue);background:var(--bg-blue);outline:none}
.dropzone svg{width:38px;height:38px;stroke:var(--blue);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dropzone p{margin:.3em 0}
.dropzone input{position:absolute;left:-9999px}
.linkish{color:var(--blue);font-weight:620;cursor:pointer;text-decoration:underline}
.filechip{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:12px;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:.93rem}
.filechip span{min-width:0;overflow-wrap:anywhere}
.demo-grid>*{min-width:0}
.filechip button{font:inherit;border:0;background:none;color:var(--muted);cursor:pointer;font-size:1.1rem}
.field{display:block;margin-top:16px;font-weight:620;font-size:.9rem;color:var(--navy)}
.field select{display:block;width:100%;margin-top:6px;font:inherit;font-weight:400;font-size:.93rem;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink)}
button.btn{cursor:pointer;font-family:inherit}
button.btn[disabled]{opacity:.5;cursor:not-allowed;transform:none}
.status{margin-top:14px;font-size:.94rem;min-height:1.5em}
.status.err{color:var(--crit);font-weight:560}
.status .spin,.typing .spin{display:inline-block;width:14px;height:14px;border:2px solid #B9CBE2;border-top-color:var(--blue);border-radius:50%;animation:sp 0.8s linear infinite;vertical-align:-2px;margin-right:8px}
@keyframes sp{to{transform:rotate(360deg)}}
.samples{list-style:none;margin:0;padding:0}
.samples li{display:flex;gap:8px;align-items:stretch;border-top:1px solid var(--line);padding:8px 0}
.samples li:first-child{border-top:0}
.samples button{flex:1;text-align:left;font:inherit;font-size:.93rem;background:#fff;border:1px solid var(--line);border-radius:10px;padding:9px 12px;cursor:pointer;color:var(--navy)}
.samples button:hover{border-color:var(--blue);background:var(--bg-blue)}
.samples button b{display:inline-block;min-width:26px;color:var(--blue)}
.samples button span{display:block;font-size:.8rem;color:var(--muted);margin-left:26px}
.samples a{align-self:center;font-size:.85rem;font-weight:600}
.results{margin-top:44px}
.mockbanner{background:#FFF4EC;border:1px solid #F3C9A8;border-radius:10px;padding:10px 14px;margin-bottom:18px;font-size:.93rem}
.summary{margin-bottom:18px}
.summary .top{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-bottom:10px}
.summary .rating{font-size:1rem;padding:6px 14px}
.summary .counts{display:flex;gap:8px;flex-wrap:wrap}
.summary .counts span{font-size:.85rem;font-weight:620;border:1px solid var(--line);border-radius:999px;padding:3px 10px;background:var(--bg-soft)}
.summary .meta{font-size:.85rem;color:var(--muted);margin:8px 0 0}
.findings td{font-size:.9rem}
.findings td:first-child{min-width:190px}
.findings td.src{min-width:170px}
.findings td:last-child{min-width:260px}
.findings .sev small{display:block;color:var(--muted);font-size:.75rem;margin-top:3px}
.findings .src a{white-space:nowrap}
.findings .src small{display:block;color:var(--muted);font-size:.78rem}
.st-met{color:var(--ok);font-weight:650}.st-missing{color:var(--crit);font-weight:650}.st-unclear{color:#8A6D00;font-weight:650}
.p-none{background:#9AA5B5}
.howrated{margin:18px 0;font-size:.93rem;background:var(--bg-soft);border:1px solid var(--line);border-radius:12px;padding:12px 16px}
.howrated summary{cursor:pointer;font-weight:650;color:var(--navy)}
.howrated ul{margin:10px 0 0;padding-left:1.2em}
.sources{font-size:.88rem}
.sources h3{font-size:1rem;margin-top:10px}
.sources ol{padding-left:1.4em}
.sources li{margin:6px 0}
.sources li:target{background:var(--bg-blue);border-radius:6px}
.sources .snip{display:block;color:var(--muted);font-size:.83rem}
.chat{margin-top:40px}
.msgs{display:flex;flex-direction:column;gap:12px;margin:12px 0}
.msg{max-width:88%;padding:12px 16px;border-radius:12px;font-size:.95rem}
.msg.user{align-self:flex-end;background:var(--blue);color:#fff}
.msg.bot{align-self:flex-start;background:var(--bg-soft);border:1px solid var(--line)}
.msg.err{background:#FDECEA;border-color:#F4C7C3;color:var(--crit)}
.msg p:last-child,.msg ul:last-child{margin-bottom:0}
.msg .ai{display:block;margin-top:8px;font-size:.78rem;color:var(--muted)}
.msg ol.srcs{font-size:.83rem;margin:8px 0 0;padding-left:1.3em;color:#33405A}
.askform textarea{width:100%;font:inherit;font-size:.95rem;padding:10px 12px;border:1px solid var(--line);border-radius:10px;resize:vertical}
.askrow{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:10px;flex-wrap:wrap}
.chk{font-size:.9rem;color:#33405A}
@media (max-width:860px){ .demo-grid{grid-template-columns:1fr} .msg{max-width:100%} .findings td:last-child{min-width:220px} }

/* ---- results header + export ---- */
.print-head{display:none}
.results-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.results-head h2{margin:0}
.export-bar{display:flex;flex-wrap:wrap;gap:8px}
.export-bar .btn,.viewer-head .btn{padding:9px 14px;font-size:.88rem;display:inline-flex;align-items:center;gap:7px}
.export-bar svg,.viewer-head svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn .spin{display:inline-block;width:13px;height:13px;border:2px solid #B9CBE2;border-top-color:var(--blue);border-radius:50%;animation:sp .8s linear infinite}
.genote{font-size:.8rem;color:var(--muted);margin:14px 0 0}

/* ---- findings numbers + evidence ---- */
.findings td.num,.findings th.num{min-width:0;width:46px;text-align:center}
.findings td:first-child.num{min-width:0}
.findings td.num + td{min-width:190px}
.nb{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 5px;border-radius:999px;font-size:.74rem;font-weight:750;line-height:1;color:#1B2433;background:#E7ECF3;border:1px solid rgba(0,0,0,.12);box-sizing:border-box}
.nb-crit{background:#F04A3B;color:#fff}.nb-major{background:#F7962A;color:#1B2433}.nb-minor{background:#FFDB1A;color:#1B2433}.nb-obs{background:#8AA8D6;color:#fff}.nb-met{background:#4DB86B;color:#fff}
.findings .loc{display:block;font-size:.7rem;color:var(--muted);margin-top:4px;white-space:nowrap}
.findings .loc.no{color:#8A6D00}
.findings tr.frow{cursor:pointer}
.findings tr.frow:hover td{background:#F6F9FD}
.findings .ev{display:block;margin-top:6px;font-size:.82rem;color:#33405A;font-style:italic;border-left:3px solid var(--line);padding-left:8px}
.findings .ev.none{color:var(--muted)}
.findings tr.flash td{animation:fl 1.6s ease-out}
@keyframes fl{0%,40%{background:#FFF3B0}100%{background:transparent}}

/* ---- document viewer ---- */
.viewer{margin:22px 0;padding:20px}
.viewer-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;flex-wrap:wrap}
.viewer-head h3{margin:0 0 4px;font-size:1.12rem}
.viewer-head p{margin:0;max-width:720px}
.viewer-tools{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px 18px;align-items:center;margin:14px 0 6px;font-size:.85rem}
.legend{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;color:#33405A}
.legend i{display:inline-block;width:18px;height:11px;border-radius:3px;margin-left:6px;vertical-align:-1px}
.legend i:first-child{margin-left:0}
.hl-crit{--hl:rgba(240,74,59,.36);--hb:#D8372A}.hl-major{--hl:rgba(250,150,40,.38);--hb:#E07E10}.hl-minor{--hl:rgba(255,220,26,.5);--hb:#C9A800}.hl-obs{--hl:rgba(120,160,220,.35);--hb:#5F84C0}.hl-met{--hl:rgba(77,184,107,.32);--hb:#2F9A52}
.legend i{background:var(--hl);border:1px solid var(--hb)}
.notfound{margin:12px 0;padding:12px 16px;border:1px solid #F3C9A8;background:#FFF8F2;border-radius:12px}
.notfound h4{margin:4px 0 2px;font-size:.95rem;color:var(--navy)}
.notfound p{margin:0 0 6px}
.notfound ul{list-style:none;margin:0 0 6px;padding:0}
.notfound li{display:flex;gap:9px;align-items:flex-start;padding:5px 6px;border-radius:8px;cursor:pointer;font-size:.9rem}
.notfound li:hover,.notfound li:focus{background:#FDEBDD;outline:none}
.notfound li small{color:var(--muted);white-space:nowrap}
.notfound li.flash{animation:fl 1.6s ease-out}
.pv{margin-top:10px}
.pv-row{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px;margin:0 0 22px;align-items:start}
.pv-page{position:relative;width:100%;background:#fff;box-shadow:0 1px 3px rgba(11,31,58,.18),0 6px 18px rgba(11,31,58,.08);border:1px solid var(--line)}
.pv-page canvas{display:block;width:100%;height:100%}
.pv-layer{position:absolute;inset:0}
.pv-pno{position:absolute;right:8px;bottom:-20px;font-size:.72rem;color:var(--muted)}
.pv-hl{position:absolute;background:var(--hl);border-bottom:2px solid var(--hb);mix-blend-mode:multiply;cursor:pointer;border-radius:2px}
.pv-hl:hover,.pv-hl:focus{outline:2px solid var(--hb);outline-offset:1px;background:var(--hl)}
.pv-hl.flash,.pv-note.flash{animation:pulse 1.4s ease-out 2}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(10,102,194,.55)}100%{box-shadow:0 0 0 10px rgba(10,102,194,0)}}
.pv-mk{position:absolute;transform:translate(-115%,-20%);cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.25);z-index:2}
.pv-notes{position:relative}
.pv-note{position:absolute;left:0;right:0;background:#fff;border:1px solid var(--line);border-left:4px solid var(--hb,#9AA5B5);border-radius:10px;padding:8px 11px;font-size:.8rem;line-height:1.45;box-shadow:0 2px 8px rgba(11,31,58,.08);cursor:pointer}
.pv-note.n-crit{--hb:#D8372A}.pv-note.n-major{--hb:#E07E10}.pv-note.n-minor{--hb:#C9A800}.pv-note.n-obs{--hb:#5F84C0}.pv-note.n-met{--hb:#2F9A52}
.pv-note .nh{display:flex;flex-wrap:wrap;align-items:center;gap:5px;color:#33405A}
.pv-note .nh b{color:var(--navy)}
.pv-note p{margin:4px 0}
.pv-note .nt{font-weight:620;color:var(--navy)}
.pv-note .linkish{font:inherit;font-size:.78rem;background:none;border:0;padding:0}
.pv-tip{position:absolute;z-index:60;background:var(--navy);color:#fff;border-radius:10px;padding:10px 12px;font-size:.8rem;line-height:1.45;box-shadow:0 8px 24px rgba(11,31,58,.3);pointer-events:none}
.pv-tip span{color:#CFE0F5}
.pv-tip p{margin:5px 0 0;color:#E8EEF6}
.viewer.nolayer .pv-row{grid-template-columns:minmax(0,1fr)}
.tv-row{grid-template-columns:minmax(0,1fr) 280px}
.tv{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8rem;line-height:1.55;background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px;white-space:pre-wrap;word-break:break-word;max-height:900px;overflow:auto}
.tv mark.pv-hl{position:static;color:inherit;padding:1px 0}
.tv .tv-mk{height:18px;min-width:18px;font-size:.66rem;margin-right:3px;vertical-align:1px}
.pv-notes.static .pv-note{position:static;margin-bottom:10px}
@media (max-width:860px){
 .results-head{align-items:flex-start}
 .export-bar{width:100%}
 .export-bar .btn{flex:1 1 auto;justify-content:center}
 .viewer{padding:14px}
 .pv-row,.tv-row{grid-template-columns:minmax(0,1fr);gap:10px}
 .pv-note{position:static;margin-bottom:8px}
 .pv-notes{min-height:0!important}
 .pv-row{margin-bottom:30px}
 .pv-mk{transform:translate(-50%,-70%);width:15px;height:15px;min-width:15px;font-size:.58rem;opacity:.92;padding:0}
}

/* ---- print: a clean A4 report ---- */
@page{size:A4;margin:14mm 12mm 16mm}
@media print{
 html,body{background:#fff!important;font-size:10.5pt}
 *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .site-header,.site-footer,.hero,.page-hero,.demo-grid,.chat,.export-bar,.howrated,.viewer,.pv-tip,.skip,.demo-notices{display:none!important}
 section.demo{padding:0!important}
 .wrap{max-width:none!important;padding:0!important}
 .results{margin:0!important;display:block!important}
 .print-head{display:flex!important;justify-content:space-between;align-items:center;border-bottom:2px solid var(--navy);padding-bottom:8px;margin-bottom:12px}
 .print-head img{height:30px;width:auto}
 .print-head span{font-weight:700;color:var(--navy);font-size:13pt}
 .results-head{margin-bottom:6px}
 .results-head h2{font-size:15pt}
 .mockbanner{border:1px solid #F3C9A8;margin-bottom:8px}
 .card{box-shadow:none!important;border:1px solid var(--line)}
 .summary{padding:12px 14px;break-inside:avoid}
 .table-wrap{overflow:visible!important;box-shadow:none!important;border:0}
 .table-wrap table{min-width:0!important}
 .findings table{font-size:8.5pt}
 .findings th,.findings td{padding:5px 6px}
 .findings td{font-size:8.5pt}
 .findings td:first-child,.findings td.num + td,.findings td.src,.findings td:last-child{min-width:0!important}
 .findings thead{display:table-header-group}
 .findings tr{break-inside:avoid;page-break-inside:avoid}
 .findings tr.frow{cursor:auto}
 .findings .src a{color:inherit;text-decoration:none}
 .sources{break-before:auto;font-size:8.5pt}
 .sources .snip{display:none}
 .genote{display:block!important;border-top:1px solid var(--line);padding-top:6px;font-size:8pt}
 a[href]:after{content:none!important}
}
