/* SF Pro — локальные файлы (работает офлайн и в РФ без CDN) */
@font-face {
  font-family: "SF Pro Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("SF Pro Display"), url("/assets/fonts/SFProDisplay-Regular.woff") format("woff");
}
@font-face {
  font-family: "SF Pro Display";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: local("SF Pro Display"), url("/assets/fonts/SFProDisplay-Medium.woff") format("woff");
}
@font-face {
  font-family: "SF Pro Display";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: local("SF Pro Display"), url("/assets/fonts/SFProDisplay-Bold.woff") format("woff");
}

:root {
  --bg: #f6f7f2;
  --ink: #111315;
  --muted: rgba(17, 19, 21, 0.58);
  --line: rgba(17, 19, 21, 0.1);
  --accent: #ffdd2d;
  --accent-ink: #161616;
  --glass-bg: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.74);
  --shadow: 0 28px 80px rgba(42, 48, 54, 0.16), 0 8px 22px rgba(42, 48, 54, 0.08);
  --font-sf: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sf);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

@supports (-webkit-touch-callout: none) {
  :root {
    --font-sf: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  }
}

/* SF Pro во всех элементах проекта */
*,
button,
input,
textarea,
select {
  font-family: var(--font-sf);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overflow-x: clip;
}

button,
input {
  font: inherit;
}

a,
[role="button"] {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(106px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow: hidden;
  overflow-x: clip;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 221, 45, 0.42), transparent 34%),
    radial-gradient(circle at 80% 16%, rgba(64, 156, 255, 0.2), transparent 34%),
    linear-gradient(145deg, #f8f8f0 0%, #eaf0ee 54%, #f6f7f2 100%);
  transition: opacity 360ms ease;
  touch-action: manipulation;
}

.app-frame {
  width: min(100%, 430px);
  height: calc(100svh - max(18px, env(safe-area-inset-top)) - 106px - env(safe-area-inset-bottom));
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, #ffe76b 0%, var(--accent) 100%);
  box-shadow: 0 18px 36px rgba(184, 152, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 24px;
  font-weight: 800;
}

.header-copy {
  display: grid;
  gap: 1px;
}

.header-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.header-copy strong {
  font-size: 18px;
  line-height: 1.16;
}

.screen {
  min-height: 0;
  display: none;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.screen.is-active {
  display: flex;
  animation: tab-screen-fade 110ms ease-out both;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen > * {
  flex: 0 0 auto;
}

.screen-head {
  display: grid;
  gap: 4px;
}

.glass-surface {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
}

.glass-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), transparent 44%, rgba(255, 255, 255, 0.16));
}

.login-card,
.profile-card,
.root-card,
.hero-card,
.list-card,
.allocation-card,
.search-card,
.ticket-card,
.mini-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 34px;
}

.hero-card {
  gap: 14px;
}

.search-card,
.ticket-card {
  border-radius: 30px;
}

.content-group {
  display: grid;
  gap: 10px;
}

.section-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-row h2 {
  font-size: 22px;
}

.section-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.list-card {
  gap: 0;
  padding: 8px;
}

.event-row {
  position: relative;
  min-height: 72px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 24px;
}

.event-row + .event-row {
  border-top: 1px solid rgba(17, 19, 21, 0.06);
}

.event-row b {
  font-size: 15px;
  white-space: nowrap;
}

.date-chip {
  width: 48px;
  height: 52px;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 6px 0;
  border-radius: 18px;
  background: rgba(255, 221, 45, 0.4);
  color: var(--accent-ink);
}

.date-chip span,
.date-chip small {
  line-height: 1;
}

.date-chip span {
  font-size: 18px;
  font-weight: 800;
}

.date-chip small {
  font-size: 11px;
  font-weight: 700;
}

.row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.row-copy strong,
.row-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-copy strong {
  font-size: 15px;
}

.row-copy span {
  color: var(--muted);
  font-size: 13px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-card {
  gap: 8px;
  padding: 16px;
  border-radius: 24px;
}

.mini-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.mini-card strong {
  font-size: 18px;
}

.login-card,
.profile-card {
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.login-card.is-confirmed,
.profile-card.is-confirmed {
  transform: scale(0.985);
}

.profile-card {
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
}

.profile-card h2 {
  font-size: 24px;
}

.portfolio-hero {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.38)),
    rgba(255, 255, 255, 0.58);
}

.change-row {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(52, 199, 89, 0.12);
  color: #176a31;
}

.change-row span,
.change-row strong {
  font-size: 14px;
  line-height: 1;
}

.change-row span {
  font-weight: 650;
}

.change-row strong {
  white-space: nowrap;
}

.allocation-card {
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  padding: 18px;
  border-radius: 30px;
}

.allocation-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(#111315 0 62%, #4aa3ff 62% 86%, #ffdd2d 86% 100%);
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.72), 0 12px 28px rgba(42, 48, 54, 0.12);
}

.allocation-list {
  position: relative;
  display: grid;
  gap: 10px;
}

