/* ANJOUO v5 — "7K system"
   7K aggregator design language with ANJOUO brand (Telegram blue accent).
   Radius rhythm 28 → 24 → 20 → 16 → 14 → pill. Outfit typography. */
:root {
  --bg: #0b0d14;
  --surface: #1c1e2c;
  --frame: #232534;
  --pill: #2c3043;
  --border: #373a4d;
  --text: #ffffff;
  --text-2: #a8a8c7;
  --text-3: #555575;
  --accent: #2aabee;
  --accent-hover: #7dd3fc;
  --green: #60f678;
  --ice: #7dd3fc;
  --bad: #fb431a;
  --warn: #f5a623;
  --accent-soft: rgba(42, 171, 238, 0.12);
  --shimmer: linear-gradient(100deg, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0.05) 70%);
  color-scheme: dark;
}
/* light theme */
[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f8;
  --surface: #ffffff;
  --frame: rgba(255, 255, 255, 0.65);
  --pill: #e9eef5;
  --border: #d9e0ea;
  --text: #0b0d14;
  --text-2: #5b6b80;
  --text-3: #9aa7b8;
  --accent: #2aabee;
  --accent-hover: #1b8fd4;
  --green: #00a878;
  --ice: #1b8fd4;
  --bad: #e5484d;
  --warn: #d97706;
  --accent-soft: rgba(42, 171, 238, 0.12);
  --shimmer: linear-gradient(100deg, rgba(11,13,20,0.06) 30%, rgba(11,13,20,0.14) 50%, rgba(11,13,20,0.06) 70%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* ambient glow behind the card */
.glow {
  position: fixed;
  top: 40px; left: 50%;
  transform: translateX(-50%);
  width: 340px; height: 220px;
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
    rgba(42, 171, 238, 0.20) 0%,
    rgba(42, 171, 238, 0.07) 45%,
    rgba(42, 171, 238, 0) 72%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .glow { opacity: 0.55; }
#app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 14px 16px 44px; }

/* ---------- header ---------- */
header {
  height: 40px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.wordmark {
  font-size: 17px; font-weight: 700; letter-spacing: 3px; line-height: 1;
  color: var(--text);
}
.header-right { display: flex; align-items: center; gap: 8px; }
.connect-pill {
  appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.2px;
  padding: 9px 16px; border-radius: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background 0.18s ease, transform 0.15s ease;
}
.connect-pill:hover { background: var(--accent-hover); }
.connect-pill:active { transform: scale(0.96); }
.connect-pill:disabled { opacity: 0.6; cursor: default; }
.connect-pill.connected {
  background: var(--surface); color: var(--green);
  border: 1px solid var(--border);
}
.menu-dots {
  appearance: none; cursor: pointer; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.menu-dots:hover { color: var(--text); border-color: var(--text-3); }
.menu-dots:active { transform: scale(0.9); }
.menu-dots span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

/* ---------- swap card : 7K frame ---------- */
.swap-card {
  background: rgba(35, 37, 52, 0.4);
  border: 1px solid rgba(55, 58, 77, 0.55);
  border-radius: 28px;
  padding: 4px;
}
[data-theme="light"] .swap-card {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(217, 224, 234, 0.9);
  box-shadow: 0 12px 40px rgba(11, 13, 20, 0.08);
}
.swap-controls {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding: 8px 8px 2px;
}
.slip-pill {
  appearance: none; cursor: pointer;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); font-family: inherit;
  font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums;
  padding: 7px 12px; border-radius: 999px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.slip-pill:hover { color: var(--text); border-color: var(--text-3); }
.refresh-btn {
  appearance: none; cursor: pointer;
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2); display: grid; place-items: center;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.35s ease;
}
.refresh-btn:hover { color: var(--text); border-color: var(--text-3); transform: rotate(60deg); }
.refresh-btn svg { display: block; }
.refresh-btn.spinning svg { animation: spin 0.9s linear infinite; }

/* ---------- amount panels ---------- */
.panels { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.panel {
  background: var(--surface);
  border-radius: 20px;
  padding: 16px 16px 14px;
}
.panel.receive { background: rgba(28, 30, 44, 0.6); }
[data-theme="light"] .panel.receive { background: rgba(233, 238, 245, 0.6); }
.panel-label {
  font-size: 12px; font-weight: 500; color: var(--text-2); letter-spacing: 0.2px;
  margin-bottom: 10px;
}
.panel-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#amount {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit;
  font-size: 36px; font-weight: 400; line-height: 1.05; letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums; direction: ltr; text-align: left;
  padding: 0;
}
#amount::placeholder { color: var(--text-3); }
#amount.input-error { color: #fb431a; }
.out-amount {
  flex: 1; min-width: 0;
  font-size: 36px; font-weight: 400; line-height: 1.05; letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums; direction: ltr; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.18s ease;
}
.out-amount.tick { animation: tickIn 0.3s ease; }
@keyframes tickIn { 0% { opacity: 0.25; transform: translateY(5px); } 100% { opacity: 1; transform: none; } }
.out-amount.loading {
  color: transparent; font-size: 30px;
  background: var(--shimmer); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.token-pill {
  appearance: none; cursor: pointer; border: 0; flex: none;
  background: var(--pill); color: var(--text); font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  transition: background 0.18s ease, transform 0.15s ease;
}
.token-pill:hover { background: var(--border); }
.token-pill:active { transform: scale(0.95); }
.ticon {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--frame); color: var(--ice);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; overflow: hidden; position: relative;
}
.ticon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.token-name { font-size: 14px; font-weight: 600; letter-spacing: 0.3px; }
.token-pill .chev { color: var(--text-2); display: block; flex: none; }

.panel-sub {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums; min-height: 22px; gap: 8px;
}
.bal-group { display: inline-flex; align-items: center; gap: 8px; }
.bal-group[hidden] { display: none; }
#bal-text { white-space: nowrap; }
.quick-amts { display: inline-flex; gap: 6px; }
.quick-amts button {
  appearance: none; cursor: pointer;
  background: var(--accent-soft); color: var(--ice);
  border: 1px solid rgba(42, 171, 238, 0.28); border-radius: 8px;
  font-family: inherit; font-size: 11px; font-weight: 700;
  padding: 4px 9px; transition: transform 0.15s ease, background 0.2s ease;
}
.quick-amts button:active { transform: scale(0.9); }

/* ---------- flip ---------- */
.flip-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 3; appearance: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--frame);
  color: var(--text-2); display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.3s ease;
}
.flip-btn:hover { color: var(--text); border-color: var(--text-3); }
.flip-btn:active { transform: translate(-50%, -50%) rotate(180deg) scale(0.92); }
.flip-btn svg { display: block; }

/* ---------- CTA ---------- */
.cta {
  appearance: none; border: 0; cursor: pointer;
  width: calc(100% - 8px); margin: 8px 4px 4px;
  height: 68px; border-radius: 24px;
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 18px; font-weight: 500; letter-spacing: 0.2px;
  box-shadow: 0 10px 34px rgba(42, 171, 238, 0.35), 0 2px 10px rgba(42, 171, 238, 0.25);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}
.cta:hover { background: #45b8f5; box-shadow: 0 12px 40px rgba(42, 171, 238, 0.45); }
.cta:active { transform: scale(0.98); background: #1f9be0; }
.cta:disabled {
  background: var(--frame); color: var(--text-3);
  box-shadow: none; cursor: default; transform: none;
}
.hint { min-height: 18px; margin: 6px 16px 2px; font-size: 13px; color: var(--bad); text-align: center; }

/* ---------- quotes sheet : 7K ranked list ---------- */
.quotes-sheet {
  margin-top: 12px;
  background: rgba(28, 30, 44, 0.7);
  border: 1px solid rgba(55, 58, 77, 0.4);
  border-radius: 20px;
  padding: 16px;
  animation: cardIn 0.3s ease;
}
[data-theme="light"] .quotes-sheet {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(217, 224, 234, 0.9);
}
@keyframes cardIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }
.qs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.qs-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
}
.qs-check { color: var(--green); font-weight: 700; }
.qs-close {
  appearance: none; cursor: pointer;
  background: var(--pill); border: 0; color: var(--text-2);
  width: 28px; height: 28px; border-radius: 50%; font-size: 16px; line-height: 1;
  transition: transform 0.15s ease, color 0.18s ease;
}
.qs-close:active { transform: scale(0.88); }
.qs-close:hover { color: var(--text); }
#routes-list { display: flex; flex-direction: column; }
.rrow {
  appearance: none; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; border-top: 1px solid rgba(55, 58, 77, 0.35);
  padding: 10px 2px; color: var(--text); text-align: left; font-family: inherit;
  transition: background 0.15s ease;
}
.rrow:first-child { border-top: 0; }
.rrow:active { background: var(--accent-soft); }
.rrow.selected { background: var(--accent-soft); border-radius: 12px; }
.qrank {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  width: 12px; text-align: center; font-variant-numeric: tabular-nums; flex: none;
}
.rrow.best .qrank { color: var(--accent-hover); }
.qdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.rinfo { flex: 1; min-width: 0; }
.rname { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.rrow.best .rname { color: var(--text); font-weight: 600; }
.rmeta { font-size: 11px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.rbest {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px; color: #0b0d14;
  background: var(--green); border-radius: 999px; padding: 3px 7px; white-space: nowrap;
}
.rout { font-size: 13.5px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rrow.best .rout { color: var(--text); font-weight: 600; }
.rout .unit { font-size: 11px; color: var(--text-3); font-weight: 500; }
.routes-pill {
  font-size: 10.5px; font-weight: 500; color: var(--text-2);
  background: var(--pill); border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}

/* ---------- status card ---------- */
.status-card {
  margin-top: 12px;
  background: rgba(28, 30, 44, 0.7);
  border: 1px solid rgba(55, 58, 77, 0.4);
  border-radius: 20px; padding: 18px;
  font-size: 14px; line-height: 1.55; text-align: center;
  animation: cardIn 0.3s ease;
}
[data-theme="light"] .status-card { background: rgba(255, 255, 255, 0.75); border-color: rgba(217, 224, 234, 0.9); }
.status-card .ok { color: var(--green); font-weight: 700; font-size: 15px; }
.status-card .err { color: var(--bad); font-weight: 700; font-size: 15px; }
.status-card .warn { color: var(--warn); font-weight: 700; font-size: 15px; }
.status-card a { color: var(--ice); }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
footer { margin-top: 22px; text-align: center; }
.fine { font-size: 12px; color: var(--text-3); line-height: 1.6; margin: 6px 12px; }
.trust { color: var(--ice); opacity: 0.8; }

/* ---------- bottom sheets ---------- */
#picker, #wallet-sheet, #settings-sheet, #review-sheet, #uncertain-sheet {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.22s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
#picker[hidden], #wallet-sheet[hidden], #settings-sheet[hidden],
#review-sheet[hidden], #uncertain-sheet[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 30px; display: flex; flex-direction: column;
  animation: sheetUp 0.3s ease; position: relative;
}
.sheet::before {
  content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4.5px; border-radius: 999px; background: var(--text-3); opacity: 0.6;
}
@keyframes sheetUp { 0% { transform: translateY(60px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.sheet-head { display: flex; gap: 8px; margin: 12px 0 10px; align-items: center; }
.sheet-title { font-weight: 600; font-size: 15px; padding: 8px 4px; color: var(--text); }
.sheet-close {
  appearance: none; cursor: pointer; margin-left: auto;
  background: var(--pill); color: var(--text-2); border: 0;
  border-radius: 50%; width: 32px; height: 32px; font-size: 17px; line-height: 1;
  transition: transform 0.15s ease, color 0.18s ease;
}
.sheet-close:active { transform: scale(0.88); }
.sheet-close:hover { color: var(--text); }

/* token picker */
#picker-search {
  flex: 1; background: var(--pill); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#picker-search::placeholder { color: var(--text-3); }
#picker-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.18); }
#picker-list { overflow-y: auto; flex: 1; }
.prow {
  appearance: none; width: 100%;
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: 0; border-top: 1px solid rgba(55, 58, 77, 0.35);
  color: var(--text); padding: 11px 4px; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 14px;
  transition: background 0.15s ease;
}
.prow:first-child { border-top: 0; }
.prow:active { background: var(--accent-soft); }
.prow .pinfo { flex: 1; min-width: 0; }
.prow .psym { font-weight: 600; font-size: 14px; display: flex; align-items: center; }
.prow .pname { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.prow .paddr { font-size: 10px; color: var(--text-3); font-family: monospace; margin-top: 1px; direction: ltr; }
.prow .pprice { font-size: 12.5px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.prow .pprice .up { color: var(--green); }
.prow .pprice .dn { color: var(--bad); }
.tbadge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(96, 246, 120, 0.15); color: var(--green);
  font-size: 9px; font-weight: 700; margin-left: 5px; flex: none;
}
#picker-custom {
  appearance: none; margin-top: 12px; background: transparent; color: var(--ice);
  border: 1px dashed rgba(42, 171, 238, 0.5); border-radius: 12px;
  padding: 12px; font-family: inherit; font-size: 13.5px; cursor: pointer;
  transition: transform 0.15s ease;
}
#picker-custom:active { transform: scale(0.97); }
.loading, .empty { text-align: center; color: var(--text-2); padding: 26px; font-size: 13.5px; }
.lang-row .tick { margin-left: auto; color: var(--green); font-weight: 700; }
#lang-list-inline .prow:last-child { border-bottom: 0; }

/* settings */
.set-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px; font-size: 14.5px; font-weight: 600; color: var(--text);
}
.set-val { color: var(--ice); font-variant-numeric: tabular-nums; font-weight: 500; }
.pills.wide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
#theme-pills.pills.wide { grid-template-columns: repeat(2, 1fr); }
.pills.wide button {
  appearance: none; cursor: pointer;
  background: var(--pill); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 0; font-family: inherit; font-size: 13.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: all 0.18s ease;
}
.pills.wide button:active { transform: scale(0.94); }
.pills.wide button.active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--ice);
}
.ghost-btn {
  appearance: none; width: 100%; background: transparent; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; margin-top: 8px; transition: transform 0.15s ease, color 0.18s ease;
}
.ghost-btn:active { transform: scale(0.97); }
.ghost-btn:hover { color: var(--text); }

/* review */
.rev-hero { text-align: center; padding: 8px 0 14px; }
.rev-hero .lbl { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.rev-hero .amt {
  font-size: 36px; font-weight: 400; letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums; color: var(--text);
  animation: tickIn 0.35s ease;
}
.rev-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 2px; font-size: 13.5px; border-top: 1px solid rgba(55, 58, 77, 0.35);
}
.rev-line .k { color: var(--text-2); }
.rev-line .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.pi-ok { color: var(--green); font-weight: 700; }
.pi-warn { color: #f5a623; font-weight: 700; }
.pi-bad { color: #fb431a; font-weight: 700; }
#review-confirm:disabled { opacity: 0.45; cursor: not-allowed; }
#review-confirm { margin-top: 14px; }

/* wallet sheet */
.waddr-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--pill); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; font-size: 13.5px;
}
#waddr-text { flex: 1; font-variant-numeric: tabular-nums; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; direction: ltr; }
#waddr-copy {
  appearance: none; cursor: pointer;
  background: var(--accent-soft); color: var(--ice); border: 0;
  border-radius: 8px; padding: 8px 14px; font-family: inherit;
  font-size: 12.5px; font-weight: 600; transition: transform 0.15s ease;
}
#waddr-copy:active { transform: scale(0.92); }
#wallet-balances { overflow-y: auto; flex: 1; margin-bottom: 10px; }
.wrow {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-top: 1px solid rgba(55, 58, 77, 0.35); font-size: 14px;
}
.wrow:first-child { border-top: 0; }
.wrow .pinfo { flex: 1; min-width: 0; }
.wrow .psym { font-weight: 600; font-size: 14px; }
.wrow .pname { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.wrow .pbal { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; direction: ltr; }
.wrow .pusd { font-size: 11.5px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.danger-btn {
  appearance: none; cursor: pointer; width: 100%;
  background: transparent; color: var(--bad);
  border: 1px solid rgba(251, 67, 26, 0.4); border-radius: 12px;
  padding: 14px; font-family: inherit; font-size: 14.5px; font-weight: 600;
  transition: transform 0.15s ease, background 0.2s ease;
}
.danger-btn:active { transform: scale(0.97); background: rgba(251, 67, 26, 0.08); }

/* uncertain-transaction warning */
.warn-box { text-align: center; padding: 8px 4px 4px; }
.warn-icon { font-size: 42px; margin-bottom: 12px; }
.warn-box p { color: var(--text); font-size: 14.5px; line-height: 1.55; margin: 0 0 12px; }
.warn-box .warn-strong { color: var(--bad); font-weight: 600; }
.warn-box .ghost-btn { display: block; text-decoration: none; margin-top: 16px; }

/* route whisper link */
.route-link {
  appearance: none; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer; font-family: inherit;
  font-size: 12px; color: var(--text-3); padding: 4px 6px;
  transition: color 0.2s ease, transform 0.15s ease;
}
.route-link:hover { color: var(--ice); }
.route-link:active { transform: scale(0.95); }
.route-link[hidden] { display: none; }
.route-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.route-dot.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

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

/* ---------- RTL ---------- */
[dir="rtl"] #amount, [dir="rtl"] .out-amount { direction: ltr; text-align: right; }
[dir="rtl"] #waddr-text { text-align: right; }
[dir="rtl"] .pbal, [dir="rtl"] .rout, [dir="rtl"] .pprice { direction: ltr; }
[dir="rtl"] .token-pill .chev { transform: scaleX(-1); }
[dir="rtl"] .slip-pill, [dir="rtl"] .refresh-btn { direction: ltr; }

/* ---------- custom token sheet ---------- */
.field-label { display: block; font-size: 12px; color: var(--text-2); margin: 12px 0 6px; }
.text-input {
  width: 100%; background: var(--pill); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; color: var(--text);
  font-size: 15px; font-family: inherit; outline: none; box-sizing: border-box;
}
.text-input:focus { border-color: var(--accent); }
.field-err { color: #fb431a; font-size: 13px; margin-top: 8px; }
#custom-token-sheet .cta { margin-top: 16px; }

/* ---------- TonConnect modal: center on desktop ---------- */
@media (min-width: 600px) {
  #tonconnect-ui__modal-root > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
