.form-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 16px;
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--input-bg);
  transition: border-color 0.2s;
  box-sizing: border-box;
  margin: 0;
  color: var(--text-primary);
}

.form-group input:focus {
  outline: none;
  border-color: #4b6bfb;
  box-shadow: 0 0 0 1px #4b6bfb;
}

.action-button {
  background-color: #4b6bfb;
  color: white;
  padding: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.2s;
  margin-top: 20px;
}

.action-button:hover {
  background-color: #3a54d6;
}

.action-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Status message styling */
.status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

/* Token symbol display */
#sellTokenSymbol,
#buyTokenSymbol {
  margin-left: 10px;
  color: #7780a0;
  font-size: 14px;
}

.form-group input[type="number"] {
  /* Remove default number input styling */
  -moz-appearance: textfield;
}

/* Remove spinner buttons for number inputs */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.paste-button {
  padding: 0 12px;
  background: #4b6bfb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.paste-button:hover {
  background: #3a54d6;
}

.swap-container {
  max-width: 480px;
  margin: 20px auto;
  padding: 0 16px;
}

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

.swap-header h2 {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
}

.settings-icon {
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.settings-icon:hover {
  background: rgba(0, 0, 0, 0.05);
}

.swap-box {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.swap-box h2 {
  margin: 0 0 24px 0;
  font-size: 20px;
  color: #333;
}

.swap-input-container {
  margin-bottom: 4px;
}

.input-box {
  margin-bottom: 4px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-tertiary);
}

.input-box label {
  display: block;
  font-size: 14px;
  color: #7d7d7d;
  margin-bottom: 8px;
}

.input-container {
  display: flex;
  align-items: center;
}

.token-input-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #e8ecf4;
  border-radius: 12px;
  font-size: 16px;
  background: #ffffff;
  transition: border-color 0.2s;
}

.token-select-button {
  background: #f8f9fe;
  border: 1px solid #e8ecf4;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.token-select-button:hover {
  background: #e8ecf4;
}

/* Token modal styling */
.token-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.token-modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.token-modal-content {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

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

.token-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.token-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-secondary);
}

.token-item {
  display: flex;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 8px;
}

.token-item:hover {
  background-color: var(--bg-tertiary);
}

.token-item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.token-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-item-right {
  color: #666;
  font-size: 0.9em;
}

.token-item-info {
  display: flex;
  flex-direction: column;
}

.token-item-symbol {
  font-weight: 500;
  color: var(--text-primary);
}

.token-item-name {
  font-size: 0.85em;
  color: var(--text-secondary);
}

.token-item-balance {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.token-selector {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  padding: 4px 8px;
  border-radius: 16px;
  cursor: pointer;
  gap: 4px;
}

/* Vertical stack for selector + balance chip */
.token-selector-group {
  display: flex;
  flex-direction: column;
  align-items: center; /* center children horizontally */
  gap: 4px;
}

.dropdown-arrow {
  font-size: 12px;
  color: #7d7d7d;
}

.swap-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 24px;
  color: var(--text-secondary);
  line-height: 0;
  margin-top: -12px;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
  background: var(--bg-secondary);
  padding: 4px 0;
}

.swap-arrow svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

.fee-container {
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
}

.create-order-button {
  margin-top: 24px;
  width: 100%;
  padding: 16px;
  background: #4b6bfb;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.create-order-button:hover {
  background: #3a59fa;
}

.create-order-button:disabled {
  background: #e8e8e8;
  cursor: not-allowed;
}

.placeholder-text {
  color: #666;
  font-style: italic;
}

/* Order action buttons */
.fill-button,
.cancel-button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, opacity 0.2s;
}

.fill-button {
  background-color: #4b6bfb;
  color: white;
}

.fill-button:hover {
  background-color: #3a54d6;
}

.cancel-button {
  background-color: #dc2626;
  color: white;
}

.cancel-button:hover {
  background-color: #b91c1c;
}

.fill-button:disabled,
.cancel-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.your-order {
  color: #666666;
  font-style: italic;
  font-size: 14px;
}

