body { background: var(--bg); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar.welcome { background: transparent; border: 0; position: absolute; left: 0; right: 0; color: #fff; }
.topbar.welcome .logo { color: #fff; }
.topbar.welcome .logo .mark { background: #fff; color: var(--brand); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 18px; }
.lang { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #F6F3EC; gap: 2px; }
.lang button { border: 0; background: transparent; border-radius: 999px; min-width: 44px; min-height: 34px; font-weight: 700; font-size: 13px; letter-spacing: .04em; cursor: pointer; color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.topbar.welcome .lang { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.topbar.welcome .lang button { color: #fff; }
.topbar.welcome .lang button[aria-pressed="true"] { background: #fff; color: var(--brand); }
.shell { max-width: 520px; margin: 0 auto; padding: 18px 16px 32px; outline: none; }
.shell h1 { font-size: 26px; margin: 4px 0 16px; }
.shell h2 { font-size: 19px; margin: 0 0 12px; }

/* Welcome */
.welcome-hero { margin: -18px -16px 0; padding: calc(84px + env(safe-area-inset-top)) 24px 28px; background: var(--brand); color: #fff; border-radius: 0 0 28px 28px; }
.welcome-hero h1 { font-size: 36px; line-height: 1.05; margin: 0 0 12px; letter-spacing: -0.02em; }
.welcome-hero p { color: #D5E9E1; font-size: 17px; line-height: 1.5; margin: 0; }
.hero-art { display: flex; justify-content: center; gap: -10px; margin: 26px 0 6px; }
.hero-art img { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--brand); margin-left: -12px; background: #fff; }
.hero-art img:first-child { margin-left: 0; }
.features { list-style: none; padding: 0; margin: 22px 0; }
.features li { display: flex; gap: 12px; align-items: center; padding: 10px 0; font-weight: 600; }
.features .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; flex: 0 0 auto; }
.welcome-actions { display: grid; gap: 10px; }
.btn.lg { min-height: 52px; font-size: 17px; border-radius: 14px; }

/* Bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 4px 0; min-height: 52px; justify-content: center; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--brand); }
.tabbar a.scan { color: #fff; }
.tabbar a.scan .fab { width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(11,74,58,.35); border: 4px solid #fff; }
.tabbar a.scan span.lbl { color: var(--muted); }
.tabbar a.scan.on span.lbl { color: var(--brand); }

/* Home */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hello h1 { margin: 0; font-size: 22px; }
.av { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; color: var(--brand); background: var(--brand-soft); overflow: hidden; }
.av img { width: 100%; height: 100%; display: block; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av.sm { width: 36px; height: 36px; font-size: 13px; }
.balance { background: var(--brand); color: #fff; border: 0; }
.balance .amount { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.balance .muted { color: #CFE5DC; }
.balance .btn.primary { background: #fff; color: var(--brand); }
.balance .btn.secondary { color: #fff; border-color: rgba(255,255,255,.5); }
.tagcard { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tagcard img.qr { width: 120px; height: 120px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.qr-big { width: min(280px, 80vw); height: auto; display: block; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); }
.tag-field { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 10px; background: #fff; padding-left: 12px; }
.tag-field input { border: 0; outline: none; }
.tag-field:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.amount-field { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 10px; background: #fff; padding-right: 12px; }
.amount-field input { border: 0; outline: none; font-size: 28px; font-weight: 700; }
.amount-field:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.person { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.person-name { margin: 0; font-size: 20px; font-weight: 700; }
.verified { color: var(--good); font-weight: 600; }
.steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 16px; font-size: 12px; color: var(--muted); }
.steps li { flex: 1; text-align: center; padding-top: 6px; border-top: 3px solid var(--line); }
.steps li.done, .steps li.on { border-color: var(--brand); color: var(--ink); }
.steps li.on { font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li button.linklike { all: unset; cursor: pointer; display: flex; gap: 12px; width: 100%; align-items: center; }
.list li button.linklike:focus-visible { outline: 2px solid var(--brand); }
.list .who { flex: 1; min-width: 0; }
.list .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt-in { color: var(--good); font-weight: 700; } .amt-out { font-weight: 700; }
.video { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 1; object-fit: cover; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--field); background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; min-height: 40px; }
.tabs button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.thread { list-style: none; padding: 0; margin: 0; }
.thread li { padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); }
.thread li.you { background: var(--brand-soft); border-color: #B3DCCB; }

/* Thank-you */
.thanks-bubble { display: flex; gap: 10px; align-items: flex-start; background: #FFF6E2; border: 1px solid #F2D9A0; border-radius: 14px; padding: 12px; }
.thanks-bubble .txt { background: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--field); background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; min-height: 40px; }
.chips button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Avatar picker */
.avgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.avgrid button { border: 3px solid transparent; border-radius: 50%; padding: 0; background: none; cursor: pointer; aspect-ratio: 1; }
.avgrid button img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avgrid button[aria-pressed="true"] { border-color: var(--brand); }

/* Pop-up notifications */
.popups { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); width: min(440px, calc(100vw - 20px)); z-index: 70; display: grid; gap: 8px; }
.popup { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(10, 20, 16, .22); border: 1px solid var(--line); cursor: pointer; animation: drop .28s ease-out; text-align: left; font: inherit; width: 100%; }
.popup .who { flex: 1; min-width: 0; }
.popup .k { font-size: 12px; color: var(--muted); }
.popup strong { display: block; }
.popup .msg { margin-top: 2px; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .popup { animation: none; } }

.devbox { position: fixed; right: 8px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: min(340px, calc(100vw - 16px)); max-height: 40vh; overflow: auto; background: #1C2723; color: #E8F1ED; border-radius: 10px; padding: 6px 10px; font-size: 12px; z-index: 40; }
.devbox summary { cursor: pointer; color: #F2B544; font-weight: 700; }
.devbox p { margin: 6px 0; border-top: 1px solid #33423C; padding-top: 6px; }
.features .ic svg { width: 20px; height: 20px; display: block; }
.toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
.chips button { padding: 7px 12px; font-size: 14px; }
.badge.info { background: #E3E6FB; color: #2E3E8C; margin-left: 6px; }
