/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #f7fbf9;
    --bg-card:   #ffffff;
    --bg-hover:  #f0f4f3;
    --border:    #e0e0e0;
    --text:      #1a1a1a;
    --text-dim:  #555;
    --accent:    #1a5f4a;
    --green:     #1a5f4a;
    --amber:     #b45309;
    --red:       #dc2626;
    --radius:    10px;
    --font:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-space: 'Orbitron', 'DM Sans', sans-serif;
    --logo-mark:  #0d1f2a;
    --logo-dish:  #1a4d6b;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
}

code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82em;
    background: rgba(0,0,0,0.05);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    word-break: break-all;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.app-wide {
    max-width: 900px;
}

.app-header {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.app-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 100%;
    width: max-content;
    box-sizing: border-box;
    overflow: visible;
    background: transparent;
    text-decoration: none;
    color: inherit;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    height: 2.65rem;
    width: 2.65rem;
    flex-shrink: 0;
    display: block;
    color: var(--logo-dish);
}
img.logo-icon {
    object-fit: contain;
    object-position: left center;
}
svg.logo-icon {
    overflow: visible;
}

.logo-text {
    font-family: var(--font-space);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--logo-mark);
    line-height: 1;
}

.app-header-text {
    flex: 1 1 12rem;
    min-width: 0;
    text-align: center;
}

.app-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0;
}