.allocation-list div {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.allocation-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.allocation-list b {
  font-size: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-stock {
  background: #111315;
}

.dot-bond {
  background: #4aa3ff;
}

.dot-cash {
  background: #ffdd2d;
}

.asset-row {
  position: relative;
  min-height: 70px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 24px;
}

.quote-row {
  position: relative;
  min-height: 70px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 24px;
}

.quote-row + .quote-row {
  border-top: 1px solid rgba(17, 19, 21, 0.06);
}

.quote-value {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.quote-value b {
  font-size: 15px;
  white-space: nowrap;
}

.quote-value span {
  font-size: 12px;
  font-weight: 750;
}

.positive {
  color: #176a31;
}

.negative {
  color: #ba2a2a;
}

.segmented-control {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 20px;
  background: rgba(17, 19, 21, 0.06);
}

.segment {
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  color: rgba(17, 19, 21, 0.6);
  background: transparent;
  font-size: 14px;
  font-weight: 760;
}

.segment.is-selected {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(42, 48, 54, 0.08);
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-field input {
  min-height: 50px;
}

.secondary-button {
  min-height: 52px;
  border: 1px solid rgba(17, 19, 21, 0.08);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-weight: 740;
}

.asset-row + .asset-row {
  border-top: 1px solid rgba(17, 19, 21, 0.06);
}

.asset-row b {
  font-size: 15px;
  white-space: nowrap;
}

.asset-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(17, 19, 21, 0.08);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.copy {
  position: relative;
  display: grid;
  gap: 3px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: 0;
}

h1 {
  font-size: 38px;
}

h2 {
  font-size: 32px;
}

.field {
  position: relative;
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.field input:focus {
  border-color: rgba(255, 221, 45, 0.95);
  box-shadow: 0 0 0 4px rgba(255, 221, 45, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-button {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, #ffe66a 0%, var(--accent) 100%);
  box-shadow: 0 12px 26px rgba(191, 158, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-weight: 740;
  touch-action: manipulation;
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-button:active,
.tab-button:active,
.utility-tab:active {
  transform: scale(0.98) translateY(1px);
  filter: brightness(0.97);
}

.hint {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.32;
}

.metric-label,
.metric-value {
  position: relative;
  margin: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.metric-value {
  font-size: 44px;
  line-height: 1;
  font-weight: 800;
}

.ios-tab-shell {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(calc(100% - 36px), 430px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 62px;
  align-items: center;
  gap: 8px;
  z-index: 20;
  contain: layout style;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.tab-dock {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  min-height: 66px;
  padding: 5px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(36, 38, 42, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateZ(0);
  --tab-active-index: 0;
}

.tab-dock::before {
  z-index: 0;
  opacity: 0.48;
}

.tab-dock::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 3);
  border-radius: 29px;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 239, 244, 0.76)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(42, 48, 54, 0.08);
  transform: translate3d(calc(var(--tab-active-index) * 100%), 0, 0);
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
  pointer-events: none;
}

.tab-dock.has-main-active::after {
  opacity: 1;
}

.utility-tab,
.tab-button {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #969ca4;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  transform: translateZ(0);
  transition: color 180ms ease, transform 160ms ease, filter 160ms ease;
}

.utility-tab {
  width: 62px;
  height: 62px;
  gap: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(36, 38, 42, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
}

.pulse-tab,
.search-tab {
  gap: 0;
}

.tab-button {
  height: 56px;
  gap: 4px;
  padding: 5px 2px 6px;
  border-radius: 28px;
}

.utility-tab svg,
.tab-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pulse-tab svg,
.search-tab svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.45;
}

.pulse-tab svg {
  transform: translateY(-1px);
}

.tab-button.is-active svg {
  width: 23px;
  height: 23px;
}

.tab-button span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9.5px;
}

.tab-button.is-active {
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.tab-button.is-active span {
  font-weight: 760;
}

.ios-tab-shell.is-tab-pop .tab-button.is-active,
.ios-tab-shell.is-tab-pop .utility-tab.is-active {
  animation: tab-pop-confirm 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tab-pop-confirm {
  0% { transform: translateZ(0) scale(1); }
  45% { transform: translateZ(0) scale(0.94); }
  100% { transform: translateZ(0) scale(1); }
}

@media (max-width: 370px) {
  .login-card,
  .profile-card,
  .root-card,
  .hero-card,
  .allocation-card,
  .search-card,
  .ticket-card {
    padding: 20px;
    border-radius: 28px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 30px;
  }

  .tab-button {
    padding-inline: 1px;
  }

  .ios-tab-shell {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    width: min(calc(100% - 20px), 430px);
    grid-template-columns: minmax(0, 1fr) 54px 54px;
    gap: 6px;
  }

  .utility-tab {
    width: 54px;
    height: 54px;
  }

  .tab-dock {
    min-height: 60px;
  }

  .tab-button {
    height: 50px;
  }

  .tab-button span {
    font-size: 9px;
  }

  .event-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .event-row b,
  .asset-row b {
    grid-column: 2;
    justify-self: start;
  }

  .asset-row,
  .quote-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .quote-value {
    grid-column: 2;
    justify-self: start;
    justify-items: start;
  }

  .allocation-card {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .allocation-list {
    width: 100%;
  }
}


/* ── TASK-011 TotalBalance (glass pill) ──────────────── */

.total-balance {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 7px 16px 7px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 19, 21, 0.06);
  box-shadow: 0 6px 20px rgba(60, 50, 90, 0.06);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
}

.tb-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe76b 0%, #ffdd2d 100%);
  box-shadow: 0 0 0 2px rgba(74, 130, 255, 0.9);
}

.tb-avatar-inner {
  color: #161616;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.tb-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tb-amount {
  font-size: 17px;
  font-weight: 760;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: 0;
}

.tb-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}

/* На светлых вкладках (портфель/трейдинг) — тёмный текст */
.app-shell[data-active-screen="portfolio"] .tb-amount,
.app-shell[data-active-screen="trading"] .tb-amount {
  color: var(--ink);
}

.app-shell[data-active-screen="portfolio"] .tb-label,
.app-shell[data-active-screen="trading"] .tb-label {
  color: var(--muted);
}

.app-shell[data-active-screen="portfolio"] .total-balance,
.app-shell[data-active-screen="trading"] .total-balance {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(17, 19, 21, 0.08);
}

/* ── TASK-013 Payouts hero ───────────────────────────── */

/* На вкладке Выплаты: полноширинный layout, hero вровень с верхом */
/* Иммерсивные экраны (выплаты/активы/трейдинг): full-width + пилюля-оверлей */
.app-shell[data-active-screen="payouts"],
.app-shell[data-active-screen="portfolio"],
.app-shell[data-active-screen="trading"],
.app-shell[data-active-screen="pulse"] {
  padding: 0 0 calc(106px + env(safe-area-inset-bottom)) 0;
}

.app-shell[data-active-screen="payouts"],
.app-shell[data-active-screen="portfolio"] {
  background: linear-gradient(180deg, #E9E6F6 0%, #F1EFF8 24%, #F7F7F9 56%, #F7F7F9 100%);
}

.app-shell[data-active-screen="trading"] {
  background:
    radial-gradient(circle at 100% 0%, rgba(20, 78, 39, 0.46), transparent 176px),
    radial-gradient(circle at 0% 55%, rgba(94, 32, 36, 0.46), transparent 190px),
    #000;
}

.app-shell[data-active-screen="trading"]::before,
.app-shell[data-active-screen="trading"]::after {
  content: none;
}

.app-shell[data-active-screen="payouts"] .app-frame,
.app-shell[data-active-screen="portfolio"] .app-frame,
.app-shell[data-active-screen="trading"] .app-frame,
.app-shell[data-active-screen="pulse"] .app-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  height: 100svh;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.app-shell[data-active-screen="payouts"] .total-balance,
.app-shell[data-active-screen="portfolio"] .total-balance,
.app-shell[data-active-screen="trading"] .total-balance {
  position: absolute;
  top: max(16px, calc(env(safe-area-inset-top) + 8px));
  left: max(20px, env(safe-area-inset-left));
  z-index: 30;
}

/* Трейдинг — тёмная пилюля со светлым текстом */
.app-shell[data-active-screen="trading"] .total-balance {
  background: rgba(120, 120, 128, 0.28);
  border-color: rgba(255, 255, 255, 0.14);
}
.app-shell[data-active-screen="trading"] .tb-amount { color: #fff; }
.app-shell[data-active-screen="trading"] .tb-label { color: rgba(255, 255, 255, 0.55); }

.payouts-hero,
.assets-hero,
.trading-hero {
  /* Единый скелет на всех 3 экранах. Сетка 8pt: 96/16/24 кратны 8 */
  width: 100%;
  margin: 0;
  padding: 96px max(20px, env(safe-area-inset-right)) 16px max(20px, env(safe-area-inset-left));

  background: transparent;
  border-radius: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px; /* единый вертикальный ритм между блоками героя */
  justify-content: flex-start;
}

.ph-period-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.ph-period-btn svg {
  width: 14px;
  height: 14px;
  color: rgba(17, 19, 21, 0.45);
}

.ph-big-amount {
  margin: 2px 0 0;
  color: #18C964;
  font-size: 62px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 0 22px rgba(24, 201, 100, 0.35),
    0 0 50px rgba(24, 201, 100, 0.18);
}

.ph-already-paid {
  margin: 4px 0 0;
  color: rgba(17, 19, 21, 0.45);
  font-size: 15px;
  font-weight: 500;
}

/* Карточка статистики внутри hero */
.ph-stats-card {
  width: 100%;
  margin-top: 22px;
  display: flex;
  align-items: stretch;
  padding: 20px 18px;
  border-radius: 24px;
  border: 1px solid rgba(17, 19, 21, 0.06);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(60, 50, 90, 0.06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.ph-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.ph-stat > strong {
  color: #fff;
  font-size: 22px;
  font-weight: 760;
  line-height: 1;
}

.ph-stat span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.ph-stat span b {
  font-weight: 760;
}

.ph-stat-sep {
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
  align-self: stretch;
  margin: 0 4px;
}

/* Наложенные лого источников дохода */
.ph-sources-logos {
  display: flex;
  align-items: center;
  height: 28px;
}

.ph-src-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  flex: 0 0 auto;
}

.ph-src-logo + .ph-src-logo {
  margin-left: -10px;
}

.ph-src-tt {
  background: #FFDD2D;
  color: #161616;
  font-size: 14px;
  font-weight: 800;
}

.ph-src-green {
  background: linear-gradient(135deg, #4ad17a, #2f9e57);
}

/* Карточка-кнопка «инструменты пассивного дохода» */
.ph-savings {
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 18px 20px;
  cursor: pointer;
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.ph-savings:active {
  transform: scale(0.985);
  box-shadow: 0 4px 16px rgba(60, 50, 90, 0.08);
}

.ph-savings-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.ph-savings-copy strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 760;
  line-height: 1;
}

.ph-savings-copy span {
  color: rgba(17, 19, 21, 0.45);
  font-size: 13px;
  font-weight: 500;
}

.ph-savings-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ph-chevron {
  width: 16px;
  height: 16px;
  color: rgba(17, 19, 21, 0.3);
}

/* Промо-блок */
.ph-promo {
  width: 306px;
  min-height: 61px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  margin-top: 8px;
}

.ph-promo-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.ph-promo-icon svg { display: none; }

.ph-promo-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Текст всегда чёрный (нижний слой) + мягкая фиолетовая полоса проходит сверху */
.ph-promo p {
  margin: 1px 0 0;
  max-width: 253px;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
  background-image:
    linear-gradient(105deg, transparent 39%, rgba(178, 136, 255, 1) 50%, transparent 61%),
    linear-gradient(0deg, #17131f, #17131f);
  background-size: 280% 100%, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  background-position: 130% 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: promo-shine 6s cubic-bezier(0.45, 0, 0.2, 1) infinite;
  will-change: background-position, filter;
}

.ph-promo p .hl { color: inherit; } /* всё чёрное, без двухцветности */

/* Плавный проход подсветки + мягкий фиолетовый глоу в такт, затем покой */
@keyframes promo-shine {
  0%   { background-position: 130% 0, 0 0; filter: drop-shadow(0 0 0 rgba(150, 110, 255, 0)); }
  19%  { background-position: 50% 0, 0 0;  filter: drop-shadow(0 0 9px rgba(168, 124, 255, 0.6)); }
  38%  { background-position: -30% 0, 0 0; filter: drop-shadow(0 0 0 rgba(150, 110, 255, 0)); }
  100% { background-position: -30% 0, 0 0; filter: drop-shadow(0 0 0 rgba(150, 110, 255, 0)); }
}

/* На тёмном экране трейдинга — светлый текст без клипа/подсветки */
.trading-body .ph-promo p {
  background-image: none;
  -webkit-text-fill-color: currentColor;
  color: rgba(255, 255, 255, 0.62);
  animation: none;
}
.trading-body .ph-promo p .hl { color: rgba(255, 255, 255, 0.62); }
.trading-body .ph-promo-icon { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }

/* Точки-пагинация */
.ph-dots {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.ph-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(44, 43, 49, 0.16);
}

.ph-dots span.is-active {
  width: 17px;
  border-radius: 999px;
  background: rgba(44, 43, 49, 0.42);
}

/* ── Нижняя секция (общая для экранов) ────────────────── */
.payouts-body,
.assets-body,
.trading-body {
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pb-title {
  margin: 0;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.pb-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px 2px;
}

.pb-chips::-webkit-scrollbar { display: none; }

.pb-chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 19, 21, 0.06);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.pb-chip.is-active {
  background: #2B7BFF;
  color: #fff;
}

/* Сетка карточек инструментов */
.pb-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pb-card {
  background: #fff;
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 140ms ease;
}

.pb-card:active { transform: scale(0.985); }

.pb-card-top {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 124px;
  border-radius: 16px;
  background: #F2F3F5;
}

.pb-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff;
  color: rgba(17, 19, 21, 0.55);
  font-size: 12px;
  font-weight: 700;
}

.pb-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(17, 19, 21, 0.28);
}

.pb-heart svg { width: 20px; height: 20px; }

.pb-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.pb-card-body {
  padding: 12px 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pb-income {
  color: #1FB85E;
  font-size: 17px;
  font-weight: 760;
  line-height: 1.1;
}

.pb-name {
  color: rgba(17, 19, 21, 0.5);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-add {
  margin-top: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: #161616;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  touch-action: manipulation;
  transition: transform 140ms ease, filter 140ms ease;
}

.pb-add:active { transform: scale(0.97); filter: brightness(1.2); }

/* Ряд категорий */
.pb-cats {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 4px -16px 0;
  padding: 6px 16px 4px;
}

.pb-cats::-webkit-scrollbar { display: none; }

.pb-cat {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 64px;
  border: 0;
  background: transparent;
}

.pb-cat-ic {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(17, 19, 21, 0.06);
  color: rgba(17, 19, 21, 0.7);
}

.pb-cat-ic svg { width: 24px; height: 24px; }

.pb-cat small {
  color: rgba(17, 19, 21, 0.6);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* Серый аватар-кружок в карточках */
.ph-ava {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(17, 19, 21, 0.1);
}

/* ── Активы: список «Топ по обороту» ──────────────────── */
.tw-listcard {
  background: #fff;
  border-radius: 24px;
  padding: 18px 16px 6px;
  box-shadow: 0 8px 28px rgba(60, 50, 90, 0.05);
}

.tw-listtitle {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: 0;
}

.tw-list { display: flex; flex-direction: column; }

.tw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.tw-row:active { opacity: 0.6; }

.tw-row + .tw-row { border-top: 1px solid rgba(17, 19, 21, 0.06); }

.tw-row-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

/* Логотип-картинка (реальная иконка компании из каталога T-Invest) */
.tw-row-logo.is-img,
.tr-card-logo.is-img,
.tr-leader-logo.is-img,
.pb-logo.is-img,
.cal-item-logo.is-img,
.instr-logo.is-img,
.pf-row-logo.is-img,
.sr-card-logo.is-img,
.sr-row-logo.is-img {
  background: #fff;
  overflow: hidden;
  padding: 0;
}
.tw-row-logo.is-img img,
.tr-card-logo.is-img img,
.tr-leader-logo.is-img img,
.pb-logo.is-img img,
.cal-item-logo.is-img img,
.instr-logo.is-img img,
.pf-row-logo.is-img img,
.sr-card-logo.is-img img,
.sr-row-logo.is-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tw-row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tw-row-copy strong { font-size: 16px; font-weight: 640; }
.tw-row-copy span { font-size: 13px; color: rgba(17, 19, 21, 0.4); }

.tw-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tw-row-right b { font-size: 16px; font-weight: 640; white-space: nowrap; }
.tw-row-right span { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tw-up { color: #18C964; }
.tw-down { color: #E8452C; }

/* ── Трейдинг (тёмная тема) ───────────────────────────── */
.trading-hero .ph-period-btn { color: #fff; }
.trading-hero .ph-period-btn svg { color: rgba(255, 255, 255, 0.5); }

.trading-hero .ph-big-amount {
  color: #fff;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.28), 0 0 54px rgba(255, 255, 255, 0.14);
}

.tr-margin {
  margin-top: 12px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(24, 201, 100, 0.16), rgba(24, 201, 100, 0.34));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.trading-hero {
  padding-bottom: 10px;
  gap: 14px;
}

.tr-assistant {
  margin-top: 4px;
}

.tr-assistant.ph-promo p {
  background-image: none;
  color: rgba(255, 255, 255, 0.72);
  -webkit-text-fill-color: currentColor;
  animation: none;
}

.tr-assistant.ph-promo p .hl {
  color: rgba(255, 255, 255, 0.88);
}

.trading-body {
  position: relative;
  z-index: 1;
  gap: 22px;
  padding-top: 10px;
  padding-bottom: 150px;
  color: #fff;
}

.tr-cards { display: flex; flex-direction: column; gap: 14px; }

.tr-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 75px;
  padding: 14px 18px;
  border-radius: 22px;
  background: #1c1c1e;
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 140ms ease;
}

.tr-card::before {
  content: "";
  position: absolute;
  inset: -34px auto auto -20px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--card-glow, rgba(255, 255, 255, 0.04));
  filter: blur(18px);
  opacity: 0.5;
  pointer-events: none;
}

.tr-card > * {
  position: relative;
  z-index: 1;
}

.tr-card:active { transform: scale(0.985); }

.tr-card-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.tr-card-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tr-card-price { color: #fff; font-size: 22px; font-weight: 760; line-height: 1; }
.tr-card-change { font-size: 14px; font-weight: 600; }

.tr-spark { width: 86px; height: 46px; flex: 0 0 auto; }

.tr-add {
  align-self: center;
  width: 89px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #1c1c1e;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  font-weight: 500;
  transition: transform 140ms ease;
}
.tr-add:active { transform: scale(0.94); }

.tr-acc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  background: #1c1c1e;
}
.tr-acc[hidden] { display: none; }
.tr-acc .ph-ava { background: rgba(255, 255, 255, 0.14); }
.tr-acc .ph-savings-copy strong { color: #fff; font-size: 20px; }
.tr-acc .ph-savings-copy span { color: rgba(255, 255, 255, 0.45); }

/* Промо на тёмном фоне трейдинга */
/* (иконка промо на трейдинге стилизуется выше) */

.tr-section-trigger {
  min-height: 44px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
}

.tr-market,
.tr-leaders,
.tr-catalog {
  display: grid;
  gap: 8px;
}

.tr-heatmap-card {
  width: 100%;
  min-height: 210px;
  padding: 20px 15px 16px;
  overflow: hidden;
  border-radius: 22px;
  background: #1c1c1e;
}

.tr-heatmap-card h2 {
  margin: 0 0 16px 4px;
  color: #fff;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 790;
}

.tr-heatmap {
  height: 135px;
  display: grid;
  grid-template-columns: 1.25fr 0.86fr 0.66fr 0.88fr;
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
}

.tr-heat-tile {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-content: center;
  gap: 3px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: #08be39;
  font: inherit;
  text-align: center;
  overflow: hidden;
}

.tr-heat-tile.is-down {
  background: #f5232d;
}

.tr-heat-tile strong,
.tr-heat-tile span {
  line-height: 1;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tr-heat-tile strong {
  font-size: 11px;
  font-weight: 760;
}

.tr-heat-tile span {
  font-size: 10px;
  font-weight: 650;
}

.tr-heat-tile.tile-1 { grid-row: span 2; }
.tr-heat-tile.tile-2 { grid-row: span 2; }
.tr-heat-tile.tile-3 { grid-row: span 1; }
.tr-heat-tile.tile-4 { grid-row: span 2; }
.tr-heat-tile.tile-5 { grid-row: span 2; }
.tr-heat-tile.tile-6 { grid-row: span 1; }

.tr-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.54);
  font-size: 14px;
}

.tr-leader-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tr-leader-card {
  position: relative;
  min-width: 0;
  min-height: 133px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 14px 8px 15px;
  border: 0;
  border-radius: 22px;
  background: #1b1b1d;
  color: #fff;
  font: inherit;
  text-align: center;
}

.tr-leader-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--leader-color);
  filter: blur(18px);
  opacity: 0.58;
}

.tr-leader-logo {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 820;
}

.tr-leader-card strong,
.tr-leader-card b,
.tr-leader-card em {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.12;
}

.tr-leader-card strong {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 650;
}

.tr-leader-card b {
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}

.tr-leader-card em {
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
}

.tr-catalog-strip {
  margin-top: 0;
  padding-top: 18px;
  padding-bottom: 18px;
  border-radius: 22px;
  background: #1c1c1e;
}

.tr-catalog-strip .pb-cat-ic {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
}

.tr-catalog-strip .pb-cat small {
  color: rgba(255, 255, 255, 0.82);
}

.tr-config {
  align-self: center;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #1c1c1e;
  color: #6aa5ff;
  font-size: 14px;
  font-weight: 650;
}

/* ── Режим активного трейдинга: быстрые действия ─────── */
.detail-screen.at-screen {
  z-index: 40;
  min-height: 100svh;
  overflow: hidden;
  background: #050605;
  color: #fff;
}

.at-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.2) 1px, transparent 1.4px);
  background-size: 32px 32px;
  background-position: 0 0;
  pointer-events: none;
}

.at-screen::after {
  content: "";
  position: absolute;
  inset: -70px -58px;
  background:
    radial-gradient(circle at 50% 0%, rgba(19, 103, 39, 0.72) 0 118px, transparent 158px),
    radial-gradient(circle at 14% 80%, rgba(117, 32, 32, 0.28) 0 110px, transparent 154px),
    radial-gradient(circle at 91% 42%, rgba(37, 104, 45, 0.26) 0 118px, transparent 170px);
  filter: blur(14px);
  opacity: 0.92;
  pointer-events: none;
}

.at-close {
  position: absolute;
  z-index: 3;
  top: max(50px, calc(env(safe-area-inset-top) + 26px));
  left: max(16px, env(safe-area-inset-left));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.02);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 140ms ease, background-color 140ms ease;
}

.at-close:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.08);
}

.at-close svg {
  width: 24px;
  height: 24px;
}

.at-home-pill {
  position: absolute;
  z-index: 2;
  top: max(29px, calc(env(safe-area-inset-top) + 12px));
  left: 50%;
  width: 42px;
  height: 4px;
  border-radius: 99px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.32);
}

.at-avatar {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  margin: max(88px, calc(env(safe-area-inset-top) + 72px)) auto 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffde33;
  box-shadow: 0 0 32px rgba(255, 222, 51, 0.2);
}

.at-avatar::before {
  content: "";
  position: absolute;
  inset: 11px 11px 7px;
  border-radius: 11px 11px 16px 16px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}

.at-avatar span {
  position: relative;
  z-index: 1;
  color: #111315;
  font-size: 21px;
  font-weight: 820;
  line-height: 1;
}

.at-actions {
  position: relative;
  z-index: 1;
  width: min(312px, calc(100vw - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 108px 108px 112px 112px;
  gap: 11px 9px;
}

.at-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: #171717;
  color: #fff;
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 140ms ease, filter 140ms ease;
}

.at-card::before {
  content: "";
  position: absolute;
  width: 118px;
  height: 118px;
  left: -28px;
  top: -58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  filter: blur(18px);
  pointer-events: none;
}

.at-card > * {
  position: relative;
  z-index: 1;
}

.at-card:active {
  transform: scale(0.975);
  filter: brightness(1.08);
}

.at-card span:not(.at-card-icon) {
  max-width: 121px;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.16;
}

.at-card strong {
  font-size: 20px;
  font-weight: 760;
  line-height: 1;
}

.at-card-tall,
.at-card-large {
  grid-row: span 2;
}

.at-card-green {
  background:
    linear-gradient(180deg, #142918 0%, #171717 72%);
}

.at-card-green::before {
  width: 172px;
  height: 172px;
  left: -47px;
  top: -74px;
  background: rgba(32, 164, 67, 0.34);
  filter: blur(22px);
}

.at-card-red {
  background:
    linear-gradient(180deg, #713030 0%, #651d1d 100%);
  border-color: rgba(255, 126, 126, 0.16);
}

.at-card-red::before {
  width: 158px;
  height: 158px;
  left: -36px;
  top: -30px;
  background: rgba(255, 125, 125, 0.17);
  filter: blur(24px);
}

.at-card-warm {
  background:
    linear-gradient(180deg, #231b1b 0%, #1a1717 100%);
}

.at-card-warm::before {
  width: 132px;
  height: 132px;
  left: -34px;
  top: -52px;
  background: rgba(255, 113, 113, 0.14);
  filter: blur(22px);
}

.at-card-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #5d1111;
  background: #f25e5e;
}

.at-card-icon svg {
  width: 13px;
  height: 13px;
}

.at-green {
  color: #18e54e;
  text-shadow: 0 0 14px rgba(24, 229, 78, 0.24);
}

.at-red {
  color: #ff4747;
  text-shadow: 0 0 14px rgba(255, 71, 71, 0.24);
}

.at-bottom-bar {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  width: 134px;
  height: 5px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: #fff;
}

@media (max-width: 360px) {
  .at-avatar {
    margin-top: max(78px, calc(env(safe-area-inset-top) + 62px));
    margin-bottom: 36px;
  }

  .at-actions {
    width: min(302px, calc(100vw - 36px));
    grid-template-rows: 104px 104px 108px 108px;
  }

  .at-card span:not(.at-card-icon) {
    font-size: 14px;
  }
}

/* ── Терминальный график на реальных свечах ──────────── */
.detail-screen.chart-screen {
  z-index: 42;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -120px, rgba(255, 221, 45, 0.36) 0 150px, transparent 245px),
    #000;
  color: #fff;
}

.chart-header {
  position: relative;
  z-index: 4;
  height: 96px;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  padding: max(48px, calc(env(safe-area-inset-top) + 34px)) 16px 0 8px;
  gap: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0));
}

.chart-close {
  width: 32px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #fff;
}

.chart-close svg {
  width: 24px;
  height: 24px;
}

.chart-symbol {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 6px;
  border: 0;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
}

.chart-symbol-logo {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #111315;
  background: var(--accent);
  font-size: 14px;
  font-weight: 820;
}

.chart-symbol strong {
  font-size: 13px;
  font-weight: 720;
  line-height: 1;
}

.chart-symbol svg {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}

.chart-mode {
  width: 114px;
  height: 36px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 64px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.chart-mode button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 30px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
}

.chart-mode button.is-active {
  background: #fff;
  color: #333;
}

.chart-mode svg {
  width: 19px;
  height: 19px;
}

.chart-info {
  position: absolute;
  z-index: 5;
  left: 8px;
  top: max(135px, calc(env(safe-area-inset-top) + 121px));
  width: 142px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: #fff;
  font-size: 12px;
  line-height: 1.1;
}

.chart-info[hidden] {
  display: none;
}

.chart-info div {
  display: flex;
  gap: 4px;
}

.chart-info .chart-change {
  width: 100%;
  display: block;
  color: #00d635;
}

.chart-info .chart-change.is-down {
  color: #ff4d4d;
}

.chart-info span {
  width: 10px;
  color: #9299a2;
}

.chart-info strong {
  color: #fff;
  font-weight: 500;
}

.chart-stage {
  position: absolute;
  inset: 96px 0 147px;
  z-index: 1;
}

.chart-stage[hidden],
.book-stage[hidden],
.news-stage[hidden] {
  display: none;
}

#chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-price-badge {
  position: absolute;
  right: 2px;
  min-width: 63px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid #000;
  border-radius: 100px;
  background: rgba(0, 185, 45, 0.32);
  color: #00d635;
  font-size: 13px;
  line-height: 1;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chart-bottom {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 34px;
  padding: 0 16px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), #000 28px);
}

.chart-bottom.is-hidden {
  display: none;
}

.chart-account {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-bottom: 10px;
}

.chart-more,
.chart-tf {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.chart-more {
  font-size: 20px;
  letter-spacing: 1px;
  line-height: 1;
}

.chart-account-pill {
  min-width: 0;
  flex: 1;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 300px;
  background: #1c1c1e;
}

.chart-account-pill strong {
  font-size: 12px;
  line-height: 1.1;
}

.chart-account-pill span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  line-height: 1.1;
}

.chart-account-pill b {
  color: #00d635;
  font-weight: 500;
}

.chart-trade-row {
  display: grid;
  grid-template-columns: 1fr 88px 1fr;
  gap: 8px;
  align-items: center;
}

.chart-trade,
.chart-qty {
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 300px;
  background: transparent;
  color: #fff;
}

.chart-trade {
  font-size: 11px;
  line-height: 1.08;
}

.chart-buy {
  color: #00d635;
}

.chart-sell {
  color: #ff4d4d;
}

.chart-qty {
  height: 44px;
  font-size: 15px;
  font-weight: 700;
}

.chart-home {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  width: 133px;
  height: 5px;
  border-radius: 100px;
  transform: translateX(-50%);
  background: #fff;
}

.book-stage {
  position: absolute;
  z-index: 2;
  inset: 108px 0 147px;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.book-head {
  display: grid;
  grid-template-columns: 1fr 96px 1fr;
  align-items: center;
  padding: 0 16px;
  margin-bottom: 10px;
  color: #fff;
  font-size: 13px;
}

.book-head span:nth-child(2) {
  color: #fff;
  text-align: center;
}

.book-buy {
  color: #00d635;
}

.book-sell {
  color: #ff4d4d;
  text-align: right;
}

.book-ladder {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.book-row {
  position: relative;
  height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
  align-items: center;
  color: #fff;
  font-size: 15px;
}

.book-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 64px);
  border-radius: 7px;
  opacity: 0.44;
  transform: scaleX(var(--book-pct, 0));
}

.book-row.is-bid .book-bar {
  left: 16px;
  background: #00d635;
  transform-origin: left center;
}

.book-row.is-ask .book-bar {
  right: 16px;
  background: #ff4d4d;
  transform-origin: right center;
}

.book-qty,
.book-price,
.book-spacer {
  position: relative;
  z-index: 1;
}

.book-row.is-bid .book-qty {
  grid-column: 1;
  color: #00d635;
  padding-left: 26px;
}

.book-row.is-ask .book-qty {
  grid-column: 3;
  color: #ff4d4d;
  padding-right: 26px;
  text-align: right;
}

.book-price {
  grid-column: 2;
  grid-row: 1;
  color: #fff;
  text-align: center;
}

.book-row.is-bid .book-spacer {
  grid-column: 3;
}

.book-row.is-ask .book-spacer {
  grid-column: 1;
}

.book-mid {
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
}

.book-mid span {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.book-loading {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.news-stage {
  position: absolute;
  z-index: 2;
  inset: 110px 20px 42px;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.news-tabs {
  height: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 4px;
  margin-bottom: 28px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.news-tabs button {
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 720;
}

.news-tabs button.is-active {
  background: #fff;
  color: #333;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.news-item h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 17px;
  font-weight: 520;
  line-height: 1.22;
  letter-spacing: 0;
}

.news-item p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1.2;
}

/* ── Экран-деталь: календарь выплат (оверлей) ─────────── */
.detail-screen {
  position: fixed;
  inset: 0;
  z-index: 15; /* ниже таб-бара (20) — табы остаются кликабельны */
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #E9E6F6 0%, #F3F1FA 22%, #F7F7F9 50%);
  animation: tab-screen-fade 110ms ease-out both;
}

.detail-screen[hidden] { display: none; }

/* Пока открыт календарь — прячем пилюлю баланса, чтобы не перекрывала «назад» */
.app-shell.calendar-open .total-balance,
.app-shell.overlay-open .total-balance { display: none; }

@keyframes tab-screen-fade {
  from { opacity: 0.88; }
  to { opacity: 1; }
}

.ds-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(52px, calc(env(safe-area-inset-top) + 38px)) 16px 10px;
}

.ds-back {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 14px rgba(60, 50, 90, 0.08);
  color: var(--ink);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: transform 140ms ease;
}

.ds-back:active { transform: scale(0.92); }
.ds-back svg { width: 22px; height: 22px; }

.ds-title {
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: 0;
}

.ds-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 8px 16px calc(118px + env(safe-area-inset-bottom));
}

.ds-body::-webkit-scrollbar { display: none; }

/* Сводка над календарём */
.cal-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.cal-sum-card {
  flex: 1;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 19, 21, 0.05);
}

.cal-sum-card strong {
  display: block;
  font-size: 20px;
  font-weight: 780;
  line-height: 1.1;
}

.cal-sum-card.is-income strong { color: #18C964; }

.cal-sum-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* Календарь */
.cal-card {
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 19, 21, 0.05);
  box-shadow: 0 8px 28px rgba(60, 50, 90, 0.05);
}

.cal-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-month h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 740;
  text-transform: capitalize;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-weekdays {
  margin-bottom: 6px;
}

.cal-weekdays span {
  text-align: center;
  color: rgba(17, 19, 21, 0.4);
  font-size: 12px;
  font-weight: 600;
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.cal-day.is-empty { background: transparent; }

.cal-day.is-weekend { color: rgba(17, 19, 21, 0.35); }

.cal-day.is-today {
  outline: 2px solid rgba(17, 19, 21, 0.18);
}

.cal-day.has-pay {
  background: rgba(24, 201, 100, 0.12);
  color: #0E8F46;
  font-weight: 760;
}

.cal-day .cal-dot {
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #18C964;
}

/* Список выплат месяца */
.cal-list-title {
  margin: 22px 4px 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.cal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 19, 21, 0.05);
}

.cal-item-date {
  flex: 0 0 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.cal-item-date b { font-size: 18px; font-weight: 800; }
.cal-item-date small { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; }

.cal-item-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.cal-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-item-copy strong {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-item-copy span {
  font-size: 12px;
  color: var(--muted);
}

.cal-item-amount {
  color: #18C964;
  font-size: 15px;
  font-weight: 760;
  white-space: nowrap;
}

/* ── Экран деталей бумаги ─────────────────────────────── */
.instr-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0 24px;
}

.instr-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.instr-name { font-size: 22px; font-weight: 760; text-align: center; letter-spacing: 0; }
.instr-ticker { font-size: 14px; font-weight: 600; color: var(--muted); }
.instr-price { font-size: 34px; font-weight: 800; letter-spacing: 0; margin-top: 6px; }

.instr-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 18px;
  background: rgba(17, 19, 21, 0.05);
}

.instr-qty-btn {
  width: 52px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 26px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(60, 50, 90, 0.08);
  cursor: pointer;
}

.instr-qty-btn:active { transform: scale(0.94); }
.instr-qty-val { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.instr-qty-val b { font-size: 20px; font-weight: 780; }
.instr-qty-val span { font-size: 12px; color: var(--muted); }

.instr-total { text-align: center; color: var(--muted); font-size: 15px; font-weight: 600; margin-top: 12px; min-height: 20px; }

.instr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.instr-buy, .instr-sell {
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 740;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.instr-buy { background: #18C964; color: #fff; }
.instr-sell { background: rgba(17, 19, 21, 0.06); color: var(--ink); }
.instr-buy:active, .instr-sell:active { transform: scale(0.98); filter: brightness(0.97); }

.instr-status { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0 0; line-height: 1.4; }
.instr-status.is-ok { color: #0E8F46; font-weight: 600; }
.instr-status.is-err { color: #D23B3B; font-weight: 600; }

/* ── Экран «Мой портфель» ─────────────────────────────── */
.pf-loading { color: var(--muted); font-size: 15px; text-align: center; padding: 32px 16px; }

.pf-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 4px 18px;
}
.pf-total span { color: var(--muted); font-size: 14px; font-weight: 500; }
.pf-total strong { font-size: 24px; font-weight: 800; letter-spacing: 0; }

.pf-group { margin-bottom: 22px; }
.pf-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}
.pf-group-head h3 { margin: 0; font-size: 17px; font-weight: 740; }
.pf-group-head span { color: var(--muted); font-size: 14px; font-weight: 600; }

.pf-list {
  background: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.pf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.pf-row + .pf-row { border-top: 1px solid rgba(17, 19, 21, 0.06); }
.pf-row:active { opacity: 0.6; }

.pf-row-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.pf-row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-row-copy strong { font-size: 16px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row-copy span { font-size: 13px; color: var(--muted); }
.pf-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pf-row-right b { font-size: 16px; font-weight: 640; white-space: nowrap; }
.pf-row-right span { font-size: 13px; font-weight: 600; }

/* ── Экран поиска ─────────────────────────────────────── */
.ds-header-search { gap: 10px; }

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(17, 19, 21, 0.06);
}
.search-ic { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--ink);
}

.sr-shelf { margin-bottom: 22px; }
.sr-shelf-title { margin: 0 0 12px; font-size: 18px; font-weight: 760; }
.sr-shelf-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 2px 16px 4px;
}
.sr-shelf-row::-webkit-scrollbar { display: none; }

.sr-card {
  flex: 0 0 auto;
  width: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  text-align: center;
}
.sr-card:active { transform: scale(0.96); }
.sr-card-logo {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 800;
  margin-bottom: 2px;
}
.sr-card-ticker { font-size: 14px; font-weight: 740; }
.sr-card-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.sr-list { display: flex; flex-direction: column; }
.sr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 2px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.sr-row + .sr-row { border-top: 1px solid rgba(17, 19, 21, 0.06); }
.sr-row:active { opacity: 0.6; }
.sr-row-logo {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.sr-row-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sr-row-copy strong { font-size: 16px; font-weight: 620; }
.sr-row-copy span { font-size: 13px; color: var(--muted); text-transform: capitalize; }

/* Кнопка «Смотреть все облигации» */
.pb-seeall {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 16px;
  background: rgba(17, 19, 21, 0.06);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}
.pb-seeall:active { transform: scale(0.99); background: rgba(17, 19, 21, 0.1); }

/* Чипы на экране всех облигаций */
.bonds-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 16px 12px;
}
.bonds-chips::-webkit-scrollbar { display: none; }

/* ── Root-экран «Все счета» (тёмный модал) ───────────── */
.total-balance { cursor: pointer; }

.account-screen {
  background: radial-gradient(120% 70% at 50% 0%, #1b2030 0%, #050608 60%);
}

.acc-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(52px, calc(env(safe-area-inset-top) + 38px)) 16px 6px;
}

.acc-close {
  position: absolute;
  left: 16px;
  top: max(48px, calc(env(safe-area-inset-top) + 34px));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}
.acc-close:active { transform: scale(0.92); }
.acc-close svg { width: 20px; height: 20px; }

.acc-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffe76b 0%, #ffdd2d 100%);
  color: #161616;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(74, 130, 255, 0.9);
}

.acc-body { text-align: center; }

.acc-label { margin: 14px 0 6px; color: #fff; font-size: 17px; font-weight: 700; }
.acc-total { margin: 0; color: #fff; font-size: 52px; font-weight: 800; letter-spacing: 0; line-height: 1; }
.acc-growth { margin: 12px 0 0; color: #2DD36F; font-size: 17px; font-weight: 700; }

.acc-actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 28px 0 8px;
}
.acc-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font: inherit;
  cursor: pointer;
}
.acc-act-ic {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.acc-act-ic svg { width: 26px; height: 26px; }
.acc-act small { font-size: 13px; font-weight: 500; }
.acc-act:active .acc-act-ic { transform: scale(0.94); }

.acc-section {
  margin: 28px 0 12px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.account-screen .ph-promo {
  margin: 0 auto 4px;
  padding: 10px 12px 16px;
  border-radius: 30px;
  background: rgba(247, 247, 249, 0.96);
}
.account-screen .ph-promo p {
  background-image:
    linear-gradient(105deg, transparent 39%, rgba(178, 136, 255, 1) 50%, transparent 61%),
    linear-gradient(0deg, #17131f, #17131f);
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: promo-shine 6s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}
.account-screen .ph-dots { justify-content: center; }
.account-screen .ph-dots span { background: rgba(44, 43, 49, 0.16); }
.account-screen .ph-dots span.is-active { background: rgba(44, 43, 49, 0.42); }

.acc-list { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}
.acc-row-copy { display: flex; flex-direction: column; gap: 2px; }
.acc-row-copy strong { color: #fff; font-size: 18px; font-weight: 760; }
.acc-row-copy span { color: rgba(255, 255, 255, 0.45); font-size: 13px; font-weight: 500; }
.acc-row-pct { font-size: 15px; font-weight: 700; }

/* ── Дуо-блок в шапке вкладки: баланс счёта + профит ──── */
.hero-duo {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
}

.hd-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hd-right { align-items: flex-end; text-align: right; }

.hd-tap {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  align-items: flex-start;
  cursor: pointer;
}
.hd-tap:active { opacity: 0.6; }

.hd-num {
  font-size: 35px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  white-space: nowrap;
}

.hd-green {
  color: #18C964;
  text-shadow: 0 0 18px rgba(24, 201, 100, 0.3);
}

.hd-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* Трейдинг — тёмная тема */
.trading-hero .hd-num { color: #fff; }
.trading-hero .hd-num.hd-green { color: #2DD36F; }
.trading-hero .hd-label { color: rgba(255, 255, 255, 0.5); }

@media (max-width: 360px) {
  .hd-num { font-size: 30px; }
}

/* ── Payouts: Figma node 822:47539 ───────────────────── */
.app-shell[data-active-screen="payouts"] {
  background: #f5f5f5;
}

.app-shell[data-active-screen="payouts"] .total-balance {
  top: calc(env(safe-area-inset-top) + 62px);
  left: 50%;
  width: 154px;
  min-height: 44px;
  transform: translateX(-50%);
  gap: 8px;
  padding: 2px 12px 2px 3px;
  border: 0;
  border-radius: 296px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.app-shell[data-active-screen="payouts"] .tb-avatar {
  width: 40px;
  height: 40px;
  background: url("/assets/figma-account-avatar.png") center / cover no-repeat;
  box-shadow: none;
}

.app-shell[data-active-screen="payouts"] .tb-avatar-inner {
  opacity: 0;
}

.app-shell[data-active-screen="payouts"] .tb-copy {
  min-width: 0;
}

.app-shell[data-active-screen="payouts"] .tb-amount {
  overflow: hidden;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell[data-active-screen="payouts"] .tb-label {
  color: rgba(12, 12, 12, 0.66);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}

#screen-payouts {
  align-items: center;
  gap: 0;
  padding-bottom: 0;
  background: #f5f5f5;
}

.payouts-figma {
  position: relative;
  width: min(100%, 375px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: #f5f5f5;
}

#screen-payouts .payouts-hero {
  position: relative;
  z-index: 0;
  height: 446px;
  margin: 0;
  padding: 0;
  display: block;
  overflow: visible;
  background: #f5f5f5;
}

#screen-payouts .payouts-hero::before {
  content: "";
  position: absolute;
  inset: -24px 0 auto 0;
  height: 470px;
  border-radius: 0 0 32px 32px;
  background: #f5f5f5;
}

#screen-payouts .payouts-hero::after {
  content: "";
  position: absolute;
  top: -134px;
  left: 0;
  width: 100%;
  height: 439px;
  opacity: 0.3;
  filter: blur(100px);
  pointer-events: none;
  background: linear-gradient(148deg, #490cb9 0%, rgba(77, 124, 223, 0) 100%);
}

.payouts-hero-duo {
  position: absolute;
  z-index: 1;
  top: 143px;
  left: 38px;
  width: 304px;
  margin: 0;
  gap: 52px;
}

.payouts-hero-duo .hd-col {
  width: 128px;
  gap: 1px;
}

.payouts-hero-duo .hd-right {
  width: 124px;
}

.payouts-hero-duo .hd-num {
  font-size: 34.6px;
  font-weight: 700;
  line-height: 41px;
  letter-spacing: 0;
}

.payouts-hero-duo .hd-green {
  color: #03ac28;
  letter-spacing: 0.67px;
  text-shadow: none;
}

.payouts-hero-duo .hd-label {
  color: rgba(12, 12, 12, 0.66);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: 0;
}

.payout-calendar-card {
  position: absolute;
  z-index: 1;
  top: 232px;
  left: 18px;
  width: calc(100% - 34px);
  height: 78px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #000;
  text-align: left;
  cursor: pointer;
}

.payout-calendar-title {
  position: absolute;
  top: 29px;
  left: 0;
  width: 100%;
  color: #000;
  font-size: 16px;
  font-weight: 700;
  line-height: 19px;
  letter-spacing: 0;
  text-align: center;
}

.payout-calendar-title::after {
  content: none;
}

.payout-date-card,
.payout-next-copy,
.payout-next-logo {
  display: none;
}

.payout-date-card {
  position: absolute;
  left: 12px;
  top: 42px;
  width: 45px;
  height: 44px;
  display: grid;
  place-items: center;
  padding-top: 3px;
  border-radius: 13px;
  background: rgba(0, 16, 36, 0.06);
}

.payout-date-card strong,
.payout-date-card span {
  display: block;
  line-height: 1;
}

.payout-date-card strong {
  color: #000;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.payout-date-card span {
  color: rgba(12, 12, 12, 0.66);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: 0;
}

.payout-next-copy {
  position: absolute;
  top: 47px;
  left: 71px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: calc(100% - 158px);
}

.payout-next-copy strong {
  overflow: hidden;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-next-copy span {
  color: rgba(12, 12, 12, 0.66);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: 0;
}

.payout-next-logo {
  position: absolute;
  top: 43px;
  right: 15px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #22a647;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.payout-assistant {
  position: absolute;
  z-index: 1;
  top: 349px;
  left: 52px;
  width: 286px;
  min-height: 61px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.payout-assistant-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.payout-assistant-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.payout-assistant p {
  margin: 1px 0 0;
  max-width: 253px;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
  color: #8614d8;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.payout-assistant-dots {
  position: absolute;
  left: 131px;
  top: 56px;
  width: 39px;
  height: 5px;
  display: flex;
  gap: 4px;
}

.payout-assistant-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(44, 43, 49, 0.16);
}

.payout-assistant-dots span:first-child {
  width: 17px;
  border-radius: 999px;
  background: rgba(44, 43, 49, 0.42);
  animation: payout-dot-breathe 4.8s ease-in-out infinite;
}

@keyframes payout-dot-breathe {
  0%, 100% { opacity: 0.42; }
  18% { opacity: 0.78; }
  36% { opacity: 0.42; }
}

#screen-payouts .payouts-body {
  position: relative;
  z-index: 2;
  margin-top: -90px;
  padding: 80px 16px 150px;
  gap: 15px;
}

#screen-payouts .payout-date-card,
#screen-payouts .payout-next-copy,
#screen-payouts .payout-next-logo {
  display: none;
}

#screen-payouts .pb-chips {
  height: 46px;
  margin: 0 -16px;
  padding: 8px 16px;
  gap: 8px;
}

#screen-payouts .pb-chip {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 30px;
  background: rgba(0, 16, 36, 0.03);
  color: #333;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0;
}

#screen-payouts .pb-chip.is-active {
  background: #428bf9;
  color: #fff;
}

#screen-payouts .pb-cards {
  grid-template-columns: repeat(2, minmax(0, 164px));
  justify-content: center;
  gap: 15px 17px;
}

#screen-payouts .pb-card {
  width: 164px;
  height: 215px;
  padding: 6px;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#screen-payouts .pb-card-top {
  min-height: 113px;
  border-radius: 14px;
  background: #f2f3f5;
}

#screen-payouts .pb-badge {
  top: 7px;
  left: 9px;
  padding: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: 800;
  line-height: 14px;
}

#screen-payouts .pb-heart {
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  color: rgba(0, 0, 0, 0.22);
}

#screen-payouts .pb-heart svg {
  width: 20px;
  height: 20px;
}

#screen-payouts .pb-logo {
  width: 77px;
  height: 77px;
  font-size: 23px;
}

#screen-payouts .pb-card-body {
  padding: 8px 6px 0;
  gap: 0;
}

#screen-payouts .pb-income {
  color: #00ce59;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
}

#screen-payouts .pb-name {
  margin-top: 1px;
  color: #333;
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
}

#screen-payouts .pb-add {
  width: 140px;
  min-height: 30px;
  height: 30px;
  margin: 11px auto 0;
  border-radius: 100px;
  background: #000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0;
}

#screen-payouts .pb-seeall {
  min-height: 44px;
  margin-top: 2px;
  border-radius: 18px;
  font-size: 14px;
}