.fee-group {
  position: relative;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-tooltip .tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  z-index: 1000;
  margin-bottom: 8px;
  width: 240px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.info-tooltip:hover .tooltip-text {
  visibility: visible;
}

/* Arrow for tooltip */
.info-tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 10px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.fee-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fee-amount {
  font-size: 16px;
  font-weight: 500;
}

.fee-gas {
  font-size: 14px;
  color: #666;
}

/* Add arrow to tooltip */
.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.token-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
}

.token-select:focus {
  outline: none;
  border-color: #007bff;
}

.token-list-loading,
.token-list-empty,
.token-list-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #666;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.token-list-error {
  color: #dc3545;
}

.token-list-empty {
  color: #666;
  font-style: italic;
}

.token-explorer-link {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: var(--text-secondary);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.token-explorer-link:hover {
  opacity: 1;
}

.token-explorer-icon {
  width: 14px;
  height: 14px;
}

.token-item-symbol {
  display: flex;
  align-items: center;
}

.token-address-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 4px;
  z-index: 100;
  display: none;
  white-space: nowrap;
}

.token-input:hover + .token-address-tooltip {
  display: block;
}

.token-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f8f9fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.token-icon img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
}

.token-icon-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.balance-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-icon.small {
  width: 28px;
  height: 28px;
  background: transparent;
}

.token-icon.small img {
  width: 16px;
  height: 16px;
}

.token-icon.small .token-icon-fallback {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

/* Enhanced token modal search styles */
.token-modal-search {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.search-info-text {
  color: #666666;
  font-size: 12px;
  margin-bottom: 8px;
  display: block;
}

.token-search-input {
  width: 100%;
  padding: 12px 16px 12px 40px; /* Added left padding for search icon */
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 18px;
}

.token-search-input:focus {
  outline: none;
  border-color: #4b6bfb;
  box-shadow: 0 0 0 1px #4b6bfb;
}

/* Contract address result styling */
.contract-address-result {
  margin: 8px 16px;
  padding: 16px;
  background: #f0f7ff;
  border: 1px solid #4b6bfb;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contract-address-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contract-address-text {
  color: #4b6bfb;
  font-family: monospace;
  font-weight: 500;
  font-size: 14px;
}

.contract-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contract-action-button {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.verify-button {
  background: transparent;
  border: 1px solid #4b6bfb;
  color: #4b6bfb;
}

.verify-button:hover {
  background: rgba(75, 107, 251, 0.1);
}

.add-token-button {
  background: #4b6bfb;
  border: 1px solid #4b6bfb;
  color: white;
}

.add-token-button:hover {
  background: #3a54d6;
}

.contract-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666666;
  font-size: 14px;
}

.contract-loading .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin: 0;
}

.contract-error {
  color: #dc3545;
  font-size: 14px;
}

.search-placeholder {
  color: #666666;
  font-size: 14px;
  text-align: center;
  padding: 16px;
  background: #f8f9fe;
  border-radius: 12px;
  margin: 8px 16px;
}

/* Search result sections */
.search-section-label {
  padding: 8px 16px;
  font-size: 12px;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8f9fe;
}

.token-sections {
  max-height: 400px;
  overflow-y: auto;
}

.token-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.token-section h4 {
  margin: 0 0 12px 0;
  color: #666666;
  font-size: 14px;
  font-weight: 500;
}

.token-list-empty {
  padding: 20px;
  text-align: center;
  color: #666666;
  font-style: italic;
  background: #f8f9fe;
  border-radius: 12px;
}

/* Token section header styling */
.token-section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.token-section-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.token-section-subtitle {
  color: var(--text-secondary);
  font-size: 12px;
}

.token-section {
  padding: 16px;
  border-bottom: 1px solid #e8ecf4;
}

.token-section:last-child {
  border-bottom: none;
}

/* Update existing token list styling */
.token-list {
  background: var(--bg-secondary);
  border-radius: 8px;
}

.token-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 8px;
}

.token-item:hover {
  background-color: var(--bg-tertiary);
}

.token-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.token-item-symbol {
  font-weight: 500;
  color: var(--text-primary);
}

