:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #687080;
  --line: #e7dfd0;
  --paper: #fff;
  --canvas: #f7f0df;
  --red: #b7282e;
  --red-dark: #8f1f24;
  --straw: #f4c542;
  --amber-soft: #fff1b8;
  --shadow: 0 18px 50px rgba(23, 32, 51, .13);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100%, 470px); min-height: 100vh; margin: 0 auto; background: var(--paper); box-shadow: var(--shadow); }
header { padding: max(18px, env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 3px solid var(--straw); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 21px; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; text-decoration: none; }
.avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; object-fit: cover; border: 3px solid var(--straw); box-shadow: 0 2px 8px rgba(23,32,51,.16); }
.account-chip { border: 1px solid #e7c85e; border-radius: 12px; background: var(--amber-soft); padding: 7px 9px; font-size: 11px; line-height: 1.2; text-align: center; }
.account-chip strong { display: block; color: var(--red-dark); font-size: 12px; }
main { padding: 20px 18px 28px; }
h1, h2, p { margin: 0; }
h1 { margin-top: 5px; font-size: 28px; }
h2 { font-size: 20px; }
.muted, .data-updated { color: var(--muted); }
.data-updated { margin-top: 4px; font-size: 12px; }
.eyebrow { color: inherit; opacity: .8; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.eyebrow.dark { color: var(--red-dark); opacity: 1; }
.hero { color: white; background: linear-gradient(135deg, var(--red-dark), var(--red)); border-radius: 20px; padding: 20px; margin: 16px 0 12px; box-shadow: 0 8px 20px rgba(183,40,46,.18); }
.hero strong { display: block; margin: 6px 0 2px; font-size: 31px; letter-spacing: -.04em; }
.meter { height: 7px; margin: 15px 0 9px; overflow: hidden; background: rgba(255,255,255,.25); border-radius: 99px; }
.meter span { display: block; height: 100%; background: white; }
.toolbar-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mom-badge { padding: 7px 10px; border-radius: 99px; background: var(--amber-soft); color: var(--red-dark); font-size: 12px; font-weight: 800; }
.total-card { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 17px; border: 2px solid var(--straw); border-radius: 16px; background: #fffaf0; font-weight: 800; }
.total-card strong { color: var(--red-dark); font-size: 24px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bucket-card { min-height: 105px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.bucket-card span { display: block; min-height: 38px; color: var(--muted); font-size: 13px; font-weight: 700; }
.bucket-card strong { display: block; margin-top: 9px; font-size: 22px; }
.empty-state, .login-card { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fffaf0; }
.empty-state p { margin-top: 7px; color: var(--muted); line-height: 1.45; }
.login-card .muted { margin-top: 7px; }
.stack { display: grid; gap: 14px; margin-top: 22px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 800; }
input, select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); }
.form-card { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fffaf0; }
.text-link { color: var(--red-dark); font-size: 13px; font-weight: 800; text-decoration: none; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.summary-item { padding: 13px 8px; border: 1px solid var(--line); border-radius: 13px; text-align: center; }
.summary-item strong, .summary-item span { display: block; }
.summary-item strong { font-size: 23px; }
.summary-item span { color: var(--muted); font-size: 11px; font-weight: 800; }
.summary-item.good { border-color: #9bcaa1; background: #f1fbf2; }
.summary-item.warn { border-color: #e4c75d; background: #fff9df; }
.button-row { display: flex; gap: 9px; margin-top: 14px; }
.secondary { min-height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-weight: 800; }
.primary:disabled { cursor: not-allowed; opacity: .45; }
.status-banner { font-weight: 800; color: var(--red-dark); }
.row-list { display: grid; gap: 8px; margin-top: 14px; }
.import-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 13px; }
.import-row.valid { border-left-color: #3e9a4d; }
.import-row.duplicate { border-left-color: #9297a0; opacity: .76; }
.import-row.collision, .import-row.invalid { border-left-color: #d59c16; background: #fffbeb; }
.import-row strong, .import-row small { display: block; }
.import-row small { margin-top: 3px; color: var(--muted); }
.status-label { display: block; margin-bottom: 3px; color: var(--red-dark); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.row-message { color: #8b6510 !important; }
.dashboard-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.dashboard-filters label { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.dashboard-filters select { min-height: 40px; margin-top: 4px; padding: 0 8px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.review-alert { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 13px 15px; border: 1px solid #ddb94c; border-radius: 14px; background: var(--yellow); color: var(--ink); text-decoration: none; }
.review-alert span { color: var(--red-dark); font-weight: 900; }
.main-nav { display: flex; gap: 6px; padding: 0 20px 10px; border-bottom: 1px solid var(--border); }
.main-nav a { padding: 7px 12px; border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 900; text-decoration: none; }
.main-nav a.active { background: var(--ink); color: white; }
.queue-count { margin: 14px 0 8px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.review-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: white; }
.review-charge { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.review-charge div { display: grid; gap: 3px; }
.review-charge span, .subtle { color: var(--muted); font-size: 12px; }
.review-form { display: grid; gap: 13px; margin-top: 16px; }
.review-form fieldset { margin: 0; padding: 0; border: 0; }
.review-form legend { margin-bottom: 8px; font-size: 12px; font-weight: 900; }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.choice-row label { display: flex; justify-content: center; gap: 6px; padding: 10px 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--cream); font-size: 12px; font-weight: 900; }
.choice-row input { width: auto; }
.luke-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.luke-fields[hidden] { display: none; }
.category-form, .category-edit-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 80px auto; gap: 10px; align-items: end; }
.category-form label, .category-edit-form label { margin: 0; }
.category-group { margin-top: 14px; }
.category-row { padding: 14px 0; border-top: 1px solid var(--line); }
.category-row:first-of-type { border-top: 0; }
.category-row.retired { opacity: .68; }
.category-status { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.status-pill { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); font-size: .82rem; }
@media (max-width: 620px) {
  .category-form, .category-edit-form { grid-template-columns: 1fr 76px; }
  .category-form label:first-of-type, .category-form label:nth-of-type(2), .category-form .primary-button,
  .category-edit-form label:first-of-type { grid-column: 1 / -1; }
  .category-status { justify-content: flex-start; flex-wrap: wrap; }
}
.luke-fields label { font-size: 11px; font-weight: 900; text-transform: uppercase; }
.luke-fields select { margin-top: 5px; text-transform: none; }
.empty-state { margin-top: 24px; padding: 30px 20px; border: 1px solid var(--border); border-radius: 16px; background: white; text-align: center; }
.button-link { display: inline-block; margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--red-dark); color: white; font-weight: 900; text-decoration: none; }
.filter-note { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.filter-note a { color: var(--red-dark); font-weight: 900; }
.overview-heading { margin: 20px 0 8px; font-size: 17px; }
.total-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.income-amount { color: #287744; }
.bucket-card { color: var(--ink); text-decoration: none; }
.bucket-card.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.freshness-card, .transactions-section { margin-top: 20px; }
.freshness-card h2, .section-heading h2 { margin: 0; font-size: 17px; }
.freshness-card > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.freshness-card > div strong { color: var(--muted); }
.section-heading, .transaction-row { display: flex; justify-content: space-between; gap: 12px; }
.section-heading { align-items: center; }
.section-heading span { color: var(--muted); font-weight: 900; }
.transaction-row { padding: 13px 2px; border-bottom: 1px solid var(--line); }
.transaction-row strong, .transaction-row small { display: block; }
.transaction-row small { margin-top: 3px; color: var(--muted); }
.transaction-amount { text-align: right; white-space: nowrap; }
.transaction-amount span { display: inline-block; margin-top: 5px; padding: 2px 6px; border-radius: 7px; background: var(--yellow); color: var(--red-dark); font-size: 10px; font-weight: 900; }
.over-budget { color: #ffd4cc; font-weight: 900; }
.override-row { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11px; font-weight: 800; }
.override-row input { width: 16px; min-height: 16px; }
@media (max-width: 520px) { .dashboard-filters { grid-template-columns: 1fr 1fr; } .dashboard-filters label:last-child { grid-column: 1 / -1; } }
.primary { min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--red); color: white; font-weight: 800; }
.primary:hover { background: var(--red-dark); }
.flash { margin-bottom: 14px; padding: 12px; border-radius: 12px; }
.flash.error { background: #fff3f0; color: var(--red-dark); border: 1px solid #e6b7b1; }
.flash.success { background: #effaf1; color: #256b31; border: 1px solid #a9d4af; }
footer { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px calc(15px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--red-dark); font-weight: 800; }
