@font-face {
  font-family: Inter;
  src: url('/assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  scrollbar-gutter: stable both-edges;
  --background: #101011;
  --surface: #1c1c1f;
  --surface-raised: #252527;
  --surface-hover: #2d2d30;
  --surface-pressed: #38383b;
  --foreground: #f6f6f5;
  --muted: #aaa9ad;
  --quiet: #98979c;
  --divider: #303033;
  --outline: #3c3c40;
  --accent: #f3f2ee;
  --on-accent: #171719;
  --error: #ee9b9b;
  --positive: #9ce0bb;
  --radius-card: 20px;
  --radius-sheet: 24px;
  --glass-fill: rgb(49 49 52 / 52%);
  --glass-solid: #29292c;
  --glass-rim: rgb(255 255 255 / 8%);
  --glass-highlight: rgb(255 255 255 / 30%);
  --glass-reflection: rgb(255 255 255 / 17%);
  --glass-shadow: 0 8px 32px rgb(0 0 0 / 24%);
  --motion-spring: cubic-bezier(.41, 1.4, .64, 1);
  --gutter: 20px;
  --panel-inset: 16px;
  --stack-gap: 24px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --shell: 440px;
  --dock: 64px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--telegram-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--telegram-bottom, 0px));
  --dock-bottom: max(12px, var(--safe-bottom));
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
h1, h2, p, dl, dd, ol, ul { margin: 0; }
h1:focus { outline: none; }
svg { display: block; flex: none; }

.app-shell {
  max-width: var(--shell);
  min-height: 100dvh;
  margin-inline: auto;
  padding: var(--safe-top) var(--gutter) calc(var(--dock) + var(--dock-bottom) + var(--gutter));
}

.access-screen {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  min-height: 100dvh;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 24px var(--gutter);
  text-align: center;
}
.access-screen h1 { font-size: 1.375rem; }
.access-screen p { color: var(--muted); font-size: .875rem; line-height: 1.45; }

.account-header {
  position: sticky;
  z-index: 2;
  top: calc(var(--safe-top) + 8px);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  margin-top: 24px;
}

.account-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-pressed);
  color: var(--foreground);
  font-size: .625rem;
  font-weight: 710;
}
.account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-chip {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  padding: 4px 13px 4px 5px;
  border-radius: 999px;
}
.profile-chip strong {
  overflow: hidden;
  font-size: .875rem;
  line-height: 1.3;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pro-link {
  justify-self: end;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 630;
}
.pro-link:hover { background: var(--surface-raised); }
.pro-link[data-selected] { border-color: var(--muted); }

.glass {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--glass-rim);
  background: var(--glass-solid);
  box-shadow: var(--glass-shadow);
}
.glass::after {
  position: absolute;
  z-index: 1;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 8% 1%, var(--glass-highlight), transparent 48%),
    radial-gradient(ellipse at 96% 98%, var(--glass-reflection), transparent 42%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  content: '';
}
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
  .glass {
    background: linear-gradient(160deg, rgb(255 255 255 / 7%), transparent 58%), var(--glass-fill);
    -webkit-backdrop-filter: blur(20px) saturate(.8);
    backdrop-filter: blur(20px) saturate(.8);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
}
.icon-button:where(:not(.glass)) { border: 0; background: transparent; }
.icon-button:active { color: var(--foreground); background: var(--surface-pressed); }
.settings { color: var(--foreground); }
.profile-chip:active, .icon-button.glass:active { background: var(--surface-pressed); }

.balance-hero { position: relative; display: grid; justify-items: center; gap: 18px; margin-top: 44px; text-align: center; }
.balance-label { color: var(--muted); font-size: .9375rem; font-weight: 500; line-height: 1.4; }
.balance-row { display: grid; grid-template-columns: 38px minmax(0, auto) 38px; align-items: center; gap: 7px; max-width: 100%; }
.balance { grid-column: 2; display: flex; align-items: baseline; justify-content: center; gap: .14em; font-size: clamp(2.125rem, 10.6vw, 2.875rem); line-height: 1.12; letter-spacing: -.048em; font-weight: 680; font-variant-numeric: tabular-nums; }
.balance-currency { opacity: .46; font-weight: 550; }
.balance-visibility { grid-column: 3; width: 38px; height: 38px; }
.balance-visibility:hover, .balance-visibility:active { color: var(--foreground); background: transparent; }
.balance-visibility svg { width: 18px; }
.balance-number { display: inline-grid; justify-items: end; }
.balance-number > span { grid-area: 1 / 1; }
.balance-number:has(.balance-reels) #balance { opacity: 0; }
.balance-reels { display: flex; align-items: flex-start; }
.balance-reel { height: 1.12em; overflow: clip; }
.balance-reel-track, .balance-reel-track > span { display: block; }
.balance-reel-track > span { line-height: 1.12; }

