/* FOW Swap — usa as variáveis do styles.css (página interna escura, como o Jogo). */
body[data-page="swap"] {
  background: var(--ink);
  color: var(--white);
}

body[data-page="swap"] .nav-links a[aria-current="page"] {
  color: var(--teal-bright);
}

/* `hidden` vence o display:grid/flex dos componentes. */
.sw-page [hidden] {
  display: none !important;
}

.sw-page {
  padding-top: 120px;
  min-height: 100vh;
  --sw-line: rgba(255, 255, 255, 0.08);
  --sw-line-2: rgba(255, 255, 255, 0.14);
  --sw-muted: rgba(255, 255, 255, 0.5);
  --sw-faint: rgba(255, 255, 255, 0.32);
  --sw-box: #0f1923;
  --sw-rose: #fb7185;
}

/* ---------- Hero ---------- */
.sw-hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.sw-hero-inner > div {
  max-width: 620px;
}

.sw-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin: 0;
  padding: 0 0 6px;
}

.sw-hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-hero-stats dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sw-muted);
}

.sw-hero-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--teal-bright);
  letter-spacing: -0.02em;
}

.sw-hero-stats dd.is-muted {
  color: var(--sw-faint);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

/* ---------- Layout ---------- */
.sw-layout {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 36px 0 90px;
}

/* ---------- Swap card ---------- */
.sw-card {
  background: var(--panel);
  border: 1px solid var(--sw-line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 30px 80px -40px rgba(45, 212, 191, 0.35);
  position: relative;
}

.sw-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sw-tabs {
  display: inline-flex;
  background: var(--ink);
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  padding: 3px;
}

.sw-tabs button {
  border: 0;
  background: transparent;
  color: var(--sw-muted);
  font: 600 0.85rem var(--font-body);
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sw-tabs button.is-active {
  background: var(--panel-2);
  color: var(--white);
}

.sw-head-actions {
  display: flex;
  gap: 6px;
}

.sw-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--sw-line);
  background: transparent;
  color: var(--sw-muted);
  cursor: pointer;
}

.sw-icon-btn:hover {
  color: var(--white);
  border-color: var(--sw-line-2);
}

.sw-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.sw-ring-bg {
  stroke: var(--sw-line-2);
}

.sw-ring {
  stroke: var(--teal-bright);
  stroke-dasharray: 56.55;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 12px 12px;
}

/* Settings */
.sw-settings {
  display: grid;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--ink);
  border: 1px solid var(--sw-line);
}

.sw-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sw-set-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-set-label small,
.sw-gas small {
  color: var(--sw-muted);
  font-size: 0.72rem;
}

.sw-seg {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sw-seg button,
.sw-seg-input {
  border: 1px solid var(--sw-line);
  background: transparent;
  color: var(--sw-muted);
  font: 500 0.76rem var(--font-mono);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.sw-seg button.is-active {
  border-color: var(--teal-bright);
  color: var(--teal-bright);
  background: rgba(45, 212, 191, 0.08);
}

.sw-seg-input {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: text;
}

.sw-seg-input input {
  width: 52px;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  outline: none;
}

/* Switch */
.sw-switch {
  position: relative;
  cursor: pointer;
}

.sw-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sw-switch i {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--sw-line-2);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.sw-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.2s var(--ease);
}

.sw-switch input:checked + i {
  background: var(--teal);
}

.sw-switch input:checked + i::after {
  transform: translateX(16px);
}

.sw-switch input:focus-visible + i {
  outline: 2px solid var(--teal-bright);
  outline-offset: 2px;
}

/* Boxes */
.sw-box {
  background: var(--sw-box);
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  padding: 14px;
  transition: border-color 0.2s ease;
}

.sw-box:focus-within {
  border-color: rgba(45, 212, 191, 0.45);
}

.sw-box-top,
.sw-box-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--sw-muted);
}

.sw-box-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.sw-amount {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-amount::placeholder {
  color: var(--sw-faint);
}

.sw-amount-out.is-empty {
  color: var(--sw-faint);
}

.sw-amount-out.is-loading {
  opacity: 0.45;
}

.sw-chain {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
}

.sw-token-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--sw-line-2);
  background: var(--panel-2);
  color: var(--white);
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
}

.sw-token-btn:hover {
  border-color: rgba(45, 212, 191, 0.5);
}

