:root {
  --bg: #f3f5fb;
  --card: #ffffff;
  --ink: #0f1d4a;
  --soft: #4a5578;
  --muted: #8a93ad;
  --line: #e3e7f2;
  --navy: #1e3a8a;
  --teal: #0d9488;
  --up: #16a34a;
  --down: #e11d48;
  --gold: #fbbf24;
  --shadow: 0 10px 30px rgba(15, 29, 74, 0.08);
  --hd-bg: #ffffff; --hd-text: #0f1d4a; --hd-muted: #8a93ad; --hd-field: #f3f5fb; --hd-accent: #1e3a8a; --hd-accent-ink: #fff; --hd-shadow: rgba(30, 58, 138, 0.3);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-height: 100dvh; color: var(--ink); font: 15px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1160px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 18px 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 12px; }
.brand span { display: grid; line-height: 1.15; }
.brand b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.worth { display: grid; text-align: right; line-height: 1.15; padding: 6px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.worth small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.worth b { font-size: 17px; font-variant-numeric: tabular-nums; }
.account { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 6px; border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--teal)); color: #fff; font-weight: 800; }

.tabs { display: flex; gap: 4px; max-width: 1160px; margin: 6px auto 0; padding: 0 18px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs button { flex: none; padding: 12px 14px; border: 0; background: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--navy); }

main { max-width: 1160px; margin: 0 auto; padding: 18px 18px 40px; }
.panel { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.panel h2 small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.fine { color: var(--muted); font-size: 12.5px; text-align: center; max-width: 70ch; margin: 18px auto 0; }
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 800; background: var(--line); }
.btn.primary { background: linear-gradient(135deg, var(--navy), #2747b0); color: #fff; box-shadow: 0 8px 18px rgba(30, 58, 138, 0.3); }
.btn.sell { background: linear-gradient(135deg, #be123c, var(--down)); box-shadow: 0 8px 18px rgba(225, 29, 72, 0.3); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.field { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 700; font-size: 13.5px; color: var(--soft); }
.field input { font: inherit; font-size: 16px; font-weight: 700; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); outline: none; }
.field input:focus { border-color: var(--navy); background: #fff; }
.up { color: var(--up); } .down { color: var(--down); }
:is(.btn, .tabs button, .account, .assets li, .filters button, .tf button, .side button, .pct button, .quick > *):focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bcard { position: relative; aspect-ratio: 1.586; max-width: 460px; border-radius: 22px; padding: 22px 24px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, rgba(45, 212, 191, 0.55), transparent 55%), radial-gradient(90% 80% at 0% 100%, rgba(251, 191, 36, 0.28), transparent 60%), linear-gradient(135deg, #0f1d4a, #1e3a8a 55%, #0d9488);
  box-shadow: 0 20px 40px rgba(15, 29, 74, 0.35); display: grid; grid-template-rows: auto auto 1fr auto; }
.bcard::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 14px); pointer-events: none; }
.bcard-top { display: flex; justify-content: space-between; align-items: center; }
.bcard-top b { font-size: 20px; letter-spacing: 0.12em; }
.bcard-top span { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; padding: 3px 8px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 6px; }
.chip { width: 46px; height: 34px; margin-top: 18px; border-radius: 7px; background: linear-gradient(135deg, #fde68a, #d4a017); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); position: relative; }
.chip::before { content: ""; position: absolute; inset: 7px 10px; border: 1.5px solid rgba(120, 80, 0, 0.45); border-radius: 4px; }
.bcard-no { align-self: center; font: 600 clamp(18px, 3vw, 23px)/1 "Courier New", ui-monospace, monospace; letter-spacing: 0.12em; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); }
.bcard-bottom { display: flex; justify-content: space-between; gap: 12px; }
.bcard-bottom small { display: block; font-size: 10.5px; opacity: 0.75; letter-spacing: 0.08em; text-transform: uppercase; }
.bcard-bottom b { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.balances { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.balances div { background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.balances small { color: var(--muted); font-weight: 700; font-size: 12px; }
.balances b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.balances span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.quick > * { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 0; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; text-decoration: none; }
.quick i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e8edfb; color: var(--navy); font-style: normal; font-weight: 900; font-size: 18px; }
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mover { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg); cursor: pointer; }
.mover b { font-size: 14px; }
.mover small { display: block; color: var(--muted); font-size: 11.5px; }
.mover .pctag { font-weight: 800; }
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.news li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--bg); font-size: 13.5px; }
.news time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.news .pctag { font-weight: 800; font-size: 12.5px; }
.sym-badge { display: inline-grid; place-items: center; min-width: 46px; padding: 3px 8px; border-radius: 8px; font: 800 12px/1.2 ui-monospace, Consolas, monospace; color: #fff; background: var(--navy); }
.sym-badge.coin { background: linear-gradient(135deg, #b45309, var(--gold)); color: #231400; }

/* ---------- market ---------- */
.mkt { display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.list-panel { padding: 12px; }
.filters { display: flex; gap: 6px; margin: 2px 4px 10px; }
.filters button, .tf button { padding: 7px 12px; border: 0; border-radius: 10px; background: var(--bg); font-weight: 700; font-size: 13px; color: var(--soft); }
.filters button[aria-pressed="true"], .tf button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.assets { list-style: none; margin: 0; padding: 0; }
.assets li { display: grid; grid-template-columns: auto minmax(0, 1fr) 70px auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; cursor: pointer; }
.assets li:hover { background: var(--bg); }
.assets li.on { background: #e8edfb; }
.assets .nm b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assets .nm small { color: var(--muted); font-size: 11.5px; }
.assets svg { width: 70px; height: 28px; }
.assets .px { text-align: right; font-variant-numeric: tabular-nums; }
.assets .px b { display: block; font-size: 14px; }
.assets .px small { font-weight: 800; font-size: 12px; }
.flash-up { animation: fu 0.8s ease; } .flash-down { animation: fd 0.8s ease; }
@keyframes fu { 30% { background: rgba(22, 163, 74, 0.15); } } @keyframes fd { 30% { background: rgba(225, 29, 72, 0.15); } }
.d-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.d-head > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.d-head b { font-size: 18px; }
.d-head small { color: var(--muted); font-weight: 600; }
.d-price { text-align: right; }
.d-price b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.d-price span { font-weight: 800; }
.tf { display: flex; gap: 6px; margin-bottom: 8px; }
.chart { height: 340px; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.trade { margin-top: 14px; display: grid; gap: 4px; }
.side { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--bg); margin-bottom: 10px; }
.side button { border: 0; border-radius: 10px; padding: 9px; font-weight: 800; background: none; color: var(--soft); }
.side button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(15, 29, 74, 0.1); }
.side button[data-side="sell"][aria-pressed="true"] { color: var(--down); }
.pct { display: flex; gap: 6px; margin: -4px 0 8px; }
.pct button { flex: 1; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; font-size: 13px; }
.t-est { margin: 0 0 10px; color: var(--soft); font-size: 13.5px; min-height: 20px; }

/* ---------- portfolio ---------- */
.port-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.port-sum div { padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.port-sum small { color: var(--muted); font-weight: 700; font-size: 12px; }
.port-sum b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table.port { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.port th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.port td { text-align: right; padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.port th:first-child, .port td:first-child { text-align: left; }
.port tr { cursor: pointer; }
.port tbody tr:hover { background: var(--bg); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; }

/* ---------- send, save, tx ---------- */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.save-card { background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff; }
.save-card small { opacity: 0.8; font-weight: 700; }
.save-bal { display: block; font-size: clamp(32px, 5vw, 44px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.save-card p { margin: 6px 0 0; } .save-card .hint { color: rgba(255, 255, 255, 0.75); }
.txs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.txs li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.txs .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: var(--bg); color: var(--navy); }
.txs .ic.in { background: #dcfce7; color: var(--up); } .txs .ic.out { background: #ffe4e6; color: var(--down); }
.txs b { display: block; font-size: 14px; }
.txs small { color: var(--muted); font-size: 12px; }
.txs .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg); font-weight: 700; }
.board li.me { background: #e8edfb; }
.board .rk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-weight: 900; }
.board li:nth-child(1) .rk { background: var(--gold); }
.board .w { font-variant-numeric: tabular-nums; }

.welcome { max-width: 560px; margin: 50px auto; padding: 30px 24px; text-align: center; background: var(--card); border-radius: 26px; box-shadow: var(--shadow); }
.welcome img { border-radius: 18px; }
.welcome h1 { margin: 14px 0 8px; font-size: clamp(24px, 4vw, 30px); letter-spacing: -0.02em; }
.welcome p { color: var(--soft); }
.welcome small { display: block; margin-top: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 70; transform: translate(-50%, 150%); visibility: hidden; padding: 11px 18px; background: var(--ink); color: #fff; border-radius: 14px; font-weight: 700; transition: transform 0.25s, visibility 0.25s; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.err { background: var(--down); }

@media (max-width: 900px) {
  .home, .mkt, .two { grid-template-columns: 1fr; }
  .bcard { max-width: none; }
}
@media (max-width: 560px) {
  .top { padding-bottom: 4px; }
  .brand small, #account-name { display: none; }
  .account { padding: 0 6px; }
  .balances { grid-template-columns: 1fr 1fr; }
  .balances div:last-child { grid-column: 1 / -1; }
  .quick { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .quick > * { font-size: 11.5px; padding: 10px 2px; }
  .movers { grid-template-columns: 1fr; }
  .chart { height: 280px; }
  .port-sum { grid-template-columns: 1fr 1fr; }
  .news li { grid-template-columns: minmax(0, 1fr) auto; }
  .news time { display: none; }
}
.balances .up { color: var(--up); } .balances .down { color: var(--down); }

/* ---------- round 2: notifications, watchlist, orders, terms, loans ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.bell svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell i { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--down); color: #fff; font: 800 11px/20px system-ui, sans-serif; font-style: normal; }
.notes { position: absolute; right: 0; top: 52px; z-index: 40; width: min(340px, 90vw); max-height: 420px; overflow-y: auto; background: var(--card); border-radius: 18px; box-shadow: 0 20px 50px rgba(15, 29, 74, 0.2); padding: 12px; }
.notes ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.notes li { padding: 8px 10px; border-radius: 12px; background: var(--bg); font-size: 13.5px; }
.notes li.new { background: #e8edfb; font-weight: 700; }
.notes small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.star { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 0 2px; }
.star.on { color: var(--gold); }
.sym-badge.starred { box-shadow: 0 0 0 2px var(--gold); }
.otype { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 0 10px; }
.otype button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 700; font-size: 13px; color: var(--soft); }
.otype button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.orders { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.orders li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--bg); }
.orders b { display: block; font-size: 13.5px; }
.orders small { color: var(--muted); font-size: 12px; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.terms-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.terms-pick button { display: grid; gap: 2px; padding: 10px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.terms-pick button[aria-pressed="true"] { border-color: var(--teal); background: #ecfdf5; }
.terms-pick small { color: var(--teal); font-weight: 800; }
.terms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.terms li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.terms b { display: block; font-size: 14px; }
.terms small { color: var(--muted); font-size: 12px; }
.terms .bar { height: 6px; margin-top: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.terms .bar i { display: block; height: 100%; background: var(--teal); }
.loan-card { background: linear-gradient(135deg, #7c2d12, #c2410c); color: #fff; }
.loan-card small { opacity: 0.8; font-weight: 700; }
.loan-card .loan-owed { display: block; font-size: clamp(30px, 5vw, 42px); font-weight: 800; font-variant-numeric: tabular-nums; }
.loan-card p { margin: 6px 0 0; opacity: 0.92; }
.loan-card .down { color: #fecaca; font-weight: 800; }
@media (max-width: 560px) { .bell { width: 40px; height: 40px; } .worth { padding: 4px 10px; } .worth b { font-size: 15px; } }
@media (max-width: 560px) { .notes { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; } }

/* ======================================================= bank-app layout (round 3) */
body { padding-bottom: env(safe-area-inset-bottom); }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; padding: 22px 14px; background: #0f1d4a; color: #fff; display: flex; flex-direction: column; gap: 22px; z-index: 30; }
.sidebar .brand { padding: 0 8px; }
.sidebar .brand small { color: #9fb0e0; }
.side-nav { display: grid; gap: 4px; }
.side-nav > * { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 12px; background: none; color: #c9d4f5; font-weight: 700; font-size: 14.5px; text-decoration: none; text-align: left; }
.side-nav > *:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.side-nav > .on { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 3px 0 0 #fbbf24; }
.side-note { margin-top: auto; padding: 0 10px; color: #8796c4; font-size: 12px; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page { margin-left: 240px; min-height: 100dvh; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(243, 245, 251, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bar-left { display: flex; align-items: center; gap: 14px; }
.bar-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.hello { display: none; line-height: 1.2; }
.hello small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.hello b { font-size: 17px; }
.bar-right { display: flex; align-items: center; gap: 10px; }
main { max-width: 1100px; padding: 6px 28px 40px; margin: 0; }
.welcome { margin: 40px 28px; }
body.out .side-nav, body.out .bottom { display: none !important; }

/* home */
.home2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.acct { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 22px; color: #fff; box-shadow: 0 18px 40px rgba(15, 29, 74, 0.3);
  background: radial-gradient(110% 120% at 100% 0%, rgba(45, 212, 191, 0.5), transparent 55%), linear-gradient(135deg, #0f1d4a, #1e3a8a 60%, #1d4ed8); }
.acct::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, 0.06); pointer-events: none; }
.acct-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; color: #c9d4f5; }
.eye, .copy { border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.eye .i, .copy .i { width: 18px; height: 18px; }
.copy { width: 28px; height: 28px; background: none; }
.acct-no { display: flex; align-items: center; gap: 4px; margin-top: 6px; font: 600 15px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.08em; color: #e3e9fb; }
.acct-bal { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 12px; }
.acct-bal b { font-size: clamp(32px, 5vw, 42px); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.acct-bal span { font-weight: 700; color: #c9d4f5; }
.acct-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.15); font-size: 13px; color: #c9d4f5; }
.acct-foot b { color: #fff; font-variant-numeric: tabular-nums; }
#card-name { text-transform: uppercase; }
body.hide-bal .secret { filter: blur(8px); user-select: none; }
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; padding: 14px 8px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.services > * { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border: 0; background: none; border-radius: 14px; font-weight: 700; font-size: 12.5px; color: var(--ink); text-decoration: none; text-align: center; }
.services > *:hover { background: var(--bg); }
.services i { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: #e8edfb; color: var(--navy); }
.services > *:nth-child(2) i { background: #dcfce7; color: #15803d; }
.services > *:nth-child(3) i { background: #fef3c7; color: #b45309; }
.services > *:nth-child(4) i { background: #ffedd5; color: #c2410c; }
.services > *:nth-child(6) i { background: #f3e8ff; color: #7e22ce; }
.services > *:nth-child(7) i { background: #fce7f3; color: #be185d; }
.services > *:nth-child(8) i { background: #e0f2fe; color: #0369a1; }
.balances { margin-top: 0; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.link { border: 0; background: none; color: var(--navy); font-weight: 700; font-size: 13.5px; }
.bottom, .more { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .page { margin-left: 0; padding-bottom: 84px; }
  .bar { padding: 12px 16px; }
  body[data-page="home"] .hello { display: block; }
  body[data-page="home"] .bar-title { display: none; }
  .bar-title { font-size: 19px; }
  #account-name { display: none; }
  .account { padding: 0 6px; }
  main { padding: 4px 16px 24px; }
  .home2 { grid-template-columns: 1fr; }
  .bottom { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 6px 6px max(8px, env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 24px rgba(15, 29, 74, 0.1); border-radius: 20px 20px 0 0; }
  .bottom button { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700; }
  .bottom button.on { color: var(--navy); }
  .bottom .center .i { width: 26px; height: 26px; padding: 13px; box-sizing: content-box; margin-top: -26px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), #2563eb); color: #fff; box-shadow: 0 8px 18px rgba(30, 58, 138, 0.4); border: 4px solid #fff; }
  .bottom .center { color: var(--navy); }
  .more:not([hidden]) { display: flex; position: fixed; inset: 0; z-index: 40; background: rgba(15, 29, 74, 0.35); align-items: flex-end; }
  .more-sheet { width: 100%; padding: 16px 16px max(20px, env(safe-area-inset-bottom)); background: #fff; border-radius: 24px 24px 0 0; animation: up 0.25s ease; }
  .more-sheet .services { box-shadow: none; padding: 8px 0 0; margin: 8px 0 0; grid-template-columns: repeat(3, 1fr); }
  @keyframes up { from { transform: translateY(100%); } }
  .toast { bottom: 92px; }
  .welcome { margin: 30px 16px; }
}

/* ---------- transfer receipt ---------- */
.rcpt-wrap:not([hidden]) { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(15, 29, 74, 0.45); overflow-y: auto; }
.rcpt { width: min(420px, 100%); animation: rcIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes rcIn { from { transform: translateY(30px) scale(0.96); opacity: 0; } }
.rcpt-paper { background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 70px rgba(15, 29, 74, 0.35); position: relative; }
.rcpt-paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 12px; background: radial-gradient(circle at 8px 12px, var(--bg) 6px, transparent 7px) 0 0 / 16px 12px repeat-x; }
.rcpt-head { display: grid; justify-items: center; gap: 4px; padding: 26px 20px 22px; color: #fff; text-align: center; background: linear-gradient(135deg, #0f1d4a, #1d4ed8); }
.rcpt-ok { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #22c55e; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.25); margin-bottom: 8px; animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 0.15s both; }
@keyframes pop { from { transform: scale(0); } }
.rcpt-ok svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rcpt-head b { color: #c9d4f5; font-size: 15px; }
.rcpt-amt { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rcpt-head small { color: #c9d4f5; font-weight: 600; }
.rcpt-rows { margin: 0; padding: 8px 22px 26px; }
.rcpt-rows div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1.5px dashed var(--line); }
.rcpt-rows dt { color: var(--muted); font-weight: 600; font-size: 13.5px; flex: none; }
.rcpt-rows dd { margin: 0; text-align: right; font-weight: 800; font-size: 14.5px; word-break: break-word; }
.rcpt-rows dd small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.rcpt-rows .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.rcpt-foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 0 22px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.rcpt-foot img { border-radius: 6px; }
.rcpt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.rcpt-actions .btn { background: #fff; }
.rcpt-actions .btn.primary { grid-column: 1 / -1; background: linear-gradient(135deg, var(--navy), #2747b0); }
.rcpt-actions #rc-share:not([hidden]) ~ .btn.primary { grid-column: 1 / -1; }
.txs li.has-rc { cursor: pointer; border-radius: 12px; }
.txs li.has-rc:hover { background: var(--bg); }

/* ---------- round 4: transfer flow, PIN pad, QR, settings, statement ---------- */
.panel-head .link .i, .btn .i { width: 17px; height: 17px; vertical-align: -3px; margin-right: 4px; }
.recents { margin-bottom: 12px; }
.recents small { display: block; color: var(--muted); font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }
.recents div { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.recents button { flex: none; display: grid; justify-items: center; gap: 4px; width: 68px; border: 0; background: none; padding: 4px 0; font-size: 12px; font-weight: 700; color: var(--soft); }
.recents button i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--navy), var(--teal)); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.recents button.on i { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--teal); }
.recents button span { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; padding: 10px 12px; border-radius: 14px; font-size: 13.5px; font-weight: 700; }
.who.wait { background: var(--bg); color: var(--muted); }
.who.bad { background: #ffe4e6; color: var(--down); }
.who.ok { background: #dcfce7; color: #14532d; }
.who i { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #fff; background: var(--up); }
.who span { display: grid; line-height: 1.25; }
.who small { font-weight: 600; opacity: 0.75; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.quick button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--soft); }
.quick button.on, .quick button:hover { border-color: var(--navy); color: var(--navy); background: #eef2ff; }
.hint.warn { color: var(--down); font-weight: 700; }
.lock-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 16px; border-radius: 16px; background: #fff7ed; color: #9a3412; font-weight: 700; font-size: 13.5px; border: 1px solid #fed7aa; }

.sheet-wrap:not([hidden]) { position: fixed; inset: 0; z-index: 70; display: grid; place-items: end center; background: rgba(15, 29, 74, 0.45); animation: fadeIn 0.2s; }
@media (min-width: 700px) { .sheet-wrap:not([hidden]) { place-items: center; } }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { width: min(420px, 100%); max-height: 100dvh; overflow-y: auto; background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 20px max(20px, env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(15, 29, 74, 0.2); animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@media (min-width: 700px) { .sheet { border-radius: 26px; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { margin: 0 0 6px; text-align: center; font-size: 17px; font-weight: 800; }
.cf-amt { text-align: center; font-size: 30px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; margin: 4px 0 12px; }
.info { margin: 0 0 16px; display: grid; }
.info > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.info dt { color: var(--muted); font-weight: 600; flex: none; }
.info dd { margin: 0; text-align: right; font-weight: 700; display: grid; overflow-wrap: anywhere; }
.info dd small { color: var(--muted); font-weight: 600; font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.pin-sheet { text-align: center; }
.pin-lock { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 18px; display: grid; place-items: center; background: #eef2ff; }
.pin-lock svg { width: 26px; height: 26px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pin-sub { margin: 0; color: var(--muted); font-size: 13.5px; min-height: 20px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 6px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--navy); transition: background 0.12s, transform 0.12s; }
.pin-dots i.on { background: var(--navy); transform: scale(1.1); }
.pin-dots.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-err { margin: 0 0 8px; min-height: 20px; color: var(--down); font-weight: 700; font-size: 13px; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-keys button { height: 58px; border: 0; border-radius: 16px; background: var(--bg); font-size: 24px; font-weight: 700; color: var(--ink); transition: background 0.1s, transform 0.1s; -webkit-tap-highlight-color: transparent; }
.pin-keys button:active { background: var(--line); transform: scale(0.96); }
.pin-keys button.fn { background: none; font-size: 15px; color: var(--soft); }
#pinpad.busy .pin-dots i { animation: pulse 0.8s infinite alternate; }
@keyframes pulse { to { opacity: 0.3; } }

.qr-sheet { text-align: center; display: grid; justify-items: center; gap: 4px; }
.qr-box { position: relative; width: min(260px, 72vw); margin: 10px 0; padding: 12px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(15, 29, 74, 0.1); }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-logo { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 12px; background: #fff; padding: 3px; }
.qr-sheet > b { font-size: 16px; }
.qr-sheet > small { color: var(--muted); font-weight: 600; }
.qr-sheet .sheet-actions { width: 100%; margin-top: 12px; }

.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row span { display: grid; }
.set-row small { color: var(--muted); font-size: 12.5px; }
.switch { flex: none; width: 50px; height: 30px; border: 0; border-radius: 999px; background: var(--line); position: relative; transition: background 0.2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch[aria-checked="true"] { background: var(--teal); }
.switch[aria-checked="true"] i { transform: translateX(20px); }

.tx-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.tx-tools input, .tx-tools select { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); outline: none; min-width: 0; }
.tx-tools input:focus, .tx-tools select:focus { border-color: var(--navy); }
.tx-kinds { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.tx-kinds button { flex: none; border: 0; border-radius: 999px; padding: 6px 13px; background: var(--bg); font-size: 13px; font-weight: 700; color: var(--soft); }
.tx-kinds button.on { background: var(--navy); color: #fff; }
.tx-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.tx-sum div { padding: 10px 12px; border-radius: 14px; background: var(--bg); display: grid; }
.tx-sum small { color: var(--muted); font-size: 12px; font-weight: 700; }
.tx-sum b { font-variant-numeric: tabular-nums; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.tx-sum .up { color: var(--up); } .tx-sum .down { color: var(--down); }
@media (max-width: 560px) { .tx-sum { grid-template-columns: 1fr 1fr; } }
.set-row .btn { white-space: nowrap; }
.txs li.empty { display: block; text-align: center; color: var(--muted); padding: 14px 6px; }