.token-item-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.token-item-balance {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.unified-token-input {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 16px;
  gap: 12px;
  position: relative;
  z-index: 1;
  min-height: 120px;
}

.token-input-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.token-input-label {
  font-size: 14px;
  color: #666;
  padding-left: 2px;
}

.token-amount-input {
  border: none;
  background: transparent;
  font-size: 20px;
  outline: none;
  padding: 0;
  width: 100%;
  min-width: 0;
}

.token-selector-button {
  padding: 8px 12px;
  min-width: 120px;
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  height: 40px;
  justify-content: center;
}

.token-selector-button:hover {
  background: var(--bg-tertiary);
}

.token-selector-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-balance-display {
  font-size: 14px;
  color: #666;
  padding: 8px 12px;
}

/* Input container spacing */
.swap-input-container {
  margin-bottom: 24px;
}

/* Swap arrow spacing */
.swap-arrow {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  color: #7d7d7d;
  font-size: 20px;
}

/* Add spacing after the last swap-input-container */
.swap-input-container:last-of-type {
  margin-bottom: 24px;
}

/* Container for the entire swap section */
.swap-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

/* Input container */
.swap-input-container {
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Swap arrow styling */
.swap-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 24px;
  color: var(--text-secondary);
  line-height: 0;
  margin-top: -12px;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
  background: var(--bg-secondary);
  padding: 4px 0;
}

.swap-arrow svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

/* Balance text positioning */
.balance-text {
  position: relative;
  z-index: 1;
}

/* Fee container spacing */
.fee-container {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
}

/* Action button spacing */
.action-button {
  margin-top: 20px;
}

/* Taker input styling */
.taker-input-container {
  margin-top: 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  overflow: visible;
  position: relative;
}

.taker-toggle {
  width: 100%;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 14px;
  gap: 8px;
  transition: all 0.2s ease;
}

.taker-toggle:hover {
  background-color: var(--bg-secondary);
  border-radius: 8px;
}

.taker-toggle .chevron-down {
  transition: transform 0.2s ease;
}

.taker-input-content {
  padding: 0 16px 16px;
}

.taker-input-content.hidden {
  display: none;
}

.taker-address-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e8ecf4;
  border-radius: 12px;
  font-size: 16px;
  font-family: monospace;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.taker-address-input:focus {
  outline: none;
  border-color: #4b6bfb;
  box-shadow: 0 0 0 1px #4b6bfb;
}

.taker-address-input::placeholder {
  color: #999;
}

/* Rest of the existing styles remain the same */

.token-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.token-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.token-selector-button {
  padding: 6px 12px;
  min-width: 120px;
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}

.token-selector-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.token-selector-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.token-symbol {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.token-balance {
  font-size: 12px;
  color: #666;
}

.token-icon-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.token-item-balance {
  color: #666;
  font-size: 0.9em;
  margin-left: auto;
  padding-left: 1rem;
}

.amount-usd {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 4px;
  padding-left: 8px;
}

.token-price {
  font-size: 0.85em;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.token-balance-container {
  display: flex;
  gap: 4px;
  align-items: center;
}

.token-balance-usd {
  color: var(--text-secondary);
  font-size: 0.85em;
}

.token-balance-with-usd {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.token-balance-amount {
  color: var(--text-primary);
  font-weight: 500;
}

.token-balance-usd {
  color: var(--text-secondary);
  font-size: 0.85em;
}

.token-selector-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amount-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.token-selector-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Token Balance States */
.token-has-balance {
  border-left: 3px solid #10b981;
}

.token-no-balance {
  border-left: 3px solid #6b7280;
  opacity: 0.7;
}

/* Buy token modal specific styling - remove borders and ensure consistent hover */
#buyTokenModal .token-item {
  border-left: none !important;
}

#buyTokenModal .token-item:hover {
  background-color: var(--bg-tertiary) !important;
  opacity: 1 !important;
}

.token-not-allowed {
  border-left: 3px solid #ef4444;
  opacity: 0.8;
  background-color: #fef2f2;
}

.token-not-allowed:hover {
  background-color: #fee2e2;
  opacity: 1;
}

.token-has-balance:hover {
  background-color: #f0fdf4;
  border-color: #059669;
}

.token-no-balance:hover {
  background-color: #f9fafb;
  opacity: 1;
}

/* Disabled token styling for sell selection */
.token-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.token-disabled:hover {
  background-color: inherit;
  border-color: inherit;
}

.token-disabled .token-item-content {
  opacity: 0.6;
}

.has-balance {
  color: #059669;
  font-weight: 600;
}

.no-balance {
  color: #6b7280;
}

.no-balance-text {
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
}

/* Token Not Allowed Message */
.token-not-allowed-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.875rem;
  text-align: center;
}

/* Empty State Styling */
.token-list-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.empty-state-subtext {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.5;
}

/* Token List Summary */
.token-list-summary {
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  background: #f9fafb;
  margin-top: 8px;
  border-radius: 0 0 8px 8px;
}

.summary-text {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

/* Token Item Actions */
.token-item-actions {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.token-explorer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: #6b7280;
  transition: all 0.2s ease;
}

.token-explorer-link:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.token-explorer-icon {
  width: 16px;
  height: 16px;
}

/* Contract Loading State */
.contract-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #6b7280;
}

.contract-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Contract Error State */
.contract-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.875rem;
}

