:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: #0d1918;
  --panel-strong: #112220;
  --line: rgba(221, 255, 240, 0.09);
  --muted: #81928e;
  --text: #effbf5;
  --accent: #7fffc4;
  --accent-dark: #0b3428;
  --danger: #ff7f87;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 95% -5%, rgba(84, 255, 182, 0.11), transparent 34%),
    radial-gradient(circle at -15% 45%, rgba(58, 171, 255, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(36px, env(safe-area-inset-bottom));
}

.topbar, .brand, .balance-heading, .balance-meta, .section-title-row, .section-actions, .asset-row,
.sheet-title-row, .fee-row, .confirm-actions { display: flex; align-items: center; }

.topbar { justify-content: space-between; margin-bottom: 22px; }
.brand { gap: 11px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(127, 255, 196, 0.42);
  border-radius: 50%;
  background: var(--accent);
  color: #06120e;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 0 0 6px rgba(127, 255, 196, 0.05);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 17px; letter-spacing: -0.02em; }
h2 { margin-bottom: 0; font-size: 17px; letter-spacing: -0.02em; }

.icon-button, .close-button, .visibility-button, .text-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--accent);
  font-weight: 800;
}

.balance-card {
  position: relative;
  overflow: hidden;
  padding: 23px;
  border: 1px solid rgba(127, 255, 196, 0.13);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(127, 255, 196, 0.08), transparent 48%),
    var(--panel);
  box-shadow: var(--shadow);
}

.balance-card::after {
  position: absolute;
  width: 190px;
  height: 190px;
  right: -110px;
  top: -105px;
  border: 1px solid rgba(127, 255, 196, 0.18);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 28px rgba(127, 255, 196, 0.025), 0 0 0 58px rgba(127, 255, 196, 0.018);
}