#screen-payouts .pb-cats {
  margin-top: 0;
}

@media (max-width: 374px) {
  .payouts-hero-duo {
    left: 28px;
    width: calc(100% - 56px);
    gap: 24px;
  }

  .payout-assistant {
    left: 28px;
    width: calc(100% - 56px);
  }

  #screen-payouts .pb-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }

  #screen-payouts .pb-card {
    width: 100%;
  }
}

/* ── Assets + Trading top structure aligned to Payouts ─ */
.app-shell[data-active-screen="portfolio"] .total-balance,
.app-shell[data-active-screen="trading"] .total-balance {
  top: calc(env(safe-area-inset-top) + 62px);
  left: 50%;
  width: 154px;
  min-height: 44px;
  transform: translateX(-50%);
  gap: 8px;
  padding: 2px 12px 2px 3px;
  border-radius: 296px;
  box-shadow: none;
}

.app-shell[data-active-screen="portfolio"] .total-balance {
  border: 0;
  background: rgba(255, 255, 255, 0.9);
}

.app-shell[data-active-screen="trading"] .total-balance {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(28, 28, 30, 0.82);
}

.app-shell[data-active-screen="portfolio"] .tb-avatar,
.app-shell[data-active-screen="trading"] .tb-avatar {
  width: 40px;
  height: 40px;
  background: url("/assets/figma-account-avatar.png") center / cover no-repeat;
  box-shadow: none;
}

