:root {
    --bg: #080d13;
    --surface: #11161f;
    --surface-2: #151a24;
    --surface-3: #202631;
    --border: #282e3a;
    --border-soft: #1b222c;
    --text: #eef3f8;
    --muted: #949aa6;
    --accent: #0fdb9d;
    --accent-2: #b9ffec;
    --green: #53d985;
    --red: #ff5d5d;
    --amber: #f7b955;
    --radius: 8px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
header { border-bottom: 1px solid rgba(255, 255, 255, 0.04); padding: 18px 0; backdrop-filter: blur(10px); }
header h1 { margin: 0; font-size: 22px; }
header h1 a { color: var(--text); text-decoration: none; }
header .tagline { margin: 0; color: var(--muted); font-size: 13px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topnav { display: flex; align-items: center; gap: 10px; }
.topnav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
main { padding: 34px 0 64px; }
footer { border-top: 1px solid var(--border-soft); padding: 20px 0; color: var(--muted); }
.muted { color: var(--muted); }
.warn { color: var(--amber); }

.upload-card, .info-card, .verdict-card, .pathways-card, .fusion-card, .meta-card, .heatmaps-card, .overlay-card {
    background: linear-gradient(180deg, rgba(18, 24, 32, 0.98), rgba(14, 19, 26, 0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.upload-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.upload-head h2 { margin: 4px 0 4px; font-size: 30px; letter-spacing: 0; }
.eyebrow { color: var(--accent-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
.status-pill { border: 1px solid rgba(122, 215, 160, 0.35); color: var(--accent-2); background: rgba(122, 215, 160, 0.08); padding: 8px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }

.suite-hero { text-align: center; margin: 10px auto 28px; }
.suite-hero h2 {
    margin: 0;
    color: var(--accent-2);
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 900;
    letter-spacing: 0;
}
.suite-hero p { margin: 14px 0 0; color: var(--muted); font-size: 22px; font-weight: 750; }

.suite-card { max-width: 880px; margin: 0 auto 72px; }
.suite-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    background: #151821;
    border: 1px solid #2b303c;
    border-radius: 22px;
    padding: 7px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.tool-tab {
    margin: 0;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    font-size: 16px;
    font-weight: 850;
    white-space: nowrap;
}
.tool-tab.active {
    color: #07120f;
    background: linear-gradient(180deg, #13e8aa, #0ac992);
    box-shadow: 0 12px 32px rgba(15, 219, 157, 0.24);
}
.tool-tab.disabled { opacity: 0.68; cursor: not-allowed; }
.tab-icon { font-size: 24px; line-height: 1; font-weight: 700; }
.tool-panel { display: none; margin-top: 48px; }
.tool-panel.active { display: block; }

.dropzone {
    display: block;
    border: 3px dashed #3a3f4b;
    border-radius: 28px;
    padding: 86px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    background: #11161f;
    min-height: 250px;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: #121a22;
    transform: translateY(-1px);
}
.upload-icon {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 34px;
    position: relative;
}
.upload-icon::before {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 22px;
    border: 5px solid #7d818b;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}
.upload-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 2px;
    width: 28px;
    height: 28px;
    border-left: 5px solid #7d818b;
    border-top: 5px solid #7d818b;
    transform: translateX(-50%) rotate(45deg);
}
.dz-inner strong { display: block; color: #b6bac4; font-size: 22px; line-height: 1.3; }
.dz-inner span { display: block; color: #747a86; margin-top: 12px; font-size: 17px; font-weight: 650; }
.dz-inner .picked { color: var(--accent); font-weight: 700; }
.tool-form button[data-submit] { display: block; margin: 20px auto 0; }
.tool-form button[data-submit]:disabled { display: none; }
.suite-footer-note { opacity: 0.72; text-align: center; }
.suite-footer-note h3 {
    margin-top: 0;
    color: #6f7480;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0;
}

button, .btn { display: inline-block; background: linear-gradient(180deg, #13e8aa, #0bb986); color: #06120f; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; padding: 10px 20px; font-size: 15px; font-weight: 800; cursor: pointer; margin-top: 16px; text-decoration: none; box-shadow: 0 10px 28px rgba(15, 219, 157, 0.2); }
.btn.secondary,
button.secondary {
    background: #ffffff;
    color: #2563eb;
    border-color: #cbd5e1;
    box-shadow: none;
}
.danger-button,
.plain-danger {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
    box-shadow: none;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:not(:disabled):hover, .btn:hover { filter: brightness(1.06); }

.loading { margin-top: 20px; text-align: center; color: var(--muted); }
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.signal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.signal-grid span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; color: #cfd8e4; font-weight: 650; font-size: 13px; }

.verdict-card { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.9fr); gap: 32px; align-items: center; position: relative; overflow: hidden; }
.verdict-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.verdict-main h2 { margin: 0; font-size: 40px; letter-spacing: 0; }
.verdict-label { color: var(--muted); font-size: 12px; letter-spacing: 0; font-weight: 800; }
.verdict-prob { font-size: 16px; margin-top: 8px; }
.verdict-meta { flex: 1; font-size: 14px; }
.verdict-meta p { margin: 4px 0; }

.verdict-real h2 { color: var(--green); }
.verdict-real::before { background: var(--green); }
.verdict-uncertain h2 { color: var(--amber); }
.verdict-uncertain::before { background: var(--amber); }
.verdict-ai-generated h2 { color: var(--red); }
.verdict-ai-generated::before { background: var(--red); }
.verdict-protected-origin h2 { color: var(--accent); }
.verdict-protected-origin::before { background: var(--accent); }
.verdict-clean h2, .verdict-low-risk h2 { color: var(--green); }
.verdict-clean::before, .verdict-low-risk::before { background: var(--green); }
.verdict-suspicious h2 { color: var(--amber); }
.verdict-suspicious::before { background: var(--amber); }
.verdict-likely-tampered h2 { color: var(--red); }
.verdict-likely-tampered::before { background: var(--red); }

.confidence-meter { margin-top: 18px; max-width: 520px; }
.confidence-track { height: 14px; background: #202a35; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.confidence-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--amber), var(--red)); box-shadow: 0 0 22px rgba(247, 185, 85, 0.25); transition: width 0.3s ease; }
.confidence-scale { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }

.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.section-head h3 { margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.segmented .seg { margin: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 8px 12px; border-right: 1px solid var(--border); }
.segmented .seg:last-child { border-right: 0; }
.segmented .seg.active { background: var(--accent); color: white; }
.overlay-stage { position: relative; width: 100%; max-height: 72vh; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.overlay-stage img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.base-image { display: block; }
.overlay-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: 0; mix-blend-mode: screen; transition: opacity 0.15s; pointer-events: none; }
.overlay-stage[data-active-layer="ela"] .overlay-layer[data-overlay="ela"],
.overlay-stage[data-active-layer="noise"] .overlay-layer[data-overlay="noise"] { opacity: 0.58; }

table.pathways, table.fusion { width: 100%; border-collapse: collapse; font-size: 14px; }
table th, table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
tr.unavailable td { color: var(--muted); }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; color: var(--accent-2); }

.score-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.bar { flex: 1; height: 10px; background: #202a35; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(to right, var(--green), var(--amber), var(--red)); transition: width 0.3s; border-radius: 999px; }
.score-num { font-variant-numeric: tabular-nums; min-width: 40px; }

.heatmap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.heatmap-row figure { margin: 0; background: var(--surface-2); border-radius: 8px; padding: 12px; }
.heatmap-row figcaption { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.heatmap-row img { width: 100%; height: auto; border-radius: 6px; display: block; }

.reasons { color: var(--muted); font-size: 13px; padding-left: 20px; }
.meta-card ul li { margin: 4px 0; }

@media (max-width: 720px) {
    .upload-head, .verdict-card, .section-head { display: block; }
    .status-pill { display: inline-block; margin-top: 10px; }
    .suite-hero p { font-size: 16px; }
    .suite-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 18px; padding: 5px; }
    .tool-tab { min-height: 46px; font-size: 11px; gap: 5px; padding: 8px 4px; }
    .tab-icon { font-size: 16px; }
    .dropzone { padding: 58px 16px; border-radius: 18px; }
    .upload-icon { font-size: 56px; }
    .dz-inner strong { font-size: 18px; }
    .signal-grid { grid-template-columns: 1fr 1fr; }
    .segmented { margin-top: 12px; width: 100%; }
    .segmented .seg { flex: 1; padding: 8px 6px; }
    .heatmap-row { grid-template-columns: 1fr; }
    .score-cell { min-width: 160px; }
}

/* Light integrated suite theme */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --border: #d8e0ea;
    --border-soft: #e8edf3;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-2: #0f766e;
    --green: #059669;
    --red: #e11d48;
    --amber: #d97706;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 42%, #f1f5f9 100%);
    color: var(--text);
}

header,
footer {
    background: rgba(255, 255, 255, 0.86);
    border-color: var(--border-soft);
}

header h1 a,
.verdict-meta,
.verdict-main h2,
.pathways-card,
.fusion-card,
.meta-card,
.heatmaps-card,
.overlay-card {
    color: var(--text);
}

.suite-hero h2 {
    color: #0f766e;
}

.suite-hero p {
    color: #64748b;
}

.suite-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #ffffff;
    border-color: #d8e0ea;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.tool-tab {
    color: #64748b;
}

.tool-tab.active {
    color: #ffffff;
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
}

.dropzone {
    background: #ffffff;
    border-color: #cbd5e1;
}

.dropzone:hover,
.dropzone.dragover {
    background: #eff6ff;
    border-color: #2563eb;
}

.upload-icon::before,
.upload-icon::after {
    border-color: #94a3b8;
}

.dz-inner strong {
    color: #334155;
}

.dz-inner span {
    color: #64748b;
}

button,
.btn {
    color: #ffffff;
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.upload-card,
.info-card,
.verdict-card,
.pathways-card,
.fusion-card,
.meta-card,
.heatmaps-card,
.overlay-card {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.signal-grid span,
.heatmap-row figure,
.overlay-stage,
.segmented,
.bar,
.confidence-track {
    background: var(--surface-2);
    border-color: var(--border);
    color: #334155;
}

table th,
table td {
    border-color: var(--border-soft);
}

code {
    color: #1d4ed8;
}

.suite-footer-note h3 {
    color: #64748b;
}

.pdf-analysis-page {
    display: grid;
    gap: 18px;
    color: #0f172a;
}

.pdf-history-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pdf-history-actions .btn,
.pdf-history-actions button {
    margin: 0;
}

.pdf-history-actions form {
    margin: 0;
}

.pdf-hero-card,
.pdf-easy-summary,
.pdf-tabbar,
.pdf-tab-panel,
.pdf-detail-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.pdf-hero-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-color: #fecdd3;
}

.pdf-kicker {
    margin: 0 0 6px;
    color: #64748b;
    font-size: 13px;
}

.pdf-hero-card h2 {
    margin: 0;
    font-size: 38px;
    letter-spacing: 0;
}

.pdf-verdict-clean h2 { color: #059669; }
.pdf-verdict-low-risk h2 { color: #d97706; }
.pdf-verdict-suspicious h2,
.pdf-verdict-likely-tampered h2,
.pdf-verdict-likely-manipulated h2 { color: #e11d48; }
.pdf-verdict-likely-clean h2 { color: #059669; }
.pdf-verdict-inconclusive h2 { color: #64748b; }

.pdf-subline {
    margin: 6px 0 0;
    color: #64748b;
}

.pdf-risk-block {
    min-width: 190px;
    text-align: right;
}

.pdf-risk-block span,
.pdf-risk-block em {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-style: normal;
}

.pdf-risk-block strong {
    display: block;
    color: #be123c;
    font-size: 38px;
    line-height: 1.1;
}

.pdf-risk-block small {
    color: #64748b;
    font-size: 16px;
}

.pdf-easy-summary {
    padding: 20px;
    text-align: center;
    background: #f8fafc;
}

.pdf-easy-summary > span {
    display: block;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.pdf-easy-summary p {
    max-width: 860px;
    margin: 12px auto;
    color: #475569;
}

.pdf-easy-summary div {
    background: #eef2ff;
    border-radius: 10px;
    color: #475569;
    padding: 12px;
}

.pdf-metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pdf-metric {
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    border: 1px solid;
}

.pdf-metric strong {
    display: block;
    font-size: 42px;
    line-height: 1;
}

.pdf-metric span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.pdf-metric.pass { background: #ecfdf5; border-color: #bbf7d0; color: #059669; }
.pdf-metric.warning { background: #fffbeb; border-color: #fde68a; color: #d97706; }
.pdf-metric.critical { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.pdf-metric.math { background: #fdf4ff; border-color: #f5d0fe; color: #a21caf; }

.pdf-tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px;
}

.pdf-tabbar button {
    margin: 0;
    color: #64748b;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 9px 12px;
}

.pdf-tabbar button.active {
    color: #4338ca;
    background: #e0e7ff;
    box-shadow: inset 0 -2px 0 #818cf8;
}

.pdf-tab-panel {
    display: none;
    padding: 18px;
}

.pdf-tab-panel.active {
    display: grid;
    gap: 10px;
}

.pdf-finding {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    padding: 14px;
}

.pdf-finding > span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.pdf-finding strong {
    color: #0f172a;
}

.pdf-finding p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.pdf-finding.fail,
.pdf-finding.high,
.pdf-finding.critical {
    border-color: #fda4af;
}

.pdf-finding.warning,
.pdf-finding.medium {
    border-color: #fcd34d;
}

.pdf-finding.not_applicable,
.pdf-finding.low {
    border-color: #cbd5e1;
}

.pdf-empty,
.pdf-alert {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    padding: 16px;
}

.pdf-alert {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
    font-weight: 800;
    text-align: center;
}

.pdf-alert.valid {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.pdf-alert.suspicious,
.pdf-alert.warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.pdf-alert small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.pdf-detail-card {
    padding: 16px;
}

.pdf-detail-card h3 {
    margin: 0 0 12px;
}

.pdf-field-grid,
.pdf-metadata-grid {
    display: grid;
    gap: 0 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-field-grid div,
.pdf-metadata-grid div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
    min-width: 0;
    padding: 9px 0;
}

.pdf-field-grid span,
.pdf-metadata-grid span {
    color: #64748b;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pdf-field-grid strong,
.pdf-metadata-grid strong {
    color: #0f172a;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.pdf-statement-grid {
    grid-template-columns: 1fr;
    margin-bottom: 12px;
}

.pdf-suspect-fields .pdf-field-grid div {
    display: block;
}

.pdf-suspect-fields .pdf-field-grid strong {
    display: block;
    margin-top: 5px;
    text-align: left;
}

.pdf-suspect-fields .pdf-field-grid em {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}

.pdf-score-row {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    gap: 10px 18px;
    align-items: center;
}

.pdf-tags {
    color: #4f46e5 !important;
}

.bank-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.bank-transaction-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
    font-size: 13px;
}

.bank-transaction-table th,
.bank-transaction-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.bank-transaction-table th {
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
}

.bank-transaction-table .failed-row {
    background: #fff1f2;
}

.json-block {
    overflow-x: auto;
    white-space: pre-wrap;
    background: #0f172a;
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.5;
    padding: 14px;
}

.history-page {
    display: grid;
    gap: 18px;
}

.history-head,
.history-card,
.history-filters {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
}

.history-head h2 {
    margin: 0;
    font-size: 30px;
}

.history-head p {
    color: #64748b;
    margin: 6px 0 0;
}

.history-filters {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1fr) 180px 220px 130px auto;
    padding: 14px;
}

.image-history-filters {
    grid-template-columns: minmax(220px, 1fr) 180px 130px auto;
}

.history-filters input,
.history-filters select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    background: #ffffff;
    padding: 0 12px;
    font: inherit;
}

.history-filters button {
    margin: 0;
}

.history-card {
    overflow: hidden;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
    font-size: 14px;
}

.image-history-table {
    min-width: 980px;
}

.history-table th,
.history-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px;
    vertical-align: top;
}

.history-table th {
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
}

.history-table small {
    display: block;
    color: #64748b;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.history-date {
    white-space: nowrap;
}

.history-thumb {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    background: #f8fafc;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 900;
}

.history-badge.clean,
.history-badge.likely_clean {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.history-badge.low-risk,
.history-badge.low_risk,
.history-badge.suspicious {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.history-badge.likely_tampered,
.history-badge.likely_manipulated {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.history-badge.real,
.history-badge.protected_origin {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.history-badge.uncertain {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.history-badge.ai_generated {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.history-actions a,
.history-actions button {
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-decoration: none;
}

.history-actions .plain-danger {
    color: #be123c;
}

.history-empty {
    color: #64748b;
    text-align: center;
}

.history-pager {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px;
}

.history-pager .btn {
    margin: 0;
}

@media (max-width: 720px) {
    .topbar,
    .history-head { display: block; }
    .topnav { margin-top: 12px; }
    .pdf-hero-card { display: block; }
    .pdf-risk-block { margin-top: 16px; text-align: left; }
    .pdf-metric-grid,
    .pdf-field-grid,
    .history-filters,
    .pdf-metadata-grid { grid-template-columns: 1fr; }
    .pdf-finding { grid-template-columns: 1fr; }
}
