/* ==========================================================================
   Food Coin — Telegram Mini App
   Robinhood-inspired dark UI · crisp type · zero clutter · zero popups
   ========================================================================== */

:root {
  /* Palette */
  --bg:          #000000;
  --surface:     #0c0c0e;
  --surface-2:   #121215;
  --surface-3:   #17171b;
  --line:        #1e1e23;
  --line-soft:   #16161a;
  --text:        #ffffff;
  --text-dim:    #9b9ba5;
  --text-faint:  #6a6a74;

  --up:          #00c805;   /* gains  */
  --up-soft:     rgba(0, 200, 5, 0.12);
  --down:        #ff5000;   /* losses */
  --down-soft:   rgba(255, 80, 0, 0.12);
  --flat:        #7c7c86;

  /* Metrics */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --pad: 16px;
  --tap: 44px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Telegram viewport (falls back to dvh in browsers) */
  --vh: 100dvh;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { min-height: var(--vh); }

button, input { font-family: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
svg { fill: currentColor; display: block; }
img { display: block; }

.fc-sub { color: var(--text-faint); font-size: 12.5px; letter-spacing: 0.01em; }

/* --------------------------------------------------------------------------
   App shell / screens
   -------------------------------------------------------------------------- */
#fc-app {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: var(--vh);
}

.fc-screen {
  display: flex;
  flex-direction: column;
  min-height: var(--vh);
  padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  animation: fc-fade 0.22s var(--ease);
}
.fc-screen[hidden] { display: none; }

@keyframes fc-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Home header
   -------------------------------------------------------------------------- */
.fc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 12px;
  background: linear-gradient(to bottom, var(--bg) 70%, rgba(0, 0, 0, 0));
}

.fc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.fc-mark {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #00c805, #049b06);
  color: #00190a;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
}
.fc-mark img { width: 100%; height: 100%; object-fit: cover; }

.fc-brand-text h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.fc-brand-text .fc-sub { display: block; margin-top: -1px; }

.fc-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.fc-pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(0, 200, 5, 0.6);
  animation: fc-pulse 2.2s infinite;
}
.fc-pulse.is-stale .fc-pulse-dot { background: var(--flat); animation: none; box-shadow: none; }
@keyframes fc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 200, 5, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(0, 200, 5, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 5, 0); }
}

/* --------------------------------------------------------------------------
   Wallet chip — imported recovery phrase, live network addresses
   -------------------------------------------------------------------------- */
.fc-wallet {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.fc-wallet.is-open { border-color: rgba(0, 200, 5, 0.42); background: var(--up-soft); }

.fc-wallet-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 28px;
  padding: 0 4px 0 6px;
  border-radius: var(--r-pill);
  color: var(--text);
}
.fc-wallet-main:active { opacity: 0.72; }

.fc-wallet-dot {
  width: 6px; height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--up);
  animation: fc-pulse 2.2s infinite;
}

.fc-wallet-net {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.fc-wallet-addr {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.fc-wallet-copy {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-dim);
}
.fc-wallet-copy svg { width: 13px; height: 13px; }
.fc-wallet-copy:active { transform: scale(0.92); color: var(--text); }

.fc-wallet-logout {
  min-height: 26px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.fc-wallet-logout:active { color: var(--down); background: var(--down-soft); }

.fc-connect-wallet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.fc-connect-wallet:active { background: var(--surface-3); }

/* Inline dropdown (never an overlay) */
.fc-wallet-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
  animation: fc-fade 0.18s var(--ease);
}
.fc-wallet-list[hidden] { display: none; }

.fc-wallet-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.fc-wallet-list-title { font-size: 12.5px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.01em; }
.fc-wallet-list-close {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-dim);
}
.fc-wallet-list-close svg { width: 14px; height: 14px; }
.fc-wallet-list-close:active { transform: scale(0.92); }

