:root {
  --bg: #F7F6F3;
  --card: #FFFFFF;
  --purple: #8B66F2;
  --green: #33B273;
  --orange: #F27340;
  --blue: #4D8CF2;
  --red: #F25959;
  --soft-purple: #EBE7FA;
  --soft-green: #E6F7EB;
  --soft-orange: #FAEDE6;
  --soft-blue: #E6F0FA;
  --soft-yellow: #FAF5E6;
  --soft-pink: #FAEBEB;
  --soft-teal: #E6F5F3;
  --text: #1F1F24;
  --muted: #8C8C94;
  --tertiary: #B3B3B8;
  --radius: 18px;
  --safe-bottom: 88px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: #0a0a0a;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.phone {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,.4);
  overflow-x: hidden;
}

.screen { display: none; padding-bottom: var(--safe-bottom); min-height: 100vh; }
.screen.active { display: block; animation: fadeIn .25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Typography */
.h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.3px; }
.h2 { font-size: 20px; font-weight: 700; }
.section-label {
  font-size: 13px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted);
  padding: 0 4px 8px;
}

/* Nav header */
.nav {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; position: sticky; top: 0;
  background: var(--bg); z-index: 40;
}
.nav-back {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: none; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.nav-title { flex: 1; }
.nav-title h1 { font-size: 20px; font-weight: 700; }
.nav-title p { font-size: 12px; color: var(--muted); }

/* Cards & rows */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.list-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; transition: transform .15s;
}
.list-row:active { transform: scale(.98); }
.list-row .icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 17px;
}
.list-row .body { flex: 1; min-width: 0; }
.list-row .body strong { font-size: 15px; font-weight: 600; display: block; }
.list-row .body span { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.3; }
.list-row .chevron { color: var(--tertiary); font-size: 14px; }

/* Icon soft backgrounds */
.bg-orange { background: var(--soft-orange); color: var(--orange); }
.bg-green { background: var(--soft-green); color: var(--green); }
.bg-blue { background: var(--soft-blue); color: var(--blue); }
.bg-purple { background: var(--soft-purple); color: var(--purple); }
.bg-yellow { background: var(--soft-yellow); color: #e67e22; }
.bg-pink { background: var(--soft-pink); color: var(--red); }
.bg-teal { background: var(--soft-teal); color: var(--green); }
.bg-gray { background: #f0f0f0; color: var(--muted); }

/* Pills & buttons */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
}
.btn {
  width: 100%; padding: 14px; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn-green { background: var(--soft-green); color: var(--green); }
.btn-green-solid { background: var(--green); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-purple { background: var(--soft-purple); color: var(--purple); }
.btn-blue { background: var(--soft-blue); color: var(--blue); }
.btn-red { background: var(--soft-pink); color: var(--red); }

/* Tabs */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 430px; margin: 0 auto;
  background: var(--bg); border-top: 1px solid rgba(0,0,0,.05);
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}
.tab {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; text-decoration: none; color: var(--muted);
  font-size: 10px; font-weight: 500; min-width: 64px;
  padding: 6px 8px; border: none; background: none; cursor: pointer;
}
.tab.active { color: var(--orange); }
.tab svg { width: 22px; height: 22px; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500; background: var(--card);
  border: none; cursor: pointer; color: var(--text);
}
.chip.active { background: var(--orange); color: #fff; }
.chip.active-purple { background: var(--purple); color: #fff; }

/* Grid tiles */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px; }
.tile {
  background: var(--card); border-radius: 16px; padding: 16px 8px;
  text-align: center; cursor: pointer;
}
.tile .icon { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; }
.tile strong { font-size: 14px; display: block; }
.tile span { font-size: 11px; color: var(--muted); }

/* Balance gradient card */
.balance-card {
  background: linear-gradient(135deg, #33B273, #2A9A63);
  color: #fff; border-radius: 20px; padding: 20px; margin: 0 16px 16px;
}
.balance-card .label { font-size: 14px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.balance-card .amount { font-size: 36px; font-weight: 700; margin: 8px 0 16px; }
.balance-card .meta { display: flex; justify-content: space-between; font-size: 13px; }
.balance-card .meta p { opacity: .8; font-size: 12px; }

/* Empty state */
.empty {
  background: var(--card); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; margin: 0 16px;
}
.empty .icon { font-size: 40px; color: var(--tertiary); margin-bottom: 16px; }
.empty h3 { font-size: 18px; margin-bottom: 8px; }
.empty p { font-size: 14px; color: var(--muted); max-width: 260px; margin: 0 auto 16px; }

/* Search */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 12px;
  padding: 12px 14px; margin: 0 16px 16px;
}
.search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--text);
}
.search input::placeholder { color: var(--tertiary); }

/* Marketplace card */
.mkt-card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 0 16px 12px; }
.mkt-card .top { display: flex; gap: 12px; margin-bottom: 12px; }
.mkt-card .price { font-size: 18px; font-weight: 700; color: var(--green); }

/* Toggle */
.toggle {
  width: 44px; height: 26px; border-radius: 13px; background: #d1d1d6;
  position: relative; border: none; cursor: pointer; flex-shrink: 0;
  transition: background .2s;
}
.toggle.on { background: var(--green); }
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s;
}
.toggle.on::after { left: 20px; }

/* Assisted banner */
.assisted {
  display: flex; align-items: center; gap: 8px;
  background: var(--soft-blue); color: var(--blue);
  padding: 12px 16px; border-radius: 14px; margin: 0 16px 16px;
  font-size: 14px; font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }

/* Content padding */
.px { padding-left: 16px; padding-right: 16px; }
.pt { padding-top: 8px; }
.mb { margin-bottom: 16px; }
.space > * + * { margin-top: 10px; }

/* Avatar */
.avatar-wrap { text-align: center; padding: 8px 16px 20px; }
.avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--soft-orange); margin: 0 auto; position: relative;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
}
.avatar .badge {
  position: absolute; bottom: 0; right: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

/* Status bar mock */
.status-bar {
  height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; font-size: 14px; font-weight: 600;
}
.status-bar .island {
  width: 120px; height: 32px; background: #000; border-radius: 20px;
}

/* Plan card */
.plan {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  margin: 0 16px 14px;
}
.plan.current { box-shadow: 0 0 0 2px var(--orange); }
.plan-feat { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 8px 0; }

/* Loading spinner */
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--soft-orange);
  border-top-color: var(--orange); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade { animation: fadeIn .3s ease; }