/* Terminal host grows with the auto-sell form; plugin stays 510px. No clip / footer overlap / x-scroll. */
.pro-shell:has(> .jl-autosell),
[data-jupiter-shell]:has(.jl-autosell),
.jtn-terminal-stack:has(.jl-autosell),
.mobile-widget-card:has(.jl-autosell) {
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  min-width: 0;
}
.pro-shell:has(> .jl-autosell) > .plugin-wrapper {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  min-height: var(--juplite-plugin-min-height, 510px);
  overflow: hidden;
}

/* AI: right column scrolls plugin + autosell + Active orders / history. */
body.page-index #view-swap > .layout > section.panel:not(.panel-left):has(.jl-autosell) {
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

body.page-pools .panel-right:has(.jl-autosell),
body.portfolio-page .panel-right:has(.jl-autosell),
body.page-pro .terminal-wrapper:has(.jl-autosell),
body.page-app .panel-right:has(.jl-autosell) {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  max-height: none !important;
}
body.page-pools .panel-right > [data-jupiter-shell]:has(.jl-autosell),
body.portfolio-page .panel-right > [data-jupiter-shell]:has(.jl-autosell) {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Auto-sell: reserved slot under the terminal. The container stays mounted; empty = no inner copy. */
.jl-autosell-entry {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.jl-autosell-entry[hidden] {
  display: none !important;
}

.jl-autosell-entry__btn {
  width: 100%;
}

.jl-autosell {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  /* Match Jupiter plugin terminal shell (#000); inner Sell/Receive/trigger windows keep their own fill. */
  background: #000;
  padding: 12px 14px;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jl-autosell.is-empty {
  min-height: 48px;
}

.jl-autosell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.jl-autosell__title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.jl-autosell__brand {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  flex: 0 0 auto;
  object-fit: cover;
  display: block;
}

.jl-autosell__title {
  font-weight: 700;
  font-size: 14px;
  color: #f8fafc;
}

.jl-autosell__token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.jl-autosell__logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  background: rgba(148, 163, 184, 0.15);
}

.jl-autosell__sym {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jl-autosell__stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jl-autosell__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.jl-autosell__label {
  color: #94a3b8;
  flex: 0 0 auto;
}

.jl-autosell__value {
  font-variant-numeric: tabular-nums;
  text-align: end;
  overflow-wrap: anywhere;
  min-width: 0;
}

.jl-autosell__row--locked .jl-autosell__value {
  color: #fbbf24;
}

.jl-autosell.is-loading .jl-autosell__value {
  color: #64748b;
}

.jl-autosell__orders {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jl-autosell__subhead {
  font-weight: 600;
  color: #cbd5e1;
}

.jl-autosell__muted {
  margin: 0;
  color: #94a3b8;
}

.jl-autosell__error {
  margin: 0;
  color: #f87171;
}

.jl-autosell__error-detail {
  margin: 0;
  color: #f87171;
  opacity: 0.85;
  font-size: 0.85em;
  word-break: break-word;
}

.jl-autosell__signin {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.jl-autosell__btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 14px;
  min-height: 42px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #0b1220;
  /* Jupiter plugin Swap — idle/muted olive. */
  background: #60783d;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

/* Ready like plugin Swap when quote is ready — brighter Jupiter primary. */
.jl-autosell__btn--ready:not(:disabled) {
  background: #c7f284;
}

/* Rim on hover — same bright green as wallet connected. */
.jl-autosell__btn--ready:not(:disabled):hover {
  border-color: var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
  box-shadow:
    0 0 0 1px var(--wallet-connected-ring, rgba(41, 222, 107, 0.35)),
    0 0 12px var(--wallet-connected-glow, rgba(41, 222, 107, 0.25));
}

.jl-autosell__btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.jl-autosell__btn--ghost {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.14);
}

.jl-autosell__btn--edit {
  color: #e2e8f0;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.jl-autosell__btn--danger {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.jl-autosell__order-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  min-width: 0;
}

.jl-autosell__order-profit {
  margin: 0;
  color: #29de6b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.jl-autosell__order-received {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
}

.jl-autosell__order-missed {
  margin: 6px 0 0;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.jl-autosell__order.is-editing {
  border-color: rgba(56, 189, 248, 0.45);
}

.jl-autosell__btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.jl-autosell__orders-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jl-autosell__order {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.55);
}

.jl-autosell__order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.jl-autosell__order-fill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #94a3b8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.jl-autosell__order-fill-bar {
  display: inline-block;
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.jl-autosell__order-fill-bar-inner {
  display: block;
  height: 100%;
  background: #a3b35a;
  border-radius: inherit;
}

/* Active-order change scale — same logic as My Trades (center = place-time spot). */
.jl-autosell__order-change {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-width: 96px;
  width: 96px;
  max-width: 42%;
  flex: 0 0 auto;
}

.jl-autosell__order-change-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.9;
  font-variant-numeric: tabular-nums;
}

.jl-autosell__order-change-label.is-gain {
  color: rgba(34, 197, 94, 0.95);
}

.jl-autosell__order-change-label.is-loss {
  color: rgba(248, 113, 113, 0.95);
}

.jl-autosell__order-change-label.is-neutral {
  color: #94a3b8;
}

.jl-autosell__order-change-label.is-start {
  align-self: flex-start;
}

.jl-autosell__order-change-label.is-end {
  align-self: flex-end;
}

.jl-autosell__order-change-label.is-mid {
  align-self: center;
}

.jl-autosell__order-change-track {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    rgba(248, 113, 113, 0.4) 0%,
    rgba(148, 163, 184, 0.15) 50%,
    rgba(34, 197, 94, 0.4) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow: visible;
}

.jl-autosell__order-change-center {
  position: absolute;
  left: 50%;
  top: -4px;
  width: 2px;
  height: 13px;
  margin-left: -1px;
  background: rgba(226, 232, 240, 0.9);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.jl-autosell__order-change-marker {
  position: absolute;
  top: -4px;
  width: 7px;
  height: 13px;
  margin-left: -3.5px;
  left: 50%;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.6);
  transition: left 0.35s ease;
  pointer-events: none;
}

.jl-autosell__order-change-marker.is-gain {
  background: rgba(34, 197, 94, 0.95);
}

.jl-autosell__order-change-marker.is-loss {
  background: rgba(248, 113, 113, 0.95);
}

.jl-autosell__order-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.jl-autosell__order-left,
.jl-autosell__order-right {
  min-width: 0;
}

.jl-autosell__order-right {
  text-align: right;
}

.jl-autosell__order-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.jl-autosell__order-logos {
  position: relative;
  width: 34px;
  height: 22px;
  flex: 0 0 auto;
}

.jl-autosell__order-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.9);
  background: #0f172a;
  object-fit: cover;
}

.jl-autosell__order-logo--out {
  left: 12px;
  z-index: 1;
}

.jl-autosell__order-pair-text {
  font-weight: 700;
  font-size: 14px;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jl-autosell__order-cond {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 12px;
}

.jl-autosell__order-qty {
  font-weight: 700;
  font-size: 14px;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.jl-autosell__order-usd {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.jl-autosell__order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  min-width: 0;
}

.jl-autosell__order-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  color: #94a3b8;
  font-size: 12px;
  min-width: 0;
}

.jl-autosell__order-meta-sep {
  opacity: 0.7;
}

.jl-autosell__order-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.jl-autosell__order-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  transform-origin: center bottom;
  transition:
    color 0.15s ease,
    opacity 0.15s ease,
    transform 0.18s ease;
}

.jl-autosell__order-link:hover:not(:disabled) {
  color: #ffffff;
}

.jl-autosell__order-link:focus-visible {
  color: #ffffff;
  outline: none;
}

.jl-autosell__order-link:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* Same lighten-on-hover idea as .jl-autosell__qty-chip (MAX / 50% / 25%). */
.jl-autosell__order-link--cancel {
  color: #c2410c;
}

.jl-autosell__order-link--cancel:hover:not(:disabled) {
  color: #fdba74;
  transform: translateY(3px) scale(0.94) scaleY(0.88);
}

.jl-autosell__order-link--cancel:focus-visible {
  color: #fdba74;
}

.jl-autosell__order-link--cancel:active:not(:disabled) {
  color: #fed7aa;
  transform: translateY(4px) scale(0.92) scaleY(0.84);
}

.jl-autosell__order-link--return {
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
  background: transparent;
  animation: jl-autosell-return-pulse 1.35s ease-in-out infinite;
}

.jl-autosell__order-link--return:hover:not(:disabled),
.jl-autosell__order-link--return:focus-visible {
  color: #ffffff;
}

@keyframes jl-autosell-return-pulse {
  0%,
  100% {
    border-color: rgba(var(--wallet-connected-rgb, 41, 222, 107), 0.35);
    box-shadow: 0 0 0 1px rgba(var(--wallet-connected-rgb, 41, 222, 107), 0.12);
  }
  50% {
    border-color: var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
    box-shadow:
      0 0 0 2px var(--wallet-connected-ring, rgba(41, 222, 107, 0.35)),
      0 0 14px rgba(var(--wallet-connected-rgb, 41, 222, 107), 0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jl-autosell__order-link--return {
    animation: none;
    border-color: var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
    box-shadow:
      0 0 0 1px var(--wallet-connected-ring, rgba(41, 222, 107, 0.35)),
      0 0 10px var(--wallet-connected-glow, rgba(41, 222, 107, 0.25));
  }
}

.jl-autosell__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  white-space: nowrap;
}

.jl-autosell__chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}

.jl-autosell__chip--open,
.jl-autosell__chip--pending {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.jl-autosell__chip--executing,
.jl-autosell__chip--pending_withdraw,
.jl-autosell__chip--checking_cancel {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}

.jl-autosell__chip--filled {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.jl-autosell__chip--expired,
.jl-autosell__chip--failed,
.jl-autosell__chip--cancelled {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

.jl-autosell__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding-top: 10px;
  min-width: 0;
  max-width: 100%;
}

.jl-autosell__block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.jl-autosell__block--sell {
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jl-autosell__block--sell.is-focus {
  border-color: var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
  box-shadow:
    0 0 0 1px var(--wallet-connected-ring, rgba(41, 222, 107, 0.35)),
    0 0 12px var(--wallet-connected-glow, rgba(41, 222, 107, 0.25));
}

.jl-autosell__block--trigger {
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  /* Same fill as Sell / Receive windows */
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.72);
}

.jl-autosell__when-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.jl-autosell__when-logo {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}

.jl-autosell__when-foot {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
}

.jl-autosell__market-btns {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  align-items: center;
}

.jl-autosell__when-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.jl-autosell__mkt-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 0;
  height: auto;
  padding: 2px 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #9ca3af;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.jl-autosell__mkt-btn:hover {
  color: #ffffff;
}

.jl-autosell__mkt-btn.is-on {
  color: #ffffff;
  background: var(--wallet-connected-bg, rgba(41, 222, 107, 0.12));
  border-color: var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
  box-shadow:
    0 0 0 1px var(--wallet-connected-ring, rgba(41, 222, 107, 0.35)),
    0 0 12px var(--wallet-connected-glow, rgba(41, 222, 107, 0.25));
}

.jl-autosell__mkt-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.jl-autosell__block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.jl-autosell__block-label {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}

.jl-autosell__block-label--sell {
  color: #f8fafc;
  font-weight: 700;
}

.jl-autosell__block-top--sell {
  gap: 8px;
}

.jl-autosell__block-bal {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  flex: 1 1 auto;
  margin-left: 0;
  overflow: hidden;
}

.jl-autosell__wallet-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  flex: 0 0 auto;
  line-height: 0;
}

.jl-autosell__bal-amt {
  color: #9ca3af;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
  /* Was 7.5rem — clipped real balances to "0.00884…" after cancel/fill returns. */
  max-width: min(46vw, 12.5rem);
  font-variant-numeric: tabular-nums;
}

.jl-autosell__qty-presets {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.jl-autosell__qty-sep {
  color: #6b7280;
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
}

.jl-autosell__qty-chip {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #9ca3af;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: color 0.15s ease;
}

.jl-autosell__qty-chip:hover:not(:disabled) {
  color: #ffffff;
}

.jl-autosell__qty-chip:focus-visible:not(:disabled) {
  color: #ffffff;
  outline: none;
}

/* Same rim as #jl-wallet-btn[data-wallet-state="connected"] */
.jl-autosell__qty-chip.is-on {
  color: #ffffff;
  background: var(--wallet-connected-bg, rgba(41, 222, 107, 0.12));
  border-color: var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
  box-shadow:
    0 0 0 1px var(--wallet-connected-ring, rgba(41, 222, 107, 0.35)),
    0 0 12px var(--wallet-connected-glow, rgba(41, 222, 107, 0.25));
}

.jl-autosell__qty-chip:disabled {
  opacity: 0.45;
  cursor: default;
}

.jl-autosell__link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #7dd3fc;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.jl-autosell__block-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.jl-autosell__amount-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jl-autosell__sol-tip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0 0;
  color: #94a3b8;
  font-size: 9.6px; /* 12px − 20% */
  line-height: 1.35;
}

.jl-autosell__sol-tip-ico {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin-top: 1px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: #94a3b8;
  font-size: 8px;
  font-weight: 700;
  font-style: italic;
  line-height: 9px;
  text-align: center;
}

.jl-autosell__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.jl-autosell__pill--btn {
  appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.jl-autosell__pill--btn:hover,
.jl-autosell__pill--btn:focus-visible,
.jl-autosell__pill--btn[aria-expanded="true"] {
  border-color: rgba(125, 211, 252, 0.7);
  background: rgba(56, 189, 248, 0.12);
  outline: none;
}

.jl-autosell__pill-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-left: 1px;
  color: #e5e7eb;
  line-height: 0;
  opacity: 0.95;
}

.jl-autosell__pill-caret svg {
  display: block;
  width: 12px;
  height: 12px;
}

.jl-autosell__pill--btn[aria-expanded="true"] .jl-autosell__pill-caret {
  color: #7dd3fc;
}

.jl-autosell__token-picker {
  margin-top: 4px;
  max-height: 220px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.96);
  padding: 6px;
}

