/* ── ChestXpert — Professional Light Medical Theme ──────────────────── */
:root {
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --bg-subtle: #f1f5f9;
    --border: #e2e8f0;
    --border-focus: #2563eb;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-hover: #1d4ed8;
    --green: #16a34a;
    --green-bg: #f0fdf4;
    --yellow: #ca8a04;
    --yellow-bg: #fefce8;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

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

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

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* ── Navigation ─────────────────────────────────────────────────────── */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.nav-logo {
    width: 32px;
    height: 32px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
}

.feature-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 auto 14px;
}

.hero-tag {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-subtle);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 4px var(--green);
}

.status-dot.partial {
    background: var(--yellow);
}

.status-dot.offline {
    background: var(--red);
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 0.95rem;
}

.btn-outline {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-text {
    background: none;
    color: var(--primary);
    padding: 4px 8px;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* ── Hero Section ───────────────────────────────────────────────────── */
.hero {
    padding: 60px 0 80px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 16px;
}

.hero-desc {
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* Hero Visual */
.hero-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.hero-card-header {
    padding: 10px 14px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.card-dot.red {
    background: #fca5a5;
}

.card-dot.yellow {
    background: #fde68a;
}

.card-dot.green {
    background: #86efac;
}

.hero-preview {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.preview-placeholder p {
    margin-top: 8px;
    font-size: 0.82rem;
}

.hero-bars {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-bar-item {
    display: grid;
    grid-template-columns: 120px 1fr 40px;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.hero-bar-track {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-subtle);
    overflow: hidden;
}

.hero-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--red);
    transition: width 1s ease;
}

.hero-bar-fill.medium {
    background: var(--yellow);
}

.hero-bar-fill.low {
    background: var(--green);
}

.hero-bar-pct {
    text-align: right;
    font-weight: 600;
    font-size: 0.78rem;
}

/* ── Features ───────────────────────────────────────────────────────── */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 0.95rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Conditions ─────────────────────────────────────────────────────── */
.conditions {
    padding: 60px 0 80px;
    background: var(--bg-white);
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.condition-card {
    text-align: center;
    padding: 24px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow 0.2s;
}

.condition-card:hover {
    box-shadow: var(--shadow-md);
}

.condition-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.condition-card h4 {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.condition-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── CTA ────────────────────────────────────────────────────────────── */
.cta {
    padding: 60px 0;
}

.cta-card {
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    text-align: center;
    padding: 48px 40px;
}

.cta-card h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.cta-card p {
    opacity: 0.85;
    margin-bottom: 24px;
}

.cta-card .btn {
    background: white;
    color: var(--primary);
}

.cta-card .btn:hover {
    background: #f0f0f0;
}

/* ── Page Content ───────────────────────────────────────────────────── */
.page-content {
    padding: 32px 0 60px;
    min-height: calc(100vh - 140px);
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ── Upload ─────────────────────────────────────────────────────────── */
.upload-card {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-white);
}

.upload-card:hover,
.upload-card.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.upload-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.upload-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Preview Card */
.preview-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 560px;
    margin: 0 auto;
}

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

.preview-header h3 {
    font-size: 0.92rem;
    font-weight: 600;
}

.preview-body {
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 380px;
    overflow: hidden;
}

.preview-body img {
    width: 100%;
    max-height: 380px;
    object-fit: contain;
}

.preview-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Loading ────────────────────────────────────────────────────────── */
.loading-card {
    max-width: 420px;
    margin: 40px auto;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    text-align: center;
}

.loading-bar {
    height: 4px;
    background: var(--bg-subtle);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.4s;
    animation: loading-pulse 2s ease-in-out infinite;
}

@keyframes loading-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.loading-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.loading-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.loading-steps-list {
    text-align: left;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.step-item.active {
    color: var(--primary);
    font-weight: 500;
}

.step-item.done {
    color: var(--green);
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.step-item.active .step-num {
    background: var(--primary-light);
    color: var(--primary);
}

.step-item.done .step-num {
    background: var(--green-bg);
    color: var(--green);
}

/* ── Results ────────────────────────────────────────────────────────── */
.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-bar h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.results-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Image Column */
.card-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin: -24px -24px 0;
    padding: 0 24px;
}

.card-tab {
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.card-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.card-tab:hover:not(.active) {
    color: var(--text);
}

.card-image-wrap {
    margin: 16px -24px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.card-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.heatmap-selector {
    border-top: 1px solid var(--border);
    margin: 0 -24px -24px;
    padding: 14px 24px;
}

.heatmap-selector label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 8px;
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pill.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.model-card {
    margin-top: 16px;
}

.model-card h4 {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.model-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
}

.model-tag.on {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.model-tag.off {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Predictions */
.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.pred-item {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}

.pred-item:hover {
    box-shadow: var(--shadow);
}

.pred-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

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

.pred-name span {
    margin-right: 6px;
}

.pred-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pred-pct {
    font-weight: 700;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.pred-pct.low {
    color: var(--green);
}

.pred-pct.medium {
    color: var(--yellow);
}

.pred-pct.high {
    color: var(--red);
}

.risk-tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.risk-tag.low {
    background: var(--green-bg);
    color: var(--green);
}

.risk-tag.medium {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.risk-tag.high {
    background: var(--red-bg);
    color: var(--red);
}

.pred-bar-bg {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-subtle);
    overflow: hidden;
    margin-bottom: 8px;
}

.pred-bar {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.pred-bar.low {
    background: var(--green);
}

.pred-bar.medium {
    background: var(--yellow);
}

.pred-bar.high {
    background: var(--red);
}

.pred-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.pred-models {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

/* Summary */
.summary-card {
    margin-top: 16px;
}

.summary-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.summary-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.summary-top h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.summary-card>p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Disclaimer */
.disclaimer {
    margin-top: 16px;
    padding: 14px 18px;
    background: var(--yellow-bg);
    border: 1px solid rgba(202, 138, 4, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.disclaimer.lg {
    padding: 24px;
    font-size: 0.88rem;
}

.disclaimer.lg h4 {
    margin-bottom: 8px;
    color: var(--text);
}

/* ── About Page ─────────────────────────────────────────────────────── */
.about-section {
    margin-bottom: 40px;
}

.about-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.about-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
}

.about-card {
    text-align: center;
}

.about-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.about-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.about-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.about-card ul {
    list-style: none;
    text-align: left;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.about-card ul li {
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.about-card ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.about-card-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 4px 14px;
    border-radius: 20px;
    background: var(--bg-subtle);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.about-card-badge.highlight {
    background: var(--primary-light);
    color: var(--primary);
}

/* Performance Table */
.perf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.perf-table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.perf-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.perf-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--border);
    border-bottom: none;
}

.perf-badge {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.perf-badge.excellent {
    background: var(--green-bg);
    color: var(--green);
}

.perf-badge.good {
    background: var(--primary-light);
    color: var(--primary);
}

.perf-badge.fair {
    background: var(--yellow-bg);
    color: var(--yellow);
}

/* Dataset */
.dataset-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
}

.dataset-item h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.dataset-item p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.dataset-stats {
    display: flex;
    gap: 24px;
    justify-content: flex-end;
}

.ds-stat {
    text-align: center;
}

.ds-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.ds-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Detail Card */
.detail-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.detail-card dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 12px;
    font-size: 0.84rem;
}

.detail-card dt {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-card dd {
    color: var(--text);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 24px;
}

.footer h4 {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer a {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0;
}

.footer a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-visual {
        display: none;
    }

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

    .conditions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-layout {
        grid-template-columns: 1fr;
    }

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

    .about-grid.two-col {
        grid-template-columns: 1fr;
    }

    .dataset-info {
        grid-template-columns: 1fr;
    }

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

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: fadeIn 0.4s ease;
}

.pred-item {
    animation: fadeIn 0.35s ease backwards;
}

.pred-item:nth-child(1) {
    animation-delay: 0.05s;
}

.pred-item:nth-child(2) {
    animation-delay: 0.1s;
}

.pred-item:nth-child(3) {
    animation-delay: 0.15s;
}

.pred-item:nth-child(4) {
    animation-delay: 0.2s;
}

.pred-item:nth-child(5) {
    animation-delay: 0.25s;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.3s ease;
}

.toast.error {
    background: var(--red);
    color: white;
}

.toast.info {
    background: var(--primary);
    color: white;
}

/* ── Hero Actions ───────────────────────────────────────────────────── */
.hero-actions {
    display: flex;
    gap: 12px;
}

/* ── Features Overview (4-col) ──────────────────────────────────────── */
.features-overview {
    padding: 60px 0;
    background: var(--bg-white);
}

.four-col {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Page Header Row ────────────────────────────────────────────────── */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* ── Results Actions ────────────────────────────────────────────────── */
.results-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Sample Gallery ─────────────────────────────────────────────────── */
.samples-section {
    margin-bottom: 24px;
}

.samples-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.samples-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.samples-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.sample-card {
    min-width: 120px;
    max-width: 140px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sample-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.sample-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.sample-card p {
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
}

/* ── History Page ───────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: box-shadow 0.2s;
}

.history-card:hover {
    box-shadow: var(--shadow);
}

.history-card-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.history-info h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.history-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.history-id {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

.history-preds {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-pred {
    display: grid;
    grid-template-columns: 130px 1fr 50px;
    gap: 8px;
    align-items: center;
    font-size: 0.82rem;
}

.history-bar-bg {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-subtle);
    overflow: hidden;
}

.history-bar {
    height: 100%;
    border-radius: 2px;
}

.history-bar.low {
    background: var(--green);
}

.history-bar.medium {
    background: var(--yellow);
}

.history-bar.high {
    background: var(--red);
}

.history-pct {
    text-align: right;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.history-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ── Compare Page ───────────────────────────────────────────────────── */
.compare-uploads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.compare-upload-card {
    position: relative;
}

.compare-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.upload-card.compact {
    padding: 30px 20px;
}

.upload-card.compact p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.compare-preview {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
}

.compare-preview img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    background: #f9fafb;
}

.compare-preview .btn {
    margin: 8px;
}

.compare-actions {
    text-align: center;
    margin-bottom: 24px;
}

.compare-results-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
}

.compare-col-title {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.card-image-wrap.compact {
    min-height: 180px;
}

.compare-pred-row {
    display: grid;
    grid-template-columns: 110px 1fr 50px;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    font-size: 0.82rem;
}

.compare-pred-label {
    font-weight: 500;
}

.compare-diff-col {
    min-width: 160px;
}

.diff-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
}

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

.diff-label {
    font-weight: 500;
}

.diff-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.diff-up {
    color: var(--red);
}

.diff-down {
    color: var(--green);
}

.diff-neutral {
    color: var(--text-muted);
}

/* ── Report Page ────────────────────────────────────────────────────── */
.report-container {
    max-width: 900px;
}

.report-header {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.report-page {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.report-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 32px;
    border-bottom: 2px solid var(--primary);
}

.report-title-bar h1 {
    font-size: 1.3rem;
    font-weight: 700;
}

.report-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.report-meta {
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.report-meta p {
    margin-bottom: 2px;
}

.report-body {
    padding: 28px 32px;
}

.report-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 20px 0 12px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.report-image-box {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.report-image-box img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.report-heatmap-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.report-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.report-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.report-disclaimer {
    margin-top: 24px;
    padding: 16px;
    background: var(--yellow-bg);
    border: 1px solid rgba(202, 138, 4, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Responsive (Additional) ────────────────────────────────────────── */
@media (max-width: 768px) {
    .compare-uploads {
        grid-template-columns: 1fr;
    }

    .compare-results-grid {
        grid-template-columns: 1fr;
    }

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

    .four-col {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-actions {
        flex-direction: column;
    }

    .results-actions {
        flex-direction: column;
    }

    .history-pred {
        grid-template-columns: 100px 1fr 40px;
    }
}

.btn-sm {
    font-size: 0.78rem;
    padding: 4px 10px;
}