/* QCI DocAI — styles for the on-device AI layer. Uses the prototype's tokens. */
:root{ --scan:#16a34a; --scan-glow:rgba(22,163,74,.35); --ai:#6d4ae0; --ai-soft:#efeafd; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){ --ai:#a78bfa; --ai-soft:#251d3d; } }
:root[data-theme="dark"]{ --ai:#a78bfa; --ai-soft:#251d3d; }

/* ---------- smart scan ---------- */
#uploadModal.scan-mode{ width:min(1120px,96vw); }
.scan{ display:grid; grid-template-columns:minmax(0,1.45fr) minmax(260px,1fr); gap:16px; }
@media (max-width:820px){ .scan{ grid-template-columns:1fr; } }
.scan-view{ position:relative; background:repeating-linear-gradient(45deg,var(--surface-2),var(--surface-2) 10px,var(--bg) 10px,var(--bg) 20px); border:1px solid var(--line); border-radius:12px; min-height:340px; display:flex; align-items:center; justify-content:center; padding:14px; overflow:hidden; }
.scan-stage{ width:100%; display:flex; justify-content:center; max-height:470px; overflow:auto; }
.scan-wait{ display:flex; gap:10px; align-items:center; color:var(--text-gray); font-size:13px; padding:40px; }
.scan-wait.err{ color:var(--low-fg); }
.scan-doc{ position:relative; display:inline-block; line-height:0; box-shadow:0 6px 24px rgba(0,0,0,.18); border-radius:4px; overflow:hidden; background:#fff; }
.scan-doc img{ display:block; max-width:100%; max-height:440px; }
.scan-boxes{ position:absolute; inset:0; pointer-events:none; }
.scan-boxes i{ position:absolute; display:block; border-radius:2px; }
.scan-boxes i.ln{ border:1px solid rgba(55,145,229,.55); background:rgba(55,145,229,.07); animation:pop .25s ease-out both; }
.scan-boxes i.hit{ border:2px solid var(--high-fg); background:rgba(27,127,59,.16); box-shadow:0 0 0 3px rgba(27,127,59,.15); animation:hit .45s cubic-bezier(.2,.9,.3,1.3) both; }
.scan-boxes i.hit.medium{ border-color:var(--med-fg); background:rgba(166,99,0,.15); box-shadow:0 0 0 3px rgba(166,99,0,.14); }
.scan-boxes i.hit.low{ border-color:var(--low-fg); background:rgba(192,57,47,.14); box-shadow:0 0 0 3px rgba(192,57,47,.14); }
.scan-boxes i em{ position:absolute; left:-2px; bottom:100%; margin-bottom:2px; font:700 10.5px/1.25 "Nunito Sans",sans-serif; font-style:normal; color:#fff; background:var(--high-fg); padding:1px 5px; border-radius:4px; white-space:nowrap; max-width:220px; overflow:hidden; text-overflow:ellipsis; }
.scan-boxes i.medium em{ background:var(--med-fg); } .scan-boxes i.low em{ background:var(--low-fg); }
@keyframes pop{ from{ opacity:0; transform:scale(.96); } to{ opacity:1; transform:none; } }
@keyframes hit{ from{ opacity:0; transform:scale(1.25); } to{ opacity:1; transform:none; } }
.scan-beam{ position:absolute; left:0; right:0; top:0; height:60px; background:linear-gradient(180deg,transparent,var(--scan-glow) 70%,var(--scan) 72%,transparent 74%); animation:beam 1.6s ease-in-out infinite alternate; pointer-events:none; }
.scan-beam.stop{ animation:none; opacity:0; transition:opacity .3s; }
@keyframes beam{ from{ transform:translateY(-60px); } to{ transform:translateY(440px); } }
.scan-type{ position:absolute; top:10px; left:10px; display:inline-flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--high-bd); color:var(--high-fg); border-radius:20px; padding:5px 12px 5px 8px; font-size:12.5px; font-weight:800; box-shadow:var(--shadow); animation:pop .3s both; }
.scan-type b{ background:var(--high-bg); border-radius:10px; padding:0 6px; }
.scan-type.bad{ color:var(--med-fg); border-color:var(--med-bd); } .scan-type.bad b{ background:var(--med-bg); }
.scan-type .ms{ font-size:17px; }
.scan-sheet{ position:relative; background:var(--surface); border:1px solid var(--line); border-radius:8px; overflow:auto; max-height:440px; width:100%; font-size:12px; }
.scan-sheet .cap{ display:flex; gap:6px; align-items:center; padding:8px 10px; font-weight:800; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--surface); z-index:1; }
.scan-sheet .cap .ms{ font-size:17px; color:var(--green); }
.scan-sheet table{ border-collapse:collapse; width:100%; }
.scan-sheet td{ border:1px solid var(--line); padding:4px 7px; white-space:nowrap; max-width:260px; overflow:hidden; text-overflow:ellipsis; }
.scan-sheet tr.h td{ background:var(--surface-2); font-weight:800; }
.scan-sheet tr.seen td{ background:rgba(55,145,229,.05); }
.scan-sheet tr.hit td{ background:var(--high-bg); }
.scan-sheet tr.hit.medium td{ background:var(--med-bg); } .scan-sheet tr.hit.low td{ background:var(--low-bg); }
.scan-sheet tr.hit td:first-child{ box-shadow:inset 3px 0 0 var(--high-fg); }
.scan-sheet.dv{ max-height:none; margin-bottom:12px; }
.scan-text{ position:relative; background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:12px 14px; font-size:12.5px; line-height:1.55; width:100%; max-height:440px; overflow:auto; }
.scan-text .hl-line{ background:var(--high-bg); }
.scan-side{ display:flex; flex-direction:column; min-width:0; }
.scan-file{ display:flex; gap:10px; align-items:center; padding:2px 0 10px; border-bottom:1px solid var(--line); }
.scan-file > .ms{ width:36px; height:36px; border-radius:9px; background:var(--blue-soft); color:var(--blue); display:flex; align-items:center; justify-content:center; }
.scan-file .nm{ font-weight:800; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:300px; }
.scan-file .st{ font-size:12px; color:var(--text-gray); }
.scan-steps{ list-style:none; margin:10px 0; padding:0; font-size:12.8px; }
.scan-steps li{ display:flex; align-items:center; gap:8px; padding:5px 0; color:var(--text-gray); }
.scan-steps li .dot{ width:14px; height:14px; border-radius:50%; border:2px solid var(--track); flex:0 0 auto; }
.scan-steps li .r{ margin-left:auto; font-size:11.5px; font-weight:700; }
.scan-steps li.on{ color:var(--text); font-weight:700; } .scan-steps li.on .dot{ border-color:var(--blue); border-top-color:transparent; animation:sp .8s linear infinite; }
.scan-steps li.done{ color:var(--text-mid); } .scan-steps li.done .dot{ border-color:var(--high-fg); background:var(--high-fg); box-shadow:inset 0 0 0 2px var(--surface); }
.scan-steps li.done .r{ color:var(--high-fg); }
.scan-found-h{ display:flex; justify-content:space-between; font-size:12px; font-weight:800; color:var(--text-gray); text-transform:uppercase; letter-spacing:.04em; padding-top:8px; border-top:1px solid var(--line); }
.scan-found-h #scCount{ background:var(--blue-soft); color:var(--blue); border-radius:10px; padding:0 8px; }
.scan-found{ flex:1; overflow-y:auto; max-height:250px; margin-top:6px; }
.sf{ display:flex; gap:8px; justify-content:space-between; font-size:12.3px; padding:5px 8px; border-radius:7px; border-left:3px solid var(--high-fg); background:var(--surface-2); margin-bottom:4px; animation:pop .25s both; }
.sf.medium{ border-left-color:var(--med-fg); } .sf.low{ border-left-color:var(--low-fg); }
.sf .k{ color:var(--text-gray); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:48%; }
.sf .v{ font-weight:700; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sf.more,.sf.none{ border-left-color:var(--line); color:var(--text-gray); justify-content:center; }
.scan-strip{ display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.scan-chip{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); border-radius:18px; padding:4px 10px 4px 6px; font-size:12px; color:var(--text-gray); max-width:260px; }
.scan-chip .ms{ font-size:16px; } .scan-chip .t{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:130px; font-weight:700; }
.scan-chip .s{ font-size:11px; }
.scan-chip.on{ border-color:var(--blue); color:var(--blue); background:var(--blue-soft); }
.scan-chip.ok{ border-color:var(--high-bd); color:var(--high-fg); } .scan-chip.err{ border-color:var(--low-bd); color:var(--low-fg); }
.scan-note{ display:flex; gap:6px; align-items:center; font-size:12px; color:var(--text-gray); margin:10px 0 0; } .scan-note .ms{ font-size:15px; color:var(--high-fg); }
.scan-hub{ position:relative; width:100%; min-height:300px; display:flex; flex-wrap:wrap; gap:10px; align-content:center; justify-content:center; padding:20px; }
.scan-hub .node{ display:inline-flex; gap:6px; align-items:center; background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:6px 12px; font-size:12px; font-weight:700; box-shadow:0 2px 8px rgba(0,0,0,.06); animation:pulse 1.4s ease-in-out infinite; }
.scan-hub .node:nth-child(2n){ animation-delay:.3s; } .scan-hub .node:nth-child(3n){ animation-delay:.6s; }
.scan-hub .node .ms{ font-size:16px; color:var(--blue); }
.scan-hub .core{ flex-basis:100%; display:flex; justify-content:center; order:-1; margin-bottom:8px; }
.scan-hub .core .ms{ font-size:40px; color:var(--ai); animation:sp 3s linear infinite; }
@keyframes pulse{ 50%{ border-color:var(--blue); box-shadow:0 0 0 4px var(--blue-soft); } }
.eng-status{ display:inline-flex; align-items:center; gap:6px; margin-top:8px; font-size:12px; font-weight:700; border-radius:12px; padding:2px 10px 2px 6px; }
.eng-status .ms{ font-size:15px; } .eng-status .spin{ width:12px; height:12px; }
.eng-status.ok{ background:var(--high-bg); color:var(--high-fg); } .eng-status.busy{ background:var(--surface-2); color:var(--text-gray); } .eng-status.err{ background:var(--low-bg); color:var(--low-fg); }
#statGrid .stat .sub{ font-size:11px; color:var(--text-gray); margin-top:3px; line-height:1.35; opacity:.85; }
.done-checks{ display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; background:var(--ai-soft); color:var(--text); border-radius:10px; padding:7px 10px; margin-right:6px; cursor:pointer; }
.done-checks .ms{ color:var(--ai); font-size:18px; } .done-checks .lnk{ color:var(--ai); font-weight:800; }

/* ---------- field: ask AI button, score badge, insight card ---------- */
.label-row .ai-ask{ margin-left:auto; } .label-row .ai-ask + .guide-btn{ margin-left:0; }
.ai-ask{ border:none; background:var(--ai-soft); color:var(--ai); width:26px; height:24px; border-radius:7px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; padding:0; }
.ai-ask .ms{ font-size:16px; } .ai-ask:hover{ filter:brightness(.95); outline:1px solid var(--ai); }
.field.ai-low .form-control{ border-color:var(--low-bd); }
.src-pop{ min-width:min(420px,92vw); }
.ins-head{ display:flex; align-items:center; gap:6px; margin-bottom:6px; } .ins-head .ms{ color:var(--ai); font-size:18px; } .ins-head .conf-badge{ margin-left:auto; cursor:default; }
.ins-val{ font-size:15px; font-weight:800; margin:2px 0 8px; word-break:break-word; }
.ins-agree{ font-weight:700; color:var(--high-fg); background:var(--high-bg); border-radius:8px; padding:0 6px; margin-left:4px; }
.src-pop .quote mark{ background:rgba(250,204,21,.45); color:inherit; border-radius:2px; padding:0 1px; font-style:normal; font-weight:700; }
.ins-reason{ margin:0 0 8px; color:var(--text-mid); font-size:12.5px; }
.ins-sub{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--text-gray); margin:10px 0 5px; }
.ins-bars .bar{ display:grid; grid-template-columns:150px 1fr 28px; align-items:center; gap:8px; font-size:12px; color:var(--text-mid); margin-bottom:3px; }
.ins-bars i{ height:6px; background:var(--track); border-radius:4px; overflow:hidden; } .ins-bars b{ display:block; height:100%; border-radius:4px; background:var(--high-fg); transition:width .5s; }
.ins-bars b.m{ background:var(--med-fg); } .ins-bars b.l{ background:var(--low-fg); } .ins-bars em{ font-style:normal; font-weight:800; text-align:right; }
.ins-docs{ display:flex; flex-wrap:wrap; gap:5px; }
.ins-doc{ display:inline-flex; gap:4px; align-items:center; border:1px solid var(--high-bd); background:var(--high-bg); color:var(--high-fg); border-radius:14px; font:700 11.5px "Nunito Sans",sans-serif; padding:2px 9px 2px 5px; cursor:pointer; }
.ins-doc .ms{ font-size:14px; }
.ins-alt{ display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:12.5px; background:var(--med-bg); border:1px solid var(--med-bd); border-radius:8px; padding:5px 8px; margin-bottom:4px; }
.src-pop .chk{ margin-bottom:4px; }

/* inline AI checks under a field */
.ai-chk{ display:flex; flex-direction:column; gap:4px; margin-top:6px; }
.chk{ display:flex; align-items:center; gap:6px; width:100%; text-align:left; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); color:var(--text-mid); font:600 12.3px/1.35 "Nunito Sans",sans-serif; padding:5px 8px; cursor:pointer; }
.chk .ms{ font-size:16px; flex:0 0 auto; }
.chk.error{ background:var(--low-bg); border-color:var(--low-bd); color:var(--low-fg); }
.chk.warn{ background:var(--med-bg); border-color:var(--med-bd); color:var(--med-fg); }
.chk.info{ background:var(--user-bg); border-color:var(--user-bd); color:var(--user-fg); }
.chk.ok{ background:var(--high-bg); border-color:var(--high-bd); color:var(--high-fg); }
.chk.sug{ background:var(--ai-soft); border-color:transparent; color:var(--text); cursor:default; } .chk.sug .ms{ color:var(--ai); } .chk.sug .btn-ghost{ margin-left:auto; color:var(--ai); font-weight:800; }
.chk .pr{ margin-left:auto; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; opacity:.8; }
.row-flags{ display:flex; flex-direction:column; gap:3px; margin-top:8px; }
.rf{ display:flex; gap:5px; align-items:flex-start; font-size:12px; border-radius:6px; padding:3px 7px; }
.rf .ms{ font-size:15px; } .rf.src{ color:var(--text-gray); padding-left:0; }
.rf.warn{ background:var(--med-bg); color:var(--med-fg); } .rf.error{ background:var(--low-bg); color:var(--low-fg); } .rf.info{ background:var(--user-bg); color:var(--user-fg); }
.ck-btn .cnt{ margin-left:4px; background:var(--high-bg); color:var(--high-fg); border-radius:10px; padding:0 6px; font-size:11.5px; font-weight:900; }
.ck-btn.has .cnt{ background:var(--med-bg); color:var(--med-fg); }

/* ---------- AI checks panel ---------- */
.ck-sheet{ width:min(520px,100vw); }
.ck-head{ display:flex; gap:14px; align-items:center; margin-bottom:12px; }
.ck-ring{ --p:0; width:74px; height:74px; border-radius:50%; flex:0 0 auto; background:conic-gradient(var(--ai) calc(var(--p)*1%), var(--track) 0); display:flex; align-items:center; justify-content:center; }
.ck-ring > div{ width:58px; height:58px; border-radius:50%; background:var(--surface); display:flex; align-items:baseline; justify-content:center; padding-top:16px; }
.ck-ring b{ font-size:21px; } .ck-ring span{ font-size:11px; color:var(--text-gray); }
.ck-sum .t{ font-weight:900; font-size:15px; } .ck-sum .s{ font-size:12.5px; color:var(--text-gray); }
.ck-counts{ display:flex; gap:5px; flex-wrap:wrap; margin-top:6px; }
.ck-counts .c{ font-size:11.5px; font-weight:800; border-radius:10px; padding:1px 8px; }
.ck-counts .error{ background:var(--low-bg); color:var(--low-fg); } .ck-counts .warn{ background:var(--med-bg); color:var(--med-fg); } .ck-counts .info{ background:var(--user-bg); color:var(--user-fg); } .ck-counts .ok{ background:var(--high-bg); color:var(--high-fg); }
.ck-item{ border:1px solid var(--line); border-left:4px solid var(--line); border-radius:10px; padding:10px 12px; margin:8px 0; background:var(--surface); }
.ck-item.error{ border-left-color:var(--low-fg); } .ck-item.warn{ border-left-color:var(--med-fg); } .ck-item.info{ border-left-color:var(--user-fg); } .ck-item.ok{ border-left-color:var(--high-fg); }
.ck-item.focus{ box-shadow:0 0 0 3px var(--ai-soft); border-color:var(--ai); }
.ck-t{ display:flex; gap:8px; } .ck-t > .ms{ font-size:19px; }
.ck-item.error .ck-t > .ms{ color:var(--low-fg); } .ck-item.warn .ck-t > .ms{ color:var(--med-fg); } .ck-item.info .ck-t > .ms{ color:var(--user-fg); } .ck-item.ok .ck-t > .ms{ color:var(--high-fg); }
.ck-t .tt{ font-weight:800; font-size:13.5px; } .ck-t .dd{ font-size:12.8px; color:var(--text-mid); margin-top:2px; line-height:1.45; }
.ck-why,.ck-fix{ display:flex; gap:6px; font-size:12.3px; margin-top:8px; padding:6px 8px; border-radius:8px; }
.ck-why{ background:var(--ai-soft); } .ck-why .ms{ color:var(--ai); font-size:16px; }
.ck-fix{ background:var(--surface-2); } .ck-fix .ms{ color:var(--blue); font-size:16px; }
.ck-foot{ display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:8px; }
.ck-rule{ display:inline-flex; gap:4px; align-items:flex-start; font-size:11.5px; color:var(--text-gray); } .ck-rule .ms{ font-size:14px; }
.ck-foot .link{ display:inline-flex; align-items:center; white-space:nowrap; font-size:12.5px; } .ck-foot .link .ms{ font-size:16px; }
.ck-footnote{ font-size:11.5px; color:var(--text-gray); margin-top:14px; }
.peer{ margin-top:10px; padding:8px 10px 18px; border:1px dashed var(--line); border-radius:8px; }
.peer-top{ display:flex; justify-content:space-between; gap:6px; font-size:11.8px; color:var(--text-mid); font-weight:700; }
.peer-top .tag{ font-size:10px; text-transform:uppercase; letter-spacing:.05em; background:var(--surface-2); border:1px solid var(--line); border-radius:6px; padding:0 5px; color:var(--text-gray); white-space:nowrap; }
.peer-bar{ position:relative; height:8px; background:var(--track); border-radius:5px; margin-top:22px; }
.peer-bar .band{ position:absolute; top:0; bottom:0; background:var(--high-bd); border-radius:5px; }
.peer-bar .mk{ position:absolute; top:-5px; width:3px; height:18px; background:var(--high-fg); border-radius:2px; transform:translateX(-1px); }
.peer-bar .mk.out{ background:var(--med-fg); }
.peer-bar .mk b{ position:absolute; bottom:100%; left:50%; transform:translateX(-50%); font-size:11px; white-space:nowrap; margin-bottom:1px; }
.peer-scale{ position:relative; height:12px; font-size:10.5px; color:var(--text-gray); } .peer-scale span{ position:absolute; top:3px; transform:translateX(-50%); }

/* ---------- review modal ---------- */
#reviewModal{ width:min(820px,96vw); }
.rv-call{ display:flex; gap:12px; border-radius:12px; padding:14px; background:var(--high-bg); border:1px solid var(--high-bd); }
.rv-call.medium{ background:var(--med-bg); border-color:var(--med-bd); } .rv-call.low{ background:var(--low-bg); border-color:var(--low-bd); }
.rv-call > .ms{ font-size:28px; color:var(--high-fg); } .rv-call.medium > .ms{ color:var(--med-fg); } .rv-call.low > .ms{ color:var(--low-fg); }
.rv-call .k{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--text-gray); }
.rv-call .v{ font-size:19px; font-weight:900; } .rv-call p{ margin:6px 0 0; line-height:1.5; font-size:13.3px; }
.rv-meta{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; } .rv-meta span{ display:inline-flex; gap:4px; align-items:center; font-size:11.8px; font-weight:700; background:var(--surface); border-radius:10px; padding:2px 8px; } .rv-meta .ms{ font-size:14px; }
.rv-h{ margin:18px 0 8px; font-size:13.5px; }
.rv-tbl{ width:100%; border-collapse:collapse; font-size:12.8px; } .rv-tbl th{ text-align:left; color:var(--text-gray); font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; padding:6px 8px; border-bottom:1px solid var(--line); }
.rv-tbl td{ padding:8px; border-bottom:1px solid var(--line); vertical-align:top; } .rv-tbl td:first-child{ font-weight:700; width:34%; }
.rv-pill{ display:inline-flex; gap:3px; align-items:center; font-size:11.5px; font-weight:800; border-radius:10px; padding:1px 8px 1px 5px; white-space:nowrap; } .rv-pill .ms{ font-size:14px; }
.rv-pill.ok{ background:var(--high-bg); color:var(--high-fg); } .rv-pill.partial{ background:var(--med-bg); color:var(--med-fg); } .rv-pill.missing{ background:var(--low-bg); color:var(--low-fg); } .rv-pill.na{ background:var(--surface-2); color:var(--text-gray); }
.rv-obs{ margin:0; padding-left:18px; color:var(--med-fg); font-size:13px; }
.rv-cs .bar{ height:10px; background:var(--track); border-radius:6px; overflow:hidden; } .rv-cs .bar b{ display:block; height:100%; background:var(--high-fg); }
.rv-cs .bar b.m{ background:var(--med-fg); } .rv-cs .bar b.l{ background:var(--low-fg); }
.rv-cs .num{ font-size:12.5px; font-weight:800; margin:6px 0; } .rv-cs .cols{ display:grid; grid-template-columns:1fr 1fr; gap:12px; font-size:12.5px; } .rv-cs h5{ margin:4px 0; font-size:12px; color:var(--text-gray); } .rv-cs ul{ margin:0; padding-left:18px; }
.rv-fix{ display:flex; gap:10px; padding:12px; border-radius:10px; background:var(--med-bg); border:1px solid var(--med-bd); font-size:13px; }
.rv-fix.low{ background:var(--low-bg); border-color:var(--low-bd); } .rv-fix > .ms{ color:var(--med-fg); } .rv-fix.low > .ms{ color:var(--low-fg); } .rv-fix ul{ margin:6px 0 0; padding-left:18px; }
.rv-clean{ display:flex; gap:8px; align-items:center; padding:12px; border-radius:10px; background:var(--high-bg); color:var(--high-fg); font-weight:700; font-size:13px; }
.rv-dec{ border:1px solid var(--line); border-radius:10px; } .rv-dec .row{ display:flex; justify-content:space-between; align-items:center; padding:7px 12px; border-bottom:1px solid var(--line); font-size:13px; } .rv-dec .row:last-child{ border-bottom:none; } .rv-dec .conf-badge{ cursor:default; }
.rv-note{ font-size:12.5px; color:var(--text-mid); margin:6px 0 0; }
.rv-disc{ margin-top:14px; font-size:11.5px; color:var(--text-gray); background:var(--surface-2); border-radius:8px; padding:8px 10px; }