.tagline {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.app-footer {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-error {
    border-color: var(--red);
    color: var(--red);
}

.hidden { display: none !important; }

/* === Drop zone === */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(26, 95, 74, 0.04);
}

.drop-icon {
    width: 40px;
    height: 40px;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.drop-text {
    font-size: 1rem;
    font-weight: 500;
}

.drop-sub {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.drop-formats {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.6;
    opacity: 0.7;
}
.drop-formats:first-of-type {
    margin-top: 0.75rem;
}

/* === File info bar === */
.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.file-info-name {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info-size {
    color: var(--text-dim);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover { opacity: 0.85; }

.btn-mt-lg { margin-top: 1.5rem; }

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* === Progress === */
.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0%   { width: 0%;   margin-left: 0; }
    50%  { width: 60%;  margin-left: 20%; }
    100% { width: 0%;   margin-left: 100%; }
}

.progress-text {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* === Results === */
.results-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.verdict-badge {
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.verdict-clean      { background: rgba(26,95,74,0.1);  color: var(--green); }
.verdict-suspicious { background: rgba(180,83,9,0.1);   color: var(--amber); }
.verdict-malicious  { background: rgba(220,38,38,0.1);  color: var(--red); }

.results-meta {
    flex: 1;
    min-width: 0;
}

.results-meta h2 {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-all;
}

.meta-row {
    display: flex;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.2rem;
    flex-wrap: wrap;
}

.meta-row.hashes {
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.5rem;
}

.risk-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
}

.risk-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.risk-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

/* === Heuristics === */
#heuristics-section {
    margin-top: 1.5rem;
}

#heuristics-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-hover);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    color: var(--text-dim);
}

.heuristics-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* === Score composition bar === */
.score-breakdown { margin: 1.5rem 0; }
.score-breakdown h3 { margin-bottom: 0.6rem; }

.score-bar-frame {
    position: relative;
    height: 30px;
    border-radius: 6px;
    background: #eef0ef;
    overflow: visible;
    margin-bottom: 2rem;
}
.score-bands {
    position: absolute; top: 0; bottom: 0; left: 0; right: 0;
    border-radius: 6px;
    overflow: hidden;
}
.score-band {
    position: absolute; top: 0; bottom: 0;
    opacity: 0.22;
    pointer-events: none;
}
.band-clean     { background: #1a5f4a; }
.band-low       { background: #eab308; }
.band-high      { background: #ea580c; }
.band-malicious { background: #dc2626; }

.score-segments {
    position: absolute; top: 0; bottom: 0; left: 0; right: 0;
    display: flex;
    border-radius: 6px;
    overflow: hidden;
}
.score-segment {
    height: 100%;
    display: flex; align-items: center;
    padding: 0 6px;
    font-size: 10.5px; font-weight: 600;
    color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-right: 1px solid rgba(255,255,255,0.35);
    cursor: help;
}
.score-segment:last-child { border-right: none; }
.score-segment.sev-critical { background: #dc2626; }
.score-segment.sev-high     { background: #ea580c; }
.score-segment.sev-medium   { background: #eab308; color: #222; }
.score-segment.sev-low      { background: #22c55e; color: #0d2818; }
.score-segment.sev-info     { background: #9ca3af; color: #222; }

.score-marker {
    position: absolute; top: -5px; bottom: -5px;
    width: 3px; background: #111;
    transform: translateX(-1.5px);
    box-shadow: 0 0 0 1.5px #fff;
    pointer-events: none;
}
.score-marker::after {
    content: attr(data-score);
    position: absolute; bottom: calc(100% + 2px); left: 50%;
    transform: translateX(-50%);
    font-size: 11px; font-weight: 700;
    color: #111;
    background: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid #ccc;
    white-space: nowrap;
}
.score-thresholds {
    position: absolute; top: 0; bottom: 0; left: 0; right: 0;
    pointer-events: none;
}
.score-threshold {
    position: absolute; top: 100%; bottom: auto;
    height: 6px;
    border-left: 1px dashed #9ca3af;
}
.score-threshold span {
    position: absolute; top: 6px; left: -10px;
    font-size: 10px; color: var(--text-dim);
}

/* === Heuristic items === */
.heuristic-item {
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--border);
}

.heuristic-item.sev-info     { border-left-color: var(--text-dim); }
.heuristic-item.sev-low      { border-left-color: var(--accent); }
.heuristic-item.sev-medium   { border-left-color: var(--amber); }
.heuristic-item.sev-high     { border-left-color: #c2410c; }
.heuristic-item.sev-critical { border-left-color: var(--red); }

.heuristic-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.heuristic-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.sev-tag {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.sev-tag-info     { background: rgba(85,85,85,0.1);    color: var(--text-dim); }
.sev-tag-low      { background: rgba(26,95,74,0.1);     color: var(--accent); }
.sev-tag-medium   { background: rgba(180,83,9,0.1);     color: var(--amber); }
.sev-tag-high     { background: rgba(234,88,12,0.12);   color: #c2410c; }
.sev-tag-critical { background: rgba(220,38,38,0.1);    color: var(--red); }

.cve-confidence {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid currentColor;
}

.cve-confidence-exact { color: var(--red); background: rgba(220,38,38,0.06); }
.cve-confidence-likely { color: #c2410c; background: rgba(234,88,12,0.08); }
.cve-confidence-related { color: var(--amber); background: rgba(180,83,9,0.08); }

.heuristic-rule {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.heuristic-desc {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.heuristic-detail {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.7;
    overflow-wrap: break-word;
    word-break: break-all;
}

/* === URL scan per-page report === */
.url-scan-domain {
    font-weight: 700;
    color: var(--text);
    margin-top: 0.6rem;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}
.url-scan-domain:first-child { margin-top: 0; }
.url-scan-check {
    padding: 0.1rem 0;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: break-all;
}
.url-scan-check strong {
    color: var(--text-dim);
}
.url-scan-alert {
    color: var(--red, #ef4444);
    opacity: 1;
}
.url-scan-alert strong {
    color: var(--red, #ef4444);
}

/* === Hex context toggle === */
.hex-toggle {
    margin-top: 0.35rem;
}

.btn-hex-toggle {
    margin-bottom: 0.25rem;
}

.hex-dump {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text);
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

/* === ClamAV section === */
.clamav-section {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border-radius: 8px;
}

.clamav-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.clamav-section p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.clamav-clean { color: var(--green); }
.clamav-detected { color: var(--red); font-weight: 600; }
.clamav-unavailable { color: var(--text-dim); font-style: italic; }

/* === Heuristic explanation === */
.heuristic-explanation {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* === URLs section === */
.urls-section {
    margin-top: 1.25rem;
}

.urls-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
}

.urls-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg);
    border-radius: 8px;
    padding: 0.5rem;
}

.urls-list li {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    word-break: break-all;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
}

.urls-list li:last-child {
    border-bottom: none;
}

/* === Help page === */
.help-intro {
    margin-bottom: 1.5rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
}

.help-intro a {
    color: var(--accent);
    text-decoration: none;
}

.help-intro a:hover {
    text-decoration: underline;
}

.help-category {
    margin-bottom: 1.5rem;
}

.help-category h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-rules {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.help-rule .heuristic-explanation {
    margin-top: 0.35rem;
}

.loading-text {
    color: var(--text-dim);
    text-align: center;
    padding: 2rem;
}

/* === Archive member results === */
.archive-section {
    margin-top: 1.25rem;
}
.archive-section h3 {
    margin-bottom: 0.75rem;
}
.archive-member-card {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.verdict-border-malicious { border-left: 4px solid var(--red, #ef4444); }
.verdict-border-suspicious { border-left: 4px solid var(--amber, #f59e0b); }
.verdict-border-clean { border-left: 4px solid var(--green, #22c55e); }
.archive-member-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.archive-member-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    word-break: break-all;
}
.verdict-badge-small {
    font-size: 0.65rem;
    padding: 0.1rem 0.5rem;
}
.archive-member-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.7;
}
.archive-member-clamav {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}
.archive-member-findings {
    margin-top: 0.3rem;
}
.archive-finding {
    font-size: 0.8rem;
    padding: 0.15rem 0;
    line-height: 1.5;
}
.archive-finding-name {
    font-weight: 500;
}
.archive-finding-desc {
    color: var(--text-dim);
    opacity: 0.8;
}
.archive-member-clean {
    font-size: 0.8rem;
    color: var(--green, #22c55e);
    opacity: 0.8;
}

/* === Email details section === */
.email-section {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.email-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.email-headers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.email-headers-table th {
    text-align: left;
    vertical-align: top;
    width: 100px;
    padding: 0.35rem 0.75rem 0.35rem 0;
    color: var(--text-dim);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.email-headers-table td {
    padding: 0.35rem 0;
    color: var(--text);
    word-break: break-word;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.email-from-display {
    font-weight: 600;
}

.email-subject {
    font-weight: 600;
    font-size: 0.9rem;
}

.email-attachments {
    margin-top: 0.75rem;
}

.email-attachments h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.email-attachments-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.email-attach-item {
    padding: 0.4rem 0.65rem;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.email-attach-meta {
    color: var(--text-dim);
    font-size: 0.78rem;
}

.email-attach-danger {
    border-color: rgba(220,38,38,0.3);
    background: rgba(220,38,38,0.04);
}

.email-attach-danger strong {
    color: var(--red);
}

.email-body-section {
    margin-top: 0.75rem;
}

.email-body-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email-body-preview {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* === Forensic disclaimer === */
.forensic-disclaimer {
    margin: 1rem 0 0.25rem;
    padding: 0.6rem 1rem;
    background: rgba(100,116,139,0.07);
    border: 1px solid rgba(100,116,139,0.2);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* === Results actions (cached banner + re-scan) === */
.results-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 0.25rem;
    flex-wrap: wrap;
}

/* === Cached result banner === */
.cached-banner {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0.6rem 1rem;
    background: rgba(26, 95, 74, 0.07);
    border: 1px solid rgba(26, 95, 74, 0.2);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* === Search section === */
.search-card {
    padding: 1.25rem 1.5rem;
}
.search-heading {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--text);
}
.search-row {
    display: flex;
    gap: 0.5rem;
}
.hash-input {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
.hash-input:focus {
    border-color: var(--accent);
}
.search-error {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--red);
}

/* === Quarantine notice === */
.quarantine-notice {
    margin-top: 1.25rem;
    padding: 0.6rem 1rem;
    background: rgba(220,38,38,0.08);
    border: 1px solid rgba(220,38,38,0.2);
    border-radius: 6px;
    color: var(--red);
    font-size: 0.85rem;
    font-weight: 500;
}

/* === Clean state === */
.no-findings {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--green);
}

.no-findings svg {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
}

.no-findings p {
    font-size: 1rem;
    font-weight: 500;
}

/* === Statistics page === */
.stats-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.stats-summary-row > div {
    display: flex;
    flex-direction: column;
}

.stats-summary-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.stats-summary-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.stats-summary-time {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-dim);
}

.stats-filetype-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stats-filetype-head h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.stats-total {
    font-size: 0.95rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.stats-verdict-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stats-verdict {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stats-verdict-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.stats-verdict-count {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stats-verdict-clean      { border-left: 4px solid var(--green); }
.stats-verdict-suspicious { border-left: 4px solid var(--amber); }
.stats-verdict-malicious  { border-left: 4px solid var(--red); }

.stats-verdict-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-hover);
    margin-bottom: 1.25rem;
}

.stats-verdict-bar .bar-clean      { background: var(--green); }
.stats-verdict-bar .bar-suspicious { background: var(--amber); }
.stats-verdict-bar .bar-malicious  { background: var(--red); }

.stats-pie-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-pie-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stats-pie {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.stats-legend {
    list-style: none;
    flex: 1;
    min-width: 14rem;
}

.stats-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.88rem;
}

.stats-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.stats-legend-rule {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    flex: 1;
    word-break: break-all;
}

.stats-legend-count {
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.stats-empty {
    color: var(--text-dim);
    font-style: italic;
}

.stats-recent h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.stats-recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.stats-recent-table th,
.stats-recent-table td {
    text-align: left;
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.stats-recent-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.stats-recent-table tr:last-child td {
    border-bottom: none;
}

.stats-recent-hash {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.78rem;
    word-break: break-all;
}

.stats-recent-score {
    font-variant-numeric: tabular-nums;
}

.stats-recent-time {
    color: var(--text-dim);
    font-size: 0.82rem;
    white-space: nowrap;
}

/* === Responsive === */
@media (max-width: 600px) {
    .app { padding: 1.25rem 1rem 2rem; }
    .app-header-text { flex-basis: 100%; }
    .logo { max-width: 100%; }
    .logo-text { font-size: 1.05rem; letter-spacing: 0.08em; }
    .results-header { flex-direction: column; }
    .risk-score { flex-direction: row; gap: 0.5rem; }
    .risk-number { font-size: 1.5rem; }
    .drop-zone { padding: 2rem 1rem; }
    .stats-verdict-row { grid-template-columns: 1fr; }
    .stats-pie-wrap { flex-direction: column; align-items: stretch; }
    .stats-pie { margin: 0 auto; }
}
