.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 46, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dialog {
  background: var(--bg-mid);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  animation: dialogIn 0.18s ease;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ─── Header ────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ─── Selects row ────────────────────────────── */

.selectsRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.selectGroup {
  position: relative;
}

.selectLabel {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.selectTrigger {
  width: 100%;
  height: 48px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0 12px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.selectTrigger:hover,
.selectTriggerOpen {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.selectValue {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.chevronOpen {
  transform: rotate(180deg);
}

/* ─── Token dot ─────────────────────────────── */

.tokenDot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.tokenDot img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ─── Speed dot ─────────────────────────────── */

.speedDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.speedDot_slow {
  background: #f3ba2f;
  box-shadow: 0 0 6px rgba(243, 186, 47, 0.6);
}

.speedDot_normal {
  background: var(--interactive);
  box-shadow: 0 0 6px rgba(74, 109, 255, 0.6);
}

.speedDot_fast {
  background: var(--success);
  box-shadow: 0 0 6px rgba(38, 161, 123, 0.6);
}

/* ─── Dropdown ──────────────────────────────── */

.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1e1a4a;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dropdownItem {
  width: 100%;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.dropdownItem:hover {
  background: var(--glass-bg);
}

.dropdownItemActive {
  background: rgba(74, 109, 255, 0.15);
  color: #7a9dff;
}

.dropdownTicker {
  font-weight: 600;
  font-size: 14px;
}

.dropdownName {
  color: var(--text-secondary);
  font-size: 12px;
  flex: 1;
}

/* ─── Fields ────────────────────────────────── */

.field {
  margin-bottom: 20px;
}

.fieldLabel {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  height: 52px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--font-sans);
}

.input:focus {
  border-color: var(--interactive);
  background: rgba(74, 109, 255, 0.05);
}

.input[type='number']::-webkit-outer-spin-button,
.input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.input[type='number'] {
  -moz-appearance: textfield;
}

/* ─── Amount field ──────────────────────────── */

.amountWrap {
  position: relative;
}

.amountInput {
  padding-right: 64px;
}

.amountTicker {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
  user-select: none;
}

.maxHint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.maxBtn {
  background: none;
  border: none;
  padding: 0;
  color: var(--interactive);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.maxBtn:hover {
  color: var(--highlight);
  text-decoration: underline;
}

/* ─── Error message ─────────────────────────── */

.errorMsg {
  background: rgba(255, 68, 102, 0.1);
  border: 1px solid rgba(255, 68, 102, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--error);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ─── Submit button ─────────────────────────── */

.submitBtn {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #4a6dff 0%, #6b4fff 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
}

.submitBtn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.submitBtn:active {
  transform: translateY(0);
  opacity: 1;
}

/* ─── Mobile ────────────────────────────────── */

@media (max-width: 520px) {
  .dialog {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .selectsRow {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
