/* FaroSwap host clone — Phase 1. Pixel-faithful, no Spice Flow.
   Every value here was read off computed styles of the live site (see design-tokens.md). */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --main: #ffffff;
  --paper: #f2f2f2;
  --hover: rgba(0, 0, 0, 0.06);
  --pill: rgba(26, 26, 27, 0.10);
  --badge: rgba(26, 26, 27, 0.04);
  --p: #1a1a1b;
  --s: rgba(26, 26, 27, 0.5);
  --disabled: rgba(26, 26, 27, 0.3);
  --line: rgba(69, 72, 81, 0.10);
  --primary: #326afd;
  --success: #47d1a7;
  --danger: #e5484d;
  --warn: #e8912d;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: Manrope, PingFangSC-Regular, "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--p);
  background-color: var(--main);
  /* The signature page treatment: 2px dots on a 40px pitch. */
  background-image: radial-gradient(circle at 30px 30px, #e0e0e0 2px, transparent 0);
  background-size: 40px 40px;
  min-height: 100vh;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; border: 0; background: none; outline: none; }
a { color: inherit; text-decoration: none; }

/* ---------- sidebar ---------- */

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  padding: 20px 0 20px 20px;
}

.sidebar-card {
  width: 240px;
  height: 100%;
  background: var(--paper);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  padding: 26px 12px 20px;
}

.brand { padding: 0 12px 26px; }
.brand img { display: block; width: 142px; height: 25px; }

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

.nav-item {
  display: block;
  padding: 12px;
  border-radius: 8px;
  color: var(--s);
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--hover); color: var(--p); }
.nav-item .ico { display: block; width: 22px; height: 22px; margin-bottom: 10px; }
.nav-item .label { display: block; font-size: 16px; font-weight: 600; line-height: 1; color: var(--p); }
.nav-item:not(.active) .label { color: var(--s); }
.nav-item .desc { display: block; font-size: 12px; font-weight: 500; line-height: 1.35; color: var(--s); margin-top: 8px; }

.sidebar-foot { margin-top: auto; padding: 0 12px; }
.socials { display: flex; gap: 16px; align-items: center; padding-bottom: 18px; }
.socials a { color: var(--s); display: block; }
.socials a:hover { color: var(--p); }
.socials svg { display: block; width: 16px; height: 16px; }
.powered {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--s);
}

/* ---------- header pills ---------- */

.topbar {
  position: fixed;
  top: 12px; right: 24px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.pill {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--pill);
  font-size: 14px;
  font-weight: 500;
}
.pill img, .pill svg { width: 20px; height: 20px; border-radius: 50%; display: block; }

/* ---------- page shell ---------- */

.main {
  margin-left: 260px;
  padding: 60px 20px 40px 0;
}

.panel {
  background: var(--paper);
  border-radius: 16px;
}

/* ---------- swap page ---------- */

.swap-page { padding: 28px 20px 0; }

.swap-card {
  width: 450px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 16px;
  padding: 20px 16px 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 16px;
}
.card-title { font-size: 20px; font-weight: 600; line-height: 1; }
.icon-btn { color: var(--p); display: flex; }
.icon-btn svg { display: block; width: 20px; height: 20px; }

.token-rows { position: relative; }

.token-row {
  background: var(--main);
  border-radius: 12px;
  padding: 20px 20px 24px;
}
.token-row + .token-row { margin-top: 8px; }

.tr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.token-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}
.token-select img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }
.token-select .caret { color: var(--s); font-size: 10px; }
.token-select.empty { color: var(--p); letter-spacing: 0.02em; }

.balance { font-size: 14px; font-weight: 500; color: var(--s); }

.amount {
  width: 100%;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--p);
  padding: 0;
}
.amount::placeholder { color: var(--disabled); }
.amount-out { font-size: 24px; font-weight: 600; line-height: 1.2; }
.usd { font-size: 12px; font-weight: 500; line-height: 1.2; color: var(--s); margin-top: 6px; }

.flip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--s);
  border: 3px solid var(--paper);
}
.flip svg { width: 16px; height: 16px; display: block; }

