/* Mystic Finance — host recreation stylesheet.
   Every value here was measured off app.mysticfinance.xyz at 1440px on 2026-08-04.
   Phase 1 = host only. No Spice Flow. */

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

:root {
  --bg: #131420;
  --surface: #120e1a;      /* dark-bg — sidebar, cards, modals */
  --raised: #261e38;       /* row-hover — active nav, hover rows */
  --field: rgba(255, 255, 255, 0.04);
  --field-focus: rgba(255, 255, 255, 0.07);
  --line: rgba(227, 231, 239, 0.2);
  --line-soft: rgba(255, 255, 255, 0.1);
  --primary: #373eef;
  --primary-hover: #585ded;
  --text: #fff;
  --muted: #b2b2b2;
  --chart: #a78bfa;
  --radius: 6px;
  --sidebar-w: 224px;
  --banner-h: 36px;
  --gutter: 38px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; }

/* ---------- phishing banner ---------- */

.banner {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #e8833a 0%, #d2557d 50%, #9b4dca 100%);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  z-index: 60;
}

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

.sidebar {
  position: fixed;
  left: 0;
  top: var(--banner-h);
  width: var(--sidebar-w);
  height: calc(100vh - var(--banner-h));
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 16px 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.sidebar-logo { display: block; padding-left: 24px; line-height: 0; }
.sidebar-logo svg { width: 150px; height: 40px; }

.nav { margin-top: 26px; display: flex; flex-direction: column; gap: 13px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 24px;
  transition: background 0.15s;
}
.nav a:hover { background: rgba(38, 30, 56, 0.5); }
.nav a.is-active { background: var(--raised); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.95; }

.nav-soon {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #b9f8cf;
  color: #0d2818;
}

.sidebar-foot { margin-top: auto; padding-bottom: 20px; }

.api-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 18px;
}
.api-card p { margin: 0 0 10px; font-size: 13px; font-weight: 700; }
.api-card a {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px;
  font-size: 12px;
  font-weight: 500;
}
.api-card a:hover { background: var(--raised); }

.socials { display: flex; gap: 30px; padding-left: 6px; align-items: center; }
.socials a { opacity: 0.85; font-size: 12px; font-weight: 700; }
.socials a:hover { opacity: 1; }
.socials svg { width: 17px; height: 17px; }

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

.main {
  margin-left: var(--sidebar-w);
  padding: calc(var(--banner-h) + 83px) var(--gutter) 60px;
  min-height: 100vh;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

h1 { margin: 0; font-size: 36px; font-weight: 600; line-height: 40px; letter-spacing: -0.01em; }
.page-sub { margin: 0; font-size: 16px; font-weight: 500; line-height: 24px; }

/* ---------- header controls ---------- */

.controls { display: flex; align-items: center; gap: 16px; flex: none; }

.ctl {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
}
.ctl:hover { background: var(--raised); }
.ctl svg { width: 18px; height: 18px; }
.ctl img { width: 20px; height: 20px; border-radius: 50%; }
.ctl .chev { width: 14px; height: 14px; opacity: 0.7; }

.ctl-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
  padding: 8px 16px;
}
.ctl-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #6ea8fe, #b98cf0 55%, #f38ab0);
}

/* dropdown shared by chain + account menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 172px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  z-index: 40;
  display: none;
}
.menu.is-open { display: block; }
.menu button, .menu a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius);
  font-size: 14px;
  text-align: left;
}
.menu button:hover, .menu a:hover { background: var(--raised); }
.menu img { width: 20px; height: 20px; border-radius: 50%; }
.menu svg { width: 15px; height: 15px; opacity: 0.85; }
.menu .tick { margin-left: auto; width: 14px; height: 14px; opacity: 0; }
.menu .is-current .tick { opacity: 1; }

/* ---------- morpho lockup ---------- */

.morpho {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 52px 0 33px;
  font-size: 20px;
  font-weight: 500;
}
.morpho svg { width: 26px; height: 26px; }

/* ---------- data card + grid tables ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.grid-head, .grid-row { display: grid; align-items: center; gap: 0 16px; padding: 0 24px; }
.grid-head {
  height: 52px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}
.grid-row { min-height: 80px; transition: background 0.15s; }
.grid-row + .grid-row { border-top: 1px solid var(--line); }
a.grid-row:hover { background: rgba(38, 30, 56, 0.45); }

/* Column templates. Widths are the measured live column offsets at 1440, so the
   track sizes already include their own spacing — cols-vault carries no extra gap. */
.cols-vault   { grid-template-columns: 265fr 144fr 288fr 144fr 145fr 74fr 30fr; gap: 0; }
.cols-market  { grid-template-columns: 200fr 200fr 130fr 200fr 160fr 130fr 118fr; }
.cols-mult    { grid-template-columns: 190fr 130fr 170fr 210fr 210fr 110fr 120fr; }
.cols-earnpos { grid-template-columns: 110fr 430fr 310fr 190fr 100fr; }
.cols-borrpos { grid-template-columns: 110fr 300fr 300fr 160fr 170fr 100fr; }

