.market-page {
  background: var(--dark-color, #121212);
}

.market-page .market-hero.hero-modern.hero-modern--game {
  min-height: 0;
  max-height: none;
  padding: 0.95rem 0 0.65rem;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.market-page .market-hero .container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.market-page .hero-description-modern {
  max-width: 680px;
  margin-top: 0.35rem;
  font-size: 0.98rem;
}

.market-page .market-hero .hero-title-gradient {
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  line-height: 1.08;
}

.market-shell {
  padding: 0.45rem 0 4rem;
}

.market-workspace {
  width: min(100%, 473px);
  margin: 0 auto;
}

.market-page-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.28rem;
  margin: 0 0 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 8px);
  background: rgba(0, 0, 0, 0.26);
}

.market-page-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.3rem;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 0 0.95rem;
  background: transparent;
  color: var(--text-gray, #adb5bd);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
}

.market-page-tabs button:hover {
  color: var(--text-light, #f8f9fa);
}

.market-page-tabs button.active {
  background: #e6c97a;
  color: #131b26;
}

.market-tab-panel[hidden] {
  display: none;
}

.market-tab-panel,
.market-grid {
  padding: 0;
}

.market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, 0.94fr);
  gap: 1rem;
  align-items: start;
}

.market-grid-swap {
  grid-template-columns: minmax(0, 1fr);
}

.market-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.market-common-proof {
  margin-top: 1rem;
}