.quote-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 0 12px;
  font-size: 14px;
  font-weight: 500;
}
.quote-note.muted { color: var(--s); }
.quote-note .impact { color: var(--danger); }
.quote-note .warn-ico { color: var(--warn); display: flex; }
.quote-note svg { width: 16px; height: 16px; display: block; }

.cta {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
}
.cta[disabled] { background: var(--pill); color: var(--disabled); cursor: default; }

/* ---------- order history ---------- */

.order-history { margin: 28px 0 0; }
.oh-head { padding: 20px; font-size: 20px; font-weight: 600; border-bottom: 1px solid var(--line); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 96px 0;
  color: var(--s);
  font-size: 14px;
}
.empty-glyph { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.empty-glyph i { width: 24px; height: 24px; border-radius: 50%; background: #d9d9d9; display: block; }
.empty-glyph i:nth-child(2) { background: #c4c4c4; }

/* ---------- tabs (pool) ---------- */

.tabstrip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
}
.tabs { display: flex; gap: 8px; }
.tab {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--p);
}
.tab.active { background: #e3ebfe; color: var(--primary); }
.tab.muted { color: var(--s); }

.btn-outline {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
}

.searchbar {
  margin: 0 20px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--s);
}
.searchbar svg { width: 16px; height: 16px; display: block; }
.searchbar input { width: 100%; font-size: 14px; }
.searchbar input::placeholder { color: var(--s); }

/* ---------- pool table ---------- */

.ptable { width: 100%; border-collapse: collapse; }
.ptable th {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--p);
  padding: 20px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ptable th:first-child, .ptable td:first-child { padding-left: 20px; }
.ptable th:last-child, .ptable td:last-child { padding-right: 20px; text-align: right; }
.ptable td { padding: 14px 12px; font-size: 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable tr:hover td { background: rgba(0, 0, 0, 0.02); }

.pair { display: flex; align-items: center; gap: 12px; }
.pair-icons { display: flex; }
.pair-icons img, .pair-icons .letter {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid var(--paper);
}
.pair-icons > *:last-child { margin-left: -8px; }
.letter {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  background: #8a8f98;
}
/* Attribute selectors, not inline style="" — privacy extensions strip inline styles
   and the mark would render as a colourless circle (§7, Cypher 2026-05-04). */
.letter[data-sym="Atest"] { background: #2b3a52; }
.letter[data-sym="Btest"] { background: #3d5570; }
.letter[data-sym="PDOG"]  { background: #e8c33a; color: #4a3c00; }
.pair-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.pair-addr {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--s); margin-top: 2px;
}
.pair-addr svg { width: 12px; height: 12px; display: block; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--badge);
  color: var(--s);
  font-size: 12px;
  font-weight: 500;
}
.badge + .badge { margin-left: 6px; }

.apy { color: var(--success); font-size: 14px; font-weight: 600; }

.btn-add {
  width: 58px; height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.btn-add.adding {
  width: auto; padding: 0 12px;
  background: var(--pill); color: var(--p);
  white-space: nowrap;
}

/* ---------- pool drawer ---------- */

.panel-wrap { display: flex; gap: 20px; align-items: flex-start; }
.panel-wrap .panel { flex: 1; min-width: 0; }

.drawer {
  width: 340px;
  flex: none;
  background: var(--paper);
  border-radius: 16px;
  padding: 20px;
}
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-title { font-size: 16px; font-weight: 600; }
.drawer-close { color: var(--s); font-size: 14px; }
.drawer-body {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 70px 0 40px;
}
.drawer-empty { font-size: 14px; font-weight: 500; color: var(--s); }
.btn-addpos {
  background: var(--primary); color: #fff;
  border-radius: 8px; padding: 10px 20px;
  font-size: 14px; font-weight: 500;
}

.loadmore {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 18px; font-size: 14px; font-weight: 500; color: var(--p);
  width: 100%;
}
.loadmore svg { width: 14px; height: 14px; display: block; }

/* ---------- add liquidity page ---------- */

/* Measured on the live host: card 600 wide, 560 inner. */
.al-page { padding: 8px 20px 40px; }

.al-card {
  width: 600px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 16px;
  padding: 0 20px 20px;
}
.al-head {
  display: flex; align-items: center;
  padding: 24px 0;
}
.al-head .back { color: var(--p); display: flex; }
.al-head .back svg { width: 20px; height: 20px; display: block; }
.al-head h2 { flex: 1; margin: 0; text-align: center; font-size: 20px; font-weight: 600; }
.al-head .spacer { width: 20px; }

.al-label { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.al-label.no-mb { margin-bottom: 0; }
.al-row { display: flex; gap: 16px; margin-bottom: 16px; }

.tok-drop {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  height: 50px; padding: 8px 20px;
  background: var(--main);
  border-radius: 12px;
  font-size: 16px; font-weight: 500;
}
.tok-drop img { width: 24px; height: 24px; border-radius: 50%; display: block; }
.tok-drop .caret { margin-left: auto; color: var(--s); font-size: 10px; }

.fee-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
  background: var(--main);
  border-radius: 12px;
  padding: 12px 12px 12px 20px;
  margin-bottom: 24px;
  font-size: 16px; font-weight: 500;
}
.btn-edit {
  width: 60px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}

.range-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.seg { display: flex; gap: 4px; }
.seg button { padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--s); }
.seg button.active { background: #e3ebfe; color: var(--primary); }
.seg button.on { background: var(--pill); color: var(--p); }

.price-box {
  background: var(--main);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  position: relative;
}
.price-box .cap { font-size: 14px; font-weight: 500; }
.price-box .sub { font-size: 12px; font-weight: 500; color: var(--s); margin-top: 2px; }
.price-box input { font-size: 24px; font-weight: 600; margin-top: 10px; width: 70%; }
.price-box input::placeholder { color: var(--disabled); }
.steppers { position: absolute; right: 16px; top: 14px; display: flex; flex-direction: column; gap: 8px; }
.steppers button {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--badge); color: var(--s);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}

.current-price { font-size: 16px; font-weight: 500; margin: 20px 0 4px; }
.current-price + div { font-size: 16px; font-weight: 500; }

.pos-empty {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 56px 0 64px;
  color: var(--p); font-size: 16px; font-weight: 500;
}
.pos-empty svg { width: 40px; height: 40px; color: var(--p); display: block; }

.dep-box {
  background: var(--main);
  border-radius: 12px;
  padding: 12px 20px 20px;
  position: relative;
}
.dep-top { display: flex; align-items: center; justify-content: space-between; }
.dep-tok { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.dep-tok img { width: 24px; height: 24px; border-radius: 50%; display: block; }
.dep-box input { font-size: 24px; font-weight: 600; width: 100%; margin: 8px 0 12px; }
.dep-box input::placeholder { color: var(--disabled); }
.pcts { display: flex; gap: 8px; }
.pcts button {
  flex: 1; height: 25px; border-radius: 4px;
  background: var(--pill); color: var(--s);
  font-size: 12px; font-weight: 500;
}
.dep-plus {
  position: absolute; left: 50%; bottom: -18px;
  transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--main); border: 2px solid var(--paper);
  display: flex; align-items: center; justify-content: center;
  color: var(--s); font-size: 16px; line-height: 1;
  z-index: 2;
}
.dep-box + .dep-box { margin-top: 12px; }

.slip-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 36px;
  background: var(--main);
  border-radius: 8px;
  padding: 0 12px;
  margin: 32px 0 16px;
  font-size: 16px; font-weight: 500;
}

/* The add-liquidity CTA is taller and rounder than the swap card's — measured
   560x60 r16 on the host vs 418x48 r8 on /swap. */
.cta-al { height: 60px; border-radius: 16px; }
.slip-row .val { display: flex; align-items: center; gap: 6px; }
.slip-row svg { width: 14px; height: 14px; display: block; color: var(--s); }

/* ---------- points page ---------- */

.pts-top { display: flex; gap: 20px; margin-bottom: 20px; }
.pts-left { flex: 1; background: var(--paper); border-radius: 16px; padding: 24px; min-height: 356px; }
.pts-right { width: 600px; background: var(--paper); border-radius: 16px; padding: 24px; }

.pts-toggle { display: flex; justify-content: center; margin-bottom: 20px; }
.pts-toggle .wrap { display: flex; background: var(--badge); border-radius: 8px; padding: 3px; }
.pts-toggle button { padding: 7px 14px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--s); }
.pts-toggle button.active { background: var(--main); color: var(--p); }

.pts-score { text-align: center; font-size: 28px; font-weight: 600; margin-bottom: 14px; }
.pts-badge {
  display: block; width: fit-content; margin: 0 auto 16px;
  background: #fdf3d4; color: #8a6a12;
  border-radius: 6px; padding: 5px 10px;
  font-size: 12px; font-weight: 500;
}
.pts-viewmore {
  display: block; margin: 0 auto 22px;
  border: 1px solid var(--primary); color: var(--primary);
  border-radius: 8px; padding: 8px 18px;
  font-size: 14px; font-weight: 600;
}
.pts-note {
  background: var(--main); border-radius: 12px; padding: 20px;
  text-align: center; font-size: 13px; font-weight: 500; color: var(--s); line-height: 1.5;
}

.lb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lb-title { font-size: 20px; font-weight: 600; }
.lbtable { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.lbtable th {
  text-align: left; font-size: 14px; font-weight: 500; color: var(--s); padding: 4px 16px;
}
.lbtable th:last-child, .lbtable td:last-child { text-align: right; }
.lbtable td { background: var(--main); padding: 16px; font-size: 14px; font-weight: 500; }
.lbtable td:first-child { border-radius: 8px 0 0 8px; }
.lbtable td:last-child { border-radius: 0 8px 8px 0; }
.lbtable tr.you td { background: #e9effe; color: var(--primary); }
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--pill); font-size: 12px; font-weight: 600;
}
.rank.g1 { background: #f5c451; color: #fff; }
.rank.g2 { background: #c9cdd4; color: #fff; }
.rank.g3 { background: #d19a66; color: #fff; }

.mission-tabs { display: flex; gap: 12px; margin-bottom: 20px; }
.mtab {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 10px;
  background: var(--badge); color: var(--s);
  font-size: 18px; font-weight: 500;
}
.mtab .mico {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--pill);
  display: flex; align-items: center; justify-content: center;
}
.mtab .mico svg { width: 18px; height: 18px; display: block; }
.mtab.active {
  background: linear-gradient(90deg, #cfd8a8 0%, #8f9de8 100%);
  color: #fff;
}
.mtab.active .mico { background: #fff; color: var(--primary); }

.pts-body { display: flex; gap: 20px; align-items: flex-start; }
.pts-missions { flex: 1; background: var(--paper); border-radius: 16px; padding: 24px; }
.pts-missions h3 { margin: 0 0 16px; font-size: 22px; font-weight: 600; }
.pts-missions p, .pts-missions li { font-size: 15px; font-weight: 500; line-height: 1.6; }
.pts-missions ol { margin: 0; padding-left: 20px; }
.pts-missions .hint { font-size: 13px; color: var(--s); margin: 2px 0 10px; }
.pts-missions a { color: var(--primary); text-decoration: underline; }
.chip {
  display: inline-flex; align-items: center;
  background: var(--badge); border-radius: 5px;
  padding: 2px 7px; font-size: 14px; font-weight: 500;
}
.pts-side { width: 340px; background: var(--paper); border-radius: 16px; padding: 24px; }
.pts-side .row { display: flex; align-items: center; gap: 16px; }
.pts-side .circ {
  width: 56px; height: 56px; border-radius: 50%;
  background: #dfe6f7; display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.pts-side .circ svg { width: 24px; height: 24px; display: block; }
.pts-side .t { font-size: 18px; font-weight: 600; }
.pts-side .v { font-size: 20px; font-weight: 600; margin: 6px 0 10px; }