/* Token Item Improvements */
.token-item {
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 4px;
}

.token-item:last-child {
  margin-bottom: 0;
}

.token-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  width: 100%;
}

.token-item-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.token-item-right {
  display: flex;
  align-items: center;
  margin-left: 12px;
}

.token-balance-with-usd {
  text-align: right;
  margin-right: 8px;
}

.token-balance-amount {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
}

.token-balance-usd {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .token-item-content {
    padding: 10px 12px;
  }

  .token-item-symbol {
    font-size: 0.875rem;
  }

  .token-item-name {
    font-size: 0.75rem;
  }

  .token-balance-amount {
    font-size: 0.8rem;
  }

  .token-balance-usd {
    font-size: 0.7rem;
  }
}

/* Token Balance Display - New Implementation */

.token-balance-display:hover {
  background: var(--bg-tertiary); /* match selector hover */
}

.balance-clickable {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* match selector content spacing */
  padding: 6px 12px; /* pill padding */
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px; /* match selector */
  color: var(--text-primary);
  transition: background-color 0.2s;
  white-space: nowrap;
  min-width: 120px; /* match selector min-width */
}

.balance-clickable:hover {
  background: var(--bg-tertiary);
}

.balance-clickable:focus {
  outline: 2px solid #4b6bfb;
  outline-offset: 2px;
  border-radius: 4px;
}

.balance-clickable:active {
  transform: scale(0.98);
}

.balance-amount {
  font-size: 14px; /* match selector */
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  min-width: 0;
}

.balance-usd {
  font-size: 10px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  opacity: 0.8;
}

/* Explicitly hide balance USD chips by ID when present */
#sellTokenBalanceUSD,
#buyTokenBalanceUSD {
  display: none !important;
}

/* Position balance displays relative to their containers */
#sellContainer {
  position: relative;
}

#buyContainer {
  position: relative;
}

/* Ensure balance displays flow naturally after their containers */
.token-balance-display {
  display: inline-flex;
  align-items: center;
  margin-left: 0;
  margin-right: 0;
  border-radius: 20px; /* match selector */
  padding: 6px 12px; /* match selector */
  transition: background-color 0.2s; /* match selector */
  font-size: 14px; /* match selector */
  color: var(--text-primary);
  gap: 8px; /* match selector */
  align-self: center; /* center chip in the group */
  min-width: 120px; /* match selector min-width */
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .token-balance-display {
    margin-top: 3px;
    padding: 3px 6px;
  }

  .balance-amount {
    font-size: 10px;
  }

  .balance-usd {
    font-size: 9px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .token-balance-display {
    border: 2px solid var(--text-primary);
  }

  .balance-clickable:focus {
    outline: 3px solid var(--text-primary);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .token-balance-display,
  .balance-clickable {
    transition: none;
  }

  .balance-clickable:active {
    transform: none;
  }
}
