:root {
  --teal: #1f5f5b;
  --teal-dark: #16403d;
  --orange: #f0a942;
  --orange-dark: #e0972f;
  --bg: #fdf6ef;
  --card: #ffffff;
  --text: #21403c;
  --muted: #8a8a8a;
  --danger: #d64545;
  --ok: #2e9e6b;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #fdf6ef 0%, #fbeee6 60%, #f6e2ec 100%);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 76px;
  background: transparent;
}

.screen { display: none; padding: 16px; animation: fade .2s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* Header / profile */
.profile-head { display: flex; align-items: center; gap: 12px; padding: 8px 4px 16px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--teal); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:18px; }
.profile-head .name { font-weight: 700; font-size: 17px; }
.profile-head .meta { font-size: 12px; color: var(--muted); }
.credit { color: var(--teal); font-size: 12px; }

/* Wallet card */
.wallet-card {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff; border-radius: var(--radius); padding: 22px; text-align: center;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.wallet-card .label { font-size: 14px; opacity: .85; }
.wallet-card .balance { font-size: 30px; font-weight: 800; margin-top: 4px; letter-spacing: .5px; }
.wallet-card::after { content:""; position:absolute; left:12px; right:12px; bottom:-6px; height:12px;
  background: var(--orange); border-radius: 0 0 12px 12px; opacity:.9; }

/* Action buttons */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.btn { border: none; border-radius: 12px; padding: 15px; font-size: 15px; font-weight: 700;
  cursor: pointer; color: #fff; transition: transform .05s, filter .15s; }
.btn:active { transform: scale(.98); }
.btn-orange { background: var(--orange); }
.btn-orange:hover { filter: brightness(1.03); }
.btn-teal { background: var(--teal); }
.btn-block { width: 100%; }
.btn-ghost { background: #eee; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }

/* Service center grid */
.section-title { font-size: 20px; font-weight: 800; margin: 18px 4px 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border-radius: 12px; padding: 16px; display: flex;
  align-items: center; gap: 12px; box-shadow: var(--shadow); cursor: pointer; }
.tile .ic { width: 38px; height: 38px; border-radius: 10px; display:flex; align-items:center;
  justify-content:center; color:#fff; font-size:18px; flex-shrink:0; }
.tile .tx { font-size: 13px; line-height: 1.25; }
.ic-purple{background:#6c5ce7}.ic-blue{background:#4aa3c7}.ic-orange{background:var(--orange)}
.ic-green{background:#2ecc9b}.ic-red{background:# e74c5e;background:#e74c5e}.ic-violet{background:#9b59b6}

/* Cards / lists */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.list-item { display:flex; gap:12px; padding:12px 0; border-bottom:1px solid #f0f0f0; }
.list-item:last-child { border-bottom:none; }
.list-item .thumb { width:64px; height:64px; border-radius:8px; background:#f2f2f2; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; color:#bbb; font-size:11px; text-align:center; }
.list-item .body { flex:1; font-size:13px; }
.list-item .title { font-weight:600; margin-bottom:4px; }
.price { color: var(--orange-dark); font-weight:700; }
.row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; font-size:14px; }
.row .val { color: var(--orange-dark); font-weight:700; }

/* Forms */
label { display:block; font-size:13px; margin:12px 0 6px; color: var(--text); font-weight:600; }
input, select { width:100%; padding:13px; border:1px solid #e3e3e3; border-radius:10px; font-size:15px;
  background:#f6f7fb; }
input:focus { outline:2px solid var(--orange); background:#fff; }

/* Tabs */
.tabs { display:flex; gap:6px; margin-bottom:12px; }
.tab { flex:1; text-align:center; padding:10px; border-radius:10px; font-size:13px; font-weight:600;
  background:#eee; cursor:pointer; color:var(--muted); }
.tab.active { background: var(--orange); color:#fff; }

/* Bottom nav */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width:100%; max-width:430px;
  background: #fff; display:flex; border-top:1px solid #eee; }
.tabbar a { flex:1; text-align:center; padding:10px 0 8px; font-size:11px; color:var(--muted);
  text-decoration:none; cursor:pointer; }
.tabbar a.active { color: var(--orange); font-weight:700; }
.tabbar .ico { font-size:18px; display:block; }

/* Toast */
.toast { position: fixed; bottom: 90px; left:50%; transform:translateX(-50%); background: #333;
  color:#fff; padding:12px 18px; border-radius:10px; font-size:14px; z-index:50; opacity:0;
  transition:opacity .2s; pointer-events:none; max-width:90%; text-align:center; }
.toast.show { opacity:.95; }

/* Auth screens */
.auth-wrap { max-width:430px; margin:0 auto; padding:40px 24px; }
.auth-wrap h1 { color: var(--teal); text-align:center; }
.link { color: var(--teal); text-decoration:underline; cursor:pointer; font-size:14px; }
.center { text-align:center; }
.badge { display:inline-block; padding:3px 8px; border-radius:6px; font-size:11px; font-weight:700; }
.badge.pending{background:#fdf0d5;color:#b8860b}.badge.confirmed,.badge.paid,.badge.completed{background:#d7f5e5;color:#1a7a4f}
.badge.rejected{background:#fde0e0;color:#b03030}.badge.in_progress{background:#e0ecfd;color:#2b62b0}
.muted { color: var(--muted); font-size:12px; }
.disclosure { background:#eef7f4; border-left:4px solid var(--teal); padding:10px 12px; border-radius:8px;
  font-size:12px; color:#2a5852; margin:12px 0; }

/* Deposit address box */
.deposit-addr { background:#fff7ec; border:1px dashed var(--orange); border-radius:12px; padding:14px; margin:12px 0; }
.deposit-addr .addr-net { font-weight:700; color:var(--teal); }
.addr-row { display:flex; align-items:center; gap:8px; margin-top:4px; }
.addr-val { flex:1; font-family:ui-monospace, "SF Mono", Menlo, monospace; font-size:13px;
  word-break:break-all; background:#fff; padding:8px 10px; border-radius:8px; border:1px solid #f0e0c8; }

/* Product thumbnails */
.list-item .thumb img { width:100%; height:100%; object-fit:cover; border-radius:8px; }

/* Milestone card */
.milestone-card { background:var(--teal); color:#fff; border-radius:12px; padding:14px; margin-bottom:12px; box-shadow:var(--shadow); }
.milestone-card .ms-row { display:flex; justify-content:space-between; font-size:13px; font-weight:600; }
.ms-bar { height:8px; background:rgba(255,255,255,.25); border-radius:6px; margin:8px 0 6px; overflow:hidden; }
.ms-fill { height:100%; background:var(--orange); border-radius:6px; transition:width .4s ease; }
.ms-note { font-size:11px; opacity:.9; }

/* Mini balance strip */
.wallet-mini { display:flex; justify-content:space-between; align-items:center; background:#fff;
  border-radius:10px; padding:10px 14px; margin-bottom:12px; box-shadow:var(--shadow); font-size:14px; }
.wallet-mini b { color:var(--teal); font-size:16px; }

/* Category tabs (horizontal scroll) */
.cat-tabs { display:flex; gap:8px; overflow-x:auto; padding-bottom:8px; margin-bottom:8px; }
.cat-tab { flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 6px;
  border-radius:10px; background:#fff; box-shadow:var(--shadow); cursor:pointer; min-width:64px; }
.cat-tab.active { outline:2px solid var(--orange); }
.cat-tab img { width:36px; height:36px; border-radius:8px; object-fit:cover; }
.cat-tab .cn { font-size:11px; font-weight:600; color:var(--text); }
.cat-tab.all { justify-content:center; }
.cat-tab.all .ci { width:36px; height:36px; border-radius:8px; background:var(--teal); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:16px; }

/* Payout summary box on product cards */
.payout-box { background:#f4faf8; border-radius:10px; padding:8px 12px; margin:8px 0; }
.payout-box .row { padding:4px 0; font-size:13px; }
.row.total { border-top:1px solid #d9e8e3; margin-top:4px; padding-top:6px; font-weight:800; color:var(--teal); }
.row.total span:last-child { color:var(--teal); }

/* Insufficient-balance banner (on product card) */
.insufficient { margin-top:12px; background:#fff3f3; border:1px solid #f3c2c2; border-radius:10px; padding:12px; }
.ins-title { color:var(--danger); font-weight:700; font-size:14px; margin-bottom:8px; }
.ins-rows > div { display:flex; justify-content:space-between; font-size:13px; padding:3px 0; }
.ins-rows .ins-short { border-top:1px dashed #e0b0b0; margin-top:4px; padding-top:6px; }
.ins-rows .ins-short b { color:var(--danger); }
.insufficient .btn { margin-top:10px; }