.portfolio-detail { margin-top: 0; }

.wallet-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); margin-top: 42px; }
.wallet-action {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-size: .8125rem;
  font-weight: 620;
}
.wallet-action > span {
  display: grid;
  place-items: center;
  width: clamp(56px, 17.5vw, 68px);
  aspect-ratio: 1;
  border: 1px solid var(--divider);
  border-radius: 50%;
  background: var(--surface-raised);
  transition: background-color 160ms ease, transform 200ms var(--motion-spring);
}
.wallet-action svg { width: 25px; height: 25px; }
.wallet-action:hover > span { background: var(--surface-hover); }
.wallet-action:active > span { transform: scale(.92); }
.wallet-action-primary > span { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.wallet-action-primary:hover > span { background: #dfded9; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 46px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline);
  border-radius: 15px;
  background: var(--surface-raised);
  font-size: .9375rem;
  line-height: 1.2;
  font-weight: 560;
  text-align: center;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.button:not(:disabled):active { background: var(--surface-pressed); }
.primary { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 650; }
.primary:not(:disabled):active { background: #d6d5d0; }
.primary:disabled { background: var(--surface-raised); color: var(--muted); border-color: var(--outline); }

.panel { border-radius: var(--radius-card); background: var(--surface); }
.engine { display: grid; gap: 15px; margin-top: 32px; padding: var(--panel-inset); }
.engine-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 11px; }
.engine-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--surface-raised);
  transition: background-color 180ms ease, color 180ms ease;
}
.engine-header:has(.engine-status[data-state="live"]) .engine-icon {
  color: var(--positive);
  background: color-mix(in srgb, var(--positive) 12%, var(--surface-raised));
}
@media (prefers-reduced-motion: no-preference) {
  .engine-header:has(.engine-status[data-state="live"]) .engine-icon::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 24%, rgb(156 224 187 / 17%), transparent 76%);
    animation: engine-sweep 2.4s ease-in-out infinite;
    content: '';
  }
  .engine-header:has(.engine-status[data-state="live"]) .engine-prompt {
    animation: engine-prompt 2.4s ease-in-out infinite;
  }
  .engine-header:has(.engine-status[data-state="live"]) .engine-cursor {
    animation: engine-cursor 1.2s steps(1, end) infinite;
  }
}
@keyframes engine-sweep {
  from { transform: translateX(-100%); }
  60%, to { transform: translateX(100%); }
}
@keyframes engine-prompt {
  0%, 30%, to { transform: translateX(0); }
  15% { transform: translateX(2px); }
}
@keyframes engine-cursor {
  0%, 72%, to { opacity: 1; }
  47% { opacity: .2; }
}
.engine-copy { align-self: center; }
.engine-status { padding-top: 3px; color: var(--muted); font-size: .75rem; line-height: 1.25; transition: color 180ms ease; }
.engine-action { text-align: center; }
.engine-action .button { width: 100%; }

