:root {
  --bg: #0a0b10;
  --surface: #12141c;
  --surface-2: #1a1d28;
  --border: #242836;
  --border-2: #2f3446;
  --accent: #7c5cff;
  --accent-2: #5b3dd6;
  --accent-dim: #7c5cff33;
  --green: #28d295;
  --red: #ff5572;
  --yellow: #ffb84d;
  --text: #e8e9f0;
  --text-dim: #8890a3;
  --text-mute: #5a6078;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }

/* Background glow */
.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 700px;
  background: radial-gradient(ellipse at center, #7c5cff1a 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  backdrop-filter: blur(12px);
  background: #0a0b10cc;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-dot {
  width: 12px; height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, #7c5cff, #4cc9f0);
  box-shadow: 0 0 12px #7c5cff80;
}
.brand-name { color: var(--text); }
.brand-sub {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 500;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.wallet-area { display: flex; align-items: center; gap: 12px; }
.chip {
  padding: 6px 12px;
  background: var(--accent-dim);
  color: #b7a1ff;
  border: 1px solid #7c5cff40;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.addr {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
}
.btn-wallet {
  background: linear-gradient(135deg, #7c5cff, #5b3dd6);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s;
  box-shadow: 0 4px 14px #7c5cff40;
  font-family: inherit;
}
.btn-wallet:hover { transform: translateY(-1px); box-shadow: 0 6px 18px #7c5cff60; }

.hidden { display: none !important; }

/* Main */
main { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; position: relative; z-index: 1; }

/* Hero */
.hero { text-align: center; margin-bottom: 32px; }
.hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #fff 0%, #b7a1ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}
.hero-sub { color: var(--text-dim); font-size: 16px; margin: 0 0 24px; }

.paste-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.paste-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px 4px 4px 18px;
  gap: 6px;
  border: 1px solid transparent;
  transition: 0.15s;
}
.paste-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.paste-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  padding: 14px 0;
  font-family: "JetBrains Mono", monospace;
}
.paste-input-wrap input::placeholder { color: var(--text-mute); font-family: inherit; }
.paste-hint {
  color: var(--text-mute);
  font-size: 12px;
  padding: 14px 18px 12px;
  line-height: 1.5;
}
.paste-hint strong { color: var(--text-dim); }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #7c5cff, #5b3dd6);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 14px #7c5cff60; }
.btn-primary:disabled { background: var(--surface-2); color: var(--text-mute); cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-2); }
.btn-ghost.small { padding: 8px 12px; font-size: 12px; }
.btn-action {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #7c5cff, #5b3dd6);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}
.btn-action:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px #7c5cff50; }
.btn-action:disabled { background: var(--surface-2); color: var(--text-mute); cursor: not-allowed; }
.btn-action.success { background: linear-gradient(135deg, #28d295, #1ba675); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.card details summary { cursor: pointer; color: var(--text-dim); font-size: 14px; font-weight: 500; list-style: none; }
.card details summary::-webkit-details-marker { display: none; }
.card details summary::before { content: "▸ "; transition: 0.15s; display: inline-block; }
.card details[open] summary::before { transform: rotate(90deg); color: var(--accent); }
.card details[open] summary { color: var(--text); margin-bottom: 14px; }

/* Resolve card */
.resolve-card { animation: slideUp 0.25s ease-out; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.resolve-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.resolve-main { display: flex; align-items: center; gap: 14px; }
.token-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #4cc9f0);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 14px #7c5cff40;
}
.token-symbol { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.token-name { color: var(--text-dim); font-size: 14px; }
.token-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge[data-type="OFT"] { background: #28d29520; color: #5eeaae; border: 1px solid #28d29540; }
.badge[data-type="OFT_ADAPTER"] { background: #ffb84d20; color: #ffc970; border: 1px solid #ffb84d40; }
.badge[data-type="MINT_BURN_ADAPTER"] { background: #ff557220; color: #ff8196; border: 1px solid #ff557240; }
.badge[data-type="UNKNOWN"] { background: #5a607820; color: var(--text-dim); border: 1px solid var(--border); }

.token-addrs {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.addr-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; }
.addr-label { color: var(--text-mute); font-weight: 500; }
.addr-val { color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 65%; }

/* Available on chips */
.section-label { color: var(--text-mute); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.chain-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chain-chip {
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: 0.15s;
  font-weight: 500;
}
.chain-chip:hover { border-color: var(--accent); }
.chain-chip.active { background: var(--accent-dim); border-color: var(--accent); color: #d1c4ff; }
.chain-chip .check { color: var(--green); }

/* Bridge card */
.bridge-card { animation: slideUp 0.25s ease-out 0.1s both; }

.flow-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.flow-col { flex: 1; }
.flow-arrow {
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 10px;
  padding: 0 4px;
  font-weight: 600;
}
label {
  display: block;
  color: var(--text-mute);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
label small { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; color: var(--text-mute); }
.chain-picker select, .recipient-row input, .amount-input-wrap input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  border-radius: 10px;
  outline: none;
  transition: 0.15s;
}
.chain-picker select:focus, .recipient-row input:focus, .amount-input-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.chain-picker select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M3 5l4 4 4-4' stroke='%238890a3' stroke-width='2' fill='none'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.amount-row, .recipient-row { margin-bottom: 16px; }
.amount-input-wrap { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0 14px 0 0; transition: 0.15s; }
.amount-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.amount-input-wrap input { border: none; font-family: "JetBrains Mono", monospace; font-size: 20px; font-weight: 500; padding: 16px 14px; background: none; }
.amount-input-wrap input:focus { box-shadow: none; }
.amount-sym { color: var(--text-dim); font-weight: 600; font-size: 15px; margin-right: 8px; }

.hint { color: var(--text-mute); font-size: 11px; display: block; margin-top: 6px; }
.muted { color: var(--text-mute); font-size: 12px; }

.quote-row {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 16px 0;
  align-items: center;
  flex-wrap: wrap;
}
.quote-item { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; }
.quote-label { color: var(--text-mute); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.quote-val { color: var(--text); font-weight: 600; font-size: 14px; font-family: "JetBrains Mono", monospace; }
.slippage-input { width: 80px; padding: 8px 10px; font-family: "JetBrains Mono", monospace; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 6px; color: var(--text); }
.expand-btn { margin-top: 6px; font-size: 11px; padding: 5px 10px; }

.action-row { display: flex; gap: 10px; margin-top: 20px; }
.action-row .btn-action { flex: 1; }

.approve-box { margin-top: 16px; animation: slideUp 0.25s ease-out; }
.approve-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px;
}
.approve-row.done { border-color: var(--green); background: #28d29510; }
.approve-meta { font-size: 13px; }
.approve-meta b { color: var(--text); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.approve-meta .meta-sub { color: var(--text-mute); font-size: 11px; margin-top: 2px; }
.approve-row.done .meta-sub { color: var(--green); }

.send-status { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.send-status.ok { background: #28d29515; color: #5eeaae; border: 1px solid #28d29540; }
.send-status.err { background: #ff557215; color: #ff8196; border: 1px solid #ff557240; }
.send-status.info { background: #7c5cff15; color: #b7a1ff; border: 1px solid #7c5cff40; }

/* Warnings */
.warnings {
  background: #ffb84d15;
  border: 1px solid #ffb84d30;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 12px;
  color: #ffc970;
}
.warnings ul { margin: 6px 0 0 18px; padding: 0; }
.warnings li { margin: 2px 0; }

/* Log */
.log-card pre {
  background: var(--bg);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
  margin: 10px 0 0;
}
.log-card .ok { color: var(--green); }
.log-card .err { color: var(--red); }
.log-card .warn { color: var(--yellow); }

/* Advanced */
.adv-row { display: flex; gap: 12px; margin-top: 10px; }
.adv-col { flex: 1; }
.adv-col.narrow { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: flex-end; }
.adv-col input, .adv-col select { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-family: inherit; font-size: 13px; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--text-mute);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Wallet Modal */
.wallet-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.wallet-modal-inner {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 22px 24px;
  min-width: 360px;
  max-width: 460px;
  width: 92%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.wallet-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.wallet-modal-head h3 { margin: 0; color: var(--text); font-weight: 700; font-size: 18px; }
.wallet-modal-head button { padding: 6px 10px; font-size: 16px; line-height: 1; }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s;
}
.wallet-item:hover { border-color: var(--accent); background: #151824; transform: translateY(-1px); }
.wallet-item img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: #fff; padding: 2px; }
.wallet-item .wi-icon-fallback { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #7c5cff, #4cc9f0); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 14px; }
.wallet-item .wi-name { flex: 1; font-weight: 600; color: var(--text); font-size: 14px; }
.wallet-item .wi-status { font-size: 11px; color: var(--green); font-weight: 500; }
.wallet-item .wi-status.missing { color: var(--text-mute); }
.wallet-modal-hint { color: var(--text-mute); font-size: 11px; margin-top: 14px; text-align: center; }

/* Responsive */
@media (max-width: 640px) {
  header { padding: 14px 18px; }
  main { padding: 24px 14px 60px; }
  .hero h1 { font-size: 30px; }
  .flow-row { flex-direction: column; align-items: stretch; }
  .flow-arrow { text-align: center; margin: 0; transform: rotate(90deg); }
  .brand-sub { display: none; }
  .adv-row { flex-direction: column; }
}
