:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1e2329;
  --bg-card: rgba(22, 27, 34, 0.85);
  --bg-card-hover: rgba(30, 37, 46, 0.9);
  --border-color: rgba(48, 54, 61, 0.6);
  --border-accent: rgba(16, 185, 129, 0.2);
  --text-primary: #e6edf3;
  --text-secondary: rgba(230, 237, 243, 0.7);
  --text-tertiary: rgba(139, 148, 158, 0.8);
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  --accent-yellow: #f0b90b;
  --accent-blue: #3b82f6;
  --glow-green: rgba(16, 185, 129, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: #0d1117 !important;
  background-color: #0d1117 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0d1117 !important;
  background-color: #0d1117 !important;
  color: var(--text-primary, #e6edf3);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #0d1117 !important;
  background-color: #0d1117 !important;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header h1 {
  font-size: 18px;
  font-weight: 700;
}

/* Swap Card */
.swap-card {
  margin: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

/* Token Box */
.token-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.2s;
}

.token-box:focus-within {
  border-color: var(--accent-yellow);
}

.token-box-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.token-box-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-amount-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  outline: none;
  min-width: 0;
}

.token-amount-input::placeholder {
  color: var(--text-tertiary);
}

.token-amount-input:read-only {
  color: var(--text-secondary);
}

.token-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(240, 185, 11, 0.08);
  border: 1px solid rgba(240, 185, 11, 0.25);
  border-radius: 100px;
  padding: 6px 14px 6px 8px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.token-selector:hover {
  background: rgba(240, 185, 11, 0.15);
  border-color: var(--accent-yellow);
}

.token-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 10px;
  color: #fff;
}

.token-sym {
  font-weight: 700;
  font-size: 14px;
}

.token-chevron {
  color: var(--text-secondary);
  font-size: 10px;
}

.balance-link {
  color: var(--accent-yellow);
  cursor: pointer;
  font-weight: 600;
}

.balance-link:hover {
  text-decoration: underline;
}

/* Swap arrow */
.swap-arrow-wrap {
  display: flex;
  justify-content: center;
  margin: -8px 0;
  position: relative;
  z-index: 2;
}

.swap-arrow-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 3px solid var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  color: var(--accent-yellow);
}

.swap-arrow-btn:hover {
  background: rgba(240, 185, 11, 0.15);
  transform: rotate(180deg);
}

/* Quote details */
.quote-details {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 13px;
}

.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  color: var(--text-secondary);
}

.quote-row .q-val {
  color: var(--text-primary);
  font-weight: 600;
}

/* Swap button */
.swap-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-yellow), #e6a800);
  color: #0b0e11;
  transition: all 0.25s;
  margin-top: 16px;
  box-shadow: 0 4px 20px rgba(240, 185, 11, 0.2);
}

.swap-btn:hover {
  box-shadow: 0 6px 28px rgba(240, 185, 11, 0.35);
  transform: translateY(-2px);
}

.swap-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Coin picker modal */
.coin-picker {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 300;
  flex-direction: column;
}

.coin-picker.show {
  display: flex;
}

.coin-picker-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.coin-picker-header .close-pick {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}

.coin-picker-header input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.coin-picker-header input::placeholder {
  color: var(--text-tertiary);
}

.coin-picker-list {
  flex: 1;
  overflow-y: auto;
}

.coin-pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s;
}

.coin-pick-item:hover {
  background: var(--bg-tertiary);
}

.coin-pick-item .cpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
}

.coin-pick-item .cpi-name {
  font-weight: 600;
  font-size: 15px;
}

.coin-pick-item .cpi-fullname {
  font-size: 12px;
  color: var(--text-secondary);
}

.coin-pick-item .cpi-balance {
  margin-left: auto;
  text-align: right;
}

.coin-pick-item .cpi-bal-val {
  font-weight: 600;
  font-size: 14px;
}

.coin-pick-item .cpi-bal-usd {
  font-size: 11px;
  color: var(--text-secondary);
}

/* History */
.history-section {
  padding: 0 16px 16px;
}

.history-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.history-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  align-items: center;
}

.hi-icon-swap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(240, 185, 11, 0.12);
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.hi-info {
  flex: 1;
  min-width: 0;
}

.hi-pair-swap {
  font-weight: 700;
  font-size: 14px;
}

.hi-date-swap {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.hi-amounts {
  text-align: right;
  flex-shrink: 0;
}

.hi-from-amt {
  font-size: 13px;
  color: var(--accent-red);
  font-weight: 600;
}

.hi-to-amt {
  font-size: 13px;
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 2px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
}

/* Toast */
.toast-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 12px;
  z-index: 9999;
  font-size: 14px;
  font-weight: 600;
  animation: fadeInToast 0.3s ease;
}

.toast-msg.success {
  background: var(--accent-green);
  color: #fff;
}

.toast-msg.error {
  background: var(--accent-red);
  color: #fff;
}

@keyframes fadeInToast {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Success overlay */
.swap-success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 400;
  justify-content: center;
  align-items: center;
}

.swap-success-overlay.show {
  display: flex;
}

.swap-success-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  color: #1a1a2e;
  animation: popIn 0.35s ease;
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.ssc-emoji {
  font-size: 56px;
  margin-bottom: 12px;
}

.ssc-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-green);
  margin-bottom: 4px;
}

.ssc-sub {
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}

.ssc-details {
  background: #f5f5f5;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.ssc-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.ssc-row:last-child {
  border-bottom: none;
}

.ssc-row .ssc-label {
  color: #999;
}

.ssc-row .ssc-value {
  font-weight: 700;
  color: #1a1a2e;
}

.ssc-done-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: var(--accent-green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.inline-style-d59a4f235d {
  font-size: 12px;
  color: var(--text-secondary);
}

.inline-style-8f798f616a {
  background: #f7931a;
}

.inline-style-356acb12b7 {
  background: #627eea;
}

.inline-style-c8be1ccba6 {
  display: none;
}