.sw-token-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--sw-muted);
  border-bottom: 2px solid var(--sw-muted);
  transform: rotate(45deg) translateY(-2px);
  margin-left: 2px;
}

.sw-tok-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font: 700 0.68rem var(--font-mono);
  color: var(--ink);
  flex-shrink: 0;
}

.sw-tok-ico.is-sm {
  width: 22px;
  height: 22px;
  font-size: 0.58rem;
}

.sw-usd {
  font-family: var(--font-mono);
}

.sw-bal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}

.sw-chip {
  border: 1px solid var(--sw-line-2);
  background: transparent;
  color: var(--teal-bright);
  font: 500 0.64rem var(--font-mono);
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.sw-chip:disabled {
  color: var(--sw-faint);
  cursor: not-allowed;
}

.sw-impact {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
}

.sw-impact.is-ok { background: rgba(52, 211, 153, 0.12); color: var(--ok); }
.sw-impact.is-warn { background: rgba(251, 191, 36, 0.12); color: var(--warn); }
.sw-impact.is-bad { background: rgba(251, 113, 133, 0.14); color: var(--sw-rose); }

.sw-flip-row {
  display: flex;
  justify-content: center;
  height: 8px;
  position: relative;
  z-index: 2;
}

.sw-flip {
  margin-top: -14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 4px solid var(--panel);
  background: var(--panel-2);
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}

.sw-flip:hover {
  transform: rotate(180deg);
  color: var(--teal-bright);
}

.sw-flip svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sw-flip:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

/* Destination (cross-chain) */
.sw-dest {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--sw-line);
  background: var(--sw-box);
  display: grid;
  gap: 8px;
}

.sw-dest-label {
  font-size: 0.76rem;
  color: var(--sw-muted);
}

.sw-dest-row {
  display: flex;
  gap: 8px;
}

.sw-dest-row input {
  flex: 1;
  min-width: 0;
  background: var(--ink);
  border: 1px solid var(--sw-line);
  border-radius: 10px;
  color: var(--white);
  font: 0.82rem var(--font-mono);
  padding: 10px 12px;
  outline: none;
}

.sw-dest-row input:focus {
  border-color: rgba(45, 212, 191, 0.5);
}

.sw-dest-row input.is-bad {
  border-color: var(--sw-rose);
}

.sw-dest-row input.is-ok {
  border-color: rgba(52, 211, 153, 0.6);
}

.sw-mini-btn {
  border: 1px solid var(--sw-line-2);
  background: var(--panel-2);
  color: var(--white);
  font: 600 0.76rem var(--font-body);
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}

.sw-dest-msg {
  margin: 0;
  font-size: 0.72rem;
  color: var(--sw-muted);
  line-height: 1.45;
}

.sw-dest-msg.is-bad { color: var(--sw-rose); }
.sw-dest-msg.is-ok { color: var(--ok); }

.sw-gas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
}

.sw-gas > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Rate + details */
.sw-rate {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font: 0.8rem var(--font-mono);
  cursor: pointer;
  text-align: left;
}

.sw-rate-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sw-muted);
}

.sw-rate svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.sw-rate[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.sw-details {
  margin: 0 0 4px;
  padding: 4px 4px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--sw-line);
}

.sw-details dt {
  color: var(--sw-muted);
}

.sw-details dd {
  margin: 0;
  text-align: right;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.86);
}

.sw-details dd.is-fow {
  color: var(--teal-bright);
}

.sw-route {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sw-route i {
  font-style: normal;
  color: var(--sw-faint);
}

.sw-saving {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.22);
  color: var(--teal-bright);
  font-size: 0.78rem;
}

.sw-cta {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  font-size: 1rem;
  border-radius: 12px;
}

.sw-cta:disabled {
  background: var(--panel-2);
  color: var(--sw-muted);
  cursor: not-allowed;
  transform: none;
}

.sw-cta.is-warn {
  background: var(--warn);
}

.sw-wallet-line {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 0.76rem var(--font-mono);
  color: var(--sw-muted);
}

.sw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.sw-link {
  border: 0;
  background: none;
  color: var(--teal-bright);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* ---------- Side ---------- */
.sw-side {
  display: grid;
  gap: 18px;
}

.sw-panel {
  background: var(--panel);
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  padding: 18px;
}

.sw-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sw-panel-head .sw-h3 {
  margin: 0;
}

.sw-h3 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sw-muted);
}

.sw-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(225, 167, 85, 0.45);
  color: var(--gold);
}