.log { margin-top: var(--stack-gap); overflow: hidden; }
.log-heading { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 var(--panel-inset); border-bottom: 1px solid var(--divider); background: var(--surface); }
.log-heading h2 { display: flex; align-items: center; gap: var(--space-sm); font-size: .8125rem; line-height: 1.3; letter-spacing: .105em; text-transform: uppercase; }
.log-heading h2 svg, .log-status { color: var(--muted); }
.log-list { list-style: none; padding: 0; }
.log-empty { padding: 14px var(--panel-inset); color: var(--muted); font-size: .8125rem; }
.log-list li + li { border-top: 1px solid var(--divider); }
.log-list time { color: var(--quiet); font: .6875rem/1.4 var(--mono); }
.profit { color: var(--positive); }
.trade-event {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  min-height: 50px;
}
.trade-token {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
}
.trade-token-sol { padding: 5px; background: #191721; }
.trade-description { display: grid; gap: 2px; font-size: .8125rem; line-height: 1.3; }
.trade-event time { justify-self: end; white-space: nowrap; text-align: right; }
.trade-loss { color: var(--error); }

.engine h2 { font-size: .9375rem; line-height: 1.25; font-weight: 610; }
.engine-copy p { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; color: var(--muted); font-size: .8125rem; line-height: 1.32; }
.engine-error { color: var(--error); font-size: .8125rem; }
.engine-status[data-state="live"] { color: var(--positive); }
.log-list { padding-inline: var(--panel-inset); }
.log-status { font-size: .75rem; }

.footer {
  position: fixed;
  z-index: 3;
  bottom: var(--dock-bottom);
  left: 50%;
  width: min(calc(var(--shell) - 2 * var(--gutter)), calc(100% - 2 * var(--gutter)));
  transform: translateX(-50%);
  transition: opacity 220ms ease;
}

.nav {
  --nav-inset: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: var(--dock);
  padding: var(--nav-inset);
  border-radius: 999px;
}


.nav::before {
  position: absolute;
  inset: var(--nav-inset) auto var(--nav-inset) var(--nav-inset);
  width: calc((100% - 2 * var(--nav-inset)) / 2);
  border: 1px solid var(--glass-rim);
  border-radius: inherit;
  background: rgb(255 255 255 / 13%);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 10%);
  transition: transform 350ms var(--motion-spring);
  pointer-events: none;
  content: '';
}

.nav:has(#nav-history[aria-current])::before { transform: translateX(100%); }

.nav button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 5px 10px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.2;
  font-weight: 600;
  transition: color 160ms ease, transform 160ms ease;
}

.nav svg { width: 23px; height: 23px; }
.nav button[aria-current] { color: var(--foreground); }
.nav button:focus-visible { outline-offset: -3px; }
.nav button:active { transform: scale(.94); }

.history-header { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: var(--space-md); min-height: 44px; margin-top: 24px; }
.history-header h1 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -.025em; text-align: center; }
.filters { display: flex; gap: var(--space-sm); margin-top: calc(var(--stack-gap) - 4px); overflow-x: auto; padding: 4px 0 4px; scrollbar-width: none; }
.filters button { flex: 1 0 auto; min-width: 44px; min-height: 44px; padding: var(--space-xs) var(--space-sm); border: 1px solid var(--divider); border-radius: 99px; color: var(--muted); background: var(--surface); font-size: .8125rem; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.filters button:focus-visible { outline-offset: -3px; }
.filters button[aria-pressed="true"] { color: var(--on-accent); border-color: transparent; background: var(--accent); }
.filters button:not([aria-pressed="true"]):active { background: var(--surface-pressed); }

.records { padding: 0 14px; list-style: none; margin-top: 14px; border-radius: var(--radius-card); background: var(--surface); }
.records .history-row:last-child { border-bottom: 0; }
.history-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-md);
  padding-block: var(--space-md);
  border-bottom: 1px solid var(--divider);
}