/* ---------- document viewer ---------- */
.dv-modal{ width:min(900px,96vw); }
.dv-modal .modal-body{ background:var(--surface-2); text-align:center; }
.dv-doc{ position:relative; display:inline-block; line-height:0; box-shadow:0 6px 24px rgba(0,0,0,.18); background:#fff; }
.dv-doc img{ display:block; max-width:100%; }
.dv-doc .scan-boxes{ opacity:0; } .dv-doc .scan-boxes.show{ opacity:1; }
.dv-doc i.hl{ border:3px solid #f59e0b; background:rgba(250,204,21,.28); border-radius:4px; animation:glow 1.2s ease-in-out infinite alternate; }
.dv-doc i.hl em{ background:#b45309; }
@keyframes glow{ from{ box-shadow:0 0 0 2px rgba(245,158,11,.25); } to{ box-shadow:0 0 0 9px rgba(245,158,11,.12); } }
.dv-pages{ display:flex; gap:6px; justify-content:center; margin-bottom:10px; }
.dv-tog{ display:flex; gap:5px; align-items:center; font-size:12.5px; color:var(--text-gray); white-space:nowrap; margin-right:6px; align-self:center; }
.scan-text.dv{ text-align:left; max-height:none; }

/* ---------- chat ---------- */
.bot-tag{ display:flex; gap:4px; align-items:center; font-size:11px; font-weight:800; color:var(--ai); margin-bottom:3px; } .bot-tag .ms{ font-size:14px; }
.msg-acts{ display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; white-space:normal; }
.msg-acts .filter-chip{ border-color:var(--ai); color:var(--ai); }
.chat-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.msg.typing{ display:inline-flex; gap:4px; padding:12px 14px; } .msg.typing span{ width:6px; height:6px; border-radius:50%; background:var(--text-gray); animation:blink 1s infinite; }
.msg.typing span:nth-child(2){ animation-delay:.2s; } .msg.typing span:nth-child(3){ animation-delay:.4s; }
@keyframes blink{ 0%,80%,100%{ opacity:.25; } 40%{ opacity:1; } }
/* ---------- guidance video: floating enlarged player ---------- */
.vp-pop{ position:fixed; left:50%; top:50%; transform:translate(-50%,-48%) scale(.97); opacity:0; pointer-events:none; z-index:87; width:min(1180px,96vw); max-height:94vh; display:flex; flex-direction:column; background:var(--surface); border-radius:16px; box-shadow:0 24px 80px rgba(0,0,0,.45); transition:opacity .18s, transform .18s; outline:none; }
.vp-pop.show{ opacity:1; transform:translate(-50%,-50%); pointer-events:auto; }
.vp-pop-head{ display:flex; gap:12px; align-items:center; padding:14px 18px; border-bottom:1px solid var(--line); }
.vp-pop-head .mh-text{ flex:1; min-width:0; }
.vp-pop-head h2{ margin:0; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vp-pop-head p{ margin:2px 0 0; font-size:12.5px; color:var(--text-gray); }
.vp-pop-body{ padding:16px 18px 18px; overflow-y:auto; }
.vp-pop .vp{ display:grid; grid-template-columns:minmax(0,1fr) 250px; column-gap:18px; align-items:start; }
.vp-pop .vp-stage,.vp-pop .vp-bar{ grid-column:1; }
.vp-pop .vp-stage{ display:flex; justify-content:center; }
.vp-pop .vp-stage canvas{ width:auto; max-width:100%; max-height:calc(94vh - 170px); }
.vp-pop .vp-chapters{ grid-column:2; grid-row:1; margin:0; }
.vp-pop #vpDl{ grid-column:2; grid-row:2; justify-self:start; align-self:center; }
.vp-pop .vp > p{ grid-column:2; grid-row:3; }
.vp-pop .vp-big{ width:84px; height:84px; } .vp-pop .vp-big .ms{ font-size:50px; width:50px; }
.vp-pop:fullscreen{ left:0; top:0; width:100vw; max-height:100vh; border-radius:0; transform:none; }
.vp-pop:fullscreen .vp-stage canvas{ max-height:calc(100vh - 150px); }
@media (max-width:820px){ .vp-pop .vp{ grid-template-columns:1fr; } .vp-pop .vp-chapters,.vp-pop #vpDl,.vp-pop .vp > p{ grid-column:1; grid-row:auto; margin-top:10px; } }
.vp-holder{ display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; padding:28px 16px; border:1px dashed var(--line); border-radius:10px; color:var(--text-gray); font-size:13px; background:var(--surface-2); }
.vp-holder .ms{ font-size:32px; color:var(--blue); }
@media (prefers-reduced-motion: reduce){ .vp-pop{ transition:none; } }
@media (prefers-reduced-motion: reduce){ .scan-beam,.scan-hub .node,.scan-hub .core .ms,.dv-doc i.hl{ animation:none; } }
