.fi-body {
    background:
        radial-gradient(900px 380px at 100% -20%, rgba(184, 97, 58, 0.12), transparent 50%),
        #f4f0e7;
}

.dark .fi-body {
    background:
        radial-gradient(800px 320px at 100% -10%, rgba(231, 176, 137, 0.08), transparent 45%),
        #0d1614;
}

.fi-main {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.fi-sidebar {
    background: #fffdf8;
    border-inline-end: 1px solid rgba(18, 53, 47, 0.08);
}

.dark .fi-sidebar {
    background: #101a17;
}

.fi-topbar {
    background: rgba(255, 253, 248, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(18, 53, 47, 0.08);
}

.dark .fi-topbar {
    background: rgba(16, 26, 23, 0.9);
}

.fi-simple-layout {
    background:
        radial-gradient(700px 320px at 80% 0%, rgba(231, 176, 137, 0.28), transparent 55%),
        #12352f;
    min-height: 100dvh;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.fi-simple-main {
    width: min(100%, 28rem);
    border-radius: 1.4rem;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-in-entry-wrp {
    border-radius: 1rem;
}

.fi-wi-stats-overview-stat {
    min-width: 0;
}

.fi-header-heading,
.fi-simple-header-heading {
    letter-spacing: -0.03em;
}

.thi-situation {
    display: grid;
    gap: 0.85rem;
}

.thi-situation-card {
    min-width: 0;
    background: #fffdf8;
    border: 1px solid rgba(18, 53, 47, 0.1);
    border-radius: 1.1rem;
    padding: 1rem 1rem 1rem 0.95rem;
    box-shadow: 0 10px 30px rgba(18, 53, 47, 0.05);
}

.dark .thi-situation-card {
    background: #16211e;
    border-color: rgba(255, 255, 255, 0.08);
}

.thi-kicker {
    margin: 0;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.thi-value {
    margin: 0.35rem 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.thi-meta {
    margin: 0.2rem 0 0;
    color: #4b5563;
    overflow-wrap: anywhere;
}

@media (min-width: 720px) {
    .thi-situation { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1200px) {
    .thi-situation { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .fi-header { align-items: stretch; }
    .fi-header-actions { width: 100%; }
    .fi-header-actions .fi-btn { flex: 1 1 auto; }
    .fi-topbar-start { min-width: 0; }
    .fi-logo { max-width: 11rem; }
}

/* Receipt review: photo next to what was read */
.thi-review { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .thi-review { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.thi-review-photo img { margin-top: .5rem; width: 100%; max-height: 640px; object-fit: contain; border-radius: 12px; border: 1px solid rgba(18, 53, 47, .12); background: #fff; }
.thi-link { color: #0f766e; font-weight: 600; text-decoration: underline; }
.thi-muted { color: #6b7280; }
.thi-reading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; font-size: .875rem; }
.thi-banner { border-radius: 10px; padding: .625rem .875rem; margin-bottom: .75rem; font-size: .875rem; line-height: 1.4; }
.thi-banner-info { background: #eef6f5; color: #12352f; }
.thi-banner-warning { background: #fff4e0; color: #7a4a00; }
.thi-banner-danger { background: #fdecec; color: #8a1c1c; }
.thi-compare { width: 100%; border-collapse: collapse; font-size: .875rem; }
.thi-compare th, .thi-compare td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid rgba(18, 53, 47, .08); vertical-align: top; }
.thi-compare thead th { font-weight: 600; color: #6b7280; font-size: .75rem; text-transform: uppercase; letter-spacing: .02em; }
.thi-compare tbody th { font-weight: 600; white-space: nowrap; }
.thi-compare tr.is-mismatch td, .thi-compare tr.is-mismatch th { background: #fdf1f1; }
.thi-compare-mark { width: 2rem; text-align: center !important; font-weight: 700; }
.thi-ok { color: #15803d; }
.thi-ko { color: #b91c1c; }
.thi-ocr-text { margin-top: .75rem; font-size: .8125rem; }
.thi-ocr-text summary { cursor: pointer; color: #0f766e; font-weight: 600; }
.thi-ocr-text pre { white-space: pre-wrap; background: #fbfaf6; border: 1px solid rgba(18, 53, 47, .08); border-radius: 8px; padding: .75rem; margin-top: .5rem; max-height: 320px; overflow: auto; }
.dark .thi-compare tr.is-mismatch td, .dark .thi-compare tr.is-mismatch th { background: rgba(185, 28, 28, .15); }
.dark .thi-ocr-text pre { background: rgba(255, 255, 255, .04); }
.dark .thi-banner-info { background: rgba(15, 118, 110, .18); color: #cdeae6; }
.dark .thi-banner-warning { background: rgba(217, 119, 6, .18); color: #fde7c2; }
.dark .thi-banner-danger { background: rgba(185, 28, 28, .2); color: #fecaca; }

/* AI OCR usage and cost (Settings → Receipt OCR) */
.thi-usage { display: grid; gap: 1rem; }
.thi-usage-tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.thi-usage-tile { display: flex; flex-direction: column; gap: .125rem; padding: .875rem 1rem; border-radius: 12px; background: #eef6f5; }
.thi-usage-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: #6b7280; }
.thi-usage-value { font-size: 1.5rem; line-height: 1.2; color: #12352f; font-variant-numeric: tabular-nums; }
.thi-usage-tile .thi-muted { font-size: .8125rem; }
.thi-usage-table { overflow-x: auto; }
.thi-number { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.thi-usage-note { font-size: .8125rem; line-height: 1.5; margin: 0; }
.dark .thi-usage-tile { background: rgba(15, 118, 110, .18); }
.dark .thi-usage-value { color: #cdeae6; }
