:root {
    --bg: #f8f9fb;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbfc;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.8);
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --accent: #3b82f6;
    --accent-dark: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.08);
    --accent-glow: rgba(59, 130, 246, 0.25);
    --green: #10b981;
    --green-bg: #ecfdf5;
    --green-border: #a7f3d0;
    --amber: #f59e0b;
    --amber-bg: #fffbeb;
    --amber-border: #fde68a;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --red-border: #fecaca;
    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes countUp { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes borderDance { 0% { background-position: 0% 0%; } 100% { background-position: 200% 0%; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 8px transparent; } }
@keyframes scanLine { 0% { top: -3px; } 50% { top: 100%; } 100% { top: -3px; } }

.drop-preview-wrapper.scanning::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -3px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 255, 255, 0.8) 50%, transparent 100%);
    box-shadow: 0 0 12px 4px rgba(0, 255, 255, 0.3);
    z-index: 10;
    animation: scanLine 2s ease-in-out infinite;
}
@keyframes stepBounce { 0% { transform: scale(0.8); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes glint { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.topbar {
    position: relative;
    z-index: 100;
    background: var(--bg-topbar);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    height: 52px;
    flex-shrink: 0;
}

.topbar-inner {
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.topbar-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.title-dim {
    font-weight: 400;
    color: var(--text-tertiary);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.upload-new-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.upload-new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.upload-new-btn:active { transform: translateY(0); }

.mobile-menu-btn {
    display: none;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover { background: var(--bg); }

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100vh - 52px);
    overflow: hidden;
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 14px 16px 10px;
}

.sidebar-stats {
    display: flex;
    gap: 8px;
}

.stat-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
}

.stat-chip.clean { background: var(--green-bg); color: var(--green); }
.stat-chip.tampered { background: var(--red-bg); color: var(--red); }

.sidebar-filters {
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--border);
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.sidebar-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.sidebar-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
}

.filter-row { display: flex; gap: 4px; }

.filter-btn {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

.folder-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.folder-list::-webkit-scrollbar { width: 4px; opacity: 0; transition: opacity 0.2s; }
.folder-list:hover::-webkit-scrollbar { opacity: 1; }
.folder-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.folder-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
}

.folder-item:hover {
    background: var(--bg);
    border-color: var(--border);
    transform: translateX(2px);
}

.folder-item.active {
    background: var(--accent-light);
    border-color: rgba(59, 130, 246, 0.2);
    border-left: 3px solid var(--accent);
}

.folder-item-name {
    font-size: 12px;
    font-weight: 500;
    font-family: var(--mono);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-item.active .folder-item-name { color: var(--accent); font-weight: 600; }

.folder-item-badge {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--mono);
    padding: 2px 7px;
    border-radius: 100px;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
    animation: stepBounce 0.4s ease;
}

.badge-clean { background: var(--green-bg); color: var(--green); }
.badge-low { background: var(--blue-bg); color: var(--accent); }
.badge-medium { background: var(--amber-bg); color: var(--amber); }
.badge-high { background: var(--red-bg); color: var(--red); }

.sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    flex-shrink: 0;
}

.skeleton-item {
    height: 40px;
    background: linear-gradient(90deg, var(--bg) 25%, var(--border-light) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.content {
    overflow-y: auto;
    background: var(--bg);
    position: relative;
}

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.upload-form {
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.upload-container {
    max-width: 720px;
    margin: 0 auto;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover { border-color: var(--red); color: var(--red); }

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.drop-zone {
    position: relative;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    min-height: 140px;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: var(--blue-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-light);
}

.drop-zone.dragover {
    border-color: var(--accent);
    border-style: dashed;
    background: var(--blue-bg);
    transform: scale(1.02);
    box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-glow);
    animation: pulse 2s ease infinite;
}

.drop-zone.has-file {
    border-style: solid;
    border-color: var(--green);
    background: var(--green-bg);
    min-height: auto;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    height: 100%;
    min-height: 136px;
}

.drop-icon-wrapper {
    width: 52px;
    height: 52px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.drop-icon-wrapper.small {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.drop-zone:hover .drop-icon-wrapper {
    color: var(--accent);
    border-color: var(--accent);
    background: white;
}

.drop-text { display: flex; flex-direction: column; gap: 2px; }
.drop-label { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.drop-hint { font-size: 12px; color: var(--text-tertiary); }
.drop-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.optional-tag {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
    margin-left: 4px;
}

.drop-preview-wrapper { position: relative; padding: 6px; overflow: hidden; }
.drop-preview-wrapper.selfie-preview { max-height: 120px; }

.drop-preview {
    width: 100%;
    height: 140px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.selfie-preview .drop-preview { height: 90px; }

.preview-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.preview-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 5px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    backdrop-filter: blur(8px);
}

.preview-remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: white;
    cursor: pointer;
    display: grid;
    place-items: center;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.preview-remove:hover { background: var(--red); transform: scale(1.1); }

.preview-filename {
    padding: 4px 8px;
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--mono);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selfie-zone {
    margin-bottom: 14px;
    min-height: auto;
}

.selfie-zone .drop-zone-content {
    flex-direction: row;
    gap: 12px;
    padding: 14px 16px;
    min-height: auto;
}

.selfie-zone .drop-text { text-align: left; }
.has-file .drop-zone-content { display: none; }

.analyze-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.analyze-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: borderDance 3s ease infinite;
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.analyze-btn:active:not(:disabled) { transform: translateY(0); }
.analyze-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.analyze-btn:disabled::before { display: none; }

.btn-content, .btn-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.analyze-btn.loading .btn-content { display: none; }
.analyze-btn.loading .btn-spinner { display: flex !important; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.progress-section.active-pulse {
    animation: fadeInUp 0.3s ease, pulse 2s ease infinite;
}

.progress-steps {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--blue-bg);
    color: var(--accent);
    animation: pulse 1.5s ease infinite;
}

.progress-step.done {
    background: var(--green-bg);
    color: var(--green);
    animation: stepBounce 0.4s ease;
}

.progress-step.failed {
    background: var(--red-bg);
    color: var(--red);
}

.progress-step svg { width: 12px; height: 12px; }

.progress-track {
    height: 5px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    width: 0%;
    transition: width 0.6s ease;
    position: relative;
    background-size: 200% 100%;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: glint 1.5s ease infinite;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.progress-pct { font-size: 12px; font-weight: 700; font-family: var(--mono); color: var(--accent); }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-tertiary);
    gap: 10px;
}

.empty-icon {
    width: 72px;
    height: 72px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
}

.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.empty-state p { font-size: 13px; }

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeInUp 0.4s ease;
    border: 1px solid var(--border);
    max-width: 960px;
}

.verdict-banner {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.verdict-banner.clean { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.verdict-banner.low-risk { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.verdict-banner.suspicious { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.verdict-banner.tampered { background: linear-gradient(135deg, #fef2f2, #fecaca); }

.verdict-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.verdict-banner.clean .verdict-icon { background: rgba(16,185,129,0.15); color: var(--green); }
.verdict-banner.low-risk .verdict-icon { background: rgba(59,130,246,0.15); color: var(--accent); }
.verdict-banner.suspicious .verdict-icon { background: rgba(245,158,11,0.15); color: var(--amber); }
.verdict-banner.tampered .verdict-icon { background: rgba(239,68,68,0.15); color: var(--red); }

.verdict-info { flex: 1; }

.verdict-info h2 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 1px;
}

.verdict-banner.clean .verdict-info h2 { color: #059669; }
.verdict-banner.low-risk .verdict-info h2 { color: #2563eb; }
.verdict-banner.suspicious .verdict-info h2 { color: #d97706; }
.verdict-banner.tampered .verdict-info h2 { color: #dc2626; }

.verdict-info p { font-size: 13px; color: var(--text-secondary); }

.verdict-score { text-align: center; flex-shrink: 0; }

.score-value {
    font-size: 36px;
    font-weight: 900;
    font-family: var(--mono);
    animation: countUp 0.6s ease;
    line-height: 1;
}

.verdict-banner.clean .score-value { color: var(--green); }
.verdict-banner.low-risk .score-value { color: var(--accent); }
.verdict-banner.suspicious .score-value { color: var(--amber); }
.verdict-banner.tampered .score-value { color: var(--red); }

.score-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.result-body { padding: 20px 24px 24px; }

.card-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 3px;
    border-radius: 8px;
    margin-bottom: 16px;
    width: fit-content;
    border: 1px solid var(--border);
    position: relative;
}

.card-tab {
    padding: 6px 16px;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.card-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

.card-view { display: none; animation: fadeIn 0.3s ease; }
.card-view.active { display: block; }

.image-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.image-panel {
    position: relative;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.image-panel-label {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    backdrop-filter: blur(8px);
}

.image-panel img {
    width: 100%;
    height: auto;
    display: block;
    animation: fadeIn 0.4s ease;
    transform-origin: center;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    margin-bottom: 16px;
}

.field-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease backwards;
    border: 1px solid transparent;
}

.field-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}

.field-pill-name { color: var(--text-secondary); font-weight: 500; }

.field-pill-status {
    font-weight: 700;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field-pill-status.pass { color: var(--green); background: var(--green-bg); }
.field-pill-status.warn { color: var(--amber); background: var(--amber-bg); }
.field-pill-status.fail { color: var(--red); background: var(--red-bg); }
.field-pill-status.skip { color: var(--text-tertiary); background: var(--bg); }

.section-heading {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    margin-top: 20px;
}

.section-heading:first-child { margin-top: 0; }

.face-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.face-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--border);
    animation: fadeIn 0.5s ease;
}

.face-result { text-align: center; flex: 1; }

.face-score {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--mono);
}

.face-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 10px;
    border-radius: 100px;
    display: inline-block;
    margin-top: 3px;
}

.face-label.verified { color: var(--green); background: var(--green-bg); }
.face-label.uncertain { color: var(--amber); background: var(--amber-bg); }
.face-label.not-verified { color: var(--red); background: var(--red-bg); }

.face-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.face-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.face-detail-row:last-child { border-bottom: none; }

.face-detail-label { font-weight: 500; }
.face-detail-value { font-family: var(--mono); font-size: 11px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 8px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
    animation: fadeIn 0.3s ease backwards;
}

.data-table td:first-child { font-weight: 500; color: var(--text-secondary); }
.data-table td:last-child { font-family: var(--mono); font-size: 11px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

.checks-section { margin-top: 20px; }

.checks-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
}

.checks-toggle:hover { border-color: var(--accent); color: var(--accent); }

.checks-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.checks-toggle.open svg { transform: rotate(90deg); }

.checks-list {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.checks-list.open { display: flex; animation: fadeIn 0.3s ease; }

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    background: var(--bg);
    animation: slideIn 0.3s ease backwards;
}

.check-status {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    min-width: 36px;
    text-align: center;
}

.check-status.pass { background: var(--green-bg); color: var(--green); }
.check-status.warn { background: var(--amber-bg); color: var(--amber); }
.check-status.fail { background: var(--red-bg); color: var(--red); }
.check-status.skip { background: var(--bg); color: var(--text-tertiary); border: 1px solid var(--border); }

.check-name {
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--mono);
    font-size: 11px;
    min-width: 140px;
}

.check-detail {
    color: var(--text-tertiary);
    font-size: 11px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mrz-section {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.mrz-confidence {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.mrz-confidence.high { background: var(--green-bg); color: var(--green); }
.mrz-confidence.medium { background: var(--amber-bg); color: var(--amber); }
.mrz-confidence.low { background: var(--red-bg); color: var(--red); }
.mrz-confidence.none { background: var(--bg); color: var(--text-tertiary); }

.mrz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.mrz-field {
    padding: 6px 10px;
    background: var(--bg-card);
    border-radius: 5px;
    border: 1px solid var(--border-light);
}

.mrz-field-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mrz-field-value {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--text-primary);
}

.mrz-checks {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mrz-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.mrz-check svg { width: 12px; height: 12px; }
.mrz-check.pass svg { color: var(--green); }
.mrz-check.fail svg { color: var(--red); }

.error-state {
    text-align: center;
    padding: 32px;
    animation: fadeInUp 0.4s ease;
}

.error-state svg { color: var(--red); margin-bottom: 12px; }
.error-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.error-state p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

.retry-btn {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover { border-color: var(--accent); color: var(--accent); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 89;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.open { display: block; }

.right-sidebar {
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.right-sidebar-header {
    padding: 14px 16px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.right-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.right-sidebar-count {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--accent-light);
    color: var(--accent);
}

.right-sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 8px 8px 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: border-color 0.2s;
}

.right-sidebar-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.right-sidebar-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
}

.dataset-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.dataset-list::-webkit-scrollbar { width: 4px; }
.dataset-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.dataset-pair {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.dataset-pair:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.dataset-pair-name {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--text-secondary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dataset-thumbs {
    display: flex;
    gap: 8px;
}

.dataset-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    cursor: grab;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.dataset-thumb:hover {
    border-color: var(--accent);
    transform: scale(1.03);
    box-shadow: var(--shadow-sm);
}

.dataset-thumb:active { cursor: grabbing; }

.dataset-thumb-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    margin-top: 2px;
}

.dataset-thumb-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.score-gauge {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.gauge-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-gauge .score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-size: 28px;
}

.score-gauge .score-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 55%);
    white-space: nowrap;
}

.export-btn-group {
    display: flex;
    gap: 8px;
    margin: 12px 24px 0;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.history-section {
    border-bottom: 1px solid var(--border);
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
    user-select: none;
}

.history-header-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-chevron {
    transition: transform 0.2s ease;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.history-chevron.expanded {
    transform: rotate(90deg);
}

.history-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.history-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 100px;
    background: var(--accent-light);
    color: var(--accent);
}

.history-list {
    padding: 4px 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.history-list.collapsed {
    max-height: 0;
    padding: 0 6px;
    opacity: 0;
    overflow: hidden;
}

.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    border: 1px solid transparent;
    gap: 8px;
}

.history-entry:hover {
    background: var(--bg);
    border-color: var(--border);
}

.history-entry.active {
    background: var(--accent-light);
    border-color: rgba(59, 130, 246, 0.2);
    border-left: 3px solid var(--accent);
}

.history-entry-info {
    flex: 1;
    min-width: 0;
}

.history-entry-name {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-entry-time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 1px;
}

@media print {
    .sidebar, .right-sidebar, .topbar, .checks-toggle, .export-btn, .upload-form, .sidebar-overlay { display: none !important; }
    .dashboard { grid-template-columns: 1fr !important; }
    .result-card { max-width: 100% !important; box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
    .content { overflow: visible !important; }
    html, body { height: auto !important; overflow: visible !important; }
}

@media (max-width: 767px) {
    html, body {
        height: auto;
        overflow-y: auto;
    }

    .topbar-actions { display: none; }
    .right-sidebar { display: none; }

    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70vh;
        z-index: 90;
        border-right: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    }

    .sidebar.open { display: flex; animation: slideUp 0.3s ease; }
    @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

    .upload-form { padding: 16px; }
    .upload-grid { grid-template-columns: 1fr; }

    .selfie-zone .drop-zone-content {
        flex-direction: column;
        text-align: center;
    }
    .selfie-zone .drop-text { text-align: center; }

    .result-body { padding: 14px; }
    .verdict-banner { padding: 16px; flex-wrap: wrap; }
    .verdict-score { margin-left: 0; }
    .field-grid { grid-template-columns: 1fr; }
    .image-compare { grid-template-columns: 1fr; }
    .face-section { flex-direction: column; text-align: center; }
    .card-tabs { width: 100%; }
    .card-tab { flex: 1; text-align: center; }
    .mrz-grid { grid-template-columns: 1fr 1fr; }

    .mobile-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 32px 20px 24px;
    }

    .mobile-hero-icon { margin-bottom: 8px; }

    .mobile-action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        max-width: 340px;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
        border: none;
        cursor: pointer;
        font-family: var(--font);
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .mobile-action-btn.primary {
        height: 56px;
        background: var(--accent);
        color: white;
    }

    .mobile-action-btn.primary:active {
        background: var(--accent-dark);
    }

    .mobile-action-btn.secondary {
        height: 50px;
        background: white;
        color: var(--accent);
        border: 2px solid var(--accent);
    }

    .mobile-action-btn.secondary:active {
        background: var(--accent-light);
    }

    .mobile-action-btn.tertiary {
        height: 44px;
        background: transparent;
        color: var(--text-secondary);
        font-size: 14px;
    }

    .mobile-demo-count {
        font-size: 12px;
        background: var(--accent-light);
        color: var(--accent);
        padding: 1px 7px;
        border-radius: 10px;
        font-weight: 700;
    }

    .mobile-demos-list {
        width: 100%;
        max-width: 340px;
    }

    .mobile-demo-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--bg-card);
        margin-bottom: 8px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-demo-card:active {
        background: var(--bg);
    }

    .mobile-demo-card img {
        width: 48px;
        height: 30px;
        object-fit: cover;
        border-radius: 4px;
        border: 1px solid var(--border-light);
    }

    .mobile-demo-card span {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-primary);
    }

    #appFooter {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(28px + env(safe-area-inset-bottom));
    }

    button, a, .tap-target {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

@media (min-width: 768px) {
    .mobile-actions { display: none !important; }
    .sheet-backdrop, .upload-sheet { display: none !important; }
}

body.sheet-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
}

.upload-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
    z-index: 201;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.upload-sheet.open {
    transform: translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.sheet-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.sheet-upload-item {
    margin-bottom: 10px;
}

.sheet-upload-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    min-height: 56px;
    cursor: pointer;
    transition: all 0.2s;
}

.sheet-upload-zone:active {
    background: var(--bg);
}

.sheet-upload-zone.has-file {
    border-color: var(--green);
    border-style: solid;
    background: var(--green-bg);
}

.sheet-upload-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sheet-upload-status {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.sheet-upload-zone.has-file .sheet-upload-status {
    color: var(--green);
}

.sheet-preview {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 8px;
}

.sheet-analyze-btn {
    margin-top: 12px;
    width: 100%;
}

@media (max-width: 480px) {
    .section-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .mrz-grid { grid-template-columns: 1fr; }
}

#appFooter {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 100;
}

#apiUsageText {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    font-family: var(--mono);
}

.not-detected {
    color: var(--text-tertiary) !important;
    font-style: italic;
}

.quality-rejection {
    text-align: center;
    padding: 32px;
    animation: fadeInUp 0.4s ease;
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    border-radius: var(--radius-md);
}

.quality-rejection .rejection-icon {
    color: var(--amber);
    margin-bottom: 12px;
}

.quality-rejection .rejection-icon svg {
    width: 40px;
    height: 40px;
}

.quality-rejection h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.quality-rejection p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.rejection-detail {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: var(--mono);
    margin-bottom: 4px;
}

.face-mismatch-banner {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 6px;
    margin-top: 10px;
    text-align: center;
}

.face-label.face-mismatch {
    color: var(--red);
    background: var(--red-bg);
}

.face-rotation-warning {
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    color: var(--amber);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    margin-top: 8px;
    text-align: center;
}

.antispoof-placeholder {
    color: var(--text-tertiary) !important;
    font-style: italic;
    font-family: var(--font) !important;
}

.scoring-breakdown {
    margin: 12px 24px 0;
}

.scoring-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.scoring-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.scoring-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.scoring-toggle.open svg {
    transform: rotate(90deg);
}

.scoring-breakdown-content {
    padding: 12px 0;
    animation: fadeIn 0.3s ease;
}

.category-row {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 6px;
}

.category-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.category-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-weight {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    font-family: var(--mono);
}

.category-bar-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.category-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.category-counts {
    display: flex;
    gap: 8px;
}

.cat-count {
    font-size: 10px;
    font-weight: 600;
    font-family: var(--mono);
}

.cat-count.pass { color: var(--green); }
.cat-count.warn { color: var(--amber); }
.cat-count.fail { color: var(--red); }

.risk-scale-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.risk-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--mono);
}

.risk-chip.clean { background: var(--green-bg); color: var(--green); }
.risk-chip.low-risk { background: var(--blue-bg); color: var(--accent); }
.risk-chip.suspicious { background: var(--amber-bg); color: var(--amber); }
.risk-chip.tampered { background: var(--red-bg); color: var(--red); }

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    cursor: default;
}

.forensics-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.ela-field-table {
    margin-top: 12px;
    overflow-x: auto;
}

.ela-field-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ela-field-table th {
    text-align: left;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
}

.ela-field-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-family: var(--mono);
    font-size: 11px;
}

.ela-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.ela-badge.high { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.ela-badge.medium { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.ela-badge.low { background: var(--blue-bg); color: var(--accent); border: 1px solid rgba(59,130,246,0.2); }
.ela-badge.none { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }

.ela-suspicious {
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--amber);
}

.ai-detection-panel {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ai-classification {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ai-classification.genuine { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.ai-classification.suspicious { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.ai-classification.ai-generated { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

.ai-composite-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--mono);
}

.ai-gauge {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ai-gauge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.ai-sub-scores {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-sub-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-sub-name {
    width: 80px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: capitalize;
    flex-shrink: 0;
}

.ai-sub-bar {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.ai-sub-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.ai-sub-value {
    width: 32px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    font-family: var(--mono);
    text-align: right;
    flex-shrink: 0;
}

.fraud-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #FEE2E2;
    border: 2px solid #E24B4A;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.fraud-banner .fraud-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.fraud-banner .fraud-text strong {
    display: block;
    color: #991B1B;
    font-size: 15px;
    margin-bottom: 4px;
}

.fraud-banner .fraud-text p {
    color: #7F1D1D;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.mrz-prefix-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.prefix-badge {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.prefix-ir {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.prefix-id {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #86EFAC;
}

.forensics-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.forensics-card.alert {
    border-color: var(--red);
    border-width: 2px;
    background: #FEF2F2;
}

.forensics-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.forensics-card-header strong {
    font-size: 14px;
}

.forensics-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.forensics-status.status-pass {
    background: var(--green-bg);
    color: var(--green);
}

.forensics-status.status-warn {
    background: var(--amber-bg);
    color: var(--amber);
}

.forensics-status.status-fail {
    background: var(--red-bg);
    color: var(--red);
}

.forensics-card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: var(--mono);
    margin-bottom: 8px;
}

.forensics-explanation {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-top: 8px;
}

.face-mismatch-rejection {
    text-align: center;
    padding: 40px 32px;
    animation: fadeInUp 0.4s ease;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-md);
}

.face-mismatch-rejection .mismatch-icon {
    color: var(--red);
    margin-bottom: 12px;
}

.face-mismatch-rejection .mismatch-icon svg {
    width: 48px;
    height: 48px;
}

.face-mismatch-rejection h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 8px;
}

.face-mismatch-rejection p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.face-mismatch-rejection .similarity-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--mono);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.face-mismatch-rejection .mismatch-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.biometric-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.biometric-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.biometric-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.biometric-badge.pass { color: var(--green); background: var(--green-bg); }
.biometric-badge.warn { color: var(--amber); background: var(--amber-bg); }
.biometric-badge.fail { color: var(--red); background: var(--red-bg); }

.biometric-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
}

.biometric-detail {
    color: var(--text-secondary);
    font-size: 12px;
}

.image-compare-slider { position: relative; border-radius: 12px; overflow: hidden; margin: 12px 0; }
.compare-wrapper { position: relative; width: 100%; cursor: ew-resize; }
.compare-base { width: 100%; display: block; }
.compare-reveal { position: absolute; top: 0; left: 0; height: 100%; overflow: hidden; }
.compare-top { height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.compare-handle { position: absolute; top: 0; bottom: 0; width: 3px; background: white; z-index: 10; transform: translateX(-50%); }
.handle-grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 32px; height: 32px; border-radius: 50%; background: white; border: 2px solid rgba(0,0,0,0.3); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.compare-labels { display: flex; justify-content: space-between; padding: 8px 12px; font-size: 12px; color: var(--text-secondary); }

.upload-sheet::after {
    content: '';
    position: sticky;
    bottom: 0;
    display: block;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-card));
    pointer-events: none;
}
.sheet-title-row { display: flex; justify-content: space-between; align-items: center; }
.sheet-close-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: var(--bg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.sheet-close-btn:hover { background: var(--border); }

@media (max-width: 767px) {
    .result-collapse { border: 1px solid var(--border); border-radius: 12px; margin: 8px 0; overflow: hidden; }
    .collapse-header { padding: 14px 16px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; cursor: pointer; background: var(--bg-card); }
    .collapse-body { display: none; padding: 0 16px 14px; }
    .result-collapse.open .collapse-body { display: block; }
    .collapse-chevron { transition: transform 0.2s; }
    .result-collapse.open .collapse-chevron { transform: rotate(180deg); }

    .image-tabs { display: flex; border-bottom: 1px solid var(--border); }
    .image-tab { flex: 1; text-align: center; padding: 10px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text-secondary); }
    .image-tab.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 500; }
    .image-tab-content { display: none; }
    .image-tab-content.active { display: block; }

    #captureResults .progress-section,
    #sheetProgressSection {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: 12px 16px;
        z-index: 100;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    }
}
