/* Demo shell: the phone frame on desktop, full bleed on a phone. */
.page { height: 100%; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 20px; }
.device {
  position: relative; flex: none; width: var(--device-w, 390px); height: min(844px, 100%); max-height: 100%;
  border-radius: 44px; overflow: hidden; display: flex; flex-direction: column; background: #000;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 30px 70px rgba(0, 0, 0, .22), 0 8px 20px rgba(0, 0, 0, .1);
}
.device .app { flex: 1; min-height: 0; --safe-bottom: 18px; }
.device::after {
  content: ""; position: absolute; left: 50%; bottom: 7px; width: 128px; height: 5px; margin-left: -64px; border-radius: 3px;
  background: var(--text); opacity: .85; z-index: 100; pointer-events: none;
}
.tg-header { position: relative; z-index: 2; flex: none; height: 54px; display: flex; align-items: center; justify-content: space-between; padding-inline: 16px; padding-top: 6px; background: var(--bg); color: var(--text); }
.tg-header-title { position: absolute; left: 90px; right: 90px; text-align: center; display: flex; flex-direction: column; font-size: 15px; line-height: 19px; font-weight: 600; }
.tg-header-title span { font-size: 12px; line-height: 15px; font-weight: 400; color: var(--hint); }
.tg-header-name { display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 600; }
.tg-header-name svg { flex: none; }
.tg-header-close { font-size: 16px; color: var(--link); }
.tg-header-more { display: flex; color: var(--link); }

.stage-panel { flex: none; width: 214px; display: flex; flex-direction: column; gap: 18px; color: var(--text); }
.stage-panel h1 { font: 700 22px/27px var(--font-display); letter-spacing: -.02em; }
.stage-panel h1 svg { display: block; width: 186px; height: auto; fill: currentColor; }
.stage-group { display: flex; flex-direction: column; gap: 7px; }
.stage-group > span { font-size: 13px; line-height: 17px; color: var(--hint); }
.stage-panel .seg-btn { font-size: 13px; }

@media (max-width: 760px) { .stage-panel { display: none; } }
/* A phone, upright or on its side (too short for the frame): full bleed, never wider than a phone column. */
@media (max-width: 520px), (max-height: 560px) {
  .page { display: block; padding: 0; }
  .stage-panel { display: none; }
  .device { width: 100%; max-width: 560px; height: 100%; max-height: none; margin-inline: auto; border-radius: 0; box-shadow: none; }
  .device::after, .tg-header { display: none; }
  .device .app { --safe-bottom: max(var(--env-bottom), var(--tg-safe-area-inset-bottom, 0px)); }
}
.in-telegram .tg-header, .in-telegram .device::after { display: none; }

/* Tabs */
/* No visibility and no inert here: both inherit, so each switch would restyle every node of both panes. The active pane lies on top and takes every touch; a pane on its way out is see-through, then parked. */
.tab-pane { position: absolute; inset: 0; opacity: 0; transform: scale(.992); transition: opacity .2s ease, transform .3s var(--ease-out); }
.tab-pane.is-active { z-index: 1; opacity: 1; transform: none; transition: opacity .22s ease, transform .34s var(--ease-out); }
/* A tab nobody sees takes no part in layout or paint, and keeps what it has rendered for its return. */
.tab-pane.is-parked { content-visibility: hidden; }

