:root {
  --bg: #04040a;
  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-glow: rgba(120,80,255,0.3);
  --text: #f0eeff;
  --muted: rgba(240,238,255,0.45);
  --faint: rgba(240,238,255,0.28);
  --success: #00e5a0;
  --warning: #ffd166;
  --danger: #ff6b6b;
  --purple: #7c4dff;
  --purple-light: #a78bff;
  --cyan: #00e5ff;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background blobs */
.blob { position: fixed; border-radius: 50%; filter: blur(120px); opacity: 0.12; pointer-events: none; z-index: 0; }
.blob-1 { width: 520px; height: 520px; background: radial-gradient(circle, #7c4dff, transparent 70%); top: -180px; left: -180px; }
.blob-2 { width: 420px; height: 420px; background: radial-gradient(circle, #00e5ff, transparent 70%); bottom: -120px; right: -120px; }

/* Nav (matches swap-widget.html) */
nav { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(20px); background: rgba(4,4,10,0.7); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 860px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { width: 34px; height: 34px; border-radius: 8px; }
.logo-text {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  font-size: 0.82rem; color: var(--muted); text-decoration: none; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-badge {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(0,229,255,0.3); padding: 3px 10px;
  border-radius: 100px;
}

/* Page wrapper */
.page { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 2rem 1.25rem 5rem; }

/* Hero (matches swap-widget.html) */
.hero { text-align: center; margin-bottom: 1.75rem; }
.hero-badge {
  display: inline-flex; background: rgba(124,77,255,0.12);
  border: 1px solid rgba(124,77,255,0.25); border-radius: 999px;
  padding: 0.32rem 0.9rem; font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--purple-light); margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800; margin-bottom: 0.5rem;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); font-size: 0.95rem; max-width: 580px; margin: 0 auto; line-height: 1.6; }
.hero-note {
  margin-top: 0.4rem !important;
  font-size: 0.78rem !important;
  color: var(--faint) !important;
  letter-spacing: 0.01em;
}

/* Card (matches swap-widget.html .card) */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 1.5rem; backdrop-filter: blur(20px);
  position: relative; max-width: 780px; margin: 0 auto 1rem;
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,255,0.4), transparent);
}

.card-head {
  display: flex; flex-direction: column; gap: 0.85rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 0.85rem;
}
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.field select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 0.6rem 0.85rem; font-family: inherit; font-size: 0.88rem;
  min-width: 130px; outline: none; transition: border-color 0.2s;
}
.field select:focus { border-color: rgba(124,77,255,0.4); }
.btn-ghost {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 0.6rem 1.1rem; font-family: inherit; font-size: 0.85rem;
  font-weight: 500; cursor: pointer; height: fit-content;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: rgba(124,77,255,0.12); border-color: rgba(124,77,255,0.4); }

.status-line {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.78rem; color: var(--muted);
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warning); box-shadow: 0 0 8px var(--warning);
}
.status.ok .dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status.err .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.source-pills { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.pill {
  font-size: 0.66rem; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); font-weight: 500;
}
.pill.live { color: var(--success); border-color: rgba(0,229,160,0.3); }
.pill.zero { color: var(--faint); }
.pill.err  { color: var(--danger); border-color: rgba(255,107,107,0.3); }

/* Orderbook rows — list inside card, NOT a grid table */
.ob-rows { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, auto);
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.015);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.row:hover { background: rgba(255,255,255,0.035); border-color: var(--border); }

.row .side-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 8px; border-radius: 6px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
}
.side-badge.buy  { background: rgba(0,229,160,0.12);  color: var(--success); }
.side-badge.sell { background: rgba(255,107,107,0.12); color: var(--danger);  }

