/* OMBRO v16 — clean card + multi-source route sheet */
@font-face {
  font-family: "Bricolage";
  src: url("./assets/fonts/bricolage-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("./assets/fonts/bricolage-600.ttf") format("truetype");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "National Park";
  src: url("./assets/fonts/national-park-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "National Park";
  src: url("./assets/fonts/national-park-bold.ttf") format("truetype");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  --page: #070708;
  --surface: #121214;
  --raised: #1a1a1d;
  --field: #0c0c0e;
  --line: #2a2a2e;
  --line2: #3c3c42;
  --text: #f5f1e8;
  --soft: #c9c4ba;
  --muted: #969189;
  --faint: #6a655e;
  --accent: #ff6a21;
  --accent2: #ff7f3d;
  --ink: #160b05;
  --accent-soft: rgba(255, 106, 33, 0.14);
  --ok: #7dd39a;
  --ok-soft: rgba(125, 211, 154, 0.14);
  --font-d: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  --font-b: "National Park", ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; min-width: 320px; }
body {
  font-family: var(--font-b);
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -16%, rgba(255, 106, 33, 0.14), transparent 55%),
    var(--page);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.top {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 20px 18px 0;
  display: flex;
  align-items: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
}
.logo img {
  width: 28px; height: 28px;
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.stage {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 18px 16px 64px;
}
.tagline {
  margin: 8px 4px 18px;
  text-align: center;
  font-family: var(--font-d);
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.box {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  transition: border-color .15s ease;
}
.box:focus-within { border-color: var(--line2); }
.box-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.fiat { color: var(--faint); font-weight: 500; }
.box-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.box-main input,
.box-main .out {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-d);
  font-size: clamp(30px, 8vw, 38px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.box-main input::placeholder { color: var(--faint); }
.box-main .out { display: block; min-height: 1.05em; }

.token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
  max-width: 160px;
}
.token:hover { background: #222226; border-color: var(--line2); }
.token img {
  width: 30px; height: 30px;
  border-radius: 999px;
  object-fit: contain;
  background: #0a0a0c;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.token-text {
  display: grid;
  text-align: left;
  min-width: 0;
  line-height: 1.15;
}
.token-text b {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 700;
}
.token-text small {
  font-size: 10px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.token svg {
  width: 14px; height: 14px;
  stroke: var(--muted);
  fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto;
}

.switch {
  width: 38px; height: 38px;
  margin: -12px auto;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  border: 3px solid var(--surface);
  border-radius: 12px;
  background: var(--raised);
  color: var(--soft);
  cursor: pointer;
  transition: color .12s ease, transform .15s ease, background .12s ease;
}
.switch:hover { color: var(--accent); background: #26262a; }
.switch:active { transform: scale(.96) rotate(180deg); }
.switch svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* selected route chip */
.route-chip {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.route-chip:hover:not(:disabled) {
  border-color: rgba(255, 106, 33, 0.4);
  background: #101012;
}
.route-chip:disabled { cursor: default; opacity: 0.85; }
.chip-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.chip-left img, .chip-fb {
  width: 36px; height: 36px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #0a0a0c;
  flex: 0 0 auto;
}
.chip-fb {
  display: grid;
  place-items: center;
  font-family: var(--font-d);
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}
.chip-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
#chip-title {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-sub {
  font-size: 11px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.chip-right svg {
  width: 16px; height: 16px;
  stroke: var(--muted);
  fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.chip-badge {
  font-family: var(--font-d);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
}
.chip-badge.swap { background: var(--accent-soft); color: var(--accent); }
.chip-badge.quote { background: rgba(255,255,255,0.06); color: var(--faint); }

.addr { margin-top: 12px; }
.addr input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  border-radius: 14px;
  padding: 14px;
  font: 500 13px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
}
.addr input:focus { border-color: rgba(255, 106, 33, 0.55); }
.addr input::placeholder {
  color: var(--faint);
  font-family: var(--font-b);
}

.cta {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 16px;
  padding: 16px;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(255, 106, 33, 0.28);
}
.cta:hover { filter: brightness(1.05); }
.cta:disabled {
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
  background: #26262a;
  color: var(--faint);
}

.deposit {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 106, 33, 0.35);
  background: var(--accent-soft);
  display: grid;
  gap: 8px;
  animation: pop .2s ease both;
}
.dep-label {
  font-family: var(--font-d);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.deposit .amt {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.deposit .copy {
  border: 1px dashed rgba(255, 106, 33, 0.45);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  font: 600 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  cursor: pointer;
}
.deposit .copy[data-ok="1"] { color: var(--accent); border-style: solid; }
.deposit a {
  color: var(--accent);
  font-family: var(--font-d);
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  width: fit-content;
}

.foot {
  margin: 16px 8px 0;
  text-align: center;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
}
.foot b { color: var(--muted); }

/* sheets */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.62);
  animation: fade .15s ease both;
}
.sheet-panel {
  width: min(440px, 100%);
  margin: 0 auto;
  max-height: min(78vh, 640px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.55);
  animation: slide .18s ease both;
}
.routes-panel { grid-template-rows: auto auto 1fr; }
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 8px;
}
.sheet-title {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 17px;
}
.sheet-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--faint);
}
.sheet-head button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 700 14px var(--font-d);
  cursor: pointer;
  padding: 6px 8px;
}
.sheet-search { padding: 0 14px 10px; }
.sheet-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  font: 500 14px var(--font-b);
  outline: none;
}
.sheet-search input:focus { border-color: rgba(255, 106, 33, 0.5); }
.sheet-list {
  overflow: auto;
  padding: 0 10px 16px;
  scrollbar-width: thin;
}

.sort-row {
  display: flex;
  gap: 6px;
  padding: 0 14px 12px;
  flex-wrap: wrap;
}
.sort-chip {
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.sort-chip.is-on {
  color: var(--accent);
  border-color: rgba(255, 106, 33, 0.45);
  background: var(--accent-soft);
}

/* route rows in sheet */
.rrow {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: 16px;
  padding: 11px;
  margin-bottom: 8px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.rrow:hover { border-color: rgba(255, 106, 33, 0.35); }
.rrow.is-active {
  border-color: rgba(255, 106, 33, 0.7);
  background: linear-gradient(180deg, rgba(255, 106, 33, 0.12), rgba(255, 106, 33, 0.04));
}
.rrow.is-best:not(.is-active) { border-color: rgba(125, 211, 154, 0.28); }
.rlogo {
  width: 40px; height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #0a0a0c;
}
.rbody { min-width: 0; }
.rline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.rname {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 14px;
  margin-right: 2px;
}
.rmeta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
  color: var(--faint);
}
.rbar {
  margin-top: 7px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.rbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffb07a);
}
.rrow.is-best .rbar i {
  background: linear-gradient(90deg, #4db87a, var(--ok));
}
.rout {
  text-align: right;
  display: grid;
  gap: 4px;
  justify-items: end;
}
.rout strong {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rout small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.delta {
  font-family: var(--font-d);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--faint);
}
.delta.best { background: var(--ok-soft); color: var(--ok); }

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-family: var(--font-d);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag.swap { background: var(--accent-soft); color: var(--accent); }
.tag.quote { background: rgba(255,255,255,0.05); color: var(--faint); }
.tag.fixed { background: var(--accent-soft); color: var(--accent); }
.tag.float { background: rgba(255,255,255,0.06); color: var(--soft); }
.tag.priv.max { background: var(--ok-soft); color: var(--ok); }
.tag.priv.high { background: rgba(125, 211, 154, 0.1); color: #b6e0bc; }
.tag.priv.low { background: rgba(255,255,255,0.05); color: var(--faint); }

.empty, .skel {
  padding: 20px;
  text-align: center;
  color: var(--faint);
  border: 1px dashed var(--line);
  border-radius: 14px;
  margin-bottom: 8px;
}
.skel {
  height: 76px;
  padding: 0;
  border-style: solid;
  background: linear-gradient(90deg, var(--field), #16161a, var(--field));
  background-size: 200% 100%;
  animation: shimmer 1.1s ease infinite;
}

.tok {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.tok:hover { background: var(--accent-soft); }
.tok img {
  width: 40px; height: 40px;
  border-radius: 999px;
  object-fit: contain;
  background: var(--field);
  border: 1px solid var(--line);
}
.tok b {
  display: block;
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 700;
}
.tok small { color: var(--muted); font-size: 12px; }
.tok .priv {
  font-family: var(--font-d);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.tok .priv.max { color: var(--ok); }
.tok .priv.high { color: #b6e0bc; }
.tok .priv.low { color: var(--faint); }

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide {
  from { transform: translateY(18px); opacity: .7; }
  to { transform: none; opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-panel, .deposit, .skel, .switch {
    animation: none !important;
    transition: none !important;
  }
}