/* Markets */
.stack-tight { display: flex; flex-direction: column; gap: 10px; }
.list-in { animation: list-in .28s var(--ease-out) both; }
@keyframes list-in { from { opacity: 0; transform: translate3d(0, 6px, 0); } to { opacity: 1; transform: none; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; text-align: center; color: var(--hint); font-size: 15px; line-height: 20px; }
.empty .icon { opacity: .6; }

/* Coin detail */
.detail-title { display: inline-flex; align-items: center; gap: 7px; }
.detail-price { font: 700 36px/44px var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.detail-meta { display: flex; align-items: center; gap: 8px; min-height: 24px; color: var(--hint); font-size: 14px; }
.detail-meta [data-data-status] { margin-left: auto; }
@media (max-width: 340px) { .detail-frame { font-size: 12.5px; white-space: nowrap; } }
.detail-head { display: flex; flex-direction: column; gap: 2px; min-height: 70px; }
.detail-price-slot { flex: none; height: 44px; }
.detail-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; padding: 10px calc(var(--gutter) + var(--safe-right)) calc(max(10px, var(--safe-bottom)) + 4px) calc(var(--gutter) + var(--safe-left)); background: var(--glass-tint); -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%); box-shadow: 0 -.5px 0 var(--sep); }
.screen.has-bar .screen-scroll { padding-bottom: calc(max(10px, var(--safe-bottom)) + 84px); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; padding: 14px 16px; }
.stat-grid dt { font-size: 13px; line-height: 17px; color: var(--hint); }
.stat-grid dd { font-size: 16px; line-height: 21px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Trade */
.order-form { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.lev-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 17px; color: var(--hint); }
.lev-value { font-size: 20px; line-height: 25px; font-weight: 700; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.summary { display: flex; flex-direction: column; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; line-height: 19px; color: var(--hint); }
/* The figure's slot fills the row: a new number changes the text, not the box. */
.summary-row > b { flex: 1 0 auto; justify-content: flex-end; text-align: right; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt-pop { animation: receipt-pop .6s var(--spring) both; }
@keyframes receipt-pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

/* Portfolio */
.action-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* Скрыть сумму: every figure of the wallet screen goes with the total. Blurred in place, so nothing moves. */
.screen-pad:has(> .balance.is-hidden) ~ * :is(.asset-right > *, .wallet-row-sub > span, .alloc-legend b) { color: transparent; text-shadow: 0 0 9px var(--hint); user-select: none; -webkit-user-select: none; }
.alloc { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.alloc-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.alloc-bar i { display: block; height: 100%; background: var(--c); min-width: 3px; }
.alloc-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 13px; line-height: 18px; }
.alloc-legend span { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--hint); white-space: nowrap; }
.alloc-legend span i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.alloc-legend em { font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.alloc-legend b { margin-left: auto; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.asset-row { min-height: 60px; --sep-left: 68px; }
.asset-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.asset-right b { font-size: 15px; line-height: 21px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.asset-right > span:not(.change) { font-size: 13px; line-height: 17px; color: var(--hint); white-space: nowrap; }

/* The real wallet */
.action-row[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action-row[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section[hidden], .group[hidden] { display: none; }
.balance-address { display: inline-flex; align-items: center; gap: 5px; height: 28px; margin: -4px 8px -4px auto; padding-inline: 10px; border-radius: 14px; background: rgba(255, 255, 255, .18); color: inherit; font-size: 13px; line-height: 18px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-pct[hidden] { display: none; }
.wallet-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px 16px; text-align: center; }
.wallet-card-mark { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 26px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); --icon-knock: transparent; }
.wallet-card > b { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; }
.wallet-card > span:not(.wallet-card-mark, .wallet-address) { font-size: 14px; line-height: 19px; color: var(--hint); }
.wallet-card .btn { margin-top: 6px; }
.wallet-card > .wallet-address + .btn, .wallet-card > span + .btn:first-of-type { margin-top: 12px; }
.wallet-address { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: center; word-break: break-all; user-select: text; -webkit-user-select: text; }
.sheet-body > .wallet-address { margin-top: 0; }
.wallet-note-link { margin-top: -12px; }
.wallet-explorer { margin-top: -6px; }
/* Пригласить друзей: the link's box keeps two lines and the figures one row, filled or not, so nothing moves as they come in. */
.invite-link { display: flex; align-items: center; justify-content: center; min-height: 60px; word-break: normal; overflow-wrap: anywhere; }
.invite-link.is-wait { color: var(--hint); }
/* Поделиться: the card it is about, and the link in a field a tap selects whole. Пригласить друзей uses the same field and buttons. */
.share-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.share-head .market-name { min-width: 0; }
.share-link { display: flex; align-items: center; justify-content: center; min-height: 60px; word-break: normal; overflow-wrap: anywhere; cursor: text; user-select: all; -webkit-user-select: all; }
.share-link.is-wait { user-select: none; -webkit-user-select: none; }
.share-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.invite-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.invite-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border-radius: 12px; background: var(--fill); }
.invite-stats > div[hidden] { display: none; }
.invite-stats b { font-size: 20px; line-height: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.invite-stats span { font-size: 13px; line-height: 18px; color: var(--hint); text-align: center; }
.wallet-row-sub { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wallet-row-sub > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-row-sub .tag { flex: none; height: 17px; padding-inline: 5px; border-radius: 6px; font-size: 11px; line-height: 15px; font-style: normal; }
.wallet-skel { height: 60px; background: linear-gradient(90deg, transparent, var(--fill), transparent); animation: tk-breathe 1.4s ease-in-out infinite; }
.wallet-skel--card { height: 164px; border-radius: var(--r-card); }
@container app (max-width: 350px) {
  .balance-address { padding-inline: 8px; font-size: 12px; }
}

/* Profile */
.theme-row { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }

/* Kit */
.kit-panel { display: none; flex-direction: column; gap: 22px; }
.kit-panel.is-active { display: flex; animation: list-in .28s var(--ease-out) both; }
.kit-box { position: relative; border-radius: var(--r-group); padding: 14px; overflow: hidden; }
.kit-box--glass {
  background:
    radial-gradient(70% 90% at 15% 15%, #ffb36b, transparent 70%),
    radial-gradient(70% 90% at 85% 25%, #e7c477, transparent 70%),
    radial-gradient(90% 90% at 55% 100%, #b07bff, transparent 70%),
    #dfe3ea;
}
.kit-col { display: flex; flex-direction: column; gap: 10px; }
.icon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 10px; }
.icon-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 12px; transition: transform .4s var(--spring); }
.icon-cell:active { transform: scale(.86); transition-duration: .1s; }
.icon-cell:focus-visible { outline-offset: -2px; }
.tile-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 14px 16px; }
.tile-palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; justify-items: center; }
@container app (max-width: 350px) {
  .icon-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tile-palette { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .detail-price { font-size: 32px; }
  .action-disc { width: 48px; height: 48px; }
  #market-filter .seg-btn { font-size: 11.5px; }
}

@supports (overflow: clip) {
  .device { overflow: clip; }
  body { overflow: clip; }
}

/* Inside Telegram the app fills the window up to a phone column of 560: on a tablet, a phone on its side or a wide desktop window it stands in the middle, the page's own colour either side. */
.in-telegram body, .tg-launch body { background: var(--bg); }
.in-telegram .page, .tg-launch .page { display: block; padding: 0; }
.in-telegram .device, .tg-launch .device { width: 100%; max-width: 560px; height: 100%; max-height: none; margin-inline: auto; border-radius: 0; box-shadow: none; }
.in-telegram .stage-panel, .tg-launch .stage-panel, .in-telegram #row-preset, .tg-launch #row-preset { display: none; }
.in-telegram .device .app, .tg-launch .device .app { --safe-bottom: max(var(--env-bottom), var(--tg-safe-area-inset-bottom, 0px)); }
/* Wider than the column: the notch of a phone on its side falls in the margin, so the content needs no room for it. */
@media (min-width: 561px) {
  .device .app {
    --safe-left: max(0px, max(var(--env-left), var(--tg-safe-area-inset-left, 0px)) - (100vw - 560px) / 2);
    --safe-right: max(0px, max(var(--env-right), var(--tg-safe-area-inset-right, 0px)) - (100vw - 560px) / 2);
  }
  /* A sheet sends the page back on black, as on a phone: the margins go dark with the column, not a black strip between light ones. */
  .in-telegram body, .tg-launch body { transition: background-color .35s var(--ease-ios); }
  .in-telegram body:has(.app-stage.is-receded), .tg-launch body:has(.app-stage.is-receded) { background: #000; }
}

/* Invite rewards: Начислено and Выплачено in GRAM with the money beside, one line each, filled or not. Выплаты: the total with its money, and how many people, in the same lines. */
.invite-money { display: flex; flex-direction: column; padding: 2px 14px; border-radius: 12px; background: var(--fill); }
.invite-money[hidden] { display: none; }
/* Выплаты: «Подтвердить крупные выплаты» shows only once its lines are on screen; .btn's own display would show it hidden. */
.btn[data-large-ok][hidden] { display: none; }
.invite-money.is-reserved { visibility: hidden; }
.invite-money > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.invite-money > div + div { box-shadow: inset 0 0.5px 0 var(--separator, rgba(128, 128, 128, .25)); }
.invite-money span { color: var(--hint); font-size: 15px; line-height: 20px; white-space: nowrap; }
.invite-money p { display: flex; align-items: baseline; gap: 6px; margin: 0; min-width: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invite-money b { font-size: 15px; line-height: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.invite-money i { font-style: normal; font-size: 13px; line-height: 18px; color: var(--hint); font-variant-numeric: tabular-nums; }