.sw-compare {
  display: grid;
  gap: 10px;
}

.sw-cmp-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
}

.sw-cmp-row .sw-cmp-name {
  color: rgba(255, 255, 255, 0.78);
}

.sw-cmp-row.is-fow .sw-cmp-name {
  color: var(--white);
  font-weight: 600;
}

.sw-cmp-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sw-cmp-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.28);
}

.sw-cmp-row.is-fow .sw-cmp-bar i {
  background: var(--teal-bright);
}

.sw-cmp-val {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.78);
}

.sw-cmp-row.is-fow .sw-cmp-val {
  color: var(--teal-bright);
}

.sw-note {
  margin: 14px 0 0;
  font-size: 0.74rem;
  color: var(--sw-muted);
  line-height: 1.5;
}

.sw-holder {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(225, 167, 85, 0.3);
  background: rgba(225, 167, 85, 0.06);
  transition: border-color 0.2s ease;
}

.sw-holder:hover {
  border-color: rgba(225, 167, 85, 0.6);
}

.sw-holder-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
}

.sw-holder strong {
  display: block;
  font-size: 0.84rem;
}

.sw-holder small {
  color: var(--sw-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.sw-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.sw-recent li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--sw-line);
  font-size: 0.8rem;
}

.sw-recent li:first-child {
  border-top: 0;
  padding-top: 0;
}

.sw-pair {
  display: inline-flex;
}

.sw-pair .sw-tok-ico + .sw-tok-ico {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--panel);
}

.sw-recent-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sw-recent-main span:last-child {
  color: var(--sw-muted);
  font: 0.7rem var(--font-mono);
}

.sw-status {
  font: 0.68rem var(--font-mono);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.sw-status.is-ok { background: rgba(52, 211, 153, 0.12); color: var(--ok); }
.sw-status.is-run { background: rgba(45, 212, 191, 0.1); color: var(--teal-bright); }
.sw-status.is-bad { background: rgba(251, 113, 133, 0.12); color: var(--sw-rose); }

.sw-recent-empty {
  color: var(--sw-muted);
  font-size: 0.8rem;
}

.sw-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sw;
  display: grid;
  gap: 12px;
}

.sw-steps li {
  counter-increment: sw;
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 10px;
  font-size: 0.8rem;
  color: var(--sw-muted);
  line-height: 1.45;
}

.sw-steps li::before {
  content: counter(sw);
  grid-row: span 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 0.72rem var(--font-mono);
  color: var(--teal-bright);
  border: 1px solid rgba(45, 212, 191, 0.35);
}

.sw-steps strong {
  color: var(--white);
  font-size: 0.84rem;
}

/* ---------- Modals ---------- */
.sw-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 7, 11, 0.72);
  backdrop-filter: blur(6px);
}

.sw-modal[hidden] {
  display: none;
}

.sw-modal-card {
  width: min(440px, 100%);
  max-height: min(640px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--sw-line-2);
  border-radius: 16px;
  padding: 16px;
  animation: sw-pop 0.22s var(--ease);
}

@keyframes sw-pop {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sw-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sw-modal-head h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
}

.sw-search {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--sw-line);
  border-radius: 12px;
  color: var(--white);
  font: 0.9rem var(--font-body);
  padding: 12px 14px;
  outline: none;
}

.sw-search:focus {
  border-color: rgba(45, 212, 191, 0.5);
}

.sw-popular {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.sw-pop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--sw-line-2);
  background: transparent;
  color: var(--white);
  font: 600 0.8rem var(--font-body);
  cursor: pointer;
}

.sw-pop:hover {
  border-color: rgba(45, 212, 191, 0.5);
}

.sw-token-list {
  list-style: none;
  margin: 0 -6px;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

#swReviewBody {
  min-height: 0;
  overflow-y: auto;
}

.sw-token-list button {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  text-align: left;
  cursor: pointer;
}

.sw-token-list button:hover,
.sw-token-list button:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.sw-token-list button.is-selected {
  opacity: 0.45;
  cursor: default;
}

.sw-tl-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sw-tl-name strong {
  font-size: 0.92rem;
}

