@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
  --bg: #f7f6f1;
  --surface: #fffefa;
  --surface-2: #f0f1eb;
  --ink: #1c2b25;
  --muted: #738078;
  --muted-2: #9aa39d;
  --line: #e3e6de;
  --green: #285447;
  --green-2: #3e725f;
  --green-soft: #e1ece5;
  --yellow: #b88428;
  --yellow-soft: #f8efd9;
  --red: #ac5f55;
  --red-soft: #f8e6e2;
  --blue: #587495;
  --blue-soft: #e7edf3;
  --shadow: 0 20px 60px rgba(37, 62, 50, .08), 0 2px 6px rgba(37, 62, 50, .03);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 242px; flex: 0 0 242px; padding: 26px 14px 18px; border-right: 1px solid var(--line); background: rgba(255,254,250,.66); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 29px; }
.brand-mark { width: 35px; height: 35px; border-radius: 12px; background: var(--green); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px rgba(40,84,71,.18); }
.brand-mark svg { width: 19px; }
.brand-name { font-family: Fraunces, Georgia, serif; font-weight: 700; letter-spacing: -.03em; font-size: 20px; }
.brand-sub { display: block; color: var(--muted-2); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .08em; margin-top: 1px; }
.nav-label { padding: 0 13px 8px; color: var(--muted-2); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .12em; }
.nav-list { display: grid; gap: 4px; }
.nav-item { border: 0; background: transparent; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px; color: var(--muted); width: 100%; text-align: left; font-size: 13px; transition: .18s ease; }
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item.active { color: var(--green); background: var(--green-soft); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-spacer { flex: 1; }
.sidebar-foot { margin: 18px 4px 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.tiny-label { color: var(--muted-2); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .09em; }
.privacy-copy { font-size: 11px; line-height: 1.45; color: var(--muted); margin: 8px 0 12px; }
.lock-line { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--green-2); font-weight: 600; }
.main-wrap { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { height: 76px; padding: 0 44px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; background: rgba(247,246,241,.8); }
.crumb { color: var(--muted); font-size: 12px; }
.crumb strong { color: var(--ink); font-weight: 600; }
.top-spacer { flex: 1; }
.global-search { display: flex; align-items: center; gap: 8px; width: min(270px, 34vw); height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 0 11px; color: var(--muted-2); }
.global-search:focus-within { border-color: #adc6b8; box-shadow: 0 0 0 3px rgba(62,114,95,.08); }
.global-search input { border: 0; outline: 0; min-width: 0; background: transparent; width: 100%; color: var(--ink); font-size: 12px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #d7e6db; color: var(--green); font-weight: 700; font-size: 12px; }
.page { width: min(1260px, 100%); margin: 0 auto; padding: 42px 44px 64px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { color: var(--green-2); font: 10px 'DM Mono', monospace; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 9px; }
h1, h2, h3, p { margin: 0; }
h1 { font: 600 clamp(29px, 4vw, 44px)/1.05 Fraunces, Georgia, serif; letter-spacing: -.035em; }
h2 { font: 600 22px/1.2 Fraunces, Georgia, serif; letter-spacing: -.02em; }
h3 { font-size: 14px; }
.page-lede { max-width: 490px; margin-top: 11px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.btn { border: 1px solid transparent; border-radius: 11px; min-height: 39px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 600; transition: .18s ease; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(40,84,71,.13); }
.btn-primary:hover { background: #1f453a; transform: translateY(-1px); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--muted); padding: 0 7px; min-height: 31px; }
.btn-quiet:hover { color: var(--green); background: var(--green-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 11px; }
.cards-grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 18px rgba(41,63,51,.025); }
.stat-card { padding: 18px 19px; min-height: 116px; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; width: 72px; height: 72px; border-radius: 50%; right: -27px; top: -24px; background: var(--green-soft); opacity: .6; }
.stat-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 9px; margin-bottom: 14px; position: relative; z-index: 1; }
.stat-icon svg { width: 15px; height: 15px; }
.stat-value { font: 600 25px Fraunces, Georgia, serif; letter-spacing: -.03em; }
.stat-title { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .85fr); gap: 20px; align-items: start; }
.panel { padding: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 17px; }
.panel-title { font-size: 14px; font-weight: 700; }
.panel-subtitle { font-size: 11px; color: var(--muted); margin-top: 3px; }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); cursor: pointer; }
.recent-row:hover .merchant-name { color: var(--green); }
.receipt-thumb { width: 38px; height: 44px; border-radius: 7px; background: #eef1e9; display: grid; place-items: center; color: var(--green); overflow: hidden; }
.receipt-thumb svg { width: 18px; }
.merchant-name { font-size: 12px; font-weight: 700; transition: color .15s; }
.receipt-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.row-total { text-align: right; font-size: 12px; font-weight: 700; }
.row-status { display: block; margin-top: 5px; text-align: right; }
.status { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-saved { color: var(--green-2); background: var(--green-soft); }
.status-review { color: var(--yellow); background: var(--yellow-soft); }
.status-processing { color: var(--blue); background: var(--blue-soft); }
.status-error { color: var(--red); background: var(--red-soft); }
.mini-bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 45px; gap: 10px; align-items: center; font-size: 11px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--green-2); }
.bar-value { font: 10px 'DM Mono', monospace; color: var(--muted); text-align: right; }
.callout { display: flex; gap: 13px; align-items: flex-start; padding: 16px; border-radius: 15px; background: #eef4ef; margin-top: 18px; }
.callout-icon { width: 27px; height: 27px; border-radius: 8px; background: var(--green); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.callout-icon svg { width: 14px; }
.callout strong { display: block; font-size: 12px; margin-bottom: 4px; }
.callout p { color: var(--muted); font-size: 11px; line-height: 1.45; }
.callout .btn { margin-top: 10px; }
.soft-panel { background: var(--surface-2); border: 1px solid #e5e9e1; border-radius: 15px; }
.quick-actions { display: grid; gap: 9px; }
.quick-action { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; color: var(--ink); }
.quick-action:hover { border-color: #b8cec0; transform: translateY(-1px); }
.quick-action-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--green); }
.quick-action-icon svg { width: 15px; }
.quick-action-text strong { display: block; font-size: 11px; }
.quick-action-text span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.section-gap { margin-top: 24px; }
.filter-bar { display: flex; gap: 9px; flex-wrap: wrap; padding: 13px; margin-bottom: 18px; }
.filter-input, .filter-select { height: 35px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--surface); color: var(--ink); font-size: 11px; outline: 0; }
.filter-input { min-width: 220px; flex: 1; }
.filter-input:focus, .filter-select:focus { border-color: #adc6b8; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.library-count { color: var(--muted); font-size: 11px; }
.view-toggle { display: flex; padding: 3px; background: var(--surface-2); border-radius: 9px; }
.view-toggle button { width: 28px; height: 26px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; display: grid; place-items: center; }
.view-toggle button.active { color: var(--green); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.receipt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.receipt-card { padding: 16px; cursor: pointer; transition: .18s ease; }
.receipt-card:hover { transform: translateY(-2px); border-color: #b8cec0; box-shadow: var(--shadow); }
.receipt-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.merchant-mark { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--green); background: var(--green-soft); }
.receipt-card h3 { margin-top: 13px; font-size: 14px; }
.receipt-date { color: var(--muted); font-size: 11px; margin-top: 3px; }
.receipt-card-bottom { display: flex; justify-content: space-between; align-items: end; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.receipt-total { font: 600 18px Fraunces, Georgia, serif; letter-spacing: -.02em; }
.receipt-items-count { color: var(--muted); font-size: 10px; margin-top: 3px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.chip { border-radius: 6px; padding: 4px 6px; color: var(--muted); background: var(--surface-2); font-size: 9px; }
.list-view .receipt-grid { display: grid; gap: 0; }
.list-view .receipt-card { display: grid; grid-template-columns: 42px 1fr auto auto; gap: 13px; align-items: center; padding: 14px 16px; border-radius: 0; border-bottom: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
.list-view .receipt-card:first-child { border-radius: 16px 16px 0 0; }
.list-view .receipt-card:last-child { border-radius: 0 0 16px 16px; border-bottom: 1px solid var(--line); }
.list-view .receipt-card h3 { margin-top: 0; }
.list-view .receipt-card-bottom { margin-top: 0; border-top: 0; padding-top: 0; display: block; text-align: right; }
.list-view .category-chips { margin-top: 0; max-width: 190px; }
.empty-state { padding: 52px 20px; text-align: center; color: var(--muted); }
.empty-state svg { width: 32px; color: var(--green-2); margin-bottom: 13px; }
.empty-state strong { color: var(--ink); display: block; font-size: 13px; margin-bottom: 5px; }
.empty-state p { font-size: 11px; }
.scan-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; align-items: stretch; }
.scan-dropzone { min-height: 390px; border: 1.5px dashed #b9cec0; border-radius: 20px; background: linear-gradient(135deg, rgba(225,236,229,.76), rgba(255,254,250,.7)); display: flex; align-items: center; justify-content: center; text-align: center; padding: 28px; }
.scan-drop-inner { max-width: 380px; }
.scan-camera { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 20px; color: #fff; background: var(--green); box-shadow: 0 12px 22px rgba(40,84,71,.18); }
.scan-camera svg { width: 29px; }
.scan-dropzone h2 { font-size: 25px; }
.scan-dropzone p { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 10px auto 20px; }
.scan-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.scan-input { display: none; }
.workflow-card { padding: 21px; }
.workflow-steps { display: grid; gap: 18px; }
.workflow-step { display: grid; grid-template-columns: 25px 1fr; gap: 10px; position: relative; }
.workflow-step:not(:last-child)::after { content: ''; width: 1px; position: absolute; left: 12px; top: 26px; bottom: -18px; background: var(--line); }
.step-num { width: 25px; height: 25px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font: 11px 'DM Mono', monospace; position: relative; z-index: 1; }
.workflow-step strong { display: block; font-size: 12px; margin: 3px 0 4px; }
.workflow-step p { color: var(--muted); font-size: 11px; line-height: 1.45; }
.privacy-note { padding: 15px; margin-top: 19px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1.5; }
.privacy-note strong { color: var(--ink); }
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.insight-card { padding: 19px; min-height: 175px; }
.insight-card.wide { grid-column: span 2; }
.insight-card.tall { grid-row: span 2; }
.insight-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.insight-heading h3 { font-size: 13px; }
.insight-heading span { color: var(--muted-2); font: 10px 'DM Mono', monospace; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 105px; height: 105px; border-radius: 50%; background: conic-gradient(var(--green-2) 0 42%, #9ab7a4 42% 64%, #d2bf8b 64% 77%, #c7d4ca 77% 100%); position: relative; flex: 0 0 auto; }
.donut::after { content: ''; position: absolute; inset: 18px; background: var(--surface); border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; font: 600 16px Fraunces, Georgia, serif; }
.legend { display: grid; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 3px; }
.metric-list { display: grid; gap: 10px; }
.metric-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; }
.metric-row span { color: var(--muted); }
.metric-row strong { font-size: 12px; }
.export-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(290px, .9fr); gap: 20px; align-items: start; }
.export-card { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 700; }
.field small { font-size: 10px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); padding: 0 10px; color: var(--ink); font-size: 11px; outline: 0; }
.field textarea { padding-top: 10px; resize: vertical; min-height: 73px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #adc6b8; box-shadow: 0 0 0 3px rgba(62,114,95,.08); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { position: relative; }
.check-pill input { position: absolute; opacity: 0; }
.check-pill label { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 10px; cursor: pointer; }
.check-pill input:checked + label { border-color: #a4c2b1; background: var(--green-soft); color: var(--green); font-weight: 600; }
.export-preview { position: sticky; top: 20px; }
.export-preview .preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.preview-file { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.file-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.file-icon svg { width: 15px; }
.file-copy { min-width: 0; flex: 1; }
.file-copy strong { font-size: 11px; display: block; }
.file-copy span { color: var(--muted); font-size: 10px; }
.export-footnote { color: var(--muted); font-size: 10px; line-height: 1.5; padding-top: 14px; }
.prompt-box { background: #263a33; color: #e3ede4; border-radius: 13px; padding: 16px; font: 10px/1.55 'DM Mono', monospace; max-height: 330px; overflow: auto; white-space: pre-wrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 880px; }
.settings-card { padding: 20px; }
.settings-card .panel-header { margin-bottom: 20px; }
.setting-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.setting-row strong { display: block; font-size: 11px; }
.setting-row span { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; margin-top: 3px; }
.toggle { width: 36px; height: 21px; border: 0; padding: 2px; border-radius: 99px; background: #c9d0ca; flex: 0 0 auto; }
.toggle i { display: block; width: 17px; height: 17px; background: white; border-radius: 50%; transition: transform .18s; }
.toggle.on { background: var(--green); }
.toggle.on i { transform: translateX(15px); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(24,42,34,.42); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(820px, 100%); max-height: min(780px, calc(100vh - 40px)); overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: 0 28px 90px rgba(18,38,28,.25); }
.modal.small { width: min(510px, 100%); }
.modal-header { padding: 20px 23px 16px; display: flex; align-items: flex-start; gap: 15px; border-bottom: 1px solid var(--line); }
.modal-header .top-spacer { flex: 1; }
.modal-header h2 { font-size: 21px; }
.modal-header p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.close-btn { border: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.close-btn:hover { color: var(--ink); }
.close-btn svg { width: 15px; }
.modal-body { padding: 22px 23px 24px; }
.scan-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 19px; }
.preview-tile { min-height: 145px; position: relative; border: 1px solid var(--line); border-radius: 12px; background: #eef1e9; display: grid; place-items: center; overflow: hidden; }
.preview-tile img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.preview-tile .tile-remove { position: absolute; right: 7px; top: 7px; width: 24px; height: 24px; border: 0; border-radius: 7px; background: rgba(255,254,250,.9); color: var(--red); display: grid; place-items: center; z-index: 1; }
.preview-tile .tile-remove svg { width: 12px; }
.preview-empty { color: var(--muted); font-size: 10px; text-align: center; padding: 14px; }
.scan-progress { display: grid; gap: 10px; padding: 14px; margin-top: 14px; border-radius: 12px; background: var(--surface-2); }
.progress-line { height: 7px; border-radius: 99px; overflow: hidden; background: var(--line); }
.progress-line span { display: block; height: 100%; width: 40%; background: var(--green-2); border-radius: inherit; animation: progress 1.4s ease-in-out infinite; }
@keyframes progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.scan-progress p { color: var(--muted); font-size: 11px; }
.modal-footer { padding: 14px 23px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.helper-text { color: var(--muted); font-size: 10px; }
.detail-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.receipt-image-placeholder { min-height: 280px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg,#edf1e9,#f9f8f2); display: grid; place-items: center; color: var(--muted); text-align: center; padding: 18px; }
.receipt-image-placeholder svg { width: 29px; color: var(--green-2); margin-bottom: 9px; }
.receipt-image-placeholder p { font-size: 10px; line-height: 1.4; }
.detail-fields { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.detail-fields .field.full { grid-column: 1/-1; }
.items-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.items-table th { color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; font: 9px 'DM Mono', monospace; text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.items-table td { font-size: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.items-table td:last-child, .items-table th:last-child { text-align: right; }
.item-name { font-weight: 700; font-size: 11px; }
.item-raw { color: var(--muted); font-size: 9px; margin-top: 2px; }
.category-select { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 10px; padding: 4px; max-width: 120px; }
.reconcile-box { display: flex; gap: 10px; align-items: center; margin-top: 17px; padding: 12px; border-radius: 11px; background: var(--yellow-soft); color: var(--yellow); font-size: 11px; }
.reconcile-box svg { width: 15px; flex: 0 0 auto; }
.reconcile-box.good { color: var(--green-2); background: var(--green-soft); }
.toast { position: fixed; right: 20px; bottom: 22px; z-index: 50; display: flex; align-items: center; gap: 10px; max-width: min(390px, calc(100vw - 40px)); padding: 12px 14px; border-radius: 12px; background: #263a33; color: #fff; box-shadow: 0 12px 30px rgba(17,35,27,.25); font-size: 12px; animation: toast-in .25s ease both; }
.toast svg { width: 15px; color: #bcd6c4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav { display: none; }
.muted { color: var(--muted); }
.mono { font-family: 'DM Mono', monospace; }
.text-right { text-align: right; }
.hide { display: none !important; }

@media (max-width: 1080px) {
  .topbar { padding: 0 28px; }
  .page { padding-left: 28px; padding-right: 28px; }
  .receipt-grid { grid-template-columns: repeat(2,1fr); }
  .insight-grid { grid-template-columns: repeat(2,1fr); }
  .insight-card.wide { grid-column: span 2; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .topbar { padding: 0 18px; height: 65px; }
  .global-search { width: 170px; }
  .page { padding: 28px 18px 94px; }
  .page-header { margin-bottom: 23px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid, .scan-hero, .export-layout { grid-template-columns: 1fr; }
  .scan-dropzone { min-height: 320px; }
  .export-preview { position: static; }
  .mobile-nav { position: fixed; display: flex; z-index: 20; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 62px; padding: 5px; background: rgba(255,254,250,.94); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 35px rgba(31,55,43,.14); backdrop-filter: blur(12px); }
  .mobile-nav .nav-item { flex: 1; padding: 7px 4px; flex-direction: column; justify-content: center; gap: 3px; border-radius: 12px; font-size: 9px; text-align: center; }
  .mobile-nav .nav-item:nth-child(n+5) { display: none; }
}
@media (max-width: 560px) {
  .topbar .crumb { display: none; }
  .topbar .top-spacer { min-width: 0; }
  .global-search { flex: 1; width: auto; }
  .avatar { flex: 0 0 auto; }
  .page-header { display: block; }
  .page-header > .btn { margin-top: 17px; width: 100%; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px; min-height: 105px; }
  .stat-value { font-size: 21px; }
  .receipt-grid, .insight-grid, .settings-grid { grid-template-columns: 1fr; }
  .insight-card.wide, .insight-card.tall { grid-column: auto; grid-row: auto; }
  .filter-input { min-width: 100%; }
  .filter-select { flex: 1; min-width: 130px; }
  .list-view .receipt-card { grid-template-columns: 38px 1fr auto; }
  .list-view .category-chips { display: none; }
  .list-view .receipt-card-bottom { grid-column: 3; grid-row: 1; }
  .scan-buttons .btn { flex: 1 1 42%; }
  .scan-preview-grid { grid-template-columns: repeat(2,1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .receipt-image-placeholder { min-height: 180px; }
  .detail-fields { grid-template-columns: 1fr; }
  .detail-fields .field.full { grid-column: auto; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: calc(100vh - 20px); border-radius: 20px 20px 12px 12px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 17px; padding-right: 17px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; }
  .items-table { min-width: 510px; }
  .items-scroll { overflow-x: auto; }
}
