/* Dedicated shell for the Friday Funded Rush Telegram Mini App. */
html.rush-miniapp-mode,
html.rush-miniapp-mode body {
  min-height: 100%;
  background: #08090b !important;
}

body.rush-miniapp-mode {
  --rush-standalone-ink: #08090b;
  --rush-standalone-surface: #121419;
  --rush-standalone-line: rgba(255, 255, 255, 0.1);
  --rush-standalone-muted: #9da1aa;
  background: var(--rush-standalone-ink) !important;
}

body.rush-miniapp-mode .app-shell {
  width: min(900px, calc(100% - 24px)) !important;
  min-height: 100dvh;
  padding: 10px 0 calc(102px + env(safe-area-inset-bottom, 0px)) !important;
  background: var(--rush-standalone-ink) !important;
}

body.rush-miniapp-mode .topbar {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 58px !important;
  margin: 0 0 14px !important;
  padding: 9px 0 12px !important;
  overflow: visible !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rush-standalone-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.rush-miniapp-mode .topbar::before,
body.rush-miniapp-mode .topbar .brand-award,
body.rush-miniapp-mode .topbar .language-switch,
body.rush-miniapp-mode .topbar .support-launch-button {
  display: none !important;
}

body.rush-miniapp-mode .topbar .brand-lockup {
  display: block !important;
  grid-column: auto !important;
  min-width: 0 !important;
}

html.miniapp-dashboard body.rush-miniapp-mode .topbar .brand-logo,
body.rush-miniapp-mode .topbar .brand-logo {
  display: block !important;
  width: 112px !important;
  max-width: 112px !important;
  height: 36px !important;
  max-height: 36px !important;
  object-fit: contain !important;
  object-position: left center !important;
  filter: none !important;
}

body.rush-miniapp-mode .topbar .topbar-tools {
  grid-column: auto !important;
  justify-self: end !important;
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.rush-miniapp-mode .topbar .user-menu {
  display: flex !important;
  min-width: 0 !important;
}

body.rush-miniapp-mode .topbar .user-menu-trigger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: min(208px, 54vw) !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 4px 9px 4px 5px !important;
  overflow: hidden !important;
  border: 1px solid var(--rush-standalone-line) !important;
  border-radius: 8px !important;
  background: var(--rush-standalone-surface) !important;
  box-shadow: none !important;
}

body.rush-miniapp-mode .topbar .user-avatar {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 50% !important;
}

body.rush-miniapp-mode .topbar .user-menu-trigger-copy {
  display: grid !important;
  min-width: 0 !important;
  gap: 1px !important;
  text-align: left !important;
}

body.rush-miniapp-mode .topbar .user-menu-trigger-copy strong,
body.rush-miniapp-mode .topbar .user-menu-trigger-copy span {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.rush-miniapp-mode .topbar .user-menu-trigger-copy strong {
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 760 !important;
  line-height: 1.15 !important;
}

body.rush-miniapp-mode .topbar .user-menu-trigger-copy span {
  color: var(--rush-standalone-muted) !important;
  font-size: 10px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
}

body.rush-miniapp-mode .topbar .user-menu-popover {
  z-index: 200 !important;
}

body.rush-miniapp-mode .content-shell {
  display: block !important;
  min-height: 0;
  padding: 0 !important;
}

body.rush-miniapp-mode .view-section[data-view]:not([data-view="rush"]):not([data-view="accounts"]) {
  display: none !important;
}

body.rush-miniapp-mode .rush-view,
body.rush-miniapp-mode .accounts-view {
  min-height: calc(100dvh - 174px);
}

body.rush-miniapp-mode .rush-page-shell {
  width: min(100%, 900px) !important;
  padding-bottom: 28px !important;
}

body.rush-miniapp-mode .accounts-view {
  padding: 2px 0 22px !important;
}

body.rush-miniapp-mode .accounts-view .accounts-page-head,
body.rush-miniapp-mode .accounts-view .accounts-add-button,
body.rush-miniapp-mode .accounts-view .account-overview-strip:not(.rush-wallet-overview) {
  display: none !important;
}

body.rush-miniapp-mode .accounts-view .section-block {
  margin: 0 !important;
}

body.rush-miniapp-mode .accounts-view .account-grid {
  display: block !important;
}

body.rush-miniapp-mode .bottom-nav {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 90 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: 56px !important;
  gap: 4px !important;
  width: min(460px, calc(100% - 20px)) !important;
  height: auto !important;
  min-height: 68px !important;
  padding: 6px !important;
  overflow: hidden !important;
  border: 1px solid var(--rush-standalone-line) !important;
  border-radius: 8px !important;
  background: rgba(14, 16, 20, 0.97) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4) !important;
  -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
  backdrop-filter: blur(18px) saturate(125%) !important;
  transform: translateX(-50%) !important;
}

body.rush-miniapp-mode .bottom-nav .nav-button:not([data-tab="rush"]):not([data-tab="accounts"]) {
  display: none !important;
}

body.rush-miniapp-mode .bottom-nav .nav-button[data-tab="rush"],
body.rush-miniapp-mode .bottom-nav .nav-button[data-tab="accounts"] {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: start !important;
  gap: 7px !important;
  width: 100% !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 13px !important;
  overflow: hidden !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #9ba0aa !important;
  box-shadow: none !important;
}

body.rush-miniapp-mode .bottom-nav .nav-button.is-active {
  border-color: rgba(255, 255, 255, 0.09) !important;
  background: #1b1e25 !important;
  color: #ffffff !important;
}

body.rush-miniapp-mode .bottom-nav .nav-button .nav-icon {
  display: grid !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
}

body.rush-miniapp-mode .bottom-nav .nav-icon svg,
body.rush-miniapp-mode .bottom-nav .nav-icon img {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
}

body.rush-miniapp-mode .bottom-nav .nav-button-rush .nav-icon img {
  filter: brightness(0) invert(1) !important;
}

body.rush-miniapp-mode .bottom-nav .nav-label {
  position: static !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: auto !important;
  clip-path: none !important;
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 760 !important;
  line-height: 1.1 !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.rush-miniapp-mode .rush-wallet {
  display: grid;
  gap: 16px;
  padding-bottom: 24px;
}

body.rush-miniapp-mode .rush-wallet-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

body.rush-miniapp-mode .rush-wallet-kicker,
body.rush-miniapp-mode .rush-wallet-section-label,
body.rush-miniapp-mode .rush-wallet-eyebrow {
  margin: 0 0 5px;
  color: var(--rush-standalone-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

body.rush-miniapp-mode .rush-wallet-title {
  margin: 0;
  color: #ffffff;
  font-size: 22px;
  font-weight: 780;
  line-height: 1.05;
}

body.rush-miniapp-mode .rush-wallet-account {
  min-width: 0;
  max-width: 50%;
  overflow: hidden;
  color: var(--rush-standalone-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.rush-miniapp-mode .rush-wallet-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rush-standalone-line);
  border-radius: 8px;
  background: var(--rush-standalone-line);
}

body.rush-miniapp-mode .rush-wallet-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px;
  background: #121419;
}

body.rush-miniapp-mode .rush-wallet-stat {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px;
  background: #121419;
}

body.rush-miniapp-mode .rush-wallet-metric span {
  color: var(--rush-standalone-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-stat span {
  color: var(--rush-standalone-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-metric strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 18px;
  font-weight: 770;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.rush-miniapp-mode .rush-wallet-stat strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 18px;
  font-weight: 770;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.rush-miniapp-mode .rush-wallet-metric small {
  color: #8ccf9d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-activity {
  display: grid;
  gap: 9px;
}

body.rush-miniapp-mode .rush-wallet-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.rush-miniapp-mode .rush-wallet-activity-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

body.rush-miniapp-mode .rush-wallet-activity-head h3 {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-activity-heading h3 {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-activity-head span {
  color: var(--rush-standalone-muted);
  font-size: 11px;
  font-weight: 650;
}

body.rush-miniapp-mode .rush-wallet-count {
  color: var(--rush-standalone-muted);
  font-size: 11px;
  font-weight: 650;
}

body.rush-miniapp-mode .rush-wallet-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rush-standalone-line);
  border-radius: 8px;
  background: var(--rush-standalone-line);
}

body.rush-miniapp-mode .rush-wallet-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px;
  background: #121419;
}

body.rush-miniapp-mode .rush-wallet-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body.rush-miniapp-mode .rush-wallet-item-main,
body.rush-miniapp-mode .rush-wallet-item-result {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body.rush-miniapp-mode .rush-wallet-item-result {
  justify-items: end;
  text-align: right;
}

body.rush-miniapp-mode .rush-wallet-item-copy strong,
body.rush-miniapp-mode .rush-wallet-item-copy span,
body.rush-miniapp-mode .rush-wallet-item-main strong,
body.rush-miniapp-mode .rush-wallet-item-main span,
body.rush-miniapp-mode .rush-wallet-item-result strong,
body.rush-miniapp-mode .rush-wallet-item-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.rush-miniapp-mode .rush-wallet-item-copy strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 730;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-item-main strong,
body.rush-miniapp-mode .rush-wallet-item-result strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 730;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-item-copy span {
  color: var(--rush-standalone-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-item-main span,
body.rush-miniapp-mode .rush-wallet-item-result span {
  color: var(--rush-standalone-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

body.rush-miniapp-mode .rush-wallet-item.is-positive .rush-wallet-item-result strong {
  color: #8fd3a0;
}

body.rush-miniapp-mode .rush-wallet-item.is-negative .rush-wallet-item-result strong {
  color: #ff8e88;
}

body.rush-miniapp-mode .rush-wallet-item-value {
  color: #ffffff;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
  text-align: right;
}

body.rush-miniapp-mode .rush-wallet-item-value.is-positive {
  color: #8fd3a0;
}

body.rush-miniapp-mode .rush-wallet-item-value.is-negative {
  color: #ff8e88;
}

body.rush-miniapp-mode .rush-wallet-empty {
  margin: 0;
  padding: 18px 14px;
  border: 1px solid var(--rush-standalone-line);
  border-radius: 8px;
  color: var(--rush-standalone-muted);
  font-size: 13px;
  line-height: 1.45;
}

body.rush-miniapp-mode .rush-wallet-empty strong,
body.rush-miniapp-mode .rush-wallet-empty span {
  display: block;
}

body.rush-miniapp-mode .rush-wallet-empty strong {
  margin-bottom: 5px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 740;
}

body.rush-miniapp-mode .rush-wallet-account-picker select {
  min-width: 132px;
  max-width: 190px;
  height: 34px;
  padding: 0 27px 0 10px;
  overflow: hidden;
  border: 1px solid var(--rush-standalone-line);
  border-radius: 6px;
  outline: 0;
  background: #121419;
  color: #ffffff;
  font: inherit;
  font-size: 11px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.rush-miniapp-mode .rush-standalone-access {
  display: grid;
  min-height: calc(100dvh - 200px);
  place-items: center;
  padding: 32px 0 116px;
}

body.rush-miniapp-mode .rush-miniapp-access {
  display: grid;
  min-height: calc(100dvh - 200px);
  place-items: center;
  padding: 32px 0 116px;
}

body.rush-miniapp-mode .rush-standalone-access > div {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid var(--rush-standalone-line);
  border-radius: 8px;
  background: #121419;
}

body.rush-miniapp-mode .rush-miniapp-access-card {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid var(--rush-standalone-line);
  border-radius: 8px;
  background: #121419;
}

body.rush-miniapp-mode .rush-standalone-access p {
  margin: 0 0 8px;
  color: var(--rush-standalone-muted);
  font-size: 12px;
  font-weight: 740;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}

body.rush-miniapp-mode .rush-miniapp-access-card > p:not(.rush-wallet-eyebrow) {
  margin: 0;
  color: var(--rush-standalone-muted);
  font-size: 13px;
  line-height: 1.45;
}

body.rush-miniapp-mode .rush-standalone-access h2 {
  margin: 0 0 9px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 770;
  line-height: 1.15;
}

body.rush-miniapp-mode .rush-miniapp-access-card h1 {
  margin: 0 0 9px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 770;
  line-height: 1.15;
}

body.rush-miniapp-mode .rush-miniapp-access-refresh {
  min-height: 38px;
  margin-top: 16px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: #f4f5f6;
  color: #111216;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

body.rush-miniapp-mode .rush-standalone-access span {
  color: var(--rush-standalone-muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 768px) {
  html.telegram-miniapp body.rush-miniapp-mode .app-shell {
    padding-top: 0 !important;
  }

  html.telegram-miniapp body.rush-miniapp-mode .topbar {
    min-height: calc(58px + var(--ff-telegram-header-clearance, 72px)) !important;
    padding-top: calc(var(--ff-telegram-header-clearance, 72px) + 9px) !important;
  }
}

@media (max-width: 420px) {
  body.rush-miniapp-mode .app-shell {
    width: calc(100% - 20px) !important;
  }

  body.rush-miniapp-mode .topbar .brand-logo {
    width: 100px !important;
    max-width: 100px !important;
  }

  body.rush-miniapp-mode .topbar .user-menu-trigger {
    max-width: min(184px, 56vw) !important;
  }

  body.rush-miniapp-mode .rush-wallet-summary {
    grid-template-columns: 1fr;
  }

  body.rush-miniapp-mode .rush-wallet-metric + .rush-wallet-metric,
  body.rush-miniapp-mode .rush-wallet-stat + .rush-wallet-stat {
    border-top: 1px solid var(--rush-standalone-line);
  }
}

/* The dashboard's mobile dock and Rush lobby have high-specificity defaults.
   Keep the standalone shell deterministic after those styles load. */
html.rush-miniapp-mode body.rush-miniapp-mode.rush-page-active:not(.admin-page) .topbar,
html.rush-miniapp-mode body.rush-miniapp-mode.view-accounts-active:not(.admin-page) .topbar {
  grid-template-columns: minmax(0, 1fr) auto !important;
  padding: 9px 0 12px !important;
  border-bottom: 1px solid var(--rush-standalone-line) !important;
  background: transparent !important;
}

html.rush-miniapp-mode body.rush-miniapp-mode.rush-page-active:not(.admin-page) .topbar .brand-lockup,
html.rush-miniapp-mode body.rush-miniapp-mode.view-accounts-active:not(.admin-page) .topbar .brand-lockup {
  grid-column: auto !important;
}

html.rush-miniapp-mode body.rush-miniapp-mode.rush-page-active:not(.admin-page) .topbar .topbar-tools,
html.rush-miniapp-mode body.rush-miniapp-mode.view-accounts-active:not(.admin-page) .topbar .topbar-tools {
  grid-column: auto !important;
  justify-self: end !important;
}

html.rush-miniapp-mode body.rush-miniapp-mode.rush-page-active:not(.admin-page) .topbar .user-menu-trigger,
html.rush-miniapp-mode body.rush-miniapp-mode.view-accounts-active:not(.admin-page) .topbar .user-menu-trigger {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: min(208px, 54vw) !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 4px 9px 4px 5px !important;
  border: 1px solid var(--rush-standalone-line) !important;
  border-radius: 8px !important;
  background: var(--rush-standalone-surface) !important;
}

html.rush-miniapp-mode body.rush-miniapp-mode.rush-page-active:not(.admin-page) .topbar .user-menu-trigger-copy,
html.rush-miniapp-mode body.rush-miniapp-mode.view-accounts-active:not(.admin-page) .topbar .user-menu-trigger-copy {
  display: grid !important;
}

html.rush-miniapp-mode.miniapp-dashboard body.rush-miniapp-mode:not(.admin-page) .app-shell > .bottom-nav {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: 56px !important;
  width: min(460px, calc(100% - 20px)) !important;
  height: auto !important;
  min-height: 68px !important;
  padding: 6px !important;
  border-radius: 8px !important;
}

html.rush-miniapp-mode.miniapp-dashboard body.rush-miniapp-mode:not(.admin-page) .bottom-nav .nav-button:not([data-tab="rush"]):not([data-tab="accounts"]) {
  display: none !important;
}

html.rush-miniapp-mode.miniapp-dashboard body.rush-miniapp-mode:not(.admin-page) .bottom-nav .nav-button[data-tab="rush"],
html.rush-miniapp-mode.miniapp-dashboard body.rush-miniapp-mode:not(.admin-page) .bottom-nav .nav-button[data-tab="accounts"] {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: start !important;
  gap: 7px !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 13px !important;
  border-radius: 6px !important;
}

html.rush-miniapp-mode.miniapp-dashboard body.rush-miniapp-mode:not(.admin-page) .bottom-nav .nav-label {
  position: static !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: auto !important;
  clip-path: none !important;
  font-size: 12px !important;
  text-align: left !important;
}