.market-panel {
  background: var(--card-bg, #222831);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 8px);
  box-shadow: var(--shadow, 0 4px 6px rgba(0, 0, 0, 0.3));
  padding: 1rem;
}

.market-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.market-panel-head.compact {
  margin-bottom: 0.85rem;
}

.market-panel h2 {
  margin: 0;
  color: var(--text-light, #f8f9fa);
  font-size: 1.12rem;
  line-height: 1.25;
}

.market-panel p {
  margin: 0.25rem 0 0;
  color: var(--text-gray, #adb5bd);
  font-size: 0.9rem;
  line-height: 1.45;
}

.market-segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 8px);
  background: rgba(0, 0, 0, 0.22);
}

.market-segmented button {
  min-height: 2.1rem;
  border: 0;
  border-radius: 6px;
  padding: 0 0.75rem;
  background: transparent;
  color: var(--text-gray, #adb5bd);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.market-segmented button.active {
  background: #e6c97a;
  color: #131b26;
}

.market-field {
  display: grid;
  gap: 0.45rem;
  width: 100%;
}

.market-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-gray, #adb5bd);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-field input,
.market-field select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius, 8px);
  background: #121212;
  color: var(--text-light, #f8f9fa);
  color-scheme: dark;
  padding: 0 0.8rem;
  font: inherit;
}

.market-field select option {
  background: #121212;
  color: var(--text-light, #f8f9fa);
}

.market-field input:focus,
.market-field select:focus {
  border-color: rgba(230, 201, 122, 0.6);
  outline: none;
  box-shadow: 0 0 0 2px rgba(230, 201, 122, 0.12);
}

.market-field.market-field-inactive {
  opacity: 0.48;
}

.market-field.market-field-inactive span,
.market-field.market-field-inactive .market-balance-line {
  color: rgba(173, 181, 189, 0.72);
}

.market-field.market-field-inactive input {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(18, 18, 18, 0.56);
  color: rgba(248, 249, 250, 0.44);
  cursor: not-allowed;
}

.market-swap-ticket {
  display: grid;
  gap: 0;
  position: relative;
}

.market-swap-asset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 8.2rem;
  padding: 0.95rem;
  border: 1px solid #333;
  border-radius: var(--border-radius, 8px);
  background: #0d0e14;
}

.market-swap-asset-output {
  margin-top: 0.45rem;
}

.market-swap-asset-main {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.market-swap-asset-main label,
.market-swap-asset-main span {
  color: var(--text-gray, #adb5bd);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.market-swap-asset-main input,
.market-swap-asset-main strong {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-light, #f8f9fa);
  padding: 0;
  font: inherit;
  font-size: 2.12rem;
  font-weight: 500;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-swap-asset-main input:focus {
  outline: none;
}

.market-token-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.7rem;
  padding: 0 0.8rem;
  border-radius: var(--border-radius, 8px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-light, #f8f9fa);
  white-space: nowrap;
}

.market-token-icon {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.market-token-icon.lucky {
  background: rgba(230, 201, 122, 0.16);
}

.market-token-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.market-flip-btn {
  justify-self: center;
  width: 2.45rem;
  height: 2.45rem;
  margin: -0.2rem 0 -0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: linear-gradient(180deg, #18202e 0%, #090b10 100%);
  box-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text-light, #f8f9fa);
  cursor: pointer;
  position: relative;
  z-index: 3;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.market-flip-btn:hover {
  border-color: rgba(230, 201, 122, 0.42);
  box-shadow: 0 0.5rem 1.1rem rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(230, 201, 122, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.market-flip-btn:active {
  transform: scale(0.96);
}

.market-swap-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  margin-top: 0.9rem;
  color: var(--text-light, #f8f9fa);
  font-size: 0.9rem;
}

.market-swap-summary #market-rate-line {
  font-weight: 900;
}

.market-summary-copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.market-refresh-indicator {
  color: var(--text-gray, #adb5bd);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-refresh-indicator.active {
  color: #8ce99a;
}

.market-refresh-indicator.warn {
  color: #ffd43b;
}

.market-slippage-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border-radius: var(--border-radius, 8px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e6c97a;
}

.market-slippage-control select {
  border: 0;
  background: transparent;
  color: var(--text-light, #f8f9fa);
  color-scheme: dark;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.market-slippage-control select option {
  background: #121212;
  color: var(--text-light, #f8f9fa);
}

.market-execution-summary {
  margin-top: 0.72rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 8px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.market-reward-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2rem;
  padding: 0 0.72rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  font-weight: 900;
}

.market-lp-execution-summary[hidden],
.market-reward-strip[hidden] {
  display: none;
}

.market-reward-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.market-reward-strip i {
  color: #e6c97a;
}

.market-reward-strip strong {
  color: #ffd43b;
  text-align: right;
  line-height: 1.2;
}

.market-reward-strip.eligible strong {
  color: #8ce99a;
}

.market-liquidity-game-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.72rem;
  margin: 0.86rem 0 0;
  padding: 0.82rem 0.9rem;
  border: 1px solid rgba(230, 201, 122, 0.26);
  border-radius: 8px;
  background: rgba(230, 201, 122, 0.08);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.market-liquidity-game-toggle input {
  margin-top: 0.22rem;
  accent-color: #e6c97a;
}

.market-liquidity-game-toggle span {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.market-liquidity-game-toggle strong {
  font-size: 0.92rem;
}

.market-liquidity-game-toggle small {
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.35;
}

.market-summary-head,
.market-advanced-toggle {
  width: 100%;
  min-height: 1.95rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0 0.72rem;
  border: 0;
  background: transparent;
  color: var(--text-light, #f8f9fa);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
}

.market-summary-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.market-summary-head[aria-expanded="false"] {
  border-bottom: 0;
}

.market-summary-rows[hidden] {
  display: none;
}

.market-summary-head[aria-expanded="false"] + .market-summary-rows {
  display: none;
}

.market-summary-head span,
.market-advanced-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-width: 0;
}

.market-summary-head i,
.market-advanced-toggle i {
  color: #e6c97a;
}

.market-summary-rows {
  display: grid;
  gap: 0;
  padding: 0.05rem 0.72rem 0.4rem;
}

.market-summary-rows:empty {
  display: none;
}

.market-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  min-height: 1.55rem;
  padding: 0.26rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-gray, #adb5bd);
  font-size: 0.86rem;
}

.market-summary-row:last-child {
  border-bottom: 0;
}

.market-summary-row span {
  min-width: 0;
}

.market-summary-row strong {
  color: var(--text-light, #f8f9fa);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.market-summary-row.important strong {
  color: #8ce99a;
}

.market-summary-row.ok strong {
  color: #8ce99a;
}

.market-summary-row.warn strong {
  color: #ffd43b;
}

.market-advanced-toggle {
  min-height: 1.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.market-advanced-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.market-advanced-details {
  padding: 0 0.72rem 0.6rem;
}

.market-advanced-details[hidden] {
  display: none;
}

.market-fee-estimate {
  margin-top: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 8px);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.market-fee-toggle {
  width: 100%;
  min-height: 2.55rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0 0.75rem;
  border: 0;
  background: transparent;
  color: var(--text-light, #f8f9fa);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.market-fee-toggle span {
  color: var(--text-gray, #adb5bd);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-fee-toggle strong {
  color: #e6c97a;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.market-fee-toggle i {
  color: var(--text-gray, #adb5bd);
  transition: transform 0.15s ease;
}

.market-fee-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.market-fee-details {
  display: grid;
  gap: 0.45rem;
  padding: 0 0.75rem 0.75rem;
  color: var(--text-gray, #adb5bd);
  font-size: 0.82rem;
}

.market-fee-details[hidden] {
  display: none;
}

.market-fee-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.market-fee-row strong {
  color: var(--text-light, #f8f9fa);
  white-space: nowrap;
}

.market-fee-note {
  color: var(--text-gray, #adb5bd);
  line-height: 1.35;
}

.market-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.market-slippage-field {
  margin-top: 0.85rem;
}

.market-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.market-btn {
  min-height: 2.7rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius, 8px);
  padding: 0 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.market-btn.primary {
  background: linear-gradient(180deg, #1c1f28 0%, #0c0d11 100%);
  color: #fff;
  border-color: rgba(76, 110, 245, 0.55);
  box-shadow:
    0 0 12px rgba(76, 110, 245, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.market-trade-panel .market-btn.primary {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1rem;
}

.market-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light, #f8f9fa);
  border-color: rgba(255, 255, 255, 0.12);
}

.market-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.market-btn.primary:hover:not(:disabled) {
  border-color: rgba(76, 110, 245, 0.78);
  background: linear-gradient(180deg, #22262f 0%, #14161c 100%);
  box-shadow:
    0 0 16px rgba(76, 110, 245, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.market-btn:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.market-quote-main {
  min-height: 3.4rem;
  padding: 0.85rem;
  border: 1px solid rgba(230, 201, 122, 0.12);
  border-radius: var(--border-radius, 8px);
  background: rgba(230, 201, 122, 0.06);
}

.market-best {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem;
  align-items: baseline;
}

.market-best strong {
  color: var(--text-light, #f8f9fa);
  font-size: 1.35rem;
  line-height: 1.2;
}

.market-best span {
  color: #e6c97a;
  font-weight: 900;
}

.market-best-secondary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.65rem;
  align-items: baseline;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.market-best-secondary span,
.market-best-secondary small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.market-best-secondary strong {
  font-size: 0.95rem;
}

.market-output-helper {
  display: block;
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  min-height: 0.95rem;
}

.market-balance-line {
  display: block;
  color: rgba(140, 233, 154, 0.82);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
  min-height: 0.95rem;
  overflow-wrap: anywhere;
}

.market-balance-line[data-market-balance-fill],
.market-balance-line[data-market-lp-balance-fill] {
  cursor: pointer;
  transition: color 0.15s ease;
}

.market-balance-line[data-market-balance-fill]:hover,
.market-balance-line[data-market-balance-fill]:focus-visible,
.market-balance-line[data-market-lp-balance-fill]:hover,
.market-balance-line[data-market-lp-balance-fill]:focus-visible {
  color: rgba(172, 255, 186, 0.98);
  outline: none;
}

.market-signing-overlay .joey-processing-container {
  max-width: min(92vw, 460px);
  overflow: hidden;
}

.market-signing-overlay #market-signing-overlay-sub {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.market-tx-link {
  color: #8ce99a;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.market-tx-link:hover,
.market-tx-link:focus-visible {
  color: #ffd43b;
}

.market-route-list {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.05rem;
}

.market-route {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius, 8px);
  background: rgba(255, 255, 255, 0.035);
}

.market-route.partial {
  border-color: rgba(255, 212, 59, 0.18);
  background: rgba(255, 212, 59, 0.055);
}

.market-route b {
  display: grid;
  gap: 0.16rem;
  color: var(--text-light, #f8f9fa);
  font-size: 0.9rem;
  line-height: 1.1;
}

.market-route b small {
  color: var(--text-muted, rgba(255, 255, 255, 0.62));
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.market-route strong {
  color: var(--text-light, #f8f9fa);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.market-note {
  margin-top: 0.55rem;
  color: #e6c97a;
  font-size: 0.78rem;
  line-height: 1.3;
}

.market-note.ok {
  color: #8ce99a;
}

.market-note.warn {
  color: #ffd43b;
}

.market-lp-summary,
.market-lp-position {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 8px);
  background: rgba(0, 0, 0, 0.2);
}

.market-lp-position-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  color: var(--text-light, #f8f9fa);
  font-weight: 900;
}

.market-lp-disclosure {
  display: grid;
  gap: 0.65rem;
}

.market-lp-disclosure > summary {
  cursor: pointer;
  list-style: none;
}

.market-lp-disclosure > summary::-webkit-details-marker {
  display: none;
}

.market-lp-disclosure > summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--text-gray, #adb5bd);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.16s ease;
}

.market-lp-disclosure[open] > summary::after {
  transform: rotate(180deg);
}

.market-lp-position-head span {
  color: var(--text-gray, #adb5bd);
  font-size: 0.78rem;
}

.market-lp-confidence {
  padding: 0.18rem 0.42rem;
  border: 1px solid rgba(255, 215, 87, 0.24);
  border-radius: 999px;
  background: rgba(255, 215, 87, 0.1);
  color: #f7d774 !important;
  white-space: nowrap;
}

.market-lp-confidence.ledger_backed {
  border-color: rgba(80, 250, 123, 0.24);
  background: rgba(80, 250, 123, 0.1);
  color: #50fa7b !important;
}

.market-metric strong.positive {
  color: #50fa7b;
}

.market-metric strong.negative {
  color: #ff7b7b;
}

.market-lp-position .market-metric-grid {
  gap: 0.45rem;
}

.market-lp-disclosure:not([open]) .market-metric-grid {
  display: none;
}

.market-lp-position .market-metric {
  padding: 0.55rem 0.6rem;
}

.market-lp-position .market-metric.wide {
  grid-column: 1 / -1;
}

.market-lp-position .market-note.wide {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(255, 215, 87, 0.12);
  border-radius: var(--border-radius, 8px);
  background: rgba(255, 215, 87, 0.06);
}

.market-lp-position .market-metric.muted strong {
  color: var(--text-gray, #adb5bd);
}

.market-lp-section-title {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0.05rem;
  color: var(--text-muted, #ced4da);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-lp-action-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin-bottom: 0.75rem;
}

.market-lp-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius, 8px);
  background: rgba(0, 0, 0, 0.22);
}

.market-lp-mode-tabs button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.market-lp-mode-tabs button {
  min-height: 2.1rem;
  border-radius: 6px;
  background: transparent;
  color: var(--text-gray, #adb5bd);
  font-size: 0.78rem;
  font-weight: 900;
}

.market-lp-mode-tabs button.active {
  background: rgba(230, 201, 122, 0.95);
  color: #131b26;
}

.market-lp-withdraw-preview {
  margin-top: 0.8rem;
  padding: 0; /* Cancel global section padding; the preview is a compact card. */
  border: 1px solid rgba(230, 201, 122, 0.24);
  border-radius: var(--border-radius, 8px);
  background: linear-gradient(125deg, rgba(230, 201, 122, 0.11), rgba(230, 201, 122, 0.025) 65%), rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.market-lp-withdraw-preview[hidden],
.market-lp-preview-assets[hidden],
.market-lp-preview-status[hidden] {
  display: none;
}

.market-lp-preview-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.68rem 0.86rem 0.42rem;
  color: #e6c97a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-lp-preview-heading i {
  margin-right: 0.3rem;
}

.market-lp-preview-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0 0.86rem 0.64rem;
}

.market-lp-preview-asset {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.market-lp-preview-asset + .market-lp-preview-asset {
  padding-left: 0.85rem;
  border-left: 1px solid rgba(230, 201, 122, 0.18);
}

.market-lp-preview-asset .market-token-icon {
  flex: none;
}

.market-lp-preview-asset-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.market-lp-preview-asset-copy small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.market-lp-preview-asset-copy strong {
  color: var(--text-light, #f8f9fa);
  font-size: clamp(0.86rem, 2vw, 1.08rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.market-panel .market-lp-preview-status {
  margin: 0;
  padding: 0 0.86rem 0.78rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
}

.market-panel .market-lp-preview-note {
  margin: 0;
  padding: 0.56rem 0.86rem;
  border-top: 1px solid rgba(230, 201, 122, 0.13);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  line-height: 1.35;
}

.market-lp-ticket-summary {
  margin-top: 0.75rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--border-radius, 8px);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-gray, #adb5bd);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.market-lp-execution-summary .market-lp-ticket-summary {
  margin: 0;
  padding: 0.62rem 0.72rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.market-backfill-btn {
  width: 100%;
  margin-top: 0.75rem;
}

.market-lp-position .market-backfill-btn {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}

.market-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.market-metric {
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius, 8px);
  background: rgba(255, 255, 255, 0.035);
}

.market-metric span {
  display: block;
  color: var(--text-gray, #adb5bd);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-metric strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-light, #f8f9fa);
  font-size: 0.98rem;
}

.market-qr {
  width: 148px;
  height: 148px;
  object-fit: contain;
  border-radius: var(--border-radius, 8px);
  background: #fff;
  padding: 0.4rem;
}

.market-empty {
  color: var(--text-gray, #adb5bd);
}

.market-overlay-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--border-radius, 8px);
  background: linear-gradient(180deg, #ffd43b, #e6b800);
  color: #111;
  font-weight: 900;
  text-decoration: none;
}

.market-error-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10000;
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: var(--border-radius, 8px);
  background: rgba(32, 20, 22, 0.96);
  color: #ffb4a8;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  font-size: 0.88rem;
  font-weight: 800;
}

.market-lp-submit {
  width: 100%;
  margin-top: 0.85rem;
}

@media (max-width: 900px) {
  .market-shell {
    width: min(100%, calc(100vw - 1rem));
    padding-top: 0.55rem;
  }

  .market-page .market-hero .container,
  .market-panel-head,
  .market-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .market-grid,
  .market-row,
  .market-metric-grid {
    grid-template-columns: 1fr;
  }

  .market-lp-position .market-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-segmented {
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
  }

  .market-fee-toggle,
  .market-fee-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .market-page .market-hero.hero-modern.hero-modern--game {
    padding: 1rem 0 0.75rem;
  }

  .market-page .hero-description-modern {
    font-size: 0.88rem;
  }

  .market-workspace {
    width: 100%;
  }

  .market-page-tabs {
    margin-bottom: 0.45rem;
  }

  .market-page-tabs button {
    min-height: 2.25rem;
    padding: 0 0.6rem;
    font-size: 0.82rem;
  }

  .market-panel {
    padding: 0.78rem;
  }

  .market-panel-head {
    margin-bottom: 0.75rem;
  }

  .market-panel h2 {
    font-size: 1rem;
  }

  .market-panel p {
    font-size: 0.8rem;
  }

  .market-swap-asset {
    min-height: 7.15rem;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    padding: 0.78rem;
  }

  .market-swap-asset-main {
    gap: 0.24rem;
  }

  .market-swap-asset-main input,
  .market-swap-asset-main strong {
    font-size: clamp(1.55rem, 8.5vw, 2.05rem);
  }

  .market-swap-asset-output .market-swap-asset-main strong {
    font-size: clamp(1.25rem, 5.4vw, 1.5rem);
    white-space: nowrap;
  }

  .market-token-pill {
    min-height: 2.3rem;
    gap: 0.35rem;
    padding: 0 0.55rem;
    font-size: 0.84rem;
  }

  .market-token-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .market-flip-btn {
    width: 2.15rem;
    height: 2.15rem;
  }

  .market-swap-summary {
    margin-top: 0.65rem;
    gap: 0.55rem;
    font-size: 0.82rem;
  }

  .market-refresh-indicator,
  .market-balance-line,
  .market-output-helper {
    font-size: 0.68rem;
  }

  .market-output-helper {
    min-height: 0.85rem;
  }

  .market-reward-strip,
  .market-summary-head,
  .market-advanced-toggle {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }

  .market-reward-strip {
    font-size: 0.76rem;
  }

  .market-actions {
    margin-top: 0.75rem;
  }
}

@media (max-width: 420px) {
  .market-slippage-control {
    min-height: 2.2rem;
  }
}

@media (max-width: 420px) {
  .market-lp-preview-assets {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .market-lp-preview-asset + .market-lp-preview-asset {
    padding-left: 0;
    padding-top: 0.6rem;
    border-left: 0;
    border-top: 1px solid rgba(230, 201, 122, 0.18);
  }
}
