@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&display=swap');

:root { color-scheme: light; --bg: #f8f9f6; --ink: #2b302b; --muted: #777e75; --line: #e9ece5; --accent: #75866a; --error: #a14337; font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-synthesis: none; color: var(--ink); background: var(--bg); }
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, input, a { outline-offset: 4px; }
:focus-visible { outline: 2px solid #738567; }
[hidden] { display: none !important; }
.app-header { max-width: 1160px; padding: 24px 48px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 650; font-size: 24px; letter-spacing: -.9px; text-decoration: none; color: var(--ink); }
.brand-dot { color: var(--accent); }
.header-note { font-size: 12px; color: var(--muted); letter-spacing: .1px; }
main { width: min(860px, calc(100% - 64px)); margin: 24px auto 24px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #717e66; font-size: 10px; letter-spacing: 1.7px; font-weight: 650; }
.eyebrow > span { width: 5px; height: 5px; border-radius: 50%; background: #879678; }
h1 { margin: 12px 0 10px; font-size: 42px; font-weight: 550; line-height: 1.1; letter-spacing: -1.8px; }
h1 > span { color: #88967c; }
.intro p { margin: 0; font-size: 14px; color: var(--muted); }
.button { border: 1px solid transparent; border-radius: 8px; min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-size: 12px; font-weight: 550; padding: 0 15px; transition: background .16s, border-color .16s, transform .16s; white-space: nowrap; }
.button:active { transform: translateY(1px); }
.button svg { width: 17px; height: 17px; flex: none; }
.button-secondary { background: #fff; border-color: #dfe4d9; color: #555e50; }
.button-secondary:hover { background: #f0f3ec; border-color: #c8d0c0; }
.intro .button { margin-bottom: 2px; }
.button-primary { background: #303a2c; color: #fff; }
.button-primary:hover { background: #46533f; }
.balance-card { background: #fff; border: 1px solid #e3e7de; border-radius: 15px; overflow: hidden; box-shadow: 0 3px 5px #28321902, 0 9px 30px #28321902; }
.table-head, .entry-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) 160px; column-gap: 24px; align-items: center; padding-left: 30px; padding-right: 30px; }
.table-head { min-height: 49px; background: #fcfdfb; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 600; color: #727d68; letter-spacing: 1.1px; }
.table-head > :nth-child(2) { text-align: right; padding-right: 40px; }
.table-head > :last-child { text-align: right; padding-right: 1px; }
.entry-row { min-height: 76px; position: relative; }
.entry-row:not(:last-child)::after { content: ''; position: absolute; left: 30px; right: 30px; bottom: 0; height: 1px; background: var(--line); }
.entry-name { display: flex; align-items: center; min-width: 0; gap: 15px; }
.entry-number { display: grid; place-items: center; color: #8c9685; font-size: 10px; font-weight: 500; background: #f4f6f0; width: 32px; height: 32px; border-radius: 9px; flex: none; }
.entry-name label { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; line-height: 1.4; cursor: pointer; }
.remaining { padding-right: 40px; text-align: right; }
.remaining output { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.8px; overflow-wrap: anywhere; }
.remaining output.negative { color: var(--error); }
.input-wrap { position: relative; }
.input-wrap > span { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: #a0a69a; font-size: 16px; pointer-events: none; }
.input-wrap input { width: 100%; height: 43px; text-align: right; padding: 0 13px 0 32px; border: 1px solid #e5e8e0; border-radius: 8px; color: var(--ink); background: #fdfefb; font-size: 14px; font-variant-numeric: tabular-nums; transition: border-color .16s, background .16s; }
input::placeholder { color: #a3aa9d; opacity: 1; }
.input-wrap input:hover { border-color: #cbd3c4; }
input:focus { border-color: #8d9d80; background: #fff; }
input[aria-invalid=true] { border-color: var(--error) !important; }
.field-error { display: block; color: var(--error); font-size: 11px; line-height: 1.4; margin: 6px 0; }
.card-footer { min-height: 78px; padding: 16px 30px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.update-note { display: flex; align-items: center; gap: 7px; color: #8a9182; font-size: 11px; }
.update-note svg { width: 15px; height: 15px; flex: none; }
#update-button { min-width: 132px; min-height: 43px; justify-content: space-between; padding-left: 20px; padding-right: 16px; }
.below-card { display: flex; align-items: center; justify-content: space-between; margin: 19px 3px 0; color: #8a9282; font-size: 10px; gap: 14px; }
.save-note { display: flex; align-items: center; gap: 6px; }
.save-note svg { width: 12px; height: 12px; }
.status { color: #5b734e; font-size: 12px; text-align: center; margin: 14px 0 0; min-height: 18px; }
.status.error { color: var(--error); }
.setup-hint { color: #909787; font-size: 12px; text-align: center; margin: 2px 0 0; }
.setup-hint button { border: 0; padding: 2px 0; background: none; color: #5a6e4d; text-decoration: underline; text-underline-offset: 3px; }
.fatal-error { padding: 14px 18px; color: var(--error); background: #fff4f0; border: 1px solid #ebc7be; border-radius: 8px; font-size: 13px; margin-bottom: 20px; }
dialog { width: min(540px, calc(100% - 32px)); border: 1px solid #e3e7de; padding: 29px; border-radius: 16px; color: var(--ink); box-shadow: 0 20px 100px #1e2c2024; max-height: calc(100dvh - 40px); }
dialog::backdrop { background: #222b2145; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
h2 { font-size: 26px; font-weight: 550; letter-spacing: -.8px; margin: 10px 0 0; }
.icon-button { display: grid; place-items: center; padding: 7px; border: 0; border-radius: 7px; background: #f6f8f2; color: #65715b; }
.icon-button:hover { background: #e9eee3; }
.icon-button svg { width: 18px; height: 18px; }
#settings-description { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 12px 0 23px; }
.settings-head, .settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.settings-head { color: #899080; font-size: 9px; letter-spacing: 1.1px; margin-bottom: 10px; }
.settings-row { margin-bottom: 10px; }
.settings-row input { min-width: 0; width: 100%; height: 42px; padding: 0 12px; border: 1px solid #e0e5d9; border-radius: 7px; font-size: 13px; color: var(--ink); background: #fcfdfb; }
.settings-row input:last-of-type { font-variant-numeric: tabular-nums; }
.settings-row .field-error { grid-column: 1 / -1; margin: -5px 0 2px; }
.settings-help { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 16px 0 0; }
.form-error { color: var(--error); font-size: 12px; line-height: 1.5; margin: 12px 0; }
.form-error:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-height: 900px) and (min-width: 701px) {
  .app-header { padding-top: 34px; padding-bottom: 34px; }
  main { margin-top: 56px; }
  .entry-row { min-height: 88px; }
  .table-head { min-height: 53px; }
  .card-footer { min-height: 87px; }
}
@media (max-width: 700px) {
  .app-header { padding: 25px 25px; }
  .brand { font-size: 22px; }
  .header-note { font-size: 10px; }
  main { width: calc(100% - 40px); margin-top: 40px; }
  h1 { font-size: 34px; }
  .intro { gap: 12px; margin-bottom: 26px; }
  .intro p { font-size: 12px; max-width: 220px; line-height: 1.6; }
  .intro .button { font-size: 11px; padding: 0 11px; }
  .table-head, .entry-row { grid-template-columns: minmax(80px, 1fr) minmax(92px, 1fr) 110px; gap: 12px; padding-left: 20px; padding-right: 20px; }
  .table-head { font-size: 8px; letter-spacing: .6px; }
  .table-head > :nth-child(2), .remaining { padding-right: 4px; }
  .entry-number { display: none; }
  .entry-name label { font-size: 13px; }
  .entry-row { min-height: 80px; }
  .entry-row:not(:last-child)::after { left: 20px; right: 20px; }
  .remaining output { font-size: 22px; }
  .card-footer { padding: 18px 20px; }
  .update-note { font-size: 10px; }
  #update-button { min-width: 110px; }
}
@media (max-width: 430px) {
  .header-note { display: none; }
  .app-header { padding: 22px 21px; }
  main { width: calc(100% - 32px); margin-top: 24px; }
  h1 { font-size: 31px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  .intro p { max-width: 185px; }
  .intro .button { gap: 5px; padding: 0 9px; min-height: 38px; }
  .intro .button svg { width: 15px; }
  .table-head, .entry-row { grid-template-columns: minmax(62px, 1fr) minmax(78px, 1fr) 88px; gap: 8px; padding-left: 15px; padding-right: 15px; }
  .table-head { min-height: 45px; font-size: 7px; letter-spacing: .45px; }
  .entry-row { min-height: 76px; }
  .remaining output { font-size: 20px; }
  .input-wrap input { font-size: 13px; padding-right: 10px; padding-left: 23px; }
  .input-wrap > span { left: 10px; }
  .entry-row:not(:last-child)::after { left: 15px; right: 15px; }
  .card-footer { padding: 17px 15px; min-height: 80px; gap: 9px; }
  .update-note { font-size: 9px; gap: 4px; }
  .update-note svg { width: 13px; }
  #update-button { min-width: 94px; padding-left: 15px; padding-right: 12px; }
  .below-card { font-size: 9px; }
  .setup-hint { font-size: 10px; line-height: 1.8; }
  dialog { padding: 22px; }
}
/* Debt accounts and editable entries */
.account-controls { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e9eee3; color: #647658; font-size: 11px; font-weight: 600; }
#account-name { max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.text-button { border: 0; background: none; padding: 3px 0; font-size: 11px; color: #63765a; text-decoration: none; }
.text-button:hover { color: #2d3b27; text-decoration: underline; text-underline-offset: 3px; }
#logout { padding-left: 14px; margin-left: 4px; border-left: 1px solid #dfe5d8; }
#logout:disabled { cursor: wait; }
#dashboard .eyebrow > #greeting { width: auto; height: auto; border-radius: 0; background: none; }
.plus { font-size: 21px; line-height: 1; font-weight: 400; margin-top: -2px; }
.entry-edit { display: inline-flex; align-items: center; gap: 9px; padding: 4px 0; border: 0; background: none; text-align: left; color: var(--ink); font-size: 14px; font-weight: 500; min-width: 0; }
.entry-label { overflow-wrap: anywhere; }
.entry-edit svg { flex: none; width: 13px; height: 13px; color: #a0ac97; transition: color .15s; }
.entry-edit:hover svg { color: #556c48; }
.entry-edit:hover .entry-label { text-decoration: underline; text-underline-offset: 3px; }
.entry-row { padding-top: 12px; padding-bottom: 12px; }
.loading-view { min-height: 350px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; }
.loading-dot { width: 7px; height: 7px; border-radius: 50%; background: #829175; }
.auth-view { width: min(410px, calc(100% - 40px)); margin-top: 36px; }
.auth-card { background: #fff; padding: 27px 30px 29px; border: 1px solid #e2e7db; border-radius: 15px; box-shadow: 0 12px 40px #28321903; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; background: #f2f5ed; border-radius: 8px; margin-bottom: 32px; }
.auth-tabs button { border: 0; border-radius: 5px; background: transparent; min-height: 35px; font-size: 12px; color: #7b8672; }
.auth-tabs button.active { background: #fff; color: #35452d; box-shadow: 0 1px 4px #2832190a; }
.auth-card h1 { font-size: 31px; letter-spacing: -1.3px; margin-top: 13px; }
#auth-title:focus { outline: none; }
#auth-description { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 11px 0 27px; }
.auth-field { margin: 0 0 17px; }
.auth-field label { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 550; color: #596351; }
.auth-field input { width: 100%; border: 1px solid #dfe5d8; background: #fcfdfb; color: var(--ink); padding: 0 12px; min-height: 43px; border-radius: 7px; font-size: 13px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 59px; }
.password-wrap button { position: absolute; right: 12px; top: 12px; }
.field-help { font-size: 10px; color: #818c78; line-height: 1.6; margin: 7px 0 0; }
.forgot-row { text-align: right; margin-top: -6px; margin-bottom: 17px; }
.auth-submit { width: 100%; justify-content: space-between; font-size: 13px; min-height: 44px; padding-left: 17px; padding-right: 17px; }
.auth-message { font-size: 12px; line-height: 1.6; color: #617751; margin: 15px 0; }
.auth-message:empty { display: none; }
.auth-message.error { color: var(--error); }
.confirmation-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; color: #687e5b; background: #f0f4ea; margin-bottom: 21px; }
.confirmation-icon svg { width: 31px; height: 31px; }
.confirmation-copy { font-size: 13px; line-height: 1.8; color: #737e6b; }
.confirmation-copy strong { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.confirmation-help { font-size: 12px; line-height: 1.8; color: var(--muted); margin: 15px 0 25px; }
.confirmation-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: 19px; }
#resend-confirmation { justify-content: center; }
.back-login { display: block; margin: 19px auto 0; }
.auth-footnote { text-align: center; color: #939c8a; font-size: 10px; margin-top: 23px; }
#entry-description { margin: 15px 0 25px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.import-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid #dfe6d7; border-radius: 9px; padding: 13px 16px; margin-bottom: 16px; background: #f1f5ec; font-size: 11px; color: #5f7152; }
.import-banner p { margin: 0; }
.import-list { margin-top: 15px; }
.import-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.import-list > div > :last-child { font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .entry-edit { font-size: 13px; gap: 6px; } .entry-edit svg { width: 11px; } }
@media (max-width: 430px) {
  .account-controls { gap: 7px; font-size: 11px; } #account-name { max-width: 98px; } #logout { padding-left: 9px; margin-left: 1px; }
  .avatar { width: 26px; height: 26px; } .auth-view { margin-top: 20px; } .auth-card { padding: 24px; }
  .import-banner { align-items: flex-start; flex-direction: column; gap: 6px; } .entry-edit svg { display: none; }
  #dashboard .intro p { max-width: 210px; } .entry-edit { font-size: 12px; }
}
