:root {
  color-scheme: light;
  font-family: "Segoe UI", "SF Pro Display", sans-serif;
  --bg: #f3f3f4;
  --surface: #ffffff;
  --surface-muted: #f2f2f4;
  --surface-soft: #f5f4f8;
  --text: #111111;
  --muted: #7b7b80;
  --green: #1ea332;
  --green-dark: #138b28;
  --purple: #b15cff;
  --border: rgba(17, 17, 17, 0.04);
  --shadow: 0 14px 40px rgba(23, 25, 31, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

.phone-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 24px 112px;
  background: var(--bg);
}

.topbar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: #ececed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-button-avatar {
  background: #e8e8e8;
}

.avatar-shape {
  position: relative;
  width: 24px;
  height: 24px;
}

.avatar-shape::before,
.avatar-shape::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #9a9a9f;
}

.avatar-shape::before {
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.avatar-shape::after {
  bottom: 0;
  width: 24px;
  height: 12px;
  border-radius: 12px 12px 6px 6px;
}

.searchbar {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  background: #ededee;
}

.searchbar input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #4a4a50;
  font-size: 17px;
}

.searchbar__icon {
  width: 16px;
  height: 16px;
  border: 2px solid #b3b3b8;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.searchbar__icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #b3b3b8;
  transform: rotate(45deg);
}

