:root {
  --bg: #11141b;
  --surface: rgba(0, 0, 0, 0.6);
  --green: #00b831;
  --red: #e54d4d;
  --blue: #5b9fed;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.52);
  --nav-inactive: rgba(255, 255, 255, 0.45);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

.app-body {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 0;
  padding-bottom: calc(72px + var(--safe-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 16px;
  flex-shrink: 0;
}

.app-brand {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.balance-pill__add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(0, 184, 49, 0.45);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-placeholder {
  flex: 1;
  min-height: 120px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  z-index: 20;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--nav-inactive);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
}

.bottom-nav__item--active {
  color: var(--text);
}

.bottom-nav__icon {
  width: 24px;
  height: 24px;
}

.muted {
  color: var(--muted);
}

.page-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 16px;
}

.profile-title {
  margin-top: 4px;
}

.content-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 12px;
}

.profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.profile-identity__avatar {
  width: 72px;
  height: 72px;
  color: var(--muted);
  margin-bottom: 12px;
}

.profile-identity__avatar svg {
  width: 100%;
  height: 100%;
}

.profile-identity__name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-identity__meta {
  font-size: 0.88rem;
}

.profile-section__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  justify-content: center;
}

.profile-section__icon {
  width: 22px;
  height: 22px;
  color: var(--muted);
  flex-shrink: 0;
}

.profile-section__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.stat-cell--full {
  grid-column: 1 / -1;
}

.stat-cell__label {
  font-size: 0.82rem;
  color: var(--muted);
}

.stat-cell__value {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-cell__value--pos {
  color: var(--green);
}

.stat-cell__value--neg {
  color: var(--red);
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 16px;
}

.profile-lang-row {
  display: flex;
  gap: 10px;
}

.profile-lang__btn {
  flex: 1;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.profile-lang__btn--active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.profile-footer {
  text-align: center;
  font-size: 0.78rem;
  margin: 0 0 8px;
}

.balance-page {
  margin-top: 8px;
}

.balance-page__hint {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.balance-page__amount {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.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;
}

.balance-screen__title {
  margin-bottom: 8px;
}

.balance-screen__balance {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0 0 18px;
}

.balance-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
}

.balance-tabs__btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  opacity: 0.75;
}

.balance-tabs__btn--active {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.balance-panel {
  display: none;
}

.balance-panel--active {
  display: block;
}

.balance-screen__subtitle {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.pay-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.pay-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 108px;
  padding: 12px 8px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.pay-tile--active {
  background: var(--blue);
  color: #111;
}

.pay-tile__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.pay-tile--active .pay-tile__icon {
  background: rgba(255, 255, 255, 0.35);
}

.pay-tile__img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.pay-tile__fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.balance-input {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 14px;
  margin-bottom: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
}

.balance-input::placeholder {
  color: var(--muted);
}

.btn-pay--dark {
  color: #111;
}

.balance-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.balance-history__item {
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 10px;
  align-items: start;
}

.balance-history__title {
  grid-column: 1;
  grid-row: 1;
  font-size: 0.9rem;
  font-weight: 600;
}

.balance-history__method {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.78rem;
  color: var(--muted);
}

.balance-history__amount {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.balance-history__amount--in {
  color: var(--green);
}

.balance-history__amount--out {
  color: var(--red);
}

.balance-history__time {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  justify-self: end;
  align-self: end;
}

.balance-history-empty {
  text-align: center;
  margin: 16px 0;
  font-size: 0.9rem;
}