.app-shell[data-active-screen="portfolio"] .tb-avatar-inner,
.app-shell[data-active-screen="trading"] .tb-avatar-inner {
  opacity: 0;
}

.app-shell[data-active-screen="portfolio"] .tb-amount,
.app-shell[data-active-screen="trading"] .tb-amount {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell[data-active-screen="portfolio"] .tb-label,
.app-shell[data-active-screen="trading"] .tb-label {
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}

#screen-portfolio,
#screen-trading {
  align-items: center;
  gap: 0;
  padding-bottom: 0;
}

#screen-portfolio .assets-hero,
#screen-trading .trading-hero {
  z-index: 3;
}

#screen-portfolio .assets-hero {
  position: relative;
  width: min(100%, 375px);
  height: 446px;
  margin: 0 auto;
  padding: 0;
  display: block;
  overflow: visible;
}

#screen-trading .trading-hero {
  position: relative;
  width: min(100%, 375px);
  height: 446px;
  margin: 0 auto;
  padding: 0;
  display: block;
  overflow: visible;
}

#screen-portfolio .assets-hero::after,
#screen-trading .trading-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#screen-trading .trading-hero::before {
  content: "438 000 ₽ с маржиналкой";
  position: absolute;
  z-index: 2;
  top: 239px;
  left: 77px;
  width: 221px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 700;
  line-height: 13px;
}

