* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #F1F5F9;
  min-height: 100vh;
}

.header-gradient {
  background: linear-gradient(135deg, #1E40AF 0%, #4F46E5 50%, #7C3AED 100%);
}

.swap-btn {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.swap-btn:hover {
  transform: rotate(180deg);
}

.swap-btn:active {
  transform: rotate(180deg) scale(0.9);
}

.panel-shadow {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.panel-shadow:focus-within {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3), 0 1px 3px rgba(0,0,0,0.06);
}

textarea {
  resize: none;
  font-family: 'DM Sans', system-ui, sans-serif;
}

textarea:focus {
  outline: none;
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-slide {
  animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 1.7s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

.dots-loading span {
  animation: dotBounce 1.4s infinite ease-in-out both;
}
.dots-loading span:nth-child(1) { animation-delay: -0.32s; }
.dots-loading span:nth-child(2) { animation-delay: -0.16s; }
.dots-loading span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.history-item {
  transition: all 0.15s ease;
}

.history-item:hover {
  background: #EEF2FF;
  transform: translateX(2px);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

@media (max-width: 767px) {
  .mobile-stack {
    flex-direction: column !important;
  }
}