.unitedswap-root {
  --us-pink: #ff007a;
  --us-pink-2: #ff4da6;
  --us-blue: #2172e5;
  --us-bg: #191b1f;
  --us-bg-2: #212429;
  --us-bg-3: #2c2f36;
  --us-text: #ffffff;
  --us-muted: #8f96ac;
  --us-ok: #27ae60;
  --us-bad: #fd4040;
  --us-radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--us-text);
  line-height: 1.4;
  box-sizing: border-box;
}

.unitedswap-root *,
.unitedswap-root *::before,
.unitedswap-root *::after {
  box-sizing: inherit;
}

.unitedswap-shell {
  background: radial-gradient(1200px 500px at 10% -10%, rgba(255, 0, 122, 0.18), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(33, 114, 229, 0.16), transparent 46%),
    var(--us-bg);
  border-radius: 24px;
  padding: 16px;
  min-height: 420px;
}

.unitedswap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.unitedswap-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.unitedswap-brand img {
  width: 32px;
  height: 32px;
}

/* A site logo or custom image (Settings > Branding) is often a wordmark: keep its shape. */
.unitedswap-brand.is-custom-logo img {
  width: auto;
  max-width: min(200px, 100%);
  height: 34px;
  object-fit: contain;
}

.unitedswap-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.unitedswap-nav button {
  background: transparent;
  border: 0;
  color: var(--us-muted);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.unitedswap-nav button.is-active,
.unitedswap-nav button:hover {
  color: var(--us-text);
  background: var(--us-bg-3);
}

.unitedswap-wallet {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.unitedswap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 16px;
}

.unitedswap-btn-pink {
  background: var(--us-pink);
  color: #fff;
  width: 100%;
}

.unitedswap-btn:disabled,
.unitedswap-btn-pink:disabled {
  opacity: 0.7;
  cursor: wait;
}

.unitedswap-btn.is-loading,
.unitedswap-chip.is-loading {
  pointer-events: none;
}

.unitedswap-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: unitedswap-spin 0.7s linear infinite;
  flex-shrink: 0;
  display: inline-block;
}

.unitedswap-status .unitedswap-spinner {
  border-color: rgba(255, 140, 200, 0.35);
  border-top-color: #ff8cc8;
}

@keyframes unitedswap-spin {
  to {
    transform: rotate(360deg);
  }
}

.unitedswap-btn-ghost {
  background: var(--us-bg-3);
  color: var(--us-text);
}

.unitedswap-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a2b55;
  color: #6da8ff;
  border: 0;
  border-radius: 16px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

.unitedswap-chip:disabled {
  cursor: wait;
  opacity: 0.75;
}

.unitedswap-chip .unitedswap-spinner {
  width: 12px;
  height: 12px;
  border-color: rgba(109, 168, 255, 0.35);
  border-top-color: #6da8ff;
}

.unitedswap-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--us-bg-2);
  border-radius: var(--us-radius);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.unitedswap-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 12px;
}

.unitedswap-field {
  background: var(--us-bg);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}

