/* Finance details inherit the active ORBIT coin theme, including dialogs opened
   from a primary page. Keep monetary values and payment controls untouched. */
body[data-orbit-theme] .arc-deposit-quick > span,
body[data-orbit-theme] .arc-deposit-amount-grid small,
body[data-orbit-theme] .withdraw-policy-copy,
body[data-orbit-theme] .bank-form-hint {
  color: var(--orbit-muted, #bfd4d0);
}

body[data-orbit-theme] .arc-deposit-amount-grid button,
body[data-orbit-surface="secondary"] #app:is([data-route="withdraw"], [data-route="wealthFund"]) .amount-chip {
  color: var(--orbit-text, #edf5fa);
  background: var(--orbit-panel, #0b252b);
  border: 1px solid var(--orbit-border, #4a897d66);
  border-radius: 11px;
  box-shadow: inset 0 1px 0 #ffffff06;
}

body[data-orbit-theme] .arc-deposit-amount-grid button[aria-pressed="true"],
body[data-orbit-surface="secondary"] #app:is([data-route="withdraw"], [data-route="wealthFund"]) .amount-chip.active {
  color: var(--orbit-tint, #a6f3db);
  background: var(--orbit-surface, #113a36);
  border-color: var(--orbit-tint, #a6f3db);
  box-shadow: inset 0 0 0 1px #a6f3db12, 0 4px 18px #0003;
}

body[data-orbit-theme] .arc-deposit-amount-grid button[aria-pressed="true"] small {
  color: var(--orbit-text, #edf5fa);
}

body[data-orbit-theme] :is(.arc-deposit-amount-grid button, .wealth-plan-card, .bank-select-button):focus-visible,
body[data-orbit-surface="secondary"] #app:is([data-route="withdraw"], [data-route="wealthFund"]) .amount-chip:focus-visible {
  outline: 2px solid var(--orbit-tint, #a6f3db);
  outline-offset: 3px;
}

body[data-orbit-theme] .withdraw-rental-lock a,
body[data-orbit-theme] .wealth-order-action,
body[data-orbit-theme] .points-exchange-row button:not(:disabled),
body[data-orbit-theme] .record-pagination button:not(:disabled) {
  color: #05241f;
  background: var(--orbit-tint, #a6f3db);
  border-color: transparent;
  box-shadow: none;
  min-height: 44px;
}

body[data-orbit-theme] .withdraw-rental-lock a:hover,
body[data-orbit-theme] .points-exchange-row button:hover:not(:disabled) {
  color: #05241f;
  background: #c4ffe9;
}

body[data-orbit-theme] .record-pagination :is(button:disabled, span) {
  color: var(--orbit-muted, #bfd4d0);
  background: var(--orbit-panel, #0b252b);
  border-color: var(--orbit-border, #4a897d66);
}

body[data-orbit-theme] .wallet-record-list .record b.income,
body[data-orbit-theme] .income-detail-row b {
  color: #9debc6;
}

body[data-orbit-theme] .wallet-record-list .record b.outcome {
  color: #ffb2ae;
}

body[data-orbit-theme] .wallet-view-all {
  color: var(--orbit-tint, #a6f3db);
  background: var(--orbit-panel, #0b252b);
  border-color: var(--orbit-border, #4a897d66);
}

body[data-orbit-theme] :is(.wealth-plan-card, .wealth-rate-row, .points-exchange-row, .income-detail-row, .points-rule-card) {
  color: var(--orbit-text, #edf5fa);
  background: var(--orbit-panel, #0b252b);
  border-color: var(--orbit-border, #4a897d66);
  box-shadow: none;
}

body[data-orbit-theme] .wealth-plan-card.active {
  color: var(--orbit-text, #edf5fa);
  background: var(--orbit-surface, #113a36);
  border-color: var(--orbit-tint, #a6f3db);
  box-shadow: inset 0 0 0 1px #a6f3db12;
}

body[data-orbit-theme] .wealth-plan-card:disabled,
body[data-orbit-theme] .points-exchange-row button:disabled {
  color: #a7b5bb;
  background: #16272e;
  border-color: #60757b4d;
  opacity: .72;
  box-shadow: none;
}

body[data-orbit-theme] :is(.wealth-plan-card span, .wealth-detail p, .points-exchange-row span, .points-rule-card p, .income-detail-row span, .income-detail-row em) {
  color: var(--orbit-muted, #bfd4d0);
}

body[data-orbit-theme] :is(.wealth-plan-card em, .wealth-detail-title, .wealth-order-row .row-icon, .wealth-detail-title .icon) {
  color: var(--orbit-tint, #a6f3db);
}

body[data-orbit-theme] :is(.points-exchange-row strong, .points-rule-card h3, .income-detail-row strong) {
  color: var(--orbit-text, #edf5fa);
}

body[data-orbit-theme] :is(.wealth-rate-table, .wealth-detail) {
  border-color: var(--orbit-border, #4a897d66);
}

body[data-orbit-theme] .wealth-rate-row.head,
body[data-orbit-theme] .points-hero > span {
  color: var(--orbit-tint, #a6f3db);
  background: var(--orbit-surface, #113a36);
  border-color: var(--orbit-border, #4a897d66);
  box-shadow: none;
}

body[data-orbit-theme] .bank-select-button {
  color: var(--orbit-text, #edf5fa);
  background: #061d24;
  border-color: var(--orbit-border, #4a897d66);
  border-radius: 11px;
}

body[data-orbit-theme] .bank-select-button.is-selected {
  border-color: var(--orbit-tint, #a6f3db);
}

body[data-orbit-theme] .bank-select-button svg {
  color: var(--orbit-tint, #a6f3db);
}

/* Payment and bank overlays must retain the theme outside secondary page shells. */
body[data-orbit-theme] :is(.withdraw-confirmation-layer, .first-withdraw-layer, .recharge-channel-layer, .bank-picker-layer) {
  background: #010d17bf;
  backdrop-filter: blur(9px);
}

body[data-orbit-theme] :is(.withdraw-confirmation-card, .first-withdraw-card, .recharge-channel-card, .bank-picker-card) {
  color: var(--orbit-text, #edf5fa);
  background: linear-gradient(130deg, #071e29ed, #0a1b25f5), url('/assets/orbit/crypto-card-texture.png') right top / cover;
  border: 1px solid var(--orbit-border, #4a897d66);
  border-radius: 18px;
  box-shadow: 0 24px 70px #0009, inset 0 1px 0 #c9fff510;
  max-height: calc(100dvh - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  scrollbar-color: var(--orbit-border, #4a897d66) #071b25;
}

body[data-orbit-theme] .bank-picker-card {
  max-height: min(76dvh, 620px);
}

body[data-orbit-theme] :is(.withdraw-confirmation-close, .first-withdraw-close, .recharge-channel-close, .bank-picker-close) {
  width: 40px;
  height: 40px;
  color: var(--orbit-muted, #bfd4d0);
  background: var(--orbit-panel, #0b252b);
  border-color: var(--orbit-border, #4a897d66);
  border-radius: 12px;
}

body[data-orbit-theme] :is(.withdraw-confirmation-mark, .first-withdraw-mark, .recharge-channel-mark) {
  color: var(--orbit-tint, #a6f3db);
  background: var(--orbit-surface, #113a36);
  border: 1px solid var(--orbit-border, #4a897d66);
  border-radius: 13px;
}

body[data-orbit-theme] :is(.withdraw-confirmation-heading h2, .first-withdraw-card h2, .recharge-channel-card h2, .bank-picker-head h2, .bank-picker-subhead strong) {
  color: var(--orbit-text, #edf5fa);
}

body[data-orbit-theme] :is(.withdraw-confirmation-heading p, .first-withdraw-card p, .recharge-channel-card p, .bank-picker-head span, .bank-picker-subhead span, .bank-picker-option small, .bank-picker-empty, .recharge-channel-option span) {
  color: var(--orbit-muted, #bfd4d0);
}

body[data-orbit-theme] .withdraw-confirmation-heading strong {
  color: var(--orbit-tint, #a6f3db);
}

body[data-orbit-theme] :is(.recharge-channel-option, .bank-picker-option, .first-withdraw-support-btn) {
  color: var(--orbit-text, #edf5fa);
  background: var(--orbit-panel, #0b252b);
  border: 1px solid var(--orbit-border, #4a897d66);
  border-radius: 12px;
  box-shadow: none;
}

body[data-orbit-theme] :is(.recharge-channel-option, .bank-picker-option, .first-withdraw-support-btn):hover:not(:disabled) {
  color: var(--orbit-text, #edf5fa);
  background: var(--orbit-surface, #113a36);
  border-color: var(--orbit-tint, #a6f3db);
}

body[data-orbit-theme] :is(.recharge-channel-option:disabled, .recharge-channel-option.is-disabled) {
  color: #a7b5bb;
  background: #16272e;
  border-color: #60757b4d;
  box-shadow: none;
}

body[data-orbit-theme] :is(.recharge-channel-option:disabled, .recharge-channel-option.is-disabled) span {
  color: #a7b5bb;
}

body[data-orbit-theme] :is(.bank-picker-search, .withdraw-confirmation-card .input-wrap) {
  color: var(--orbit-text, #edf5fa);
  background: #061923;
  border: 1px solid var(--orbit-border, #4a897d66);
  border-radius: 11px;
}

body[data-orbit-theme] :is(.bank-picker-search input, .withdraw-confirmation-card input) {
  color: var(--orbit-text, #edf5fa);
  background: transparent;
  caret-color: var(--orbit-tint, #a6f3db);
}

body[data-orbit-theme] :is(.bank-picker-search input, .withdraw-confirmation-card input)::placeholder {
  color: #a4bec1;
}

body[data-orbit-theme] :is(.bank-picker-search svg, .withdraw-confirmation-card .input-wrap svg) {
  color: var(--orbit-tint, #a6f3db);
}

body[data-orbit-theme] :is(.bank-picker-search, .withdraw-confirmation-card .input-wrap):focus-within {
  border-color: var(--orbit-tint, #a6f3db);
  box-shadow: 0 0 0 3px #a6f3db18;
}

body[data-orbit-theme] .withdraw-confirmation-card label {
  color: var(--orbit-muted, #bfd4d0);
}

body[data-orbit-theme] .withdraw-confirmation-actions .ghost-btn {
  color: var(--orbit-text, #edf5fa);
  background: var(--orbit-panel, #0b252b);
  border-color: var(--orbit-border, #4a897d66);
  box-shadow: none;
}

body[data-orbit-theme] .withdraw-confirmation-actions .primary-btn,
body[data-orbit-theme] .bank-picker-retry {
  color: #05241f;
  background: var(--orbit-tint, #a6f3db);
  border-color: transparent;
  box-shadow: none;
}

body[data-orbit-theme] .withdraw-confirmation-error {
  color: #ffd0cc;
  background: #4c252c;
  border-color: #d8858055;
}

body[data-orbit-theme] .bank-picker-empty {
  border-color: var(--orbit-border, #4a897d66);
}

body[data-orbit-theme] :is(.withdraw-confirmation-card, .first-withdraw-card, .recharge-channel-card, .bank-picker-card) button:focus-visible {
  outline: 2px solid var(--orbit-tint, #a6f3db);
  outline-offset: 3px;
}

/* Activity purchase sheets share finance colors while retaining their layout. */
body[data-orbit-theme] .activity-stock-purchase-backdrop {
  background: #010d17bf;
  backdrop-filter: blur(9px);
}

body[data-orbit-theme] .activity-stock-purchase-sheet {
  color: var(--orbit-text, #edf5fa);
  background: linear-gradient(135deg, #071e29ed, #0a1b25f7), url('/assets/orbit/crypto-card-texture.png') right top / cover;
  border-color: var(--orbit-border, #4a897d66);
  box-shadow: 0 -20px 60px #0008;
  max-height: calc(100dvh - 18px - env(safe-area-inset-top));
  overflow-y: auto;
}

body[data-orbit-theme] .activity-stock-purchase-grip {
  background: #8fbbb6;
}

body[data-orbit-theme] .activity-stock-purchase-sheet > header small,
body[data-orbit-theme] .activity-stock-purchase-sheet dd {
  color: var(--orbit-tint, #a6f3db);
}

body[data-orbit-theme] .activity-stock-purchase-sheet :is(dt, label span) {
  color: var(--orbit-muted, #bfd4d0);
}

body[data-orbit-theme] .activity-stock-purchase-sheet :is(dl, input, input[readonly]),
body[data-orbit-theme] .activity-stock-purchase-sheet > header button {
  color: var(--orbit-text, #edf5fa);
  background: var(--orbit-panel, #0b252b);
  border-color: var(--orbit-border, #4a897d66);
}

body[data-orbit-theme] .activity-stock-purchase-sheet dl > div + div {
  border-color: var(--orbit-border, #4a897d66);
}

body[data-orbit-theme] .activity-stock-purchase-warning {
  color: #f4dfb5;
  background: #322c1f;
  border-color: #b9a26766;
}

body[data-orbit-theme] .activity-stock-purchase-warning > svg {
  color: #edcb81;
}

body[data-orbit-theme] .activity-stock-purchase-calculation .is-insufficient {
  background: #4c252c;
}

body[data-orbit-theme] .activity-stock-purchase-calculation .is-insufficient dd,
body[data-orbit-theme] .activity-stock-insufficient {
  color: #ffc2bb;
}

body[data-orbit-theme] .activity-stock-purchase-sheet form button {
  color: #05241f;
  background: var(--orbit-tint, #a6f3db);
  box-shadow: none;
}

body[data-orbit-theme] .activity-stock-purchase-sheet form button:disabled {
  color: #a7b5bb;
  background: #23343a;
}

body[data-orbit-theme] .activity-stock-purchase-sheet :is(input, button):focus-visible {
  outline: 2px solid var(--orbit-tint, #a6f3db);
  outline-offset: 3px;
}

@media (max-width: 380px) {
  body[data-orbit-theme] .recharge-channel-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-orbit-theme] .recharge-channel-option {
    min-height: 68px;
  }
}

@media (max-width: 640px) {
  body[data-orbit-theme] .wealth-rate-row:not(.head) :is(strong, span) {
    color: var(--orbit-text, #edf5fa);
    background: var(--orbit-surface, #113a36);
  }

  body[data-orbit-theme] .wealth-rate-row:not(.head) :is(strong, span)::before {
    color: var(--orbit-muted, #bfd4d0);
  }
}