.jl-autosell__token-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jl-autosell__token-item-btn {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  padding: 8px;
  cursor: pointer;
  text-align: start;
}

.jl-autosell__token-item-btn:hover,
.jl-autosell__token-item.is-on .jl-autosell__token-item-btn {
  background: rgba(56, 189, 248, 0.12);
}

.jl-autosell__token-item.is-disabled .jl-autosell__token-item-btn,
.jl-autosell__token-item-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jl-autosell__token-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.jl-autosell__token-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.jl-autosell__token-item-sym {
  font-weight: 700;
  font-size: 14px;
}

.jl-autosell__token-item-bal,
.jl-autosell__token-item-val {
  color: #94a3b8;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.jl-autosell__token-item-val {
  flex: 0 0 auto;
  font-weight: 600;
}

.jl-autosell__approx {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: #94a3b8;
  font-size: 9.6px; /* 12px − 20% */
  font-variant-numeric: tabular-nums;
}

.jl-autosell__min-hint {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.jl-autosell__xl-read {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.6px; /* 18px − 30% */
  font-weight: 700;
  line-height: 1.2;
  color: rgb(var(--wallet-connected-rgb, 41, 222, 107));
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.jl-autosell__price-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.jl-autosell__price-prefix {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #f8fafc;
}

.jl-autosell__price-row.is-unset .jl-autosell__price-prefix,
.jl-autosell__price-row.is-unset .jl-autosell__input--price,
.jl-autosell__price-row.is-unset .jl-autosell__input--price::placeholder {
  color: rgba(248, 250, 252, 0.32);
}

.jl-autosell__basis,
.jl-autosell__preview,
.jl-autosell__sell-price {
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.jl-autosell__sell-price {
  font-weight: 700;
  color: #f8fafc;
}

.jl-autosell__ok {
  margin: 0;
  color: #86efac;
}

.jl-autosell__warn {
  margin: 0;
  color: #fcd34d;
}

.jl-autosell__basis-actions,
.jl-autosell__basis-row,
.jl-autosell__pct,
.jl-autosell__qty {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.jl-autosell__qty-label {
  color: #94a3b8;
  font-size: 12px;
}

.jl-autosell__input {
  flex: 1 1 96px;
  min-width: 0;
  width: auto;
  max-width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font: inherit;
  padding: 8px 12px;
}

.jl-autosell__input--xl {
  flex: 1 1 auto;
  min-height: 36px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

/* Sell qty amount: +20% vs base xl. */
.jl-autosell__input--qty {
  font-size: 21.6px;
}

.jl-autosell__input--xl:focus {
  outline: none;
}

.jl-autosell__input--xl::placeholder {
  color: rgba(248, 250, 252, 0.32);
  opacity: 1;
}

.jl-autosell__input--price {
  width: 100%;
}

.jl-autosell__input--sm {
  flex: 1 1 120px;
  min-height: 36px;
  font-size: 12px;
}

.jl-autosell__input--pct {
  flex: 0 1 72px;
  min-width: 56px;
  max-width: 88px;
}

.jl-autosell__chip-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  min-height: 36px;
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.1);
  cursor: pointer;
  flex: 0 0 auto;
}

.jl-autosell__chip-btn.is-on {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.jl-autosell__expiry {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 2px 0;
}

.jl-autosell__expiry-label {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 42%;
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jl-autosell__expiry-btns {
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
}

.jl-autosell__expiry-btn {
  appearance: none;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #9ca3af;
  background: transparent;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.jl-autosell__expiry-btn:hover:not(:disabled):not(.is-on) {
  color: #ffffff;
}

.jl-autosell__expiry-btn:focus-visible:not(:disabled):not(.is-on) {
  color: #ffffff;
  outline: none;
}

.jl-autosell__expiry-btn.is-on {
  color: #ffffff;
  background: var(--wallet-connected-bg, rgba(41, 222, 107, 0.12));
  border-color: var(--wallet-connected-border, rgba(41, 222, 107, 0.9));
  box-shadow:
    0 0 0 1px var(--wallet-connected-ring, rgba(41, 222, 107, 0.35)),
    0 0 12px var(--wallet-connected-glow, rgba(41, 222, 107, 0.25));
}

.jl-autosell__expiry-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.jl-autosell__input--days {
  flex: 0 1 88px;
  max-width: 100px;
  min-height: 34px;
}

.jl-autosell__history-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: #7dd3fc;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  text-align: start;
  align-self: start;
  text-decoration: none;
}

a.jl-autosell__history-toggle:hover {
  text-decoration: underline;
}

.jl-autosell__btn--sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}

@media (max-width: 768px) {
  .jl-autosell {
    padding: 10px;
    font-size: 14px;
  }
  .jl-autosell__btn,
  .jl-autosell-entry__btn {
    min-height: 44px;
    width: 100%;
  }
  .jl-autosell__chip-btn,
  .jl-autosell__btn--sm {
    min-height: 40px;
  }
  .jl-autosell__input {
    min-height: 40px;
  }
  .jl-autosell__input--xl,
  .jl-autosell__price-prefix {
    font-size: 18px;
  }
  .jl-autosell__input--qty {
    font-size: 21.6px;
  }
  .jl-autosell__xl-read {
    font-size: 12.6px;
  }
  .jl-autosell__when-foot {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .jl-autosell__mkt-btn {
    min-height: 0;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 999px;
  }
  .jl-autosell__expiry {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .jl-autosell__expiry-label {
    font-size: 10px;
    max-width: 38%;
  }
  .jl-autosell__expiry-btns {
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
  }
  .jl-autosell__expiry-btn {
    font-size: 12px;
    min-height: 0;
    padding: 2px 6px;
    border-radius: 999px;
  }
  .jl-autosell__btn {
    min-height: 48px;
    width: 100%;
  }
  .jl-autosell__order {
    padding: 10px;
  }
  .jl-autosell__order-pair-text,
  .jl-autosell__order-qty {
    font-size: 13px;
  }
  .jl-autosell__order-cond,
  .jl-autosell__order-usd,
  .jl-autosell__order-meta,
  .jl-autosell__order-fill {
    font-size: 11px;
  }
  .jl-autosell__order-actions {
    gap: 8px;
  }
  .jl-autosell__order-link {
    font-size: 12px;
  }
  .jl-autosell__order-fill-bar {
    width: 36px;
  }
  .jl-autosell__order-change {
    min-width: 84px;
    width: 84px;
  }
}