.cell-r { text-align: right; justify-self: end; }

.asset { display: flex; align-items: center; gap: 8px; min-width: 0; }
.asset img, .asset .letter { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.asset .letter {
  display: flex; align-items: center; justify-content: center;
  background: var(--raised); font-size: 12px; font-weight: 700;
}
.asset-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge {
  font-size: 12px; font-weight: 700; line-height: 16px;
  padding: 0 6px; border-radius: var(--radius);
  background: var(--primary); color: #fff; flex: none;
}
.badge-ghost { background: var(--raised); color: var(--text); font-weight: 600; }

.stack .up { font-size: 16px; font-weight: 600; line-height: 22px; }
.stack .dn { font-size: 13px; color: var(--muted); line-height: 18px; }

.curator { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.curator img, .curator .letter { width: 22px; height: 22px; border-radius: 50%; }
.curator .letter {
  display: flex; align-items: center; justify-content: center;
  background: var(--raised); font-size: 10px; font-weight: 700;
}

.icon-stack { display: flex; }
.icon-stack img, .icon-stack .letter {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--surface); margin-left: -8px;
}
.icon-stack > :first-child { margin-left: 0; }
.icon-stack .letter {
  display: flex; align-items: center; justify-content: center;
  background: var(--raised); font-size: 9px; font-weight: 700;
}

.apy { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.apy img { width: 18px; height: 18px; border-radius: 50%; }

.chev-cell { display: flex; justify-content: flex-end; opacity: 0.55; }
.chev-cell svg { width: 16px; height: 16px; }

.empty { padding: 34px 24px; text-align: center; font-size: 14px; }

/* ---------- toolbar (search / filters) ---------- */

.toolbar { display: flex; align-items: center; gap: 16px; margin: 30px 0 0; }
.toolbar-end { margin-left: auto; }
.toolbar-end .morpho { margin: 0; }
.toolbar + .card { margin-top: 33px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 44px;
  width: 232px;
}
.search svg { width: 15px; height: 15px; opacity: 0.6; }
.search input {
  border: 0; background: none; color: var(--text);
  font: inherit; font-size: 14px; outline: none; width: 100%;
}
.search input::placeholder { color: var(--muted); }

.select {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0 12px; height: 44px; font-size: 14px;
}
.select:hover { background: var(--raised); }
.select svg { width: 14px; height: 14px; opacity: 0.7; }

.link-accent { color: #f0813c; font-size: 14px; font-weight: 500; text-decoration: underline; }

.sortable { display: inline-flex; align-items: center; gap: 4px; }
.sortable svg { width: 10px; height: 12px; opacity: 0.5; }

.info-dot { width: 13px; height: 13px; opacity: 0.5; vertical-align: -2px; margin-left: 4px; }

/* ---------- collapsible (retired vaults / strategies) ---------- */

.collapse {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.collapse-head {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 22px 24px; font-size: 16px; font-weight: 600;
}
.collapse-head .count {
  font-size: 12px; font-weight: 600; padding: 1px 8px;
  border-radius: 999px; background: var(--raised);
}
.collapse-head .chev { margin-left: auto; width: 16px; height: 16px; opacity: 0.7; transition: transform 0.2s; }
.collapse.is-open .collapse-head .chev { transform: rotate(180deg); }
.collapse-body { display: none; border-top: 1px solid var(--line); }
.collapse.is-open .collapse-body { display: block; }

/* ---------- stats bar ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 30px;
}
.stats > div { padding: 26px 30px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats .k { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.stats .v { font-size: 24px; font-weight: 600; }

.section-title { font-size: 22px; font-weight: 600; margin: 40px 0 16px; }

/* ---------- vault detail ---------- */

.vault-head { display: flex; align-items: center; gap: 14px; }
.vault-back { opacity: 0.7; }
.vault-back svg { width: 20px; height: 20px; }
.vault-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px;
}
.vault-pill img, .vault-pill .letter { width: 30px; height: 30px; border-radius: 50%; }
.vault-pill .letter { display: flex; align-items: center; justify-content: center; background: var(--raised); font-size: 11px; font-weight: 700; }
.vault-pill .nm { font-size: 22px; font-weight: 600; }
.vault-pill .chev { width: 16px; height: 16px; opacity: 0.7; }

.vault-grid { display: grid; grid-template-columns: 1fr 420px; gap: 30px; margin-top: 30px; align-items: start; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 22px 26px; }

.vault-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.vault-stats > div { padding: 22px 26px; }
.vault-stats > div + div { border-left: 1px solid var(--line); }
.vault-stats .k { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.vault-stats .v { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.vault-stats .v img { width: 17px; height: 17px; border-radius: 50%; }

.chart-card { margin-top: 22px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; }
.chart-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.range { display: flex; gap: 6px; }
.range button {
  font-size: 12px; font-weight: 600; padding: 5px 11px;
  border-radius: var(--radius); background: var(--raised); color: var(--text);
}
.range button.is-active { background: var(--primary); }
.chart-big { font-size: 26px; font-weight: 600; margin-top: 14px; }
.chart-avg { float: right; font-size: 13px; color: var(--muted); margin-top: 20px; }
.chart-avg b { background: var(--raised); color: var(--text); padding: 3px 8px; border-radius: var(--radius); font-size: 12px; margin-left: 6px; }
.chart-svg { width: 100%; height: 210px; margin-top: 10px; display: block; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 6px 0 0 42px; }

/* supply / withdraw widget */
.tabs { display: flex; gap: 6px; padding: 16px 16px 0; }
.tabs button { flex: 1; padding: 9px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--muted); }
.tabs button.is-active { background: var(--raised); color: var(--text); }

.widget-body { padding: 12px 16px 16px; }

.swap-to {
  display: flex; align-items: center; gap: 6px; margin-left: auto; width: max-content;
  font-size: 12px; font-weight: 500;
  background: var(--raised); border-radius: var(--radius); padding: 5px 9px; margin-bottom: 8px;
}
.swap-to svg { width: 13px; height: 13px; }

.amount-box { background: var(--field); border: 1px solid transparent; border-radius: var(--radius); padding: 14px 16px; }
.amount-box:focus-within { background: var(--field-focus); border-color: rgba(55, 62, 239, 0.4); }
.amount-row { display: flex; align-items: center; gap: 12px; }
.amount-row > img, .amount-row > .letter { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.amount-row > .letter { display: flex; align-items: center; justify-content: center; background: var(--raised); font-size: 11px; font-weight: 700; }
.amount-row input {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 22px; font-weight: 600; outline: none;
}
.amount-row input::placeholder { color: rgba(255, 255, 255, 0.4); }
.btn-max { font-size: 12px; font-weight: 700; background: var(--raised); border-radius: var(--radius); padding: 6px 10px; }
.amount-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

.kv { display: flex; justify-content: space-between; font-size: 14px; margin-top: 16px; }
.kv .k { color: var(--muted); font-weight: 500; }
.kv .v { font-weight: 600; }

.cta {
  width: 100%; margin-top: 16px; padding: 15px;
  border-radius: var(--radius); background: var(--primary);
  font-size: 15px; font-weight: 600; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.cta:hover { background: var(--primary-hover); }
.cta[disabled] { background: #262a86; color: rgba(255, 255, 255, 0.75); cursor: not-allowed; }
.cta svg { width: 17px; height: 17px; }

.panel-title { font-size: 17px; font-weight: 600; padding: 20px 26px; border-bottom: 1px solid var(--line); }

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

.swap-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; padding-top: 40px; }
.swap-card { width: 440px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.swap-card h2 { margin: 0; font-size: 17px; font-weight: 600; padding: 18px 20px 12px; }
.swap-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.legs { position: relative; display: flex; flex-direction: column; gap: 4px; }

.leg { background: var(--field); border: 1px solid transparent; border-radius: var(--radius); padding: 16px; }
.leg:focus-within { background: var(--field-focus); border-color: rgba(55, 62, 239, 0.4); }
.leg-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.leg-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.leg-tools { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.leg-tools svg { width: 13px; height: 13px; opacity: 0.8; }
.pct { font-size: 11px; font-weight: 600; background: var(--surface); border-radius: var(--radius); padding: 4px 7px; color: var(--text); }
.leg-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.token-pill { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--radius); padding: 6px 10px 6px 6px; }
.token-pill .tk { position: relative; width: 28px; height: 28px; flex: none; }
.token-pill .tk img.t, .token-pill .tk .letter { width: 28px; height: 28px; border-radius: 50%; }
.token-pill .tk .letter { display: flex; align-items: center; justify-content: center; background: var(--raised); font-size: 10px; font-weight: 700; }
.token-pill .tk img.c { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--surface); }
.token-pill .sym { font-size: 15px; font-weight: 600; }
.token-pill svg { width: 13px; height: 13px; opacity: 0.7; }

.leg-amt { text-align: right; }
.leg-amt input {
  border: 0; background: none; color: var(--text); font: inherit;
  font-size: 30px; font-weight: 700; text-align: right; outline: none; width: 150px;
}
.leg-amt input::placeholder { color: #6b6b78; }
.leg-usd { font-size: 12px; color: var(--muted); margin-top: 2px; }

.flip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--raised); border: 3px solid var(--surface);
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.flip svg { width: 15px; height: 15px; }

.slippage {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--field); border-radius: var(--radius); padding: 14px 16px; margin-top: 4px;
}
.slippage .l { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.slippage .l svg { width: 13px; height: 13px; }
.slippage .r { font-size: 13px; font-weight: 700; }

.routing { width: 440px; }
.routing h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.routing-card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px 16px; text-align: center;
}
.venues { display: flex; justify-content: center; margin-bottom: 12px; }
.venues img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -9px; }
.venues img:first-child { margin-left: 0; }
.routing-card .rt { font-size: 15px; font-weight: 700; }
.routing-card .rv { font-size: 12px; color: var(--muted); margin-top: 5px; }
.swap-foot { font-size: 12px; color: var(--muted); }
