:root {
  --bg: #0a0a0b;
  --surface: #161618;
  --surface-2: #1c1c1f;
  --border: #2c2c30;
  --text: #f5f5f7;
  --text-muted: #8e8e93;
  --blue: #3b7cff;
  --blue-soft: rgba(59, 124, 255, 0.18);
  --green: #34c759;
  --red: #ff3b30;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

#viewport {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  position: relative;
}

#slider {
  display: flex;
  width: 200%;
  height: 100%;
  will-change: transform;
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

#slider[data-page="ops"] {
  transform: translateX(-50%);
}

.page {
  position: relative;
  width: 50%;
  flex: 0 0 50%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(88px + var(--safe-bottom));
}

/* ——— Home ——— */
.home-top {
  padding: calc(10px + var(--safe-top)) 16px 12px;
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 16px;
}

.search-pill svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3a3a40, #252528);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  flex-shrink: 0;
}

.profile-text {
  min-width: 0;
}

.profile-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 600;
}

.profile-name svg {
  opacity: 0.45;
  flex-shrink: 0;
}

.premium-pill {
  display: inline-flex;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c9b8a4;
  background: rgba(201, 184, 164, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
}

.gift-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(160deg, #7b5cff, #5a3def);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.stories {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.stories::-webkit-scrollbar {
  display: none;
}

.story-slot {
  flex: 0 0 72px;
  height: 88px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding: 0 16px;
}

.mini-card {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  position: relative;
  min-height: 118px;
  display: flex;
  flex-direction: column;
}

.mini-card.tap-target {
  cursor: pointer;
}

.mini-card h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.25;
}

.mini-card .big {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mini-card .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.progress-strip {
  margin-top: auto;
  height: 4px;
  border-radius: 2px;
  background: #2a2a2e;
  overflow: hidden;
  display: flex;
}

.progress-strip span {
  flex: 1;
}

.progress-strip span:nth-child(1) {
  background: #2bd9de;
}
.progress-strip span:nth-child(2) {
  background: #3b7cff;
}
.progress-strip span:nth-child(3) {
  background: #a855f7;
}
.progress-strip span:nth-child(4) {
  background: #ff5c9d;
}
.progress-strip span:nth-child(5) {
  background: #ff9f0a;
}

.bonus-logos {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.bonus-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.actions-row::-webkit-scrollbar {
  display: none;
}

.action-tile {
  flex: 1 1 0;
  min-width: 108px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue-soft);
  display: grid;
  place-items: center;
}

.action-tile span {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text);
}

.account-card {
  margin: 18px 16px 0;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  position: relative;
}

.account-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.account-ico--img {
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #b8d4ff 0%, #5a9dff 38%, #2567e8 100%);
}

.account-ico--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.balance-block {
  flex: 1;
  min-width: 0;
}

.balance {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-card .balance {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.account-card .bal-thsep {
  display: inline-block;
  width: 0.38em;
  min-width: 3px;
}

.account-card .bal-dec {
  font-variant-numeric: tabular-nums;
}

.account-card .bal-cur {
  white-space: nowrap;
}

.acct-type {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.crown-tag svg,
.points-tag svg {
  flex-shrink: 0;
}

.card-preview {
  margin-top: 16px;
  margin-left: calc(44px + 12px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-mini {
  width: 120px;
  height: 76px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  background: linear-gradient(135deg, #2a2a30 0%, #121214 100%);
}

.card-mini-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.card-mini--platinum-shot .card-mini-img {
  object-position: center center;
}

.card-mini-overlay {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 1;
}

.card-mini-pan {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  line-height: 1;
  white-space: nowrap;
}

.card-mini-mir {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  line-height: 1;
}

.card-mini--platinum-shot .card-mini-pan {
  color: rgba(28, 28, 32, 0.92);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.card-mini--platinum-shot .card-mini-mir {
  color: rgba(28, 28, 32, 0.88);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.product-stack {
  margin: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
}

.product-card--compact {
  padding-bottom: 16px;
}

.product-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.product-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

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

.product-balance {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.product-promo {
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(145deg, #1e2f4d 0%, #152238 100%);
  color: rgba(230, 238, 255, 0.92);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.product-promo span {
  flex: 1;
}

.product-promo svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.hint-banner {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(59, 124, 255, 0.12);
  color: var(--blue);
  font-size: 13px;
  text-align: center;
}

/* Bottom tab bar (home) */
.tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  position: relative;
}

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

.tab-badge {
  position: absolute;
  top: -2px;
  left: 50%;
  margin-left: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.tab-ico {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}

/* ——— Operations ——— */
.ops-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 12px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.ops-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.ops-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px calc(24px + var(--safe-bottom));
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.chip.primary {
  background: var(--blue);
  color: #fff;
}

.chip.secondary {
  background: var(--surface-2);
  color: var(--text);
}

.ops-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.stat-card .amount {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-card .label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat-card .bar {
  margin-top: 12px;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
}

.stat-card .bar.cyan {
  background: #2bd9de;
}

.stat-card .bar.multi span {
  flex: 1;
}
.stat-card .bar.multi span:nth-child(1) {
  flex: 6;
  background: #2bd9de;
}
.stat-card .bar.multi span:nth-child(2) {
  background: #a855f7;
}
.stat-card .bar.multi span:nth-child(3) {
  background: #ff5c9d;
}
.stat-card .bar.multi span:nth-child(4) {
  background: #ff9f0a;
}

.banner {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.banner.analytics {
  background: var(--surface-2);
}

.banner.analytics .decor {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(145deg, #6b4dff, #9b7dff);
  opacity: 0.9;
  flex-shrink: 0;
}

.banner.installment {
  background: linear-gradient(135deg, #152238, #1a2d4a);
  border: 1px solid rgba(59, 124, 255, 0.25);
}

.banner h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.banner p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.banner.installment h4 {
  color: #7eb6ff;
}

.banner.installment p {
  color: rgba(200, 210, 230, 0.75);
}

.ico-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(59, 124, 255, 0.25);
  color: #9ec5ff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 0 12px;
}

.section-head strong {
  font-size: 16px;
}

.section-head .section-total {
  font-size: 14px;
  color: var(--text-muted);
}

.tx {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.tx:last-child {
  border-bottom: none;
}

.tx-ico-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
  padding: 3px;
  box-sizing: border-box;
  flex-shrink: 0;
  background: var(--surface-2);
}

.tx-ico-letter {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3a3a40;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.tx-mid {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.tx-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tx-cat,
.tx-cat-icons {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.tx-cat-ico {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}

.tx-cat-ico-pending svg {
  display: block;
}

.tx-right {
  text-align: right;
  flex-shrink: 0;
  max-width: 42%;
  padding-top: 2px;
}

.tx-amt-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.tx-amt {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tx-amt.expense {
  color: var(--text);
}

.tx-amt.income {
  color: var(--green);
}

.tx-amt.neutral {
  color: var(--text);
  font-weight: 600;
}

.tx-cashback {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 8px;
  background: #ffdd2d;
  color: #1a1a1a;
  line-height: 1.2;
}

.tx-acct {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.25;
}

.tx-acct-transfer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  text-align: right;
}

.tx-transfer-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  vertical-align: middle;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 420px) {
  #viewport {
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px var(--border);
  }
}
