:root {
  --accent: #1b7f3b; --accent-deep: #0f5a2a; --accent-soft: #e6f3ea; --money: #85bb65;
  --bg: #f5f7fb; --card: #fff; --text: #14181f; --muted: #667085; --line: #e4e7ee;
  --in: #15803d; --out: #dc2626;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --card: #181c25; --text: #eef1f6; --muted: #98a2b3; --line: #262c38; --in: #4ade80; --out: #f87171; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overscroll-behavior-y: contain; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* khung: một cột, gọn cho điện thoại; máy tính thì căn giữa */
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; }
.screen { padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 96px); }

.top {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: calc(10px + var(--safe-t)) 16px 8px; margin: 0 -16px;
}
.space-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; min-height: 56px;
  border-left: 6px solid var(--accent);
}
.space-btn .ic { font-size: 28px; line-height: 1; }
.space-btn .nm { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.space-btn .tg { font-size: 13px; color: var(--muted); }
.space-btn .chev { margin-left: auto; color: var(--muted); }

h2 { font-size: 15px; margin: 20px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 14px; }
.in { color: var(--in); } .out { color: var(--out); }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.big { font-size: clamp(19px, 5.6vw, 26px); font-weight: 800; white-space: nowrap; }

/* chọn kỳ: cuộn ngang bằng ngón tay */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-weight: 600; white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary .net { grid-column: 1 / -1; background: var(--accent); color: #fff; border: 0; }
.summary .net .muted { color: rgba(255,255,255,.85); }

.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.day-head { font-size: 13px; color: var(--muted); font-weight: 700; padding: 14px 4px 6px; }
.tx { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card); border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 14px; text-align: left; min-height: 60px; }
.tx:first-of-type { border-top-left-radius: 14px; border-top-right-radius: 14px; }
.tx:last-of-type { border-bottom: 0; border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.spark > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; height: 100%; min-width: 2px; }
.spark i { display: block; border-radius: 2px 2px 0 0; }
.spark .a { background: var(--in); } .spark .b { background: var(--out); }

/* thanh điều hướng dưới + nút thêm nổi (tầm ngón cái) */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
nav.tabs .in-wrap { display: flex; width: 100%; max-width: 560px; }
nav.tabs button { flex: 1; height: var(--nav-h); background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); }
nav.tabs button .e { font-size: 22px; line-height: 1; }
nav.tabs button.on { color: var(--accent); font-weight: 700; }
.fab {
  position: fixed; z-index: 11; right: max(16px, calc(50% - 280px + 16px)); bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 34px; line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}

/* bảng trượt từ dưới lên */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + var(--safe-b));
}
.sheet h3 { margin: 0 0 12px; font-size: 18px; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 12px; }