.fc-wallet-rows { max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.fc-wallet-rows::-webkit-scrollbar { display: none; }

.fc-wrow {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  transition: background 0.14s var(--ease);
}
.fc-wrow + .fc-wrow { border-top: 1px solid var(--line-soft); }
.fc-wrow:active { background: var(--surface-3); }

.fc-wrow-logo {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
}
.fc-wrow-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.fc-wrow-text { min-width: 0; }
.fc-wrow-name { display: block; font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.fc-wrow-addr {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-wrow-bal { text-align: right; }
.fc-wrow-amt { display: block; font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.fc-wrow-amt i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-faint); }
.fc-wrow-copy { display: block; margin-top: 1px; font-size: 11px; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */
.fc-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.fc-search:focus-within { border-color: #2c2c33; background: var(--surface-3); }
.fc-search-icon { width: 17px; height: 17px; flex: 0 0 17px; color: var(--text-faint); }

.fc-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.fc-search-input::placeholder { color: var(--text-faint); }
.fc-search-input::-webkit-search-cancel-button { display: none; }

.fc-search-clear {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-dim);
}
.fc-search-clear svg { width: 14px; height: 14px; }
.fc-search-clear:active { transform: scale(0.92); }

/* --------------------------------------------------------------------------
   Chain selector
   -------------------------------------------------------------------------- */
.fc-chains {
  display: flex;
  gap: 7px;
  margin: 0 calc(-1 * var(--pad)) 10px;
  padding: 0 var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.fc-chains::-webkit-scrollbar { display: none; }
.fc-chains[hidden] { display: none; }

.fc-chain {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.fc-chain:active { transform: scale(0.97); }
.fc-chain.is-active {
  background: var(--up-soft);
  border-color: rgba(0, 200, 5, 0.32);
  color: var(--up);
}

/* --------------------------------------------------------------------------
   Category tabs
   -------------------------------------------------------------------------- */
.fc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fc-tabs::-webkit-scrollbar { display: none; }

.fc-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.fc-tab:active { transform: scale(0.97); }
.fc-tab.is-active { background: var(--text); border-color: var(--text); color: #000; }

/* --------------------------------------------------------------------------
   Token list
   -------------------------------------------------------------------------- */
.fc-list { display: flex; flex-direction: column; }

.fc-load-more {
  display: block;
  width: 100%;
  min-height: 42px;
  margin: 12px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 650;
}
.fc-load-more[hidden] { display: none; }
.fc-load-more:disabled { opacity: .55; }
.fc-load-more:active { transform: scale(.99); }

.fc-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(84px, auto);
  align-items: center;
  gap: 11px;
  padding: 11px 10px 11px 8px;
  margin: 0 -8px;
  border-radius: var(--r-md);
  transition: background 0.15s var(--ease);
  will-change: background;
}
.fc-row + .fc-row { box-shadow: inset 0 1px 0 var(--line-soft); }
.fc-row:active { background: var(--surface-2); }

.fc-logo {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.fc-logo--fallback {
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  color: #fff; letter-spacing: -0.03em;
}

.fc-row-id { min-width: 0; }
.fc-row-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-row-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
  font-size: 12px; color: var(--text-faint);
}
.fc-row-sym { font-weight: 600; color: var(--text-dim); letter-spacing: 0.01em; }
.fc-row-dex { text-transform: capitalize; }

.fc-row-price { text-align: right; min-width: 0; }
.fc-price {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  border-radius: 5px;
  transition: color 0.5s var(--ease), background 0.5s var(--ease);
}
.fc-price.flash-up   { color: var(--up);   background: var(--up-soft); }
.fc-price.flash-down { color: var(--down); background: var(--down-soft); }

.fc-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.fc-badge--up   { color: var(--up);   background: var(--up-soft); }
.fc-badge--down { color: var(--down); background: var(--down-soft); }
.fc-badge--flat { color: var(--flat); background: rgba(124, 124, 134, 0.12); }

.fc-up { color: var(--up); }
.fc-down { color: var(--down); }
.fc-flat { color: var(--flat); }

/* Skeleton */
.fc-skel-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 90px;
  align-items: center; gap: 11px;
  padding: 13px 8px;
}
.fc-skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: fc-shimmer 1.4s ease-in-out infinite;
}
@keyframes fc-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.fc-skel-avatar { width: 38px; height: 38px; border-radius: 50%; }
.fc-skel-lines { display: flex; flex-direction: column; gap: 6px; }
.fc-skel-lines--right { align-items: flex-end; }
.fc-skel-l1 { width: 80%; height: 11px; }
.fc-skel-l2 { width: 50%; height: 9px; }

/* Empty state */
.fc-empty { padding: 56px 20px; text-align: center; }
.fc-empty-title { font-size: 15px; font-weight: 700; }
.fc-empty-sub { margin-top: 5px; font-size: 13px; color: var(--text-faint); }

.fc-foot {
  margin-top: auto;
  padding: 18px 0 0;
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Detail header
   -------------------------------------------------------------------------- */
.fc-detail-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 10px;
  background: linear-gradient(to bottom, var(--bg) 72%, rgba(0, 0, 0, 0));
}
.fc-iconbtn {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.14s var(--ease), background 0.14s var(--ease);
}
.fc-iconbtn svg { width: 19px; height: 19px; }
.fc-iconbtn:active { transform: scale(0.92); background: var(--surface-3); }

.fc-detail-id { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 auto; }
.fc-dlogo { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line); }
.fc-detail-idtext { min-width: 0; }
.fc-detail-idtext strong {
  display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-dot { margin: 0 5px; font-style: normal; }

/* --------------------------------------------------------------------------
   Hero price
   -------------------------------------------------------------------------- */
.fc-hero { padding: 6px 0 12px; }
.fc-hero-price {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  transition: color 0.5s var(--ease);
}
.fc-hero-price.flash-up { color: var(--up); }
.fc-hero-price.flash-down { color: var(--down); }
.fc-hero-change {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Timeframe pills
   -------------------------------------------------------------------------- */
.fc-tfs { display: flex; gap: 6px; margin-bottom: 10px; }
.fc-tfs button {
  flex: 1 1 0;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.fc-tfs button.is-active { background: var(--up-soft); color: var(--up); border-color: rgba(0, 200, 5, 0.28); }

/* --------------------------------------------------------------------------
   Chart
   -------------------------------------------------------------------------- */
.fc-chart-wrap {
  position: relative;
  width: 100%;
  height: 210px;
  margin-bottom: 22px;
  touch-action: pan-y;
}
.fc-chart { width: 100%; height: 100%; display: block; }

.fc-chart-readout {
  position: absolute;
  top: 0; left: 0;
  z-index: 3;
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: rgba(18, 18, 21, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.fc-chart-readout span:first-child { font-size: 13px; font-weight: 700; }
.fc-chart-readout span:last-child { font-size: 11px; color: var(--text-faint); }

.fc-chart-status {
  position: absolute;
  top: 6px;
  right: 58px;
  z-index: 2;
  max-width: calc(100% - 190px);
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(18, 18, 21, 0.88);
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.fc-chart-status[hidden] { display: none; }
.fc-chart-continue {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green, #00c805);
  font: inherit;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
}
.fc-chart-continue[hidden] { display: none; }

.fc-chart-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text-faint);
  font-size: 13px;
  pointer-events: none;
}
.fc-chart-empty[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Blocks / metrics
   -------------------------------------------------------------------------- */
.fc-block { margin-bottom: 24px; }
.fc-block-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.fc-mgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.fc-metric { padding: 12px 13px; background: var(--bg); }
.fc-metric-k { display: block; font-size: 11.5px; color: var(--text-faint); letter-spacing: 0.01em; }
.fc-metric-v {
  display: block; margin-top: 3px;
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fc-contract {
  width: 100%;
  margin-top: 10px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 13px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: left;
  transition: background 0.15s var(--ease);
}
.fc-contract:active { background: var(--surface-3); }
.fc-contract-k { font-size: 11.5px; color: var(--text-faint); flex: 0 0 auto; }
.fc-contract-v {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.02em;
}
.fc-contract-c { flex: 0 0 16px; color: var(--text-faint); }
.fc-contract-c svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   Swap card
   -------------------------------------------------------------------------- */
.fc-card {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.fc-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fc-card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.fc-chip {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: 11px; font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

/* Swap From/To cards */
.fc-swap-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.fc-swap-box-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.fc-swap-box-label {
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  letter-spacing: 0.01em;
}
.fc-swap-box-actions { display: flex; align-items: center; gap: 8px; }
.fc-swap-bal {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.fc-swap-bal-icon {
  width: 13px; height: 13px; border-radius: 4px;
  background: var(--surface-3);
  display: inline-block;
  box-shadow: inset 0 0 0 1px var(--line);
}
.fc-swap-pct {
  height: 26px; padding: 0 12px;
  border-radius: 8px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px; font-weight: 700;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.fc-swap-pct:active { transform: scale(0.96); }
.fc-swap-pct.is-active {
  color: var(--up);
  border-color: rgba(0, 200, 5, 0.38);
  background: var(--up-soft);
}
.fc-swap-pct:disabled { opacity: 0.4; cursor: default; }

.fc-swap-box-body {
  display: flex; align-items: center; gap: 12px;
}
.fc-swap-box-amount { flex: 1 1 auto; min-width: 0; text-align: right; }

.fc-swap-input {
  width: 100%;
  border: 0; background: none; outline: none;
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  padding: 0;
  text-align: right;
  color: var(--text);
}
.fc-swap-input--ro { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-swap-usd { display: block; margin-top: 2px; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.fc-tokenpick {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 800;
  letter-spacing: -0.01em;
  max-width: 160px;
  white-space: nowrap; overflow: hidden;
}
.fc-tokenpick--big { padding: 8px 14px; }
.fc-tokenpick-logo {
  width: 24px; height: 24px; border-radius: 50%;
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #fff;
  background: var(--surface-2);
  overflow: hidden;
}
.fc-tokenpick-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.fc-tokenpick-sym { overflow: hidden; text-overflow: ellipsis; }
.fc-tokenpick-caret { width: 14px; height: 14px; color: var(--text-faint); }
.fc-tokenpick--ro { background: var(--surface-3); }
.fc-tokenpick--ro .fc-tokenpick-caret { display: none; }
.fc-tokenpick:active { transform: scale(0.96); }
.fc-tokenpick.is-open { border-color: rgba(0, 200, 5, 0.42); background: var(--up-soft); }

/* Inline token picker — expands inside the swap card, never an overlay */
.fc-tokenpicker {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
  animation: fc-fade 0.18s var(--ease);
}
.fc-tokenpicker[hidden] { display: none; }
.fc-tokenpicker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px;
}
.fc-tokenpicker-title { font-size: 12.5px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.01em; }
.fc-tokenpicker-close {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-dim);
}
.fc-tokenpicker-close svg { width: 14px; height: 14px; }
.fc-tokenpicker-close:active { transform: scale(0.92); }

.fc-tokenpicker-search {
  display: flex; align-items: center; gap: 8px;
  height: 38px;
  margin: 0 10px 8px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.fc-tokenpicker-search:focus-within { border-color: #2c2c33; }
.fc-tokenpicker-search-icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-faint); }
.fc-tokenpicker-input {
  flex: 1 1 auto; min-width: 0;
  height: 100%; border: 0; background: none; outline: none;
  font-size: 14px; letter-spacing: -0.01em;
}
.fc-tokenpicker-input::placeholder { color: var(--text-faint); }
.fc-tokenpicker-input::-webkit-search-cancel-button { display: none; }

.fc-tokenpicker-list {
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 1px solid var(--line-soft);
}
.fc-tokenpicker-list::-webkit-scrollbar { display: none; }
.fc-tokenpicker-empty { padding: 22px 12px; text-align: center; font-size: 13px; color: var(--text-faint); }

.fc-tk {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  transition: background 0.14s var(--ease);
}
.fc-tk + .fc-tk { box-shadow: inset 0 1px 0 var(--line-soft); }
.fc-tk:active { background: var(--surface-3); }
.fc-tk-logo {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.fc-tk-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.fc-tk-id { min-width: 0; }
.fc-tk-name {
  display: block;
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-tk-sym { display: block; font-size: 11.5px; color: var(--text-faint); font-weight: 600; }
.fc-tk-price {
  font-size: 12.5px; font-weight: 700; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Flip button between From and To */
.fc-swap-flip {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  margin: -10px auto;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--up);
  position: relative; z-index: 2;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.fc-swap-flip svg { width: 18px; height: 18px; }
.fc-swap-flip:active { transform: scale(0.92) rotate(180deg); }

.fc-slippage { margin-top: 14px; }
.fc-slippage-label { display: block; font-size: 11.5px; color: var(--text-faint); margin-bottom: 7px; }
.fc-slip-pills { display: flex; gap: 6px; }
.fc-slip-pills button {
  flex: 1 1 0;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px; font-weight: 700;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.fc-slip-pills button.is-active {
  color: var(--up);
  border-color: rgba(0, 200, 5, 0.38);
  background: var(--up-soft);
}
.fc-slip-custom-wrap {
  display: flex; align-items: center; gap: 4px;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px; color: var(--text-faint);
}
.fc-slip-custom { flex: 1 1 auto; min-width: 0; border: 0; background: none; outline: none; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Breakdown table */
.fc-breakdown { width: 100%; margin-top: 16px; border-collapse: collapse; }
.fc-breakdown th, .fc-breakdown td {
  padding: 9px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.fc-breakdown th { text-align: left; font-weight: 500; color: var(--text-faint); }
.fc-breakdown td {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.fc-breakdown tr:last-child th, .fc-breakdown tr:last-child td { border-bottom: 0; }
.fc-breakdown-hl th { color: var(--text-dim); }
.fc-breakdown-hl td { color: var(--text); }
.fc-breakdown .fc-loading { color: var(--text-faint); font-weight: 500; }

.fc-cta {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #00e25a 0%, #00c805 100%);
  color: #00170a;
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 18px rgba(0, 200, 5, 0.22);
  transition: transform 0.14s var(--ease), opacity 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.fc-cta:active { transform: scale(0.985); box-shadow: 0 2px 10px rgba(0, 200, 5, 0.18); }
.fc-cta:disabled { opacity: 0.45; box-shadow: none; }
.fc-note { margin-top: 10px; font-size: 11.5px; color: var(--text-faint); text-align: center; }

/* --------------------------------------------------------------------------
   Toast (inline, non-blocking — never a modal)
   -------------------------------------------------------------------------- */
.fc-toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  transform: translate(-50%, 14px);
  max-width: min(88vw, 420px);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: rgba(22, 22, 26, 0.96);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.fc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
