:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: #111821;
  --panel-soft: #172130;
  --border: #263345;
  --text: #f4f8fb;
  --muted: #9aa9b7;
  --accent: #31d09b;
  --accent-soft: rgba(49, 208, 155, 0.13);
  --blue: #67a7ff;
  --warning: #f2c75c;
  --danger: #ff6b6b;
  --primary-control-hit-height: 44px;
  --primary-section-gap: 6px;
  --bottom-nav-hit-height: 52px;
  --bottom-nav-chrome-height: 61px;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

.loading-splash {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  overflow: hidden;
  align-content: center;
  justify-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 48%, rgba(49, 208, 155, 0.13), transparent 28%),
    radial-gradient(circle at 18% 16%, rgba(103, 167, 255, 0.11), transparent 28%),
    var(--bg);
  opacity: 1;
  pointer-events: auto;
  transition: opacity 220ms ease, visibility 220ms ease;
  visibility: visible;
}

.loading-splash::before {
  position: absolute;
  inset: -38%;
  background:
    linear-gradient(
      135deg,
      transparent 26%,
      rgba(49, 208, 155, 0.03) 38%,
      rgba(49, 208, 155, 0.16) 48%,
      rgba(103, 167, 255, 0.08) 55%,
      transparent 70%
    );
  content: "";
  filter: blur(2px);
  transform: translate3d(-16%, -16%, 0);
  animation: loading-splash-wave 2.9s ease-in-out infinite;
}

.loading-splash::after {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(49, 208, 155, 0.16), transparent 62%);
  content: "";
  display: none;
  filter: blur(42px);
  opacity: 0.78;
  animation: loading-splash-breathe 2.6s ease-in-out infinite;
}

