/* ==========================================================================
   BitPay Wallet — mobile-first PWA stylesheet
   Design tokens borrowed from the /template folder (Davur dashboard:
   primary #2f4cdd, Poppins/Roboto type, 18px card radius) and merged with
   the BitPay logo blue (#1a3b8b).
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --brand: #1a3b8b;
  --brand-2: #2f4cdd;
  --brand-3: #4d6bf0;
  --brand-soft: #eaefff;

  --ink: #0e1729;
  --ink-2: #33415c;
  --muted: #7c8aa5;
  --muted-2: #9aa7be;

  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e8ecf5;
  --line-2: #f1f4fa;

  --up: #16c784;
  --up-soft: #e6f9f1;
  --down: #ea3943;
  --down-soft: #fdecec;

  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --frame-w: 430px;

  --shadow-sm: 0 2px 8px -2px rgba(16, 30, 66, .08);
  --shadow-md: 0 12px 30px -18px rgba(16, 30, 66, .45);
  --shadow-lg: 0 26px 60px -26px rgba(16, 30, 66, .55);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }
::selection { background: var(--brand-soft); }

/* app frame -------------------------------------------------------------- */
.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--frame-w);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.app-main {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px calc(20px + var(--safe-b));
  scroll-behavior: smooth;
}
.app-main.no-scroll { overflow: hidden; }

/* top bar ---------------------------------------------------------------- */
.app-bar {
  flex: 0 0 auto;
  padding: calc(var(--safe-t) + 10px) 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 247, 251, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
  z-index: 20;
}
.app-bar.scrolled { border-bottom-color: var(--line); background: rgba(250, 251, 253, .95); }

.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.brand img { height: 22px; width: auto; display: block; }
.brand-fallback { font-weight: 800; letter-spacing: -.4px; color: var(--brand); font-size: 19px; }