label.f { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], select {
  width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  font-size: 16px; /* >=16px để iPhone không tự phóng to */
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.amount-in { font-size: 32px !important; font-weight: 800; text-align: right; min-height: 64px !important; }
.seg { display: flex; background: var(--bg); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: none; font-weight: 700; color: var(--muted); }
.seg button.on.out { background: var(--out); color: #fff; }
.seg button.on.in { background: var(--in); color: #fff; }
.seg button.on.plain { background: var(--accent); color: #fff; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.pick.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.emoji { width: 48px; height: 48px; font-size: 24px; padding: 0; text-align: center; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; }
.swatch.on { border-color: var(--text); }
.btn { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; margin-top: 16px; }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--out); border: 1px solid var(--out); }
.err { color: var(--out); font-size: 14px; margin-top: 8px; min-height: 18px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.auth { padding: calc(28px + var(--safe-t)) 20px 40px; }
.auth h1 { font-size: 28px; margin: 0 0 4px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 90px); transform: translateX(-50%); z-index: 30;
  background: #111; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: 90%; }

/* ---------- trang chủ ---------- */
.lp { background: var(--bg); }
.lp-hero { position: relative; overflow: hidden; color: #fff; padding: calc(16px + var(--safe-t)) 20px 0;
  background: radial-gradient(120% 80% at 80% 0%, #2f9a52 0%, transparent 55%), linear-gradient(165deg, #0f5a2a 0%, #1b7f3b 60%, #2f9a52 100%); }
.lp-hero::before { content: "$"; position: absolute; right: -30px; top: 40px; font: 700 320px/1 Georgia, serif; color: rgba(255,255,255,.07); pointer-events: none; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; position: relative; }
.lp-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; }
.lp-logo i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e6f3ea; color: #0f5a2a; font: 700 20px Georgia, serif; font-style: normal; }
.lp-link { background: rgba(255,255,255,.16); border: 0; color: #fff; border-radius: 999px; padding: 10px 18px; min-height: 42px; font-weight: 700; }
.lp-hero h1 { font-size: clamp(34px, 9.5vw, 48px); line-height: 1.1; margin: 28px 0 12px; letter-spacing: -.5px; position: relative; }
.lp-sub { font-size: 17px; line-height: 1.5; margin: 0 0 20px; color: rgba(255,255,255,.9); max-width: 34em; position: relative; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; position: relative; }
.lp-btn { min-height: 54px; padding: 0 26px; border-radius: 999px; border: 0; background: #fff; color: #0f5a2a; font-weight: 800; font-size: 17px; box-shadow: 0 8px 22px rgba(0,0,0,.22); }
.lp-btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); box-shadow: none; }
.lp-phone { position: relative; width: min(300px, 86%); margin: 30px auto -60px; background: var(--card); color: var(--text); border-radius: 30px 30px 0 0;
  padding: 18px 16px 24px; box-shadow: 0 -10px 40px rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.4); }
.lp-phone small { color: var(--muted); font-size: 12px; display: block; }
.lp-phone-top { display: flex; gap: 10px; align-items: center; border-left: 5px solid var(--accent); padding-left: 10px; } .lp-phone-top span { font-size: 26px; }
.lp-phone-net { margin: 14px 0 10px; background: var(--accent); color: #fff; border-radius: 14px; padding: 12px 14px; } .lp-phone-net small { color: rgba(255,255,255,.85); } .lp-phone-net b { font-size: 22px; }
.lp-phone-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; } .lp-phone-row div { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.lp-phone-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin: 8px 0 10px; } .lp-phone-bars i { flex: 1; background: linear-gradient(var(--money), var(--accent)); border-radius: 4px 4px 0 0; }
.lp-phone-tx { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.lp-sec { padding: 96px 20px 28px; max-width: 760px; margin: 0 auto; } .lp-sec ~ .lp-sec { padding-top: 28px; }
.lp-sec h2 { font-size: 22px; margin: 22px 0 14px; text-transform: none; letter-spacing: 0; color: var(--text); }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.lp-feat { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.lp-feat p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.lp-ic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); border-radius: 14px; }
.lp-feat.soon { border-style: dashed; background: transparent; } .lp-soon { margin-left: 8px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-deep); padding: 2px 8px; border-radius: 999px; }
.lp-sec.alt { max-width: none; background: var(--accent-soft); margin-top: 20px; padding-bottom: 28px; } .lp-sec.alt > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.lp-samples { display: flex; flex-wrap: wrap; gap: 10px; } .lp-sample { padding: 10px 16px; border: 2px solid; border-radius: 999px; font-weight: 700; background: var(--card); }
.lp-steps { display: grid; gap: 12px; } .lp-step { display: flex; gap: 14px; align-items: flex-start; }
.lp-step i { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 800 18px system-ui; font-style: normal; }
.lp-step p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.lp-final { text-align: center; padding: 40px 20px 30px; margin-top: 24px; background: linear-gradient(165deg, #0f5a2a, #1b7f3b); color: #fff; } .lp-final h2 { color: #fff; margin-top: 0; }
.lp-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 20px calc(24px + var(--safe-b)); }
.back { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 6px 0 14px; min-height: 40px; }

.code-in { text-align: center; font: 800 32px/1 ui-monospace, Consolas, monospace; letter-spacing: 10px; min-height: 64px !important; }
.btn:disabled { opacity: .55; cursor: default; }

/* đợt 2: quỹ */
button.list-item.fund { display: block; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; font: inherit; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; }
.check input { width: 22px; height: 22px; }
nav.tabs button { font-size: 11px; }

.alloc { margin: 6px 0 2px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.alloc:empty { display: none; }
.alloc .row { padding: 5px 0; }

/* đợt 3: tiền gửi */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: middle; }
.badge.sim { background: var(--muted); }
.cmp { display: grid; grid-template-columns: 0.8fr 1.3fr 1.4fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cmp:last-child { border-bottom: 0; }
.cmp.head { font-size: 12px; color: var(--muted); }
.cmp .num { text-align: right; }
.summary + .card { margin-top: 10px; }

/* hàng lọc 5 nút vừa khít một dòng trên điện thoại */
.chips.fit { gap: 6px; overflow-x: visible; }
.chips.fit .chip { flex: 1 1 0; min-width: 0; padding: 0 4px; font-size: 13px; }

/* chuyển nội bộ: số tiền xám, không tô thu/chi */
.num.xfer { color: var(--muted); }
.xfer-note { margin: 6px 2px 10px; font-size: 13px; }
