/* ─── Loading overlay ─────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
}
.tw-loader-wrap {
  position: relative; width: 40px; height: 40px;
  background: #E9ECF2; border-radius: 10px;
  transform: rotate(45deg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.tw-bars {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 1.5px; transform: rotate(-45deg); padding-bottom: 11px;
}
.tw-bars span {
  display: block; width: 3px; height: 3px;
  background: #6C6CFF; border-radius: 1.5px;
  animation: twBarPulse 1.3s cubic-bezier(0.45,0,0.55,1) infinite;
  transform-origin: bottom center;
}
.tw-bars span:nth-child(1) { animation-delay: -0.80s; }
.tw-bars span:nth-child(2) { animation-delay: -0.87s; }
.tw-bars span:nth-child(3) { animation-delay: -0.94s; }
.tw-bars span:nth-child(4) { animation-delay: -1.01s; }
@keyframes twBarPulse {
  0%,50% { height: 3px; }
  65%     { height: 10px; }
  80%,100%{ height: 3px; }
}

/* frontend/style.css */
:root {
  --primary: #6C6CFF;
  --primary-disabled: #D4D3FF;
  --border: #D0D7DE;
  --text-muted: #6B7280;
  --bg-chip: #F2F3F5;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  color: #000;
  overflow: hidden;
}

.app {
  padding: 14px 16px 96px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.header {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 20px;
}

.label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.field input {
  flex: 1;
  margin-right: 8px;
  font-size: 15px;
  border: none;
  outline: none;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field input::placeholder {
  color: #9CA3AF;
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

.actions span {
  cursor: pointer;
}

.actions img {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Network pill — compact chip style matching Trust Wallet exactly */
.network-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F2F3F5;
  padding: 5px 10px 5px 5px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #000;
  margin-bottom: 14px;
  cursor: default;
  user-select: none;
}

.network-pill-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.network-pill-chevron {
  width: 14px;
  height: 14px;
  color: #6B7280;
  flex-shrink: 0;
  margin-left: 2px;
}

/* Error state for usd value row */
.usd.error {
  color: #EF4444;
  font-weight: 500;
}

.field.amount {
  display: flex;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  justify-content: space-between;
}

.field.amount input {
  font-size: 18px;
  font-weight: 500;
  border: none;
  outline: none;
  width: 100%;
}

.token {
  font-size: 14px;
  font-weight: 600;
  margin-left: 6px;
}

.max {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-left: 6px;
  cursor: pointer;
}

.usd {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  background: #fff;
}

.next {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: none;
  background: var(--primary-disabled);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.next.active {
  background: var(--primary);
}

.next:active.active {
  opacity: 0.8;
}