.unitedswap-field-top {
  display: flex;
  justify-content: space-between;
  color: var(--us-muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.unitedswap-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.unitedswap-field input[type="text"],
.unitedswap-field input[type="number"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--us-text);
  font-size: 24px;
  min-width: 0;
  outline: none;
}

.unitedswap-field input[data-act="send-to"] {
  font-size: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.unitedswap-token {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--us-bg-3);
  border: 0;
  color: var(--us-text);
  border-radius: 16px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

.unitedswap-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.unitedswap-switch {
  width: 36px;
  height: 36px;
  margin: -18px auto;
  position: relative;
  z-index: 1;
  border-radius: 10px;
  border: 4px solid var(--us-bg-2);
  background: var(--us-bg-3);
  color: var(--us-text);
  cursor: pointer;
}

.unitedswap-meta,
.unitedswap-note,
.unitedswap-status {
  color: var(--us-muted);
  font-size: 13px;
  padding: 8px;
}

.unitedswap-status.is-bad {
  color: var(--us-bad);
}

.unitedswap-status.is-ok {
  color: var(--us-ok);
}

.unitedswap-status.is-busy {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ff8cc8;
}

.unitedswap-tx {
  color: #6da8ff;
  margin-left: 6px;
}

.unitedswap-shell.is-busy {
  cursor: wait;
}

.unitedswap-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  z-index: 100000;
  padding: 16px;
}

.unitedswap-modal-card {
  width: min(420px, 100%);
  background: var(--us-bg-2);
  border-radius: 20px;
  padding: 16px;
  max-height: 80vh;
  overflow: auto;
}

.unitedswap-token-list button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  background: transparent;
  border: 0;
  color: var(--us-text);
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.unitedswap-token-list button:hover {
  background: var(--us-bg-3);
}

.unitedswap-settings {
  display: flex;
  gap: 8px;
  padding: 8px;
}

.unitedswap-settings input {
  width: 80px;
  background: var(--us-bg);
  border: 0;
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
}

.unitedswap-pool-item,
.unitedswap-info-row {
  background: var(--us-bg);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.unitedswap-range {
  width: 100%;
}

.unitedswap-empty {
  text-align: center;
  color: var(--us-muted);
  padding: 28px 12px;
}

/* Phones: brand and Connect on the first row, the network picker full width under them, the page tabs (Swap, Pool,
   ...) one swipeable row at the bottom, so nothing spills past the card or wraps into ragged lines. */
@media (max-width: 720px) {
  .unitedswap-shell {
    padding: 12px;
  }
  .unitedswap-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 8px;
  }
  .unitedswap-brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .unitedswap-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .unitedswap-wallet {
    display: contents;
  }
  .unitedswap-wallet > button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    white-space: nowrap;
  }
  .unitedswap-root.unitedswap-root .unitedswap-wallet > select {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .unitedswap-nav {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .unitedswap-nav::-webkit-scrollbar {
    display: none;
  }
  .unitedswap-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Selects (network, fee tier): set completely here, so a theme's select styles (white backgrounds, grey text,
   heights, shadows) never make them unreadable. Doubled class for specificity; colours forced over theme !important. */
.unitedswap-root.unitedswap-root select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color-scheme: dark;
  display: inline-block;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 36px;
  margin: 0;
  padding: 8px 32px 8px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-shadow: none;
  color: var(--us-text) !important;
  background-color: var(--us-bg-3) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238f96ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px;
  box-shadow: none !important;
  cursor: pointer;
  opacity: 1;
}

.unitedswap-root.unitedswap-root select:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.unitedswap-root.unitedswap-root select:focus {
  outline: 2px solid var(--us-pink);
  outline-offset: 1px;
}

.unitedswap-root.unitedswap-root select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.unitedswap-root.unitedswap-root select::-ms-expand {
  display: none;
}

.unitedswap-root.unitedswap-root select option,
.unitedswap-root.unitedswap-root select optgroup {
  color: var(--us-text) !important;
  background-color: var(--us-bg-2) !important;
}

/* Loading placeholder (rendered by the shortcode, replaced by dex.js) */
.unitedswap-loading-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.unitedswap-skel {
  display: block;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(143, 150, 172, 0.12) 25%, rgba(143, 150, 172, 0.26) 50%, rgba(143, 150, 172, 0.12) 75%);
  background-size: 200% 100%;
  animation: unitedswap-shimmer 1.4s ease-in-out infinite;
}
.unitedswap-skel-pill { width: 150px; height: 36px; border-radius: 999px; }
.unitedswap-skel-title { width: 40%; height: 18px; border-radius: 8px; }
.unitedswap-skel-field { width: 100%; height: 84px; }
.unitedswap-loading-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 4px;
  color: var(--us-muted);
  font-size: 14px;
  font-weight: 600;
}
.unitedswap-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(143, 150, 172, 0.3);
  border-top-color: var(--us-pink);
  animation: unitedswap-spin 0.8s linear infinite;
}
@keyframes unitedswap-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes unitedswap-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .unitedswap-skel, .unitedswap-spinner { animation: none; }
}
