:root {
  --blue: #0075be;
  --blue-deep: #005a92;
  --blue-dark: #003d66;
  --blue-banner: #004f82;
  --text: #1a1a1a;
  --muted: #6b7280;
  --line: #e6e9ee;
  --bg: #f2f4f7;
  --white: #ffffff;
  --danger: #c62828;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --font: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: #0b1f33;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font-family: inherit;
}

.app {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(0, 117, 190, 0.35), transparent 60%),
    linear-gradient(180deg, #0b1f33 0%, #12283f 100%);
}

.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.page {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  -webkit-overflow-scrolling: touch;
}

.header {
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--white);
  padding: 14px 16px 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
}

.brand {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.5px;
  line-height: 1;
}

.header-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--white);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.12);
}

.greeting {
  margin: 18px 0 14px;
  font-size: 22px;
  font-weight: 600;
}

.insight {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-banner);
  margin: 0 -16px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 0;
  width: calc(100% + 32px);
  color: var(--white);
  cursor: pointer;
  text-align: left;
}

.insight .chev {
  margin-left: auto;
}

.section {
  background: var(--white);
  margin-top: 10px;
  padding: 14px 16px 8px;
}

.section + .section {
  margin-top: 8px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.account-row,
.tx-row,
.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 14px 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.account-row {
  border-bottom: 1px solid var(--line);
}

.account-meta {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: 16px;
  font-weight: 600;
}

.account-mask {
  color: var(--muted);
  font-weight: 500;
}

.account-balance {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.total-line {
  display: flex;
  justify-content: flex-end;
  padding: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 12px 0 10px;
  cursor: pointer;
}

.cta-link svg {
  width: 16px;
  height: 16px;
}

.chev {
  color: var(--blue);
  flex-shrink: 0;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 20;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #7a8494;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 4px 6px;
}

.nav-item.active {
  color: var(--blue);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

/* Account detail */
.acct-hero {
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--white);
  padding: 8px 16px 18px;
}

.back-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.back-btn {
  border: 0;
  background: transparent;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 500;
  padding: 6px 0;
  cursor: pointer;
}

.acct-card {
  background: var(--white);
  color: var(--text);
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.acct-card h1 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
}

.balance-grid {
  display: grid;
  gap: 10px;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.balance-row .label {
  color: var(--muted);
}

.balance-row .value {
  font-weight: 600;
}

.manage-btn {
  margin-top: 16px;
  width: 100%;
  border: 1.5px solid var(--blue);
  background: var(--white);
  color: var(--blue);
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px 12px 8px;
  background: var(--white);
}

.qa {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.qa-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid #dce3ec;
  box-shadow: 0 2px 8px rgba(16, 40, 70, 0.06);
  display: grid;
  place-items: center;
  color: var(--blue);
}

.qa span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
  color: var(--blue-dark);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.tab {
  border: 0;
  background: transparent;
  padding: 14px 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
}

.tx-toolbar {
  background: var(--white);
  padding: 0 16px;
}

.link-row {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}

.filter-bar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 0 12px;
}

.filter-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
}

.badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 11px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.date-group {
  margin-top: 0;
}

.date-label {
  background: #eceff3;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 16px;
}

.tx-row {
  background: var(--white);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.tx-main {
  flex: 1;
  min-width: 0;
}

.tx-desc {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.tx-merchant {
  margin-top: 2px;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-money {
  text-align: right;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 15px;
  font-weight: 700;
}

.tx-amount.credit {
  color: #0f7a3f;
}

.tx-bal {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* Detail page */
.detail-header {
  background: var(--blue);
  color: var(--white);
  padding: 8px 16px 16px;
}

.detail-header h1 {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 700;
}

.detail-body {
  padding: 12px 0 24px;
}

.detail-card {
  background: var(--white);
  margin: 0 0 10px;
  padding: 8px 16px 12px;
}

.detail-amount {
  text-align: center;
  padding: 20px 12px 8px;
}

.detail-amount .big {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.detail-amount .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv .k {
  color: var(--muted);
  flex-shrink: 0;
}

.kv .v {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px);
  transform: translateX(-50%) translateY(12px);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.placeholder {
  background: var(--white);
  margin-top: 10px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.placeholder h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
}

@media (min-width: 860px) {
  .phone {
    margin: 24px 0;
    min-height: calc(100dvh - 48px);
    border-radius: 28px;
    overflow: hidden;
  }
}
