/* ── PDF Threat Scanner styles ── */

/* Page-width override for the scan tool — wider than standard tool pages */
.pdf-tool-page:has(#scan-upload-zone),
.pdf-tool-page:has(.scan-about) {
    max-width: min(94vw, 1320px);
    width: auto;
}

/* Match the header inner width to the wider scan page content */
body:has(#scan-upload-zone) .pdf-header-tool .pdf-header-inner {
    max-width: min(94vw, 1320px);
}

@media (max-width: 700px) {
    .pdf-tool-page:has(#scan-upload-zone),
    .pdf-tool-page:has(.scan-about) {
        max-width: 100%;
        width: 100%;
    }
    body:has(#scan-upload-zone) .pdf-header-tool .pdf-header-inner {
        max-width: 100%;
    }
}

/* ── About section ───────────────────────────────────────────────────────── */
.scan-about {
    margin-bottom: 2rem;
}

.scan-about-header {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    margin-bottom: 1.4rem;
    padding: 1.3rem 1.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
}
.scan-about-shield    { font-size: 2.2rem; line-height: 1; flex-shrink: 0; margin-top: .1rem; }
.scan-about-title     { font-size: 1.15rem; font-weight: 700; color: var(--pdf-text, #e8e8f0); margin-bottom: .3rem; }
.scan-about-subtitle  { font-size: .88rem; color: #c4c4d8; line-height: 1.55; }
.scan-about-subtitle strong { color: var(--pdf-amber, #ff8c00); }

/* Engine grid section label */
.scan-about-stack-label {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: .75rem;
    row-gap: .2rem;
    margin-bottom: .9rem;
}
.scan-about-stack-name {
    grid-column: 1; grid-row: 1;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--pdf-amber, #ff8c00);
    white-space: nowrap;
}
.scan-about-stack-desc {
    grid-column: 1 / -1; grid-row: 2;
    font-size: .75rem;
    color: var(--pdf-text-muted, #9898b0);
}
.scan-about-stack-count {
    grid-column: 2; grid-row: 1;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: rgba(255,140,0,.5);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Engine cards grid */
.scan-about-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 1.2rem;
    margin-bottom: 1.4rem;
    width: 100%;
}
.scan-about-engine-cell {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.scan-about-card.scan-about-c45 {
    border-left: 2px solid rgba(167,139,250,0.5);
    padding-left: .6rem;
}
@media (max-width: 900px) {
    .scan-about-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Collapsed card — number + title only, clickable */
.scan-about-card {
    display: flex;
    gap: .7rem;
    align-items: center;
    padding: .55rem 1rem;
    border-radius: 8px;
    border-left: 3px solid transparent;
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background .15s;
    user-select: none;
}
.scan-about-card:hover { background: rgba(255,255,255,0.06); }

.scan-about-card-num {
    font-size: .95rem;
    line-height: 1;
    flex-shrink: 0;
    opacity: .9;
}
.scan-about-card-title {
    font-size: .85rem;
    font-weight: 700;
    flex: 1;
}
.scan-about-card-chevron {
    font-size: .65rem;
    color: var(--pdf-text-muted, #9898b0);
    transition: transform .2s;
    flex-shrink: 0;
}
.scan-about-card.scan-card-open .scan-about-card-chevron { transform: rotate(180deg); }

/* Expanded description — hidden by default */
.scan-about-card-desc {
    display: none;
    font-size: .78rem;
    color: #c4c4d8;
    line-height: 1.6;
    padding: .5rem 1rem .65rem calc(1rem + .95rem + .7rem); /* indent under title */
    border-left: 3px solid transparent;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    background: rgba(255,255,255,0.025);
    margin-top: -4px;
}
.scan-about-card-desc code {
    font-size: .74rem;
    padding: .1rem .3rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.07);
    color: var(--pdf-text, #e8e8f0);
}
/* Wide expanded desc — JS moves it to grid level spanning all 4 columns */
.scan-about-desc-wide {
    display: block;
    grid-column: 1 / -1;
    padding: .85rem 1.2rem 1rem 1.2rem;
    background: #1a1d2e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    margin-top: .2rem;
    margin-bottom: .4rem;
    font-size: .82rem;
    color: #dde0f0;
    line-height: 1.7;
}
.scan-about-desc-wide code {
    font-size: .78rem;
    padding: .1rem .35rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    color: #f0c070;
}
.scan-about-card-desc code {
    font-size: .74rem;
    padding: .1rem .3rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.07);
    color: var(--pdf-text, #e8e8f0);
}

/* Per-engine accent colors */
.scan-about-c1  { border-left-color: #6366f1; background: rgba(99,102,241,0.05); }   /* indigo   — Structure */
.scan-about-c1  .scan-about-card-title { color: #818cf8; }
.scan-about-c1  .scan-about-card-num   { color: #818cf8; }

.scan-about-c2  { border-left-color: #f97316; background: rgba(249,115,22,0.05); }   /* orange   — Patterns */
.scan-about-c2  .scan-about-card-title { color: #fb923c; }
.scan-about-c2  .scan-about-card-num   { color: #fb923c; }

.scan-about-c3  { border-left-color: #06b6d4; background: rgba(6,182,212,0.05); }   /* cyan     — Streams */
.scan-about-c3  .scan-about-card-title { color: #22d3ee; }
.scan-about-c3  .scan-about-card-num   { color: #22d3ee; }

.scan-about-c4  { border-left-color: #8b5cf6; background: rgba(139,92,246,0.05); }   /* violet   — Objects */
.scan-about-c4  .scan-about-card-title { color: #a78bfa; }
.scan-about-c4  .scan-about-card-num   { color: #a78bfa; }

.scan-about-c5  { border-left-color: #3b82f6; background: rgba(59,130,246,0.05); }   /* blue     — URLs */
.scan-about-c5  .scan-about-card-title { color: #60a5fa; }
.scan-about-c5  .scan-about-card-num   { color: #60a5fa; }

.scan-about-c6  { border-left-color: #ec4899; background: rgba(236,72,153,0.05); }   /* pink     — Metadata */
.scan-about-c6  .scan-about-card-title { color: #f472b6; }
.scan-about-c6  .scan-about-card-num   { color: #f472b6; }

.scan-about-c7  { border-left-color: #14b8a6; background: rgba(20,184,166,0.05); }   /* teal     — Fonts */
.scan-about-c7  .scan-about-card-title { color: #2dd4bf; }
.scan-about-c7  .scan-about-card-num   { color: #2dd4bf; }

.scan-about-c8  { border-left-color: #ef4444; background: rgba(239,68,68,0.05); }   /* red      — CVEs */
.scan-about-c8  .scan-about-card-title { color: #f87171; }
.scan-about-c8  .scan-about-card-num   { color: #f87171; }

.scan-about-c9  { border-left-color: #eab308; background: rgba(234,179,8,0.05); }   /* yellow   — Statistics */
.scan-about-c9  .scan-about-card-title { color: #fbbf24; }
.scan-about-c9  .scan-about-card-num   { color: #fbbf24; }

.scan-about-c10 { border-left-color: #e879f9; background: rgba(232,121,249,0.05); }  /* fuchsia-light — AcroForm Field Forensics */
.scan-about-c10 .scan-about-card-title { color: #e879f9; }
.scan-about-c10 .scan-about-card-num   { color: #e879f9; }

.scan-about-c11 { border-left-color: #22c55e; background: rgba(34,197,94,0.05); }  /* green — ClamAV */
.scan-about-c11 .scan-about-card-title { color: #4ade80; }
.scan-about-c11 .scan-about-card-num   { color: #4ade80; }

.scan-about-c12 { border-left-color: #a78bfa; background: rgba(167,139,250,0.05); }  /* purple — ExifTool */
.scan-about-c12 .scan-about-card-title { color: #a78bfa; }
.scan-about-c12 .scan-about-card-num   { color: #a78bfa; }

.scan-about-c13 { border-left-color: #38bdf8; background: rgba(56,189,248,0.05); }  /* sky — qpdf */
.scan-about-c13 .scan-about-card-title { color: #38bdf8; }
.scan-about-c13 .scan-about-card-num   { color: #38bdf8; }

.scan-about-c14 { border-left-color: #fb923c; background: rgba(251,146,60,0.05); }  /* orange — YARA */
.scan-about-c14 .scan-about-card-title { color: #fb923c; }
.scan-about-c14 .scan-about-card-num   { color: #fb923c; }

.scan-about-c15 { border-left-color: #f472b6; background: rgba(244,114,182,0.05); }  /* rose — PeePDF */
.scan-about-c15 .scan-about-card-title { color: #f472b6; }
.scan-about-c15 .scan-about-card-num   { color: #f472b6; }
.scan-about-c16 { border-left-color: #06b6d4; background: rgba(6,182,212,0.05); }    /* cyan — Dynamic Behavioral Sandbox */
.scan-about-c16 .scan-about-card-title { color: #06b6d4; }
.scan-about-c16 .scan-about-card-num   { color: #06b6d4; }
.scan-about-c17 { border-left-color: #a3e635; background: rgba(163,230,53,0.05); }    /* lime   — ML Intelligence Engine */
.scan-about-c17 .scan-about-card-title { color: #a3e635; }
.scan-about-c17 .scan-about-card-num   { color: #a3e635; }
.scan-about-c18 { border-left-color: #38bdf8; background: rgba(56,189,248,0.05); }    /* sky    — Differential Parsing */
.scan-about-c18 .scan-about-card-title { color: #38bdf8; }
.scan-about-c18 .scan-about-card-num   { color: #38bdf8; }
.scan-about-c19 { border-left-color: #f43f5e; background: rgba(244,63,94,0.05); }     /* rose   — Polyglot Detection */
.scan-about-c19 .scan-about-card-title { color: #fb7185; }
.scan-about-c19 .scan-about-card-num   { color: #fb7185; }
.scan-about-c20 { border-left-color: #f59e0b; background: rgba(245,158,11,0.05); }    /* amber  — JS AST Deobfuscation */
.scan-about-c20 .scan-about-card-title { color: #fbbf24; }
.scan-about-c20 .scan-about-card-num   { color: #fbbf24; }
.scan-about-c21 { border-left-color: #ef4444; background: rgba(239,68,68,0.05); }      /* red    — Threat Intelligence */
.scan-about-c21 .scan-about-card-title { color: #f87171; }
.scan-about-c21 .scan-about-card-num   { color: #f87171; }
.scan-about-c22 { border-left-color: #a78bfa; background: rgba(167,139,250,0.06); }    /* violet — Signature Forensics */
.scan-about-c22 .scan-about-card-title { color: #c4b5fd; }
.scan-about-c22 .scan-about-card-num   { color: #c4b5fd; }
.scan-about-c23 { border-left-color: #f472b6; background: rgba(244,114,182,0.05); }    /* pink   — Phishing Detection */
.scan-about-c23 .scan-about-card-title { color: #f9a8d4; }
.scan-about-c23 .scan-about-card-num   { color: #f9a8d4; }
.scan-about-c24 { border-left-color: #fb923c; background: rgba(251,146,60,0.05); }     /* orange — Embedded File Analysis */
.scan-about-c24 .scan-about-card-title { color: #fdba74; }
.scan-about-c24 .scan-about-card-num   { color: #fdba74; }
.scan-about-c25 { border-left-color: #34d399; background: rgba(52,211,153,0.05); }     /* emerald — Campaign Attribution */
.scan-about-c25 .scan-about-card-title { color: #6ee7b7; }
.scan-about-c25 .scan-about-card-num   { color: #6ee7b7; }
.scan-about-c26 { border-left-color: #6366f1; background: rgba(99,102,241,0.05); }     /* indigo — Document Revision History */
.scan-about-c26 .scan-about-card-title { color: #818cf8; }
.scan-about-c26 .scan-about-card-num   { color: #818cf8; }
.scan-about-c27 { border-left-color: #ec4899; background: rgba(236,72,153,0.05); }     /* pink — Annotation Forensics */
.scan-about-c27 .scan-about-card-title { color: #f472b6; }
.scan-about-c27 .scan-about-card-num   { color: #f472b6; }
.scan-about-c28 { border-left-color: #14b8a6; background: rgba(20,184,166,0.05); }     /* teal — Named Tree Analysis */
.scan-about-c28 .scan-about-card-title { color: #2dd4bf; }
.scan-about-c28 .scan-about-card-num   { color: #2dd4bf; }
.scan-about-c29 { border-left-color: #f59e0b; background: rgba(245,158,11,0.05); }     /* amber — Content Stream Forensics */
.scan-about-c29 .scan-about-card-title { color: #fbbf24; }
.scan-about-c29 .scan-about-card-num   { color: #fbbf24; }
.scan-about-c30 { border-left-color: #8b5cf6; background: rgba(139,92,246,0.05); }     /* violet — Object Stream Analysis */
.scan-about-c30 .scan-about-card-title { color: #a78bfa; }
.scan-about-c30 .scan-about-card-num   { color: #a78bfa; }
.scan-about-c31 { border-left-color: #d946ef; background: rgba(217,70,239,0.05); }     /* fuchsia — XFA FormCalc Parser */
.scan-about-c31 .scan-about-card-title { color: #e879f9; }
.scan-about-c31 .scan-about-card-num   { color: #e879f9; }
.scan-about-c32 { border-left-color: #06b6d4; background: rgba(6,182,212,0.05); }      /* cyan — Action Dependency Graph */
.scan-about-c32 .scan-about-card-title { color: #22d3ee; }
.scan-about-c32 .scan-about-card-num   { color: #22d3ee; }
.scan-about-c33 { border-left-color: #4ade80; background: rgba(74,222,128,0.05); }     /* green — OCG Layer Cloaking */
.scan-about-c33 .scan-about-card-title { color: #86efac; }
.scan-about-c33 .scan-about-card-num   { color: #86efac; }
.scan-about-c34 { border-left-color: #fb923c; background: rgba(251,146,60,0.05); }     /* orange — Unicode & Invisible Text */
.scan-about-c34 .scan-about-card-title { color: #fdba74; }
.scan-about-c34 .scan-about-card-num   { color: #fdba74; }
.scan-about-c35 { border-left-color: #f43f5e; background: rgba(244,63,94,0.05); }      /* rose — Trailer Chain Forensics */
.scan-about-c35 .scan-about-card-title { color: #fb7185; }
.scan-about-c35 .scan-about-card-num   { color: #fb7185; }
.scan-about-c36 { border-left-color: #a78bfa; background: rgba(167,139,250,0.06); }    /* violet — Codec Parameter Validation */
.scan-about-c36 .scan-about-card-title { color: #c4b5fd; }
.scan-about-c36 .scan-about-card-num   { color: #c4b5fd; }
.scan-about-c37 { border-left-color: #38bdf8; background: rgba(56,189,248,0.05); }     /* sky — Physical Entropy Topology */
.scan-about-c37 .scan-about-card-title { color: #7dd3fc; }
.scan-about-c37 .scan-about-card-num   { color: #7dd3fc; }
.scan-about-c38 { border-left-color: #f472b6; background: rgba(244,114,182,0.05); }    /* pink — Image Steganography */
.scan-about-c38 .scan-about-card-title { color: #f9a8d4; }
.scan-about-c38 .scan-about-card-num   { color: #f9a8d4; }
.scan-about-c39 { border-left-color: #34d399; background: rgba(52,211,153,0.05); }     /* emerald — Compliance Fraud Detection */
.scan-about-c39 .scan-about-card-title { color: #6ee7b7; }
.scan-about-c39 .scan-about-card-num   { color: #6ee7b7; }
.scan-about-c40 { border-left-color: #fbbf24; background: rgba(251,191,36,0.05); }     /* amber — JS Behavioral Emulation */
.scan-about-c40 .scan-about-card-title { color: #fde68a; }
.scan-about-c40 .scan-about-card-num   { color: #fde68a; }
.scan-about-c41 { border-left-color: #818cf8; background: rgba(129,140,248,0.05); }    /* indigo — Font CharString Emulator */
.scan-about-c41 .scan-about-card-title { color: #a5b4fc; }
.scan-about-c41 .scan-about-card-num   { color: #a5b4fc; }
.scan-about-c42 { border-left-color: #14b8a6; background: rgba(20,184,166,0.05); }     /* teal — XRef Integrity Graph */
.scan-about-c42 .scan-about-card-title { color: #2dd4bf; }
.scan-about-c42 .scan-about-card-num   { color: #2dd4bf; }
.scan-about-c43 { border-left-color: #ff8c00; background: rgba(255,140,0,0.07); }      /* amber-gold — Correlation Engine (44) */
.scan-about-c43 .scan-about-card-title { color: #ffb347; }
.scan-about-c43 .scan-about-card-num   { color: #ffb347; }

.scan-about-c44 { border-left-color: #84cc16; background: rgba(132,204,22,0.05); }    /* lime — PDF Token Obfuscation (31) */
.scan-about-c44 .scan-about-card-title { color: #a3e635; }
.scan-about-c44 .scan-about-card-num   { color: #a3e635; }

/* ── Differential parsing panel ── */
.scan-diff-panel {
    margin: 1.2rem 0;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    border: 1px solid rgba(56,189,248,0.25);
    background: rgba(56,189,248,0.04);
}
.scan-diff-title {
    font-size: .8rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: #38bdf8; margin-bottom: .85rem;
}
.scan-diff-intro {
    font-size: .72rem; color: var(--pdf-text-muted,#9898b0);
    margin-bottom: .75rem; letter-spacing: .03em;
}
.scan-diff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .65rem;
    margin-bottom: .85rem;
}
@media (max-width: 720px) { .scan-diff-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .scan-diff-grid { grid-template-columns: 1fr; } }
.scan-diff-parser {
    padding: .7rem .9rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    transition: border-color .2s;
}
.scan-diff-parser:hover { border-color: rgba(56,189,248,0.25); }
.scan-diff-parser-name {
    font-size: .75rem; font-weight: 700; color: #38bdf8;
    margin-bottom: .45rem; letter-spacing: .02em;
}
.scan-diff-parser-row {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: .4rem; font-size: .72rem; line-height: 1.75;
    color: var(--pdf-text-muted,#9898b0);
}
.scan-diff-row-label { flex-shrink: 0; }
.scan-diff-row-val   { color: var(--pdf-text,#e8e8f0); font-weight: 600; text-align: right; }
.scan-diff-row-warn .scan-diff-row-val { color: #fbbf24; }
.scan-diff-mismatch  { color: #f87171; font-weight: 700; }
.scan-diff-badges    { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.scan-diff-badge {
    padding: .25rem .65rem; border-radius: 4px; font-size: .72rem; font-weight: 600;
    background: rgba(56,189,248,0.12); color: #38bdf8;
}
.scan-diff-badge-warn { background: rgba(251,191,36,0.14); color: #fbbf24; }
.scan-diff-badge-crit { background: rgba(239,68,68,0.15);  color: #f87171; }

/* ── Polyglot panel ── */
.scan-poly-panel {
    margin: 1.2rem 0; padding: 1rem 1.2rem;
    border-radius: 10px;
    border: 1px solid rgba(244,63,94,0.25);
    background: rgba(244,63,94,0.04);
}
.scan-poly-title {
    font-size: .8rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: #fb7185; margin-bottom: .75rem;
}
.scan-poly-hit {
    display: flex; align-items: center; gap: .6rem;
    padding: .45rem .7rem; border-radius: 6px;
    background: rgba(244,63,94,0.08); margin-bottom: .4rem;
    font-size: .8rem;
}
.scan-poly-hit-icon { font-size: 1.1rem; }
.scan-poly-hit-label { color: var(--pdf-text,#e8e8f0); font-weight: 600; flex: 1; }
.scan-poly-hit-risk  { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.scan-poly-hit-risk-critical { color: #f87171; }
.scan-poly-hit-risk-high     { color: #fb923c; }
.scan-poly-hit-risk-medium   { color: #fbbf24; }
.scan-poly-clean { font-size: .8rem; color: #4ade80; }

/* ── JS AST Deobfuscation panel ── */
.scan-ast-panel {
    margin: 1.2rem 0; padding: 1rem 1.2rem;
    border-radius: 10px;
    border: 1px solid rgba(245,158,11,0.25);
    background: rgba(245,158,11,0.04);
}
.scan-ast-title {
    font-size: .8rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: #fbbf24; margin-bottom: .85rem;
}
.scan-ast-meta { font-size: .75rem; color: var(--pdf-text-muted,#9898b0); margin-bottom: .75rem; }
.scan-ast-finding {
    display: flex; align-items: flex-start; gap: .65rem;
    padding: .5rem .75rem; border-radius: 7px;
    background: rgba(245,158,11,0.07); margin-bottom: .4rem;
}
.scan-ast-finding-icon { font-size: 1rem; margin-top: .05rem; }
.scan-ast-finding-label { font-size: .8rem; font-weight: 600; color: var(--pdf-text,#e8e8f0); }
.scan-ast-finding-detail { font-size: .73rem; color: var(--pdf-text-muted,#9898b0); }
.scan-ast-clean { font-size: .8rem; color: #4ade80; }

/* ── ML feature importance (Explainable ML) ── */
.scan-ml-importance {
    margin-top: 1rem;
    border-top: 1px solid rgba(163,230,53,0.15);
    padding-top: .85rem;
}
.scan-ml-importance-title {
    font-size: .73rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: rgba(163,230,53,0.7); margin-bottom: .6rem;
}
.scan-ml-fi-row {
    display: flex; align-items: center; gap: .6rem;
    margin-bottom: .35rem; font-size: .75rem;
}
.scan-ml-fi-label { color: var(--pdf-text-muted,#9898b0); width: 12rem; flex-shrink: 0; }
.scan-ml-fi-bar-wrap { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; }
.scan-ml-fi-bar-fill { height: 100%; border-radius: 3px; background: #a3e635; transition: width .4s ease; }
.scan-ml-fi-pct  { font-size: .7rem; color: var(--pdf-text-muted,#9898b0); width: 2.8rem; text-align: right; flex-shrink: 0; }

/* ML Intelligence panel in results */
.scan-ml-panel {
    margin: 1.2rem 0;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    border: 1px solid rgba(163,230,53,0.25);
    background: rgba(163,230,53,0.04);
}
.scan-ml-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .75rem;
}
.scan-ml-title { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #a3e635; }
.scan-ml-ver   { font-size: .72rem; color: var(--pdf-text-muted, #9898b0); margin-left: auto; }
.scan-ml-bar-wrap { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: .5rem; transition: opacity .4s; }
.scan-ml-bar-fill  { height: 100%; border-radius: 4px; transition: width .6s ease, opacity .4s; width: var(--ml-bar-pct, 0%); }
.scan-ml-bar-safe  { background: #22c55e; }
.scan-ml-bar-low   { background: #84cc16; }
.scan-ml-bar-sus   { background: #f59e0b; }
.scan-ml-bar-dan   { background: #ef4444; }

/* Feedback states — applied to the ML panel wrapper */
.scan-ml-panel.scan-ml-flagged-fp .scan-ml-bar-wrap { opacity: .3; }
.scan-ml-panel.scan-ml-flagged-fp .scan-ml-bar-fill  { background: #6b7280; }
.scan-ml-panel.scan-ml-flagged-ct .scan-ml-bar-wrap  { box-shadow: 0 0 0 1px rgba(239,68,68,0.4); }

.scan-ml-verdict-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .22rem .65rem; border-radius: 20px; font-size: .72rem; font-weight: 700;
    margin-left: auto;
}
.scan-ml-verdict-fp { background: rgba(34,197,94,0.13); color: #22c55e; border: 1px solid rgba(34,197,94,0.35); }
.scan-ml-verdict-ct { background: rgba(239,68,68,0.13);  color: #ef4444; border: 1px solid rgba(239,68,68,0.35); }

.scan-ml-labels { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: var(--pdf-text-muted, #9898b0); margin-bottom: .6rem; }
.scan-ml-context { font-size: .75rem; color: var(--pdf-text-muted, #9898b0); margin-bottom: .85rem; font-style: italic; }
.scan-ml-feedback { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.scan-ml-fb-btn {
    padding: .35rem .85rem;
    border-radius: 6px;
    border: 1px solid;
    font-size: .78rem;
    cursor: pointer;
    background: transparent;
    transition: background .2s, color .2s;
}
.scan-ml-fb-fp  { border-color: #22c55e; color: #22c55e; }
.scan-ml-fb-fp:hover  { background: rgba(34,197,94,0.12); }
.scan-ml-fb-ct  { border-color: #ef4444; color: #ef4444; }
.scan-ml-fb-ct:hover  { background: rgba(239,68,68,0.12); }
.scan-ml-fb-note { font-size: .7rem; color: var(--pdf-text-muted,#9898b0); font-style: italic; }
.scan-ml-fb-sent { font-size: .78rem; color: #a3e635; font-style: italic; }

/* ── Threat Intelligence tab ── */
.scan-ti-panel { padding: .5rem 0; }
.scan-ti-hash  { display: flex; align-items: center; gap: .7rem; margin: .6rem 0 1rem; font-size: .82rem; }
.scan-ti-label { font-weight: 700; color: var(--pdf-text-muted,#9898b0); min-width: 4.5rem; }
.scan-ti-hash code { font-size: .75rem; background: rgba(255,255,255,0.06); padding: .15rem .5rem; border-radius: 4px; word-break: break-all; }
.scan-section-subhead { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pdf-text-muted,#9898b0); margin: 1rem 0 .4rem; border-top: 1px solid rgba(255,255,255,0.06); padding-top: .75rem; }
.scan-mitre-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.scan-mitre-chip { font-size: .74rem; padding: .25rem .6rem; border-radius: 5px; background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; }
.scan-mitre-chip strong { color: #818cf8; margin-right: .3rem; }

/* ── Sanitize — about section (scan-san-*) ───────────────────────────────── */
.scan-about-sanitize { border-top: 1px solid rgba(255,255,255,0.07); padding-top: .7rem; }

.scan-san-hdr { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; flex-wrap: wrap; }
.scan-san-hdr-title { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9898b0; }
.scan-san-hdr-pills { display: flex; gap: .25rem; }
.scan-san-hdr-pill  { font-size: .62rem; font-weight: 700; letter-spacing: .04em; padding: .1rem .4rem; border-radius: 100px; }
.scan-san-hdr-pill-basic { background: rgba(34,197,94,.1);  color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.scan-san-hdr-pill-adv   { background: rgba(168,85,247,.1); color: #c084fc; border: 1px solid rgba(168,85,247,.2); }

.scan-san-tier-row { display: flex; align-items: center; gap: .45rem; margin: .35rem 0 .25rem; }
.scan-san-tier-lbl { font-size: .6rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #9898b0; white-space: nowrap; }
.scan-san-tier-row::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.06); }

.scan-san-info-list { display: grid; grid-template-columns: 1fr 1fr; gap: .28rem; }
.scan-san-info-row {
    display: flex; align-items: center; gap: .5rem;
    padding: .32rem .7rem .32rem .9rem;
    border-radius: 7px; border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
    position: relative;
}
.scan-san-info-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.scan-san-row-flatten::before { background: linear-gradient(180deg,#22c55e,#16a34a); }
.scan-san-row-strip::before   { background: linear-gradient(180deg,#60a5fa,#3b82f6); }
.scan-san-info-icon { font-size: .95rem; flex-shrink: 0; }
.scan-san-info-name { font-size: .76rem; font-weight: 700; color: #e8e8f0; flex: 1; min-width: 0; }
.scan-san-info {
    flex-shrink: 0; font-size: .6rem; font-weight: 700; line-height: 1;
    width: 1.1rem; height: 1.1rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.15); color: #6e7681;
    transition: border-color .15s, color .15s;
}
.scan-san-info:hover { border-color: rgba(255,255,255,.35); color: #a0a0c0; }

.scan-san-badge { display: inline-flex; align-items: center; font-size: .6rem; font-weight: 700; letter-spacing: .04em; padding: .1rem .38rem; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.scan-san-badge-safe     { background: rgba(34,197,94,.12);  color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.scan-san-badge-moderate { background: rgba(96,165,250,.12); color: #93c5fd; border: 1px solid rgba(96,165,250,.2); }
.scan-san-badge-targeted { background: rgba(168,85,247,.12); color: #c084fc; border: 1px solid rgba(168,85,247,.2); }

.scan-san-chip-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .28rem; }
.scan-san-chip {
    display: flex; align-items: center; gap: .32rem;
    padding: .3rem .45rem;
    border-radius: 6px; border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
    transition: border-color .15s, background .15s;
}
.scan-san-chip:hover { border-color: rgba(168,85,247,.35); background: rgba(168,85,247,.05); }
.scan-san-chip-icon { font-size: .82rem; flex-shrink: 0; }
.scan-san-chip-name { font-size: .67rem; font-weight: 600; color: #c4c4d8; line-height: 1.2; }

@media (max-width: 600px) { .scan-about-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .scan-san-chip-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .scan-san-chip-grid { grid-template-columns: repeat(3, 1fr); } .scan-san-info-list { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .scan-san-chip-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Tooltip system ──────────────────────────────────────────────────────── */
.scan-has-tip {
    position: relative;
    cursor: help;
}
.scan-has-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    white-space: pre-line;
    width: max-content;
    max-width: 300px;
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 7px;
    padding: .55rem .75rem;
    font-size: .75rem;
    line-height: 1.5;
    color: #d0d0e8;
    font-family: inherit;
    font-weight: 400;
    text-align: left;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 9999;
    /* keep within viewport edges */
    left: clamp(calc(-1 * (300px - 100%) / 2), 50%, calc(100vw - 320px));
    transform: none;
}
.scan-has-tip:hover::after { opacity: 1; }

/* ── Risk banners */
.scan-risk-banner {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    border-radius: 10px;
    padding: 1.4rem 1.6rem;
    margin: 1.4rem 0 1rem;
    border: 2px solid transparent;
}
.scan-risk-clean      { background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.35);  }
.scan-risk-low        { background: rgba(234,179,8,0.12);  border-color: rgba(234,179,8,0.35);  }
.scan-risk-suspicious { background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.35); }
.scan-risk-high-risk  { background: rgba(234,88,12,0.14);  border-color: rgba(234,88,12,0.55);  }
.scan-risk-dangerous  { background: rgba(239,68,68,0.14);  border-color: rgba(239,68,68,0.5);   }

.scan-banner-left  { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; flex-shrink: 0; }
.scan-banner-icon  { font-size: 2.4rem; line-height: 1; }
.scan-banner-body  { flex: 1; min-width: 0; }
.scan-banner-title { font-size: 1.25rem; font-weight: 700; color: var(--pdf-text, #e8e8f0); margin-bottom: .25rem; }
.scan-banner-desc  { font-size: .92rem; color: var(--pdf-text-muted, #9898b0); margin-bottom: .4rem; }
.scan-banner-score { font-size: .82rem; font-family: monospace; color: var(--pdf-text-muted, #9898b0); }

/* Score meter */
.scan-score-meter-wrap { width: 100%; margin-top: .6rem; }
.scan-score-label      { font-size: .75rem; color: var(--pdf-text-muted, #9898b0); margin-bottom: .25rem; }
.scan-score-meter-bg   { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.scan-score-meter-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.scan-score-clean      .scan-score-meter-fill { background: #22c55e; }
.scan-score-low        .scan-score-meter-fill { background: #eab308; }
.scan-score-suspicious .scan-score-meter-fill { background: #f97316; }
.scan-score-dangerous  .scan-score-meter-fill { background: #ef4444; }

/* Stats row */
.scan-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: .6rem;
    margin: .8rem 0 1.4rem;
}
.scan-stat-cell  { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: .7rem .9rem; text-align: center; }
.scan-stat-label { font-size: .74rem; color: var(--pdf-text-muted, #9898b0); margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .04em; }
.scan-stat-value { font-size: 1.05rem; font-weight: 600; color: var(--pdf-text, #e8e8f0); }
.scan-stat-alert .scan-stat-value { color: #f87171; }

/* Engine chips strip */
.scan-engines-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 1rem 0 .6rem;
}
.scan-engine-chip {
    font-size: .75rem;
    font-weight: 600;
    padding: .28rem .7rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: var(--pdf-text-muted, #9898b0);
    transition: background .25s, border-color .25s, color .25s;
    position: relative;
    overflow: hidden;
}
.scan-chip-running {
    border-color: var(--pdf-amber, #ff8c00);
    color: var(--pdf-amber, #ff8c00);
    background: rgba(255,140,0,0.1);
    animation: scan-chip-pulse 1s ease-in-out infinite;
}
.scan-chip-done {
    border-color: rgba(34,197,94,0.5);
    color: #4ade80;
    background: rgba(34,197,94,0.1);
}
@keyframes scan-chip-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .55; }
}
/* AI chip — violet accent, overrides amber when running */
.scan-chip-ai {
    border-color: rgba(167,139,250,0.4);
    color: #a78bfa;
}
.scan-chip-ai.scan-chip-running {
    border-color: #a78bfa;
    color: #a78bfa;
    background: rgba(167,139,250,0.12);
    animation: scan-chip-ai-pulse 1.4s ease-in-out infinite;
}
@keyframes scan-chip-ai-pulse {
    0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(167,139,250,0); }
    50%       { opacity: .75; box-shadow: 0 0 8px 2px rgba(167,139,250,0.35); }
}

/* Tab bar */
.scan-tabs {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    padding: .3rem;
    margin: 1.4rem 0 0;
}
.scan-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: .5rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--pdf-text-muted, #9898b0);
    cursor: pointer;
    transition: color .18s, background .18s, border-color .18s;
    display: flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
}
.scan-tab-btn:hover {
    color: var(--pdf-text, #e8e8f0);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}
.scan-tab-active {
    color: #fff !important;
    background: rgba(255,140,0,0.18) !important;
    border-color: rgba(255,140,0,0.45) !important;
    box-shadow: 0 0 0 1px rgba(255,140,0,0.2);
}
.scan-tab-active .scan-tab-badge {
    background: rgba(255,140,0,0.35);
    color: #ffd27a;
}

.scan-tab-badge {
    font-size: .68rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 10px;
    background: rgba(249,115,22,0.25);
    color: #fb923c;
    min-width: 1.4em;
    text-align: center;
}

/* Clickable stat cells (Threats / URLs / Streams) */
.scan-stat-link {
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .1s;
}
.scan-stat-link:hover {
    border-color: rgba(255,140,0,0.45) !important;
    background: rgba(255,140,0,0.08) !important;
    transform: translateY(-1px);
}
.scan-stat-link .scan-stat-label::after {
    content: ' ↗';
    font-size: .65rem;
    opacity: .55;
}
.scan-tab-panel { padding: 1rem 0; }

/* ML tab badge — blue-tinted to distinguish from threat count */
#scan-tab-ml-badge { background: rgba(99,179,237,0.2); color: #90cdf4; }

/* Section headings inside tabs */
.scan-section-head  { font-size: 1rem; font-weight: 700; color: var(--pdf-text, #e8e8f0); margin: 1.4rem 0 .4rem; }
.scan-section-head:first-child { margin-top: 0; }
.scan-section-intro { font-size: .85rem; color: var(--pdf-text-muted, #9898b0); margin-bottom: .9rem; }

.scan-more-link {
    display: inline-block;
    font-size: .82rem;
    color: var(--pdf-amber, #ff8c00);
    cursor: pointer;
    margin-top: .6rem;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
}
.scan-more-link:hover { opacity: .8; }

/* Engines summary pills (in Summary tab) */
.scan-engines-summary       { margin: .6rem 0 1.4rem; }
.scan-engines-summary-label { font-size: .78rem; color: var(--pdf-text-muted, #9898b0); margin-bottom: .45rem; text-transform: uppercase; letter-spacing: .04em; }
.scan-engines-list          { display: flex; flex-wrap: wrap; gap: .35rem; }
.scan-engine-pill {
    font-size: .74rem;
    padding: .2rem .6rem;
    border-radius: 20px;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #4ade80;
}

/* Indicators */
.scan-indicators-section  { margin: 0 0 1.4rem; }
.scan-indicators-heading  { font-size: 1rem; font-weight: 600; color: var(--pdf-text, #e8e8f0); margin-bottom: .8rem; }

/* Risk group headings in Threats tab */
.scan-risk-head-critical { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #f87171; margin: 1.1rem 0 .45rem; padding-left: .3rem; border-left: 3px solid #ef4444; }
.scan-risk-head-high     { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #fb923c; margin: 1.1rem 0 .45rem; padding-left: .3rem; border-left: 3px solid #f97316; }
.scan-risk-head-medium   { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #fbbf24; margin: 1.1rem 0 .45rem; padding-left: .3rem; border-left: 3px solid #eab308; }
.scan-risk-head-low      { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #60a5fa; margin: 1.1rem 0 .45rem; padding-left: .3rem; border-left: 3px solid #3b82f6; }

/* ── Indicator cards (multi-row) ─────────────────────────────── */
.scan-ind-card {
    border-radius: 8px;
    margin-bottom: .55rem;
    padding: .75rem 1rem;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.07);
    border-left-width: 4px;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.scan-ind-critical { border-left-color: #ef4444; background: rgba(239,68,68,.04); }
.scan-ind-high     { border-left-color: #f97316; background: rgba(249,115,22,.04); }
.scan-ind-medium   { border-left-color: #eab308; background: rgba(234,179,8,.04); }
.scan-ind-low      { border-left-color: #3b82f6; background: rgba(59,130,246,.04); }

.scan-ind-topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.scan-ind-badge {
    font-size: .67rem; font-weight: 800; letter-spacing: .07em;
    padding: .18rem .5rem; border-radius: 4px; white-space: nowrap;
    flex-shrink: 0;
}
.scan-ind-critical .scan-ind-badge { background: rgba(239,68,68,.22);  color: #f87171; }
.scan-ind-high     .scan-ind-badge { background: rgba(249,115,22,.22); color: #fb923c; }
.scan-ind-medium   .scan-ind-badge { background: rgba(234,179,8,.22);  color: #fbbf24; }
.scan-ind-low      .scan-ind-badge { background: rgba(59,130,246,.22); color: #60a5fa; }

.scan-ind-engine-label {
    font-size: .72rem; color: var(--pdf-text-muted, #9898b0);
    font-style: italic; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scan-ind-count-pill {
    font-family: monospace; font-size: .75rem; font-weight: 700;
    padding: .12rem .45rem; border-radius: 20px;
    background: rgba(255,255,255,0.08); color: var(--pdf-text-muted, #9898b0);
    flex-shrink: 0;
}
.scan-ind-critical .scan-ind-count-pill { background: rgba(239,68,68,.15);  color: #f87171; }
.scan-ind-high     .scan-ind-count-pill { background: rgba(249,115,22,.15); color: #fb923c; }
.scan-ind-medium   .scan-ind-count-pill { background: rgba(234,179,8,.15);  color: #fbbf24; }
.scan-ind-low      .scan-ind-count-pill { background: rgba(59,130,246,.15); color: #93c5fd; }

.scan-ind-card-key {
    font-size: .9rem; font-weight: 600;
    color: var(--pdf-text, #e8e8f0);
    line-height: 1.35;
    word-break: break-word;
}
.scan-ind-card-desc {
    font-size: .82rem; line-height: 1.6;
    color: var(--pdf-text-muted, #9898b0);
    word-break: break-word;
}
.scan-ind-card-ctx {
    font-size: .74rem; font-family: monospace;
    color: var(--pdf-text-muted, #9898b0);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: .3rem .6rem;
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 5em;
    overflow: hidden;
}

.scan-no-indicators {
    padding: 1rem 1.2rem; border-radius: 8px;
    background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
    color: #4ade80; font-size: .95rem; margin: .8rem 0 1.4rem;
}

/* URLs tab */
.scan-url-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem .8rem;
    border-radius: 7px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: .35rem;
}
.scan-url-text {
    flex: 1;
    font-family: monospace;
    font-size: .8rem;
    color: var(--pdf-text, #e8e8f0);
    word-break: break-all;
    min-width: 0;
}
.scan-url-copy {
    flex-shrink: 0;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    color: var(--pdf-text-muted, #9898b0);
    font-size: .72rem;
    padding: .2rem .55rem;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.scan-url-copy:hover { background: rgba(255,255,255,0.13); color: var(--pdf-text, #e8e8f0); }

/* Streams tab table */
.scan-stream-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem;
    margin-top: .4rem;
}
.scan-stream-th {
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--pdf-text-muted, #9898b0);
    padding: .45rem .75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.scan-stream-td {
    padding: .5rem .75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--pdf-text, #e8e8f0);
    vertical-align: middle;
}
.scan-stream-table tr:last-child .scan-stream-td { border-bottom: none; }
.scan-stream-row-suspicious { background: rgba(249,115,22,0.07); }
.scan-stream-row-suspicious .scan-stream-td:first-child { border-left: 2px solid #f97316; }
/* Entropy-only: informational tint — no indicator raised, observation only */
.scan-stream-row-entropy { background: rgba(234,179,8,0.04); }
.scan-stream-row-entropy .scan-stream-td:first-child { border-left: 2px solid rgba(234,179,8,0.4); }

/* Entropy bar */
.scan-ent-wrap    { display: flex; align-items: center; gap: .45rem; }
.scan-ent-val     { font-family: monospace; font-size: .8rem; min-width: 3.2em; text-align: right; color: var(--pdf-text, #e8e8f0); }
.scan-ent-bar-bg  { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; min-width: 40px; }
.scan-ent-bar-fill { height: 100%; border-radius: 3px; background: #3b82f6; transition: width .3s; }
.scan-ent-high .scan-ent-bar-fill { background: #f97316; }
.scan-ent-high .scan-ent-val      { color: #fb923c; }

/* Metadata tab KV table */
.scan-kv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    margin-bottom: 1.2rem;
}
.scan-kv-table tr { border-bottom: 1px solid rgba(255,255,255,0.05); }
.scan-kv-table tr:last-child { border-bottom: none; }
.scan-kv-key {
    width: 38%;
    padding: .5rem .8rem .5rem .2rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--pdf-text-muted, #9898b0);
    vertical-align: top;
    white-space: nowrap;
}
.scan-kv-val {
    padding: .5rem .2rem .5rem .8rem;
    color: var(--pdf-text, #e8e8f0);
    word-break: break-word;
    font-family: monospace;
    font-size: .84rem;
}

/* Utility classes */
.scan-mono  { font-family: monospace; }
.scan-small { font-size: .78rem; color: var(--pdf-text-muted, #9898b0); }

/* ── Sanitize panel (ssn-*) ──────────────────────────────────────────────── */
.ssn-head { display: flex; align-items: baseline; gap: .6rem; margin: 1.4rem 0 .7rem; flex-wrap: wrap; }
.ssn-head-title { font-size: .95rem; font-weight: 700; color: #e8e8f0; }
.ssn-head-sub   { font-size: .72rem; color: #6e7681; }

.ssn-tier {
    font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: #6e7681; display: flex; align-items: center; gap: .5rem; margin: .65rem 0 .4rem;
}
.ssn-tier::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.06); }

/* Basic 2-col grid */
.ssn-basic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .1rem; }
.ssn-basic-card {
    position: relative; padding: .7rem 1rem .7rem 1.3rem;
    border-radius: 8px; border: 1.5px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.025);
    cursor: pointer; transition: border-color .18s, background .18s;
    display: flex; flex-direction: column; gap: .35rem;
}
.ssn-basic-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    border-radius: 3px 0 0 3px;
}
.ssn-card-flatten::before { background: linear-gradient(180deg,#22c55e,#16a34a); }
.ssn-card-strip::before   { background: linear-gradient(180deg,#60a5fa,#3b82f6); }
.ssn-basic-card:hover              { border-color: rgba(255,140,0,.45); background: rgba(255,140,0,.03); }
.ssn-basic-card.scan-method-active { border-color: #ff8c00; background: rgba(255,140,0,.07); box-shadow: 0 0 0 1px rgba(255,140,0,.12); }
.ssn-basic-row  { display: flex; align-items: center; gap: .6rem; }
.ssn-basic-icon { font-size: 1.35rem; flex-shrink: 0; line-height: 1; }
.ssn-basic-name { font-size: .86rem; font-weight: 700; color: #e8e8f0; flex: 1; min-width: 0; }
.ssn-basic-info {
    flex-shrink: 0; font-size: .65rem; font-weight: 700; font-style: normal; line-height: 1;
    width: 1.25rem; height: 1.25rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.15); color: #6e7681;
    transition: border-color .15s, color .15s;
}
.ssn-basic-info:hover { border-color: rgba(255,255,255,.35); color: #a0a0c0; }
.ssn-basic-findings { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.ssn-finding        { display: inline-flex; align-items: center; font-size: .7rem; line-height: 1.4; }
.ssn-finding-chip   { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; padding: .13rem .42rem; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.ssn-finding-label  { font-size: .68rem; color: #6e7681; font-weight: 400; margin-right: .1rem; }
.ssn-finding-ok     { background: rgba(63,185,80,.1); border: 1px solid rgba(63,185,80,.25); color: #7ecf87; }
.ssn-finding-warn   { background: rgba(248,147,29,.1); border: 1px solid rgba(248,147,29,.35); color: #f8931d; }

/* Recommendation banner */
.ssn-rec {
    display: flex; align-items: flex-start; gap: .5rem;
    font-size: .78rem; line-height: 1.5;
    padding: .55rem .8rem; border-radius: 6px; margin-bottom: .85rem;
}
.ssn-rec-danger { background: rgba(248,81,73,.08); border: 1px solid rgba(248,81,73,.25); color: #f08080; }
.ssn-rec-warn   { background: rgba(210,153,34,.08); border: 1px solid rgba(210,153,34,.25); color: #d4a84b; }
.ssn-rec-ok     { background: rgba(63,185,80,.07); border: 1px solid rgba(63,185,80,.2); color: #7ecf87; }

/* Advanced 7-col compact strip */
.ssn-adv-grid {
    display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem;
}
.ssn-adv-card {
    display: flex; align-items: center; gap: .45rem;
    padding: .42rem .7rem;
    border-radius: 8px; border: 1.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    cursor: pointer; transition: border-color .18s, background .18s;
}
.ssn-adv-card:hover              { border-color: rgba(168,85,247,.45); background: rgba(168,85,247,.06); }
.ssn-adv-card.scan-method-active { border-color: #ff8c00; background: rgba(255,140,0,.07); box-shadow: 0 0 0 1px rgba(255,140,0,.12); }
/* Dynamic states set by JS after scan */
.ssn-adv-card-hit   { border-color: rgba(248,147,29,.5) !important; background: rgba(248,147,29,.06) !important; }
.ssn-adv-card-hit:hover { border-color: rgba(248,147,29,.8) !important; }
.ssn-adv-card-clean { opacity: .5; }
.ssn-adv-card-clean:hover { opacity: .85; }
.ssn-adv-icon { font-size: .95rem; line-height: 1; flex-shrink: 0; }
.ssn-adv-name { font-size: .76rem; font-weight: 600; color: #e8e8f0; flex: 1; }

/* Shared badge */
.ssn-badge { display: inline-flex; align-items: center; font-size: .64rem; font-weight: 700; letter-spacing: .04em; padding: .13rem .46rem; border-radius: 4px; white-space: nowrap; align-self: flex-start; }
.ssn-badge-safe     { background: rgba(34,197,94,.12);  color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.ssn-badge-moderate { background: rgba(96,165,250,.12); color: #93c5fd; border: 1px solid rgba(96,165,250,.2); }
.ssn-badge-targeted { background: rgba(168,85,247,.12); color: #c084fc; border: 1px solid rgba(168,85,247,.2); }

.scan-sanitize-status-ok    { color: #4ade80; font-size: .88rem; margin: .55rem 0; }
.scan-sanitize-status-error { color: #f87171; font-size: .88rem; margin: .55rem 0; }
#scan-download-area { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }

@media (max-width: 580px) { .ssn-basic-grid { grid-template-columns: 1fr; } }

/* ── Forensic Console ────────────────────────────────────────────────────── */
.scan-console {
    margin: 1.2rem 0 .8rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: #0d1117;
    box-shadow: 0 4px 24px rgba(0,0,0,.55);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

.scan-console-header {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem 1rem;
    background: #161b22;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    user-select: none;
}

.scan-console-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.scan-con-dot-red   { background: #ff5f57; }
.scan-con-dot-amber { background: #febc2e; }
.scan-con-dot-green { background: #28c840; }

.scan-console-title {
    font-size: .8rem;
    font-weight: 600;
    color: #8b949e;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-left: .3rem;
}

.scan-console-subtitle {
    font-size: .75rem;
    color: #3d444d;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scan-console-controls {
    display: flex;
    gap: .4rem;
    margin-left: auto;
    flex-shrink: 0;
}

.scan-console-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #8b949e;
    border-radius: 5px;
    padding: .18rem .55rem;
    font-size: .72rem;
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: inherit;
}
.scan-console-btn:hover { background: rgba(255,255,255,0.12); color: #e6edf3; }

.scan-console-body {
    max-height: 340px;
    overflow-y: auto;
    padding: .6rem .2rem;
    scrollbar-width: thin;
    scrollbar-color: #30363d #0d1117;
    transition: max-height .25s ease;
}
.scan-console-body.scan-console-collapsed { max-height: 0; padding: 0; overflow: hidden; }
.scan-console-body::-webkit-scrollbar       { width: 6px; }
.scan-console-body::-webkit-scrollbar-track { background: #0d1117; }
.scan-console-body::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

.scan-con-line {
    display: flex;
    align-items: baseline;
    gap: .7rem;
    padding: .14rem 1rem;
    font-size: .78rem;
    line-height: 1.55;
    border-bottom: 1px solid transparent;
    transition: background .1s;
}
.scan-con-line:hover { background: rgba(255,255,255,0.03); }

.scan-con-ts {
    flex-shrink: 0;
    color: #3d444d;
    font-size: .72rem;
    letter-spacing: .01em;
    min-width: 100px;
}

.scan-con-badge {
    flex-shrink: 0;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .07em;
    padding: .05rem .38rem;
    border-radius: 3px;
    min-width: 52px;
    text-align: center;
}

.scan-con-msg { color: #c9d1d9; flex: 1; word-break: break-word; }

/* Level colours */
.scan-con-info   .scan-con-badge { background: rgba(139,148,158,.15); color: #8b949e; }
.scan-con-info   .scan-con-ts    { color: #3d444d; }

.scan-con-start  .scan-con-badge { background: rgba(56,139,253,.18); color: #58a6ff; }
.scan-con-start  .scan-con-msg   { color: #58a6ff; }
.scan-con-start  .scan-con-ts    { color: #3d5a80; }

.scan-con-done   .scan-con-badge { background: rgba(35,134,54,.22); color: #3fb950; }
.scan-con-done   .scan-con-msg   { color: #3fb950; }
.scan-con-done   .scan-con-ts    { color: #1a3a1a; }

.scan-con-warn   .scan-con-badge { background: rgba(210,153,34,.2); color: #d29922; }
.scan-con-warn   .scan-con-msg   { color: #d29922; }
.scan-con-warn   .scan-con-ts    { color: #3a2a00; }

.scan-con-error  .scan-con-badge { background: rgba(248,81,73,.2); color: #f85149; }
.scan-con-error  .scan-con-msg   { color: #f85149; }
.scan-con-error  .scan-con-ts    { color: #3a0000; }

.scan-con-upload .scan-con-badge { background: rgba(188,140,255,.18); color: #bc8cff; }
.scan-con-upload .scan-con-msg   { color: #bc8cff; }
.scan-con-upload .scan-con-ts    { color: #2d1a4a; }

.scan-con-section {
    padding: .5rem 1rem .25rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #21262d;
    border-top: 1px solid #21262d;
    margin-top: .2rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .scan-ind-card { padding: .6rem .75rem; }
    .scan-stream-th:nth-child(3),
    .scan-stream-td:nth-child(3) { display: none; }
    .scan-tabs { gap: .15rem; padding: .25rem; }
    .scan-tab-btn { padding: .45rem .6rem; font-size: .8rem; }
}

/* ── Score Tab ────────────────────────────────────────────────────────────── */
.scan-score-gauge {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.4rem 1.6rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    margin-bottom: 1.4rem;
}
.scan-score-big {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: monospace;
    line-height: 1;
    flex-shrink: 0;
}
.scan-score-big.scan-score-c { color: #22c55e; }
.scan-score-big.scan-score-l { color: #eab308; }
.scan-score-big.scan-score-s { color: #f97316; }
.scan-score-big.scan-score-h { color: #ef4444; }
.scan-score-big.scan-score-d { color: #ef4444; text-shadow: 0 0 20px rgba(239,68,68,0.4); }
.scan-score-gauge-meta { flex: 1; min-width: 0; }
.scan-score-gauge-level { font-size: 1.1rem; font-weight: 700; color: var(--pdf-text,#e8e8f0); margin-bottom: .3rem; }
.scan-score-gauge-bar-bg { height: 10px; border-radius: 5px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: .5rem; }
.scan-score-gauge-bar-fill { height: 100%; border-radius: 5px; transition: width .6s ease; }
.scan-score-gauge-note { font-size: .78rem; color: var(--pdf-text-muted,#9898b0); }

.scan-eng-contrib-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem;
}
.scan-eng-contrib-table th {
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--pdf-text-muted,#9898b0);
    padding: .4rem .7rem;
    border-bottom: 1px solid rgba(255,255,255,0.09);
}
.scan-eng-contrib-table td {
    padding: .45rem .7rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
    color: var(--pdf-text,#e8e8f0);
}
.scan-eng-contrib-table tr:last-child td { border-bottom: none; }
.scan-eng-contrib-table tr:hover td { background: rgba(255,255,255,0.025); }
.scan-eng-contrib-pts { font-family: monospace; font-weight: 700; text-align: right; }
.scan-eng-contrib-pts.scan-pts-crit { color: #f87171; }
.scan-eng-contrib-pts.scan-pts-high { color: #fb923c; }
.scan-eng-contrib-pts.scan-pts-med  { color: #fbbf24; }
.scan-eng-contrib-pts.scan-pts-low  { color: #60a5fa; }
.scan-eng-contrib-pts.scan-pts-corr { color: #a78bfa; }

.scan-score-by-engine { margin: 1.4rem 0; }
.scan-eng-bar-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .3rem 0;
    font-size: .8rem;
}
.scan-eng-bar-label { width: 12rem; flex-shrink: 0; color: var(--pdf-text-muted,#9898b0); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.scan-eng-bar-wrap  { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; min-width: 60px; }
.scan-eng-bar-fill  { height: 100%; border-radius: 3px; background: #f97316; transition: width .4s ease; }
.scan-eng-bar-pts   { font-family: monospace; font-size: .78rem; color: var(--pdf-text-muted,#9898b0); min-width: 3.5rem; text-align: right; }

/* ── Engines Tab ──────────────────────────────────────────────────────────── */
.scan-engines-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-top: .5rem;
}
@media (max-width: 700px) { .scan-engines-grid { grid-template-columns: 1fr; } }

.scan-eng-card {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 9px;
    padding: .75rem 1rem;
    background: rgba(255,255,255,0.025);
    transition: border-color .15s;
}
.scan-eng-card:hover { border-color: rgba(255,140,0,0.25); }
.scan-eng-card-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .35rem;
}
.scan-eng-num  { font-size: .68rem; font-weight: 700; color: var(--pdf-text-muted,#9898b0); font-family: monospace; min-width: 1.8em; }
.scan-eng-name { font-size: .84rem; font-weight: 600; color: var(--pdf-text,#e8e8f0); flex: 1; }
.scan-eng-status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.scan-eng-dot-ok   { background: #22c55e; }
.scan-eng-dot-warn { background: #f97316; }
.scan-eng-dot-skip { background: rgba(255,255,255,0.2); }
.scan-eng-inds {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin-top: .3rem;
}
.scan-eng-ind-mini {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    font-size: .74rem;
    color: var(--pdf-text-muted,#9898b0);
    padding: .1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.035);
}
.scan-eng-ind-mini:last-child { border-bottom: none; }
.scan-eng-ind-mini .scan-ind-badge {
    font-size: .62rem;
    padding: .08rem .3rem;
    flex-shrink: 0;
}
.scan-eng-ind-key { flex: 1; font-family: monospace; font-size: .72rem; color: var(--pdf-text,#e8e8f0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-eng-clean { font-size: .76rem; color: #4ade80; margin-top: .2rem; }
.scan-eng-skipped { font-size: .76rem; color: rgba(255,255,255,0.25); margin-top: .2rem; font-style: italic; }

/* ── Sandbox Tab ──────────────────────────────────────────────────────────── */
.scan-sandbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .6rem;
    margin: .8rem 0 1.4rem;
}
.scan-sandbox-cell {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    padding: .8rem 1rem;
    text-align: center;
}
.scan-sandbox-cell.scan-sandbox-alert {
    background: rgba(249,115,22,0.08);
    border-color: rgba(249,115,22,0.35);
}
.scan-sandbox-cell.scan-sandbox-critical {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.4);
}
.scan-sandbox-val { font-size: 1.3rem; font-weight: 700; font-family: monospace; color: var(--pdf-text,#e8e8f0); }
.scan-sandbox-cell.scan-sandbox-alert   .scan-sandbox-val { color: #fb923c; }
.scan-sandbox-cell.scan-sandbox-critical .scan-sandbox-val { color: #f87171; }
.scan-sandbox-lbl { font-size: .73rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pdf-text-muted,#9898b0); margin-top: .2rem; }

.scan-sandbox-renderer {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    padding: .25rem .65rem;
    border-radius: 20px;
    background: rgba(56,189,248,0.1);
    border: 1px solid rgba(56,189,248,0.25);
    color: #7dd3fc;
    margin: .2rem;
}

/* ── Signature Tab ────────────────────────────────────────────────────────── */
.scan-sig-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    margin-bottom: 1rem;
}
.scan-sig-icon { font-size: 2rem; flex-shrink: 0; }
.scan-sig-info { flex: 1; }
.scan-sig-title { font-size: .95rem; font-weight: 700; color: var(--pdf-text,#e8e8f0); }
.scan-sig-desc  { font-size: .8rem; color: var(--pdf-text-muted,#9898b0); margin-top: .2rem; }

.scan-cert-card {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: .7rem .9rem;
    margin-bottom: .5rem;
    background: rgba(255,255,255,0.025);
}
.scan-cert-title { font-size: .8rem; font-weight: 700; color: var(--pdf-text-muted,#9898b0); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }

/* ── Phishing Tab ─────────────────────────────────────────────────────────── */
.scan-phishing-score-wrap {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.4rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    margin-bottom: 1.2rem;
}
.scan-phishing-score-num { font-size: 2.8rem; font-weight: 800; font-family: monospace; color: var(--pdf-text,#e8e8f0); }
.scan-phishing-score-num.scan-phish-danger { color: #f87171; text-shadow: 0 0 16px rgba(239,68,68,0.3); }
.scan-phishing-score-num.scan-phish-warn   { color: #fbbf24; }
.scan-phishing-score-label { font-size: .9rem; color: var(--pdf-text-muted,#9898b0); }

.scan-phrase-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: .4rem 0 .9rem;
}
.scan-phrase-tag {
    font-size: .76rem;
    padding: .2rem .6rem;
    border-radius: 20px;
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.28);
    color: #fbbf24;
}
.scan-brand-tag {
    font-size: .76rem;
    padding: .2rem .6rem;
    border-radius: 20px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.28);
    color: #f87171;
}

.scan-qr-item {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .6rem .9rem;
    border-radius: 7px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: .4rem;
    font-size: .82rem;
}
.scan-qr-url  { font-family: monospace; color: #60a5fa; word-break: break-all; }
.scan-ocr-box {
    font-size: .78rem;
    font-family: monospace;
    padding: .7rem 1rem;
    border-radius: 7px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--pdf-text-muted,#9898b0);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 14em;
    overflow-y: auto;
    margin-top: .4rem;
}

/* ── Embedded Files Tab ───────────────────────────────────────────────────── */
.scan-emb-file-card {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: .9rem 1.1rem;
    margin-bottom: .75rem;
    background: rgba(255,255,255,0.025);
}
.scan-emb-file-head {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .5rem;
}
.scan-emb-file-icon { font-size: 1.3rem; flex-shrink: 0; }
.scan-emb-file-name { font-family: monospace; font-size: .88rem; font-weight: 600; color: var(--pdf-text,#e8e8f0); flex: 1; word-break: break-all; }
.scan-emb-file-size { font-size: .75rem; color: var(--pdf-text-muted,#9898b0); flex-shrink: 0; }
.scan-emb-type-badge {
    font-size: .68rem; font-weight: 700; letter-spacing: .05em;
    padding: .15rem .5rem; border-radius: 4px;
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
}
.scan-emb-imports {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin: .4rem 0;
}
.scan-emb-import-tag {
    font-size: .71rem;
    padding: .15rem .5rem;
    border-radius: 4px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
    font-family: monospace;
}
.scan-emb-strings {
    font-size: .75rem;
    font-family: monospace;
    color: var(--pdf-text-muted,#9898b0);
    background: rgba(255,255,255,0.035);
    border-radius: 5px;
    padding: .4rem .6rem;
    margin-top: .35rem;
    max-height: 6em;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── MITRE Tab ────────────────────────────────────────────────────────────── */
.scan-mitre-full-card {
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 9px;
    padding: .75rem 1rem;
    margin-bottom: .5rem;
    background: rgba(99,102,241,0.07);
    display: flex;
    align-items: flex-start;
    gap: .9rem;
}
.scan-mitre-full-id {
    font-family: monospace;
    font-size: .78rem;
    font-weight: 700;
    color: #818cf8;
    background: rgba(99,102,241,0.15);
    padding: .2rem .55rem;
    border-radius: 5px;
    flex-shrink: 0;
    margin-top: .1rem;
}
.scan-mitre-full-name { font-size: .88rem; font-weight: 600; color: var(--pdf-text,#e8e8f0); line-height: 1.4; }
.scan-mitre-full-tactic { font-size: .73rem; color: var(--pdf-text-muted,#9898b0); margin-top: .15rem; }

/* ── Raw JSON Tab ─────────────────────────────────────────────────────────── */
.scan-raw-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .6rem;
}
.scan-raw-note { font-size: .78rem; color: var(--pdf-text-muted,#9898b0); flex: 1; }
.scan-raw-copy-btn {
    font-size: .75rem;
    padding: .3rem .8rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--pdf-text-muted,#9898b0);
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: inherit;
}
.scan-raw-copy-btn:hover { background: rgba(255,255,255,0.12); color: var(--pdf-text,#e8e8f0); }
.scan-raw-json {
    font-family: 'SF Mono','Fira Code','Cascadia Code','Consolas',monospace;
    font-size: .75rem;
    line-height: 1.6;
    background: #0d1117;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    overflow: auto;
    max-height: 72vh;
    white-space: pre;
    color: #c9d1d9;
    scrollbar-width: thin;
    scrollbar-color: #30363d #0d1117;
}
.scan-raw-json::-webkit-scrollbar       { width: 6px; height: 6px; }
.scan-raw-json::-webkit-scrollbar-track { background: #0d1117; }
.scan-raw-json::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
/* JSON syntax colours */
.sjk { color: #79c0ff; }   /* key   */
.sjs { color: #a5d6ff; }   /* string value */
.sjn { color: #f97316; }   /* number */
.sjb { color: #ff7b72; }   /* boolean */
.sjl { color: #8b949e; }   /* null */
.sjp { color: #6e7681; }   /* punctuation */

/* ── Enhanced TI: domain/campaign rows ───────────────────────────────────── */
.scan-ti-domain-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .7rem;
    border-radius: 6px;
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2);
    margin-bottom: .3rem;
    font-size: .8rem;
}
.scan-ti-domain-badge { font-size: .65rem; font-weight: 700; padding: .1rem .35rem; border-radius: 3px; background: rgba(239,68,68,0.2); color: #f87171; flex-shrink: 0; }
.scan-ti-domain-url   { font-family: monospace; color: var(--pdf-text,#e8e8f0); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-ti-domain-type  { font-size: .7rem; color: var(--pdf-text-muted,#9898b0); flex-shrink: 0; }

.scan-camp-sim-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .7rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: .3rem;
    font-size: .78rem;
    font-family: monospace;
}
.scan-camp-sim-pct  { min-width: 3.5em; text-align: right; font-weight: 700; }
.scan-camp-sim-hash { flex: 1; color: var(--pdf-text-muted,#9898b0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-camp-sim-score{ color: #fb923c; }

/* Enhanced Metadata: full structure table */
.scan-structure-section { margin-top: 1.4rem; }

/* ── Engine Two-Panel Browser ── */
.scan-eng-browser {
    display: flex;
    gap: 0;
    min-height: 520px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
}
.scan-eng-sidebar {
    width: 240px;
    flex-shrink: 0;
    overflow-y: auto;
    background: rgba(255,255,255,0.025);
    border-right: 1px solid rgba(255,255,255,0.08);
}
.scan-eng-sidebar-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background .15s;
    font-size: .8rem;
    line-height: 1.3;
}
.scan-eng-sidebar-item:hover { background: rgba(255,255,255,0.05); }
.scan-eng-sidebar-item.scan-eng-sidebar-active {
    background: rgba(99,102,241,0.18);
    border-left: 3px solid #6366f1;
}
.scan-eng-sidebar-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--pdf-text,#e8e8f0);
}
.scan-eng-sidebar-count {
    font-size: .68rem;
    font-weight: 700;
    background: rgba(239,68,68,0.25);
    color: #fca5a5;
    padding: .1rem .4rem;
    border-radius: 20px;
    flex-shrink: 0;
}
.scan-eng-detail {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.4rem;
    min-width: 0;
}
.scan-eng-detail-hdr {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}
.scan-eng-detail-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pdf-text,#e8e8f0);
    flex: 1;
}
.scan-eng-detail-warn {
    font-size: .78rem;
    padding: .2rem .6rem;
    border-radius: 4px;
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    font-weight: 600;
}
.scan-eng-detail-section {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pdf-text-muted,#9898b0);
    margin: 1.1rem 0 .55rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.scan-eng-detail-empty {
    font-size: .88rem;
    color: var(--pdf-text-muted,#9898b0);
    padding: 2rem 0;
    text-align: center;
}
.scan-eng-stream-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .4rem .6rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: .3rem;
    font-size: .8rem;
}
.scan-eng-stream-title {
    font-family: monospace;
    color: var(--pdf-text,#e8e8f0);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scan-eng-url-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .3rem .5rem;
    border-radius: 5px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: .25rem;
    font-size: .78rem;
}
.scan-eng-url-text {
    font-family: monospace;
    flex: 1;
    word-break: break-all;
    color: var(--pdf-text,#e8e8f0);
}
@media (max-width: 700px) {
    .scan-eng-browser { flex-direction: column; }
    .scan-eng-sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); max-height: 220px; }
}

/* ── Engine detail: stream table ── */
.scan-eng-stream-tbl { width: 100%; }
.scan-ent-high { color: #fb923c !important; font-weight: 700; }
.scan-muted { color: var(--pdf-text-muted,#9898b0); }
.scan-small { font-size: .78rem; margin-bottom: .4rem; }

/* ── ML SHAP explanation bars ── */
.scan-ml-shap-list, .scan-ml-fi-list { display: flex; flex-direction: column; gap: .4rem; }
.scan-ml-shap-row, .scan-ml-fi-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .8rem;
    flex-wrap: nowrap;
}
.scan-ml-shap-feat, .scan-ml-fi-name {
    width: 10rem;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .78rem;
    color: var(--pdf-text,#e8e8f0);
}
.scan-ml-shap-bar-bg, .scan-ml-fi-bar-bg {
    flex: 1;
    height: 7px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}
.scan-ml-shap-bar-fill { height: 100%; border-radius: 4px; }
.scan-ml-mal-fill { background: #ef4444; }
.scan-ml-ben-fill { background: #22c55e; }
.scan-ml-fi-bar-fill { height: 100%; border-radius: 4px; background: #6366f1; }
.scan-ml-shap-val { font-size: .76rem; font-weight: 700; width: 5.5rem; flex-shrink: 0; }
.scan-ml-shap-raw { font-size: .72rem; color: var(--pdf-text-muted,#9898b0); white-space: nowrap; }
.scan-ml-fi-val   { font-size: .74rem; color: var(--pdf-text-muted,#9898b0); white-space: nowrap; }
.scan-ml-mal { color: #fca5a5; }
.scan-ml-ben { color: #4ade80; }

/* ── Raw Forensics Tab ── */
.scan-forensic-section-hdr {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pdf-text-muted,#9898b0);
    margin: 1.4rem 0 .6rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.scan-forensic-obj-hdr {
    font-size: .78rem;
    font-weight: 600;
    font-family: monospace;
    color: #a5b4fc;
    margin: .8rem 0 .25rem;
    padding: .25rem .5rem;
    background: rgba(99,102,241,0.1);
    border-left: 3px solid #6366f1;
    border-radius: 0 4px 4px 0;
    word-break: break-all;
}
.scan-forensic-code {
    font-family: monospace;
    font-size: .77rem;
    line-height: 1.55;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 6px;
    padding: .8rem 1rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 320px;
    overflow-y: auto;
    color: #d1fae5;
    margin-bottom: .5rem;
}
.scan-forensic-code-js { color: #fde68a; }
.scan-forensic-code-stream { color: #bfdbfe; }
.scan-forensic-code-ctx { color: #e9d5ff; }

/* ── Revision History Tab ─────────────────────────────────────── */
.scan-rev-card {
    background: #1c1c2e;
    border: 1px solid #2d2d45;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.scan-rev-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.scan-rev-num {
    font-weight: 700;
    font-size: .85rem;
    color: #e2e2ff;
    background: #2d2d55;
    padding: 3px 10px;
    border-radius: 5px;
}
.scan-rev-date {
    font-size: .78rem;
    color: #9898b0;
    font-family: monospace;
}

/* ── Deep Forensics Tab (Engines 32–43) ─────────────────────── */
.scan-df-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: .8rem 0 1rem;
}
.scan-df-stat-card {
    background: #1c1c2e;
    border: 1px solid #2d2d45;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 90px;
    text-align: center;
    flex: 1 1 90px;
}
.scan-df-stat-card.scan-df-stat-danger {
    border-color: #f59e0b;
    background: rgba(245,158,11,0.08);
}
.scan-df-stat-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: #e2e2ff;
    font-family: monospace;
}
.scan-df-stat-lbl {
    display: block;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9898b0;
    margin-top: 2px;
}
.scan-df-card {
    background: #1c1c2e;
    border: 1px solid #2d2d45;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.scan-df-list { margin: .4rem 0 .8rem; }
.scan-df-list-item {
    font-size: .78rem;
    color: #c4b5fd;
    font-family: monospace;
    padding: 4px 8px;
    border-left: 2px solid #6366f1;
    margin-bottom: 4px;
    background: rgba(99,102,241,0.06);
    border-radius: 0 4px 4px 0;
}
.scan-df-alert {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: .78rem;
    font-family: monospace;
    margin: .5rem 0 .8rem;
    border-left: 4px solid;
}
.scan-df-alert-critical { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #fca5a5; }
.scan-df-alert-high     { background: rgba(245,158,11,0.1); border-color: #f59e0b; color: #fcd34d; }
.scan-df-alert-info     { background: rgba(99,102,241,0.1); border-color: #6366f1; color: #a5b4fc; }
.scan-forensic-section-hdr.scan-forensic-section-danger { color: #f87171; border-color: rgba(239,68,68,0.3); }

/* ── AI Forensic Report ───────────────────────────────────────────────────── */

/* Summary tab — compact AI verdict widget */
.scan-ai-widget {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border: 1px solid #30363d;
    border-left: 4px solid #6366f1;
    border-radius: 10px;
    padding: 16px 18px;
    margin-top: 16px;
}
.scan-ai-widget-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.scan-ai-widget-icon { font-size: 1.5rem; flex-shrink: 0; }
.scan-ai-widget-head-body { flex: 1; }
.scan-ai-widget-title { font-size: .85rem; font-weight: 700; color: #c9d1d9; display: block; }
.scan-ai-widget-model { font-size: .7rem; color: #8b949e; }
.scan-ai-verdict-tag {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid currentColor;
}
.scan-ai-verdict-malicious { color: #f87171; background: rgba(239,68,68,0.12); }
.scan-ai-verdict-suspicious { color: #fb923c; background: rgba(251,146,60,0.12); }
.scan-ai-verdict-clean { color: #4ade80; background: rgba(74,222,128,0.10); }
.scan-ai-verdict-unknown  { color: #9ca3af; background: rgba(156,163,175,0.10); }
.scan-ai-widget-summary { font-size: .83rem; color: #b0bec5; line-height: 1.55; margin-bottom: 10px; }
.scan-ai-widget-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: .73rem;
    color: #6e7681;
}
.scan-ai-conf { }
.scan-ai-widget-link { color: #6366f1; cursor: pointer; }
.scan-ai-widget-link:hover { text-decoration: underline; }
.scan-ai-unavail {
    font-size: .78rem;
    color: #6e7681;
    background: rgba(99,102,241,0.05);
    border: 1px dashed #30363d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 14px;
}

/* AI Report tab */
.scan-ai-report-unavail {
    background: #161b22;
    border: 1px dashed #30363d;
    border-radius: 10px;
    padding: 24px 28px;
    color: #8b949e;
    line-height: 1.6;
    font-size: .85rem;
}
.scan-ai-report-unavail code { color: #58a6ff; background: rgba(56,139,253,0.1); padding: 1px 5px; border-radius: 3px; }
.scan-ai-report-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 24px;
}
.scan-ai-report-banner-icon { font-size: 2rem; flex-shrink: 0; padding-top: 2px; }
.scan-ai-report-banner-body { flex: 1; }
.scan-ai-report-title { font-size: .95rem; font-weight: 700; color: #c9d1d9; margin-bottom: 2px; }
.scan-ai-report-model { font-size: .72rem; color: #8b949e; margin-bottom: 10px; }
.scan-ai-report-verdict {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.ai-v-malicious  { color: #f87171; }
.ai-v-suspicious { color: #fb923c; }
.ai-v-clean      { color: #4ade80; }
.ai-v-unknown    { color: #9ca3af; }
.scan-ai-report-conf { font-size: .75rem; color: #8b949e; }
.scan-ai-report-section-head {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6e7681;
    border-bottom: 1px solid #21262d;
    padding-bottom: 6px;
    margin: 20px 0 12px;
}
.scan-ai-report-prose {
    font-size: .85rem;
    color: #b0bec5;
    line-height: 1.65;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 14px 16px;
}
.scan-ai-report-actor { border-left: 3px solid #6366f1; }
.scan-ai-report-fp    { border-left: 3px solid #3b82f6; }
.scan-ai-report-findings { display: flex; flex-direction: column; gap: 6px; }
.scan-ai-finding-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 7px;
    padding: 10px 14px;
}
.scan-ai-finding-sev {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}
.scan-risk-critical { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.scan-risk-high     { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.scan-risk-medium   { background: rgba(234,179,8,0.12);  color: #fde047; border: 1px solid rgba(234,179,8,0.25); }
.scan-risk-low      { background: rgba(96,165,250,0.12); color: #93c5fd; border: 1px solid rgba(96,165,250,0.25); }
.scan-ai-finding-body { flex: 1; min-width: 0; }
.scan-ai-finding-signal { font-size: .82rem; color: #c9d1d9; margin-bottom: 3px; }
.scan-ai-finding-mitre {
    font-size: .7rem;
    color: #6366f1;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    padding: 1px 7px;
    border-radius: 10px;
    font-family: monospace;
}
.scan-ai-technique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
.scan-ai-technique-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 12px 14px;
}
.scan-ai-technique-id {
    font-size: .72rem;
    font-family: monospace;
    color: #6366f1;
    font-weight: 700;
    margin-bottom: 3px;
}
.scan-ai-technique-name { font-size: .82rem; color: #c9d1d9; margin-bottom: 4px; }
.scan-ai-technique-evidence { font-size: .75rem; color: #8b949e; line-height: 1.4; }
.scan-ai-actions-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.scan-ai-actions-list li {
    background: #161b22;
    border: 1px solid #21262d;
    border-left: 3px solid #4ade80;
    border-radius: 0 7px 7px 0;
    padding: 9px 14px;
    font-size: .83rem;
    color: #b0bec5;
    line-height: 1.5;
}
.scan-ai-report-footer {
    margin-top: 24px;
    padding: 12px 16px;
    background: rgba(99,102,241,0.04);
    border: 1px dashed #30363d;
    border-radius: 8px;
    font-size: .72rem;
    color: #6e7681;
    line-height: 1.5;
}

/* ── Shared AI panel — used by extract-text, redact, compare AI features ── */
.ai-panel {
    margin-top: 1.2rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #21262d;
    font-size: .85rem;
    color: #c9d1d9;
}
.ai-panel-indigo {
    background: #0d1117;
    border-left: 3px solid #6366f1;
}
.ai-panel-loading {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1rem 1.2rem;
    background: #0d1117;
    color: #8b949e;
    border-left: 3px solid #6366f1;
}
.ai-panel-error {
    padding: 1rem 1.2rem;
    background: #160d0d;
    border-left: 3px solid #ef4444;
    color: #fca5a5;
}
.ai-panel-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #6366f1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ai-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes ai-spin {
    to { transform: rotate(360deg); }
}
.ai-panel-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.1rem .6rem;
    border-bottom: 1px solid #21262d;
    flex-wrap: wrap;
}
.ai-panel-robot {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}
.ai-panel-title {
    font-size: .9rem;
    font-weight: 700;
    color: #e8e8f0;
    flex: 1;
    min-width: 0;
}
.ai-panel-badge {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
    padding: .18em .7em;
    border-radius: 20px;
    flex-shrink: 0;
}
.ai-panel-row {
    display: flex;
    align-items: baseline;
    gap: .7rem;
    padding: .45rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ai-panel-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #6e7681;
    min-width: 110px;
    flex-shrink: 0;
}
.ai-panel-value {
    color: #c9d1d9;
    font-size: .84rem;
}
.ai-badge-doctype {
    background: rgba(99,102,241,.18);
    color: #a5b4fc;
    padding: .15em .6em;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 600;
}
.ai-panel-section {
    padding: .7rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ai-panel-section-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #6e7681;
    margin-bottom: .4rem;
}
.ai-panel-text {
    color: #b0bec5;
    line-height: 1.6;
    font-size: .84rem;
}
.ai-panel-recommendation {
    background: rgba(99,102,241,.04);
}
.ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.ai-chip {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 5px;
    padding: .2em .65em;
    font-size: .78rem;
    color: #c9d1d9;
}
.ai-chip-sm {
    font-size: .72rem;
    padding: .15em .5em;
}
.ai-entities {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.ai-entity-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
}
.ai-entity-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6e7681;
    min-width: 90px;
}
.ai-suggest-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.ai-suggest-item {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 7px;
    padding: .6rem .9rem;
}
.ai-suggest-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .3rem;
    flex-wrap: wrap;
}
.ai-suggest-pattern {
    font-family: monospace;
    font-size: .82rem;
    color: #a5b4fc;
    word-break: break-all;
}
.ai-suggest-reason {
    font-size: .77rem;
    color: #8b949e;
    line-height: 1.45;
    margin-bottom: .4rem;
}
.ai-detail-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.ai-detail-list li {
    background: #161b22;
    border: 1px solid #21262d;
    border-left: 3px solid #6366f1;
    border-radius: 0 6px 6px 0;
    padding: .5rem .9rem;
    font-size: .82rem;
    color: #b0bec5;
    line-height: 1.5;
}
.ai-panel-footer {
    padding: .55rem 1.1rem;
    font-size: .7rem;
    color: #484f58;
    border-top: 1px solid #21262d;
    background: rgba(0,0,0,.2);
}

/* ── Enterprise note below upload zone ─────────────────────────────────── */
.scan-enterprise-note {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-top: .9rem;
    padding: .6rem 1rem;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 8px;
    font-size: .8rem;
    color: #9ca3af;
    line-height: 1.5;
}
.scan-enterprise-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.scan-enterprise-text strong {
    color: #c4c9d4;
}
.scan-enterprise-link {
    color: #818cf8;
    text-decoration: none;
}
.scan-enterprise-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

/* ── ML × AI cross-check comparison ────────────────────────────────────── */
.scan-ml-xcheck {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: .75rem;
    margin-top: .9rem;
    padding: .75rem 1rem;
    background: rgba(255,255,255,.03);
    border: 1px solid #21262d;
    border-radius: 8px;
    min-width: 0;
}
.scan-ml-xcheck-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
}
.scan-ml-xcheck-lbl {
    font-size: .7rem;
    color: #6e7681;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.scan-ml-xcheck-chip {
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 4px;
    letter-spacing: .03em;
}
.scan-ml-xcheck-clean   { background: rgba(63,185,80,.12);  color: #3fb950; border: 1px solid rgba(63,185,80,.25); }
.scan-ml-xcheck-sus     { background: rgba(210,153,34,.12); color: #d29922; border: 1px solid rgba(210,153,34,.25); }
.scan-ml-xcheck-threat  { background: rgba(248,81,73,.12);  color: #f85149; border: 1px solid rgba(248,81,73,.25); }
.scan-ml-xcheck-sub {
    font-size: .7rem;
    color: #6e7681;
}
.scan-ml-xcheck-mid {
    flex-shrink: 0;
    text-align: center;
}
.scan-ml-xcheck-agree {
    font-size: .75rem;
    font-weight: 600;
    color: #3fb950;
}
.scan-ml-xcheck-disagree {
    font-size: .75rem;
    font-weight: 600;
    color: #d29922;
}
.scan-ml-xcheck-note {
    margin-top: .6rem;
    font-size: .75rem;
    color: #8b949e;
    line-height: 1.5;
    padding: .4rem .6rem;
    background: rgba(210,153,34,.06);
    border-left: 2px solid rgba(210,153,34,.4);
    border-radius: 0 4px 4px 0;
}
.scan-ml-xcheck-note-ok {
    background: rgba(63,185,80,.05);
    border-left-color: rgba(63,185,80,.3);
}

/* ── File-too-large modal ───────────────────────────────────────────────── */
.scan-size-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: scan-fade-in .15s ease;
}
@keyframes scan-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.scan-size-modal {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    max-width: 440px;
    width: 100%;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
    text-align: center;
    animation: scan-modal-in .18s ease;
}
@keyframes scan-modal-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
.scan-size-modal-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: .75rem;
}
.scan-size-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0883e;
    margin-bottom: .5rem;
}
.scan-size-modal-body {
    font-size: .85rem;
    color: #8b949e;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}
.scan-size-modal-body strong {
    color: #c9d1d9;
}
.scan-size-modal-file {
    display: inline-block;
    background: rgba(240,136,62,.08);
    border: 1px solid rgba(240,136,62,.25);
    border-radius: 6px;
    padding: .25rem .7rem;
    font-size: .8rem;
    color: #f0883e;
    margin-bottom: 1rem;
    word-break: break-all;
}
.scan-size-modal-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.scan-size-modal-dismiss {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    padding: .5rem 1.25rem;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.scan-size-modal-dismiss:hover {
    background: #30363d;
    border-color: #484f58;
}
.scan-size-modal-enterprise {
    background: rgba(99,102,241,.12);
    border: 1px solid rgba(99,102,241,.35);
    color: #818cf8;
    border-radius: 6px;
    padding: .5rem 1.25rem;
    font-size: .85rem;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.scan-size-modal-enterprise:hover {
    background: rgba(99,102,241,.22);
    border-color: rgba(99,102,241,.55);
    color: #a5b4fc;
}

/* ── PDF password / decryption UI ──────────────────────────────────────── */

/* Encrypted-PDF warning banner */
.scan-encrypt-notice {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: linear-gradient(135deg, rgba(234,179,8,.10), rgba(234,179,8,.05));
    border: 1px solid rgba(234,179,8,.40);
    border-left: 3px solid #eab308;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    font-size: .85rem;
    color: #fde68a;
    animation: scan-pw-slide-in .2s ease;
}
.scan-encrypt-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.scan-encrypt-body strong {
    color: #fef08a;
    font-weight: 600;
}

/* Password row — slides in when encryption detected */
.scan-pw-row {
    background: rgba(88,166,255,.04);
    border: 1px solid rgba(88,166,255,.18);
    border-radius: 10px;
    padding: .9rem 1rem;
    margin-bottom: .75rem;
    animation: scan-pw-slide-in .2s ease;
}
.scan-pw-label {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: .82rem;
    font-weight: 600;
    color: #79c0ff;
    margin-bottom: .6rem;
    letter-spacing: .01em;
}
.scan-pw-opt {
    font-weight: 400;
    font-size: .78rem;
    color: #4d6a85;
}

/* Input + toggle wrapper */
.scan-pw-input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.scan-pw-input-wrap:focus-within {
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}
.scan-pw-input {
    flex: 1;
    background: #0d1117;
    border: none;
    color: #c9d1d9;
    font-size: .9rem;
    padding: .6rem .85rem;
    outline: none;
    min-width: 0;
}
.scan-pw-input::placeholder {
    color: #484f58;
}
.scan-pw-toggle {
    background: #161b22;
    border: none;
    border-left: 1px solid #30363d;
    color: #6e7681;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 .75rem;
    line-height: 1;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.scan-pw-toggle:hover {
    background: #21262d;
    color: #c9d1d9;
}
.scan-pw-note {
    font-size: .74rem;
    color: #4d6a85;
    margin: .45rem 0 0;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.scan-pw-note::before {
    content: '🔐';
    font-size: .8rem;
}

@keyframes scan-pw-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Auto-detect help card ──────────────────────────────────────────────── */
.scan-pw-help-card {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    font-size: .8rem;
    color: #8b949e;
    line-height: 1.5;
}
.scan-pw-help-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: .05rem;
}
.scan-pw-help-body strong {
    color: #c9d1d9;
    display: block;
    margin-bottom: .3rem;
}
.scan-pw-help-links {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .6rem;
}
.scan-pw-help-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 6px;
    color: #8b949e;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 500;
    transition: background .15s, border-color .15s, color .15s;
}
.scan-pw-help-link:hover {
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.18);
    color: #c9d1d9;
}