.sw-tl-name span {
  color: var(--sw-muted);
  font: 0.7rem var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-tl-right {
  text-align: right;
  font: 0.76rem var(--font-mono);
  color: var(--sw-muted);
}

.sw-verified {
  color: var(--teal-bright);
  font-size: 0.7rem;
  margin-left: 4px;
}

.sw-unknown {
  margin: 4px 6px 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.06);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.sw-unknown strong {
  color: var(--warn);
}

.sw-unknown button {
  margin-top: 10px;
}

/* Review */
.sw-rv-pair {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--sw-box);
  border: 1px solid var(--sw-line);
}

.sw-rv-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sw-rv-line small {
  color: var(--sw-muted);
  font-size: 0.74rem;
}

.sw-rv-amt {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sw-rv-tok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.sw-rv-arrow {
  color: var(--sw-faint);
  text-align: center;
  font-size: 0.9rem;
}

.sw-rv-details {
  margin: 14px 0 0;
}

.sw-rv-warn {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.06);
  color: var(--warn);
  font-size: 0.76rem;
}

.sw-progress {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.sw-progress li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding-bottom: 18px;
  position: relative;
}

.sw-progress li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 2px;
  width: 2px;
  background: var(--sw-line-2);
}

.sw-progress li.is-done:not(:last-child)::before {
  background: var(--teal);
}

.sw-pg-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--sw-line-2);
  font: 600 0.7rem var(--font-mono);
  color: var(--sw-muted);
}

.sw-progress li.is-active .sw-pg-dot {
  border-color: var(--teal-bright);
  color: var(--teal-bright);
  animation: sw-pulse 1.2s ease-in-out infinite;
}

.sw-progress li.is-done .sw-pg-dot {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--ink);
}

@keyframes sw-pulse {
  50% { box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.15); }
}

.sw-pg-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.sw-pg-text strong {
  font-size: 0.88rem;
}

.sw-pg-text span {
  color: var(--sw-muted);
  font: 0.72rem var(--font-mono);
}

.sw-success {
  text-align: center;
  padding: 8px 0 4px;
}

.sw-success-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
  font-size: 1.6rem;
}

.sw-success h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.sw-success p {
  margin: 0 0 16px;
  color: var(--sw-muted);
  font-size: 0.84rem;
}

.sw-modal .btn {
  width: 100%;
  border-radius: 12px;
}

.sw-modal .btn + .btn {
  margin-top: 8px;
}

/* Toasts */
.sw-toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 250;
  display: grid;
  gap: 8px;
}

.sw-toast {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--sw-line-2);
  font-size: 0.82rem;
  animation: sw-pop 0.22s var(--ease);
}

/* ---------- Logos ---------- */
.sw-tok-ico img,
.sw-chain-dot img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ---------- Redes ---------- */
.sw-chain-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font: 700 0.5rem var(--font-mono);
  color: var(--ink);
  letter-spacing: 0;
}

.sw-chain-dot.is-xs {
  width: 16px;
  height: 16px;
  font-size: 0.42rem;
}

.sw-hero-chains {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}

.sw-hero-chains li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--sw-line-2);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.sw-netbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.15fr);
  gap: 6px;
  margin-bottom: 10px;
}

.sw-netbar button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px 7px;
  font-size: 0.7rem !important;
  border-radius: 10px;
  border: 1px solid var(--sw-line);
  background: transparent;
  color: var(--sw-muted);
  font: 600 0.78rem var(--font-body);
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.sw-netbar button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-netbar button:hover {
  color: var(--white);
  border-color: var(--sw-line-2);
}

.sw-netbar button.is-active {
  color: var(--white);
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.07);
}

.sw-chain-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 3px;
  border-radius: 999px;
  border: 1px solid var(--sw-line-2);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  font: 600 0.72rem var(--font-body);
  cursor: pointer;
}

.sw-chain-btn:hover {
  border-color: rgba(45, 212, 191, 0.5);
}

.sw-chain-btn::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--sw-muted);
  border-bottom: 1.5px solid var(--sw-muted);
  transform: rotate(45deg) translateY(-1px);
  margin-left: 2px;
}

.sw-chain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  /* dentro da janela: rola em vez de passar da borda */
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sw-chain-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--sw-line);
  background: transparent;
  color: var(--white);
  font: 600 0.92rem var(--font-body);
  text-align: left;
  cursor: pointer;
}

.sw-chain-list button:hover,
.sw-chain-list button:focus-visible {
  border-color: rgba(45, 212, 191, 0.5);
  outline: none;
}

.sw-chain-list button.is-selected {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.07);
}

.sw-chain-list small {
  margin-left: auto;
  color: var(--sw-muted);
  font: 0.7rem var(--font-mono);
}

