/* Trade controls wrap in both reading directions without changing page layout. */
/* Quantity presets and quote tools are separate, predictable control groups. */
.user-shell .purchase-panel{border-radius:var(--radius-card,14px)}
.purchase-panel .buy-presets{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-block:12px}
.purchase-panel .buy-presets>.btn:last-child{grid-column:auto;font-size:inherit}
.purchase-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-block:0 20px}
.purchase-tools>.btn{min-width:0;white-space:normal;line-height:1.55}
html .user-shell .purchase-details{border-color:var(--line)}
html .user-shell .purchase-details .form-summary{padding-block:12px;font-size:13px}
html .user-shell .purchase-details .form-summary>span{color:var(--muted)}
html .user-shell .purchase-total{margin-block:16px;padding:16px;border:1px solid var(--line);border-radius:var(--radius-control,10px);background:var(--surface-soft);gap:10px}
html .user-shell .purchase-total>span{font-size:14px;color:var(--muted)}
html .user-shell .purchase-total>strong{font-size:28px;font-weight:650;color:var(--text);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;max-width:100%}
html .user-shell :is(.purchase-status,.purchase-validation){font-size:13px;line-height:1.65;overflow-wrap:anywhere}
html .user-shell .purchase-validation{color:var(--red)}
html .user-shell .purchase-validation:empty{display:none}
html .user-shell .purchase-panel #buy-form>.primary{min-height:46px;font-size:15px}
.purchase-panel #buy-form[aria-busy=true]>.primary{cursor:progress}
@media(max-width:900px){
 .user-shell .buy-experience{gap:16px}
 .user-shell .purchase-panel{padding:20px}
 .user-shell .purchase-panel h2{font-size:20px;margin-block:16px 20px}
 .purchase-panel .buy-presets>.btn{font-size:13px;min-height:44px;padding-inline:5px}
 .purchase-tools>.btn{min-height:44px;font-size:14px}
 .user-shell .token-stage>.network-scene{max-height:160px}
}
:is(#sell-form,#miner-form) :is(.info-line,.market-info){gap:12px;min-width:0;align-items:start}
:is(#sell-form,#miner-form) .info-line>span:first-child{flex:1;min-width:0;overflow-wrap:anywhere}
:is(#sell-form,#miner-form) :is(.info-line>strong,.info-line>bdi){min-width:0;text-align:end;overflow-wrap:anywhere}
:is(#sell-form,#miner-form) :is(.actions,.btn,button){white-space:normal;line-height:1.55}
:is(#sale-max-quantity,#plan-amount-actions){margin-block:-3px 16px}
#plan-amount-actions[hidden]{display:none}
:is(#sale-preview,#plan-preview){border-block:1px solid var(--line);padding-block:12px;margin-block:14px}
.sale-allocation-summary .allocation-cart-row :is(strong,p){overflow-wrap:anywhere}
.sale-allocation-summary[aria-busy=true] .allocation-cart{opacity:.65}
.sale-allocation-summary :is(.panel-head,.actions){gap:10px;flex-wrap:wrap}
.sale-allocation-summary .actions>.btn,.sale-allocation-summary .actions>button{min-width:0;white-space:normal;line-height:1.55}
.purchase-status{margin-block:12px;overflow-wrap:anywhere}
.purchase-result{padding:14px;border:1px solid var(--line);border-radius:12px;margin-block:14px;min-width:0}
.purchase-result .info-line{gap:10px;align-items:start}.purchase-result .info-line>span{min-width:0;overflow-wrap:anywhere}
.purchase-result .actions{display:flex;flex-wrap:wrap;gap:8px;margin-block-start:12px}
.purchase-result .actions :is(button,.btn){min-width:0;white-space:normal;line-height:1.55}
.purchase-status[hidden],.purchase-result[hidden]{display:none}
.trade-confirmation{padding:8px 4px 4px;min-width:0}.trade-confirmation-mark{display:grid;place-items:center;width:64px;height:64px;border-radius:50%;margin:0 auto 18px;background:color-mix(in srgb,var(--green) 13%,transparent);color:var(--green)}.trade-confirmation-mark>.ui-icon{width:30px;height:30px;stroke-width:2}.trade-confirmation-message{text-align:center;font-size:16px;font-weight:600;line-height:1.7;margin:0 0 22px;overflow-wrap:anywhere}.trade-confirmation-details{padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface-soft,var(--panel));min-width:0}.trade-confirmation-details .info-line{gap:12px;align-items:start;margin-block:8px}.trade-confirmation-details .info-line>span{min-width:0;color:var(--muted);font-size:13px}.trade-confirmation-details .info-line>strong{min-width:0;max-width:65%;text-align:end;overflow-wrap:anywhere;font-size:15px}.trade-confirmation-details .actions{display:flex;flex-wrap:wrap;gap:8px;margin-block-start:16px}.trade-confirmation-details :is(button,.btn){min-height:44px;min-width:0;white-space:normal;line-height:1.5}.trade-confirmation-actions{margin-block-start:20px}.trade-confirmation-actions>button{min-height:46px}.trade-confirmation .sw-receipt{padding:0;border:0;background:transparent;margin:0}.trade-confirmation .sw-receipt-order{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding-block:10px;border-block-start:1px solid var(--line)}.trade-confirmation .sw-receipt-order .mono{font-size:12px}.trade-confirmation.has-warning .trade-confirmation-message{font-weight:500}
@media(max-width:600px){
  :is(#sell-form,#miner-form) .actions{display:grid;grid-template-columns:minmax(0,1fr)}
  :is(#sell-form,#miner-form) .actions :is(.btn,button){width:100%;justify-content:center}
  :is(#sale-max-quantity,#plan-amount-max){max-width:100%;text-align:center}
  .sale-allocation-summary .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .sale-allocation-summary .actions>.primary{grid-column:1/-1}
  .sale-allocation-summary .allocation-cart-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}
  .sale-allocation-summary .allocation-cart-row>div{grid-column:1/-1}
  .sale-allocation-summary .allocation-cart-row>span{min-width:0;overflow-wrap:anywhere}
}

/* On phones the quote form already includes the same price and unit details. */
@media(max-width:760px){.buy-experience>.token-stage{display:none}}

/* The page title already names the purchase; keep the mobile quote and CTA together. */
@media(max-width:760px){.content[data-view=buy]>.title-row p,.buy-experience .purchase-panel>h2{display:none}.buy-experience #buy-form>.primary{scroll-margin-block:90px 110px}}
