/* Accepted Mint concept: 390px, white, #269e7b, native text and SVG icons. */
:root {
  color-scheme: light;
  --paper: #fff;
  --text: #15202b;
  --muted: #88929f;
  --border: #e7ecef;
  --green: #269e7b;
  --green-dark: #0d8163;
  --mint: #eaf9f3;
  --red: #f34f48;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
button, input, textarea { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 3px; }
button:disabled { cursor: default; }
button:disabled:not(.is-loading) { opacity: .55; }
[hidden] { display: none !important; }
svg { display: block; width: 24px; height: 24px; }
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell {
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(27px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.app-header { display: flex; align-items: center; justify-content: space-between; min-height: 34px; margin-bottom: 17px; gap: 8px; }
.app-header h1 { font-size: 24px; line-height: 1.25; font-weight: 750; letter-spacing: -.8px; white-space: nowrap; }
.app-header h1 span { color: #07533f; }
.profile-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 0; border-radius: 50%; background: #eaf1f1; color: #17212d; }
.profile-button svg { width: 24px; height: 24px; }

.balance-panel {
  position: relative;
  overflow: hidden;
  min-height: 156px;
  padding: 17px 17px 15px;
  border-radius: var(--radius);
  background: linear-gradient(118deg, #239d79 0%, #2caa87 65%, #48b895 100%);
  color: #fff;
}
.balance-panel::before, .balance-panel::after { content: ""; position: absolute; border-radius: 50%; background: rgba(210, 255, 234, .1); pointer-events: none; }
.balance-panel::before { width: 200px; height: 200px; right: -34px; top: 71px; }
.balance-panel::after { width: 145px; height: 145px; right: 86px; top: 114px; background: rgba(210, 255, 234, .06); }
.balance-panel > * { position: relative; z-index: 1; }
.balance-heading { display: flex; align-items: center; gap: 10px; }
.balance-heading h2 { font-size: 16px; font-weight: 500; line-height: 20px; }
.balance-visibility { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: white; width: 24px; height: 20px; }
.balance-visibility svg { width: 20px; height: 20px; }
.balance-panel .asset-label { position: absolute; top: 16px; right: 14px; display: flex; align-items: center; gap: 5px; height: 36px; border: 1px solid #90d3bc; border-radius: 22px; padding: 5px 10px 5px 8px; background: rgba(255, 255, 255, .15); font-size: 13px; font-weight: 600; }
.asset-label > span { display: grid; place-items: center; border-radius: 50%; width: 23px; height: 23px; background: rgba(0, 121, 89, .5); font-size: 21px; line-height: 1; }
.balance-value { margin-top: 6px; max-width: 100%; font-size: clamp(24px, 9.75vw, 38px); line-height: 44px; font-weight: 700; letter-spacing: -.6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.balance-value.is-empty { font-size: 27px; }
.balance-asset { font-size: 18px; line-height: 23px; font-weight: 600; }
.balance-time { margin-top: 10px; color: #c1e9dc; font-size: 13px; line-height: 20px; }
.balance-warning { margin-top: 5px; color: #fff1cc; font-size: 12px; line-height: 18px; }

.month-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.month-stats > div { padding: 12px 13px 10px; border: 1px solid var(--border); border-radius: 9px; min-height: 74px; }
.month-stats h2 { color: #78828e; font-size: 14px; line-height: 20px; font-weight: 400; white-space: nowrap; }
.month-stats p { margin-top: 5px; font-size: 20px; line-height: 25px; font-weight: 650; letter-spacing: -.4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pending-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 56px; margin-top: 10px; padding: 8px 13px 8px 12px; border: 0; border-radius: 9px; background: #f3f8f5; color: var(--text); }
.pending-title { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 24px; font-weight: 600; }
.pending-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; color: var(--green-dark); background: var(--mint); }
.pending-icon svg { width: 25px; height: 25px; }
.pending-end { display: flex; align-items: center; gap: 13px; color: #586371; font-size: 14px; white-space: nowrap; }
.chevron { color: #8c96a1; font-size: 27px; line-height: 1; font-weight: 300; }

.home-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 8px; margin: 17px 0 0; }
.menu-button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px; border: 0; padding: 0; min-height: 77px; background: transparent; color: #34404d; font-size: 15px; line-height: 20px; }
.menu-icon { display: grid; place-items: center; width: 56px; height: 56px; background: var(--mint); color: var(--green-dark); border-radius: 50%; }
.menu-icon svg { width: 27px; height: 27px; }
.menu-button:active .menu-icon, .profile-button:active { background: #d7f1e6; }
.recent-section { margin-top: 12px; padding-top: 17px; border-top: 1px solid var(--border); }
.recent-section h2 { font-size: 20px; line-height: 24px; font-weight: 650; letter-spacing: -.3px; }
.recent-events { margin-top: 12px; }
.recent-event { display: flex; align-items: center; gap: 13px; min-height: 53px; padding: 6px 0; }
.recent-event + .recent-event { border-top: 1px solid var(--border); }
.recent-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: var(--mint); color: var(--green-dark); }
.recent-icon svg { width: 25px; height: 25px; }
.recent-info { min-width: 0; }
.recent-name { font-size: 14px; line-height: 21px; font-weight: 600; }
.recent-time { font-size: 12px; line-height: 18px; color: #98a1ad; white-space: nowrap; }
.recent-amount { margin-left: auto; color: var(--green); font-size: 14px; line-height: 20px; font-weight: 600; text-align: right; overflow-wrap: anywhere; max-width: 49%; font-variant-numeric: tabular-nums; }
.recent-event.is-out .recent-icon, .recent-event.is-out .recent-amount { color: var(--red); }
.recent-empty { display: grid; place-items: center; min-height: 110px; color: var(--muted); font-size: 14px; }
.recent-all { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 2px auto 0; padding: 3px 9px; border: 0; background: transparent; color: #8b96a2; font-size: 14px; line-height: 22px; }
.recent-all span { font-size: 22px; line-height: 22px; }
.refresh-button, .primary-button { width: 100%; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font-size: 16px; line-height: 24px; font-weight: 600; }
.refresh-button { margin-top: 4px; }
.refresh-button:active, .primary-button:active { background: #1d8e6d; }
.refresh-button.is-loading { background: #7cbaa7; }

.entry-view { padding: 70px 16px 32px; text-align: center; }
.entry-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; background: var(--mint); color: var(--green); font-size: 40px; }
.entry-view h2 { font-size: 20px; line-height: 30px; font-weight: 600; }
.entry-view p { margin-top: 12px; color: #7c8994; font-size: 14px; line-height: 24px; white-space: pre-line; }
.entry-view .primary-button { margin-top: 24px; }
.back-button { display: flex; align-items: center; gap: 6px; padding: 0 0 13px; border: 0; background: transparent; color: var(--green-dark); font-size: 15px; line-height: 28px; }
.back-button span { font-size: 30px; font-weight: 300; }
.page-content { padding: 6px 0 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.75; }
.page-buttons { display: flex; flex-direction: column; gap: 9px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-button { flex: 1 1 0; min-width: 95px; min-height: 46px; border: 1px solid #cce7dd; border-radius: 8px; padding: 10px; background: #f1faf6; color: var(--green-dark); font-size: 15px; line-height: 24px; overflow-wrap: anywhere; }
.action-button:active { background: #e1f4eb; }
.input-form { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.input-form.is-first { margin-top: 0; padding-top: 8px; border-top: 0; }
.input-form:not([hidden]) + .page-buttons { margin-top: 12px; }
.input-form label { font-size: 15px; line-height: 24px; font-weight: 600; }
.input-prompt { margin-top: 5px; color: #7b8894; font-size: 13px; line-height: 22px; white-space: pre-line; }
.input-form input, .input-form textarea { display: block; width: 100%; margin: 10px 0 12px; padding: 12px; border: 1px solid #dce5e1; border-radius: 8px; background: white; color: var(--text); font-size: 16px; line-height: 24px; }
.input-form input { min-width: 0; min-height: 48px; }
.input-form textarea { min-height: 92px; resize: vertical; }
.input-form input::placeholder, .input-form textarea::placeholder { color: #9ba6ac; }
.request-status { margin-top: 16px; padding: 11px 12px; border-radius: 8px; background: #f4f8f6; color: #62736c; font-size: 13px; line-height: 21px; overflow-wrap: anywhere; }
.retry-button { margin-top: 9px; min-height: 40px; border: 1px solid #aacdbf; border-radius: 7px; padding: 7px 13px; color: var(--green-dark); background: white; font-size: 14px; }
@media (min-width: 431px) { .app-shell { padding-top: 35px; } }
@media (max-width: 350px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .app-header h1 { font-size: 22px; }
  .month-stats > div { padding-left: 9px; padding-right: 9px; }
  .month-stats h2 { font-size: 13px; }
  .month-stats p { font-size: 18px; }
  .recent-amount { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