.sw-chain-list .sw-chain-dot {
  width: 30px;
  height: 30px;
  font-size: 0.58rem;
}

.sw-tok-chain {
  position: relative;
  display: inline-flex;
}

.sw-tok-chain .sw-chain-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  box-shadow: 0 0 0 2px var(--panel-2);
}

.sw-net-stack {
  display: inline-flex;
}

.sw-net-stack .sw-chain-dot + .sw-chain-dot {
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--panel);
}

/* ---------- Cotações comparadas ---------- */
.sw-quotes {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--sw-line);
  background: var(--ink);
  display: grid;
  gap: 6px;
}

.sw-q-head {
  font: 0.66rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sw-muted);
  margin-bottom: 2px;
}

.sw-q-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 56px;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.62);
}

.sw-q-row.is-best {
  color: var(--white);
}

.sw-q-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sw-q-badge {
  font: 600 0.62rem var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.14);
  color: var(--teal-bright);
}

.sw-q-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sw-q-row.is-best .sw-q-val {
  color: var(--teal-bright);
}

.sw-q-diff {
  text-align: right;
  font: 0.72rem var(--font-mono);
  color: var(--sw-rose);
}

/* ---------- Economia ---------- */
.sw-savings {
  position: relative;
  overflow: hidden;
  border-color: rgba(45, 212, 191, 0.28);
  background:
    radial-gradient(ellipse 80% 90% at 100% 0%, rgba(45, 212, 191, 0.14), transparent 60%),
    var(--panel);
}

.sw-sv-amount {
  margin: 2px 0 2px;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--teal-bright);
  font-variant-numeric: tabular-nums;
}

.sw-sv-sub {
  margin: 0;
  font: 0.76rem var(--font-mono);
  color: var(--sw-muted);
}

.sw-sv-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.sw-sv-stats div {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--sw-line);
  min-width: 0;
}

.sw-sv-stats dt {
  font: 0.64rem var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-muted);
}

.sw-sv-stats dd {
  margin: 4px 0 0;
  font: 600 0.92rem var(--font-body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-sv-chains {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.sw-sv-chains li {
  display: grid;
  grid-template-columns: auto 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
}

.sw-sv-chains .sw-cmp-bar i {
  background: var(--teal-bright);
}

.sw-sv-chains .sw-cmp-val {
  color: var(--teal-bright);
}

.sw-sv-empty {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.sw-sv-empty strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--white);
}

.sw-sv-bump {
  animation: sw-bump 0.6s var(--ease);
}

@keyframes sw-bump {
  40% { transform: scale(1.06); }
}

.sw-unknown-meta {
  margin: 4px 0 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--white);
  word-break: break-word;
}

/* ---------- Ordem limitada ---------- */
.sw-lo {
  margin-top: 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--sw-box);
  border: 1px solid var(--sw-line);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.sw-lo-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--sw-muted);
}

.sw-lo-delta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.sw-lo-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-lo-price {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.sw-lo-main,
.sw-lo-exp-row {
  min-width: 0;
}

.sw-lo-unit {
  font-weight: 600;
  color: var(--white);
}

.sw-lo-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sw-lo-chips button {
  border: 1px solid var(--sw-line-2);
  background: transparent;
  color: var(--sw-muted);
  font: inherit;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.sw-lo-chips button:hover {
  color: var(--white);
  border-color: rgba(45, 212, 191, 0.5);
}

.sw-lo-fee {
  margin: 0;
  font-size: 0.76rem;
  color: var(--sw-muted);
}

.sw-orders-tabs {
  margin-bottom: 10px;
}

.sw-orders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.sw-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--sw-box);
  border: 1px solid var(--sw-line);
}

.sw-order-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sw-order-main strong {
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-order-main small {
  font-size: 0.72rem;
  color: var(--sw-muted);
}

.sw-spin {
  animation: sw-pulse 1.2s ease-in-out infinite;
}

@keyframes sw-pulse {
  50% { opacity: 0.4; }
}

/* ---------- Fontes de liquidez ---------- */
.sw-src-btn {
  border: 1px solid var(--sw-line-2);
  background: var(--sw-box);
  color: var(--white);
  font: inherit;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.sw-src-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.sw-src-note {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--sw-muted);
}

.sw-src-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 2px 6px;
  font-size: 0.78rem;
  color: var(--sw-muted);
}

