/* Self hosted so the browser needs no second origin before it can paint text.
   Regenerate with: node scripts/fetch-fonts.mjs */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-tight-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-tight-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-tight-700.woff2') format('woff2');
}

/*
 * Lunar terminal.
 * Same layout as the original dapp — 288px rail, metric row, side by side swap
 * legs over a stat grid, and a right column of wallet, market and activity —
 * carried over onto the site's deep space palette.
 */

:root {
  --space: #05070c;
  --space-2: #080b12;
  --ink: #f3f6fb;
  --text: #dfe7f1;
  --muted: #90a1b6;
  --dim: #64748b;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --blue: #3b82f6;
  --blue-deep: #406ae4;
  --blue-glow: rgba(59, 130, 246, 0.35);
  --grad-blue: linear-gradient(110deg, #3b82f6 0%, #406ae4 100%);
  --pos: #4ade80;
  --neg: #f87171;
  --warn: #fbbf24;
  --accent: #3b82f6;

  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 18px;
  --radius-lg: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Guard against extensions that inject their own layout. */
.notranslate { }

body.terminal {
  margin: 0;
  min-height: 100vh;
  background: var(--space);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.125rem; }

::selection { background: var(--blue); color: #fff; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* The signature micro label of the terminal. */
.eyebrow {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 320px;
  min-height: 100vh;
}

.shell > *, .main > *, .view > *, .panel > * { min-width: 0; }

/* Rail */
.side {
  background: var(--space-2);
  border-right: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side-brand { padding: 1.75rem 1.5rem 1.5rem; }

.side-brand .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.side-brand .brand .mark { display: none; }
.rail-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.side-brand .brand small { font-size: inherit; letter-spacing: inherit; color: var(--blue); }

.side-brand .sub {
  margin-top: 0.6rem;
  font-size: 0.625rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--dim);
}

.side-group { padding: 0.75rem 0.9rem 0; }
.side-group h6 {
  margin: 0 0 0.6rem 0.6rem;
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.side-link:hover { background: var(--surface-strong); color: var(--ink); }
.side-link.active { background: var(--grad-blue); color: #fff; box-shadow: 0 10px 26px -14px var(--blue-glow); }
.side-link svg { width: 15px; height: 15px; flex: none; opacity: 0.85; }
.side-link.active svg { opacity: 1; }
.side-link .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink);
  background: var(--surface-strong);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
}
.side-link.active .badge { background: rgba(0, 0, 0, 0.25); color: #fff; }

.side-connect-wrap { padding: 1.5rem 1.25rem; }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; }

.main-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 2rem 1rem;
  flex-wrap: nowrap;
}
.main-head > div:first-child { min-width: 0; }
.main-head h1 { font-size: 1.875rem; white-space: nowrap; }
.main-head .eyebrow { display: block; margin-bottom: 0.35rem; }
.main-head .spacer { flex: 1; }

.title-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: nowrap; min-width: 0; }
.title-badge {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 1 260px;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.search-box:focus-within { border-color: var(--line-strong); background: var(--surface-strong); }
.search-box svg { width: 14px; height: 14px; flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--ink);
}
.search-box input:focus { outline: none; }
.search-box input::placeholder { color: var(--dim); }
.search-box kbd {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05rem 0.3rem;
  color: var(--dim);
  flex: none;
}

.view { padding: 1.25rem 2rem 2.5rem; display: grid; gap: 1.25rem; align-content: start; }
#view-desc { padding: 0 2rem; font-size: 0.875rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.btn:hover { background: var(--surface-strong); border-color: var(--line-strong); }
.main-head .btn { white-space: nowrap; flex: none; }
.main-head .pill { white-space: nowrap; flex: none; }

.btn-primary {
  background: var(--grad-blue);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 28px -14px var(--blue-glow);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--surface); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.dot.idle { background: var(--dim); box-shadow: none; }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 1.125rem; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 1.25rem; }

.metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
}
.metric .k {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.metric .k-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--blue);
  flex: none;
}
.metric .k-icon svg { width: 12px; height: 12px; }
.metric .v-row { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.55rem; }
.metric .v {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric .delta { font-size: 0.6875rem; font-weight: 600; }
.metric .delta.pos { color: var(--pos); }
.metric .delta.neg { color: var(--neg); }
.metric .s { margin-top: 0.2rem; font-size: 0.75rem; color: var(--muted); }
.metric a.s { display: inline-block; color: var(--blue); }

/* Swap: legs side by side, stats grid underneath, full width action. */
.swap-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.swap-grid > *, .rail-col > *, .side > * { min-width: 0; }
.swap-detail { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

/* Legs sit flush, two halves of one strip, with the invert control on the seam. */
.legs {
  display: grid;
  /* minmax(0, …) rather than 1fr: the token name inside each leg has a
     min-content width, and plain 1fr lets that push the second column past
     the rounded container. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* One column pinned to the leg's own width. Left as `auto` the track sizes to
   the widest row, and a long quoted amount then pushes past the leg. */
.leg {
  background: var(--surface);
  padding: 1.1rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-content: start;
  min-width: 0;
}
.leg + .leg { border-left: 1px solid var(--line); }

.leg-top {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.token-select {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
}
.token-select:hover { border-color: var(--line-strong); }
.token-select .glyph {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line);
}
.token-select .sym { font-weight: 600; }
.token-select .name { color: var(--muted); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.token-select .caret { margin-left: auto; color: var(--dim); font-size: 0.7rem; }

.leg-amount { display: flex; align-items: baseline; gap: 0.75rem; min-width: 0; }
.leg-amount .max {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--blue);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font: inherit;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  cursor: pointer;
  flex: none;
}
.leg-amount .usd { font-size: 0.75rem; color: var(--muted); flex: none; }
.leg-amount input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  text-align: right;
  padding: 0;
}
.leg-amount input:focus { outline: none; }
.leg-amount input::placeholder { color: var(--dim); }
.leg-amount input:disabled { color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; }

.swap-switch {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.swap-switch button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--space-2);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.swap-switch button:hover { color: var(--blue); border-color: var(--line-strong); }

.quote-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1.25rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.quote-stat { background: var(--space-2); padding: 0.85rem 1rem; display: grid; gap: 0.35rem; }
.quote-stat .k {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-stat .v { font-size: 0.875rem; color: var(--ink); overflow-wrap: anywhere; }

/* Kept for the route and guard panels. */
.quote-lines { display: grid; gap: 0.6rem; font-size: 0.8125rem; }
.quote-lines div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.quote-lines span:first-child {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-lines span:last-child, .quote-lines a { color: var(--text); }
.quote-lines a { color: var(--blue); }

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tabs button {
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 14px;
  cursor: pointer;
}
.tabs button.active { background: var(--grad-blue); color: #fff; }

.action-btn {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.95rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}

.route-view { display: grid; gap: 0.6rem; }
.hop {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.8125rem;
}
.hop .pair { font-family: var(--font-display); font-size: 0.9375rem; color: var(--ink); }
.hop .meta { font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hop .glyph { background: var(--surface-strong) !important; border-color: var(--line) !important; color: var(--muted) !important; }
.hop a.meta { color: var(--blue); }

/* Right column */
.rail-col {
  border-left: 1px solid var(--line);
  background: var(--space-2);
  padding: 1.5rem 1.25rem;
  display: grid;
  gap: 1rem;
  align-content: start;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.wallet-card { padding: 1.1rem; }
.wallet-card .addr { font-family: var(--font-mono); font-size: 0.8125rem; margin-top: 0.5rem; color: var(--ink); }
.wallet-card .bal { font-family: var(--font-display); font-size: 1.5rem; margin-top: 0.5rem; }

.mini-list { display: grid; gap: 0.6rem; }
.mini-row { display: flex; justify-content: space-between; gap: 0.7rem; font-size: 0.8125rem; align-items: baseline; }
.mini-row .sym { font-weight: 600; letter-spacing: 0.04em; color: var(--ink); }
.mini-row .val { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }

.spark { width: 100%; height: 46px; display: block; }

/* Token picker */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 200;
}
.modal {
  width: min(100%, 440px);
  max-height: min(78vh, 620px);
  display: flex;
  flex-direction: column;
  background: var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
}
.modal header { display: flex; align-items: center; gap: 0.7rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal header h3 { font-size: 1.125rem; }
.modal header button { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.modal .search { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal .search input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
}
.modal .search input:focus { outline: none; border-color: var(--line-strong); }
.modal .list { overflow-y: auto; padding: 0.5rem; }

.token-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}
.token-row:hover { background: var(--surface-strong); }
.token-row .glyph {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-strong); border: 1px solid var(--line);
  overflow: hidden; flex: none;
}
.token-row .name { font-size: 0.6875rem; color: var(--muted); }
.token-row .right { margin-left: auto; text-align: right; font-family: var(--font-mono); font-size: 0.75rem; }
.wallet-icon { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.modal-note {
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Toasts */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; display: grid; gap: 0.6rem; z-index: 300; width: min(360px, calc(100vw - 2rem)); }
.toast {
  border: 1px solid var(--line-strong);
  background: var(--space-2);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.8125rem;
  box-shadow: 0 24px 50px -26px rgba(0, 0, 0, 0.95);
  animation: rise 0.25s ease;
}
.toast.ok { border-color: rgba(74, 222, 128, 0.4); }
.toast.err { border-color: rgba(248, 113, 113, 0.45); }
.toast strong { display: block; font-family: var(--font-display); font-size: 0.9375rem; color: var(--ink); margin-bottom: 0.2rem; }
.toast a { color: var(--blue); font-family: var(--font-mono); font-size: 0.6875rem; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Tables */
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
.app-table tbody tr:hover { background: var(--surface); }
.app-table td.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.app-table a { color: var(--muted); }
.app-table a:hover { color: var(--blue); }

.sym-cell { display: flex; align-items: center; gap: 0.7rem; }
.token-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.token-mark {
  object-fit: contain;
  background: #fff;
  padding: 15%;
  box-sizing: border-box;
}
.glyph-text { font-family: var(--font-mono); font-size: 0.55em; color: var(--muted); letter-spacing: 0.02em; }
.pair-glyphs { display: inline-flex; align-items: center; flex: none; }
.pair-glyphs .glyph + .glyph { margin-left: -10px; }

.sym-cell .glyph {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-strong); border: 1px solid var(--line);
  overflow: hidden; flex: none;
}
.sym-cell .name { font-size: 0.6875rem; color: var(--muted); }
.sym-cell > span:nth-child(2) > div:first-child { color: var(--ink); }

.bar { height: 4px; border-radius: 2px; background: var(--surface-strong); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--grad-blue); border-radius: 2px; }

.empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); font-size: 0.875rem; }
.scroll-x { overflow-x: auto; }

/* Forms */
.field { display: grid; gap: 0.5rem; }
.field label { font-size: 0.5625rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.field input, .field select {
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--line-strong); }
.field .hint { font-size: 0.75rem; color: var(--muted); }

.switch { display: flex; align-items: center; gap: 0.75rem; }
.switch input {
  width: 40px; height: 22px; appearance: none;
  background: var(--surface-strong); border: 1px solid var(--line);
  border-radius: 999px; position: relative; cursor: pointer;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}
.switch input:checked { background: var(--grad-blue); border-color: transparent; }
.switch input:checked::after { transform: translateX(18px); background: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}
.chip:hover { background: var(--surface-strong); color: var(--ink); }
.chip.active { border-color: transparent; background: var(--grad-blue); color: #fff; }

.status-line {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  margin-top: 0.8rem;
}
.status-line.err { border-color: rgba(248, 113, 113, 0.35); color: var(--neg); background: rgba(248, 113, 113, 0.07); }
.status-line.ok { border-color: rgba(74, 222, 128, 0.35); color: var(--pos); background: rgba(74, 222, 128, 0.07); }
.status-line a { color: var(--blue); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .rail-col { display: none; }
  .side-brand .brand { font-size: 1.15rem; letter-spacing: 0.14em; }
  .search-box { flex-basis: 200px; }
}

@media (max-width: 860px) {
  .legs { grid-template-columns: minmax(0, 1fr); }
  .swap-switch { margin: -0.25rem 0; }
}

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .side-brand { padding: 0.9rem 1rem 0.75rem; }
  .side-brand .sub { display: none; }
  .side nav {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--line);
  }
  .side nav::-webkit-scrollbar { display: none; }
  .side-group { display: flex; gap: 0.25rem; padding: 0.5rem 0.6rem; }
  .side-group + .side-group { padding-left: 0; }
  .side-group h6 { display: none; }
  .side-connect-wrap { display: none; }
  .side-link { white-space: nowrap; padding: 0.45rem 0.7rem; font-size: 0.8125rem; }
  .side-link svg { display: none; }

  .main-head { padding: 1rem; gap: 0.6rem; flex-wrap: wrap; }
  .main-head h1 { font-size: 1.375rem; white-space: normal; }
  .main-head .pill { display: none; }
  .search-box { display: none; }
  .title-badge { display: none; }
  #view-desc { padding: 0 1rem; }
  .view { padding: 1rem; gap: 0.9rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leg input { font-size: 1.5rem; }
  th, td { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* Live price cells. The flash is the only cue that a number moved, so it is
   brief and colour coded rather than a layout change. */
.tick-up { animation: tick-up 0.7s ease-out; }
.tick-down { animation: tick-down 0.7s ease-out; }
@keyframes tick-up {
  0% { color: #4ade80; }
  100% { color: inherit; }
}
@keyframes tick-down {
  0% { color: #f87171; }
  100% { color: inherit; }
}

/* An asset with no pool on the chain: the control states the fact instead of
   offering a trade that could never be routed. */
.chip-off {
  display: inline-flex;
  align-items: center;
  border: 1px dashed var(--line);
  background: none;
  color: var(--dim);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: help;
}
