/* Mercado Livre–inspired mobile shell (yellow + blue) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ml-yellow: #fff159;
  --ml-yellow-dark: #f5e642;
  --ml-blue: #3483fa;
  --ml-blue-dark: #2968c8;
  --bg: #ebebeb;
  --card: #ffffff;
  --text: rgba(0,0,0,.9);
  --muted: rgba(0,0,0,.55);
  --border: rgba(0,0,0,.1);
  --nav-h: 56px;
  --safe: env(safe-area-inset-bottom, 0px);
}
html { font-size: 16px; touch-action: manipulation; }
body {
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}
a { color: var(--ml-blue); text-decoration: none; }
input, textarea, button { font: inherit; }

.ml-page { padding-bottom: calc(var(--nav-h) + var(--safe) + 12px); min-height: 100vh; }

/* Flash */
.flash {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: #fff;
}
.flash.success { border-color: #00a650; color: #00a650; }
.flash.error { border-color: #f23d4d; color: #c00; }

/* Header home */
.ml-header {
  background: var(--ml-yellow);
  padding: 14px 16px 18px;
  border-bottom: 1px solid var(--border);
}
.ml-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ml-header-kicker { font-size: 13px; color: var(--muted); }
.ml-balance { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ml-plan-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(0,0,0,.08);
  color: rgba(0,0,0,.65);
}
.ml-plan-pill.is-premium { background: var(--ml-blue); color: #fff; }

.ml-main { padding: 16px; }
.ml-hero-mini {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.ml-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: rgba(0,0,0,.8);
}
.ml-grid { display: flex; flex-direction: column; gap: 12px; }
.ml-offer-card {
  display: flex;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  color: inherit;
}
.ml-offer-img-wrap { width: 100px; min-height: 100px; flex-shrink: 0; background: #fafafa; display: flex; align-items: center; justify-content: center; }
.ml-offer-img { width: 100%; height: 100px; object-fit: cover; }
.ml-offer-placeholder { font-size: 36px; }
.ml-offer-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ml-offer-title { font-size: 15px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.ml-offer-cta { font-size: 13px; color: var(--ml-blue); font-weight: 600; }

.ml-empty { text-align: center; padding: 40px 16px; color: var(--muted); font-size: 15px; }

/* Bottom nav */
.ml-bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 4px calc(8px + var(--safe));
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.ml-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
  padding: 4px;
  font-weight: 600;
}
.ml-nav-item.active { color: var(--ml-blue); }
.ml-nav-ic { font-size: 20px; line-height: 1; }

/* Topbar */
.ml-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ml-yellow);
  border-bottom: 1px solid var(--border);
}
.ml-topbar-title { font-weight: 700; font-size: 17px; flex: 1; text-align: center; margin-right: 24px; }
.ml-back { color: rgba(0,0,0,.75); font-size: 15px; font-weight: 600; }

/* Detail / campanha */
.ml-detail-card { background: #fff; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.ml-detail-img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.ml-detail-h1 { font-size: 20px; padding: 16px 16px 8px; font-weight: 600; }
.ml-detail-desc { padding: 0 16px 16px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.ml-earn-box {
  margin: 0 16px 16px;
  padding: 14px;
  background: #f5f5f5;
  border-radius: 8px;
  text-align: center;
}
.ml-earn-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ml-earn-val { font-size: 24px; font-weight: 700; color: #00a650; }
.ml-earn-upgrade { display: block; margin-top: 10px; font-size: 13px; font-weight: 600; }
.ml-link-box { padding: 0 16px 16px; }
.ml-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.ml-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.ml-link-row { display: flex; gap: 8px; align-items: stretch; }
.ml-link-row .ml-input { flex: 1; font-size: 13px; }
.ml-hint { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 8px; }
.ml-share-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 0 16px 20px; }
.ml-share-btn {
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.ml-wa { background: #25d366; }
.ml-tg { background: #229ed9; }
.ml-fb { background: #1877f2; }

.ml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}
.ml-btn-primary { background: var(--ml-blue); color: #fff; }
.ml-btn-primary:active { background: var(--ml-blue-dark); }
.ml-btn-yellow { background: var(--ml-yellow); color: rgba(0,0,0,.85); border: 1px solid var(--border); }
.ml-btn-outline { background: #fff; border: 1px solid var(--border); color: var(--ml-blue); }

/* Auth */
.ml-auth { padding: 24px 20px 40px; max-width: 400px; margin: 0 auto; }
.ml-h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.ml-sub { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.ml-form .ml-label { margin-top: 14px; color: rgba(0,0,0,.65); }
.ml-form .ml-input { margin-top: 4px; }
.ml-auth-footer { margin-top: 20px; text-align: center; font-size: 14px; color: var(--muted); }
.ml-ref-banner {
  background: #e8f3ff;
  border: 1px solid #b8d9ff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

/* Splash */
.ml-splash { min-height: 100vh; padding: 32px 20px 40px; display: flex; flex-direction: column; }
.ml-logo-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.ml-logo-hand { font-size: 44px; }
.ml-brand { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.ml-tagline { font-size: 14px; color: var(--muted); margin-top: 4px; }
.ml-splash-card {
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.ml-lead { font-size: 15px; line-height: 1.55; margin-bottom: 14px; }
.ml-bullets { padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ml-bullets li { margin-bottom: 8px; }
.ml-splash-actions { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }

/* Wallet */
.ml-wallet-card {
  background: linear-gradient(135deg, var(--ml-yellow) 0%, var(--ml-yellow-dark) 100%);
  border-radius: 8px;
  padding: 22px 20px;
  border: 1px solid rgba(0,0,0,.08);
}
.ml-wallet-label { font-size: 13px; opacity: .75; }
.ml-wallet-val { font-size: 28px; font-weight: 700; margin-top: 4px; }

.ml-tx-list { background: #fff; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.ml-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.ml-tx-item:last-child { border-bottom: none; }
.ml-tx-desc { font-size: 14px; font-weight: 500; }
.ml-tx-date { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ml-tx-amt { font-size: 14px; font-weight: 700; white-space: nowrap; }
.ml-tx-amt.pos { color: #00a650; }
.ml-tx-amt.neg { color: #c00; }

/* Profile */
.ml-profile-card {
  background: #fff;
  border-radius: 8px;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--border);
}
.ml-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--ml-blue);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.ml-avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.ml-profile-name { font-size: 18px; font-weight: 600; }
.ml-profile-email { font-size: 14px; color: var(--muted); margin-top: 4px; }
.ml-profile-code { margin-top: 14px; font-size: 14px; }

/* Afiliados */
.ml-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.ml-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.ml-stat-num { font-size: 20px; font-weight: 700; color: var(--ml-blue); }
.ml-stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; margin-top: 4px; }
.ml-info-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.5;
  margin: 16px 0;
}
.ml-level-list { list-style: none; margin-top: 10px; }
.ml-level-list li { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ml-nbadge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(52,131,250,.15);
  color: var(--ml-blue);
  padding: 3px 8px;
  border-radius: 4px;
}
.ml-ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.ml-ref-meta { flex: 1; min-width: 0; }
.ml-ref-name { font-weight: 600; font-size: 14px; }
.ml-ref-sub { font-size: 12px; color: var(--muted); }
.ml-plan-tag { font-size: 11px; padding: 4px 8px; border-radius: 4px; background: #eee; }
.ml-plan-tag.is-pro { background: #e8f3ff; color: var(--ml-blue); font-weight: 700; }

/* Premium / planos */
.ml-premium-hero {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.ml-premium-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ml-blue);
  margin-bottom: 8px;
}
.ml-premium-title { font-size: 22px; font-weight: 700; }
.ml-premium-price { font-size: 32px; font-weight: 800; margin: 12px 0; letter-spacing: -0.02em; }
.ml-premium-price span { font-size: 16px; font-weight: 600; opacity: .7; }
.ml-premium-list { padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.ml-premium-list li { margin-bottom: 8px; }
.ml-card-ok { background: #e6f7ed; border: 1px solid #00a650; color: #004d26; padding: 14px; border-radius: 8px; font-size: 14px; }
.ml-card-warn { background: #fff8e6; border: 1px solid #f5a623; padding: 14px; border-radius: 8px; font-size: 14px; }

/* Admin */
.ml-admin-tile {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 16px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 16px;
  color: inherit;
}
.ml-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}