#screen-portfolio .assets-hero::after {
  top: -134px;
  left: 0;
  width: 100%;
  height: 439px;
  opacity: 0.22;
  filter: blur(100px);
  background: linear-gradient(148deg, #490cb9 0%, rgba(77, 124, 223, 0) 100%);
}

#screen-trading .trading-hero::after {
  top: -120px;
  left: 0;
  width: 100%;
  height: 430px;
  opacity: 0.38;
  filter: blur(92px);
  background:
    radial-gradient(circle at 72% 18%, rgba(20, 143, 65, 0.9), transparent 44%),
    radial-gradient(circle at 15% 72%, rgba(134, 33, 42, 0.72), transparent 48%);
}

.assets-hero .surface-hero-duo,
.trading-hero .surface-hero-duo {
  position: absolute;
  z-index: 1;
  top: 143px;
  left: 38px;
  width: 304px;
  margin: 0;
  gap: 52px;
}

.assets-hero .surface-hero-duo .hd-col,
.trading-hero .surface-hero-duo .hd-col {
  width: 128px;
  gap: 1px;
}

.assets-hero .surface-hero-duo .hd-right,
.trading-hero .surface-hero-duo .hd-right {
  width: 124px;
}

.assets-hero .surface-hero-duo .hd-num,
.trading-hero .surface-hero-duo .hd-num {
  font-size: 34.6px;
  font-weight: 700;
  line-height: 41px;
  letter-spacing: 0;
}