.sw-src-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  display: grid;
  gap: 2px;
}

.sw-src-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}

.sw-src-list label:hover {
  background: var(--sw-box);
}

.sw-src-list input {
  accent-color: #2dd4bf;
  width: 16px;
  height: 16px;
}

.sw-src-empty {
  padding: 14px 8px;
  color: var(--sw-faint);
  font-size: 0.85rem;
}

/* ---------- Gráfico + info do token ---------- */
.sw-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sw-chart-toks,
.sw-tf {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--sw-box);
  border: 1px solid var(--sw-line);
}

.sw-chart-toks button,
.sw-tf button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--sw-muted);
  font: inherit;
  font-size: 0.78rem;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.sw-tf button {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.sw-chart-toks button.is-on,
.sw-tf button.is-on {
  background: rgba(45, 212, 191, 0.12);
  color: var(--white);
}

.sw-chart-toks .sw-tok-ico {
  width: 18px;
  height: 18px;
}

.sw-chart-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 6px;
}

.sw-chart-price strong {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sw-chart-price span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.sw-up { color: #2dd4bf; }
.sw-down { color: var(--sw-rose); }

.sw-chart-box {
  position: relative;
  height: 260px;
  margin: 0 -6px;
}

.sw-chart-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--sw-faint);
  font-size: 0.85rem;
  text-align: center;
  padding: 0 20px;
  z-index: 4;
  background: var(--panel);
  border-radius: 8px;
}

.sw-chart-msg:empty {
  display: none;
}

.sw-chart-attr {
  margin: 6px 0 0;
  font-size: 0.6rem;
  color: var(--sw-faint);
  opacity: 0.75;
}

.sw-chart-attr a {
  color: var(--sw-muted);
}

.sw-ti-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0 0 14px;
}

.sw-ti-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sw-ti-grid dt {
  font-size: 0.72rem;
  color: var(--sw-faint);
}

.sw-ti-grid dd {
  margin: 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--sw-line);
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--sw-muted);
}

.sw-sec-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.sw-sec-pill.is-ok { background: rgba(45, 212, 191, 0.12); color: #2dd4bf; }
.sw-sec-pill.is-warn { background: rgba(225, 167, 85, 0.14); color: var(--gold); }
.sw-sec-pill.is-danger { background: rgba(251, 113, 133, 0.14); color: var(--sw-rose); }
.sw-sec-pill.is-none { background: var(--sw-box); color: var(--sw-faint); }

.sw-sec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
}

.sw-sec-list li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.sw-sec-list li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sw-faint);
  transform: translateY(-1px);
}

.sw-sec-list li.is-danger::before { background: var(--sw-rose); }
.sw-sec-list li.is-warn::before { background: var(--gold); }
.sw-sec-list li.is-info::before { background: rgba(255, 255, 255, 0.3); }

.sw-ti-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 0.78rem;
}

.sw-ti-links a {
  color: var(--teal-bright);
  text-decoration: none;
}

.sw-ti-links a:hover {
  text-decoration: underline;
}

.sw-ti-src {
  margin: 10px 0 0;
  font-size: 0.68rem;
  color: var(--sw-faint);
}

.sw-risk {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.08);
  font-size: 0.82rem;
  color: #fecdd3;
}

.sw-risk.is-warn {
  border-color: rgba(225, 167, 85, 0.4);
  background: rgba(225, 167, 85, 0.07);
  color: #f5deb3;
}

.sw-risk strong {
  display: block;
  margin-bottom: 4px;
  color: var(--white);
}

.sw-risk label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  cursor: pointer;
  color: var(--white);
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .sw-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
  }

  .sw-hero-stats {
    gap: 20px;
  }
}

@media (max-width: 520px) {
  .sw-chart-box {
    height: 220px;
  }

  .sw-netbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }


  .sw-amount {
    font-size: 1.6rem;
  }

  .sw-cmp-row {
    grid-template-columns: 110px minmax(0, 1fr) 70px;
  }

  .sw-hero-stats dd {
    font-size: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-flip,
  .sw-modal-card,
  .sw-toast,
  .sw-progress li.is-active .sw-pg-dot,
  .sw-sv-bump {
    animation: none;
    transition: none;
  }
}

.sw-q-badge.is-ref {
  background: transparent;
  border: 1px solid var(--sw-line-2);
  color: var(--sw-muted);
}

.sw-wallet-ico {
  border-radius: 8px;
  flex: none;
}
