:root {
  color-scheme: light;
  --navy: #493809;
  --teal: #d7a900;
  --teal-dark: #725600;
  --ink: #352c15;
  --muted: #756b4d;
  --line: #e9dfbc;
  --cream: #fff1c2;
  --page: #383838;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100vh; color: var(--ink); background: var(--page); }
button, input, select, textarea { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }

.preview-notice {
  padding: 9px 14px;
  color: #704b00;
  background: #fff1bd;
  border-bottom: 1px solid #e3cb77;
  text-align: center;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 9px max(16px, calc((100vw - 760px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--navy); font-size: 18px; font-weight: 800; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; overflow: hidden; background: transparent; border: 0; border-radius: 0; }
.brand-mark img { width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.signed-in { color: var(--muted); font-size: 12px; }
.signout {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--navy);
  background: #fff6d3;
  border: 1px solid #e9d891;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}
.signout svg { width: 15px; height: 15px; }
.signout svg path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }

.page-main { width: min(100%, 760px); margin: 0 auto; padding: 24px 18px 125px; }
.page-heading { margin: 0 0 18px; }
.eyebrow { margin: 0 0 7px; color: #ffdc72; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
h1 { margin: 0; color: #fff8df; font-size: clamp(24px, 6vw, 32px); line-height: 1.2; }
.page-subtitle { margin: 8px 0 0; color: #e2e0d7; font-size: 14px; line-height: 1.5; }

.card { margin-bottom: 16px; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 12px rgb(73 56 9 / 8%); }
.card.cream { background: var(--cream); }
.card h2 { margin: 0 0 14px; color: var(--navy); font-size: 17px; }
.notice { margin-bottom: 16px; padding: 12px 13px; color: #704b00; background: #fff4d6; border: 1px solid #e8d596; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.tax-illustration-dialog { width: min(440px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); margin: auto; padding: 24px; color: var(--ink); background: #fff; border: 1px solid #fdba74; border-radius: 14px; box-shadow: 0 18px 60px rgb(0 0 0 / 28%); }
dialog.tax-illustration-dialog[open] { position: fixed; inset: 0; z-index: 1000; }
.tax-illustration-dialog::backdrop { background: rgb(0 0 0 / 56%); }
.tax-illustration-dialog h2 { margin: 0 0 12px; color: #9a3412; font-size: 20px; }
.tax-illustration-dialog p { margin: 0 0 18px; color: var(--ink); line-height: 1.55; }
.tax-illustration-dialog .primary-button { width: auto; min-width: 90px; padding: 0 20px; }
.transfer-pin-form { display: grid; gap: 12px; }
.transfer-pin-field { display: grid; gap: 6px; }
.transfer-pin-field label { color: var(--ink); font-size: 13px; font-weight: 700; }
.transfer-pin-input { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #cbd0c2; border-radius: 9px; outline: none; }
.transfer-pin-input:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgb(215 169 0 / 18%); }

.form-grid { display: grid; gap: 15px; }
.form-grid fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-grid legend, .form-grid label { display: block; margin: 0 0 7px; color: var(--ink); font-size: 13px; font-weight: 700; }
.field { display: grid; gap: 6px; }
.form-control { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #cbd0c2; border-radius: 9px; outline: none; }
.form-control:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgb(215 169 0 / 18%); }
.form-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.exchange-rate-preview { padding: 10px 12px; background: #fffdf6; border: 1px solid var(--line); border-radius: 9px; }
.transfer-warning { margin: 0; color: #b91c1c; font-size: 13px; font-weight: 700; }
.type-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.type-option { display: flex; min-height: 48px; align-items: center; gap: 8px; padding: 9px 10px; background: #fffdf6; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 650; }
.type-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal-dark); }
.type-option:has(input:checked) { background: #fff5cf; border-color: #d7b548; }
.primary-button { width: 100%; min-height: 48px; padding: 11px 14px; color: #352700; background: var(--teal); border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; }
.primary-button:hover { background: #edc43d; }

.review-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.review-row span { color: var(--muted); }
.review-row strong { text-align: right; overflow-wrap: anywhere; }
.secondary-button { min-height: 44px; padding: 9px 13px; color: var(--navy); background: #fff7d9; border: 1px solid #eadb9b; border-radius: 9px; cursor: pointer; font-weight: 700; }

.transaction { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.transaction:first-of-type { border-top: 0; }
.transaction-name { font-size: 14px; font-weight: 700; }
.transaction-date { margin-top: 4px; color: var(--muted); font-size: 12px; }
.transaction-time { margin-top: 3px; color: var(--muted); font-size: 12px; }
.transaction-amount { white-space: nowrap; font-size: 13px; font-weight: 750; }
.credit { color: #387746; }
.debit { color: var(--ink); }
.transaction-status { grid-column: 1 / -1; color: #725600; font-size: 11px; }
.transaction-status.pending-status { justify-self: start; padding: 5px 8px; color: #8a5a00; background: #fff4c9; border: 1px solid #e9c04a; border-radius: 99px; font-weight: 700; }
.delete-pending-button { grid-column: 1 / -1; justify-self: start; min-height: 36px; margin-top: 4px; padding: 7px 11px; color: #9a3412; background: #fff7ed; border-color: #fdba74; font-size: 12px; }
.statement-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, .7fr); gap: 10px; margin-bottom: 12px; }
.empty-state { padding: 20px 8px; color: var(--muted); text-align: center; font-size: 13px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-card { min-width: 0; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.stat-label { margin: 0; color: var(--muted); font-size: 12px; }
.stat-value { margin: 9px 0 4px; color: var(--navy); font-size: clamp(20px, 5vw, 26px); font-weight: 800; overflow-wrap: anywhere; }
.stat-note { margin: 0; color: var(--muted); font-size: 11px; }
.bar-chart { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12px; }
.bar-track { height: 13px; overflow: hidden; background: #f0ead4; border-radius: 99px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #d7a900, #f1d46b); border-radius: inherit; }
.faq-item { padding: 13px 0; border-top: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 0; }
.faq-item summary { min-height: 38px; color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 700; }
.faq-item p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.contact-methods { display: grid; gap: 10px; }
.contact-detail { display: grid; min-height: 58px; gap: 5px; padding: 11px 13px; color: var(--navy); background: #fffdf6; border: 1px solid var(--line); border-radius: 10px; }
.contact-copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.contact-copy-row .contact-value { min-width: 0; }
.contact-value { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; user-select: text; }
.contact-email { color: #1d4ed8; }
.education-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.education-card { padding: 14px; background: #fffdf6; border: 1px solid var(--line); border-radius: 12px; }
.education-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 14px; }
.education-card p { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.education-card p:last-child { margin-bottom: 0; }

.bottom-nav {
  position: fixed;
  z-index: 5;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  width: min(680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 9px 8px 11px;
  background: #fffdf6;
  border: 1px solid #e9dfbc;
  border-radius: 22px;
  box-shadow: 0 10px 35px rgb(73 56 9 / 16%);
}
.bottom-nav-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 2px; }
.bottom-nav a { display: flex; min-width: 0; min-height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 1px; color: #665829; border-radius: 12px; text-decoration: none; font-size: 10px; font-weight: 650; }
.bottom-nav a[aria-current="page"] { color: var(--navy); background: #fff3c8; }
.bottom-nav svg { width: 20px; height: 20px; }
.bottom-nav svg path, .bottom-nav svg rect, .bottom-nav svg circle { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.balance-mini { margin-bottom: 14px; padding: 14px; color: var(--navy); background: var(--cream); border-radius: 12px; font-size: 13px; }
.balance-mini strong { display: block; margin-top: 5px; font-size: 19px; }

@media (max-width: 360px) {
  .page-main { padding: 20px 13px 120px; }
  .card { padding: 16px; }
  .statement-filters { grid-template-columns: 1fr; }
  .type-options { grid-template-columns: 1fr; }
  .education-grid { grid-template-columns: 1fr; }
  .signed-in { display: none; }
}