.assets-hero .surface-hero-duo .hd-green {
  color: #03ac28;
  text-shadow: none;
}

.assets-hero .surface-hero-duo .hd-label {
  color: rgba(12, 12, 12, 0.66);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
}

.trading-hero .surface-hero-duo .hd-num {
  color: #fff;
}

.trading-hero .surface-hero-duo .hd-green {
  color: #2dd36f;
  text-shadow: none;
}

.trading-hero .surface-hero-duo .hd-label {
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
}

.portfolio-card-row {
  position: absolute;
  z-index: 1;
  top: 234px;
  left: 18px;
  width: calc(100% - 34px);
  height: 98px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#screen-portfolio .portfolio-card-row {
  top: 231px;
  left: 19px;
  width: calc(100% - 36px);
  height: 78px;
  display: block;
}

#screen-portfolio .portfolio-card-row .portfolio-mini-card:first-child {
  width: 100%;
  height: 78px;
  padding: 19px 16px 18px 71px;
  justify-content: start;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  background: #fff;
}

#screen-portfolio .portfolio-card-row .portfolio-mini-card:first-child::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 17px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e6e6e6;
}

#screen-portfolio .portfolio-card-row .portfolio-mini-card:first-child span {
  color: #000;
  font-size: 16px;
  font-weight: 700;
  line-height: 18px;
}

