:root {
  color-scheme: light;
  --purple-950: #1f145f;
  --purple-800: #3a2386;
  --purple-600: #7552d6;
  --purple-200: #dfd4f8;
  --ivory: #fffaf0;
  --cream: #f8ead6;
  --gold: #f4aa1c;
  --green: #159438;
  --green-soft: #edf8e9;
  --red: #c92b2b;
  --red-soft: #fff0eb;
  --ink: #17195c;
  --muted: #70738d;
  --shadow: 0 18px 44px rgb(53 25 82 / 16%), 0 3px 10px rgb(80 47 29 / 10%);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #1f1266; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #26166f;
  font-family: "Nunito", system-ui, sans-serif;
}

button { font: inherit; }

.bank-lobby {
  position: relative;
  container-type: inline-size;
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 24%, rgb(255 255 255 / 55%) 0 2px, transparent 3px),
    linear-gradient(112deg, transparent 0 48%, rgb(173 125 82 / 7%) 49%, transparent 50%),
    linear-gradient(#2d1978 0 170px, #fefaf3 170px 100%);
  box-shadow: 0 0 80px rgb(0 0 0 / 35%);
}

.bank-lobby::before {
  content: none;
}

.bank-lobby::after {
  content: none;
}

.masthead {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  min-height: 0;
  margin: calc(-1 * max(22px, env(safe-area-inset-top))) 0 0;
  padding-top: 0;
  text-align: center;
}

.header-lockup {
  display: block;
  width: 100%;
  height: auto;
}

.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;
}

.ledger-shell {
  position: relative;
  z-index: 2;
  min-height: 560px;
  margin: -3px clamp(22px, 13.5cqw, 96px) 0;
  padding: 30px 28px max(40px, env(safe-area-inset-bottom));
  border: 1px solid rgb(189 146 90 / 26%);
  border-radius: 31px;
  background: #fffaf0;
  box-shadow: var(--shadow), inset 0 1px 0 white;
}

#account-view[hidden] { display: none; }

.balance-section { text-align: center; }

.eyebrow {
  margin: 0 0 5px;
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  font-weight: 700;
}

.eyebrow span { color: var(--gold); margin: 0 8px; }