.grid-icon {
  width: 18px;
  height: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.grid-icon span {
  border: 2px solid #1b1b1f;
  border-radius: 3px;
}

.wallet-card,
.section-card {
  background: var(--surface);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.wallet-card {
  padding: 22px;
  margin-bottom: 16px;
  background: linear-gradient(120deg, #dce6ff 0%, #f4dff1 100%);
}

.wallet-card__header,
.section-card__header,
.history-item,
.bottom-nav,
.wallet-card__controls {
  display: flex;
}

.wallet-card__header,
.section-card__header {
  align-items: center;
  justify-content: space-between;
}

.wallet-card__header {
  margin-bottom: 18px;
}

.wallet-card h1,
.section-card h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.05;
}

.wallet-card__subtitle {
  margin-top: 6px;
  color: #75758c;
  font-size: 15px;
}

.wallet-card__controls {
  gap: 10px;
}

.wallet-card__control {
  min-width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: rgba(237, 232, 243, 0.9);
  color: #2f2d38;
  font-size: 20px;
}

.wallet-grid {
  display: grid;
  grid-template-columns: 62px repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wallet-shortcuts {
  display: grid;
  gap: 10px;
}

.shortcut-tile,
.wallet-item {
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.shortcut-tile {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcut-tile__qr,
.shortcut-tile__shield,
.service-tile__icon-plus,
.history-item__icon,
.expense-card__icon,
.bottom-nav__icon,
.service-tile__icon-grid {
  position: relative;
}

.shortcut-tile__qr {
  width: 24px;
  height: 24px;
  border: 3px solid #151515;
  border-radius: 4px;
}

.shortcut-tile__qr::before,
.shortcut-tile__qr::after {
  content: "";
  position: absolute;
  background: #151515;
}

.shortcut-tile__qr::before {
  inset: 5px 8px 5px 8px;
}

.shortcut-tile__qr::after {
  inset: 8px 5px 8px 5px;
}

.shortcut-tile__shield {
  width: 24px;
  height: 28px;
  border: 2px solid #1a1a1a;
  border-radius: 10px 10px 12px 12px;
  clip-path: polygon(50% 0, 100% 18%, 88% 72%, 50% 100%, 12% 72%, 0 18%);
}

.wallet-item {
  min-height: 160px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
}

.wallet-item__badge {
  width: 28px;
  height: 22px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.wallet-item__badge-card {
  background: linear-gradient(135deg, #52d75f 0%, #14a2f5 100%);
}

.wallet-item__badge-bonus {
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.wallet-item__name {
  color: #707078;
  font-size: 14px;
  margin-bottom: auto;
}

.wallet-item__amount {
  margin-top: 28px;
  font-size: 24px;
  font-weight: 700;
}

.wallet-item__meta {
  margin-top: 6px;
  color: #707078;
  font-size: 14px;
}

.section-card {
  padding: 22px 22px 10px;
  margin-bottom: 16px;
}

.section-card__header {
  margin-bottom: 18px;
}

.section-card__header a {
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
}

.history-item {
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
}

.history-item__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f4f4f5;
}

.history-item__icon::before,
.history-item__icon::after {
  content: "";
  position: absolute;
  background: #111;
}

.history-item__icon::before {
  left: 11px;
  top: 15px;
  width: 16px;
  height: 10px;
  border-radius: 2px 2px 6px 6px;
}

.history-item__icon::after {
  left: 14px;
  top: 10px;
  width: 10px;
  height: 7px;
  border: 2px solid #111;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
}

.history-item__body {
  min-width: 0;
  flex: 1;
}

.history-item__title {
  font-size: 17px;
  font-weight: 600;
}

.history-item__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.history-item__amount {
  white-space: nowrap;
  font-size: 17px;
  font-weight: 600;
}

.expense-grid,
.services-grid {
  display: grid;
  gap: 10px;
}

.expense-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.expense-card,
.service-tile {
  min-height: 160px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-muted);
}

.expense-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin-bottom: 18px;
}

.expense-card__icon-clock {
  background: #ececec;
}

.expense-card__icon-clock::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 3px solid #111;
  border-right-color: transparent;
  border-radius: 50%;
}

.expense-card__icon-clock::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 9px;
  width: 3px;
  height: 10px;
  background: #111;
  border-radius: 999px;
}

.expense-card__icon-people {
  background: #d7ee96;
}

.expense-card__icon-people::before,
.expense-card__icon-people::after {
  content: "";
  position: absolute;
  background: #87ba1e;
  border-radius: 50%;
}

.expense-card__icon-people::before {
  width: 9px;
  height: 9px;
  left: 6px;
  top: 8px;
  box-shadow: 12px 0 0 #87ba1e;
}

.expense-card__icon-people::after {
  width: 18px;
  height: 8px;
  left: 8px;
  bottom: 7px;
}

.expense-card__icon-food {
  background: #e4d7ff;
}

.expense-card__icon-food::before,
.expense-card__icon-food::after {
  content: "";
  position: absolute;
  background: #8e73ff;
  border-radius: 999px;
}

.expense-card__icon-food::before {
  width: 3px;
  height: 18px;
  left: 12px;
  top: 8px;
  transform: rotate(30deg);
}

.expense-card__icon-food::after {
  width: 3px;
  height: 18px;
  right: 12px;
  top: 8px;
  transform: rotate(-30deg);
}

.expense-card__icon-store {
  background: #d7f5e9;
}

.expense-card__icon-store::before,
.expense-card__icon-store::after {
  content: "";
  position: absolute;
}

.expense-card__icon-store::before {
  left: 8px;
  top: 12px;
  width: 18px;
  height: 12px;
  border: 3px solid #27b58c;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.expense-card__icon-store::after {
  left: 10px;
  top: 8px;
  width: 14px;
  height: 4px;
  border: 3px solid #27b58c;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.expense-card__sum,
.expense-card__sum-small {
  font-weight: 700;
}

.expense-card__sum {
  font-size: 18px;
  margin-bottom: 6px;
}

.expense-card__sum-small {
  font-size: 16px;
  margin-top: 10px;
}

.expense-card__label {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.expense-card__label-strong {
  color: #5e5e63;
}

.services-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-tile__brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 34px;
}

.service-tile__brand-logo {
  display: block;
  width: auto;
  max-width: 122px;
  height: 24px;
  object-fit: contain;
}

.service-tile__icon-grid {
  width: 22px;
  height: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.service-tile__icon-grid span {
  border: 2px solid #111;
  border-radius: 2px;
}

.service-tile__icon-plus {
  width: 28px;
  height: 28px;
  border: 2px solid #111;
  border-radius: 50%;
}

.service-tile__icon-plus::before,
.service-tile__icon-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #111;
  transform: translate(-50%, -50%);
}

.service-tile__icon-plus::before {
  width: 12px;
  height: 2px;
}

.service-tile__icon-plus::after {
  width: 2px;
  height: 12px;
}

.service-tile__title {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.service-tile__text {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.service-tile-accent {
  background: linear-gradient(180deg, #f4f2f7 0%, #ece8f3 100%);
  box-shadow: inset 0 0 0 1px rgba(177, 92, 255, 0.08);
}

.service-tile-accent .service-tile__title {
  line-height: 1.22;
}

.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.customize-button {
  width: min(100%, 380px);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px auto 0;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: #fff;
  color: #5c5cff;
  font-size: 17px;
  font-weight: 500;
}

.customize-button__gear {
  color: var(--purple);
  font-size: 18px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  transform: translateX(-50%);
  padding: 10px 8px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(17, 17, 17, 0.06);
  backdrop-filter: blur(16px);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #8c8c92;
  font-size: 12px;
}

.bottom-nav__item-active {
  color: var(--green);
  font-weight: 600;
}

.bottom-nav__icon {
  width: 20px;
  height: 20px;
}

.bottom-nav__icon-home {
  background: var(--green);
  clip-path: polygon(50% 0, 100% 36%, 100% 100%, 0 100%, 0 36%);
}

.bottom-nav__icon-home::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background: #fff;
}

.bottom-nav__icon-chart::before,
.bottom-nav__icon-chart::after,
.bottom-nav__icon-pay::before,
.bottom-nav__icon-pay::after,
.bottom-nav__icon-card::before,
.bottom-nav__icon-assistant::before,
.bottom-nav__icon-assistant::after {
  content: "";
  position: absolute;
}

.bottom-nav__icon-chart::before {
  left: 2px;
  bottom: 3px;
  width: 4px;
  height: 8px;
  background: currentColor;
}

.bottom-nav__icon-chart::after {
  left: 8px;
  bottom: 3px;
  width: 4px;
  height: 13px;
  background: currentColor;
  box-shadow: 6px -4px 0 currentColor;
}

.bottom-nav__icon-assistant::before,
.bottom-nav__icon-assistant::after {
  border-radius: 50%;
  border: 2px solid currentColor;
}

.bottom-nav__icon-assistant::before {
  inset: 3px 5px 5px 3px;
  border-right-color: transparent;
}

.bottom-nav__icon-assistant::after {
  inset: 0 2px 8px 8px;
  opacity: 0.8;
}

.bottom-nav__icon-pay::before {
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.bottom-nav__icon-pay::after {
  left: 7px;
  top: 8px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px -4px 0 0 currentColor;
  transform: rotate(0deg);
}

.bottom-nav__icon-card::before {
  inset: 4px 2px 4px 2px;
  border-radius: 4px;
  background: currentColor;
}

.bottom-nav__icon-card::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 12px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
}

@media (max-width: 720px) {
  .wallet-grid {
    grid-template-columns: 62px repeat(3, 1fr);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .wallet-grid::-webkit-scrollbar,
  .expense-grid::-webkit-scrollbar,
  .services-grid::-webkit-scrollbar {
    display: none;
  }

  .wallet-item {
    min-width: 154px;
  }

  .expense-grid,
  .services-grid {
    grid-template-columns: repeat(4, 150px);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .service-tile {
    min-height: 184px;
  }
}

@media (max-width: 560px) {
  .phone-shell {
    padding: 16px 10px 108px;
  }

  .wallet-card,
  .section-card {
    border-radius: 22px;
  }

  .wallet-card,
  .section-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .wallet-card {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .section-card {
    padding-top: 18px;
  }

  .wallet-card h1,
  .section-card h2 {
    font-size: 24px;
  }

  .wallet-card__subtitle,
  .history-item__meta,
  .expense-card__label,
  .service-tile__text {
    font-size: 13px;
  }

  .customize-button {
    min-height: 52px;
  }
}

@media (min-width: 761px) {
  .phone-shell {
    padding-left: 32px;
    padding-right: 32px;
  }

  .bottom-nav {
    padding-left: 32px;
    padding-right: 32px;
  }
}
