/* ==========================================
   CLASSROOM INSTRUCTOR — Analysis report
   8 animation blocks. Reuses adding-students.css for shell
   (sidebar/body/breadcrumb/toast) and assignment-submissions.css
   for submission table, score chips, action buttons and the
   .as-rep overlay scaffold. Adds page-specific styles for:
     - Full Analysis Page (logo + Switch-to-old-view toggle + 9-icon
       toolbar + 3-dot menu, paper-meta line, doc thumbnails,
       large doc area, right panel with similarity donut, score
       legend, Matched/Excluded source list w/ rows + alternates)
     - 10 popups (Email, QR, Save-to-Repo, Digital Receipt,
       File Info, Download, Settings, Share, Grades, Share Feedback)
     - Source-block popup (click matched text -> source metadata
       w/ Primary/Alternate label, Quotes/References toggles,
       navigation arrows)
     - Old view layout swap (different sidebar, similarity %, sources)
     - Document Error tooltips (red 0%, 100% Quotes warning,
       100% References warning)
   ========================================== */

/* === Open-scene stage transitions === */
.op-stage,.op-stage2{position:absolute;inset:0;opacity:0;pointer-events:none;transition:opacity .45s ease}
.op-stage.on,.op-stage2.on{opacity:1;pointer-events:auto}