.row .row-main { min-width: 0; }
.row .price-line {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.row .price-premium {
  font-size: 0.72rem; color: var(--muted); margin-left: 6px; font-weight: 400;
}
.row .whisper-fee {
  font-size: 0.7rem; color: #a78bff; margin-left: 6px; font-weight: 500;
  background: rgba(167,139,255,0.08); border: 1px solid rgba(167,139,255,0.25);
  padding: 1px 6px; border-radius: 100px; cursor: help;
}
.row .meta-line {
  font-size: 0.77rem; color: var(--muted); line-height: 1.4; margin-top: 2px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.row .meta-line .meta-dot { color: var(--faint); }
.row .meta-line .amount-inline {
  color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500;
}

.row .row-side { text-align: right; }

/* Take button — opens the source's actual order page in a new tab. */
.take-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 0.85rem; border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), #4a2fe0);
  color: #fff; text-decoration: none;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.02em; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  border: 1px solid rgba(167,139,255,0.45);
}
.take-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124,77,255,0.32);
  filter: brightness(1.08);
}
.take-btn:active { transform: translateY(0); }
.take-btn .arr { font-size: 0.78rem; opacity: 0.85; }

.take-unavailable {
  font-size: 0.7rem; color: var(--faint); font-style: italic;
  letter-spacing: 0.02em;
}

.empty {
  padding: 2.5rem 1rem; text-align: center; color: var(--muted); font-size: 0.9rem;
}
.hidden { display: none; }

.footnote {
  text-align: center; color: var(--faint); font-size: 0.76rem;
  margin-top: 1.25rem; letter-spacing: 0.02em;
}

/* Mobile */
@media (max-width: 600px) {
  .blob { display: none; }
  .nav-links { display: none; }
  .nav-inner { padding: 12px 16px; }
  .page { padding: 1.5rem 0.85rem 4rem; }
  .card { padding: 1.1rem; border-radius: 20px; }
  .filters { gap: 0.5rem; }
  .field select { min-width: 100px; padding: 0.5rem 0.7rem; font-size: 0.82rem; }
  .row { grid-template-columns: 56px 1fr auto; gap: 0.55rem; padding: 0.6rem 0.7rem; }
  .row .price-line { font-size: 0.88rem; }
  .row .meta-line { font-size: 0.72rem; }
  .take-btn { padding: 0.4rem 0.65rem; font-size: 0.7rem; gap: 4px; }
  .take-btn .arr { display: none; }
}

/* Take-modal (2026-05-24) — non-custodial split-tx flow */
.take-modal-overlay { position: fixed; inset: 0; background: rgba(4,4,10,0.85); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.take-modal { background: rgba(15,15,25,0.95); border: 1px solid rgba(167,139,255,0.25); border-radius: 16px; padding: 32px; max-width: 520px; width: 100%; color: var(--text); position: relative; max-height: 90vh; overflow-y: auto; }
.take-modal h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 8px; background: linear-gradient(135deg, #a78bff 0%, #60a5fa 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.take-modal-sub { color: var(--muted); font-size: 0.82rem; margin-bottom: 24px; }
.take-modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 4px 10px; border-radius: 8px; }
.take-modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.take-step { display: flex; gap: 14px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.take-step:last-of-type { border-bottom: none; }
.take-step-num { flex: 0 0 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #a78bff, #60a5fa); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #0a0a14; font-size: 0.9rem; }
.take-step-body { flex: 1; }
.take-step-body strong { display: block; margin-bottom: 6px; font-size: 0.95rem; }
.take-step-body p { color: var(--muted); font-size: 0.82rem; margin: 0 0 12px; line-height: 1.5; }
.take-step-body code { background: rgba(167,139,255,0.1); padding: 2px 8px; border-radius: 6px; font-size: 0.85rem; color: #a78bff; }
.take-modal-addr { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; word-break: break-all; }
.take-modal-addr code { background: none; padding: 0; font-size: 0.78rem; color: var(--text); }
.take-modal-btn { display: inline-block; background: linear-gradient(135deg, #a78bff, #60a5fa); color: #0a0a14; padding: 10px 18px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 0.85rem; transition: transform 0.15s; }
.take-modal-btn:hover { transform: translateY(-1px); }
.take-modal-btn-secondary { background: rgba(167,139,255,0.15); color: #a78bff; border: 1px solid rgba(167,139,255,0.3); }
.take-step-track { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: rgba(0,229,160,0.06); border: 1px solid rgba(0,229,160,0.2); border-radius: 10px; margin-top: 8px; }
.take-track-dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; animation: pulse 1.5s infinite; }
.take-track-text { font-size: 0.82rem; color: var(--text); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
button.take-btn { font: inherit; cursor: pointer; }
