:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --card: #fff;
  --border: #eaeaea;
  --text: #0a0a0a;
  --muted: #666666;
  --accent: #2f5fff;
  --accent-soft: rgba(47, 95, 255, .08);
  --accent-text: #fff;
  --radius: 6px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- header / swap diagram ---- */

header.site-header {
  padding: 64px 0 8px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

header.site-header h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0 0 10px;
}

header.site-header p {
  color: var(--muted);
  margin: 0 0 40px;
  font-size: 15px;
}

.swap-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto 8px;
}

.swap-node {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}

.swap-connector {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 12px;
}

.swap-row {
  position: relative;
  height: 1px;
  background: var(--border);
}

.swap-row::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

.swap-row--fwd::after {
  right: -1px;
  border-left: 5px solid var(--border);
}

.swap-row--back::after {
  left: -1px;
  border-right: 5px solid var(--border);
}

.swap-dot {
  position: absolute;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.swap-row--fwd .swap-dot { animation: travelFwd 2.6s linear infinite; }
.swap-row--back .swap-dot { animation: travelBack 2.6s linear infinite; }

@keyframes travelFwd {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; }
}

@keyframes travelBack {
  0% { left: calc(100% - 5px); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 0; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .swap-dot { animation: none; left: calc(50% - 2px); opacity: 1; }
}

section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

section:first-of-type {
  border-top: none;
}

h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}

/* ---- 3-step list ---- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  background: var(--card);
  padding: 18px 16px;
  transition: background .15s ease;
}

.step:hover { background: var(--surface); }

.step .num {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 10px;
}

.step p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---- preview panels ---- */

.preview-panel {
  display: inline-block;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0 0 10px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

label {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label span.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

input, textarea {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
}

input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

button {
  font: inherit;
  cursor: pointer;
}

.btn-primary {
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s ease;
}

.btn-primary:hover { background: var(--accent); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
}

.snippet {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 10px;
  border-radius: 5px;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
}

.form-msg {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 5px;
  display: none;
}

.form-msg.show { display: block; }
.form-msg.ok { background: #e8f7ec; color: #17692b; }
.form-msg.err { background: #fdecec; color: #a3231a; }

/* ---- admin: status badges + row hover ---- */

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge.live { background: #e8f7ec; color: #17692b; }
.status-badge.pending { background: #fff4e0; color: #8a5a00; }
.status-badge.hidden { background: #fdecec; color: #a3231a; }

table tbody tr { transition: background .15s ease; }
table tbody tr:hover { background: var(--surface); }

footer.site-footer {
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  padding: 32px 0 48px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-links .dot {
  color: var(--border);
}

/* ---- about / privacy / terms pages ---- */

.legal-header {
  padding: 56px 0 8px;
}

.legal-header .back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 22px;
}

.legal-header .back-link:hover { color: var(--accent); }

.legal-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

.legal-header .updated {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.legal h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 24px 0 8px;
}

.legal h3:first-child { margin-top: 0; }

.legal p, .legal li {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 12px;
}

.legal ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal strong { font-weight: 700; }

/* ---- pool directory (browse.html) ---- */

.pool-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}

.pool-item:hover { background: var(--surface); }

.pool-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.pool-info { min-width: 0; flex: 1; }

.pool-name {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--text);
}

.pool-tagline {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-arrow {
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
}

.pool-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- rectangle ad unit (rendered by widget.js, also used for the live preview) ---- */

.adswap-unit {
  width: 300px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  position: relative;
  transition: opacity .25s ease;
}

.adswap-unit .adswap-label {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #9a9a9a;
}

.adswap-unit .adswap-body {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 14px 12px;
}

.adswap-unit .adswap-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
  background: #eee;
  flex-shrink: 0;
}

.adswap-unit .adswap-name {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
  color: #1a1a1a;
}

.adswap-unit .adswap-tagline {
  font-size: 12px;
  color: #666;
  margin: 0;
}

.adswap-unit .adswap-cta {
  display: block;
  text-align: center;
  padding: 9px;
  background: #f4f4f4;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.adswap-unit .adswap-cta:hover { background: #ececec; }

.adswap-unit.adswap-empty {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---- copy-to-clipboard ---- */

.snippet-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.snippet-row .snippet { flex: 1; margin: 0; }

.copy-btn {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- expandable "other formats" ---- */

details.more-formats {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--surface);
}

details.more-formats[open] { padding-bottom: 16px; }

details.more-formats summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--muted);
}

details.more-formats summary::-webkit-details-marker { display: none; }

details.more-formats summary::before { content: '+ '; color: var(--accent); }
details.more-formats[open] summary::before { content: '\2212 '; }
details.more-formats summary:hover { color: var(--text); }

.pool-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
}