.asset-icon { display: block; width: 34px; height: 34px; margin-top: 2px; object-fit: contain; }
.record, .record-result { display: grid; gap: var(--space-xs); }
.record strong, .record-result strong { font-size: .875rem; font-weight: 620; line-height: 1.25; }
.record > span, .record-result > span { font-size: .75rem; color: var(--muted); line-height: 1.35; }
.record-result { text-align: right; font-variant-numeric: tabular-nums; }
.activity-badge {
  --badge-fill: #252529;
  --badge-ink: #b5b5be;
  display: inline-flex;
  justify-self: end;
  align-items: center;
  min-height: 19px;
  padding-inline: 6px;
  border-radius: 5px;
  background: var(--badge-fill);
  color: var(--badge-ink);
  font-size: .625rem;
  font-weight: 690;
  line-height: 1.2;
  letter-spacing: .025em;
  white-space: nowrap;
}
.activity-badge[data-tone="positive"] { --badge-fill: #153029; --badge-ink: #a5e7c7; }
.activity-badge[data-tone="negative"] { --badge-fill: #352127; --badge-ink: #f0a2b2; }
.record-result > .activity-badge { color: var(--badge-ink); font-size: .625rem; }
.position-row {
  --token-size: clamp(36px, 10.8vw, 44px);
  grid-template-columns: var(--token-size) minmax(0, 1fr) auto;
  column-gap: clamp(7px, 2.4vw, 13px);
  padding-block: 16px;
}
.position-row .trade-token { width: var(--token-size); height: var(--token-size); }
.position-row .trade-token-sol { padding: 9px; }
.position-detail { display: grid; gap: 4px; min-width: 0; }
.position-title, .position-badges, .position-facts { display: flex; align-items: center; flex-wrap: wrap; }
.position-title { gap: 4px 7px; }
.position-title strong { font-size: 1rem; font-weight: 650; line-height: 1.25; white-space: nowrap; }
.position-badges { gap: 4px; }
.position-facts { column-gap: 7px; }
.position-facts, .position-detail time, .position-equity {
  color: var(--muted);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.position-detail time { color: var(--quiet); }
.position-facts span { white-space: nowrap; }
.position-result { display: grid; gap: 2px; text-align: right; font-variant-numeric: tabular-nums; }
.position-result strong { font-size: .9375rem; font-weight: 650; line-height: 1.3; }
.position-return { color: #ddd; font-size: .75rem; }
.empty-history { padding: 56px var(--panel-inset) var(--stack-gap); text-align: center; }
.empty-history svg { margin: 0 auto var(--space-md); color: var(--muted); }
.empty-history h2 { font-size: 1rem; line-height: 1.3; font-weight: 620; }
.empty-history p { margin-top: 4px; font-size: .875rem; color: var(--muted); line-height: 1.45; }

html:has(.bottom-sheet[open]) { overflow: hidden; }
.bottom-sheet {
  --sheet-bottom: max(6px, var(--safe-bottom));
  --sheet-dim: 54%;
  position: fixed;
  inset: var(--sheet-top, 0px) 0 auto;
  width: 100%;
  height: var(--sheet-viewport, 100%);
  container-type: size;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: clip;
  border: 0;
  background: transparent;
  color: var(--foreground);
}

.bottom-sheet[open] { display: grid; align-items: end; justify-items: center; }
.bottom-sheet::backdrop { background: transparent; }
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / var(--sheet-dim));
  pointer-events: none;
}
.sheet-inner {
  --sheet-inset: clamp(14px, 4.25vw, 19px);
  --sheet-padding-top: 12px;
  --sheet-padding-bottom: 18px;
  --sheet-max-height: calc(var(--sheet-viewport, 100dvh) - var(--safe-top) - var(--sheet-bottom) - 8px);
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(406px, calc(100% - 12px));
  max-height: var(--sheet-max-height);
  margin-bottom: var(--sheet-bottom);
  overflow: clip;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sheet);
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 12px 48px rgb(0 0 0 / 34%);
}
.sheet-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  grid-template-rows: 44px;
  align-items: center;
  column-gap: 8px;
  flex: none;
  padding: 12px 16px 4px;
}
.sheet-heading {
  grid-area: 1 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.icon-button.sheet-action {
  grid-area: 1 / 1;
  background: var(--surface-raised);
  color: var(--foreground);
}
.icon-button.sheet-action:active { background: var(--surface-pressed); }
#sheet-title { font-size: 1.125rem; font-weight: 660; line-height: 1.25; text-align: center; text-wrap: balance; }

.sheet-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  align-items: center;
  gap: 14px;
  padding: var(--sheet-padding-top) var(--sheet-inset) var(--sheet-padding-bottom);
  text-align: center;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.sheet-body::-webkit-scrollbar { display: none; }
.sheet-body:focus-visible { outline: 1px solid var(--muted); outline-offset: -2px; }
.sheet-body:has(.payment-details) { padding-top: 12px; }
.bottom-sheet[data-presentation="deposit-list"] .sheet-toolbar {
  grid-template-columns: minmax(0, 1fr) 44px;
  padding: 12px var(--sheet-inset) 4px;
}
.bottom-sheet[data-presentation="deposit-list"] .sheet-heading {
  grid-area: 1 / 1;
  justify-content: flex-start;
}
.bottom-sheet[data-presentation="deposit-list"] #sheet-title {
  text-align: start;
}
.bottom-sheet[data-presentation="deposit-list"] .sheet-action {
  grid-area: 1 / 2;
}
.bottom-sheet[data-presentation="pro-methods"] .sheet-toolbar {
  grid-template-rows: minmax(44px, auto);
  padding-inline: var(--sheet-inset);
}
.bottom-sheet[data-presentation="pro-methods"] .sheet-subtitle {
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.4;
  text-align: center;
}
.bottom-sheet:is([data-presentation="deposit-list"], [data-presentation="pro-methods"]) .sheet-body {
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
}
.deposit-choices {
  flex: none;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}
