@font-face { font-family: 'Frog Title'; src: url('/title-font.ttf') format('truetype'); font-style: normal; font-weight: 900; font-display: swap; }
:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17312b;
  background: #f1f5f3;
  --line: #cad9d2;
  --muted: #465e56;
  --green: #11634d;
  --dark: #12332d;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #26866a; outline-offset: 3px; }

.header-inner { max-width: 1260px; margin: auto; padding: 12px 24px 4px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.frog-mascot { display: block; flex: none; width: clamp(130px, 26vw, 220px); height: clamp(110px, 21vw, 180px); object-fit: cover; object-position: center 70%; }
main { max-width: 1260px; margin: auto; padding: 12px 24px 48px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 5.5vw, 3rem); letter-spacing: -.035em; line-height: 1.12; }
h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.02em; }
h3 { font-size: 1.1rem; line-height: 1.3; }
.workspace { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 20px; align-items: start; }
.results { display: grid; gap: 16px; min-width: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 20px; min-width: 0; scroll-margin: 1rem; }
.panel > p { margin-top: 8px; color: var(--muted); }
.account-disclosure { margin-top: 10px; }
.account-disclosure > summary, .panel-summary { align-content: center; min-height: 44px; }
.account-disclosure > summary { color: var(--green); font-weight: 680; }
.account-disclosure > summary::marker, .panel-summary::marker { color: var(--green); }
.statement-disclosure, .storage-note { grid-column: 1 / -1; }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count { padding: 1px 9px; border: 1px solid #bbdbcd; border-radius: 15px; background: #e7f4ee; font-weight: 650; }
.empty { background: #f5f8f6; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); padding: 16px; margin-top: 14px; }
.empty.compact { padding: 12px; }
.account-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-balance { display: grid; justify-items: start; gap: 2px; }
.account-item-actions { display: grid; gap: 4px; }
.account-entry-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
button[aria-expanded="true"].account-entry-toggle { background: #d8ede2; }
.account-entry-form { border-top: 1px solid var(--account-border, var(--line)); padding-top: 12px; }
.account-entry-form .actions { margin-top: 0; }
#account-entry-list { overflow-wrap: anywhere; }
#account-entry-list li > strong { white-space: nowrap; }
.import-spending-matches { margin-top: 12px; display: grid; gap: 8px; }
button.icon-action { display: grid; place-items: center; flex: 0 0 44px; width: 44px; padding: 0; font: 1.4rem/1 "Segoe UI Symbol", system-ui, sans-serif; }
button.trash-action { background: #fff5f4; color: #783334; border-color: #dcb3af; }
button.trash-action:hover { background: #f7e1df; }
.account-row { margin-top: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; overflow-wrap: anywhere; }

form { display: grid; gap: 12px; margin-top: 14px; }
label { display: grid; min-width: 0; gap: 5px; font-size: .9rem; font-weight: 630; }
input, select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #9bb5aa; border-radius: 7px; padding: 8px 10px; background: #fff; color: #17312b; font-size: 1rem; font-weight: 400; }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, #465e56 50%), linear-gradient(135deg, #465e56 50%, transparent 50%); background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="file"] { padding: 7px; }
input::file-selector-button { font: inherit; color: var(--dark); background: #e8f1ec; border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; margin-right: 8px; }
button { min-height: 44px; width: fit-content; max-width: 100%; border: 1px solid var(--green); border-radius: 7px; padding: 8px 14px; background: var(--green); color: white; font-weight: 680; }
button:hover { background: #0b4e3b; }
button.secondary { background: #edf7f2; color: #0c4e3c; border-color: #95bcab; }
button.secondary:hover { background: #d8ede2; }
button.quiet { background: transparent; color: var(--muted); border-color: transparent; }
button.quiet:hover { background: #e8f1ec; }
button:disabled { cursor: default; opacity: .55; }
.status { font-size: .9rem; color: var(--muted); }
.status:empty { display: none; }
.status.error { color: #92392d; }
.muted, .storage-note { color: var(--muted); font-size: .9rem; }
.ai-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ai-controls .status { flex: 1 1 230px; }

.bill-card { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 15px; background: #fbfdfb; overflow-wrap: anywhere; }
[data-account-tint="checking"] { --account-background: #e8f4e8; --account-border: #c1d9c0; --account-accent: #194d36; }
[data-account-tint="visa"] { --account-background: #fbe9e8; --account-border: #e7c5c2; --account-accent: #783334; }
.account-row[data-account-tint], .bill-card[data-account-tint] { background: var(--account-background); border: 1px solid var(--account-border); }
.account-row[data-account-tint] { border-radius: 10px; padding: 12px; }
[data-account-tint] .amount, [data-account-tint] .due-label { color: var(--account-accent); }
.bill-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.bill-heading p { margin-top: 3px; }
.panel-summary h2 { display: inline; }
.panel-summary .count { float: right; margin-inline-start: 8px; font-size: 1rem; }
.spending-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.spending-total { background: #edf7f2; border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; }
.spending-total dt { font-size: .82rem; font-weight: 630; }
.spending-total dd { margin: 2px 0 0; font-size: clamp(.9rem, 4vw, 1.25rem); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spending-total.is-over { background: #fbe9e8; border-color: #e7c5c2; }
.spending-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.spending-table th, .spending-table td { padding: 8px 5px; border-bottom: 1px solid var(--line); }
.spending-table th { text-align: left; }
.spending-table th:not(:first-child), .spending-table td { text-align: right; }
.spending-table td { white-space: nowrap; }
.spending-table th:first-child { padding-left: 0; }
.spending-table th:last-child, .spending-table td:last-child { padding-right: 0; }
.spending-table [scope="row"] { font-weight: 650; }
.spending-result { color: #124e3e; }
.spending-result span { display: block; font-size: .8rem; }
.spending-details > p { margin-top: 8px; }
.is-over { color: #783334; }
@media (max-width: 440px) {
  .spending-table { font-size: .8rem; }
  .spending-table th, .spending-table td { padding-inline: 4px; }
}
.saved-bill .bill-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.4rem, max-content) auto; align-items: start; min-height: 44px; }
.bill-total { display: grid; justify-items: end; gap: 4px; }
.bill-item-actions { display: flex; gap: 5px; }
button.mark-paid-toggle { white-space: nowrap; padding-inline: 9px; font-size: .875rem; background: #fbe9e8; color: #783334; border-color: #e7c5c2; }
button.mark-paid-toggle:hover { background: #f6d9d7; }
@media (max-width: 480px) { .bill-item-actions { display: grid; gap: 4px; } }
.saved-bill-name, .saved-bill .due-label { display: block; }
.due-label { color: #124e3e; font-size: .9rem; font-weight: 650; }
.bill-card > p { margin-top: 8px; }
.mark-paid { gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--account-border, var(--line)); }
.mark-paid label { display: inline-flex; align-items: center; gap: 6px; }
.mark-paid input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--green); }
#bill-payment-list li > strong { white-space: nowrap; }
.amount { color: #124e3e; font-size: clamp(1.1rem, 5vw, 1.35rem); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.bill-form .actions { margin: 0; }
.note { border-left: 3px solid #b5823d; padding: 6px 10px; background: #fcf5e6; font-size: .9rem; }
details.history { margin-top: 12px; border-top: 1px solid var(--line); }
.history summary { padding: 11px 0; color: #155842; font-weight: 650; }
.history ul { padding: 0; margin: 0 0 10px; list-style: none; max-height: 17rem; overflow: auto; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid #e5ece8; }
.history .preview-rows li { display: grid; gap: 2px; overflow-wrap: anywhere; }
#import-preview { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
#import-preview > p { margin-top: 8px; }

@media (max-width: 760px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 440px) {
  .header-inner, main { padding-left: 14px; padding-right: 14px; }
  .header-inner { gap: 10px; }
  .panel { padding: 15px; }
  .bill-fields { grid-template-columns: minmax(0, 1fr); }
}

.card-coverage { display: grid; justify-items: center; text-align: center; }
.bill-budget-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.card-balance-totals { display: flex; flex-wrap: wrap; gap: 12px; align-items: start; }
.card-balance-totals .card-coverage { flex: 1; }
.coverage-form { border-top: 1px solid var(--account-border, var(--line)); padding-top: 10px; }

button.record-card-payment { white-space: nowrap; padding-inline: 9px; font-size: .875rem; background: #e8f4e8; color: #194d36; border-color: #c1d9c0; }
button.record-card-payment:hover { background: #d8ede2; }

.about-panel { grid-column: 1 / -1; }
.about-panel h3 { margin-top: 18px; }
.about-panel p { margin-top: 8px; }

.account-row[data-account-tint='checking'] button { background: #fbe9e8; color: #783334; border-color: #e7c5c2; }
.account-row[data-account-tint='checking'] button:hover { background: #f6d9d7; }

.login-panel { max-width: 420px; margin: 24px auto; }
.connection-panel { position: fixed; right: 16px; bottom: 16px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); max-height: 45vh; overflow: auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 3px 16px #12332d20; }
.connection-panel:has(> #connection-status:empty):has(> #sync-recovery[hidden]) { display: none; }
.restore-label { margin-top: 12px; }
#sync-recovery { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }

.site-header h1 { font-family: 'Cooper Black', 'Frog Title', Georgia, serif; font-weight: 900; font-synthesis: none; color: #12452d; letter-spacing: -.025em; -webkit-text-stroke: 1px #fff6d5; paint-order: stroke fill; }

.header-title { min-width: 0; }
.page-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.page-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 20px; border: 1px solid #c1d9c0; border-radius: 9px; background: #e8f4e8; color: #12452d; font-family: 'Cooper Black', 'Frog Title', Georgia, serif; font-size: 1.15rem; font-weight: 900; font-synthesis: none; text-decoration: none; }
.page-links a:hover { background: #d8ede2; }

.finance-date { display: block; margin-top: 14px; font-size: 1rem; font-weight: 600; color: var(--muted); }

/* Native date selection with the same written date used in Finance. */
.date-picker { position: relative; width: fit-content; min-height: 44px; margin-bottom: -10px; padding: 0 0 10px; cursor: pointer; }
.date-picker input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 44px; opacity: 0; cursor: pointer; }
.date-picker input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.date-picker:focus-within { outline: 3px solid #26866a; outline-offset: 3px; border-radius: 4px; }