#screen-portfolio .portfolio-card-row .portfolio-mini-card:first-child strong {
  display: none;
}

#screen-portfolio .portfolio-card-row .portfolio-mini-card:first-child small {
  color: #000;
  font-size: 15px;
  font-weight: 400;
  line-height: 18px;
}

#screen-portfolio .portfolio-card-row .portfolio-mini-card:nth-child(2) {
  display: none;
}

.portfolio-mini-card {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #000;
  text-align: left;
  box-shadow: none;
}

button.portfolio-mini-card {
  cursor: pointer;
}

.portfolio-mini-card span,
.portfolio-mini-card small {
  overflow: hidden;
  color: rgba(12, 12, 12, 0.66);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-mini-card strong {
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trading-portfolio-cards .portfolio-mini-card {
  background: #1c1c1e;
  color: #fff;
}

#screen-trading .trading-portfolio-cards {
  display: none;
}

.trading-portfolio-cards .portfolio-mini-card span,
.trading-portfolio-cards .portfolio-mini-card small {
  color: rgba(255, 255, 255, 0.56);
}

.assets-hero .surface-advice,
.trading-hero .surface-advice {
  position: absolute;
  z-index: 1;
  top: 369px;
  left: 42px;
  width: 306px;
  min-height: 61px;
  margin: 0;
}

.assets-hero .surface-advice {
  color: #17131f;
}

#screen-portfolio .surface-advice {
  top: 349px;
  left: 56px;
  width: 286px;
}