.deposit-choice {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: start;
}
.deposit-choice:hover, .deposit-choice:focus-visible { background: var(--surface-hover); }
.deposit-choice:active { background: var(--surface-pressed); }
.deposit-choice:focus-visible { z-index: 1; outline: 2px solid var(--accent); outline-offset: -3px; }
.deposit-choice:disabled { opacity: .55; }
.deposit-choices li:not(:last-child) .deposit-choice::after {
  content: "";
  position: absolute;
  inset: auto 12px 0 64px;
  border-bottom: 1px solid var(--outline);
  pointer-events: none;
}
.deposit-choice-logo, .deposit-selected-logo { display: block; aspect-ratio: 1; object-fit: contain; }
.deposit-choice-logo { width: 40px; }
.deposit-selected-logo { width: 24px; }
.deposit-choice-copy { display: grid; gap: 3px; }
.deposit-choice-copy strong { font-size: .9375rem; line-height: 1.2; font-weight: 670; }
.deposit-choice-copy span { color: var(--muted); font-size: .875rem; line-height: 1.25; }
.deposit-choice-chevron { display: grid; place-items: center; color: var(--muted); }
.deposit-choice-chevron svg { width: 16px; height: 16px; }
.sheet-note { color: var(--muted); font-size: .8125rem; line-height: 1.4; max-width: 36ch; text-wrap: balance; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 350px) {
  :root { --gutter: 16px; --panel-inset: 12px; }
  .account-header { gap: 6px; }
  .filters { gap: var(--space-xs); }
  .filters button { padding-inline: 6px; }
  .history-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-sm); }
  .history-row .asset-icon { width: 28px; height: 28px; }
}

@media (max-width: 440px) {
  :root { scrollbar-width: none; }
}

@media (max-height: 720px) {
  .account-header, .history-header { margin-top: 14px; }
  .balance-hero { gap: 10px; margin-top: 32px; }
  .wallet-actions { margin-top: 25px; }
  .engine { margin-top: 25px; }
  .log { margin-top: 18px; }
  .wallet-action > span { width: 60px; }
}

.pro-form, .pro-options { display: grid; width: 100%; }
.pro-form { gap: 14px; }
.pro-form .sheet-note { justify-self: center; }
.pro-benefits { display: grid; gap: 8px; text-align: start; }
.pro-benefits h3 { margin: 0; font-size: .9375rem; }
.pro-benefits ul { display: grid; gap: 5px; padding: 0; list-style: none; font-size: .875rem; }
.pro-benefits li { display: flex; align-items: baseline; gap: 10px; }
.pro-benefits li::before {
  content: "";
  flex: 0 0 11px;
  height: 6px;
  border: solid var(--positive);
  border-width: 0 0 2px 2px;
  transform: translateY(-2px) rotate(-45deg);
}
.pro-benefits .sheet-note { justify-self: start; max-width: none; text-wrap: wrap; }
.pro-options { gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.pro-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--outline);
  border-radius: 15px;
  background: var(--surface-raised);
  text-align: start;
  font-size: .875rem;
  cursor: pointer;
}
.pro-option:has(:checked) { border-color: var(--muted); background: var(--surface-hover); }
.pro-option input { margin: 0; accent-color: var(--accent); }
.pro-duration { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.pro-price { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
}
.subscription-summary {
  width: 100%;
  text-align: start;
}
.subscription-summary .pro-benefits { margin-top: 18px; }
.subscription-details { font-variant-numeric: tabular-nums; }
.subscription-expiry { margin-bottom: 27px; }
.subscription-expiry dt,
.subscription-expiry time span { color: var(--muted); font-size: 1.0625rem; }
.subscription-expiry time { display: grid; gap: 3px; margin-top: 6px; }
.subscription-expiry strong { font-size: clamp(2rem, 10vw, 2.5rem); line-height: 1.12; letter-spacing: -.035em; }
.subscription-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 55px;
  padding: 8px 0;
  border-top: 1px solid var(--divider);
  font-size: 1.0625rem;
}
.subscription-row:last-child { border-bottom: 1px solid var(--divider); }
.subscription-row dt { color: var(--muted); }
.subscription-row dd { color: var(--foreground); text-align: end; font-weight: 550; }
.pro-intro { font-size: .875rem; color: var(--foreground); line-height: 1.45; max-width: none; }
.sheet-subtitle { margin-top: 3px; color: var(--positive); font-size: .9375rem; }
.bottom-sheet[data-presentation="receipt"] { --sheet-dim: 62%; }
.bottom-sheet[data-presentation="receipt"] .sheet-inner { --sheet-padding-top: 24px; }
.bottom-sheet[data-presentation="receipt"] .sheet-toolbar {
  grid-template-columns: minmax(0, 1fr) 44px;
  padding: 14px var(--sheet-inset) 0;
}
.bottom-sheet[data-presentation="receipt"] .sheet-heading { grid-area: 1 / 1; justify-content: flex-start; }
.bottom-sheet[data-presentation="receipt"] #sheet-title { font-size: 1.4375rem; font-weight: 700; text-align: start; }
.icon-button.sheet-action[data-glyph="check"] { grid-area: 1 / 2; color: var(--positive); }

