.workspace > aside{min-height:0;overflow-y:auto}
.perp-inviter label{text-align:left;font-size:14px}
.perp-inviter input{width:100%;min-width:0;padding:8px;border:1px solid var(--line);border-radius:4px;background:var(--card);font-size:16px}
.perp-inviter .perp-note{margin:4px 0;padding:0;line-height:1.5}
.perp-rewards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #d2c9b5;
}
.perp-rewards > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) 8em;
  grid-template-rows: auto 1fr;
  gap: 6px;
  align-items: start;
}
.trade-reward-summary { grid-template-columns: minmax(0, 32rem); }
.trade-reward-summary > div { grid-template-columns: 1fr auto; }
.perp-rewards span, .perp-rewards b { grid-row: 1; align-self: center; overflow-wrap: anywhere; }
.perp-rewards span { grid-column: 1; }
.perp-rewards b { grid-column: 2; text-align: right; }
.perp-rewards button { grid-area: 1 / 3; align-self: start; width: 100%; }
.perp-rewards small, .perp-rewards p { grid-column: 1 / -1; font-size: 11px; color: #756e5e; }
.perp-rewards small { grid-row: 2; }
.perp-rewards p { margin: 0; }
@media (max-width: 900px) {
  .perp-rewards { grid-template-columns: 1fr; }
}
button:disabled{opacity:.45;cursor:not-allowed}.perp-order-setting{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;margin:12px 0}.perp-order-setting input{width:70px}.perp-order-setting select{max-width:120px}#dialog input{max-width:100%}.perp-note{font-size:12px;padding:8px 0}.perp-error{color:#a34e42}

@media (max-width: 800px) {
  body header.exchange-header {
    flex-wrap: wrap;
    height: auto;
  }
  body header.exchange-header .wallet {
    flex: 1 0 100%;
    gap: 6px;
  }
  .wallet #deposit, .wallet #withdraw {
    display: inline-flex;
    align-items: center;
    padding: 8px;
    min-height: 36px;
  }
  .wallet #deposit {
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 5px;
  }
  .wallet #account { margin-left: auto; }
  body header.exchange-header .exchange-nav { order: 3; flex-basis: 100%; }
}

/* Contract actions on the trading and portfolio pages. */
:is(.perp-rewards button, .wallet #deposit, .wallet #withdraw, #fund-confirm,
    #place, [data-close], #close-all, #confirm-close-all) {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #a99d83;
  border-radius: 6px;
  background-color: var(--card);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
#place { color: white; }
:is(#rows, #portfolio-panel) button[data-close]:enabled {
  background-color: var(--red);
  border-color: var(--red);
  color: #fff;
}
:is(#rows, #portfolio-panel) button[data-close]:enabled:hover {
  background-color: #882323;
}
:is(.perp-rewards button, #fund-confirm, #confirm-close-all):enabled {
  background-color: var(--green);
  color: white;
}
:is(.perp-rewards button, .wallet #deposit, .wallet #withdraw, #fund-confirm,
    #place, [data-close], #close-all, #confirm-close-all):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
@media (max-width: 800px) {
  :is(.perp-rewards button, .wallet #deposit, .wallet #withdraw, #fund-confirm,
      #place, [data-close], #close-all, #confirm-close-all) { min-height: 44px; }
}

.leverage-slider { margin: 8px 0 14px; }
.leverage-current { display: flex; justify-content: flex-end; color: var(--green); font-size: 20px; font-weight: 600; }
.order .leverage-slider input[type="range"] { display: block; width: 100%; height: 36px; margin: 0; padding: 0; cursor: pointer; accent-color: var(--green); background: transparent; border: 0; }
.leverage-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.leverage-slider input:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.referral-skip-action { color: #176bd1; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Explicit track: trade.css disables the browser's native range appearance. */
.order .leverage-slider input[type="range"] { -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.order .leverage-slider input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #2e603c, #847344, #a52b2b); }
.order .leverage-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -9px; border: 2px solid #2e603c; border-radius: 50%; background: #faf6ed; box-shadow: 0 1px 4px #332f2933; }
.order .leverage-slider input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #2e603c, #847344, #a52b2b); }
.order .leverage-slider input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 2px solid #2e603c; border-radius: 50%; background: #faf6ed; box-shadow: 0 1px 4px #332f2933; }

#claim-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
#claim-actions > button { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 16px; border: 1px solid #1556a6; border-radius: 8px; background: #176bd1; color: #fff; font-size: 15px; font-weight: 700; line-height: 1.5; white-space: normal; box-shadow: 0 2px 5px #176bd126; }
#claim-actions > button:enabled:hover { background: #1259b1; filter: none; }
#claim-actions > button:focus-visible { outline: 3px solid #176bd1; outline-offset: 3px; }
#claim-actions > button:disabled { opacity: 1; background: #e5dfd2; border-color: #c8beaa; color: #756d5d; box-shadow: none; cursor: not-allowed; }
@media (max-width: 600px) { #claim-actions { grid-template-columns: 1fr; } #claim-actions > button { min-height: 48px; width: 100%; } }

#pape-share-body .share-copy-button {
  display: block;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 18px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
#pape-share-body .share-copy-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
#pape-share-body .share-copy-feedback { margin: 6px 0 0; color: var(--ink); }
#pape-share-body .share-copy-feedback:empty { margin: 0; }

#pape-share-body .share-active-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#pape-share-body .share-active-row button {
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--card);
  color: var(--green);
  font-weight: 600;
}

#pape-share-body .share-history table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
#pape-share-body .share-history th, #pape-share-body .share-history td { text-align:start; padding:8px 4px; border-bottom:1px solid var(--line); }
#pape-share-body .share-history button { min-height:44px; }