.balance-amount {
  margin: 0 0 25px;
  color: var(--green);
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(3.3rem, 14vw, 6.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.045em;
  text-shadow: 0 3px 0 rgb(0 0 0 / 5%);
}

.amount-positive { color: var(--green) !important; }
.amount-negative { color: var(--red) !important; }
.amount-neutral { color: #55566f !important; }

.summary-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  min-height: 105px;
  margin: 0 0 16px;
  padding: 12px 22px 12px 12px;
  border: 1px solid #d7e9d1;
  border-radius: 24px;
  background: linear-gradient(110deg, #eff9eb, #f7fbf2);
}

.summary-card h2 {
  margin: 0;
  font-size: clamp(.92rem, 3.4vw, 1.13rem);
  line-height: 1.2;
}

.summary-card h2 span { white-space: nowrap; }

.summary-value {
  margin: 2px 0 0;
  color: var(--green);
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(1.8rem, 7vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
}

.summary-icon {
  display: grid;
  place-items: center;
  position: relative;
  width: 64px;
  height: 64px;
  border: 8px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  background: #daf3d5;
  font-size: 28px;
}

.sprout-icon small {
  position: absolute;
  right: 9px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid #ce8100;
  border-radius: 50%;
  color: #9c5e00;
  background: #ffc52e;
  font: 800 14px "Nunito", sans-serif;
}

.trend-card[data-state="negative"] { border-color: #f3c5ba; background: var(--red-soft); }
.trend-card[data-state="negative"] .trend-icon { color: var(--red); background: #ffe0d8; }
.trend-card[data-state="neutral"] .trend-icon { color: #66716d; }
.trend-icon { color: var(--green); font: 800 2rem "Baloo 2", sans-serif; }

.transactions-card {
  overflow: hidden;
  border: 1px solid #cdbbe9;
  border-radius: 24px;
  background: white;
  box-shadow: 0 3px 8px rgb(68 42 108 / 6%);
}

.transactions-card h2 { margin: 0; }

.transactions-toggle {
  display: grid;
  grid-template-columns: 40px 1fr 22px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 9px 18px;
  border: 0;
  color: var(--ink);
  background: linear-gradient(105deg, #f4edff, #fbf7ff);
  text-align: left;
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(1.02rem, 4vw, 1.35rem);
  font-weight: 700;
  cursor: pointer;
}

.transactions-toggle:focus-visible, .retry-button:focus-visible { outline: 4px solid #ffbf36; outline-offset: -4px; }

.receipt-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #9a77ed, #6745c8);
}

.chevron {
  width: 16px;
  height: 16px;
  border-right: 4px solid #7653ce;
  border-bottom: 4px solid #7653ce;
  transform: rotate(45deg) translateY(-4px);
  transition: transform .2s ease;
}

.transactions-toggle[aria-expanded="false"] .chevron { transform: rotate(-45deg); }

.transactions-list { margin: 0; padding: 0 18px; list-style: none; }
.transactions-list[hidden] { display: none; }

.transaction {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-top: 1px solid #ece9ef;
}

.transaction:first-child { border-top: 0; }

.transaction-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ddf3d9;
  font-size: 21px;
}

.transaction:nth-child(even) .transaction-icon { background: #e3d7fb; }

.transaction-details { min-width: 0; }
.transaction-description { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.transaction-date { margin: 1px 0 0; color: var(--muted); font-size: .79rem; }
.transaction-amount { margin: 0; font-weight: 900; white-space: nowrap; }
.empty-transactions { padding: 25px; color: var(--muted); text-align: center; }

.mascot {
  position: absolute;
  z-index: 5;
  top: 34cqw;
  right: 15px;
  width: 34.2cqw;
  height: auto;
  pointer-events: none;
}

.status-state {
  display: grid;
  place-items: center;
  min-height: 500px;
  padding: 30px;
  text-align: center;
}

.status-state[hidden] { display: none; }
.status-state h2 { margin: 12px 0 0; font: 800 1.7rem "Baloo 2", sans-serif; }
.status-state p { margin: 5px 0; color: var(--muted); font-weight: 700; }
.status-icon { font-size: 3rem; }

.coin-loader {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 6px solid #e1960c;
  border-radius: 50%;
  color: #865300;
  background: #ffc83e;
  box-shadow: 0 0 0 6px #ffdfa0;
  font-size: 1.75rem;
  font-weight: 900;
  animation: coin-breathe 1.15s ease-in-out infinite alternate;
}

.retry-button {
  min-height: 48px;
  margin-top: 18px;
  padding: 0 22px;
  border: 0;
  border-radius: 99px;
  color: white;
  background: var(--purple-600);
  box-shadow: 0 4px 0 var(--purple-800);
  font-weight: 900;
  cursor: pointer;
}

.column {
  position: absolute;
  z-index: 4;
  top: 40.35cqw;
  bottom: 0;
  display: flex;
  width: 17.52cqw;
  flex-direction: column;
  pointer-events: none;
}

.column--left { left: 0; }
.column--right { right: 0; transform: scaleX(-1); }

.column-base {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  margin-top: -18px;
  flex: 0 0 auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18px);
  mask-image: linear-gradient(to bottom, transparent, #000 18px);
}

.column-shaft {
  display: block;
  width: 100%;
  min-height: 180px;
  margin: 0;
  flex: 1 1 auto;
  background-repeat: repeat-y;
  background-position: top center;
  background-size: 100% auto;
}

.column--left .column-shaft { background-image: url("assets/column-left-shaft.png"); }
.column--right .column-shaft { background-image: url("assets/column-left-shaft.png"); }

@keyframes coin-breathe { to { transform: translateY(-7px) rotate(6deg); } }

@media (max-width: 520px) {
  .bank-lobby { background: linear-gradient(#2d1978 0 160px, #fefaf3 160px 100%); }
  .bank-lobby::before { left: 1%; width: 98%; }
  .masthead { margin: calc(-1 * max(22px, env(safe-area-inset-top))) 0 0; }
  .ledger-shell { margin-top: -3px; padding: 25px 15px max(32px, env(safe-area-inset-bottom)); border-radius: 25px; }
  .balance-amount { font-size: clamp(3.25rem, 17vw, 5.2rem); }
  .summary-card { grid-template-columns: 63px 1fr; min-height: 92px; padding: 10px; border-radius: 20px; }
  .summary-icon { width: 54px; height: 54px; border-width: 6px; font-size: 24px; }
  .transactions-toggle { padding-inline: 12px; }
  .transactions-list { padding-inline: 12px; }
  .transaction { grid-template-columns: 39px minmax(0, 1fr) auto; gap: 8px; }
  .transaction-icon { width: 36px; height: 36px; font-size: 18px; }
  .transaction-description { font-size: .86rem; }
  .transaction-amount { font-size: .86rem; }
}

@media (max-width: 370px) {
  .ledger-shell { margin-inline: 35px; }
  .eyebrow span { margin-inline: 3px; }
  .summary-card h2 { font-size: .83rem; }
  .transaction-date { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