/* === Floating tooltip (typed) === */
.ar-tip{position:absolute;background:#1a1a1a;color:#fff;border-radius:5px;padding:4px 8px;font-size:9px;font-weight:500;box-shadow:0 4px 14px rgba(0,0,0,.22);pointer-events:none;opacity:0;transform:translateY(-3px);transition:opacity .2s ease,transform .2s ease,top .35s cubic-bezier(.4,0,.2,1),left .35s cubic-bezier(.4,0,.2,1);z-index:60;white-space:nowrap;line-height:1.3;max-width:180px}
.ar-tip.on{opacity:1;transform:translateY(0)}
.ar-tip::after{content:'';position:absolute;top:-4px;left:var(--arrow-x,12px);width:0;height:0;border:4px solid transparent;border-bottom-color:#1a1a1a;border-top:0}
.ar-tip.flip::after{top:auto;bottom:-4px;border-bottom:0;border-top:4px solid #1a1a1a}
.ar-tip .typed{display:inline-block;min-width:6px}
.ar-tip .typed::after{content:'|';color:#4285f4;margin-left:1px;animation:ar-tip-blink .9s steps(2,start) infinite}
@keyframes ar-tip-blink{to{visibility:hidden}}
.ar-tip.done .typed::after{display:none}

/* ==========================================
   FULL ANALYSIS PAGE LAYOUT (replaces mc-shell)
   ========================================== */
.ap-shell{position:absolute;inset:0;display:flex;flex-direction:column;background:#fff;font-family:var(--db-font,system-ui,sans-serif)}

/* Header row: logo / switch-old-view toggle / 9 icons / 3-dot */
.ap-hd{display:flex;align-items:center;padding:6px 10px;border-bottom:1px solid #eee;background:#fff;gap:8px;position:relative;z-index:5}
.ap-hd-logo{display:flex;align-items:center;gap:5px;font-size:11px;font-weight:700;color:#1447E6;flex-shrink:0}
.ap-hd-logo i{width:14px;height:14px;background:#1447E6;border-radius:3px;display:block}
.ap-hd-mid{flex:1;display:flex;justify-content:center;align-items:center}
.ap-old-toggle{display:flex;align-items:center;gap:4px;font-size:8px;color:#666;cursor:default;padding:2px 4px;border-radius:5px;transition:background .2s,box-shadow .2s}
.ap-old-toggle.hl{background:#e8f0fe;box-shadow:0 0 0 2px rgba(20,71,230,.15)}
.ap-old-toggle .ap-toggle{width:18px;height:10px;border-radius:5px;background:#ccc;position:relative;transition:background .25s}
.ap-old-toggle .ap-toggle::after{content:'';position:absolute;top:1px;left:1px;width:8px;height:8px;background:#fff;border-radius:50%;transition:left .25s,background .25s;box-shadow:0 1px 2px rgba(0,0,0,.18)}
.ap-old-toggle.on .ap-toggle{background:#1447E6}
.ap-old-toggle.on .ap-toggle::after{left:9px}

.ap-hd-icons{display:flex;align-items:center;gap:3px;flex-shrink:0}
.ap-ico{width:18px;height:18px;border-radius:4px;display:flex;align-items:center;justify-content:center;color:#666;background:transparent;transition:all .2s;cursor:default;position:relative}
.ap-ico svg{width:11px;height:11px}
.ap-ico.hl{background:#e8f0fe;color:#1447E6;transform:scale(1.2);box-shadow:0 0 0 1.5px #4285f4}
.ap-ico.hl-red{background:#fde0e0;color:#c4302b;transform:scale(1.2);box-shadow:0 0 0 1.5px #c4302b}
.ap-ico.dot3{font-size:14px;font-weight:700;letter-spacing:1px;color:#666}

/* Paper-meta strip */
.ap-meta{display:flex;align-items:center;gap:10px;padding:4px 10px;font-size:8px;color:#666;background:#fafafa;border-bottom:1px solid #f0f0f0;flex-shrink:0}
.ap-meta b{color:#222;margin-right:2px;font-weight:600}
.ap-meta-title{flex:1;text-align:center;background:#eef4ff;padding:2px 8px;border-radius:3px;color:#444;font-size:8px}

/* Body row: thumbnails / doc / right panel */
.ap-body{flex:1;display:flex;gap:5px;padding:5px;background:#f3f4f6;overflow:hidden;min-height:0;position:relative}

/* Thumbnail panel */
.ap-thumbs{width:32px;display:flex;flex-direction:column;gap:3px;flex-shrink:0;align-items:center}
.ap-thumb{width:26px;height:32px;background:#fff;border:1px solid #ddd;border-radius:2px;font-size:6px;color:#888;display:flex;align-items:flex-end;justify-content:center;padding-bottom:1px;cursor:default;transition:all .2s;position:relative;overflow:hidden}
.ap-thumb::before{content:'';position:absolute;top:2px;left:2px;right:2px;height:18px;background:linear-gradient(135deg,#fdebec 30%,#f8c8cb 30%,#f8c8cb 50%,#fff 50%);border-radius:1px;opacity:.7}
.ap-thumb.act{border-color:#1447E6;box-shadow:0 0 0 1px #1447E6}
.ap-thumb.hl{transform:scale(1.05);box-shadow:0 0 0 2px #1447E6}

/* Document area */
.ap-doc{flex:1.5;background:#fff;border:1px solid #eee;border-radius:5px;padding:8px 9px;font-size:7.5px;color:#333;overflow:hidden;line-height:1.45;position:relative;min-width:0}
.ap-doc-h{font-size:8px;color:#444;text-align:center;margin:1px 0 4px;background:#eef4ff;padding:3px;border-radius:2px}
.ap-doc-title{font-size:11px;font-weight:700;text-align:center;color:#1a1a1a;margin:6px 0 8px;line-height:1.2}
.ap-doc-meta-line{font-size:7px;color:#666;text-align:center;margin-bottom:6px;font-style:italic}
.ap-doc p{font-size:7px;line-height:1.6;color:#333;margin:3px 0;text-align:justify}
.ap-doc .hl-pink{background:#fde7e7;padding:0 1px;border-radius:1px}
.ap-doc .hl-pink-st{background:#fde7e7;padding:0 1px;border-radius:1px;outline:1px solid #c4302b;outline-offset:1px;transition:outline .25s}
.ap-doc .hl-yellow{background:#fff4a3;padding:0 1px;border-radius:1px;font-weight:700}
.ap-doc-cols{column-count:2;column-gap:8px;font-size:7px;line-height:1.55}
.ap-doc-cols p{margin:0 0 4px}
.ap-doc-foot{position:absolute;left:8px;right:8px;bottom:5px;display:flex;justify-content:space-between;font-size:7px;color:#888;border-top:1px solid #eee;padding-top:3px;background:#fff}

/* Right panel */
.ap-side{flex:1;display:flex;flex-direction:column;gap:5px;min-width:0}
.ap-sscore{display:flex;align-items:center;gap:5px;padding:5px 8px;background:#fff;border:1px solid #eee;border-radius:5px}
.ap-ai{display:flex;align-items:center;gap:3px;font-size:7.5px;color:#666;padding:2px 4px;border-radius:3px}
.ap-ai b{color:#1447E6;font-weight:700;margin-left:2px}
.ap-ai-arrow{color:#1447E6;font-size:9px}
.ap-gram{display:flex;align-items:center;gap:3px;font-size:7.5px;color:#666;padding:2px 4px;border-radius:3px;margin-left:auto}
.ap-gram-dots i{display:inline-block;width:3px;height:3px;background:#1447E6;border-radius:50%;margin:0 1px}
.ap-gram-dots i:last-child{background:#bbb}

/* Donut + legend */
.ap-donut-card{background:#fff;border:1px solid #eee;border-radius:5px;padding:6px 8px;display:flex;align-items:center;gap:8px}
.ap-donut{position:relative;width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .5s ease,box-shadow .3s ease}
.ap-donut.r-sat{background:conic-gradient(#22a06b 0 5%,#e8e8e8 5% 100%)}
.ap-donut.r-up{background:conic-gradient(#1447E6 0 25%,#e8e8e8 25% 100%)}
.ap-donut.r-poor{background:conic-gradient(#f4b400 0 50%,#e8e8e8 50% 100%)}
.ap-donut.r-bad{background:conic-gradient(#c4302b 0 76%,#e8e8e8 76% 100%)}
.ap-donut.r-bad-pulse{box-shadow:0 0 0 3px rgba(196,48,43,.18)}
.ap-donut::before{content:'';position:absolute;inset:5px;background:#fff;border-radius:50%}
.ap-donut span{position:relative;font-size:11px;font-weight:700;color:#222;line-height:1;text-align:center}
.ap-donut span small{display:block;font-size:6px;font-weight:600;color:#666;margin-top:1px}
.ap-legend{display:flex;flex-direction:column;gap:2px;font-size:7px;color:#444}
.ap-legend div{display:flex;align-items:center;gap:4px;transition:font-weight .2s,color .2s,background .2s;padding:1px 3px;border-radius:3px}
.ap-legend div b{color:inherit;font-weight:600}
.ap-legend div small{color:#888;font-size:6.5px}
.ap-legend i{width:6px;height:6px;border-radius:50%;flex-shrink:0}
.ap-legend div.act{background:rgba(20,71,230,.08)}
.ap-legend div.act b{font-weight:700}

/* Sources panel */
.ap-srcs{flex:1;background:#fff;border:1px solid #eee;border-radius:5px;padding:5px 6px;display:flex;flex-direction:column;gap:3px;overflow:hidden;min-height:0}
.ap-srctab{display:flex;gap:2px;background:#f5f8fc;border-radius:4px;padding:2px;font-size:8px;flex-shrink:0}
.ap-srctab div{flex:1;padding:3px 4px;text-align:center;border-radius:3px;color:#666;font-weight:600;cursor:default;transition:all .2s;font-size:7.5px}
.ap-srctab div.act{background:#1447E6;color:#fff}
.ap-srctab div.hl{background:#e8f0fe;color:#1447E6}
.ap-srctab div span{font-weight:500;font-size:7px;margin-left:2px}

.ap-srchd{display:grid;grid-template-columns:14px 1fr 38px;font-size:7px;color:#888;font-weight:600;padding:2px 4px;border-bottom:1px solid #eee;flex-shrink:0;text-transform:none}
.ap-srclist{flex:1;overflow:hidden;display:flex;flex-direction:column;gap:1px}
.ap-srcrow{display:grid;grid-template-columns:14px 16px 1fr 36px 18px;align-items:center;gap:3px;padding:3px 2px;font-size:7.5px;border-bottom:1px solid #f5f5f5;background:#fff;transition:all .25s}
.ap-srcrow.hl{background:#fff7d6}
.ap-srcrow .cb{width:9px;height:9px;border:1px solid #ccc;border-radius:2px;transition:all .2s}
.ap-srcrow .cb.on{background:#1447E6;border-color:#1447E6;position:relative}
.ap-srcrow .cb.on::after{content:'';position:absolute;left:1.5px;top:0;width:4px;height:6px;border-right:1.5px solid #fff;border-bottom:1.5px solid #fff;transform:rotate(45deg)}
.ap-srcrow .num{color:#444;font-weight:700;text-align:center}
.ap-srcrow.pri-1 .num{color:#c4302b}
.ap-srcrow.pri-2 .num{color:#1d7a3a}
.ap-srcrow.pri-3 .num{color:#7c3aed}
.ap-srcrow .nm{display:flex;flex-direction:column;line-height:1.15;overflow:hidden}
.ap-srcrow .nm b{font-weight:600;color:#1447E6;font-size:7.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ap-srcrow .nm small{color:#888;font-size:6.5px}
.ap-srcrow .pct{background:#eef4ff;color:#1447E6;font-size:7px;padding:1.5px 5px;border-radius:8px;font-weight:700;text-align:center}
.ap-srcrow .arr{width:14px;height:14px;border:1px solid #ddd;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#666;font-size:7px;background:#fff;transition:all .2s}
.ap-srcrow .arr.green{background:#22a06b;color:#fff;border-color:#22a06b}
.ap-srcrow .arr.red{background:#e54545;color:#fff;border-color:#e54545}
.ap-srcrow .arr.down{background:#fff;color:#666}
.ap-srcrow .arr.link{background:#fff;color:#666}
.ap-srcrow .arr.hl{transform:scale(1.25);box-shadow:0 0 0 2px rgba(20,71,230,.25)}

/* Alternate sub-row (revealed after dropdown click) */
.ap-altrow{display:grid;grid-template-columns:14px 16px 1fr 36px 18px;align-items:center;gap:3px;padding:3px 2px;font-size:7px;background:#f8fafd;border-radius:3px;margin:1px 0 1px 14px;max-height:0;opacity:0;overflow:hidden;transition:max-height .3s ease,opacity .25s ease,padding .25s ease,margin .25s ease}
.ap-altrow.on{max-height:30px;opacity:1;padding:3px 2px}

/* Bulk Exclude/Include button */
.ap-bulk-btn{height:18px;background:#e54545;color:#fff;font-size:8px;font-weight:700;border-radius:4px;display:flex;align-items:center;justify-content:center;margin-top:3px;flex-shrink:0;opacity:0;transform:translateY(4px);transition:all .25s}
.ap-bulk-btn.inc{background:#1d7a3a}
.ap-bulk-btn.on{opacity:1;transform:translateY(0)}
.ap-bulk-btn.hl{transform:translateY(0) scale(1.04);box-shadow:0 0 0 3px rgba(229,69,69,.18)}
.ap-bulk-btn.inc.hl{box-shadow:0 0 0 3px rgba(29,122,58,.2)}

/* ==========================================
   POPUPS (modal background reused mc-modal-bg)
   ========================================== */
.ap-pop{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(.92);background:#fff;border-radius:7px;padding:8px 10px;box-shadow:0 8px 28px rgba(0,0,0,.18);opacity:0;pointer-events:none;transition:opacity .25s ease,transform .25s ease;z-index:42;width:62%;max-width:280px}
.ap-pop.on{opacity:1;pointer-events:auto;transform:translate(-50%,-50%) scale(1)}
.ap-pop-hd{display:flex;justify-content:space-between;align-items:center;margin-bottom:5px}
.ap-pop-ttl{font-size:10px;font-weight:700;color:#1a1a1a}
.ap-pop-x{font-size:13px;color:#999;cursor:default}
.ap-pop-sub{font-size:8px;color:#666;margin-bottom:6px;line-height:1.45}
.ap-pop-inp{height:22px;border:1px solid #ddd;border-radius:4px;padding:0 6px;font-size:8.5px;color:#1a1a1a;display:flex;align-items:center;background:#fff;transition:border-color .2s,box-shadow .2s}
.ap-pop-inp.fc{border-color:#1447E6;box-shadow:0 0 0 2px rgba(20,71,230,.1)}
.ap-pop-inp.placeholder{color:#bbb}
.ap-pop-btn{height:22px;background:#1447E6;color:#fff;font-size:9px;font-weight:600;border-radius:4px;display:flex;align-items:center;justify-content:center;margin-top:6px;cursor:default;transition:background .15s,transform .15s,opacity .2s}
.ap-pop-btn.disabled{background:#bbb;opacity:.7}
.ap-pop-btn.press{transform:scale(.97);background:#0e3bb6}

/* QR specific */
.ap-qr{width:78px;height:78px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 78 78'><rect width='78' height='78' fill='%23fff'/><g fill='%23000'><rect x='4' y='4' width='20' height='20'/><rect x='8' y='8' width='12' height='12' fill='%23fff'/><rect x='11' y='11' width='6' height='6'/><rect x='54' y='4' width='20' height='20'/><rect x='58' y='8' width='12' height='12' fill='%23fff'/><rect x='61' y='11' width='6' height='6'/><rect x='4' y='54' width='20' height='20'/><rect x='8' y='58' width='12' height='12' fill='%23fff'/><rect x='11' y='61' width='6' height='6'/><rect x='28' y='4' width='3' height='3'/><rect x='34' y='4' width='3' height='3'/><rect x='40' y='4' width='3' height='3'/><rect x='46' y='4' width='3' height='3'/><rect x='28' y='10' width='3' height='3'/><rect x='40' y='10' width='3' height='3'/><rect x='46' y='10' width='3' height='3'/><rect x='28' y='16' width='3' height='3'/><rect x='34' y='16' width='3' height='3'/><rect x='46' y='16' width='3' height='3'/><rect x='4' y='28' width='3' height='3'/><rect x='10' y='28' width='3' height='3'/><rect x='28' y='28' width='3' height='3'/><rect x='34' y='28' width='3' height='3'/><rect x='46' y='28' width='3' height='3'/><rect x='52' y='28' width='3' height='3'/><rect x='64' y='28' width='3' height='3'/><rect x='28' y='34' width='3' height='3'/><rect x='40' y='34' width='3' height='3'/><rect x='52' y='34' width='3' height='3'/><rect x='4' y='40' width='3' height='3'/><rect x='16' y='40' width='3' height='3'/><rect x='34' y='40' width='3' height='3'/><rect x='40' y='40' width='3' height='3'/><rect x='46' y='40' width='3' height='3'/><rect x='58' y='40' width='3' height='3'/><rect x='70' y='40' width='3' height='3'/><rect x='28' y='46' width='3' height='3'/><rect x='34' y='46' width='3' height='3'/><rect x='40' y='46' width='3' height='3'/><rect x='52' y='46' width='3' height='3'/><rect x='28' y='52' width='3' height='3'/><rect x='34' y='52' width='3' height='3'/><rect x='40' y='52' width='3' height='3'/><rect x='46' y='52' width='3' height='3'/><rect x='58' y='52' width='3' height='3'/><rect x='64' y='52' width='3' height='3'/><rect x='34' y='58' width='3' height='3'/><rect x='46' y='58' width='3' height='3'/><rect x='58' y='58' width='3' height='3'/><rect x='70' y='58' width='3' height='3'/><rect x='28' y='64' width='3' height='3'/><rect x='40' y='64' width='3' height='3'/><rect x='52' y='64' width='3' height='3'/><rect x='64' y='64' width='3' height='3'/><rect x='40' y='70' width='3' height='3'/><rect x='52' y='70' width='3' height='3'/><rect x='58' y='70' width='3' height='3'/></g></svg>") center/contain no-repeat;margin:4px auto}

/* Save to Repo specific */
.ap-pop-fld{display:flex;flex-direction:column;gap:1px;margin-bottom:5px}
.ap-pop-lbl{font-size:7.5px;color:#1447E6;font-weight:600}
.ap-pop-fld .ap-pop-inp{height:18px;font-size:8px}

/* Digital Receipt specific */
.ap-rec-tabs{display:flex;border-bottom:1px solid #eee;margin-bottom:5px}
.ap-rec-tab{padding:4px 8px;font-size:8px;color:#666;font-weight:600;border-bottom:2px solid transparent;flex:1;text-align:center;cursor:default;transition:all .2s}
.ap-rec-tab.act{color:#1447E6;border-bottom-color:#1447E6}
.ap-rec-cert{display:flex;align-items:center;gap:6px;padding:5px 4px;background:#fafafa;border-radius:4px;margin-bottom:5px}
.ap-rec-qr{width:22px;height:22px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect width='24' height='24' fill='%23fff'/><g fill='%23000'><rect x='1' y='1' width='6' height='6'/><rect x='2' y='2' width='4' height='4' fill='%23fff'/><rect x='3' y='3' width='2' height='2'/><rect x='17' y='1' width='6' height='6'/><rect x='18' y='2' width='4' height='4' fill='%23fff'/><rect x='19' y='3' width='2' height='2'/><rect x='1' y='17' width='6' height='6'/><rect x='2' y='18' width='4' height='4' fill='%23fff'/><rect x='3' y='19' width='2' height='2'/><rect x='9' y='9' width='2' height='2'/><rect x='13' y='9' width='2' height='2'/><rect x='9' y='13' width='2' height='2'/><rect x='13' y='13' width='2' height='2'/><rect x='17' y='17' width='2' height='2'/><rect x='17' y='21' width='2' height='2'/><rect x='21' y='17' width='2' height='2'/></g></svg>") center/contain no-repeat;flex-shrink:0}
.ap-rec-cert b{font-size:8px;color:#1447E6;display:block}
.ap-rec-cert small{font-size:7.5px;color:#c4302b;font-weight:700}
.ap-rec-row{display:grid;grid-template-columns:0.55fr 1fr;gap:5px;margin-bottom:3px;align-items:center;font-size:8px}
.ap-rec-row span{color:#888}
.ap-rec-row .ap-rec-val{color:#222;font-weight:500}
.ap-rec-row .ap-pop-inp{height:14px;font-size:7px;color:#bbb}

/* File Information specific */
.ap-fi-tabs{display:flex;border-bottom:1px solid #eee;margin-bottom:5px}
.ap-fi-tab{padding:4px 8px;font-size:8px;color:#666;font-weight:600;border-bottom:2px solid transparent;cursor:default;transition:all .2s}
.ap-fi-tab.act{color:#1447E6;border-bottom-color:#1447E6}
.ap-fi-row{display:grid;grid-template-columns:0.6fr 1fr;gap:6px;padding:2px 4px;font-size:8px;color:#444}
.ap-fi-row b{color:#666;font-weight:500}

/* Download menu specific */
.ap-dl-pop{width:130px}
.ap-dl-item{height:22px;background:#1447E6;color:#fff;font-size:9px;font-weight:600;border-radius:4px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;margin-bottom:3px;cursor:default;transition:background .15s,transform .15s}
.ap-dl-item.hl{background:#0e3bb6;transform:scale(1.02)}
.ap-dl-item svg{width:9px;height:9px}

/* Settings specific */
.ap-set-pop{width:78%;max-width:340px}
.ap-set-hd{display:grid;grid-template-columns:1.2fr 0.8fr 0.7fr 0.6fr 0.4fr;font-size:7px;color:#888;font-weight:600;padding:3px 2px;border-bottom:1px solid #eee}
.ap-set-row{display:grid;grid-template-columns:1.2fr 0.8fr 0.7fr 0.6fr 0.4fr;align-items:center;gap:4px;padding:5px 2px;font-size:8px;color:#333;border-bottom:1px solid #f5f5f5}
.ap-set-row:last-child{border-bottom:0}
.ap-set-tg{width:18px;height:10px;border-radius:5px;background:#1447E6;position:relative;justify-self:start;transition:background .2s}
.ap-set-tg::after{content:'';position:absolute;top:1px;left:9px;width:8px;height:8px;background:#fff;border-radius:50%;transition:left .2s;box-shadow:0 1px 2px rgba(0,0,0,.18)}
.ap-set-tg.off{background:#ccc}
.ap-set-tg.off::after{left:1px}
.ap-set-tg-lbl{font-size:7px;color:#1447E6;font-weight:600;margin-left:3px}
.ap-set-tg.off + .ap-set-tg-lbl{color:#999}
.ap-set-note{font-size:7px;color:#c4302b;margin-top:3px;font-style:italic}

/* Grades popup specific */
.ap-gr-art{height:30px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#f5f8ff,#eef3ff);border-radius:4px;margin-bottom:6px;font-size:18px}
.ap-gr-textarea{height:38px;border:1px solid #ddd;border-radius:4px;padding:4px 6px;font-size:8px;color:#888;background:#fff;display:flex;align-items:flex-start;transition:border-color .2s,box-shadow .2s}
.ap-gr-textarea.fc{border-color:#1447E6;box-shadow:0 0 0 2px rgba(20,71,230,.1);color:#1a1a1a}
.ap-gr-marks-row{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:5px}
.ap-gr-mfld{display:flex;flex-direction:column;gap:1px}
.ap-gr-mlbl{font-size:7px;color:#888}
.ap-gr-cb-row{display:flex;align-items:center;gap:4px;margin-top:5px;font-size:8px;color:#444}
.ap-gr-cb{width:9px;height:9px;border:1px solid #ccc;border-radius:2px;transition:all .2s;flex-shrink:0}
.ap-gr-cb.on{background:#1447E6;border-color:#1447E6;position:relative}
.ap-gr-cb.on::after{content:'';position:absolute;left:1.5px;top:0;width:4px;height:6px;border-right:1.5px solid #fff;border-bottom:1.5px solid #fff;transform:rotate(45deg)}

/* ==========================================
   3-DOT MENU (More Options)
   ========================================== */
.ap-3dot-menu{position:absolute;top:30px;right:8px;background:#fff;border-radius:5px;padding:3px;box-shadow:0 6px 20px rgba(0,0,0,.16);font-size:9px;z-index:32;opacity:0;transform:translateY(-4px);pointer-events:none;transition:opacity .2s,transform .2s;min-width:120px;border:1px solid #eee}
.ap-3dot-menu.on{opacity:1;transform:translateY(0);pointer-events:auto}
.ap-3dot-item{padding:5px 8px;color:#333;border-radius:3px;cursor:default;transition:background .15s}
.ap-3dot-item.hl{background:#fff7d6;color:#c4302b;font-weight:600;outline:1px solid #c4302b}

/* ==========================================
   SOURCE BLOCK POPUP (click matched text)
   ========================================== */
.ap-srcblk{position:absolute;background:#fff;border:2px solid #c4302b;border-radius:5px;padding:6px 8px;box-shadow:0 6px 20px rgba(0,0,0,.18);font-size:7.5px;z-index:38;opacity:0;pointer-events:none;transform:scale(.95);transition:all .25s ease;width:78%;max-width:280px}
.ap-srcblk.on{opacity:1;pointer-events:auto;transform:scale(1)}
.ap-srcblk-hd{display:flex;align-items:flex-start;gap:5px;padding-bottom:4px;border-bottom:1px solid #f0f0f0;margin-bottom:4px}
.ap-srcblk-num{width:14px;height:14px;border-radius:50%;background:#fde7e7;color:#c4302b;font-size:7.5px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ap-srcblk-info{flex:1}
.ap-srcblk-info b{display:block;font-size:7px;color:#666;font-weight:500;margin-bottom:1px}
.ap-srcblk-info a{color:#1447E6;font-size:8px;font-weight:600;text-decoration:underline}
.ap-srcblk-label{font-size:6.5px;font-weight:700;background:#1447E6;color:#fff;padding:2px 5px;border-radius:3px;letter-spacing:.3px;flex-shrink:0;transition:background .25s}
.ap-srcblk-label.alt{background:#7c3aed}
.ap-srcblk-pos{font-size:7.5px;color:#666;display:flex;align-items:center;gap:2px;margin-left:auto}
.ap-srcblk-arr{width:13px;height:13px;border-radius:50%;border:1px solid #ddd;background:#fff;display:flex;align-items:center;justify-content:center;color:#666;font-size:7px;cursor:default;transition:all .2s}
.ap-srcblk-arr.hl{background:#e8f0fe;border-color:#1447E6;color:#1447E6;transform:scale(1.18)}

.ap-srcblk-body{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.ap-srcblk-col p{font-size:7px;color:#444;margin:1px 0;display:flex;justify-content:space-between}
.ap-srcblk-col p b{color:#1a1a1a;font-weight:600}
.ap-srcblk-col a{color:#1447E6;text-decoration:underline;font-size:6.5px}
.ap-srcblk-col .lab{color:#666;font-weight:600;font-size:6.5px}

.ap-srcblk-foot{display:flex;align-items:center;gap:6px;padding-top:4px;margin-top:4px;border-top:1px solid #f0f0f0;font-size:7px;color:#666}
.ap-srcblk-foot b{color:#444;font-weight:600;margin-right:3px}
.ap-srcblk-tg{display:flex;align-items:center;gap:3px}
.ap-srcblk-toggle{width:14px;height:8px;border-radius:4px;background:#1447E6;position:relative;transition:background .25s}
.ap-srcblk-toggle::after{content:'';position:absolute;top:1px;left:7px;width:6px;height:6px;background:#fff;border-radius:50%;transition:left .25s;box-shadow:0 1px 1px rgba(0,0,0,.2)}
.ap-srcblk-toggle.off{background:#ccc}
.ap-srcblk-toggle.off::after{left:1px}
.ap-srcblk-beta{position:absolute;bottom:2px;right:5px;background:#1447E6;color:#fff;font-size:6px;font-weight:700;padding:1px 3px;border-radius:2px}

/* ==========================================
   OLD VIEW LAYOUT (different look)
   ========================================== */
.ap-old{position:absolute;inset:0;background:#fff;display:flex;flex-direction:column;opacity:0;pointer-events:none;transition:opacity .35s ease;z-index:8}
.ap-old.on{opacity:1;pointer-events:auto}
.ap-old-hd{display:flex;align-items:center;padding:5px 10px;background:#1447E6;color:#fff;font-size:9px;gap:8px;flex-shrink:0}
.ap-old-hd .ap-hd-logo{color:#fff}
.ap-old-hd .ap-hd-logo i{background:#fff}
.ap-old-hd .ap-old-paperinfo{flex:1;display:flex;justify-content:center;gap:10px;font-size:8px}
.ap-old-hd .ap-old-paperinfo b{font-weight:700}
.ap-old-hd .ap-old-aiscore{background:#fff;color:#1447E6;padding:2px 6px;border-radius:3px;font-size:8px;font-weight:700}
.ap-old-hd .ap-old-icons{display:flex;gap:3px}
.ap-old-hd .ap-old-icons .ap-ico{color:#fff;background:rgba(255,255,255,.15)}
.ap-old-body{flex:1;display:flex;padding:5px;gap:5px;overflow:hidden}
.ap-old-side{width:130px;background:#fff;border:1px solid #eee;border-radius:4px;padding:5px;display:flex;flex-direction:column;gap:5px;flex-shrink:0}
.ap-old-donut{width:50px;height:50px;border-radius:50%;background:conic-gradient(#1447E6 0 45%,#e8e8e8 45% 100%);display:flex;align-items:center;justify-content:center;margin:4px auto;position:relative}
.ap-old-donut::before{content:'';position:absolute;inset:5px;background:#fff;border-radius:50%}
.ap-old-donut span{position:relative;font-size:11px;font-weight:700;color:#1447E6;text-align:center}
.ap-old-donut span small{display:block;font-size:6px;color:#666;font-weight:600}
.ap-old-mhd{background:#1447E6;color:#fff;font-size:8px;text-align:center;padding:3px;border-radius:3px;font-weight:700;margin:3px 0}
.ap-old-shd{display:grid;grid-template-columns:14px 1fr 26px 22px;font-size:7px;color:#888;font-weight:600;padding:2px;border-bottom:1px solid #eee}
.ap-old-srow{display:grid;grid-template-columns:14px 1fr 26px 22px;align-items:center;gap:3px;padding:3px 2px;font-size:7px;border-bottom:1px solid #f5f5f5;color:#444}
.ap-old-srow b{color:#1447E6;font-weight:600;font-size:7.5px}
.ap-old-srow small{color:#888;font-size:6px;display:block}
.ap-old-srow .pct{background:#fde7e7;color:#c4302b;font-size:6.5px;padding:1px 3px;border-radius:6px;text-align:center;font-weight:700}
.ap-old-doc{flex:1;background:#fff;border:1px solid #eee;border-radius:4px;padding:5px;font-size:7px;line-height:1.5;color:#333;overflow:hidden}
.ap-old-doc p{margin:0 0 3px}
.ap-old-doc .hl-pink{background:#fde7e7}
.ap-old-doc .hl-blue{background:#cfe4ff}

/* ==========================================
   ACTION DOWNLOAD DROPDOWN (4 reports)
   ========================================== */
.ap-act-menu{position:absolute;background:#fff;border-radius:5px;padding:3px;box-shadow:0 6px 22px rgba(0,0,0,.16);font-size:9px;z-index:34;opacity:0;transform:translateY(-4px);pointer-events:none;transition:opacity .2s,transform .2s;min-width:108px;border:1px solid #eee}
.ap-act-menu.on{opacity:1;transform:translateY(0);pointer-events:auto}
.ap-act-item{padding:6px 9px;color:#333;border-radius:3px;cursor:default;font-size:9px;font-weight:500;transition:background .15s}
.ap-act-item.hl{background:#f0f4ff;color:#1447E6;font-weight:700}

/* ==========================================
   DOC ERROR TOOLTIP (long, wraps)
   ========================================== */
.ap-de-tip{position:absolute;background:#1a1a1a;color:#fff;border-radius:5px;padding:6px 8px;font-size:7.5px;line-height:1.45;box-shadow:0 4px 16px rgba(0,0,0,.25);pointer-events:none;opacity:0;transform:translateY(-3px);transition:opacity .25s ease,transform .25s ease;z-index:60;max-width:200px;white-space:normal}
.ap-de-tip.on{opacity:1;transform:translateY(0)}
.ap-de-tip::after{content:'';position:absolute;top:-4px;left:14px;width:0;height:0;border:4px solid transparent;border-bottom-color:#1a1a1a;border-top:0}

.ap-de-chip{display:inline-flex;align-items:center;gap:3px;background:#fde7e7;color:#c4302b;font-size:8px;font-weight:600;padding:2px 6px;border-radius:8px;cursor:default;transition:transform .2s}
.ap-de-chip.hl{transform:scale(1.18);box-shadow:0 0 0 2px rgba(196,48,43,.18)}
.ap-de-chip svg{width:9px;height:9px}

/* Quotes / References tooltip variants (gray bg, smaller) */
.ap-de-qtip{position:absolute;background:#666;color:#fff;border-radius:4px;padding:3px 7px;font-size:7.5px;font-weight:500;box-shadow:0 4px 12px rgba(0,0,0,.22);pointer-events:none;opacity:0;transform:translateY(-3px);transition:opacity .2s ease,transform .2s ease;z-index:60;white-space:nowrap}
.ap-de-qtip.on{opacity:1;transform:translateY(0)}
.ap-de-qtip::after{content:'';position:absolute;top:-4px;left:18px;width:0;height:0;border:4px solid transparent;border-bottom-color:#666;border-top:0}

@media(max-width:640px){
  .ap-thumbs{width:24px}
  .ap-thumb{width:20px;height:24px}
  .ap-doc{padding:5px}
  .ap-pop{width:78%;font-size:9px}
}