@media (prefers-reduced-motion: reduce) {
  .button, .footer, .nav::before, .nav button, .filters button, .wallet-action > span, .settings-switch::before { transition: none; }
  .nav button:active, .wallet-action:active > span { transform: none; }
}

.balance { overflow-wrap: anywhere; }
.portfolio-detail { color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.record time { color: var(--muted); font-size: .75rem; }
.record-result { max-width: min(42vw, 160px); overflow-wrap: anywhere; }
.sheet-body > .button { width: 100%; }
.sheet-message { color: var(--error); font-size: .875rem; text-align: center; padding: 0 24px 22px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 57px;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  text-align: start;
  font-size: .875rem;
}
.settings-switch {
  position: relative;
  display: block;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 99px;
  background: var(--outline);
}
.settings-switch::before {
  position: absolute;
  inset: 3px auto auto 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 180ms ease;
  content: '';
}
.settings-row[aria-checked="true"] .settings-switch { background: var(--muted); }
.settings-row[aria-checked="true"] .settings-switch::before { transform: translateX(16px); background: var(--on-accent); }
.payment-details { display: grid; justify-items: center; align-items: center; gap: 10px; width: 100%; }
.payment-summary { display: grid; gap: 8px; justify-items: center; min-width: 0; max-width: 100%; }
.transfer-qr { display: block; width: 160px; height: 160px; border-radius: 13px; background: #fff; }
.deposit-amount { font-size: 1rem; color: var(--muted); overflow-wrap: anywhere; }
.deposit-amount strong { color: var(--foreground); font-size: 2.4rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.deposit-address-coin { display: flex; align-items: center; gap: 8px; }
.deposit-address-coin strong { font-size: 1.375rem; }
.deposit-network { display: flex; align-items: center; gap: 7px; font-size: .875rem; font-weight: 620; }
.deposit-requisites { display: grid; gap: 8px; width: 100%; min-width: 0; text-align: start; }
.deposit-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 3px 8px;
  align-items: center;
  padding: 8px 8px 8px 12px;
  border-radius: 15px;
  background: var(--surface-raised);
}
.deposit-label { font-size: .75rem; line-height: 1.2; color: var(--muted); }
.deposit-field code {
  grid-column: 1;
  overflow-wrap: anywhere;
  font: .875rem/1.3 var(--mono);
  font-weight: 600;
  user-select: all;
}
.deposit-field .copy-button { grid-column: 2; grid-row: 1 / span 2; color: var(--foreground); }
.copy-button[data-copied] { color: var(--positive); }

@container (max-height: 650px) {
  .sheet-inner { --sheet-padding-top: 8px; --sheet-padding-bottom: 14px; }
  .sheet-toolbar { padding-block: 8px 2px; }
  .sheet-body:has(.payment-details) { padding-top: 8px; }
  .sheet-message { padding: 0 14px 10px; }
  .payment-details { gap: 7px; }
  .payment-summary { gap: 4px; }
  .transfer-qr { width: clamp(80px, 22cqh, 132px); height: auto; }
  .deposit-requisites { gap: 6px; }
  .deposit-field { padding-block: 4px; }
}

@container (max-height: 460px) {
  .payment-details { grid-template-columns: auto minmax(0, 1fr); }
  .payment-details > :not(.transfer-qr, .payment-summary) { grid-column: 1 / -1; }
  .deposit-amount strong { font-size: 1.875rem; }
}