.balance-heading { gap: 8px; color: var(--muted); }
.balance-heading p { margin: 0; font-size: 13px; }
.visibility-button { color: var(--muted); font-size: 8px; }
.primary-balance { margin-top: 12px; font-size: 36px; font-weight: 730; letter-spacing: -0.055em; }
.primary-balance small { color: #a3b9b2; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.fiat-equivalent { margin-top: 5px; color: var(--muted); font-size: 13px; }
.balance-meta { justify-content: space-between; margin-top: 27px; color: #a7bab4; font-size: 10px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 28px; }
.action-button {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 13px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(13, 25, 24, 0.82);
  color: #b7c8c2;
  font-size: 11px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}
.action-button:active { transform: scale(0.96); }
.action-button:hover { border-color: rgba(127, 255, 196, 0.3); }
.action-primary { background: var(--accent); color: #06120e; font-weight: 800; }
.action-icon { display: grid; width: 28px; height: 28px; place-items: center; font-size: 18px; font-weight: 500; }

.asset-section, .activity-section, .service-section { margin-top: 24px; }
.section-title-row { justify-content: space-between; margin-bottom: 12px; }
.section-actions { gap: 14px; }
.quiet-label, .text-button { color: var(--muted); font-size: 11px; }
.text-button { color: var(--accent); }
.asset-list { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.asset-row { min-height: 76px; padding: 15px; }
.asset-row + .asset-row { border-top: 1px solid var(--line); }
.coin { display: grid; flex: 0 0 40px; height: 40px; place-items: center; border-radius: 50%; font-weight: 900; }
.coin-usdt { background: rgba(38, 161, 123, 0.18); color: #50e3ad; }
.coin-trx { background: rgba(255, 82, 92, 0.16); color: #ff7a83; }
.asset-copy { display: grid; flex: 1; gap: 4px; margin-left: 12px; }
.asset-copy strong, .asset-value strong { font-size: 13px; }
.asset-copy span, .asset-value span { color: var(--muted); font-size: 10px; }
.asset-value { display: grid; gap: 4px; text-align: right; }
.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.service-button { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; min-height: 68px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; }
.service-button > span { grid-row: 1 / 3; display: grid; width: 36px; height: 36px; place-items: center; align-self: center; border-radius: 12px; background: var(--panel-strong); color: var(--accent); font-size: 15px; }
.service-button strong { align-self: end; font-size: 11px; }
.service-button small { align-self: start; margin-top: 3px; color: var(--muted); font-size: 9px; }
.service-button:active { transform: scale(0.98); }
.service-button:last-child { grid-column: 1 / -1; }

.activity-list { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.activity-row { display: flex; align-items: center; min-height: 69px; padding: 13px 15px; }
.activity-button { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.activity-button:hover { background: rgba(127, 255, 196, 0.035); }
.activity-row + .activity-row { border-top: 1px solid var(--line); }
.activity-glyph { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 13px; background: var(--panel-strong); color: var(--accent); }
.activity-glyph.out { color: #f2bd79; }
.activity-copy { display: grid; flex: 1; gap: 4px; margin-left: 11px; }
.activity-copy strong, .activity-value strong { font-size: 12px; }
.activity-copy span, .activity-value span { color: var(--muted); font-size: 10px; }
.activity-value { display: grid; gap: 4px; text-align: right; }
.activity-value .out { color: #f3c385; }
.activity-value .in { color: var(--accent); }

.empty-state { display: grid; justify-items: center; padding: 31px 16px 29px; text-align: center; }
.empty-state strong { margin-top: 12px; font-size: 13px; }
.empty-state span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.empty-orbit { position: relative; width: 42px; height: 42px; border: 1px solid rgba(127, 255, 196, 0.3); border-radius: 50%; }
.empty-orbit::after { position: absolute; width: 7px; height: 7px; right: 2px; top: 3px; border-radius: 50%; background: var(--accent); content: ""; box-shadow: 0 0 10px var(--accent); }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  max-width: calc(100vw - 36px);
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #172421;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: #ffd7d9; border-color: rgba(255, 127, 135, 0.3); }

.sheet {
  width: min(100% - 20px, 460px);
  max-height: calc(100vh - 28px);
  margin: auto auto 10px;
  padding: 0;
  border: 1px solid rgba(221, 255, 240, 0.11);
  border-radius: 26px;
  background: #0d1918;
  color: var(--text);
  box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(0, 7, 6, 0.72); backdrop-filter: blur(7px); }
.sheet form { padding: 10px 20px 20px; }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 18px; border-radius: 4px; background: #30423e; }
.sheet-title-row { justify-content: space-between; margin-bottom: 22px; }
.close-button { width: 36px; height: 36px; border-radius: 50%; background: var(--panel-strong); color: var(--muted); font-size: 24px; }
.sheet label { display: grid; gap: 9px; margin: 15px 0; color: #b8c7c2; font-size: 11px; }
.sheet label em { color: var(--muted); font-style: normal; }
.sheet input, .sheet select {
  width: 100%;
  min-height: 51px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #081311;
  color: var(--text);
}
.sheet input:focus, .sheet select:focus { border-color: rgba(127, 255, 196, 0.45); }
.sheet [hidden] { display: none; }
.amount-input-wrap { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.fee-row { justify-content: space-between; margin: 20px 2px 14px; color: var(--muted); font-size: 11px; }
.fee-row strong { color: var(--text); }
.submit-button, .secondary-button {
  width: 100%;
  min-height: 51px;
  border: 0;
  border-radius: 15px;
  background: var(--accent);
  color: #06120e;
  font-weight: 850;
  cursor: pointer;
}
.submit-button:disabled { opacity: 0.5; cursor: wait; }
.secondary-button { border: 1px solid var(--line); background: var(--panel-strong); color: var(--text); }
.sheet-footnote { margin: 12px 0 0; color: var(--muted); font-size: 9px; text-align: center; }

.confirm-sheet { text-align: center; }
.confirm-icon { display: grid; width: 52px; height: 52px; margin: 2px auto 16px; place-items: center; border-radius: 50%; background: var(--accent); color: #07100f; font-size: 25px; }
.confirm-sheet h2 { margin-top: 12px; font-size: 32px; }
.confirm-peer { margin: 8px 0 23px; color: var(--muted); font-size: 12px; }
.confirm-peer strong { color: var(--text); }
.confirm-details { padding: 2px 14px; border: 1px solid var(--line); border-radius: 15px; background: #091412; text-align: left; }
.confirm-details div { display: flex; justify-content: space-between; padding: 13px 0; }
.confirm-details div + div { border-top: 1px solid var(--line); }
.confirm-details dt, .confirm-details dd { margin: 0; font-size: 10px; }
.confirm-details dt { color: var(--muted); }
.confirm-actions { gap: 9px; margin-top: 16px; }

.info-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #081311; }
.info-card + .info-card { margin-top: 10px; }
.info-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.info-card strong { display: block; margin-bottom: 7px; font-size: 12px; }
.address-box { overflow-wrap: anywhere; color: var(--accent) !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.network-pill { width: max-content; margin: -5px auto 12px; padding: 6px 10px; border: 1px solid rgba(127, 255, 196, 0.25); border-radius: 999px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 0.12em; }
.deposit-qr { display: grid; place-items: center; margin: 0 auto 14px; }
.deposit-qr img { width: 184px; height: 184px; padding: 10px; border-radius: 20px; background: #effbf5; }
.copy-button { width: 100%; min-height: 40px; margin-top: 13px; border: 1px solid rgba(127, 255, 196, 0.24); border-radius: 12px; background: var(--accent-dark); color: var(--accent); font-size: 11px; font-weight: 800; cursor: pointer; }
.warning-card { margin-top: 10px; padding: 14px 15px; border: 1px solid rgba(243, 195, 133, 0.2); border-radius: 16px; background: rgba(243, 195, 133, 0.06); }
.warning-card strong { display: block; margin-bottom: 5px; color: #f3c385; font-size: 11px; }
.warning-card p { margin: 0; color: #bda98d; font-size: 10px; line-height: 1.55; }
.deposit-section-title { margin: 18px 2px 9px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.deposit-history { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.deposit-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; color: inherit; text-decoration: none; }
.deposit-row + .deposit-row { border-top: 1px solid var(--line); }
.deposit-row span:first-child { display: grid; gap: 4px; }
.deposit-row strong { font-size: 11px; }
.deposit-row small, .deposit-link, .empty-deposit { color: var(--muted); font-size: 9px; }
.empty-deposit { margin: 0; padding: 16px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; }
.limit-hint { margin: -4px 2px 13px; color: var(--muted); font-size: 10px; }
.receipt-hero { display: grid; justify-items: center; gap: 7px; padding: 8px 0 22px; }
.receipt-hero span, .receipt-hero small { color: var(--muted); font-size: 10px; }
.receipt-hero strong { color: var(--accent); font-size: 27px; letter-spacing: -0.04em; }
.receipt-details { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 16px; background: #081311; }
.receipt-details div { display: flex; justify-content: space-between; gap: 18px; padding: 13px 14px; }
.receipt-details div + div { border-top: 1px solid var(--line); }
.receipt-details dt, .receipt-details dd { margin: 0; font-size: 10px; }
.receipt-details dt { color: var(--muted); }
.receipt-details dd { max-width: 65%; overflow-wrap: anywhere; text-align: right; }
.security-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.security-summary div { display: grid; gap: 6px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: #081311; text-align: center; }
.security-summary span { color: var(--muted); font-size: 9px; }
.security-summary strong { color: var(--accent); font-size: 10px; }
.security-form input { width: 100%; min-height: 43px; margin-top: 8px; }
.security-form textarea { width: 100%; margin-top: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; outline: none; resize: vertical; background: #050d0c; color: var(--text); font: inherit; }
.security-address-list { overflow: hidden; margin-top: 10px; border: 1px solid var(--line); border-radius: 15px; }
.security-address-row, .merchant-invoice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; }
.security-address-row + .security-address-row, .merchant-invoice + .merchant-invoice { border-top: 1px solid var(--line); }
.security-address-row span, .merchant-invoice span { display: grid; min-width: 0; gap: 4px; }
.security-address-row strong, .merchant-invoice strong { font-size: 10px; }
.security-address-row small, .merchant-invoice small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; }
.security-address-row button, .merchant-invoice button { flex: 0 0 auto; border: 0; background: transparent; color: var(--accent); font-size: 9px; cursor: pointer; }
.security-toggle { margin-top: 10px; }
.merchant-invoice { border: 1px solid var(--line); background: #081311; }
.merchant-invoice + .merchant-invoice { border-top: 0; }
.merchant-invoice:first-of-type { border-radius: 15px 15px 0 0; }
.merchant-invoice:last-of-type { border-radius: 0 0 15px 15px; }
.merchant-brand-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.merchant-brand-summary > span:last-child { display: grid; min-width: 0; gap: 5px; }
.merchant-brand-summary small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.merchant-brand-logo, .merchant-brand-placeholder { width: 50px; height: 50px; flex: 0 0 50px; border: 1px solid var(--line); border-radius: 15px; }
.merchant-brand-logo { display: block; object-fit: cover; background: #081311; }
.merchant-brand-placeholder { display: grid; place-items: center; background: var(--accent-dark); color: var(--accent); font-size: 20px; font-weight: 800; }
.merchant-logo-upload { display: grid; gap: 3px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.merchant-logo-upload input { padding: 9px; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin: 30px 0 4px; color: var(--muted); font-size: 9px; }
.app-footer a, .account-legal a { color: var(--muted); text-decoration: none; }
.app-footer a:hover, .account-legal a:hover { color: var(--accent); }
.app-footer span { flex-basis: 100%; text-align: center; }
.account-action { margin-top: 10px; }
.danger-button { width: 100%; min-height: 48px; border: 1px solid rgba(255, 127, 135, 0.25); border-radius: 15px; background: rgba(255, 127, 135, 0.07); color: #ffafb4; font-weight: 750; cursor: pointer; }
.center-create { margin-bottom: 12px; }
.wallet-center-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); background: #081311; }
.wallet-center-row + .wallet-center-row { border-top: 0; }
.wallet-center-row:first-of-type { border-radius: 15px 15px 0 0; }
.wallet-center-row:last-of-type { border-radius: 0 0 15px 15px; }
.wallet-center-row span { display: grid; min-width: 0; gap: 4px; }
.wallet-center-row strong { overflow-wrap: anywhere; font-size: 10px; }
.wallet-center-row small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; }
.wallet-center-row > div, .center-secret-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.wallet-center-row button, .center-secret-actions button, .center-inline button { padding: 7px 9px; border: 1px solid rgba(127, 255, 196, 0.22); border-radius: 9px; background: var(--accent-dark); color: var(--accent); font-size: 9px; cursor: pointer; }
.wallet-center-row button.danger { border-color: rgba(255, 127, 135, 0.25); background: rgba(255, 127, 135, 0.07); color: #ffafb4; }
.center-inline { display: flex; gap: 7px; margin-bottom: 12px; }
.center-inline input { min-width: 0; flex: 1; }
.center-secret-actions { margin: 10px 0 16px; }
.account-legal { margin: 16px 0 0; color: var(--muted); font-size: 9px; text-align: center; }

body.balance-hidden .primary-balance,
body.balance-hidden .fiat-equivalent,
body.balance-hidden .asset-value { filter: blur(8px); user-select: none; }

@media (min-width: 680px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 30px; background: rgba(7, 16, 15, 0.76); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
:root { --dice-panel-border: rgba(255, 255, 255, .12); }
.dice-balances { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.dice-balances > div { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--dice-panel-border); border-radius: 12px; }
.dice-balances small, .dice-order small { opacity: .65; }
.dice-order { padding: 16px 0; border-top: 1px solid var(--dice-panel-border); }
.dice-order > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.dice-order p { margin: 10px 0; line-height: 1.6; }
.dice-rules { font-size: 13px; line-height: 1.8; color: var(--muted); }
.dice-order-actions { display: flex; gap: 10px; margin-top: 14px; }
.dice-order-actions button { padding: 10px 16px; border: 1px solid var(--dice-panel-border); border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