.trading-hero .surface-advice {
  z-index: 5;
  top: 601px;
  left: 49px;
  width: 286px;
  padding: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.assets-hero .ph-dots,
.trading-hero .ph-dots {
  position: absolute;
  z-index: 1;
  top: 425px;
  left: 173px;
  margin: 0;
}

#screen-portfolio .ph-dots {
  top: 398px;
  left: 169px;
}

.trading-hero .ph-dots span {
  background: rgba(255, 255, 255, 0.24);
}

.trading-hero .ph-dots span.is-active {
  background: rgba(255, 255, 255, 0.7);
}

#screen-trading .ph-dots {
  z-index: 5;
  top: 650px;
  left: 162px;
}

#screen-portfolio .assets-body,
#screen-trading .trading-body {
  position: relative;
  z-index: 2;
  width: min(100%, 375px);
  margin: -70px auto 0;
  padding: 80px 16px 150px;
}

#screen-portfolio .assets-body {
  margin-top: -90px;
}

#screen-trading .tr-cards {
  margin-top: 0;
}

#screen-trading .trading-body {
  margin-top: -232px;
}

#screen-trading .tr-market {
  margin-top: 132px;
}

@media (max-width: 374px) {
  .assets-hero .surface-hero-duo,
  .trading-hero .surface-hero-duo {
    left: 28px;
    width: calc(100% - 56px);
    gap: 24px;
  }

  .assets-hero .surface-advice,
  .trading-hero .surface-advice {
    left: 28px;
    width: calc(100% - 56px);
  }
}

.utility-tab.is-active {
  color: var(--ink);
  background: #fff;
}

.utility-tab.is-active span {
  font-weight: 760;
}

.app-shell[data-active-screen="pulse"] {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 221, 45, 0.34), transparent 28%),
    radial-gradient(circle at 92% 20%, rgba(20, 126, 251, 0.18), transparent 30%),
    linear-gradient(180deg, #f5f7f4 0%, #eef3f0 46%, #f7f7f4 100%);
}

.app-shell[data-active-screen="pulse"] .app-frame {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.app-shell[data-active-screen="pulse"] .total-balance {
  display: none;
}

#screen-pulse {
  gap: 14px;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(106px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.pulse-filters {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(17, 19, 21, 0.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}

.pulse-filters button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 15px;
  color: rgba(17, 19, 21, 0.58);
  background: transparent;
  font-size: 13px;
  font-weight: 720;
}

.pulse-filters button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 6px 16px rgba(42, 48, 54, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pulse-feed {
  display: grid;
  gap: 10px;
}

.pulse-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(17, 19, 21, 0.06);
  box-shadow: 0 10px 28px rgba(40, 46, 52, 0.07);
}

.pulse-card.is-news {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 255, 0.86));
}

.pulse-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #161616;
  background: linear-gradient(180deg, #ffea78 0%, #ffdd2d 100%);
  font-size: 16px;
  font-weight: 820;
}

.pulse-card.is-news .pulse-avatar {
  color: #fff;
  background: linear-gradient(180deg, #1677ff 0%, #0d54c7 100%);
}

.pulse-card-body {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.pulse-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: rgba(17, 19, 21, 0.48);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.pulse-type,
.pulse-hot,
.pulse-ticker {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  line-height: 1;
}

.pulse-type {
  color: #161616;
  background: rgba(255, 221, 45, 0.42);
}

.pulse-card.is-news .pulse-type {
  color: #0d54c7;
  background: rgba(22, 119, 255, 0.12);
}

.pulse-hot {
  color: #b02b18;
  background: rgba(255, 89, 64, 0.12);
}

.pulse-ticker {
  color: #0d7d3b;
  background: rgba(45, 211, 111, 0.12);
}

.pulse-meta time {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.18;
}

.pulse-card p {
  margin: 0;
  color: rgba(17, 19, 21, 0.72);
  font-size: 14px;
  font-weight: 430;
  line-height: 1.34;
}

.pulse-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(17, 19, 21, 0.06);
}

.pulse-byline {
  overflow: hidden;
  color: rgba(17, 19, 21, 0.48);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(17, 19, 21, 0.46);
  font-size: 12px;
  font-weight: 650;
}

.pulse-link {
  justify-self: start;
  color: #0d54c7;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
}

@media (max-width: 370px) {
  .pulse-card {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px;
    border-radius: 22px;
  }

  .pulse-avatar {
    width: 38px;
    height: 38px;
  }

  .pulse-card h2 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
