:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --paper: #fff;
  --ink: #18332f;
  --ink-soft: #52665e;
  --muted: #5f7168;
  --teal: #0c7569;
  --teal-dark: #09594f;
  --lime: #d9f3df;
  --mint: #ebf7ef;
  --line: #e5ebe6;
  --red: #bc584d;
  --coral: #fcebe6;
  --shadow: 0 12px 32px rgba(22, 54, 42, .055);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef1ee;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: #eef1ee; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid #8ed7c6; outline-offset: 3px; }
.app-shell { min-height: 100dvh; max-width: 760px; margin: 0 auto; position: relative; background: var(--bg); box-shadow: 0 5px 50px rgba(10, 49, 42, .07); padding-bottom: 88px; }
.topbar { height: 72px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(24, 51, 47, .04); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-size: 23px; letter-spacing: -1.1px; font-weight: 820; }
.brand-mark { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 11px; background: var(--teal); color: #fff; font-size: 21px; letter-spacing: -2px; padding-inline-end: 3px; }
.brand-mark.large { width: 46px; height: 46px; font-size: 28px; border-radius: 15px; }
.brand-dot { color: #85afa0; }
.logout-form { margin: 0; }
.text-button, .small-link, .section-heading a, .row-actions a { border: 0; color: var(--teal); background: transparent; font-weight: 720; font-size: 13px; text-decoration: none; }
.text-button { min-height: 40px; padding: 8px; }
.page-content { max-width: 620px; margin: 0 auto; padding: 20px 22px 34px; }
h1 { margin: 4px 0 12px; font-size: clamp(27px, 7vw, 34px); line-height: 1.12; letter-spacing: -1.25px; font-weight: 790; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.35px; }
.lede { max-width: 46ch; margin: 0 0 22px; color: #5f7168; font-size: 14px; line-height: 1.55; }
.back-link { display: inline-flex; min-height: 40px; align-items: center; margin-inline-start: -4px; padding: 4px; color: var(--teal); text-decoration: none; font-size: 13px; font-weight: 730; }
.action-grid { display: grid; gap: 11px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 23px 0 32px; }
.action-card { min-height: 126px; padding: 15px 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--paper); text-decoration: none; box-shadow: var(--shadow); }
.action-card.featured { border-color: #cce8da; background: var(--mint); }
.action-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 12px; color: var(--teal); background: #d8efe4; font-size: 21px; font-weight: 700; }
.action-card strong, .account-copy strong { display: block; font-size: 13px; line-height: 1.3; }
.action-card small, .account-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 13px; }
.section-heading a { padding: 8px 0; }
.account-list { display: grid; gap: 9px; }
.account-card { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); text-decoration: none; box-shadow: 0 4px 14px rgba(22, 54, 42, .025); }
.account-copy { min-width: 0; text-decoration: none; }
.amount { flex: 0 0 auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.form-card, .filter-card, .review-card, .empty-card, .login-card { padding: 19px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.login-card { max-width: 460px; margin: 18px auto; padding: 26px; }
.login-card .brand-mark { margin-bottom: 12px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label, .choice-group legend { color: #425c53; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea, select, input[type="date"] { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid #dce5de; border-radius: 13px; color: var(--ink); background: #fff; }
.field textarea { min-height: 74px; resize: vertical; line-height: 1.45; }
.amount-input { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 0 15px; border: 1px solid #cfe4da; border-radius: 16px; background: #f8fbf8; }
.amount-input span { flex: 0 0 auto; color: #5f7168; font-size: 14px; font-weight: 720; }
.amount-input input { min-width: 0; min-height: 62px; padding: 8px 0; border: 0; outline: 0; background: transparent; font-size: 27px; font-weight: 770; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.amount-input input:focus-visible { outline: 0; }
.amount-input:focus-within { outline: 3px solid #8ed7c6; outline-offset: 2px; }
.field-error, .errorlist { margin: 0; color: #a84139; font-size: 12px; line-height: 1.4; list-style: none; padding: 0; }
.error-summary { margin: 0 0 14px; padding: 11px 13px; border-radius: 12px; color: #843e36; background: var(--coral); font-size: 13px; line-height: 1.5; }
.choice-group { margin: 18px 0; padding: 16px 14px 4px; border: 1px solid var(--line); border-radius: 16px; }
.choice-group legend { padding: 0 5px; }
.check-field { display: flex; align-items: center; gap: 9px; min-height: 46px; color: var(--ink-soft); font-size: 13px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--teal); }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 17px; border: 1px solid transparent; border-radius: 14px; text-decoration: none; font-weight: 760; font-size: 14px; cursor: pointer; }
.button:disabled { opacity: .56; cursor: wait; }
.button.primary { color: #fff; background: var(--teal); box-shadow: 0 8px 16px rgba(12, 117, 105, .13); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--teal-dark); border-color: #d8e7de; background: #f8fbf8; }
.button.danger { color: #fff; background: var(--red); }
.button.block { width: 100%; }
.quick-save { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 4; box-shadow: 0 8px 22px rgba(12, 117, 105, .24); }
.quick-save:focus-visible { scroll-margin-bottom: 150px; }
.quick-save + .fineprint { margin-bottom: 0; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0; }
.pagination .button { min-width: 92px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.fineprint, .quiet { color: var(--muted); font-size: 11px; line-height: 1.55; }
.command-status { min-height: 20px; color: #5f7168; font-size: 12px; line-height: 1.45; }
.result-card { display: flex; align-items: flex-start; gap: 15px; padding: 21px; border: 1px solid #cde6d8; border-radius: 21px; background: var(--mint); }
.result-mark { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-weight: 800; }
.result-card p { color: var(--ink-soft); line-height: 1.5; font-size: 13px; }
.result-card a { display: inline-block; margin: 7px 14px 0 0; color: var(--teal-dark); font-size: 13px; font-weight: 700; }
.balance-card { display: grid; gap: 6px; margin: 18px 0; padding: 19px; border-radius: 22px; color: white; background: linear-gradient(125deg, #0f534c 0%, #126d60 62%, #0f8475 100%); box-shadow: 0 16px 30px rgba(10, 93, 80, .16); }
.balance-card small { color: #c5ede3; font-size: 12px; }
.balance-card strong { font-size: 28px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.balance-card span { color: #d4e9e1; font-size: 11px; }
.filter-card { padding: 14px; margin: 15px 0 22px; }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.filter-grid .field { margin-bottom: 11px; }
.filter-grid input, .filter-grid select { min-height: 42px; padding: 8px; font-size: 12px; }
.statement-list { display: grid; gap: 8px; }
.statement-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 14px 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.row-date { min-width: 0; }
.row-date strong { font-size: 13px; }
.row-date small, .row-values small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.row-values { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-values b { font-size: 12px; }
.row-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 16px; margin-top: 4px; }
.row-actions a { padding: 5px 0; font-size: 11px; }
.small-link { font-size: 12px; }
.review-card { margin-bottom: 12px; line-height: 1.5; }
.review-card p { color: var(--ink-soft); font-size: 13px; }
.correction-preview, .opening-preview { margin: 16px 0; padding: 16px; border: 1px solid #cce8da; border-radius: 16px; background: var(--mint); color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.correction-preview h2, .opening-preview h2 { margin-bottom: 8px; color: var(--ink); }
.correction-preview p, .opening-preview p { margin: 8px 0 0; }
.correction-preview ul { margin: 8px 0; padding-inline-start: 22px; }
.mono { font: 12px ui-monospace, monospace; color: #78887f; overflow-wrap: anywhere; }
.bottom-nav { position: fixed; z-index: 5; inset-inline: 0; bottom: 0; max-width: 760px; min-height: 66px; margin: 0 auto; padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); }
.bottom-nav a { min-height: 44px; display: grid; place-items: center; border-radius: 12px; color: #5f7168; font-size: 11px; font-weight: 700; text-decoration: none; }
.bottom-nav a:focus-visible, .bottom-nav a:hover { color: var(--teal); background: var(--mint); }
.messages { margin-bottom: 12px; }
.message { padding: 11px 13px; border-radius: 12px; background: var(--mint); font-size: 13px; }
@media (min-width: 700px) {
  .page-content { padding: 28px 30px 48px; }
  .action-card { min-height: 142px; padding: 17px; }
  .action-card strong { font-size: 15px; }
  .form-card { padding: 25px; }
  .bottom-nav { border-inline: 1px solid var(--line); border-radius: 18px 18px 0 0; }
}
@media (max-width: 380px) {
  .page-content { padding-inline: 16px; }
  .topbar { padding-inline: 17px; }
  .action-grid { gap: 7px; }
  .action-card { padding: 12px 9px; border-radius: 17px; }
  .action-card strong { font-size: 11px; }
  .action-card small { font-size: 9px; }
  .form-card { padding: 15px; }
}
@media (max-width: 699px) {
  .quick-save, .form-card form > button[type="submit"] { position: fixed; inset-inline-start: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); width: min(calc(100vw - 72px), 566px); transform: translateX(-50%); z-index: 4; box-shadow: 0 8px 22px rgba(12, 117, 105, .24); }
  .app-shell { padding-bottom: 150px; }
}

/* Native hidden must override the app shell display at every viewport. */
[hidden] { display: none !important; }
.session-validation { max-width: 44rem; margin: 20vh auto; padding-inline: 24px; color: var(--ink); }