.loading-splash.is-hiding {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.loading-splash-brand {
  position: relative;
  z-index: 1;
  justify-content: center;
  border: 1px solid rgba(49, 208, 155, 0.22);
  border-radius: 18px;
  padding: 18px 22px 19px;
  background: rgba(7, 10, 15, 0.72);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  animation: none;
  transform: none;
  will-change: auto;
}

.loading-splash-message {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.loading-splash-message.error {
  color: var(--danger);
}

.loading-splash-retry {
  position: relative;
  z-index: 1;
  min-width: 9rem;
  margin-top: 14px;
  border: 1px solid rgba(49, 208, 155, 0.5);
  border-radius: 12px;
  padding: 10px 18px;
  background: var(--accent-soft);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@keyframes loading-splash-wave {
  0% {
    opacity: 0.72;
    transform: translate3d(-18%, -18%, 0);
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.72;
    transform: translate3d(18%, 18%, 0);
  }
}

@keyframes loading-splash-breathe {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.04);
  }
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 12px 16px calc(56px + env(safe-area-inset-bottom));
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.tab-view,
.detail-view {
  min-height: 0;
}

.tab-view {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#list-view,
#balance-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#list-view > .notice,
#balance-view > .balance-hero,
#balance-view > .balance-scope-row,
#balance-view > .balance-message,
.section-heading {
  flex: 0 0 auto;
}

.hero,
.section-heading,
.bot-card-header,
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hero {
  flex: 0 0 auto;
  min-height: 24px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.language-toggle-button {
  min-width: 42px;
  min-height: 28px;
  border: 1px solid rgba(38, 51, 69, 0.58);
  border-radius: 9px;
  padding: 0 9px;
  background: rgba(7, 10, 15, 0.34);
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.language-toggle-button:hover {
  border-color: rgba(49, 208, 155, 0.28);
  background: rgba(49, 208, 155, 0.1);
}

.language-toggle-button:focus-visible {
  outline: 2px solid rgba(49, 208, 155, 0.34);
  outline-offset: 2px;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: none;
  transform-origin: center;
  animation: none;
  opacity: 1;
  will-change: auto;
}

.brand-wordmark-logo {
  display: block;
  width: 112px;
  max-width: 34vw;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.loading-splash .loading-splash-brand {
  animation: none;
  transform: none;
  will-change: auto;
}

.loading-splash .loading-splash-logo {
  width: 223.2px;
  max-width: calc(90vw - 100.8px);
  filter: none;
}

@keyframes brand-wordmark-flight {
  0%,
  71%,
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  75.8% {
    opacity: 0;
    transform: translate3d(46px, 0, 0);
  }

  76.3%,
  78% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }

  82.8% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-splash,
  .loading-splash::before,
  .loading-splash::after,
  .brand-wordmark {
    animation: none;
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

.eyebrow,
h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: 34px;
  line-height: 1.08;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
}

.back-button,
.open-link,
.connect-link,
.add-bot-button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.back-button {
  padding: 9px 14px;
  background: var(--panel-soft);
}

.detail-view > .back-button {
  position: sticky;
  top: 0;
  z-index: 30;
  align-self: flex-start;
  box-shadow:
    0 -8px 0 8px var(--bg),
    0 10px 18px rgba(7, 10, 15, 0.38);
}

.back-button:hover {
  border-color: var(--blue);
}

.add-bot-button {
  min-height: 34px;
  padding: 6px 12px;
  background: var(--accent-soft);
  border-color: rgba(49, 208, 155, 0.55);
}

.add-bot-button:hover {
  border-color: var(--accent);
}

.add-bot-list-button {
  display: grid;
  min-height: 64px;
  width: 100%;
  place-items: center;
  border: 1px solid rgba(49, 208, 155, 0.55);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.add-bot-list-button:hover {
  border-color: var(--accent);
}

/* balance-dual-values-20260909-v1 */
.balance-hero,
.settings-profile {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.statistics-page,
.statistics-dashboard,
.statistics-content {
  display: grid;
  align-content: start;
  gap: 12px;
}

.statistics-page {
  min-width: 0;
  padding-bottom: 12px;
}

.statistics-toolbar {
  display: grid;
  gap: 10px;
  padding: 0;
}

.statistics-heading-row,
.statistics-card-header,
.statistics-chart-selection,
.statistics-history-row,
.statistics-bot-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.statistics-heading-row {
  min-height: 56px;
  justify-content: flex-start;
}

.statistics-heading-copy,
.statistics-card-header > div,
.statistics-chart-selection > div,
.statistics-bot-copy {
  min-width: 0;
}

.statistics-heading-copy h1,
.statistics-heading-copy p,
.statistics-card-header h2,
.statistics-card-header p,
.statistics-chart-selection span,
.statistics-chart-selection small,
.statistics-history-row span,
.statistics-history-row small,
.statistics-bot-copy strong,
.statistics-bot-copy small {
  margin: 0;
}

.statistics-heading-copy h1 {
  font-size: 22px;
  line-height: 1.15;
}

.statistics-heading-copy p,
.statistics-card-header p,
.statistics-chart-selection small,
.statistics-history-row small,
.statistics-bot-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.statistics-heading-copy p {
  margin-top: 4px;
}

.statistics-refresh-button {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.statistics-refresh-button:hover,
.statistics-refresh-button:focus-visible {
  border-color: rgba(49, 208, 155, 0.54);
  color: var(--accent);
}

.statistics-refresh-button.is-loading svg {
  animation: statistics-spin 800ms linear infinite;
}

.statistics-refresh-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.statistics-filter-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.statistics-bot-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  min-width: 0;
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.statistics-bot-trigger-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.statistics-bot-trigger-copy small { font-size: 11px; font-weight: 650; color: var(--muted); }
.statistics-bot-trigger-copy strong { font-size: 15px; font-weight: 750; line-height: 1.3; }
.statistics-filter-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; color: var(--accent); }
.statistics-filter-icon > svg { width: 28px; height: 28px; fill: currentColor; }
.statistics-filter-icon .bot-logo-wrap, .statistics-filter-icon .bot-logo, .statistics-filter-icon .bot-logo-badge { width: 32px; height: 32px; }
.statistics-filter-chevron { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.statistics-bot-trigger[aria-expanded="true"] { border-color: var(--accent); }
.statistics-bot-trigger[aria-expanded="true"] .statistics-filter-chevron { transform: rotate(180deg); }
.statistics-bot-trigger:focus-visible, .statistics-bot-picker button:focus-visible { outline: 2px solid #59c8ff; outline-offset: 2px; }
.statistics-bot-picker {
  width: min(460px, calc(100% - 32px));
  max-width: none;
  max-height: min(720px, calc(100svh - 48px));
  margin: auto;
  padding: 18px;
  border: 1px solid #32485a;
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
}
.statistics-bot-picker[open] { display: flex; flex-direction: column; gap: 16px; }
.statistics-bot-picker::backdrop { background: rgba(0, 0, 0, .66); }
.statistics-bot-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.statistics-bot-picker-header h2 { margin: 0; font-size: 18px; }
.statistics-bot-picker-header button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.statistics-bot-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 3px; margin: -3px; scroll-padding: 3px; }
.statistics-bot-option { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 56px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.02); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.statistics-bot-option[data-project-key="all"] { grid-column: 1 / -1; }
.statistics-bot-option .statistics-filter-icon, .statistics-bot-option .bot-logo-wrap, .statistics-bot-option .bot-logo, .statistics-bot-option .bot-logo-badge { width: 28px; height: 28px; flex-basis: 28px; }
.statistics-bot-option-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.statistics-bot-option-check { flex: 0 0 14px; width: 14px; height: 14px; stroke: var(--accent); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.statistics-bot-option[aria-pressed="true"] { background: rgba(49,208,155,.1); border-color: rgba(49,208,155,.65); }
.statistics-bot-option[aria-pressed="true"] .statistics-bot-option-check { visibility: visible; }
@media (max-width: 640px) {
  .statistics-filter-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .statistics-filter-row > .statistics-bot-trigger,
  .statistics-filter-row > .statistics-date-button.statistics-range-trigger { grid-column: 1; }
}
@media (max-width: 600px) {
  .statistics-bot-picker { width: 100%; max-height: calc(100svh - 24px); margin: auto 0 0; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; border-bottom: 0; }
}
@media (max-width: 360px) {
  .statistics-bot-options { grid-template-columns: minmax(0, 1fr); }
}

.statistics-date-picker select,
.statistics-date-picker input {
  min-height: 44px;
  min-width: 0;
  width: 100%;
  padding: 0 36px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.statistics-date-picker select:focus-visible,
.statistics-date-picker input:focus-visible {
  border-color: rgba(49, 208, 155, 0.72);
  box-shadow: 0 0 0 2px rgba(49, 208, 155, 0.12);
}

.statistics-period-switch {
  display: grid;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.statistics-period-switch {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.statistics-period-button,
.statistics-year-select,
.statistics-history-toggle,
.statistics-status button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.statistics-period-button.active,
.statistics-year-select.active {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.statistics-year-select {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  width: 100%;
  padding: 0 18px;
  text-align: center;
  text-align-last: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%239aa9b7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 6px center;
  background-repeat: no-repeat;
  background-size: 10px 6px;
  color-scheme: dark;
}

.statistics-year-select option {
  color: var(--text);
  background: var(--panel);
}

.statistics-year-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.statistics-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(242, 199, 92, 0.3);
  border-radius: 8px;
  background: rgba(242, 199, 92, 0.07);
  color: var(--warning);
  font-size: 13px;
  font-weight: 750;
}

.statistics-status.is-error {
  border-color: rgba(255, 107, 107, 0.34);
  background: rgba(255, 107, 107, 0.08);
  color: var(--danger);
}

.statistics-status p {
  margin: 0;
}

.statistics-status button,
.statistics-history-toggle {
  min-height: 44px;
  padding-inline: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  white-space: nowrap;
}

.statistics-loading {
  display: grid;
  gap: 12px;
}

.statistics-skeleton-grid,
.statistics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.statistics-skeleton-grid span,
.statistics-skeleton-chart {
  border: 1px solid rgba(38, 51, 69, 0.56);
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.025) 24%, rgba(255, 255, 255, 0.07) 38%, rgba(255, 255, 255, 0.025) 52%);
  background-size: 220% 100%;
  animation: statistics-skeleton 1.35s ease-in-out infinite;
}

.statistics-skeleton-grid span {
  min-height: 96px;
}

.statistics-skeleton-chart {
  min-height: 286px;
}

.statistics-kpi-card,
.statistics-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.statistics-kpi-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 96px;
  align-content: center;
  gap: 6px;
  padding: 13px 14px;
  overflow: hidden;
}

.statistics-kpi-card-primary::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(49, 208, 155, 0.62);
  content: "";
}

.statistics-kpi-card > span,
.statistics-kpi-card > small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.statistics-kpi-card > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-kpi-card > strong.is-positive,
.statistics-value.is-positive {
  color: var(--accent);
}

.statistics-kpi-card > strong.is-negative,
.statistics-value.is-negative {
  color: var(--danger);
}

.statistics-best-bot-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.statistics-best-bot-summary > strong,
.statistics-best-bot-summary > small {
  min-width: 0;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.statistics-best-bot-summary > strong {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-best-bot-summary > small {
  flex: 0 0 auto;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.statistics-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  align-items: stretch;
  gap: 12px;
}

.statistics-primary-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.statistics-primary-column > .statistics-chart-card {
  flex: 0 0 auto;
}

.statistics-bots-card {
  align-self: start;
}

@media (min-width: 901px) {
  .statistics-bots-card {
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }

  .statistics-bots-list {
    flex: 1;
    grid-auto-rows: minmax(min-content, 1fr);
  }

  .statistics-bot-row {
    align-content: center;
  }
}

.statistics-content.is-single-bot .statistics-main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.statistics-content.is-empty .statistics-main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.statistics-content.is-empty .statistics-chart-empty {
  min-height: 100px;
  padding: 20px 10px;
}

.statistics-content.is-single-bot .statistics-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.statistics-card {
  min-width: 0;
  padding: 15px;
}

.statistics-card-header {
  align-items: flex-start;
  margin-bottom: 13px;
}

.statistics-card-header h2 {
  font-size: 15px;
  line-height: 1.2;
}

.statistics-card-header p {
  margin-top: 4px;
}

.statistics-chart-header {
  align-items: center;
  gap: 16px;
}

.statistics-chart-header > div {
  flex: 0 0 auto;
  max-width: 45%;
}

.statistics-chart-header .statistics-chart-range {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  text-align: right;
  text-wrap: balance;
}

.statistics-chart {
  position: relative;
  min-height: 250px;
  width: 100%;
  overflow: hidden;
}

.statistics-chart svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
}

.statistics-chart-grid {
  stroke: rgba(154, 169, 183, 0.12);
  stroke-width: 1;
}

.statistics-chart-zero {
  stroke: rgba(154, 169, 183, 0.42);
  stroke-width: 1.2;
}

.statistics-chart-bar {
  fill: var(--accent);
  opacity: 0.82;
}

.statistics-chart-bar.is-negative {
  fill: var(--danger);
}

.statistics-chart-bar.is-selected {
  fill: #59c8ff;
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(89, 200, 255, 0.55));
}

.statistics-chart-selection-guide {
  stroke: #59c8ff;
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.7;
  pointer-events: none;
}

.statistics-chart-selection-marker {
  fill: #59c8ff;
  pointer-events: none;
}

.statistics-chart-zero-point {
  fill: var(--muted);
  opacity: 0.56;
}

.statistics-chart-zero-point.is-selected {
  fill: #59c8ff;
  opacity: 1;
}

.statistics-chart-hit {
  fill: transparent;
  cursor: pointer;
  outline: none;
}

.statistics-chart:focus-visible {
  border-radius: 6px;
  outline: 2px solid rgba(49, 208, 155, 0.66);
  outline-offset: 2px;
}

.statistics-chart-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.statistics-chart-selection {
  position: relative;
  min-height: 44px;
  margin-top: 6px;
  padding: 9px 11px;
  border: 1px solid rgba(49, 208, 155, 0.24);
  border-radius: 7px;
  background: rgba(49, 208, 155, 0.055);
}

.statistics-chart-selection > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.statistics-chart-selection.is-period-selected {
  border-color: rgba(89, 200, 255, 0.4);
  background: rgba(89, 200, 255, 0.055);
}

.statistics-date-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.statistics-date-picker > select,
.statistics-date-picker > .statistics-date-button {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

#statistics-period-select {
  -webkit-appearance: none;
  appearance: none;
  min-height: calc(2.6em + 18px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%239aa9b7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 10px 6px;
  color-scheme: dark;
}

.statistics-date-button,
.statistics-chart-tools button,
.statistics-calendar button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.statistics-date-button {
  display: flex;
  min-height: calc(2.6em + 18px);
  line-height: 1.3;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
}

/* The bot selector and period selector are one filter group; keep their
   capsule geometry and surface treatment identical. */
.statistics-bot-trigger,
.statistics-date-button.statistics-range-trigger {
  border-radius: 8px;
  background: var(--panel);
}

.statistics-date-button::after {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-left: 10px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' d='M5 5h14v16H5zM8 2v6m8-6v6M5 10h14'/%3E%3C/svg%3E") center/contain no-repeat;
}

.statistics-chart-tools { margin-top: 8px; }
.statistics-chart-tools button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 320px);
  box-sizing: border-box;
  max-width: 100%;
  justify-self: start;
  padding: 8px 11px;
  text-align: left;
  background: rgba(255, 255, 255, 0.018);
}
.statistics-scale-copy { display: grid; gap: 2px; min-width: 0; }
#statistics-scale-label { font-size: 12px; line-height: 1.3; }
#statistics-scale-note {
  min-height: 2.8em;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--muted);
}
.statistics-scale-switch {
  display: flex;
  align-items: center;
  flex: 0 0 32px;
  height: 20px;
  padding: 3px;
  border-radius: 12px;
  background: var(--border);
}
.statistics-scale-switch::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
}
.statistics-chart-tools button[aria-pressed="true"] .statistics-scale-switch { background: var(--accent); }
.statistics-chart-tools button[aria-pressed="true"] .statistics-scale-switch::after { transform: translateX(12px); background: var(--bg); }
.statistics-selection-reset {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.statistics-selection-reset:disabled { opacity: 0.45; cursor: default; }
.statistics-chart-tools button[aria-pressed="true"] { color: var(--accent); border-color: rgba(49, 208, 155, 0.35); }

.statistics-calendar {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(49, 208, 155, 0.35);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.statistics-calendar::backdrop { background: rgba(0, 0, 0, 0.65); }
.statistics-calendar-panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.statistics-calendar-pane { min-width: 0; }
.statistics-calendar-pane .statistics-range-fields { grid-template-columns: minmax(0, 1fr); }
.statistics-calendar-pane h3 { margin: 0; font-size: 14px; }
@media (max-width: 600px) {
  .statistics-calendar-panes { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .statistics-calendar-footer { flex-wrap: wrap; position: sticky; bottom: -16px; padding-bottom: 12px; background: var(--panel); z-index: 1; }
  .statistics-calendar-presets { width: 100%; }
  .statistics-calendar-presets > * { flex: 1 1 0; min-width: 0; }
  .statistics-calendar-footer > .statistics-range-apply { width: 100%; }
}
.statistics-calendar-heading,
.statistics-calendar-navigation,
.statistics-calendar-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.statistics-calendar-presets { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.statistics-calendar-presets select {
  min-width: 92px;
  min-height: 44px;
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  color-scheme: dark;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.statistics-calendar-presets select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.statistics-calendar-heading h2 { margin: 0; font-size: 16px; }
#statistics-calendar-range { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 10px 0 16px; }
.statistics-calendar-navigation { margin-bottom: 12px; }
.statistics-calendar-navigation strong { font-size: 14px; }
.statistics-calendar-navigation button { font-size: 24px; line-height: 1; width: 44px; }
.statistics-calendar-weekdays,
.statistics-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.statistics-calendar-weekdays { margin-bottom: 6px; text-align: center; color: var(--muted); font-size: 11px; }
.statistics-calendar-days button { position: relative; min-width: 0; min-height: 40px; padding: 4px 0 9px; background: transparent; border-color: transparent; }
.statistics-calendar button:disabled { cursor: default; opacity: 0.3; }
.statistics-calendar-days button.is-outside { visibility: hidden; }
.statistics-calendar-days button[aria-current="date"] { border-color: var(--accent); }
.statistics-calendar-days button.has-activity::after { content: ""; position: absolute; bottom: 5px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.statistics-calendar-days button.is-selected { color: var(--bg); background: var(--accent); }
.statistics-calendar-days button.is-selected::after { background: var(--bg); }
.statistics-calendar button:not(:disabled):hover,
.statistics-date-button:hover { border-color: var(--accent); }
.statistics-calendar button:focus-visible,
.statistics-date-button:focus-visible,
.statistics-chart-tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.statistics-calendar-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.statistics-calendar-footer span { max-width: 175px; font-size: 11px; line-height: 1.4; color: var(--muted); }

.statistics-range-trigger { min-height: 52px; padding: 5px 12px; }
.statistics-range-trigger > span { display: grid; gap: 4px; min-width: 0; }
.statistics-range-trigger small { color: var(--muted); font-size: 11px; font-weight: 600; }
.statistics-range-trigger strong { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.statistics-range-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.statistics-range-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; min-width: 0; }
.statistics-range-fields input { min-width: 0; width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-soft); color: var(--text); color-scheme: dark; font: inherit; }
.statistics-range-fields label > span { display: none; }
.statistics-range-fields input { padding-inline: 10px; text-align: center; font-size: 14px; font-weight: 750; -webkit-appearance: none; appearance: none; }
.statistics-range-fields input::-webkit-calendar-picker-indicator { display: none; }
#statistics-range-error { color: var(--danger); font-size: 12px; margin: 0 0 10px; }
.statistics-calendar-days button.is-in-range { background: rgba(49, 208, 155, .14); border-radius: 3px; }
.statistics-calendar .statistics-range-apply { background: var(--accent); color: var(--bg); min-width: 130px; }

.statistics-accessible-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.statistics-chart-selection strong {
  flex: 0 0 auto;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.statistics-chart-empty {
  display: grid;
  min-height: 250px;
  margin: 0;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.statistics-bots-list,
.statistics-history-list {
  display: grid;
  gap: 7px;
}

.statistics-bots-card .statistics-card-header {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.statistics-date-picker input {
  color-scheme: dark;
}

.statistics-bot-row {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(38, 51, 69, 0.7);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.statistics-bot-summary {
  display: grid;
  grid-template-columns: minmax(115px, 1fr) minmax(0, auto);
  align-items: center;
  gap: 8px;
}

.statistics-bot-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.statistics-bot-row .bot-logo-wrap,
.statistics-bot-row .bot-logo,
.statistics-bot-row .bot-logo-badge {
  width: 24px;
  height: 24px;
}

.statistics-bot-row .bot-logo-badge {
  font-size: 8px;
}

.statistics-bot-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.statistics-bot-copy strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bot-deals {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bot-value {
  flex: 0 0 auto;
  min-width: 0;
  font-size: 16px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bot-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.statistics-bot-track {
  position: relative;
  grid-column: 2;
  height: 4px;
  border-radius: 999px;
  background: rgba(154, 169, 183, 0.1);
}

.statistics-bot-track::after {
  display: none;
}

.statistics-bot-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: var(--accent);
}

.statistics-bot-fill.is-negative {
  right: 0;
  left: auto;
  background: var(--danger);
}

.statistics-history-card {
  display: flex;
  flex-direction: column;
  flex: 1 0 360px;
  min-height: 360px;
  padding-bottom: 11px;
}

.statistics-history-list {
  position: relative;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  scroll-padding-block: 5px;
}

.statistics-history-list:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.statistics-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(48%);
  align-items: center;
  column-gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 8px 3px;
  border: 0;
  border-top: 1px solid rgba(38, 51, 69, 0.58);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.statistics-history-row:first-child {
  border-top: 0;
}

.statistics-history-row:hover,
.statistics-history-row:focus-visible,
.statistics-history-row.is-selected {
  background: rgba(49, 208, 155, 0.045);
}

/* Match the chart's blue selection guide so the chosen day is obvious in
   both the graph and the daily history list. */
.statistics-history-row.is-selected {
  width: 100%;
  margin-inline: 0;
  padding-inline: 12px;
  border: 1px solid rgba(89, 200, 255, 0.46);
  border-radius: 8px;
  background: rgba(89, 200, 255, 0.14);
  box-shadow: inset 3px 0 0 #59c8ff;
}

.statistics-history-row.is-selected > span { font-size: 13px; }
.statistics-history-row.is-selected > strong { font-size: 14px; }

.statistics-history-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.statistics-history-row span {
  font-size: 13px;
  font-weight: 820;
}

.statistics-history-row strong {
  flex: 0 0 auto;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
  white-space: normal;
}

.statistics-empty-list {
  display: grid;
  min-height: 92px;
  margin: 0;
  place-items: center;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
}

@keyframes statistics-spin {
  to { transform: rotate(360deg); }
}

@keyframes statistics-skeleton {
  to { background-position-x: -120%; }
}

@media (prefers-reduced-motion: reduce) {
  .statistics-refresh-button.is-loading svg,
  .statistics-skeleton-grid span,
  .statistics-skeleton-chart {
    animation: none;
  }
}

@media (max-width: 900px) {
  .statistics-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .statistics-bots-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statistics-content { display: flex; flex-direction: column; }
  .statistics-main-grid, .statistics-primary-column { display: contents; }
  .statistics-kpi-grid { order: 1; }
  .statistics-chart-card { order: 2; }
  .statistics-bots-card { order: 3; width: 100%; }
  .statistics-history-card { order: 4; flex: none; min-height: 0; }
  .statistics-history-list { flex: none; height: clamp(240px, 42svh, 360px); }

}

@media (max-width: 760px) {
  .statistics-page,
  .statistics-content {
    gap: 9px;
  }

  .statistics-kpi-grid,
  .statistics-content.is-single-bot .statistics-kpi-grid,
  .statistics-skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statistics-kpi-card {
    min-height: 88px;
    padding: 11px 12px;
  }

  .statistics-kpi-card > strong {
    font-size: 18px;
  }

  .statistics-content.is-single-bot .statistics-kpi-card-primary {
    grid-column: 1 / -1;
  }

  .statistics-date-picker {
    gap: 5px;
  }

  .statistics-history-toggle {
    white-space: normal;
  }

  .statistics-bots-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .statistics-content {
    display: flex;
    flex-direction: column;
  }

  .statistics-main-grid,
  .statistics-primary-column {
    display: contents;
  }

  .statistics-kpi-grid {
    order: 1;
  }

  .statistics-chart-card {
    order: 2;
  }

  .statistics-history-card {
    order: 4;
    flex: 0 0 auto;
    min-height: 0;
  }

  .statistics-history-list {
    flex: none;
    height: clamp(240px, 42svh, 360px);
  }

  .statistics-bots-card {
    order: 3;
  }
}

@media (max-width: 480px) {
  .statistics-toolbar {
    gap: 8px;
    padding-bottom: 9px;
  }

  .statistics-heading-copy h1 {
    font-size: 20px;
  }

  .statistics-period-switch {
    gap: 2px;
    padding: 2px;
  }

  .statistics-period-button {
    padding-inline: 4px;
    font-size: 11px;
  }

  .statistics-year-select {
    padding-inline: 12px;
    background-position: right 4px center;
    background-size: 8px 5px;
    font-size: 11px;
  }

  .statistics-card {
    padding: 12px;
  }

  .statistics-chart-header {
    display: grid;
    align-items: stretch;
    gap: 8px;
  }

  .statistics-chart-header > div {
    max-width: none;
  }

  .statistics-chart-header .statistics-chart-range {
    text-align: left;
  }

  .statistics-chart,
  .statistics-chart-empty {
    min-height: 230px;
  }

  .statistics-chart svg {
    height: 230px;
  }

  .statistics-status {
    align-items: stretch;
    flex-direction: column;
  }

  .statistics-status button {
    width: 100%;
  }
}


.balance-hero,
.asset-card,
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.balance-hero {
  display: block;
  min-height: 88px;
}

.balance-value-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-height: 56px;
  align-items: stretch;
}

.balance-value-cell {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 7px;
  padding: 0 16px;
  text-align: center;
}

.balance-value-cell + .balance-value-cell {
  border-left: 1px solid var(--border);
}

.balance-hero-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.profit-summary-card {
  min-width: 0;
}



.balance-message,
.asset-card span {
  color: var(--muted);
  font-size: 13px;
}


.balance-value-cell > strong {
  margin-top: 0;
  min-width: 0;
  display: block;
  font-size: 27px;
  line-height: 1;
  color: var(--muted);
}

.balance-value-cell > strong.valued {
  color: var(--text);
  font-size: 27px;
}




.balance-message {
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-weight: 700;
}

.balance-message.warning {
  color: var(--warning);
}

.balance-message.error {
  color: var(--danger);
}

.balance-scope-row {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: 0 0 12px;
}

.balance-exchange-selector {
  position: relative;
  min-width: 0;
  width: 100%;
}

.balance-exchange-trigger {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  font: inherit;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.balance-exchange-trigger:disabled {
  opacity: 1;
  cursor: default;
}

.balance-exchange-trigger:not(:disabled):hover,
.balance-exchange-trigger[aria-expanded="true"] {
  border-color: rgba(49, 208, 155, 0.48);
  background: var(--panel-soft);
}

.balance-exchange-trigger:active:not(:disabled) {
  transform: translateY(1px);
}

.balance-exchange-trigger:focus-visible,
.balance-exchange-option:focus-visible {
  outline: 2px solid rgba(49, 208, 155, 0.66);
  outline-offset: 2px;
}

.balance-exchange-chevron {
  position: absolute;
  right: 15px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  transition: transform 140ms ease;
}

.balance-exchange-trigger[aria-expanded="true"] .balance-exchange-chevron {
  transform: rotate(180deg);
}

.balance-exchange-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.balance-exchange-option {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.balance-exchange-option:hover,
.balance-exchange-option.active {
  background: rgba(49, 208, 155, 0.09);
  color: var(--accent);
}

.balance-exchange-option-check {
  min-width: 14px;
  color: var(--accent);
  text-align: center;
}

.bottom-nav-button,
.settings-item {
  border: 0;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.bot-card,
.notice,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.balance-hero,
.settings-profile {
  padding: 16px;
}

.asset-list,
.settings-list {
  display: grid;
  gap: 10px;
}

.asset-card,
.settings-item {
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.asset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 66px;
  padding: 10px 12px;
}

.asset-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.asset-balances {
  display: grid;
  grid-template-columns: repeat(2, minmax(94px, 1fr));
  min-width: 228px;
  gap: 12px;
  text-align: right;
}

.asset-ticker,
.asset-balance-cell strong {
  line-height: 1.1;
}

.asset-ticker {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-balance-cell {
  display: grid;
  min-width: 0;
  gap: 3px;
  align-content: center;
}

.asset-balance-cell + .asset-balance-cell {
  padding-left: 12px;
  border-left: 1px solid rgba(38, 51, 69, 0.55);
}

.asset-balance-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}

.asset-balance-cell strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.asset-valuation {
  min-height: 16px;
  line-height: 1.2;
}

.asset-balance-cell .asset-valuation {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.asset-badge-wrap,
.asset-badge,
.asset-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
}

.asset-badge-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.asset-badge {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(154, 169, 183, 0.16);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.asset-badge-wrap .asset-badge[hidden] {
  display: none;
}

.asset-logo {
  display: block;
  flex: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  transform: scale(1.06);
  transform-origin: center;
}

.asset-badge-usdt,
.asset-badge-usdc {
  background: rgba(49, 208, 155, 0.16);
  color: var(--accent);
}

.asset-badge-kas,
.asset-badge-mx,
.asset-badge-sui {
  background: rgba(103, 167, 255, 0.16);
  color: var(--blue);
}

.asset-badge-btc,
.asset-badge-ltc {
  background: rgba(242, 199, 92, 0.16);
  color: var(--warning);
}

.asset-badge-eth,
.asset-badge-sol,
.asset-badge-gram,
.asset-badge-ton,
.asset-badge-xrp,
.asset-badge-cfx {
  background: rgba(163, 130, 255, 0.16);
  color: #c1adff;
}

.settings-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 2px 12px;
  padding: 2px 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
}

.settings-profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.settings-profile-avatar-wrap,
.settings-profile-avatar,
.settings-profile-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.settings-profile-avatar-wrap {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(49, 208, 155, 0.11);
  box-shadow: inset 0 0 0 1px rgba(49, 208, 155, 0.08);
}

.settings-profile-avatar {
  display: block;
  object-fit: cover;
}

.settings-profile-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
}

.settings-profile-main,
.settings-access-model,
.settings-profile-identity,
.settings-item span,
.settings-item small {
  min-width: 0;
}

.settings-profile-main,
.settings-access-model {
  display: grid;
  align-content: space-between;
  min-height: 38px;
  gap: 4px;
}

.settings-profile-main strong,
.settings-access-model strong {
  line-height: 1.15;
}

.settings-profile-main strong {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-profile-main span,
.settings-access-model span,
.settings-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.settings-wallet-view {
  display: grid;
  align-content: start;
  gap: 14px;
}

.detail-view.settings-wallet-view {
  padding-inline: 0;
}

.settings-wallet-header {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
}

.settings-wallet-a11y-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.settings-wallet-back {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 46px;
  place-items: center;
  padding: 8px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.settings-wallet-back:hover,
.settings-wallet-back:focus-visible {
  border-color: rgba(49, 208, 155, 0.48);
  background: var(--panel-soft);
  color: var(--accent);
}

.settings-wallet-back:focus-visible {
  outline: 2px solid rgba(49, 208, 155, 0.6);
  outline-offset: 2px;
}

.settings-wallet-back-icon {
  position: absolute;
  left: 14px;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.settings-wallet-back-label {
  text-align: center;
}

.settings-wallet-summary,
.settings-wallet-info {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.settings-wallet-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.settings-wallet-metric {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  min-height: 96px;
  gap: 10px;
  padding: 16px;
  text-align: center;
}

.settings-wallet-month-metrics {
  display: grid;
  min-width: 0;
  border-left: 1px solid rgba(154, 169, 183, 0.18);
}

.settings-wallet-month-metrics .settings-wallet-metric {
  min-height: 0;
  gap: 6px;
  padding: 12px;
}

.settings-wallet-month-metrics .settings-wallet-metric + .settings-wallet-metric {
  border-top: 1px solid rgba(154, 169, 183, 0.18);
}

.settings-wallet-month-metrics .settings-wallet-card-label { min-height: 0; }
.settings-wallet-month-metrics .settings-wallet-metric > strong { font-size: 20px; }

.settings-wallet-card-label {
  min-height: 2.4em;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.2;
}

.settings-wallet-metric > strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  color: var(--text);
  font-size: clamp(17px, 6.2vw, 25px);
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  white-space: nowrap;
}

.settings-wallet-metric-remaining > strong {
  color: var(--accent);
}

.settings-wallet-metric > strong.is-compact {
  font-size: clamp(13px, 4.2vw, 17px);
  letter-spacing: -0.045em;
}

.settings-wallet-message {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--warning);
}

.settings-wallet-info ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-wallet-info li {
  position: relative;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 13px 16px;
}

.settings-wallet-info li + li {
  border-top: 1px solid rgba(154, 169, 183, 0.14);
}

.settings-wallet-info li::before {
  width: 6px;
  height: 6px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.settings-wallet-info-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-wallet-info-copy strong,
.settings-wallet-info-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-wallet-info-copy strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 850;
  line-height: 1.3;
}

.settings-wallet-info-copy small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

@media (max-width: 360px) {
  .settings-wallet-view {
    gap: 12px;
  }

  .settings-wallet-metric {
    min-height: 88px;
    gap: 8px;
    padding: 14px 12px;
  }

  .settings-wallet-card-label {
    font-size: 11px;
  }

  .settings-wallet-metric > strong {
    font-size: clamp(16px, 6vw, 21px);
  }

  .settings-wallet-metric > strong.is-compact {
    font-size: clamp(11.5px, 4.15vw, 15px);
  }

  .settings-wallet-info li {
    padding: 12px;
  }
}

.settings-access-model {
  justify-items: end;
  text-align: right;
}

.settings-access-model strong {
  font-size: 13px;
  white-space: nowrap;
}

.settings-item span {
  font-weight: 800;
}

.settings-item small {
  grid-column: 1;
  margin-top: 4px;
}

.information-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 14px;
}

.detail-view.settings-info-view {
  display: grid;
  align-content: start;
  padding-inline: 0;
}

.settings-item-copy {
  display: contents;
  min-width: 0;
}

.settings-item-copy > span {
  grid-column: 1;
  overflow: hidden;
  color: var(--text);
  font-size: inherit;
  font-weight: 800;
  line-height: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-item-copy small {
  grid-column: 1;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.settings-item::after {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 8px;
  height: 8px;
  border-color: currentColor;
  border-style: solid;
  border-width: 0 2.35px 2.35px 0;
  border-radius: 1.5px;
  color: var(--muted);
  content: "";
  transform: rotate(-45deg);
  transition: color 160ms ease, transform 160ms ease;
}

.settings-item:hover::after,
.settings-item:focus-visible::after {
  color: var(--accent);
  transform: translateX(1px) rotate(-45deg);
}

.settings-item-static {
  cursor: default;
  opacity: 0.7;
}

.settings-item-static::after {
  display: none;
  content: "";
}

.information-item::after {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.notice {
  margin: 0 0 16px;
  padding: 13px 14px;
  color: var(--warning);
  background: rgba(242, 199, 92, 0.08);
}

.notice.error {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
}

.bots-section {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  margin-top: 0;
  min-height: 0;
  overflow: hidden;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.cards-grid {
  display: grid;
  align-content: start;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#connected-bots,
#balance-assets {
  flex: 1 1 auto;
  align-content: start;
  align-items: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#connected-bots {
  margin-top: -3px;
  padding-top: 3px;
  padding-bottom: 2px;
  scroll-padding-top: 3px;
}

#balance-assets {
  padding-bottom: 8px;
}

#connected-bots .add-bot-list-button {
  grid-column: auto;
  min-height: 0;
  height: 160px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-wrap: balance;
  border-color: var(--border);
  background: var(--panel);
}

.add-bot-card-icon {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(49, 208, 155, .25);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.add-bot-card-icon::before,
.add-bot-card-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.add-bot-card-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
#connected-bots .add-bot-list-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
#connected-bots .add-bot-list-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.connected-empty-card {
  grid-column: 1 / -1;
}

.onboarding-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

.onboarding-slider {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
}

.onboarding-slide {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-rows: minmax(230px, 1fr) auto;
  gap: 14px;
  box-sizing: border-box;
  overflow-x: hidden;
  animation: onboarding-slide-in 180ms ease both;
}

.onboarding-slide[data-onboarding-slide="0"] {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.onboarding-visual {
  position: relative;
  display: grid;
  overflow: hidden;
  max-width: 100%;
  min-height: 230px;
  min-width: 0;
  align-content: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(38, 51, 69, 0.72);
  border-radius: 8px;
  background: rgba(17, 24, 33, 0.72);
}

.onboarding-visual::before {
  position: absolute;
  inset: -60px auto auto -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(49, 208, 155, 0.08);
  content: "";
  filter: blur(46px);
}

.onboarding-copy {
  display: grid;
  max-width: 100%;
  min-width: 0;
  gap: 8px;
}

.onboarding-step {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.onboarding-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.12;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-brand {
  display: grid;
  width: min(100%, 360px);
  justify-self: center;
  justify-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-wordmark-heading {
  display: flex;
  width: 100%;
  justify-content: center;
  margin: 0;
  font-size: 0;
  line-height: 1;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-wordmark {
  display: block;
  width: clamp(220px, 66vw, 270px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-exchange-subtitle {
  width: min(100%, 330px);
  color: rgba(244, 248, 251, 0.82);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.88);
}

.onboarding-copy p {
  margin: 0;
}

.onboarding-copy > p:not(.onboarding-step) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-copy {
  justify-items: center;
  text-align: center;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-overlay {
  position: relative;
  z-index: 3;
  width: min(calc(100% - 24px), 360px);
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  pointer-events: none;
}

.onboarding-bot-scroll-visual {
  width: 100%;
  height: auto;
  min-height: 0;
  align-self: stretch;
  justify-items: center;
  align-content: stretch;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(49, 208, 155, 0.12), transparent 42%),
    transparent;
  pointer-events: none;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-bot-scroll-visual::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      var(--bg) 0%,
      rgba(7, 10, 15, 0.18) 12%,
      transparent 24%,
      transparent 76%,
      rgba(7, 10, 15, 0.18) 88%,
      var(--bg) 100%
    ),
    linear-gradient(
      180deg,
      transparent 0%,
      transparent 25%,
      rgba(7, 10, 15, 0.3) 35%,
      rgba(7, 10, 15, 0.82) 46%,
      rgba(7, 10, 15, 0.86) 54%,
      rgba(7, 10, 15, 0.3) 65%,
      transparent 75%,
      transparent 100%
    );
  content: "";
  pointer-events: none;
}

.onboarding-slide[data-onboarding-slide="0"] .onboarding-bot-scroll-visual {
  z-index: 1;
  height: 100%;
  grid-area: 1 / 1;
}

.onboarding-bot-scroll-track {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 386px);
  max-width: 100%;
  min-width: 0;
  animation: onboarding-bot-scroll 42s linear infinite;
  will-change: transform;
}

.onboarding-bot-scroll-group {
  display: grid;
  gap: 11px;
  padding-bottom: 11px;
}

.onboarding-scroll-bot-card {
  --scroll-bot-accent: rgba(49, 208, 155, 0.18);
  --bot-card-logo-size: 46px;
  position: relative;
  display: grid;
  min-height: 74px;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  padding: 14px 15px;
  border: 1px solid rgba(38, 51, 69, 0.82);
  border-radius: 8px;
  background: rgba(13, 19, 28, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.onboarding-scroll-bot-card::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--scroll-bot-accent), transparent 62%);
  content: "";
  opacity: 0.72;
}

.onboarding-scroll-bot-card > span {
  position: relative;
  z-index: 1;
}

.onboarding-scroll-bot-card strong,
.onboarding-scroll-bot-card em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-scroll-bot-card strong {
  color: var(--text);
  font-size: 16px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
}

.onboarding-scroll-bot-card em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.1;
}

.onboarding-scroll-bot-pnl {
  display: grid;
  min-width: 60px;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.onboarding-scroll-bot-pnl small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.onboarding-scroll-bot-pnl b {
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.onboarding-scroll-bot-pnl.is-positive b {
  color: var(--accent);
}

.onboarding-scroll-bot-pnl.is-negative b {
  color: #ef4444;
}

.onboarding-scroll-bot-card-btc {
  --scroll-bot-accent: rgba(245, 158, 11, 0.18);
}

.onboarding-scroll-bot-card-cfx {
  --scroll-bot-accent: rgba(239, 68, 68, 0.16);
}

.onboarding-scroll-bot-card-mx,
.onboarding-scroll-bot-card-ton {
  --scroll-bot-accent: rgba(103, 167, 255, 0.16);
}

.onboarding-scroll-bot-card-sui {
  --scroll-bot-accent: rgba(14, 165, 233, 0.16);
}

.onboarding-scroll-bot-card-eth {
  --scroll-bot-accent: rgba(139, 92, 246, 0.16);
}

.onboarding-scroll-bot-card-xrp {
  --scroll-bot-accent: rgba(148, 163, 184, 0.14);
}

.onboarding-point-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 9px;
  margin-top: 3px;
}

.onboarding-point-grid span {
  position: relative;
  min-width: 0;
  padding-left: 16px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.3;
}

.onboarding-point-grid span::before {
  position: absolute;
  top: 4px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.onboarding-controls {
  display: flex;
  max-width: 100%;
  min-width: 0;
  gap: 8px;
}

.onboarding-primary-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.onboarding-primary-button {
  border: 1px solid rgba(49, 208, 155, 0.48);
  flex: 1 1 auto;
  background: rgba(49, 208, 155, 0.15);
  color: var(--text);
}

.onboarding-primary-button:hover,
.onboarding-primary-button:focus-visible {
  border-color: rgba(49, 208, 155, 0.72);
  background: rgba(49, 208, 155, 0.2);
}

@keyframes onboarding-slide-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes onboarding-bot-scroll {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-slide,
  .onboarding-bot-scroll-track {
    animation: none;
  }
}

#balance-assets {
  display: grid;
}

#connected-bots:empty,
#balance-assets:empty {
  display: none;
}

.bot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  --bot-card-logo-size: 38px;
  --bot-card-logo-gap: 10px;
  --bot-card-metrics-width: 250px;
  gap: 18px;
  min-height: 148px;
  padding: 16px;
}

.bot-card-clickable {
  --bot-card-logo-size: 34.2px;
  --bot-card-logo-gap: 9px;
  gap: 16.2px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.bot-card-clickable:focus,
.bot-card-clickable:hover {
  border-color: rgba(49, 208, 155, 0.9);
  background: #14202b;
  box-shadow: inset 0 0 0 1px rgba(49, 208, 155, 0.45);
  outline: none;
  transform: none;
}

.bot-card-available {
  min-height: 64px;
  padding: 9px 10px;
  gap: 0;
}

.bot-card-available .bot-card-header {
  align-items: center;
  gap: 10px;
}

.bot-card-available .bot-card-identity {
  flex: 1 1 auto;
}

.bot-card-available .bot-title-wrap {
  flex: 1 1 auto;
}

.bot-card-available .bot-title-wrap {
  gap: 3px;
}

.bot-card-available .bot-title-wrap strong {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card-available .pair {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card-header {
  align-items: flex-start;
}

.bot-card-header-connected {
  display: flex;
  gap: var(--bot-card-logo-gap);
}

.bot-card-header-connected .bot-logo-wrap {
  transform: translateY(2px);
}

.bot-card-info {
  display: grid;
  width: min(
    100%,
    calc(
      var(--bot-card-metrics-width) -
      var(--bot-card-logo-size) -
      var(--bot-card-logo-gap)
    )
  );
  max-width: calc(
    var(--bot-card-metrics-width) -
    var(--bot-card-logo-size) -
    var(--bot-card-logo-gap)
  );
  min-width: 0;
  flex: 1 1 calc(
    var(--bot-card-metrics-width) -
    var(--bot-card-logo-size) -
    var(--bot-card-logo-gap)
  );
  gap: 5px;
}

.bot-card-title {
  min-width: 0;
  overflow: hidden;
  font-size: 19px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card-header-connected .status-pill {
  flex: 0 1 auto;
  margin-left: auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card-pair-row {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.bot-card-pair {
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card-ath-row {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 14px;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  color: rgba(154, 169, 183, 0.84);
  font-size: 10.8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.bot-card-ath-label {
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card-ath-value {
  overflow: visible;
  flex: 0 0 auto;
  color: rgba(215, 224, 232, 0.82);
  font-size: inherit;
  font-weight: 750;
  line-height: inherit;
  text-align: right;
  white-space: nowrap;
}

.bot-card-ath-value-stale {
  color: rgba(154, 169, 183, 0.8);
}

.bot-card-ath-value-zero {
  color: rgba(49, 208, 155, 0.86);
}

.bot-card-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.bot-logo-wrap,
.bot-logo,
.bot-logo-badge {
  width: var(--bot-card-logo-size);
  height: var(--bot-card-logo-size);
  flex: 0 0 var(--bot-card-logo-size);
  border-radius: 50%;
}

.bot-logo-wrap {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: transparent;
}

.bot-logo {
  display: block;
  object-fit: contain;
  background: transparent;
}

.bot-logo-wrap-cfx {
  background: rgba(255, 255, 255, 0.96);
}

.bot-logo-wrap-cfx .bot-logo {
  padding: 5px;
}

.bot-logo-badge {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(103, 167, 255, 0.16);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.bot-title-wrap {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.bot-title-wrap strong {
  font-size: 19px;
  line-height: 1.2;
}

.pair {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.runtime-price {
  display: flex;
  min-width: 0;
  max-width: 154px;
  align-items: baseline;
  flex: 0 1 auto;
  gap: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 12.8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.runtime-price-amount {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 1px;
  overflow: hidden;
}

.runtime-price-symbol {
  flex: 0 0 auto;
  color: rgba(244, 248, 251, 0.82);
}

.runtime-price-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.runtime-price-quote {
  flex: 0 0 auto;
  color: var(--muted);
  margin-left: 3px;
  font-size: 11px;
}

.runtime-price-placeholder {
  justify-content: flex-end;
  color: rgba(154, 169, 183, 0.72);
}

.runtime-price-change {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.1;
}

.runtime-price-change-up {
  color: var(--accent);
}

.runtime-price-change-down {
  color: var(--danger);
}

.runtime-price-change-flat,
.runtime-price-change-unknown {
  color: rgba(154, 169, 183, 0.82);
}

.bot-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bot-metrics {
  display: grid;
  width: min(100%, var(--bot-card-metrics-width));
  max-width: var(--bot-card-metrics-width);
  min-width: 0;
  flex: 1 1 auto;
  gap: 8px;
  margin-top: -2px;
}

.bot-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.bot-metric-row-orders {
  gap: 6px;
}

.bot-metric-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.bot-metric-value {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
}

.bot-metric-orders-main {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
}

.bot-metric-orders-main .bot-metric-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-metric-orders-count {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.15;
}

.bot-metric-avg-entry {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.bot-metric-avg-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.bot-metric-avg-value {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: inherit;
  font-weight: 700;
  text-overflow: ellipsis;
}

.bot-metric-avg-deviation {
  display: inline-block;
  flex: 0 0 auto;
  color: rgba(154, 169, 183, 0.86);
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.1;
}

.bot-metric-avg-deviation-up {
  color: var(--accent);
}

.bot-metric-avg-deviation-down {
  color: var(--danger);
}

.bot-metric-avg-deviation-flat {
  color: rgba(154, 169, 183, 0.86);
}

.capital-progress {
  width: 100%;
  max-width: 250px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(154, 169, 183, 0.16);
}

.capital-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--progress-fill-color, var(--accent));
}

.status-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-active,
.status-connected {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-stopped {
  color: var(--muted);
  background: rgba(154, 169, 183, 0.12);
}

.status-not-connected {
  color: var(--blue);
  background: rgba(103, 167, 255, 0.12);
}

.status-warning {
  color: var(--warning);
  background: rgba(242, 199, 92, 0.12);
}

.open-link,
.connect-link {
  align-self: flex-start;
  padding: 9px 14px;
}

.bot-card-body .open-link {
  align-self: center;
  flex: 0 0 auto;
}

.open-link {
  border-color: rgba(49, 208, 155, 0.55);
  background: var(--accent-soft);
}

.connect-link {
  align-self: center;
  min-height: 34px;
  padding: 6px 12px;
  border-color: rgba(103, 167, 255, 0.55);
  background: rgba(103, 167, 255, 0.12);
  flex: 0 0 auto;
}

.open-link:hover,
.connect-link:hover {
  border-color: var(--accent);
}

.bot-card-clickable .bot-card-header-connected .bot-logo-wrap {
  transform: translateY(1.8px);
}

.bot-card-clickable .bot-card-info {
  gap: 4.5px;
}

.bot-card-clickable .bot-card-title {
  font-size: 17.1px;
}

.bot-card-clickable .bot-card-pair-row {
  gap: 10.8px;
}

.bot-card-clickable .bot-card-ath-row {
  min-height: 12.6px;
  gap: 7.2px;
  font-size: 9.72px;
}

.bot-card-clickable .pair {
  font-size: 11.7px;
}

.bot-card-clickable .runtime-price {
  max-width: 138.6px;
  gap: 5.4px;
  font-size: 11.52px;
}

.bot-card-clickable .runtime-price-amount {
  gap: 0.9px;
}

.bot-card-clickable .runtime-price-quote {
  margin-left: 2.7px;
  font-size: 9.9px;
}

.bot-card-clickable .runtime-price-change {
  font-size: 10.35px;
}

.bot-card-clickable .bot-logo-badge {
  font-size: 9.9px;
}

.bot-card-clickable .bot-card-body {
  gap: 12.6px;
}

.bot-card-clickable .bot-metrics {
  gap: 7.2px;
  margin-top: -1.8px;
}

.bot-card-clickable .bot-metric-row {
  gap: 9px;
}

.bot-card-clickable .bot-metric-row-orders {
  gap: 5.4px;
}

.bot-card-clickable .bot-metric-label,
.bot-card-clickable .bot-metric-avg-label {
  font-size: 10.35px;
}

.bot-card-clickable .bot-metric-value,
.bot-card-clickable .bot-metric-orders-count {
  font-size: 11.7px;
}

.bot-card-clickable .bot-metric-orders-main {
  gap: 3.6px;
}

.bot-card-clickable .bot-metric-avg-entry {
  gap: 2.7px;
  font-size: 11.25px;
}

.bot-card-clickable .bot-metric-avg-deviation {
  font-size: 10.35px;
}

.bot-card-clickable .capital-progress {
  max-width: 225px;
  height: 5.4px;
}

.bot-card-clickable .status-pill {
  padding: 5.4px 8.1px;
  font-size: 10.8px;
}

.bot-card-clickable .open-link {
  min-height: 36px;
  padding: 8.1px 12.6px;
  font-size: 12.6px;
}

.bot-card-clickable .connect-link {
  padding: 5.4px 10.8px;
  font-size: 12.6px;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.detail-view {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 18px 18px;
  background: transparent;
}

#detail-view {
  padding-inline: 0;
}

.add-bot-view .cards-grid {
  margin-top: 14px;
}

.add-bot-title {
  margin-top: 14px;
  font-size: 18px;
  text-align: center;
}

.exchange-select-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exchange-select-content {
  display: grid;
  width: min(100%, 560px);
  min-width: 0;
  max-width: 100%;
  align-self: center;
  gap: 18px;
  padding: 2px 0 18px;
}

.exchange-select-bot {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 12px 0 16px;
  border-bottom: 1px solid rgba(38, 51, 69, 0.72);
}

.exchange-select-bot-logo-wrap,
.exchange-select-bot-logo,
.exchange-select-bot-badge {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
}

.exchange-select-bot-logo-wrap {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: transparent;
}

.exchange-select-bot-logo {
  display: block;
  object-fit: contain;
}

.exchange-select-bot-logo-wrap.bot-logo-wrap-cfx {
  background: rgba(255, 255, 255, 0.96);
}

.exchange-select-bot-logo-wrap.bot-logo-wrap-cfx .exchange-select-bot-logo {
  padding: 5px;
}

.exchange-select-bot-badge {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(103, 167, 255, 0.16);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.exchange-select-bot-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.exchange-select-bot-copy strong {
  overflow: hidden;
  font-size: 19px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-select-title {
  font-size: 22px;
  line-height: 1.2;
  text-align: center;
}

.exchange-select-title:focus {
  outline: none;
}

.exchange-select-options {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.exchange-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  width: 100%;
  min-width: 0;
  min-height: 70px;
  align-items: center;
  column-gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 15px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.exchange-select-row:not(:disabled) {
  border-color: rgba(49, 208, 155, 0.34);
  box-shadow: 0 0 0 1px rgba(49, 208, 155, 0.04),
    0 8px 20px rgba(49, 208, 155, 0.06);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.exchange-select-row:not(:disabled):hover {
  border-color: rgba(49, 208, 155, 0.82);
  background: #14202b;
  box-shadow: 0 0 0 1px rgba(49, 208, 155, 0.1),
    0 10px 24px rgba(49, 208, 155, 0.1);
}

.exchange-select-row:not(:disabled):active {
  background: rgba(49, 208, 155, 0.12);
}

.exchange-select-row-mexc:focus-visible,
.exchange-select-row-bybit:focus-visible,
.exchange-select-view > .back-button:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(49, 208, 155, 0.34);
  outline-offset: 2px;
}

.exchange-select-row-bybit:disabled {
  border-color: rgba(38, 51, 69, 0.72);
  background: rgba(17, 24, 33, 0.62);
  cursor: default;
}

.exchange-select-wordmark {
  display: block;
  width: 124px;
  height: 28px;
  min-width: 0;
  object-fit: contain;
  object-position: left center;
  justify-self: start;
}

.exchange-select-wordmark-bybit {
  opacity: 0.76;
}

.exchange-select-status {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.exchange-select-row:not(:disabled) .exchange-select-status {
  color: var(--accent);
}

.exchange-select-row-bybit .exchange-select-status {
  color: rgba(154, 169, 183, 0.82);
}

.exchange-select-row-bybit:not(:disabled) .exchange-select-wordmark-bybit {
  opacity: 1;
}

.exchange-select-chevron {
  color: var(--accent);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

@media (max-width: 360px) {
  .exchange-select-content {
    gap: 16px;
  }

  .exchange-select-row {
    grid-template-columns: minmax(0, 1fr) auto 15px;
    min-height: 66px;
    column-gap: 8px;
    padding-inline: 11px;
  }

  .exchange-select-wordmark {
    width: 108px;
    height: 25px;
  }
}

.connect-bot-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.connect-panel {
  display: grid;
  gap: 16px;
  padding: 14px 0 18px;
  border-bottom: 1px solid rgba(38, 51, 69, 0.72);
}

.connect-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.connect-logo-wrap,
.connect-logo,
.connect-badge {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
}

.connect-logo-wrap {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: transparent;
}

.connect-logo {
  display: block;
  object-fit: cover;
}

.connect-logo-wrap.bot-logo-wrap-cfx {
  background: rgba(255, 255, 255, 0.96);
}

.connect-logo-wrap.bot-logo-wrap-cfx .connect-logo {
  padding: 5px;
  object-fit: contain;
  background: transparent;
}

.connect-badge {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 25%, rgba(49, 208, 155, 0.28), rgba(17, 24, 33, 0.9));
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.connect-title-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.connect-title-copy h2 {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connect-instruction {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 12px;
  border: 1px solid rgba(49, 208, 155, 0.22);
  border-radius: 8px;
  background: rgba(49, 208, 155, 0.08);
  text-align: center;
}

.connect-instruction h3 {
  font-size: 15px;
}

.connect-instruction p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.connect-secondary-button {
  min-height: 36px;
  border: 1px solid rgba(103, 167, 255, 0.38);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(103, 167, 255, 0.1);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.connect-secondary-button:hover,
.connect-secondary-button:focus-visible {
  border-color: rgba(103, 167, 255, 0.7);
}

.connect-form {
  display: grid;
  gap: 12px;
}

.connect-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.connect-field-guided {
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(38, 51, 69, 0.72);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.22);
}

.connect-field-required-step {
  border-color: rgba(242, 199, 92, 0.38);
  background: rgba(242, 199, 92, 0.06);
}

.connect-field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.connect-step-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(103, 167, 255, 0.34);
  border-radius: 6px;
  padding: 3px 6px;
  color: var(--text);
  background: rgba(103, 167, 255, 0.1);
  font-size: 10px;
  line-height: 1;
}

.connect-field input,
.connect-field select {
  min-height: 44px;
  width: 100%;
  border: 1px solid rgba(38, 51, 69, 0.86);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(7, 10, 15, 0.42);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.connect-field select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.connect-field input:focus,
.connect-field select:focus {
  border-color: rgba(49, 208, 155, 0.58);
  outline: none;
}

.connect-field input:focus-visible,
.connect-field select:focus-visible {
  outline: 2px solid rgba(49, 208, 155, 0.26);
  outline-offset: 2px;
}

.connect-field.has-error input,
.connect-field.has-error select {
  border-color: rgba(255, 107, 107, 0.74);
}

.connect-field.has-error input:focus,
.connect-field.has-error input:focus-visible,
.connect-field.has-error select:focus,
.connect-field.has-error select:focus-visible {
  border-color: rgba(255, 107, 107, 0.9);
}

.connect-field-hint,
.connect-field-error {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.connect-field-hint {
  color: var(--muted);
}

.connect-field-error {
  color: var(--danger);
}

.connect-message {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.connect-message.error {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.1);
}

.connect-message.warning {
  color: var(--warning);
  background: rgba(242, 199, 92, 0.1);
}

.connect-submit-button,
.connect-open-bot-button {
  min-height: 44px;
  border: 1px solid rgba(49, 208, 155, 0.48);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(49, 208, 155, 0.13);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.connect-submit-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.connect-submit-button:not(:disabled):hover,
.connect-open-bot-button:hover {
  border-color: var(--accent);
}

.connect-success-panel {
  justify-items: start;
}

.connect-success-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(49, 208, 155, 0.42);
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 47%, rgba(49, 208, 155, 0.9) 48% 56%, transparent 57%),
    linear-gradient(45deg, transparent 39%, rgba(49, 208, 155, 0.9) 40% 48%, transparent 49%),
    rgba(49, 208, 155, 0.12);
}

.connect-success-panel p {
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.bybit-success-panel {
  width: 100%;
}

.bybit-success-facts {
  display: grid;
  width: 100%;
  gap: 8px;
  margin: 0;
}

.bybit-success-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.bybit-success-facts dt,
.bybit-success-facts dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.bybit-success-facts dt {
  color: var(--muted);
  font-weight: 700;
}

.bybit-success-facts dd {
  color: var(--text);
  font-weight: 800;
  text-align: right;
}

.api-key-instruction-panel {
  gap: 14px;
}

.api-key-instruction-header {
  display: grid;
  gap: 6px;
}

.api-key-instruction-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
}

.bybit-instruction-panel .api-key-instruction-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bybit-prerequisite {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(49, 208, 155, 0.22);
  border-radius: 8px;
  color: var(--text);
  background: rgba(49, 208, 155, 0.07);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.bybit-guide {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bybit-guide-section {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.bybit-guide-heading {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
}

.bybit-guide-section > p {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.bybit-open-button {
  justify-self: start;
  min-height: 34px;
}

.bybit-option-list {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.bybit-option-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  background: rgba(7, 10, 15, 0.2);
}

.bybit-option-label,
.bybit-option-value {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}

.bybit-option-label {
  color: var(--muted);
  font-weight: 750;
}

.bybit-option-value {
  color: var(--text);
  font-weight: 850;
}

.bybit-key-name-accent {
  color: var(--warning);
}

.bybit-option-value .api-ip-copy {
  width: 100%;
  margin-top: 0;
  margin-left: 0;
}

.bybit-option-value .api-ip-copy-status {
  margin: 0;
}

.bybit-permission-allow {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.42;
}

.bybit-permission-allow {
  border: 1px solid rgba(49, 208, 155, 0.3);
  color: var(--text);
  background: rgba(49, 208, 155, 0.09);
}

.bybit-permission-allow span {
  color: var(--muted);
  font-weight: 750;
}

.bybit-permission-allow strong {
  color: var(--accent);
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
}

.bybit-finish-steps {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.bybit-finish-steps li::marker {
  color: var(--accent);
}

.bybit-instruction-done-button {
  justify-self: start;
}

@media (max-width: 360px) {
  .bybit-success-facts > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .bybit-success-facts dd {
    text-align: left;
  }

  .bybit-guide-section {
    padding: 11px;
  }

  .bybit-instruction-done-button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .bybit-option-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.api-key-steps {
  --api-key-list-offset: 20px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: var(--api-key-list-offset);
  color: var(--text);
  font-size: 13px;
  line-height: 1.42;
}

.api-key-steps > li::marker {
  color: var(--accent);
  font-weight: 900;
}

.api-key-steps ul {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-left: 17px;
  color: var(--muted);
}

.api-key-steps-continued {
  margin-top: 0;
}

.api-key-intro-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.api-key-intro-copy {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.api-key-intro-copy p {
  margin: 0;
}

.api-key-step-path {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.api-key-term {
  color: var(--accent);
  font-weight: 900;
}

.api-key-mexc-button {
  min-height: 34px;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .api-key-intro-action {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .api-key-mexc-button {
    justify-self: start;
  }
}

.api-key-screenshots {
  display: block;
}

.api-key-screenshot-set {
  display: none;
  gap: 10px;
}

html[lang="ru"] .api-key-screenshot-set-ru,
html[lang="en"] .api-key-screenshot-set-en {
  display: grid;
}

.api-key-screenshot-set img {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  object-fit: contain;
}

.api-ip-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: calc(100% + var(--api-key-list-offset));
  margin-left: calc(-1 * var(--api-key-list-offset));
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(49, 208, 155, 0.18);
  border-radius: 8px;
  background: rgba(49, 208, 155, 0.07);
}

.api-ip-copy code {
  overflow: hidden;
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.api-ip-copy-button {
  min-height: 32px;
  padding-inline: 10px;
}

.api-ip-copy-status {
  margin: 7px 0 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.api-ip-copy-status.warning {
  color: var(--warning);
}

.api-key-warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(242, 199, 92, 0.2);
  border-radius: 8px;
  color: var(--warning);
  background: rgba(242, 199, 92, 0.08);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.api-key-secret-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.detail-header {
  align-items: flex-start;
  margin: 0 0 12px;
}

.detail-bot-card {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
}

.detail-bot-logo-wrap,
.detail-bot-logo,
.detail-bot-badge {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
}

.detail-bot-logo-wrap {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: transparent;
}

.detail-bot-logo {
  display: block;
  object-fit: contain;
  background: transparent;
}

.detail-bot-logo-wrap.bot-logo-wrap-cfx {
  background: rgba(255, 255, 255, 0.96);
}

.detail-bot-logo-wrap.bot-logo-wrap-cfx .detail-bot-logo {
  padding: 6px;
}

.detail-bot-badge {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(103, 167, 255, 0.16);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.detail-bot-copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}

.detail-bot-copy h2,
.detail-bot-copy .pair {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-control-panel,
.open-orders {
  display: grid;
  margin: 0 0 12px;
}

.parameters-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.parameters-toggle {
  display: flex;
  min-height: 42px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.parameters-toggle:hover {
  color: var(--accent);
}

.parameters-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.parameters-toggle.expanded .parameters-chevron {
  transform: rotate(225deg);
}

.parameters-content {
  border-top: 1px solid var(--border);
}

.parameters-list {
  display: grid;
  padding: 0 13px 4px;
}

.parameters-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.parameters-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.parameters-list dd {
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 14px;
  font-weight: 900;
}

.parameters-actions {
  display: block;
  padding: 0 13px 13px;
}

.parameters-edit-button,
.parameters-edit-save-button {
  min-height: 38px;
  width: 100%;
  border: 1px solid rgba(49, 208, 155, 0.28);
  border-radius: 8px;
  padding: 8px 13px;
  color: var(--accent);
  background: var(--accent-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.parameters-edit-button:hover,
.parameters-edit-button:focus-visible,
.parameters-edit-save-button:hover,
.parameters-edit-save-button:focus-visible {
  border-color: rgba(49, 208, 155, 0.58);
}

.parameters-edit-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.parameters-edit-panel {
  display: grid;
  gap: 14px;
  padding: 14px 0 18px;
}

.parameters-edit-header {
  padding: 2px 0 0;
}

.parameters-edit-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  line-height: 1.35;
}

.parameters-edit-message.success {
  color: var(--accent);
  background: rgba(49, 208, 155, 0.1);
}

.parameters-edit-message.warning {
  color: var(--warning);
  background: rgba(242, 199, 92, 0.1);
}

.parameters-edit-message.error {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.1);
}

.parameters-edit-form {
  display: grid;
  gap: 10px;
}

.parameters-edit-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parameters-edit-label-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  min-width: 0;
  line-height: 1.3;
}

.parameters-edit-label-row > span {
  min-width: 0;
}

.parameters-edit-label-row > small {
  color: rgba(136, 153, 174, 0.92);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .parameters-edit-label-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .parameters-edit-label-row > small {
    text-align: left;
    white-space: normal;
  }
}

.parameters-edit-field input {
  min-height: 42px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(38, 51, 69, 0.86);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(7, 10, 15, 0.42);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.parameters-edit-field input:focus {
  border-color: rgba(49, 208, 155, 0.58);
  outline: none;
}

.parameters-edit-field input:focus-visible {
  outline: 2px solid rgba(49, 208, 155, 0.26);
  outline-offset: 2px;
}

.parameters-edit-field.has-error input {
  border-color: rgba(255, 107, 107, 0.72);
}

.parameters-edit-field em,
.parameters-edit-toggle em {
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.3;
}

.parameters-edit-error {
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.3;
}

.parameters-edit-toggle {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(38, 51, 69, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.parameters-edit-toggle > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.parameters-edit-toggle strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.parameters-edit-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.parameters-edit-toggle i {
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid rgba(154, 169, 183, 0.28);
  border-radius: 999px;
  background: rgba(154, 169, 183, 0.13);
  transition: border-color 160ms ease, background 160ms ease;
}

.parameters-edit-toggle i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: background 160ms ease, transform 160ms ease;
}

.parameters-edit-toggle input:checked + i {
  border-color: rgba(49, 208, 155, 0.48);
  background: rgba(49, 208, 155, 0.18);
}

.parameters-edit-toggle input:checked + i::after {
  background: var(--accent);
  transform: translateX(20px);
}

.parameters-edit-toggle input:focus-visible + i {
  outline: 2px solid rgba(49, 208, 155, 0.26);
  outline-offset: 2px;
}

.parameters-edit-toggle .parameters-edit-error {
  grid-column: 1 / -1;
}

.parameters-edit-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.parameters-edit-save-button {
  width: 100%;
  color: #06110d;
  background: var(--accent);
}

.parameters-edit-save-button:disabled {
  cursor: default;
  opacity: 0.56;
}

.open-orders {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.open-orders-toggle {
  display: flex;
  min-height: 42px;
  width: 100%;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 13px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.open-orders-toggle:hover {
  color: var(--accent);
}

.open-orders-toggle > span:first-child {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-orders-title-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.open-orders-title-count {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.1;
}

.open-orders-toggle.expanded .parameters-chevron {
  transform: rotate(225deg);
}

.open-orders-toggle-meta {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.open-orders-count-badge {
  display: none;
  min-width: 24px;
  border: 1px solid rgba(49, 208, 155, 0.22);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(49, 208, 155, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.open-orders-average-entry {
  display: inline-flex;
  max-width: 200px;
  min-width: 0;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-orders-average-entry-label {
  color: var(--muted);
  font-weight: 800;
}

.open-orders-average-entry-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.open-orders-content {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 380px) {
  .open-orders-toggle-meta {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .open-orders-average-entry {
    max-width: none;
  }
}

.open-orders-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.open-orders-message.warning {
  color: var(--warning);
}

.open-orders-message.error {
  color: var(--danger);
}

.open-orders-list {
  display: grid;
  gap: 9px;
}

.open-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  align-items: end;
  gap: 16px;
  padding: 8px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.open-order-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.open-order-summary {
  display: grid;
  align-self: center;
  gap: 5px;
  min-width: 0;
}

.open-order-details {
  display: grid;
  justify-self: end;
  gap: 7px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

.open-order-header {
  min-width: 0;
}

.open-order-header strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.open-order-chips {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-height: 17px;
  gap: 5px;
}

.open-order-chip {
  border: 1px solid rgba(154, 169, 183, 0.2);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
}

.open-order-chip-autobuy {
  border-color: rgba(49, 208, 155, 0.26);
  background: rgba(49, 208, 155, 0.1);
  color: var(--accent);
}

.open-order-amount {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.open-order-rows {
  display: grid;
  margin: 0;
  gap: 5px;
  padding-top: 1px;
}

.open-order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 12px;
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.open-order-row dt {
  color: var(--muted);
  white-space: nowrap;
}

.open-order-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.open-order-row-selling dt {
  color: rgba(49, 208, 155, 0.78);
}

.open-order-row-selling dd {
  color: #e9fff7;
}

.open-order-time {
  justify-self: end;
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}

@media (max-width: 520px) {
  .open-order-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  .open-order-row dt {
    text-align: right;
  }
}

.open-orders-pagination {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  justify-self: stretch;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(103, 167, 255, 0.2);
  border-radius: 11px;
  padding: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014)),
    rgba(7, 10, 15, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.022);
}

.open-orders-page-button {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 248, 251, 0.78);
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.open-orders-page-button + .open-orders-page-button {
  border-left: 1px solid rgba(255, 255, 255, 0.055);
}

.open-orders-page-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#open-orders-first-page .open-orders-page-icon path:nth-child(2),
#open-orders-last-page .open-orders-page-icon path:nth-child(2) {
  display: none;
}

.open-orders-page-button:not(:disabled):hover,
.open-orders-page-button:not(:disabled):focus-visible {
  background: rgba(49, 208, 155, 0.105);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(49, 208, 155, 0.18);
}

.open-orders-page-button:not(:disabled):active {
  background: rgba(49, 208, 155, 0.16);
}

.open-orders-page-button:disabled {
  cursor: default;
  color: rgba(154, 169, 183, 0.38);
  opacity: 1;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 10px max(4px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(7, 10, 15, 0.94);
  backdrop-filter: blur(14px);
}

body.is-bottom-nav-visible .bottom-nav {
  display: grid;
}

.bottom-nav-button {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.bottom-nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.bottom-nav-button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

html[lang="ru"] .bottom-nav-button {
  gap: 4px;
  padding-inline: 5px;
  font-size: 12px;
}


body.is-onboarding-active .shell {
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

body.is-onboarding-active .bottom-nav {
  display: none;
  pointer-events: none;
}

body.is-onboarding-active #list-view {
  overflow: hidden;
}

body.is-onboarding-active .onboarding-view {
  min-height: 100%;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

body.is-onboarding-active .onboarding-controls {
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

body.is-onboarding-active.is-onboarding-first-slide .hero .brand-wordmark {
  display: none;
}

body.is-onboarding-active.is-onboarding-first-slide
  .onboarding-slide[data-onboarding-slide="0"]
  .onboarding-slide0-wordmark {
  width: clamp(240px, 73vw, 292px);
}

body.is-onboarding-active.is-onboarding-first-slide
  .onboarding-slide[data-onboarding-slide="0"]
  .onboarding-exchange-subtitle {
  width: clamp(260px, 82vw, 330px);
  max-width: 100%;
  font-size: 13.5px;
  line-height: 1.2;
  letter-spacing: -0.08px;
}

body.is-onboarding-active.is-onboarding-first-slide
  .onboarding-slide[data-onboarding-slide="0"]
  .onboarding-slide0-overlay {
  transform: translateY(16px);
}

body.is-onboarding-active.is-onboarding-first-slide
  .onboarding-slide[data-onboarding-slide="0"]
  .onboarding-bot-scroll-visual::after {
  background:
    linear-gradient(
      180deg,
      var(--bg) 0%,
      rgba(7, 10, 15, 0.18) 12%,
      transparent 24%,
      transparent 76%,
      rgba(7, 10, 15, 0.18) 88%,
      var(--bg) 100%
    ),
    linear-gradient(
      180deg,
      transparent 0%,
      transparent 18%,
      rgba(7, 10, 15, 0.42) 30%,
      rgba(7, 10, 15, 0.96) 41%,
      rgba(7, 10, 15, 0.98) 59%,
      rgba(7, 10, 15, 0.94) 68%,
      rgba(7, 10, 15, 0.54) 78%,
      transparent 90%,
      transparent 100%
    );
}

body.is-onboarding-active.is-onboarding-first-slide .shell {
  position: relative;
  padding-top: 0;
}

body.is-onboarding-active.is-onboarding-first-slide .hero {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 16px;
  left: 16px;
  margin: 0;
  pointer-events: none;
}

/* Keep session controls clickable while the welcome header passes through gestures. */
body.is-onboarding-active.is-onboarding-first-slide .hero-session-actions button {
  pointer-events: auto;
}

@media (max-width: 760px) {
  .shell {
    padding: 10px 12px calc(54px + env(safe-area-inset-bottom));
  }

  body.is-onboarding-active.is-onboarding-first-slide .hero {
    top: 10px;
    right: 12px;
    left: 12px;
  }

  .hero,
  .section-heading,
  .detail-header,
  .balance-hero {
    align-items: center;
    flex-direction: row;
    justify-content: center;
  }

  .detail-bot-card {
    justify-content: space-between;
  }

  .back-button {
    width: 100%;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-slide {
    grid-template-rows: minmax(220px, 1fr) auto;
  }

  .onboarding-point-grid {
    grid-template-columns: 1fr;
  }

  .bot-card {
    --bot-card-logo-gap: 6px;
  }

  .bot-card-clickable {
    --bot-card-logo-gap: 5.4px;
  }

  .bot-card-pair-row {
    align-items: baseline;
    flex-direction: row;
    gap: 6px;
  }

  .bot-card-clickable .bot-card-pair-row {
    gap: 5.4px;
  }

  .bot-card-ath-row {
    gap: 6px;
  }

  .bot-card-clickable .bot-card-ath-row {
    gap: 5.4px;
  }

  .bot-card-pair {
    overflow: visible;
    flex: 0 0 auto;
    text-overflow: clip;
  }

  .runtime-price {
    max-width: none;
    align-self: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 4px;
    font-size: 12.5px;
    overflow: visible;
  }

  .bot-card-clickable .runtime-price {
    max-width: none;
    gap: 3.6px;
    font-size: 11.25px;
  }

  .runtime-price-amount,
  .runtime-price-value {
    overflow: visible;
    text-overflow: clip;
  }

  .runtime-price-change {
    font-size: 10.8px;
  }

  .bot-metric-avg-deviation {
    font-size: 10.8px;
  }

  .bot-card-clickable .runtime-price-change,
  .bot-card-clickable .bot-metric-avg-deviation {
    font-size: 9.72px;
  }

  .bot-card-body .open-link {
    min-width: 56px;
    padding-inline: 10px;
    text-align: center;
  }

  .bot-card-clickable .bot-card-body .open-link {
    min-width: 50.4px;
    padding-inline: 9px;
  }

  .parameters-list div {
    align-items: flex-start;
  }








  .balance-value-cell > strong {
    font-size: 24px;
  }

  .hero {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    min-height: 28px;
    margin-bottom: 12px;
  }

  .brand-wordmark-logo {
    width: 108px;
  }

  h1 {
    font-size: 30px;
  }
}

@media (max-width: 340px) {
  .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-overlay {
    width: calc(100% - 16px);
    padding-inline: 4px;
  }

  .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-brand {
    gap: 6px;
  }

  .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-wordmark {
    width: 200px;
  }

  .onboarding-slide[data-onboarding-slide="0"] .onboarding-exchange-subtitle {
    font-size: 13px;
  }

  .onboarding-slide[data-onboarding-slide="0"] .onboarding-bot-scroll-visual::after {
    background:
      linear-gradient(
        180deg,
        var(--bg) 0%,
        rgba(7, 10, 15, 0.18) 11%,
        transparent 22%,
        transparent 78%,
        rgba(7, 10, 15, 0.18) 89%,
        var(--bg) 100%
      ),
      linear-gradient(
        180deg,
        transparent 0%,
        transparent 22%,
        rgba(7, 10, 15, 0.3) 33%,
        rgba(7, 10, 15, 0.84) 45%,
        rgba(7, 10, 15, 0.88) 55%,
        rgba(7, 10, 15, 0.3) 67%,
        transparent 78%,
        transparent 100%
      );
  }

}

/* browser-auth-v1: the existing Mini App, opened through a browser session. */
.hero-session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Match the signed-in web header without adding height to the Mini App hero. */
.hero-session-actions:has(.browser-logout-button:not([hidden])) .language-toggle-button {
  min-height: 34px;
}

.browser-logout-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.browser-logout-button:hover,
.browser-logout-button:focus-visible {
  border-color: rgba(49, 208, 155, 0.3);
  color: var(--text);
}

.browser-login[hidden],
.browser-logout-button[hidden] {
  display: none !important;
}

body.is-browser-login {
  overflow: auto;
}

body.is-browser-login .shell,
body.is-browser-login .loading-splash {
  visibility: hidden;
  pointer-events: none;
}

.browser-login {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  align-items: safe center;
  justify-items: center;
  min-height: 100dvh;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 18%, rgba(49, 208, 155, 0.11), transparent 32%),
    radial-gradient(circle at 82% 85%, rgba(49, 140, 208, 0.09), transparent 34%),
    #070a0f;
}

.browser-login-card {
  width: min(420px, 100%);
  padding: 32px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: #0f161f;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.browser-login-brand {
  display: inline-flex;
  align-items: center;
}

.browser-login-brand img {
  display: block;
  width: auto;
  height: 30px;
}

.browser-login h1 {
  margin: 24px 0 0;
  color: var(--text);
  font-size: clamp(23px, 5vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.browser-login-widget {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

.browser-login-message {
  margin: 12px 0 0;
  min-height: 36px;
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.browser-login-message.is-error {
  color: #f2b8b5;
}

.browser-login-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.browser-login-back:hover,
.browser-login-back:focus-visible {
  color: var(--text);
}

@media (max-width: 560px) {
  .browser-login {
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .browser-login-card {
    padding: 28px 22px;
  }

  .browser-login-brand img {
    height: 26px;
  }
}

@media (max-width: 280px) {
  .bot-card {
    padding-inline: 12px;
  }

  .bot-card-header-connected {
    gap: 4px;
  }

  .bot-card-clickable .bot-card-ath-row {
    font-size: 9.25px;
  }
}

/* home-card-exchange-brand-v2 */
#connected-bots {
  align-items: stretch;
}

.bot-card-clickable {
  --bot-card-logo-size: 30px;
  --bot-card-logo-gap: 8px;
  --home-card-metric-divider-block-size: 26px;
  container-name: home-bot-card;
  container-type: inline-size;
  display: grid;
  width: 100%;
  height: max-content;
  min-width: 0;
  min-height: 0;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  gap: 0;
  padding: 7px 12px 10px;
}

.bot-card-clickable > :not(:first-child) {
  margin-top: 11px;
}

.bot-card-clickable > .bot-card-capital {
  margin-top: 12.75px;
}

.bot-card-clickable > .bot-card-header-connected,
.bot-card-clickable > .bot-card-stat-grid,
.bot-card-clickable > .bot-card-capital {
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
}

.bot-card-clickable > .bot-card-header-connected {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
}

.bot-card-clickable .bot-card-identity-connected {
  min-width: 0;
  gap: var(--bot-card-logo-gap);
}

.bot-card-clickable .bot-card-header-connected .bot-logo-wrap {
  flex: 0 0 var(--bot-card-logo-size);
  transform: none;
}

.bot-card-clickable .bot-card-info {
  width: auto;
  max-width: none;
  min-width: 0;
  flex: 1 1 auto;
}

.bot-card-clickable .bot-card-pair-title {
  display: block;
  min-width: 0;
  overflow: visible;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.1px;
  line-height: 1.15;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable .bot-card-header-connected .status-pill {
  max-width: none;
  margin: 0;
  padding: 4px 7px;
  overflow: visible;
  justify-self: end;
  font-size: 9.5px;
  line-height: 1.1;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable > .bot-card-stat-grid {
  display: grid;
  box-sizing: border-box;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 11px 0 0;
  padding: 0;
}

.bot-card-clickable > .bot-card-market-grid {
  margin-top: 0;
}

.bot-card-clickable .bot-card-stat-cell {
  position: relative;
  display: grid;
  box-sizing: border-box;
  min-width: 0;
  align-content: start;
  gap: 3px;
  margin: 0;
  padding: 0 4px;
}

.bot-card-clickable .bot-card-market-grid .bot-card-stat-cell {
  min-height: calc(3lh + 3px);
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0;
  font-size: 10.5px;
  line-height: 1.15;
}

.bot-card-clickable .bot-card-market-grid .bot-card-stat-label {
  grid-row: 2;
}

.bot-card-clickable .bot-card-market-grid .bot-card-stat-value {
  grid-row: 3;
}

.bot-card-clickable .bot-card-stat-cell:first-child {
  justify-items: start;
}

.bot-card-clickable .bot-card-stat-cell:nth-child(2) {
  justify-items: center;
}

.bot-card-clickable .bot-card-stat-cell:nth-child(3) {
  justify-items: end;
}

.bot-card-clickable .bot-card-stat-cell:first-child {
  padding-inline-start: 0;
}

.bot-card-clickable .bot-card-stat-cell:nth-child(3) {
  padding-inline-end: 0;
}

.bot-card-clickable .bot-card-stat-cell:nth-child(n + 2)::before {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 0;
  inline-size: 1px;
  block-size: var(--home-card-metric-divider-block-size);
  background: rgba(154, 169, 183, 0.14);
  content: "";
  pointer-events: none;
  transform: translateY(-50%);
}

.bot-card-clickable .bot-card-stat-label,
.bot-card-clickable .bot-card-stat-value {
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.bot-card-clickable .bot-card-stat-label {
  overflow: visible;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable .bot-card-stat-value {
  display: flex;
  align-items: baseline;
  overflow: visible;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.12px;
  line-height: 1.15;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable .bot-card-market-grid .bot-card-stat-value {
  min-height: 0;
  margin-top: 3px;
  align-items: flex-start;
}

.bot-card-clickable .bot-card-price-compound-cell .bot-card-stat-value {
  width: 100%;
}

.bot-card-clickable .bot-card-price-compound {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 4px;
  row-gap: 2px;
}

.bot-card-clickable .runtime-price,
.bot-card-clickable .runtime-price-amount {
  display: flex;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  align-items: baseline;
  gap: 1px;
  overflow: visible;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.bot-card-clickable .bot-card-price-compound .runtime-price-value {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bot-card-clickable .runtime-price-value,
.bot-card-clickable .runtime-price-quote,
.bot-card-clickable .bot-metric-avg-value {
  overflow: visible;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable .runtime-price-quote {
  margin-left: 2px;
  color: var(--muted);
  font-size: 9px;
}

.bot-card-clickable .bot-card-percent,
.bot-card-clickable .runtime-price-change,
.bot-card-clickable .bot-card-ath-value,
.bot-card-clickable .bot-metric-avg-deviation,
.bot-card-clickable .bot-metric-orders-count {
  min-width: 0;
  margin: 0;
  overflow: visible;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable .runtime-price-change-up,
.bot-card-clickable .bot-metric-avg-deviation-up {
  color: var(--accent);
}

.bot-card-clickable .runtime-price-change-down,
.bot-card-clickable .bot-metric-avg-deviation-down {
  color: var(--danger);
}

.bot-card-clickable .runtime-price-change-flat,
.bot-card-clickable .runtime-price-change-unknown,
.bot-card-clickable .bot-metric-avg-deviation-flat,
.bot-card-clickable .bot-metric-avg-deviation-unknown {
  color: rgba(154, 169, 183, 0.86);
}

.bot-card-clickable .bot-card-ath-value {
  color: rgba(215, 224, 232, 0.82);
}

.bot-card-clickable .bot-card-ath-value-zero {
  color: var(--accent);
}

.bot-card-clickable .bot-card-ath-value-stale {
  color: rgba(154, 169, 183, 0.8);
}

.bot-card-clickable .bot-card-average-cell .bot-card-stat-value {
  width: 100%;
  justify-content: center;
}

.bot-card-clickable .bot-card-average-cell .bot-metric-avg-value {
  max-width: 100%;
}

.bot-card-clickable .home-card-exchange-cell {
  align-content: end;
  justify-items: end;
  grid-template-rows: minmax(0, 1fr);
  padding-inline-end: 0;
}

.bot-card-clickable .home-card-exchange-cell .bot-card-stat-label {
  display: none;
}

.bot-card-clickable .home-card-exchange-cell .bot-card-stat-value {
  grid-row: 1;
  width: 100%;
  height: 100%;
  align-self: stretch;
  align-items: flex-end;
  justify-content: flex-end;
}

.bot-card-clickable .home-card-exchange-brand {
  display: grid;
  inline-size: min(68px, 100%);
  block-size: 20px;
  place-items: end;
  pointer-events: none;
}

.bot-card-clickable .home-card-exchange-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 12px;
  max-height: 20px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.bot-card-clickable .home-card-exchange-logo-bybit { height: 18px; }

/* Share the label/value tracks and the numeric baseline with exchange marks. */
#connected-bots .bot-card-clickable > .bot-card-position-grid {
  grid-template-rows: auto auto;
  row-gap: 3px;
}
#connected-bots .bot-card-position-grid > .bot-card-stat-cell {
  grid-row: 1 / span 2;
  grid-template-rows: subgrid;
}
#connected-bots .bot-card-position-grid .bot-card-stat-label { grid-row: 1; }
#connected-bots .bot-card-position-grid .bot-card-stat-value {
  grid-row: 2;
  height: auto;
  min-height: 0;
  align-self: baseline;
  align-items: baseline;
}
#connected-bots .home-card-exchange-brand {
  display: inline-block;
  block-size: auto;
  line-height: 0;
  text-align: right;
}
#connected-bots .home-card-exchange-logo {
  display: inline-block;
  vertical-align: baseline;
}

.bot-card-clickable > .bot-card-capital {
  display: grid;
  gap: 5px;
}

.bot-card-clickable .bot-metric-row-capital {
  display: grid;
  min-width: 0;
  align-items: baseline;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

.bot-card-clickable .bot-metric-row-capital .bot-metric-label {
  min-width: max-content;
  overflow: visible;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.15;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable .bot-metric-row-capital .bot-metric-value {
  min-width: 0;
  overflow: visible;
  justify-self: end;
  font-size: 10.75px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.1px;
  line-height: 1.15;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

.bot-card-clickable .capital-progress-slot {
  display: block;
  width: 100%;
  min-width: 0;
  pointer-events: none;
}

.bot-card-clickable .capital-progress {
  width: 100%;
  max-width: none;
  height: 5px;
}

/* A disabled limit is a neutral divider, not a fully used capital limit. */
.bot-card-clickable [data-progress-state="limit_disabled"] .capital-progress {
  background: transparent;
}

.bot-card-clickable .capital-progress-bar-limit-disabled {
  position: relative;
  top: 1.5px;
  height: 2px;
  background: #64707d;
  background-image: none;
}

.bot-card-clickable .capital-progress-slot-reserved {
  visibility: hidden;
}

.detail-bot-actions {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.detail-open-bot-action:empty,
.detail-connect-keys-action:empty {
  display: none;
}

.detail-open-bot-link,
.detail-connect-keys-link,
.detail-bot-actions > .connect-secondary-button {
  display: grid;
  width: 100%;
  min-height: 44px;
  place-items: center;
  margin: 0;
  padding: 9px 14px;
  text-align: center;
}

@container home-bot-card (min-width: 281px) and (max-width: 320px) {
  .bot-card-clickable .bot-card-stat-cell {
    padding-inline: 1px;
  }
}

@container home-bot-card (max-width: 300px) {
  .bot-card-clickable > :not(:first-child) {
    margin-top: 11px;
  }

  .bot-card-clickable > .bot-card-market-grid {
    margin-top: 0;
  }

  .bot-card-clickable > .bot-card-capital {
    margin-top: 12.75px;
  }

  .bot-card-clickable .bot-card-stat-cell {
    padding-inline: 0;
  }

  .bot-card-clickable .bot-card-price-compound {
    column-gap: 1px;
    letter-spacing: -0.65px;
  }

  .bot-card-clickable .bot-card-market-grid .bot-card-stat-cell {
    min-height: calc(4lh - 6px);
  }

  .bot-card-clickable .bot-card-market-grid .bot-card-stat-value {
    margin-top: clamp(6.2px, calc(0.43lh + 1px), 7.5px);
  }
}

@container home-bot-card (max-width: 280px) {
  .bot-card-clickable > .bot-card-header-connected,
  .bot-card-clickable .bot-card-identity-connected {
    gap: 6px;
  }

  .bot-card-clickable .bot-card-pair-title {
    font-size: 14px;
  }

  .bot-card-clickable .bot-card-stat-cell {
    padding-inline: 1px;
  }

  .bot-card-clickable .bot-card-price-compound {
    letter-spacing: -1.25px;
  }

  .bot-card-clickable .bot-card-position-grid .bot-card-stat-value {
    min-height: 2lh;
    align-items: flex-end;
  }

  .bot-card-clickable .home-card-exchange-cell .bot-card-stat-value {
    min-height: 0;
    align-items: flex-end;
  }

  .bot-card-clickable .bot-metric-avg-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }

}

@media (max-width: 339px) {
  .bot-card-clickable {
    padding-inline: 10px;
  }
}

/* Home: 20% larger technical values, without changing the logo or pair title.
   Both metric rows share equal columns and aligned dividers. */
#connected-bots .bot-card-clickable {
  --home-card-metric-divider-block-size: 31.2px;
  padding: 8.4px 14.4px 12px;
}
#connected-bots .bot-card-stat-label,
#connected-bots .bot-metric-row-capital .bot-metric-label { font-size:11.4px; }
#connected-bots .bot-card-stat-value,
#connected-bots .bot-card-market-grid .bot-card-stat-cell { font-size:12.6px; }
#connected-bots .bot-metric-row-capital .bot-metric-value { font-size:12.9px; }
#connected-bots .runtime-price-quote { font-size:10.8px; }
#connected-bots .bot-card-clickable > .bot-card-stat-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
#connected-bots .bot-card-price-compound { letter-spacing:-.12px; column-gap:6px; }
#connected-bots .bot-card-price-compound .runtime-price-value,
#connected-bots .bot-metric-avg-value { white-space:nowrap; overflow-wrap:normal; }
#connected-bots .bot-card-clickable > .bot-card-capital { margin-top:15.3px; gap:6px; }
#connected-bots .bot-card-clickable > .bot-card-position-grid { margin-top:13.2px; }
#connected-bots .capital-progress { height:6px; }
@media (max-width:680px) {
  #connected-bots { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:359px) {
  #connected-bots .bot-card-clickable { padding-inline:10px; }
}

/* Shared navigation for the application screens. */
.screen-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 0 0 14px;
}

.browser-telegram-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid rgba(49, 208, 155, 0.5);
  border-radius: 12px;
  background: rgba(49, 208, 155, 0.12);
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  cursor: pointer;
}

.browser-telegram-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.browser-telegram-button:disabled {
  opacity: 0.7;
  cursor: wait;
}
.browser-login-brand:focus-visible,
.browser-login-back:focus-visible { outline:2px solid var(--accent); outline-offset:4px; border-radius:6px; }

.screen-heading h1 {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: clamp(19px, 3.8vw, 24px);
  line-height: 1.25;
  font-weight: 800;
}

.screen-back,
.screen-action,
.detail-view > .back-button {
  display: inline-flex;
  width: auto;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.screen-back:hover,
.screen-action:hover,
.detail-view > .back-button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.screen-back:focus-visible,
.screen-action:focus-visible,
.wallet-topup-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.screen-action:disabled {
  opacity: 0.5;
  cursor: default;
}

.balance-heading { justify-content: space-between; }
#balance-view { flex-basis: 0; }
#balance-view > :not(.asset-list):not(.balance-overview-grid) { flex-shrink: 0; }
#balance-view > .balance-overview-grid { flex-shrink: 1; }
.detail-navigation { margin-bottom: 8px; }

.screen-hint,
.balance-update-row {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.wallet-topup-button {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid rgba(49, 208, 155, 0.4);
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.balance-update-row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 11px;
}

.balance-update-row:has(#balance-updated:empty):has(#balance-retry-button[hidden]) {
  display: none;
}

.open-orders-page-summary {
  grid-column: 1 / -1;
  display: block;
  text-align: center;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* compact-primary-layout-v1 */
@media (max-width: 760px) {
  .shell {
    padding-top: 8px;
    padding-bottom: calc(var(--bottom-nav-chrome-height) + env(safe-area-inset-bottom));
  }

  .hero {
    margin-bottom: 5px;
  }




  .balance-hero {
    min-height: 64px;
    margin-bottom: var(--primary-section-gap);
    padding: 8px 12px;
  }

  .balance-value-cell {
    gap: 5px;
    padding: 0 8px;
  }

  .balance-value-cell > strong,
  .balance-value-cell > strong.valued {
    font-size: 22px;
  }

  .balance-scope-row {
    margin-bottom: var(--primary-section-gap);
  }

  .bottom-nav {
    padding: 4px 10px calc(4px + env(safe-area-inset-bottom));
  }

  .bottom-nav-button {
    min-height: var(--bottom-nav-hit-height);
    white-space: nowrap;
  }

  .bottom-nav-button:focus-visible {
    outline: 2px solid rgba(49, 208, 155, 0.66);
    outline-offset: 2px;
  }
}

@media (max-width: 760px) {
  .bottom-nav-button,
  html[lang="ru"] .bottom-nav-button {
    flex-direction: column;
    gap: 2px;
    padding: 2px 4px;
    font-size: 10.5px;
    line-height: 1;
  }

  .bottom-nav-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
}

@media (max-width: 360px) {
  .bottom-nav-button > span { white-space: normal; overflow-wrap: anywhere; line-height: 1.1; }
}

/* Current capital is shown on Balance; Statistics stays focused on history. */
.statistics-dashboard { min-width: 0; }
.allocation-card { margin-top: 0; }
.allocation-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.allocation-header h2 { margin: 0; font-size: 16px; }
.allocation-header p { margin: 5px 0 0; font-size: 12px; color: #9aabb9; }
#allocation-status { color: #b4c1cc; font-size: 13px; margin: 10px 0; }
#allocation-status:empty { display: none; }
.allocation-layout { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(0, 1.4fr); grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: 20px; margin-top: 18px; min-height: 0; }
.allocation-ring-wrap { width: min(100%, 310px); aspect-ratio: 1; position: relative; margin: auto; }
#allocation-ring { width: 100%; height: 100%; overflow: visible; }
#allocation-ring circle[role="button"] { cursor: pointer; pointer-events: stroke; }
#allocation-ring circle:focus-visible { outline: none; stroke-width: 35px; filter: brightness(1.3); }
.allocation-center { position: absolute; inset: 29% 23%; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.allocation-center span { font-size: 12px; color: #9aabb9; }
.allocation-center strong { font-size: clamp(18px, 2vw, 25px); overflow-wrap: anywhere; line-height: 1.15; }
.allocation-legend { display: grid; grid-auto-flow: row; direction: ltr; gap: 6px; }
.allocation-row { display: grid; grid-template-columns: minmax(80px, 1fr) auto 48px; align-items: center; gap: 12px; min-height: 44px; padding: 9px 12px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 8px; color: #e7eef4; }
.allocation-row > span { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.allocation-row > span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--allocation-color); }
.allocation-row > strong { font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.allocation-row > small { color: #9aabb9; font-size: 12px; text-align: right; }
.allocation-row[aria-pressed="true"] { background: #152735; border-color: #42768c; }
.allocation-row:disabled { opacity: 0.65; }
.allocation-row:focus-visible { outline: 2px solid #59c8ff; outline-offset: 2px; }
.allocation-explanation { margin-top: 15px; color: #9aabb9; font-size: 12px; border-top: 1px solid #23323e; }
.allocation-explanation summary { padding: 12px 0; cursor: pointer; width: fit-content; }
.allocation-explanation p { margin: 0; max-width: 780px; line-height: 1.6; }

/* balance-capital-allocation-20260909-v1 */
.balance-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.balance-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.balance-overview-grid > .allocation-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  margin: 0;
  padding: 15px;
  container: allocation-card / inline-size;
}

.balance-overview-grid > .allocation-card .allocation-layout {
  flex: 1 1 auto;
  min-height: 0;
}

.balance-overview-grid > .allocation-card .allocation-legend {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
}

.balance-overview-grid > .asset-table {
  min-width: 0;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
  row-gap: 12px;
  overflow: visible;
}

/* Balance assets use a compact table row: one shared header, three aligned
   value columns, and hairline separators instead of stacked capsules. */
.asset-table {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.asset-table-header,
.balance-overview-grid > .asset-table > .asset-list .asset-card {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) repeat(3, minmax(0, 1fr));
  column-gap: 12px;
  align-items: center;
}

.asset-table-header {
  flex: 0 0 auto;
  padding: 8px 4px 7px;
  border-bottom: 1px solid rgba(103, 124, 148, 0.34);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.asset-table-header span:not(:first-child) { text-align: right; }

.balance-overview-grid > .asset-table > .asset-list {
  gap: 0;
  row-gap: 4px;
  grid-auto-rows: max-content;
  overflow: auto;
}

.balance-overview-grid > .asset-table > .asset-list .asset-card {
  min-height: 66px;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid rgba(103, 124, 148, 0.22);
  border-radius: 0;
  background: transparent;
}

.balance-overview-grid > .asset-table > .asset-list .asset-card:last-child { border-bottom: 0; }
.balance-overview-grid > .asset-table > .asset-list .asset-identity { grid-column: 1; }
.balance-overview-grid > .asset-table > .asset-list .asset-balances { display: contents; }
.balance-overview-grid > .asset-table > .asset-list .asset-balance-cell { grid-column: auto; }
.balance-overview-grid > .asset-table > .asset-list .asset-balance-cell + .asset-balance-cell { padding-left: 12px; }

@media (max-width: 650px) {
  .asset-table-header,
  .balance-overview-grid > .asset-table > .asset-list .asset-card {
    grid-template-columns: minmax(92px, 1.1fr) repeat(3, minmax(0, 1fr));
    column-gap: 6px;
  }

  .asset-table-header { padding: 6px 2px; font-size: 10px; }
  .balance-overview-grid > .asset-table > .asset-list .asset-card { min-height: 56px; padding: 7px 2px; }
  .balance-overview-grid > .asset-table > .asset-list .asset-balance-cell + .asset-balance-cell { padding-left: 6px; }
  .balance-overview-grid > .asset-table > .asset-list .asset-balance-cell strong { font-size: 14px; }
  .balance-overview-grid > .asset-table > .asset-list .asset-valuation { font-size: 10px; }
}

@media (max-width: 900px) {
  .balance-overview-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
  }

  .balance-overview-grid > .allocation-card .allocation-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 12px;
    align-items: stretch;
    flex: 0 0 auto;
  }

  .balance-overview-grid > .allocation-card { min-height: max-content; }

  .balance-overview-grid > .allocation-card .allocation-ring-wrap {
    width: min(100%, 240px);
  }

  .balance-overview-grid > .allocation-card .allocation-legend {
    overflow-y: visible;
  }
}

@media (max-width: 650px) {
  .allocation-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .allocation-ring-wrap { width: min(100%, 250px); }
  .allocation-row { gap: 8px; padding: 8px 4px; grid-template-columns: minmax(80px, 1fr) auto 42px; }
  .allocation-header { gap: 12px; }
  .allocation-center strong { font-size: 21px; }

  /* Keep the two balance columns below the asset identity on narrow phones;
     the desktop minimum width otherwise makes the values overlap the ticker. */
  .asset-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .asset-balances {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .asset-balance-cell + .asset-balance-cell { padding-left: 8px; }
  .asset-balance-cell strong { font-size: 15px; }
}

/* Browser zoom narrows each desktop grid column without necessarily crossing
   a viewport media-query breakpoint. Adapt the allocation internals to the
   card's own width so the ring and legend never compete for a cramped row. */
@container allocation-card (max-width: 560px) {
  .allocation-layout {
    grid-template-columns: minmax(140px, .75fr) minmax(0, 1.25fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }

  .allocation-ring-wrap { width: min(100%, 200px); }
  .balance-overview-grid > .allocation-card .allocation-legend { overflow-y: auto; align-content: start; }
  .balance-overview-grid > .allocation-card .allocation-row {
    grid-template-columns: minmax(0, 1fr) auto 40px;
    gap: 6px;
    min-height: 38px;
    padding: 6px 4px;
  }
  .balance-overview-grid > .allocation-card .allocation-row > span { gap: 6px; font-size: 12px; }
  .balance-overview-grid > .allocation-card .allocation-row > strong { font-size: 12px; }
  .balance-overview-grid > .allocation-card .allocation-row > small { font-size: 11px; }
}

/* Keep the historical dashboard compact: chart, daily history and bot profit
   share the available viewport; current capital lives on Balance. */
@media (min-width: 1100px) {
  .statistics-dashboard:has(> .statistics-content:not([hidden])) {
    /* Enough room for two-line identity + inline profit, even in a narrow desktop. */
    grid-template-columns: minmax(0, 1.75fr) repeat(2, minmax(236px, .375fr));
    grid-template-areas:
      "summary summary summary"
      "chart history bots";
  }
  .statistics-dashboard > .statistics-content:not([hidden]),
  .statistics-dashboard .statistics-main-grid,
  .statistics-dashboard .statistics-primary-column { display: contents; }
  .statistics-dashboard .statistics-kpi-grid { grid-area: summary; }
  .statistics-dashboard .statistics-chart-card { grid-area: chart; }
  .statistics-dashboard .statistics-history-card {
    grid-area: history;
    min-height: 0;
    padding: 12px;
  }
  .statistics-dashboard .statistics-bots-card {
    grid-area: bots;
    min-height: 0;
    padding: 12px;
  }
  .statistics-dashboard .statistics-history-row {
    display: grid;
    justify-content: stretch;
    gap: 5px 8px;
  }
  .statistics-dashboard .statistics-history-row > strong { text-align: right; }
  .statistics-dashboard .statistics-bots-list {
    align-content: start;
    grid-auto-rows: max-content;
  }
  .statistics-dashboard .statistics-bot-copy { min-width: 0; }
  .statistics-dashboard .statistics-bot-summary { display: grid; gap: 8px; }
  .statistics-dashboard .statistics-bot-value { justify-self: end; }
  .statistics-dashboard .statistics-bot-row { padding: 8px; }
  .statistics-dashboard:has(> .statistics-content.is-single-bot:not([hidden])) {
    grid-template-columns: minmax(0, 1.75fr) minmax(220px, .75fr);
    grid-template-areas: "summary summary" "chart history";
  }
  .statistics-dashboard:has(> .statistics-content.is-empty:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "summary" "chart";
  }
}

/* Desktop statistics uses the available viewport, not the length of either
   history list. Small/zoomed screens retain ordinary page scrolling. */
@media (min-width: 1100px) {
  body.is-browser-app .statistics-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 574px;
    gap: 6px;
    padding-bottom: 0;
  }
  body.is-browser-app .statistics-toolbar {
    flex: 0 0 auto;
    grid-template-columns: minmax(200px, .7fr) minmax(0, 2fr);
    align-items: center;
    gap: 12px;
    padding-bottom: 0;
  }
  body.is-browser-app .statistics-heading-row { min-height: 52px; }
  body.is-browser-app .statistics-heading-copy h1 { font-size: 18px; }
  body.is-browser-app .statistics-heading-copy p { font-size: 11px; }
  body.is-browser-app .statistics-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  body.is-browser-app .statistics-heading-row { grid-column: 1; grid-row: 1; }
  body.is-browser-app .statistics-filter-row {
    grid-column: 2 / span 3;
    grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  body.is-browser-app .statistics-filter-row > .statistics-range-trigger { grid-column: 2 / span 2; }
  body.is-browser-app .statistics-bot-trigger { min-height: 52px; padding: 5px 10px; }
  body.is-browser-app .statistics-dashboard {
    flex: 1 0 0;
    min-height: 0;
    gap: 6px;
    align-content: stretch;
  }
  body.is-browser-app .statistics-dashboard:has(> .statistics-content:not([hidden])) {
    grid-template-rows: auto minmax(256px, 1fr);
  }
  body.is-browser-app .statistics-kpi-grid { gap: 6px; }
  body.is-browser-app .statistics-kpi-card { min-height: 64px; padding: 7px 10px; gap: 3px; }
  body.is-browser-app .statistics-kpi-card > strong { font-size: 18px; }
  body.is-browser-app .statistics-dashboard .statistics-card { min-width: 0; min-height: 0; padding: 8px; }
  body.is-browser-app .statistics-card-header { margin-bottom: 6px; gap: 6px; }
  body.is-browser-app .statistics-card-header h2 { font-size: 14px; }
  body.is-browser-app .statistics-chart-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(160px, 1fr) auto;
    gap: 6px;
  }
  body.is-browser-app .statistics-chart-header { grid-column: 1 / -1; margin: 0; }
  body.is-browser-app .statistics-chart-card:has(#statistics-period-select[hidden]) { grid-template-columns: minmax(0, 1fr) 44px; }
  body.is-browser-app .statistics-chart { grid-column: 1 / -1; min-height: 160px; height: 100%; }
  body.is-browser-app .statistics-chart svg { height: 100%; }
  body.is-browser-app .statistics-chart-tools,
  body.is-browser-app .statistics-date-picker,
  body.is-browser-app .statistics-chart-selection { margin: 0; min-width: 0; }
  body.is-browser-app .statistics-chart-tools button { padding: 5px 8px; height: 100%; }
  body.is-browser-app #statistics-scale-note { min-height: 0; font-size: 10px; }
  body.is-browser-app .statistics-date-picker { align-self: stretch; }
  body.is-browser-app .statistics-date-picker select,
  body.is-browser-app .statistics-date-button { height: 100%; min-height: 44px; font-size: 12px; }
  body.is-browser-app .statistics-chart-selection { display: grid; align-content: center; gap: 2px; padding: 4px 8px; }
  body.is-browser-app .statistics-chart-selection strong { font-size: 14px; text-align: right; }
  body.is-browser-app .statistics-chart-empty { grid-column: 1 / -1; min-height: 0; }
  body.is-browser-app .statistics-dashboard .statistics-history-card,
  body.is-browser-app .statistics-dashboard .statistics-bots-card { overflow: hidden; }
  body.is-browser-app .statistics-bots-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body.is-browser-app .statistics-dashboard .statistics-history-row { padding: 8px 4px; }
  body.is-browser-app .statistics-dashboard .statistics-history-row.is-selected { padding: 8px 12px; }
  body.is-browser-app .statistics-dashboard .statistics-bot-row { padding: 6px; }
  body.is-browser-app .statistics-dashboard:has(> .statistics-content.is-empty:not([hidden])) .statistics-chart-card { display: block; }
}
/* Keep the allocation legend in one stable vertical order at every desktop
   width. This prevents rows from jumping between columns as the viewport
   changes and keeps the list easy to scan on both browser and mobile layouts. */
.allocation-legend { grid-template-columns: minmax(0, 1fr); }

/* Home analysis: fixed metric tracks, with whole monetary values wrapping only
   between current capital and its limit on narrow cards. */
#connected-bots .home-card-activity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: start;
}
#connected-bots .home-card-today {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
  grid-row: 1 / span 2;
  grid-column: 2;
  justify-self: end;
  width: max-content;
  max-width: 100%;
  gap: 4px;
  min-width: 0;
}
#connected-bots .home-today-row { display:flex; align-items:baseline; justify-content:flex-end; gap:4px; min-width:0; }
#connected-bots .home-today-row .home-analysis-label { flex:none; }
#connected-bots .home-today-deals,
#connected-bots .home-today-profit { text-align:left; min-width:0; }
#connected-bots .home-analysis-label,
#connected-bots .home-card-cycle dt {
  color: var(--muted);
  font-size: 11.4px;
  line-height: 1.35;
}
#connected-bots .home-today-profit {
  font-size: 14px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
#connected-bots .home-today-profit[data-direction="up"] { color: var(--accent); }
#connected-bots .home-today-profit[data-direction="down"] { color: #f16d7e; }
#connected-bots .home-card-activity .bot-metric-row-capital {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
  grid-row: 1 / span 2;
  grid-column: 1;
  align-items: start;
  justify-items: start;
  min-width: 0;
  gap: 4px;
  text-align: left;
}
#connected-bots .home-card-activity .bot-metric-value {
  display: flex;
  justify-self: start;
  text-align: left;
  flex-wrap: wrap;
  justify-content: flex-start;
  column-gap: 4px;
  row-gap: 2px;
  max-width: 100%;
  line-height: 1.35;
}
#connected-bots .home-card-activity .bot-metric-value > span { white-space: nowrap; }

/* One hierarchy across technical metrics: labels 11.4/500, values 11.8/700.
   Keep the brand identity and mode badges independently sized. */
#connected-bots .bot-card-stat-label,
#connected-bots .home-analysis-label,
#connected-bots .home-card-cycle dt,
#connected-bots .bot-metric-row-capital .bot-metric-label {
  font-size: 11.4px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: normal;
}
#connected-bots .bot-card-stat-value,
#connected-bots .bot-card-stat-value strong,
#connected-bots .runtime-price-value,
#connected-bots .runtime-price-quote,
#connected-bots .bot-card-stat-value .runtime-price-change,
#connected-bots .home-today-profit,
#connected-bots .home-today-deals,
#connected-bots .home-card-activity .bot-metric-row-capital .bot-metric-value,
#connected-bots .home-card-cycle dd {
  font-size: 11.8px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
}
#connected-bots .bot-card-clickable > .home-card-cycle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  row-gap: 4px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
#connected-bots .home-card-cycle > div {
  min-width: 0;
  padding-inline: 4px;
  display: grid;
  grid-row: 1 / span 2;
  grid-template-rows: subgrid;
}
#connected-bots .home-card-cycle > div:first-child { padding-left: 0; }
#connected-bots .home-card-cycle > div:nth-child(2) { text-align: center; }
#connected-bots .home-card-cycle > div:last-child { text-align: right; padding-right: 0; }
#connected-bots .home-card-cycle dd {
  margin: 0;
  font-size: 11.8px;
  line-height: 1.35;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#connected-bots .bot-card-clickable > .bot-card-header-connected {
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 10px;
}
#connected-bots .bot-card-header-connected .status-pill {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
}
#connected-bots .bot-card-header-connected .status-active,
#connected-bots .bot-card-header-connected .status-connected {
  background: rgba(38, 202, 154, .07);
  border-color: rgba(38, 202, 154, .22);
}
#connected-bots .bot-card-header-connected .status-stopped { background: transparent; }
@container home-bot-card (max-width: 540px) {
  #connected-bots .bot-card-clickable > .bot-card-stat-grid,
  #connected-bots .bot-card-clickable > .home-card-cycle {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .85fr) minmax(0, .75fr);
  }
  #connected-bots .bot-card-price-compound { flex-wrap: nowrap; column-gap: 4px; }
}
@media (max-width: 400px) {
  .statistics-period-switch { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .statistics-period-button { grid-column: span 2; }
  .statistics-year-select,
  .statistics-period-button[data-statistics-period="all_time"] { grid-column: span 3; }
}

/* First-contact screen: preserve the mobile hero, compose a desktop workspace. */
.welcome-desktop-copy, .welcome-cycle-demo, .welcome-cta-note, .welcome-funds-note { display: none; }
/* Decorative cards must not present hard-coded percentages as live performance. */
.onboarding-scroll-bot-card .onboarding-scroll-bot-pnl { display: none; }
.onboarding-scroll-bot-card::after {
  content: "SPOT";
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
}
@media (min-width: 960px) {
  body.is-onboarding-active.is-onboarding-first-slide .shell { width: min(1640px, 100%); }
  body.is-onboarding-active #list-view { overflow-y: auto; }
  body.is-onboarding-active .onboarding-view {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr);
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: clamp(32px, 3vw, 52px);
    row-gap: 28px;
    width: 100%;
    max-width: 1540px;
    min-height: 720px;
    height: min(100%, 880px);
    margin: auto;
    padding: 88px 32px 56px;
    overflow: visible;
  }
  .onboarding-slider,
  .onboarding-slide[data-onboarding-slide="0"] { display: contents; }
  body.is-onboarding-active.is-onboarding-first-slide .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-overlay {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: stretch;
    justify-items: start;
    width: 100%;
    gap: 32px;
    text-align: left;
    transform: none;
    pointer-events: auto;
  }
  .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-brand {
    justify-self: start;
    justify-items: start;
    width: 100%;
  }
  .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-wordmark-heading { justify-content: start; }
  body.is-onboarding-active.is-onboarding-first-slide .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-wordmark { width: 224px; }
  body.is-onboarding-active.is-onboarding-first-slide .onboarding-slide[data-onboarding-slide="0"] .onboarding-exchange-subtitle { display: none; }
  .welcome-desktop-copy { display: grid; gap: 16px; }
  .welcome-desktop-copy h2 { max-width: 620px; margin: 0; font-size: clamp(26px, 2.2vw, 34px); font-weight: 650; line-height: 1.13; letter-spacing: -.035em; text-wrap: balance; }
  .welcome-desktop-copy .welcome-description { max-width: 500px; color: var(--muted); font-size: 16px; line-height: 1.6; }
  .welcome-features { display: grid; gap: 18px; margin-top: 12px; }
  .welcome-features > div { display: flex; align-items: start; gap: 14px; }
  .welcome-feature-icon { flex: 0 0 24px; width: 24px; height: 24px; margin-top: 1px; color: var(--accent); }
  .welcome-features h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
  .welcome-features p { color: var(--muted); font-size: 13px; line-height: 1.5; }
  body.is-onboarding-active .onboarding-controls { grid-area: 2 / 1; display: grid; justify-items: start; gap: 12px; padding: 0; }
  .onboarding-primary-button { width: 280px; min-height: 52px; background: var(--accent); color: #06261d; font-weight: 700; border-radius: 10px; }
  .onboarding-primary-button:hover, .onboarding-primary-button:focus-visible { background: #53deb2; color: #06261d; }
  .welcome-cta-note { display: block; color: var(--muted); font-size: 12px; }
  .onboarding-slide[data-onboarding-slide="0"] .onboarding-bot-scroll-visual { display: none; }
  .welcome-cycle-demo {
    grid-area: 1 / 2 / 3 / 3;
    align-self: center;
    display: grid;
    align-content: center;
    gap: 16px;
    height: auto;
    margin: 0;
    padding: 24px;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: radial-gradient(ellipse at 100% 0, rgba(49,208,155,.09), transparent 65%), #0d141d;
  }
  body.is-onboarding-active.is-onboarding-first-slide .onboarding-slide[data-onboarding-slide="0"] .onboarding-bot-scroll-visual::after,
  .onboarding-bot-scroll-visual::before { display: none; }
  .welcome-cycle-demo figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
  .welcome-cycle-demo h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
  .welcome-cycle-demo figcaption > span { color: var(--muted); font-size: 11px; }
  .welcome-cycle-demo video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #070a0f; border-radius: 12px; }
  .welcome-video-frame { position: relative; min-width: 0; }
  .welcome-video-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; max-width: calc(100% - 24px); padding: 10px 16px; border: 1px solid rgba(49,208,155,.5); border-radius: 10px; color: var(--text); background: rgba(13,25,31,.95); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
  .welcome-video-play svg { width: 20px; height: 20px; color: var(--accent); }
  .welcome-video-play:hover { border-color: var(--accent); background: #16352c; }
  .welcome-video-play:disabled { opacity: .65; cursor: wait; }
  .welcome-cycle-demo p { margin: 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
  .welcome-cycle-demo a { justify-self: start; color: var(--accent); font-size: 12px; line-height: 1.5; text-underline-offset: 4px; }
  .onboarding-bot-scroll-track { width: 100%; animation: none; will-change: auto; }
  .onboarding-bot-scroll-group { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0; }
  .onboarding-bot-scroll-group[aria-hidden="true"] { display: none; }
  .onboarding-scroll-bot-card { --bot-card-logo-size: 36px; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 18px 12px; border-radius: 12px; background: rgba(23,33,48,.58); }
  .onboarding-scroll-bot-card::before, .onboarding-scroll-bot-card::after { display: none; }
  .onboarding-scroll-bot-card strong { font-size: 13px; font-weight: 650; }
  .onboarding-scroll-bot-card em { font-size: 11px; font-weight: 500; }
}
@media (min-width: 960px) and (max-width: 1150px) {
  body.is-onboarding-active .onboarding-view { column-gap: 32px; padding-inline: 12px; }
  .onboarding-slide[data-onboarding-slide="0"] .onboarding-bot-scroll-visual { padding: 20px; }
  .onboarding-scroll-bot-card { --bot-card-logo-size: 28px; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 16px 8px; }
}

/* Focus the entry copy on the product and the next action; keep the video intact. */
@media (min-width: 960px) {
  body.is-onboarding-active.is-onboarding-first-slide .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-overlay { gap: 24px; }
  body.is-onboarding-active.is-onboarding-first-slide .onboarding-slide[data-onboarding-slide="0"] .onboarding-slide0-wordmark { width: 184px; }
  .welcome-desktop-copy { gap: 16px; }
  .welcome-exchanges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
  .welcome-exchanges > span:first-child { margin-right: 4px; }
  .welcome-exchanges > span:not(:first-child) { padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; color: #cbd6df; font-weight: 600; }
  .welcome-desktop-copy h2 { font-size: clamp(28px, 2.2vw, 34px); line-height: 1.2; font-weight: 650; letter-spacing: -.025em; text-wrap: initial; }
  .welcome-heading-accent { display: block; color: var(--accent); }
  .welcome-desktop-copy .welcome-description { font-size: 15px; line-height: 1.65; max-width: 440px; }
  .welcome-features { gap: 18px; margin-top: 4px; }
  .welcome-features > div { gap: 14px; }
  .welcome-feature-icon { width: 22px; height: 22px; flex-basis: 22px; margin-top: 2px; }
  .welcome-features h3 { font-size: 14px; line-height: 1.4; margin-bottom: 4px; }
  .welcome-features p { font-size: 12px; line-height: 1.55; }
  body.is-onboarding-active .onboarding-controls { align-content: start; gap: 10px; }
  .onboarding-primary-button { width: min(100%, 300px); min-height: 52px; align-self: start; }
  .welcome-cta-note { font-size: 11px; }
  .welcome-funds-note { display: flex; align-items: start; gap: 8px; max-width: 360px; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
  .welcome-funds-note svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--accent); }
}

/* Connection flow: a readable column, independent of the trading workspace. */
#add-bot-view { width: 100%; max-width: 680px; margin-inline: auto; }
#add-bot-view .cards-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
#add-bot-view .add-bot-title { text-align: left; margin-block: 8px 16px; }
#available-bots .bot-card-available { min-height: 76px; padding: 14px 16px; border-radius: 12px; }
#available-bots .bot-card-header { width: 100%; }
#connect-bot-view { width: 100%; max-width: 960px; margin-inline: auto; padding-bottom: 32px; }
#connect-bot-view:has(#connect-form-panel:not([hidden])) { max-width: 640px; }
#connect-form-panel { gap: 24px; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel, #101720); }
#connect-form-panel .connect-title-copy h2 { white-space: normal; overflow: visible; line-height: 1.35; }
#connect-form-panel .connect-instruction { padding: 0 0 22px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; text-align: left; justify-items: start; gap: 12px; }
#connect-form-panel .connect-instruction p { line-height: 1.6; }
#connect-form-panel .connect-field-guided { padding: 0; border: 0; border-radius: 0; background: none; }
#connect-form-panel .connect-step-badge { display: none; }
#connect-form-panel .connect-form { gap: 20px; }
#connect-form-panel .connect-field input { min-height: 48px; font-size: 16px; }
#connect-bot-view .connect-secondary-button { min-height: 44px; }
#connect-form-panel .connect-submit-button { min-height: 48px; }
#connect-bot-view .api-key-instruction-panel { padding-top: 12px; border: 0; gap: 24px; }
#connect-bot-view .api-key-instruction-header h2 { font-size: clamp(20px, 2vw, 26px); line-height: 1.3; }
#connect-bybit-instruction-panel { width: 100%; max-width: 760px; margin-inline: auto; }
#connect-bot-view:has(#connect-bybit-instruction-panel:not([hidden])) { max-width: 760px; }
#connect-bybit-instruction-panel .bybit-guide { gap: 0; }
#connect-bybit-instruction-panel .bybit-guide-section { padding: 24px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; gap: 14px; }
#connect-bybit-instruction-panel .bybit-option-row { padding: 8px 0; border: 0; border-radius: 0; background: none; gap: 24px; }
#connect-bybit-instruction-panel .bybit-option-label,
#connect-bybit-instruction-panel .bybit-option-value { font-size: 14px; line-height: 1.55; }
#connect-bybit-instruction-panel .bybit-guide-heading { font-size: 17px; }
#connect-bybit-instruction-panel .bybit-prerequisite { padding: 0 0 0 14px; border: 0; border-left: 2px solid var(--accent); border-radius: 0; background: none; line-height: 1.6; font-weight: 500; }
.mexc-guide-step { display: grid; gap: 18px; padding: 24px 0; border-top: 1px solid var(--border); min-width: 0; }
.mexc-guide-step h3 { margin: 0; font-size: 17px; line-height: 1.4; }
.mexc-guide-step > p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.mexc-guide-step .api-key-intro-action { padding: 0; border: 0; background: none; }
.mexc-guide-step .api-key-steps { list-style: none; padding-left: 0; --api-key-list-offset: 0px; font-size: 14px; line-height: 1.6; }
.mexc-guide-step .api-ip-copy { width: min(100%, 440px); margin-left: 0; }
.mexc-guide-step .connect-secondary-button { justify-self: start; }
.mexc-guide-step .api-key-screenshots { max-width: 880px; width: 100%; margin-inline: auto; }
.mexc-guide-step .api-key-screenshot-set img { height: auto; max-height: 540px; object-fit: contain; }
.mexc-guide-step .api-key-screenshot-set a { display: block; min-width: 0; border-radius: 8px; }
.mexc-guide-step .guide-image-hint { font-size: 12px; }
#connect-instruction-panel .mexc-mobile-only { display: none; }
@media (max-width: 767px) {
  #connect-instruction-panel .mexc-desktop-only { display: none; }
  #connect-instruction-panel .mexc-mobile-only { display: block; max-width: 420px; }
  #connect-form-panel { padding: 18px 14px; gap: 20px; }
  #available-bots .bot-card-available { padding: 12px; }
  .mexc-guide-step { gap: 14px; padding-block: 20px; }
}
@media (max-width: 390px) {
  #connect-bybit-instruction-panel .bybit-option-row { gap: 6px; }
}
