/* Navigation and secondary controls: preserve each component's layout and action. */
html.violet-app #mainContent :is(.eco-back, .subpage-back) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  height: auto;
  min-height: 44px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

/* Match the current cosmic theme's specificity without changing primary actions. */
html.violet-app.violet-frosted.violet-sunset.violet-optical.violet-dark.violet-cosmic #mainContent .view[data-page] :is(#ecosystemOverview, #ecosystemDetail, .subpage-head) > :is(.eco-back, .subpage-back) {
  border: 1px solid rgba(164, 164, 214, .35) !important;
  border-radius: 999px !important;
  background: linear-gradient(160deg, rgba(151, 129, 198, .11), rgba(62, 84, 132, .05)), #0b0e19 !important;
  box-shadow: inset 0 1px rgba(218, 222, 255, .12), inset 0 -1px rgba(112, 153, 215, .12) !important;
  color: #dedbed !important;
  text-shadow: none !important;
}

html.violet-app #mainContent .eco-back svg {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
}

html.violet-app #mainContent .subpage-back > span {
  display: block;
  min-width: 0;
}

html.violet-app #mainContent :is(#poolHistoryButton, .team-members-open, .subscription-record-link, .order-settlement-trigger) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 44px;
  height: auto;
  max-width: 100%;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
}

html.violet-app #mainContent #poolHistoryButton {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 11px;
  line-height: 20px;
  border: 1px solid rgba(159, 154, 201, .25);
  border-radius: 999px;
  background: rgba(146, 132, 187, .065);
  color: #c8bfdf;
}

html.violet-app #mainContent :is(.eco-lucky-history-more, .eco-lucky-ticket-more, .nova-burn-more) {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  height: auto;
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}

html.violet-app #mainContent .eco-filters {
  gap: 4px;
  padding: 4px;
  max-width: 100%;
}

html.violet-app #mainContent .eco-filters button,
html.violet-app #mainContent .segmented button,
html.violet-app .direct-members-toolbar .segmented button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  height: auto;
  padding: 10px 13px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

/* Keep the selected reporting range visible over the shared button theme. */
html.violet-app.violet-frosted.violet-sunset.violet-optical.violet-dark.violet-cosmic #mainContent .view[data-page] :is(#poolEcosystemSummary, #ecosystemDetail) .eco-filters > button:is(.active, [aria-pressed="true"]) {
  background: linear-gradient(135deg, #563b82, #293c65) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px #b29be8, inset 0 -2px #a8bdff, 0 2px 8px rgba(80, 58, 140, .3) !important;
  font-weight: 600;
}

html.violet-app #mainContent :is(.radar-symbols, .radar-periods, .radar-intel-tabs, .radar-module-filterbar) button,
html.violet-app #mainContent .radar-refresh {
  box-sizing: border-box;
  flex-shrink: 0;
  min-height: 44px;
  height: auto;
  padding: 10px 13px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

/* The rounded amount container supplies the focus ring. */
html.violet-app #strategyAmount:focus-visible {
  outline: none !important;
}

html.violet-app #strategyAmount {
  margin-right: 12px;
}

html.violet-app #strategyBuilder .amount-input > :is(em, button) {
  flex-shrink: 0;
}

html.violet-app .modal-layer .modal > .modal-close {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(166, 158, 200, .3);
  border-radius: 50%;
  background: #10131f;
  color: #c7c1d8;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

html.violet-app .modal-layer .modal > :is(header, h3) {
  padding-right: 48px;
}

html.violet-app :is(.eco-back, .subpage-back, #poolHistoryButton, .team-members-open, .subscription-record-link, .order-settlement-trigger, .eco-lucky-history-more, .eco-lucky-ticket-more, .nova-burn-more, .modal-close):focus-visible,
html.violet-app :is(.eco-filters, .segmented, .radar-module-filterbar) button:focus-visible {
  outline: 2px solid #b3c6ff;
  outline-offset: 3px;
}

@media (hover: hover) {
  html.violet-app.violet-frosted.violet-sunset.violet-optical.violet-dark.violet-cosmic #mainContent .view[data-page] :is(#ecosystemOverview, #ecosystemDetail, .subpage-head) > :is(.eco-back, .subpage-back):hover {
    border-color: rgba(183, 180, 235, .65) !important;
    background: linear-gradient(160deg, rgba(151, 129, 198, .18), rgba(62, 84, 132, .1)), #0b0e19 !important;
    color: #f2edff !important;
  }
  html.violet-app #mainContent #poolHistoryButton:hover,
  html.violet-app .modal-layer .modal > .modal-close:hover {
    border-color: rgba(183, 180, 235, .6);
    color: #f2edff;
  }
}

@media (max-width: 640px) {
  html.violet-app #mainContent :is(.eco-back, .subpage-back) {
    padding-inline: 16px;
    font-size: 12px;
  }
  html.violet-app #mainContent .panel-head-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  html.violet-app #mainContent .eco-filters button,
  html.violet-app #mainContent .segmented button {
    padding-inline: 11px;
  }
}