.app-bar-title { font-size: 15px; font-weight: 600; letter-spacing: -.2px; margin-right: auto; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn:hover { background: rgba(14, 30, 70, .06); }
.icon-btn svg { width: 20px; height: 20px; }

.bar-actions { display: flex; align-items: center; gap: 4px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2f4cdd, #1a3b8b);
  color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .3px;
  border: 0; cursor: pointer;
}

.live-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: #0f7a4e;
  background: var(--up-soft); border-radius: 999px;
  padding: 4px 9px 4px 8px;
}
.live-pill i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 0 rgba(22, 199, 132, .7);
  animation: pulse 1.9s infinite;
}
.live-pill.off { color: #8a6d1f; background: #fdf4dd; }
.live-pill.off i { background: #e8a807; animation: none; box-shadow: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 199, 132, .65); }
  70% { box-shadow: 0 0 0 7px rgba(22, 199, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0); }
}

/* generic card ----------------------------------------------------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 236, 245, .8);
  padding: 16px;
  margin-top: 14px;
}
.card.tight { padding: 8px 6px; }
.card.flush { padding: 0; overflow: hidden; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 10px;
}
.section-head h2 { font-size: 15.5px; font-weight: 600; letter-spacing: -.2px; }
.section-head a, .section-head button {
  font-size: 12.5px; font-weight: 600; color: var(--brand-2);
  background: 0; border: 0; cursor: pointer; padding: 4px;
}
.section-head .count { font-size: 12px; color: var(--muted); font-weight: 500; }

/* hero / portfolio balance ---------------------------------------------- */
.hero {
  position: relative;
  margin-top: 6px;
  border-radius: 26px;
  padding: 18px 18px 16px;
  color: #fff;
  background:
    radial-gradient(120% 130% at 92% -12%, rgba(93, 126, 255, .85) 0%, rgba(93, 126, 255, 0) 52%),
    radial-gradient(90% 100% at -10% 110%, rgba(47, 76, 221, .75) 0%, rgba(47, 76, 221, 0) 60%),
    linear-gradient(142deg, #0a1c46 0%, #16337c 44%, #2f4cdd 100%);
  box-shadow: 0 22px 44px -24px rgba(16, 40, 110, .85);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .35;
  pointer-events: none;
  mask-image: radial-gradient(80% 60% at 80% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 60% at 80% 0%, #000 0%, transparent 75%);
}
.hero > * { position: relative; z-index: 1; }

.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-label { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .74); letter-spacing: .2px; }
.hero-eye { background: rgba(255, 255, 255, .12); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.hero-eye svg { width: 16px; height: 16px; }

.hero-balance {
  display: flex; align-items: flex-start; gap: 2px;
  margin-top: 6px;
  font-size: 38px; font-weight: 700; letter-spacing: -1.4px; line-height: 1.08;
  font-variant-numeric: tabular-nums;
  transition: filter .2s ease;
}
.hero-balance .cur { font-size: 22px; font-weight: 500; margin-top: 6px; color: rgba(255, 255, 255, .72); }
.hero-balance .frac { font-size: 22px; color: rgba(255, 255, 255, .72); font-weight: 600; }
.hero-balance.hidden { filter: blur(9px); user-select: none; }

.hero-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; }
.hero-sub .chg { color: #8ff3c9; }
.hero-sub .chg.down { color: #ffb4b8; }
.hero-sub .hero-period { color: rgba(255, 255, 255, .6); font-size: 11.5px; }

.hero-meta { display: flex; gap: 10px; margin-top: 14px; }
.hero-meta > div {
  flex: 1;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: 8px 10px;
}
.hero-meta .k { display: block; font-size: 10.5px; color: rgba(255, 255, 255, .66); letter-spacing: .3px; text-transform: uppercase; }
.hero-meta .v { display: block; font-size: 13.5px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }

/* quick actions --------------------------------------------------------- */
.quick {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 16px;
}
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 2px 0;
  color: #fff;
}
.quick .q-ico {
  width: 44px; height: 44px; border-radius: 15px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .16s ease, background .16s ease;
}
.quick a:active .q-ico { transform: scale(.92); background: rgba(255, 255, 255, .24); }
.quick .q-ico svg { width: 19px; height: 19px; }
.quick .q-lbl { font-size: 10.5px; font-weight: 500; color: rgba(255, 255, 255, .9); letter-spacing: .1px; }

/* chart card ------------------------------------------------------------ */
.chart-card { padding: 14px 12px 10px; }
.chiprow {
  display: flex; gap: 7px; overflow-x: auto; padding: 2px 4px 6px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: var(--line-2);
  color: #46536d;
  font-size: 12.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  cursor: pointer;
  transition: all .16s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:active { transform: scale(.96); }
.chip.on { background: #0f2050; color: #fff; box-shadow: 0 8px 16px -10px rgba(15, 32, 80, .9); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

.chart-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 4px 6px 0; }
.chart-price { font-size: 24px; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.chart-price small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.chart-change { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.chart-host { min-height: 190px; margin-top: 2px; }
.chart-host .apexcharts-tooltip { box-shadow: var(--shadow-md) !important; border-color: var(--line) !important; border-radius: 12px !important; }
.apexcharts-tooltip-title { background: #f7f9fd !important; border-bottom-color: var(--line) !important; font-family: inherit !important; }

.range-row { display: flex; gap: 6px; padding: 6px 6px 2px; }
.range-row button {
  flex: 1;
  border: 0; background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 7px 0; border-radius: 10px; cursor: pointer;
  transition: all .16s ease;
}
.range-row button.on { background: var(--brand-soft); color: var(--brand-2); }
.range-row button:hover { color: var(--brand-2); }

/* allocation bar -------------------------------------------------------- */
.alloc-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; gap: 2px; margin-top: 4px; }
.alloc-bar span { display: block; height: 100%; border-radius: 2px; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.alloc-legend div { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.alloc-legend i { width: 8px; height: 8px; border-radius: 3px; display: block; }
.alloc-legend b { font-weight: 600; color: var(--ink); }
.alloc-legend span { color: var(--muted); }

/* asset list rows ------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px;
  border-radius: 16px;
  transition: background .16s ease;
  cursor: pointer;
}
.row:active { background: var(--line-2); }
.row + .row { border-top: 1px solid var(--line-2); border-radius: 0 0 0 0; }
.row-main { flex: 1 1 auto; min-width: 0; }
.row-title { font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; display: flex; align-items: center; gap: 6px; }
.row-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; display: flex; align-items: center; gap: 5px; }
.row-end { text-align: right; flex: 0 0 auto; }
.row-val { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-amt { font-size: 11.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.row-spark { width: 62px; height: 28px; flex: 0 0 auto; }

.coin {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 16px; font-weight: 700; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 14px -8px rgba(16, 30, 66, .5);
  letter-spacing: -.2px;
}
.coin.sm { width: 32px; height: 32px; font-size: 13px; }
.coin.lg { width: 58px; height: 58px; font-size: 23px; }

.pill {
  font-size: 11px; font-weight: 700; letter-spacing: .1px;
  padding: 3px 7px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.pill.up { color: var(--up); background: var(--up-soft); }
.pill.down { color: var(--down); background: var(--down-soft); }

.empty {
  text-align: center; padding: 26px 16px; color: var(--muted);
}
.empty .ico { width: 46px; height: 46px; border-radius: 16px; background: var(--line-2); display: grid; place-items: center; margin: 0 auto 10px; color: var(--muted-2); }
.empty p { font-size: 12.5px; }
.empty a { color: var(--brand-2); font-weight: 600; }

/* transactions ---------------------------------------------------------- */
.tx-ico {
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 12px; display: grid; place-items: center;
}
.tx-ico svg { width: 17px; height: 17px; }
.tx-ico.buy { background: var(--up-soft); color: #0e9f6e; }
.tx-ico.receive { background: #e8f2ff; color: #1f74d1; }
.tx-ico.sell { background: var(--down-soft); color: #d92d20; }
.tx-ico.send { background: #fef0e6; color: #dd6b20; }
.tx-ico.swap { background: #eee9ff; color: #6941c6; }

.tx-amt { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tx-amt.up { color: #0e9f6e; }
.tx-amt.down { color: var(--ink); }
.tx-usd { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.date-head {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .3px; text-transform: uppercase;
  padding: 14px 6px 6px;
}

/* toolbar / filters ----------------------------------------------------- */
.search {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}
.search svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.search input {
  border: 0; outline: 0; background: transparent; flex: 1;
  font: 400 13.5px/1.4 inherit; color: var(--ink); min-width: 0;
}
.search input::placeholder { color: var(--muted-2); }

.tabs { display: flex; gap: 4px; background: #eef1f8; border-radius: 14px; padding: 4px; margin-top: 12px; }
.tabs button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: #5b6a86;
  padding: 8px 4px; border-radius: 11px; transition: all .16s ease;
}
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* forms ----------------------------------------------------------------- */
.field { display: block; margin-top: 10px; }
.field > label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; margin: 0 0 6px 2px; }
.input {
  display: flex; align-items: center; gap: 8px;
  background: #f2f5fb; border: 1.5px solid transparent;
  border-radius: 16px; padding: 12px 14px;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.input:focus-within { background: #fff; border-color: #b9c6f2; box-shadow: 0 0 0 4px rgba(47, 76, 221, .08); }
.input input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font: 500 14px/1.4 inherit; color: var(--ink); min-width: 0;
}
.input .prefix { font-size: 15px; font-weight: 600; color: var(--muted); }
.input .suffix { font-size: 12.5px; font-weight: 600; color: var(--muted); flex: 0 0 auto; }
.input.big { padding: 14px 16px; }
.input.big input { font-size: 26px; font-weight: 700; letter-spacing: -1px; }
.input.big .prefix { font-size: 22px; }
.input input::placeholder { color: var(--muted-2); font-weight: 500; }
.input.invalid { border-color: #f3b1b4; background: #fff7f7; }

.amount-row { display: flex; gap: 8px; align-items: stretch; }
.presets { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.presets button {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  padding: 7px 12px; border-radius: 12px; cursor: pointer; transition: all .16s ease;
}
.presets button.on, .presets button:active { border-color: var(--brand-2); color: var(--brand-2); background: var(--brand-soft); }

.picker {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--line); background: #fff;
  border-radius: 16px; padding: 10px 12px; cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.picker:hover { border-color: #c8d2f0; }
.picker .grow { flex: 1; text-align: left; min-width: 0; }
.picker .pk-name { font-size: 13.5px; font-weight: 600; }
.picker .pk-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.picker svg.chev { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }

.summary { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 2px; color: var(--muted); }
.summary div b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary div.total { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.summary div.total b { font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border: 0; border-radius: 16px;
  font-size: 14.5px; font-weight: 600; letter-spacing: .1px;
  cursor: pointer; transition: transform .14s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:active { transform: scale(.985); }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #3155e0, #16337c);
  box-shadow: 0 14px 26px -14px rgba(31, 62, 168, .95);
}
.btn-ghost { background: #eef2fb; color: #22345c; }
.btn-danger { background: var(--down-soft); color: #c3272f; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; box-shadow: none; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }

.hint { font-size: 11.5px; color: var(--muted); margin-top: 10px; display: flex; gap: 6px; align-items: flex-start; }
.hint svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }

.note {
  display: flex; gap: 9px; align-items: flex-start;
  background: #f3f7ff; border: 1px solid #dde7ff;
  border-radius: 14px; padding: 11px 12px;
  font-size: 12px; color: #3a4c74; margin-top: 12px;
}
.note svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--brand-2); }

.note.warn {
  background: #fff8e8;
  border-color: #f6dfa4;
  color: #7a5a12;
  font-weight: 500;
}
.note.warn svg { color: #cf8a0a; }

/* receive card on the asset page */
#receiveCard .section-head h2 span { color: var(--muted); font-weight: 500; }
#receiveCard .qr-wrap { margin-top: 2px; }

/* asset detail ---------------------------------------------------------- */
.asset-head { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.asset-head .sym { font-size: 12px; color: var(--muted); font-weight: 500; }
.asset-price { font-size: 30px; font-weight: 700; letter-spacing: -1.1px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.asset-price small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat-grid > div { background: #f7f9fd; border-radius: 14px; padding: 10px 12px; }
.stat-grid .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.stat-grid .v { font-size: 13px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

.balance-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #f4f7ff, #eef3ff);
  border: 1px solid #e3eaff; border-radius: 16px;
  padding: 12px 14px; margin-top: 12px;
}
.balance-strip .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.balance-strip .v { font-size: 17px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }

/* receive / address ----------------------------------------------------- */
.qr-wrap {
  display: grid; place-items: center;
  padding: 12px; margin-top: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
}
.qr-wrap img, .qr-wrap canvas {
  width: 200px; height: 200px; display: block; border-radius: 10px;
  object-fit: contain; background: #fff;
}
.qr-ph {
  width: 190px; height: 190px; border-radius: 12px;
  display: grid; place-items: center; text-align: center;
  background: repeating-linear-gradient(45deg, #f4f6fb, #f4f6fb 8px, #eef1f8 8px, #eef1f8 16px);
  color: var(--muted); font-size: 11.5px; padding: 16px;
}
.addr-box {
  display: flex; align-items: center; gap: 8px;
  background: #f4f6fc; border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 12px; margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--ink-2); word-break: break-all;
}
.addr-box button { border: 0; background: var(--brand-soft); color: var(--brand-2); border-radius: 9px; padding: 6px; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.addr-box button svg { width: 15px; height: 15px; }

/* drawer ---------------------------------------------------------------- */
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: min(84vw, 322px);
  background: #fff;
  z-index: 60;
  transform: translateX(-102%);
  transition: transform .3s cubic-bezier(.22, .8, .3, 1);
  overflow-y: auto;
  padding-bottom: calc(18px + var(--safe-b));
  box-shadow: 24px 0 60px -30px rgba(9, 17, 38, .5);
}
.drawer.open { transform: none; }

.scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(9, 17, 38, .44);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .26s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer-head {
  padding: calc(18px + var(--safe-t)) 18px 18px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(93, 126, 255, .7) 0%, rgba(93, 126, 255, 0) 55%),
    linear-gradient(150deg, #0a1c46, #1a3b8b 60%, #2f4cdd);
  border-radius: 0 0 26px 0;
}
.drawer-profile { display: flex; align-items: center; gap: 11px; }
.drawer-profile .avatar { width: 42px; height: 42px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .22); font-size: 14px; }
.drawer-profile .who { min-width: 0; }
.drawer-profile .who b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.drawer-profile .who span { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .68); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drawer-balance { margin-top: 14px; }
.drawer-balance .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: rgba(255, 255, 255, .62); }
.drawer-balance .v { font-size: 22px; font-weight: 700; letter-spacing: -.7px; font-variant-numeric: tabular-nums; margin-top: 1px; }

.drawer-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; color: #fff; background: rgba(255, 255, 255, .14); }
.drawer-close:hover { background: rgba(255, 255, 255, .26); }

.dnav { padding: 10px 10px 4px; }
.dnav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted-2); padding: 12px 10px 6px;
}
.dnav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px; border-radius: 13px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: background .16s ease, color .16s ease;
}
.dnav a:active, .dnav a:hover { background: var(--line-2); }
.dnav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.dnav a svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--brand-2); }
.dnav a.on svg { color: var(--brand); }
.dnav a .meta { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
.dnav a .pill-tag {
  margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  color: #0e9f6e; background: var(--up-soft); border-radius: 999px; padding: 2px 7px;
}
.drawer-foot { padding: 16px 20px; font-size: 11px; color: var(--muted-2); line-height: 1.6; }

/* tab bar --------------------------------------------------------------- */
.tabbar {
  flex: 0 0 auto;
  display: flex; align-items: stretch; justify-content: space-around;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + var(--safe-b));
  z-index: 30;
}
.tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px 4px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 10px; font-weight: 600; letter-spacing: .1px;
  transition: color .16s ease;
  position: relative;
}
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.on { color: var(--brand-2); }
.tabbar a.on::before {
  content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand-2);
}
.tabbar a:active { transform: translateY(1px); }

/* bottom sheet ---------------------------------------------------------- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(9, 17, 38, .44);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .26s ease;
}
.sheet-scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: var(--frame-w); margin: 0 auto;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(18px + var(--safe-b));
  z-index: 70;
  transform: translateY(112%);
  transition: transform .32s cubic-bezier(.22, .9, .3, 1);
  max-height: 88dvh; overflow-y: auto;
  box-shadow: 0 -20px 50px -24px rgba(9, 17, 38, .45);
}
.sheet.open { transform: none; }
.sheet-grip { width: 42px; height: 4px; border-radius: 999px; background: #e3e8f2; margin: 8px auto 14px; }
.sheet h3 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.sheet .sheet-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kv { margin-top: 12px; }
.kv div { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 2px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.kv div:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); flex: 0 0 auto; }
.kv .v { text-align: right; font-weight: 600; color: var(--ink); word-break: break-word; font-variant-numeric: tabular-nums; }
.kv .v.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; font-weight: 500; }
.status-pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--up-soft); color: #0e9f6e; display: inline-block; }
.status-pill.pending { background: #fdf4dd; color: #a9781a; }

/* sheet picker list */
.pick-list { margin-top: 8px; }
.pick-list button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 10px 8px; border-radius: 14px; cursor: pointer;
}
.pick-list button:hover { background: var(--line-2); }
.pick-list .grow { flex: 1; min-width: 0; }
.pick-list .nm { font-size: 13.5px; font-weight: 600; }
.pick-list .sb { font-size: 11.5px; color: var(--muted); }
.pick-list .rt { text-align: right; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pick-list .bal { font-size: 11px; color: var(--muted); font-weight: 500; }

/* toasts ---------------------------------------------------------------- */
.toast-stack {
  position: fixed; left: 0; right: 0; bottom: calc(78px + var(--safe-b));
  max-width: var(--frame-w); margin: 0 auto;
  padding: 0 16px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #0d1e46; color: #fff;
  padding: 12px 14px; border-radius: 15px;
  font-size: 12.8px; font-weight: 500;
  box-shadow: 0 16px 34px -16px rgba(6, 16, 44, .8);
  animation: toastIn .28s cubic-bezier(.2, .9, .3, 1);
}
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; color: #7ff0bd; }
.toast.err svg { color: #ff9ba3; }
.toast.out { animation: toastOut .22s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }

/* skeleton ------------------------------------------------------------- */
.sk {
  background: linear-gradient(90deg, #eef1f7 25%, #f7f9fc 37%, #eef1f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 10px;
  color: transparent !important;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.offline-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 95;
  max-width: var(--frame-w); margin: 0 auto;
  background: #7a4b00; color: #ffefd6;
  font-size: 11.5px; font-weight: 600; text-align: center;
  padding: calc(4px + var(--safe-t)) 12px 4px;
  transform: translateY(-110%); transition: transform .3s ease;
}
.offline-bar.show { transform: none; }

/* asset detail mini actions -------------------------------------------- */
.mini-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-top: 14px;
}
.mini-actions a {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 2px 7px;
  border-radius: 14px;
  background: #f4f7fd;
  font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  transition: background .16s ease, transform .16s ease;
}
.mini-actions a:active { transform: scale(.96); background: var(--brand-soft); }
.mini-actions .q-ico {
  width: 30px; height: 30px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: #fff;
  color: var(--brand-2);
  box-shadow: var(--shadow-sm);
}
.mini-actions .q-ico svg { width: 16px; height: 16px; }

/* desktop presentation -------------------------------------------------- */
@media (min-width: 760px) {
  body {
    background:
      radial-gradient(1100px 620px at 50% -8%, #1b3a83 0%, #0b1530 58%, #070d1c 100%);
    padding: 16px 0;
    align-items: center;
  }
  .app-shell {
    height: calc(100dvh - 32px);
    min-height: 620px;
    border-radius: 34px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .06);
  }
  .app-bar { border-radius: 34px 34px 0 0; }
  .tabbar { border-radius: 0 0 34px 34px; }
  .drawer {
    top: 16px; bottom: 16px;
    left: max(0px, calc(50% - (var(--frame-w) / 2)));
    border-radius: 0 24px 24px 0;
  }
  .sheet { bottom: 16px; border-radius: 26px; }
  .toast-stack { bottom: calc(94px + var(--safe-b)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* small phones ---------------------------------------------------------- */
@media (max-width: 360px) {
  .hero-balance { font-size: 32px; }
  .quick .q-ico { width: 40px; height: 40px; }
  .app-main { padding-left: 12px; padding-right: 12px; }
}

/* dark mode ------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1220;
    --card: #141d31;
    --ink: #f2f5fb;
    --ink-2: #c6cfdf;
    --muted: #8c9ab4;
    --muted-2: #6d7c96;
    --line: #222f47;
    --line-2: #1a2437;
    --brand-soft: #1d2a4d;
    --up-soft: #10312a;
    --down-soft: #3a1b1e;
  }
  body { background: var(--bg); }
  .app-bar { background: rgba(12, 18, 32, .86); }
  .app-bar.scrolled { background: rgba(15, 22, 38, .96); }
  .tabbar { background: rgba(16, 24, 40, .96); }
  .drawer { background: #101827; }
  .sheet { background: #101827; }
  .search { background: #16203400; border-color: var(--line); background: #141d31; }
  .search input { color: var(--ink); }
  .tabs { background: #16213a; }
  .tabs button.on { background: #1e2b45; color: var(--ink); }
  .chip { background: #1a2440; color: #c3cde0; }
  .chip.on { background: #2b4bd6; color: #fff; }
  .presets button { background: #16203a; border-color: var(--line); color: var(--ink-2); }
  .input { background: #1a2440; }
  .input:focus-within { background: #1e2a49; border-color: #3d55a8; }
  .picker { background: #16203a; border-color: var(--line); }
  .stat-grid > div { background: #16203a; }
  .balance-strip { background: linear-gradient(135deg, #16233d, #131d33); border-color: #22314d; }
  .addr-box { background: #16203a; border-color: var(--line); color: #cfd9ea; }
  .qr-wrap { background: #fff; }
  .btn-ghost { background: #1c2740; color: #dbe3f2; }
  .note { background: #14203a; border-color: #22345a; color: #b6c5e0; }
  .note.warn { background: #3a2f10; border-color: #5f4a15; color: #f2e2b0; }
  .note.warn svg { color: #f0b429; }
  .toast { background: #1d2a49; }
  .empty .ico { background: #1a2437; }
  .kv .v { color: var(--ink); }
  .hero { box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .9); }
  .summary div b, .summary div.total { color: var(--ink); }
  .row:active { background: #1a2437; }
  .mini-actions a { background: #1a2440; color: var(--ink-2); }
  .mini-actions .q-ico { background: #16203a; box-shadow: none; }
  .qr-ph { background: repeating-linear-gradient(45deg, #16203a, #16203a 8px, #1a2440 8px, #1a2440 16px); }
  .drawer-head { box-shadow: 0 12px 30px -18px #000; }
  .pick-list button:hover { background: #1a2437; }
  .row + .row { border-color: #1a2437; }
  .toast-stack .toast span { color: #eaf0fb; }
  .sk { background: linear-gradient(90deg, #182136 25%, #1f2a42 37%, #182136 63%); background-size: 400% 100%; }
}
