/* Trade AVS: only the swap-specific pieces; everything else uses the Buy AVS page styles. */
.avs-trade-page__sides { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid color-mix(in srgb, var(--buy-border) 75%, #69717d); border-radius: 999px; background: var(--control); }
.avs-trade-page__sides button { min-height: 38px; border: 1px solid transparent; border-radius: 999px; color: var(--buy-subtle); background: transparent; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: color .2s, background .2s, box-shadow .2s; }
.avs-trade-page__sides button:hover { color: var(--ink); }
.avs-trade-page__sides button:focus-visible, .avs-trade-page__flip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.avs-trade-page__sides button.is-on { border-color: #f9a020; color: #271507; background: linear-gradient(110deg, #ffad00 0%, #ff8110 48%, #ff9a00 100%); box-shadow: inset 0 1px 0 rgb(255 232 158 / 54%), 0 2px 10px rgb(255 130 10 / 22%); }
.avs-trade-page[data-trade-side="sell"] .avs-trade-page__sides button.is-on { border-color: #e2563f; color: #fff4ee; background: linear-gradient(110deg, #f0573c 0%, #c8321f 52%, #e5482f 100%); box-shadow: inset 0 1px 0 rgb(255 200 180 / 40%), 0 2px 10px rgb(220 60 30 / 24%); }
.avs-trade-page[data-trade-side="sell"] .avs-buy-page__submit { border-color: #e2563f; color: #fff4ee; background: linear-gradient(110deg, #f0573c 0%, #c8321f 52%, #e5482f 100%); box-shadow: inset 0 1px 0 rgb(255 200 180 / 40%), 0 3px 15px rgb(220 60 30 / 24%); }
.avs-trade-page__flip { padding: 0; cursor: pointer; transition: transform .3s ease; }
.avs-trade-page[data-trade-side="sell"] .avs-trade-page__flip { transform: rotate(180deg); }
.avs-trade-page__receive-tether { display: grid; place-items: center; width: 25px; height: 25px; margin-right: 2px; }
.avs-trade-page__receive-tether svg, .avs-trade-page .avs-buy-page__amount-unit .avs-buy-page__receive-coin { width: 25px; height: 25px; }
.avs-trade-page__note { margin: 2px 0 0; color: var(--buy-subtle); font-size: 11.5px; text-align: center; }
/* Slippage tolerance and minimum received. */
.avs-trade-page__tolerance { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--buy-border) 75%, #69717d); border-radius: 15px; background: var(--control); color: var(--buy-subtle); font-size: 11.5px; }
.avs-trade-page__tolerance label { color: var(--buy-subtle); }
.avs-trade-page__tolerance strong { color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.avs-trade-page__tolerance small { grid-column: 1 / -1; font-size: 10.5px; line-height: 1.4; }
.avs-trade-page__tolerance small:empty { display: none; }
.avs-trade-page__slippage { display: inline-flex; align-items: center; justify-self: end; gap: 4px; padding: 2px 9px; border: 1px solid color-mix(in srgb, var(--buy-border) 75%, #69717d); border-radius: 9px; background: var(--buy-surface); color: var(--ink); }
.avs-trade-page__slippage:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.avs-trade-page__slippage input { width: 44px; padding: 3px 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; text-align: right; outline: none; font-variant-numeric: tabular-nums; }
.avs-trade-page__slippage:has(input.is-invalid) { border-color: #ff8a65; }
.avs-trade-page__slippage-error { color: #ff8a65; }
.avs-trade-page__slippage { cursor: pointer; }
.avs-trade-page__tolerance.is-adjusting .avs-trade-page__slippage { border-color: #ff9f22; }
.avs-trade-page__slippage-panel { grid-column: 1 / -1; gap: 2px; padding: 4px 0 6px; }
.avs-trade-page__slippage-panel[hidden] { display: none; }
.avs-trade-page__slippage-panel .avs-buy-page__slider-meta { font-size: 10.5px; }
.avs-trade-page .avs-buy-page__slider-meta [data-trade-gate] { color: #ff8a65; text-align: right; }
.avs-trade-page a.avs-buy-page__submit { text-decoration: none; }
.avs-trade-page .avs-buy-page__submit[hidden] { display: none; }
/* Latest swaps (server feed, newest first). */
.avs-trade-page__trades { margin-top: 18px; margin-bottom: 26px; padding: clamp(20px, 2.6vw, 30px); }
/* Five rows visible (32px head + 5 × 40px rows); scrolling down loads older swaps until the first one, and new ones land on top. */
.avs-trade-page__trades-scroll { max-height: 232px; margin-top: 16px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.avs-trade-page__trades table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.avs-trade-page__trades th { position: sticky; top: 0; z-index: 1; height: 32px; box-sizing: border-box; vertical-align: bottom; background: var(--buy-surface); box-shadow: inset 0 -1px 0 var(--rule); padding: 0 10px 10px; border-bottom: 1px solid var(--rule); color: var(--buy-subtle); font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-align: right; white-space: nowrap; }
.avs-trade-page__trades td { height: 40px; box-sizing: border-box; padding: 0 10px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); color: var(--ink); text-align: right; white-space: nowrap; }
.avs-trade-page__trades th:nth-child(-n+2), .avs-trade-page__trades td:nth-child(-n+2) { text-align: left; }
.avs-trade-page__trades tbody tr:last-child td { border-bottom: 0; }
.avs-trade-page__trades td a { color: var(--buy-accent); text-decoration: none; }
.avs-trade-page__trades td a:hover { text-decoration: underline; }
.avs-trade-page__trades-more td { color: var(--buy-subtle); font-size: 11px; text-align: center !important; }
.avs-trade-page__trades-empty td { padding: 22px 10px; color: var(--buy-subtle); text-align: center !important; }
.avs-trade-page__trade-side { display: inline-block; min-width: 38px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-align: center; }
.avs-trade-page__trade-side.is-buy { background: rgb(255 155 50 / 14%); color: #ffad4a; }
.avs-trade-page__trade-side.is-sell { background: rgb(230 80 55 / 15%); color: #ff7a5f; }
@media (max-width: 580px) {
  .avs-trade-page__trades { margin-top: 13px; padding: 18px 14px; }
  .avs-trade-page__trades table { font-size: 11.5px; }
  .avs-trade-page__tolerance { padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) { .avs-trade-page__flip, .avs-trade-page__sides button { transition: none; } }

/* Light theme follows the Dashboard (owner request 17 Nov 2026): light grey page (#f3f5f7), white cards with grey borders.
   Scoped to Trade AVS so Buy AVS keeps its own look. */
:root[data-theme="light"] .avs-trade-page {
  --buy-surface: #ffffff;
  --buy-card: #ffffff;
  --buy-border: #dce2e8;
  --buy-shadow: 0 3px 10px rgb(36 49 66 / 4%);
  background: var(--page);
}
:root[data-theme="light"] .avs-trade-page .avs-buy-page__assurances { background: #ffffff; border-color: #dce2e8; box-shadow: 0 3px 10px rgb(36 49 66 / 4%); }
:root[data-theme="light"] .avs-trade-page .avs-buy-page__assurance + .avs-buy-page__assurance { border-color: #dce2e8; }
