:root { --ink: #000000; --paper: #ffffff; --muted: #3d3d3d; --soft: #f2f2f2; --grid: #d6d6d6; --line: rgba(0, 0, 0, 0.16); --line-strong: rgba(0, 0, 0, 0.3); --line-hover: rgba(0, 0, 0, 0.55); --card: #f4f3ec; --card-line: #ebe8dc; --accent: #000000; --on-accent: #ffffff; color-scheme: light; }

/* Colour themes (Settings → Theme). Everything is drawn from these variables. */
:root[data-theme="hyperliquid"] { --ink: #f6fefd; --paper: #0f1a1f; --muted: #949e9c; --soft: #1b2429; --grid: #273035; --line: rgba(255, 255, 255, 0.14); --line-strong: rgba(255, 255, 255, 0.26); --line-hover: rgba(255, 255, 255, 0.5); --card: #16252b; --card-line: #22353c; --accent: #97fce4; --on-accent: #0f1a1f; color-scheme: dark; }
:root[data-theme="binance"] { --ink: #eaecef; --paper: #181a20; --muted: #848e9c; --soft: #1e2329; --grid: #2b3139; --line: rgba(255, 255, 255, 0.12); --line-strong: rgba(255, 255, 255, 0.24); --line-hover: rgba(255, 255, 255, 0.45); --card: #1e2329; --card-line: #2b3139; --accent: #fcd535; --on-accent: #181a20; color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 20px; line-height: 1.6; }
a { color: var(--ink); }
h1 { font-size: 40px; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 30px; line-height: 1.3; margin: 40px 0 16px; }
h3 { font-size: 24px; margin: 28px 0 8px; }
.lead { font-size: 22px; max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: 17px; }
.strong { font-weight: 800; }
.grow { flex: 1; }
.spaced { margin-top: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
#site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px 40px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--grid); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 52px; height: 52px; }
.brand span { font-size: 26px; font-weight: 800; }
#site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.nav-link, button.nav-link:hover:not(:disabled) { font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; border-radius: 0; box-shadow: none; text-decoration: none; padding: 4px 0; border-bottom: 3px solid transparent; }
.nav-link[aria-current="page"], .nav-link:hover, button.nav-link:hover:not(:disabled) { border-bottom-color: var(--ink); }

/* Pushed to the far right, a little apart, so the menu has room. */
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.icon-btn { position: relative; width: 48px; height: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 22px; }
.menu { position: relative; }
.menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; min-width: 240px; padding: 8px; background: var(--paper); border: 1px solid var(--grid); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); }
nav .menu-panel { left: 0; right: auto; }
.menu-panel a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.menu-panel a:hover { background: var(--soft); }
.menu-panel.notify { width: min(380px, calc(100vw - 32px)); padding: 16px; }
.menu-panel ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; font-size: 17px; }
.menu-panel li { padding-top: 10px; border-top: 1px solid var(--grid); }

/* ─── Controls ───────────────────────────────────────────────────────────── */
button, .btn { display: inline-block; font: inherit; font-size: 19px; font-weight: 700; line-height: 1.3; padding: 11px 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; cursor: pointer; text-decoration: none; text-align: center; white-space: nowrap; transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
button:hover:not(:disabled), .btn:hover { border-color: var(--line-hover); background: #fafafa; box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.08); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary, .btn.primary { border-color: var(--line-strong); }
button.ra { min-width: 52px; padding-left: 12px; padding-right: 12px; letter-spacing: 0.04em; }
[aria-pressed="true"], [role="tab"][aria-selected="true"] { background: var(--soft); border-color: var(--line-hover); font-weight: 800; }
button.icon { padding: 6px 14px; }
button.wide { width: 100%; margin-top: 8px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
label.check { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
label.check input { width: 24px; height: 24px; accent-color: var(--ink); }
input, select, textarea { font: inherit; font-size: 19px; width: 100%; padding: 11px 14px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink); }
textarea { min-height: 200px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; }
.form-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field-hint { font-size: 16px; color: var(--muted); margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.actions label.btn { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips button { padding: 6px 16px; }

/* ─── Layout blocks ──────────────────────────────────────────────────────── */
main { max-width: 1240px; margin: 0 auto; padding: 36px 24px 64px; }
.card { border-top: 1px solid var(--grid); padding: 24px 0; margin-bottom: 8px; background: var(--paper); }
.card > h2:first-child { margin-top: 0; }
.notice { border-radius: 12px; padding: 16px 20px; background: var(--soft); margin-bottom: 24px; }
.error { border-left: 6px solid var(--ink); background: var(--soft); padding: 16px 20px; font-weight: 700; margin: 24px 0; }
.status { font-weight: 700; margin: 12px 0 4px; }
.status.ok::before { content: "✓ "; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 8px 0 28px; }
.stats div { border-top: 2px solid var(--ink); padding: 12px 0 4px; }
.stats span { display: block; }
.stats span:first-child { font-size: 16px; color: var(--muted); }
.stats span:last-child { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 16px; }
.toolbar input[type="search"] { flex: 1 1 320px; width: auto; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0; }
.kv span { display: block; }
.kv span:first-child { font-size: 16px; color: var(--muted); }
.kv span:last-child { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 14px 6px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th { border-bottom: 2px solid var(--ink); white-space: nowrap; font-size: 17px; color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
td.num { font-weight: 800; }
.row-actions { display: flex; flex-wrap: nowrap; gap: 8px; justify-content: flex-end; }
.row-actions button, .row-actions .btn { padding: 6px 14px; font-size: 17px; }

/* ─── Dialogs ────────────────────────────────────────────────────────────── */
dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3); color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.dialog-body { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 6px 0; margin-top: -6px; }
.dialog-head .icon { flex: none; margin-left: auto; }
.dialog-head h2 { margin: 0; }
dialog h3 { margin-top: 24px; }
dialog.wide-dialog { width: min(1100px, calc(100vw - 32px)); overflow-x: hidden; }

/* ─── Risk Management ────────────────────────────────────────────────────── */
.verdict { font-size: 28px; font-weight: 800; }
.output { white-space: pre-wrap; margin-top: 16px; }
fieldset.card { min-width: 0; border: 0; border-top: 1px solid var(--grid); margin: 0 0 8px; }
legend { font-size: 24px; font-weight: 800; padding: 0 8px; }
.criterion { display: grid; grid-template-columns: 1fr minmax(260px, 360px); gap: 12px 24px; padding: 16px 0; border-top: 2px solid var(--grid); }
textarea.note { min-height: 70px; font-family: inherit; font-size: 17px; }
.chart { position: relative; margin: 8px 0 24px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 22px; fill: var(--muted); }
.chart .tip { position: absolute; pointer-events: none; display: none; background: var(--ink); color: var(--paper); font-size: 17px; font-weight: 700; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
details summary { cursor: pointer; font-weight: 700; }

/* ─── Financial AI ───────────────────────────────────────────────────────── */
.msg.user { background: var(--soft); margin-left: 10%; }
.msg.assistant { margin-right: 10%; }
.msg .who { display: block; font-size: 16px; font-weight: 800; margin-bottom: 4px; }

/* ─── Guide ──────────────────────────────────────────────────────────────── */
.prose { max-width: 900px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0; font-weight: 700; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; padding-left: 56px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
footer { border-top: 1px solid var(--grid); padding: 28px 24px; font-size: 17px; color: var(--muted); }
footer div { max-width: 1192px; margin: 0 auto; }
@media (max-width: 720px) {
  body { font-size: 19px; }
  #site-header { padding: 12px 16px; }
  main { padding: 24px 16px 48px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .criterion { grid-template-columns: 1fr; }
  .msg.user, .msg.assistant { margin: 0; }
}

/* ─── Invest extras & vault page ─────────────────────────────────────────── */
.pill { display: inline-block; font-size: 15px; font-weight: 700; padding: 2px 12px; border: 1px solid var(--ink); border-radius: 999px; white-space: nowrap; }
.featured { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 28px; }
.feature { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.feature:hover { border-color: var(--line-hover); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.08); }
.trade label input { margin-top: 6px; font-weight: 400; }
dl.info { display: grid; grid-template-columns: minmax(160px, auto) 1fr; gap: 10px 24px; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; font-weight: 700; }


/* ─── Risk report ────────────────────────────────────────────────────────── */
.report { font-size: 17px; max-width: 100%; overflow-wrap: anywhere; }
.report h2 { font-size: 26px; margin: 32px 0 8px; }
.report h3 { font-size: 21px; }
.rating { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 28px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.rating-label { font-size: 17px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.rating-value { font-size: 72px; font-weight: 800; line-height: 1.05; }
.rating-value small { font-size: 26px; margin-left: 4px; }
.rating-grade { font-size: 24px; font-weight: 800; }
.rating-basis { font-size: 16px; color: var(--muted); margin-top: 6px; }
.rating-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px 24px; margin: 0; }
.rating-keys .pair { border-top: 1px solid var(--grid); padding-top: 8px; }
.rating-keys dt { font-size: 16px; color: var(--muted); }
.rating-keys dd { margin: 0; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
dl.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); column-gap: 40px; margin: 0; }
dl.pairs .pair { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
dl.pairs dt { color: var(--muted); }
dl.pairs dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
[title] > dt { text-decoration: underline dotted var(--grid); text-underline-offset: 4px; cursor: help; }
.reasons { margin: 0; }
input[type="range"] { padding: 0; border: 0; accent-color: var(--ink); height: 36px; }
.lev-value { font-size: 24px; font-weight: 800; margin-left: 8px; }
@media (max-width: 720px) {
  .rating { grid-template-columns: 1fr; }
  dl.pairs { grid-template-columns: 1fr; }
  dl.info { grid-template-columns: 1fr; gap: 2px; }
  dl.info dd { margin-bottom: 10px; }
  .card .btn { white-space: normal; }
}

/* ─── Wallet panel ───────────────────────────────────────────────────────── */
.copy { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.copy code { font-size: 16px; overflow-wrap: anywhere; }
.copy button.icon { padding: 2px 10px; font-size: 16px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
#wallet-dialog h3 { margin-top: 28px; }

/* Deposit route comparison (cheapest first). */
.routes { display: grid; gap: 8px; margin: 12px 0; }
.routes .route { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 16px; }
.routes .route.chosen { border-color: var(--line-hover); background: var(--soft); }
.routes .route-main { min-width: 0; overflow-wrap: anywhere; }
.routes .route-cost { font-weight: 700; white-space: nowrap; }
.check { display: flex; gap: 8px; align-items: center; font-size: 16px; }

/* Invest: platform total and the one-line filter bar. */


/* Compact menus: as wide as their label, not their longest option. */

#f-savings { border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 700; }
#f-savings.on { border-color: var(--line-hover); background: var(--soft); }


/* "All" class menu: one class per line, empty square on the right that fills with a tick. */

#vault-rows tr.group th { text-align: left; padding: 18px 8px 8px; font-size: 19px; border-bottom: 1px solid var(--line); }
#vault-rows tr.basket td { background: var(--soft); }

/* ─── Phones ─────────────────────────────────────────────────────────────────
   Presentation only: compact header, two-line filters, tables as cards. */
@media (max-width: 720px) {
  #site-header { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 6px 10px; padding: 10px 12px; }
  .brand { gap: 8px; }
  .brand img { width: 38px; height: 38px; }
  .brand span { font-size: 21px; }
  .header-actions { grid-column: 2; grid-row: 1; justify-self: end; gap: 8px; margin-left: 0; }
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn svg { width: 20px; height: 20px; }
  #connect-btn { min-height: 40px; padding: 6px 12px; font-size: 15px; }
  #site-header nav { grid-column: 1 / -1; gap: 2px 16px; font-size: 16px; }
  .nav-link { padding: 2px 0; }
  main { padding: 18px 14px 40px; }
  h1 { font-size: 28px; margin-bottom: 12px; }
  h2 { font-size: 22px; }
  .deposited { font-size: 19px; padding: 10px 16px; margin: 4px 0 14px; }
  .deposited strong { font-size: 22px; }

  /* The vault / product table becomes one card per row. */
  #vault-table { min-width: 0; }
  #vault-table thead { display: none; }
  #vault-table tbody, #vault-table tr { display: block; }
  #vault-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  #vault-table td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; font-size: 17px; }
  #vault-table td:first-child { grid-column: 1 / -1; }
  #vault-table td[colspan] { grid-column: 1 / -1; }
  #vault-table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
  #vault-table .row-actions { justify-content: flex-start; }
  #vault-table tr.group { display: block; padding: 14px 0 4px; border-bottom: 1px solid var(--line-strong); }
  #vault-table tr.group th { display: block; padding: 0; font-size: 18px; border: 0; }
  #vault-table tr.basket { background: var(--soft); padding: 12px 10px; border-radius: 12px; }
  #vault-table tr.basket td { background: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .stats span:last-child { font-size: 22px; }
  dialog { width: calc(100vw - 16px); max-width: none; margin: 8px auto; }
  .dialog-body { padding: 16px; }
  .dialog-head h2 { font-size: 21px; }
  .kv { gap: 10px 14px; }
  .kv > div > span:last-child { font-size: 19px; }
  .routes .route { font-size: 15px; padding: 8px 10px; }
  .tabs { gap: 6px; }
  .tabs [role="tab"] { padding: 6px 12px; font-size: 16px; }
}

/* Narrow phones: smaller name and menu text. */
@media (max-width: 400px) {
  .brand span { font-size: 18px; }
  #site-header nav { font-size: 15px; }
  #connect-btn { font-size: 14px; padding: 6px 10px; }
}

/* ─── Invest / Multi Fund: Deposited total, top picks, plain table cells ───── */

#vault-table td, #vault-table td.num { font-weight: 400; }
#vault-table td a { color: var(--ink); }
button.linklike { font: inherit; font-weight: 400; color: var(--ink); background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; text-align: left; text-decoration: underline; cursor: pointer; }
button.linklike:disabled { text-decoration: none; color: var(--muted); }
.nav-link .short { display: none; }
.pick { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); min-width: 0; }
.pick dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.pick dt { font-size: 13px; color: var(--muted); }
.pick dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .nav-link .long { display: none; }
  .nav-link .short { display: inline; }
  #vault-table tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Phones: menu spread across the width; top picks and vault rows as compact 4-column rows. */
@media (max-width: 720px) {
  #site-header nav { justify-content: space-between; column-gap: 8px; }

  /* Top picks: three small cards side by side — name, APY, provider, score, then Deposit at the bottom. */

  .pick { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 10px 8px; border-radius: 12px; text-align: center; }
  .pick > div.small { display: none; }
  .pick dl, .pick-foot { display: contents; }
  .pick .pair { order: 2; }
  .pick .pair:nth-child(2) { display: none; }
  .pick .pair:nth-child(3) { order: 3; }
  .pick dt { display: none; }
  .pick dd { font-size: 13px; }
  #vault-table tr { gap: 4px 10px; padding: 12px 0; align-items: center; }
  #vault-table td { font-size: 15px; overflow-wrap: anywhere; }
  #vault-table td:first-child { font-size: 16px; }
  #vault-table td .small { font-size: 13px; }
  #vault-table td[data-label]:not(:first-child)::before { font-size: 12px; }
  #vault-table td:last-child { justify-self: end; text-align: right; }
  button.ra { min-width: 44px; min-height: 36px; padding: 4px 10px; font-size: 15px; }
}

/* Phones: one-line filter bar (All, Risk, Sector — or Type on Multi Fund —, Filter, search), smaller header icons,
   and the vault rows' risk button without a label so the four columns line up. */
@media (max-width: 720px) {
  .header-actions { gap: 6px; margin-right: -4px; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .icon-btn .badge { transform: scale(0.85); }
  #vault-table td[data-label]:not(:first-child)::before { font-weight: 400; }
  #vault-table td:last-child::before { content: none !important; }
}

/* Vault table: evenly spaced, centred data columns; Risk Analysis header centred over the score; Deposit last. */
#vault-table th:not(:first-child), #vault-table td:not(:first-child) { text-align: center; }
#vault-table th:not(:first-child) .sort { margin: 0 auto; }
#vault-table th:nth-child(2), #vault-table th:nth-child(3), #vault-table th:nth-child(4), #vault-table th:nth-child(5) { width: 13%; }
@media (max-width: 720px) {
  #vault-table tr { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 0.9fr) auto auto; column-gap: 8px; }
  #vault-table td.risk-cell, #vault-table td.deposit-cell { overflow: visible; }

  /* Numbers and provider names never break mid-word; a long provider name ends with "…". */
  #vault-table td:not(:first-child) { text-align: left; overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
}
@media (max-width: 720px) {
  #vault-table tr > td.risk-cell, #vault-table tr > td.deposit-cell { width: auto; overflow: visible; text-align: right; }
}

/* ─── AI chats: replies, report cards, account bar ─────────────────────────── */
.msg .md p { margin: 0 0 8px; }
.msg .md ul { margin: 0 0 8px; padding-left: 20px; }
.msg { border-radius: 14px; padding: 14px 18px; white-space: normal; border: 1px solid var(--grid); }
.ai-account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; margin: 12px 0 16px; }
.ai-account .balance { font-size: 20px; font-weight: 800; }
.topup { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.topup code { overflow-wrap: anywhere; }
.ai-account label.check { min-width: 0; max-width: 100%; }
.ai-account select { width: auto; min-width: 12em; max-width: 100%; }
@media (max-width: 720px) {
  .ai-account label.check { flex: 1 1 100%; }
  .ai-account select { flex: 1 1 0; min-width: 0; width: 100%; font-size: 15px; }
}
.topup input[type="number"] { width: 6em; }
.topup h2 { margin-top: 0; }

/* ─── Financial AI: Claude-style chat ─────────────────────────────────────── */
body.chat-page { min-height: 100vh; display: flex; flex-direction: column; }
body.chat-page > footer { display: none; }
.c-main { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 820px; margin: 0 auto; padding: 8px 16px 0; }
.c-log { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 12px 0 24px; }
.c-empty { margin: auto; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 8vh 0; }
.c-empty h1 { font-size: 30px; font-weight: 500; margin: 0; }
.c-msg { display: flex; flex-direction: column; }
.c-user { align-items: flex-end; }
.c-bubble { background: var(--soft); border-radius: 16px; padding: 10px 16px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; }
.c-files-sent { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.c-ai .c-body { font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; }
.c-ai .md p { margin: 0 0 10px; }
.c-ai .md ul { margin: 0 0 10px; padding-left: 22px; }
.c-actions { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-height: 28px; }
button.c-act { min-height: 0; padding: 3px 10px; font-size: 13px; font-weight: 600; border-color: transparent; background: none; box-shadow: none; color: var(--muted); }
button.c-act:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.c-error { color: var(--ink); font-weight: 600; }
.c-typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.c-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: c-blink 1.2s infinite ease-in-out; }
.c-typing i:nth-child(2) { animation-delay: 0.2s; }
.c-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes c-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.c-dock { position: sticky; bottom: 0; background: var(--paper); padding: 8px 0 12px; }
.c-composer { border: 1px solid var(--line-strong); border-radius: 22px; padding: 12px 12px 8px 16px; background: var(--paper); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
.c-composer textarea { width: 100%; border: 0; outline: none; resize: none; box-shadow: none; padding: 4px 0; min-height: 28px; max-height: 240px; font: inherit; font-size: 17px; background: none; }
.c-composer textarea:focus { box-shadow: none; outline: none; }
.c-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.c-spacer { flex: 1; }
button.c-icon { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border-color: var(--line); box-shadow: none; }
.c-icon svg, .c-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button.c-icon.on { background: var(--ink); color: var(--paper); }
.c-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.c-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); max-width: 220px; }
.c-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-chip button { min-height: 0; padding: 0 6px; font-size: 15px; border: 0; background: none; box-shadow: none; }
.c-model-wrap { position: relative; flex: none; }
button.c-model { min-height: 0; padding: 4px 8px; font-size: 14px; font-weight: 600; border: 0; background: none; box-shadow: none; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
button.c-model:hover:not(:disabled) { background: var(--soft); }
.c-menu { position: absolute; right: 0; bottom: calc(100% + 6px); width: min(330px, calc(100vw - 32px)); list-style: none; margin: 0; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14); z-index: 20; }
.c-menu li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.c-menu li:hover, .c-menu li:focus { background: var(--soft); outline: none; }
.c-menu li[aria-selected="true"] .c-menu-name::after { content: " ✓"; }
.c-menu-name { font-weight: 700; color: var(--ink); }
@media (max-width: 720px) {
  .c-main { padding: 4px 12px 0; }
  .c-empty h1 { font-size: 24px; }
  .c-bubble, .c-ai .c-body, .c-composer textarea { font-size: 16px; }
}

/* The hidden attribute always hides, whatever display a component sets. */
[hidden] { display: none !important; }

/* Credit button: out of sight when the balance is above zero, until the pointer comes near, it has focus or its panel is open. */
/* Touch screens have no pointer to come near, so the button stays visible there. */
/* ─── One-touch panels (quick.js): amount, 25/50/75%, Confirm ─────────────── */
dialog.quick { width: min(340px, calc(100vw - 24px)); padding: 16px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18); }
dialog.quick::backdrop { background: rgba(0, 0, 0, 0.25); }
.quick-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.quick-head h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-head .icon { min-height: 0; padding: 2px 8px; border: 0; box-shadow: none; background: none; font-size: 16px; }
.quick-panel { display: grid; gap: 10px; }
.quick-amount input { flex: 1; min-width: 0; border: 0; padding: 4px 0; font-size: 24px; font-weight: 700; background: none; box-shadow: none; outline: none; }
.quick-chips { display: flex; gap: 6px; }
button.quick-chip { flex: 1; min-height: 0; padding: 4px 0; font-size: 13px; font-weight: 700; border-radius: 8px; border-color: var(--line); box-shadow: none; }
button.quick-confirm { width: 100%; padding: 11px; font-size: 16px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.quick-confirm:hover:not(:disabled) { background: var(--ink); color: var(--paper); opacity: 0.9; }
button.quick-confirm:disabled { opacity: 0.35; }
button.quick-secondary { width: 100%; padding: 10px; font-size: 15px; }
.quick-status { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--ink); }

/* Chat-to-trade: wallet actions in the conversation, and the composer's mode and effort controls. */
.c-tool { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.c-tool.trade { border-color: var(--line-strong); }
.c-tool.quiet { border-style: dashed; color: var(--muted); font-size: 13px; padding: 6px 12px; }
.c-tool-line { font-weight: 700; }
.c-tool-status { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
button.c-approve { min-height: 0; padding: 5px 14px; font-size: 14px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.c-approve:hover:not(:disabled) { background: var(--ink); color: var(--paper); opacity: 0.9; }
.c-menu-left { left: 0; right: auto; }
.c-left button.c-model { color: var(--muted); }
button.c-effort { color: var(--muted); }
.c-row { flex-wrap: nowrap; min-width: 0; }
.c-row .c-model { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .c-row .c-model { max-width: 110px; font-size: 13px; padding: 4px 4px; }
  .c-row { gap: 4px; }
}

/* Desktop header on one line, also when the wallet address replaces "Wallet". */
@media (min-width: 721px) {
  #site-header { flex-wrap: nowrap; }
  #site-header nav { flex-wrap: nowrap; gap: 4px 20px; white-space: nowrap; }
  .header-actions { flex: none; gap: 10px; }
}
@media (min-width: 721px) and (max-width: 1180px) {
  #site-header nav { gap: 4px 14px; font-size: 16px; }
  .brand span { font-size: 22px; }
}
@media (min-width: 721px) and (max-width: 1180px) {
  #site-header { gap: 12px 18px; padding-left: 16px; }
  .brand img { width: 44px; height: 44px; }
  #site-header nav { gap: 4px 12px; font-size: 15px; }
  .icon-btn { width: 40px; height: 40px; }
}
@media (min-width: 721px) and (max-width: 1060px) {
  .brand span { display: none; }
}

/* ─── Invest / Multi Fund refinements: compact header box and cards, the table higher up ─── */

@media (min-width: 721px) {
  body[data-page="invest"] main, body[data-page="multiply"] main { padding-top: 14px; }
  .deposited { margin: 0 0 10px; padding: 7px 16px; font-size: 17px; border-color: var(--line); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04); }
  .deposited strong { font-size: 20px; }
  .pick { padding: 10px 14px; gap: 2px; }
  .pick > div.small { font-size: 12px; }
  .pick dl { margin: 6px 0 8px; gap: 6px; }
  .pick dt { font-size: 12px; }
  .pick dd { font-size: 15px; }
}

/* Filter pills: label and value centred. */


/* The table: APY stands out; deposits are plain. */
#vault-table td:nth-child(2) { font-weight: 800; }

/* More room between the featured cards and the list; filter pills sized to their text. */


.quick-menu { display: flex; flex-direction: column; gap: 10px; }
.quick-menu > button { min-height: 50px; font-size: 17px; font-weight: 700; border-radius: 12px; }

/* Live voice: the mic pulses while speech is heard or being read. */
#mic[data-state="hearing"], #mic[data-state="sending"] { animation: mic-pulse 0.9s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.12); } }
.c-tool.jev .c-tool-line { font-weight: 700; }

/* ─── Financial AI: fixed header, sidebar + chat; only the chat (and the sidebar list) scroll ─── */
body.chat-page { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.chat-page > #site-header { flex: none; }
.c-shell { flex: 1; min-height: 0; display: flex; }
body.chat-page .c-main { flex: 1; min-width: 0; min-height: 0; max-width: none; margin: 0; padding: 0 16px; position: relative; }
body.chat-page .c-log { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px max(0px, calc((100% - 820px) / 2)) 24px; margin: 0 -16px; padding-left: max(16px, calc((100% - 820px) / 2)); padding-right: max(16px, calc((100% - 820px) / 2)); }
body.chat-page .c-dock { position: static; width: 100%; max-width: 820px; margin: 0 auto; }
.c-side { flex: none; width: 264px; min-width: 0; overflow-x: hidden; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; border-right: 1px solid var(--line); background: var(--paper); overflow-y: auto; overscroll-behavior: contain; }
.side-top { display: grid; gap: 2px; position: relative; }
button.side-item, .side-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 0; padding: 8px 10px; border: 0; border-radius: 10px; background: none; box-shadow: none; font-size: 15px; font-weight: 500; color: var(--ink); text-align: left; }
button.side-item:hover { background: var(--soft); }
.side-ico { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--soft); font-size: 15px; flex: none; }
.side-find input { flex: 1; min-width: 0; border: 0; padding: 0; background: none; box-shadow: none; font-size: 15px; outline: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 10px 2px; }
.side-label, button.side-folder { font-size: 13px; font-weight: 600; color: var(--muted); }
button.side-folder { display: inline-flex; gap: 6px; align-items: center; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.side-chev { font-size: 12px; }
button.side-plus { min-height: 0; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--muted); font-size: 17px; line-height: 1; }
button.side-plus:hover { background: var(--soft); color: var(--ink); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.side-chat { display: flex; align-items: center; min-width: 0; border-radius: 10px; }
.side-chat:hover, .side-chat.on { background: var(--soft); }
button.side-more { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; min-height: 0; margin-right: 2px; padding: 0; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--muted); visibility: hidden; cursor: pointer; }
.side-chat:hover .side-more, .side-chat.on .side-more, button.side-more:focus-visible, button.side-more[aria-expanded="true"] { visibility: visible; }
button.side-more:hover { background: var(--line); color: var(--ink); }
.side-more .dots { display: inline-flex; flex-direction: column; gap: 3px; }
.side-more .dots i { width: 3.5px; height: 3.5px; border-radius: 50%; background: currentColor; }
@media (hover: none) { button.side-more { visibility: visible; } }
.side-rename { flex: 1; min-width: 0; width: 100%; padding: 2px 6px; border: 1px solid var(--line-hover, var(--line)); border-radius: 6px; background: var(--paper); font: inherit; font-size: 15px; outline: none; }
.side-menu { position: fixed; z-index: 70; display: grid; min-width: 150px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 10px 28px rgba(0,0,0,.18); }
button.side-menu-item { min-height: 0; padding: 8px 12px; border: 0; border-radius: 8px; background: none; box-shadow: none; font-size: 15px; font-weight: 500; text-align: left; color: var(--ink); cursor: pointer; }
button.side-menu-item:hover, button.side-menu-item:focus-visible { background: var(--soft); outline: none; }
button.side-menu-item.danger { color: #c43030; }
button.side-link, div.side-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 0; padding: 7px 10px; border: 0; background: none; box-shadow: none; font-size: 15px; font-weight: 400; text-align: left; color: var(--ink); }
.side-dot { width: 8px; height: 8px; border: 1.5px solid var(--muted); border-radius: 50%; flex: none; }
.side-chat.on .side-dot { background: var(--ink); border-color: var(--ink); }
.side-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-none { margin: 4px 10px; font-size: 13px; color: var(--muted); }
.side-close, .side-toggle { display: none !important; }

/* AI credit: under the wallet address in the header (placed by ai.js). */
/* Context ring (composer) and its popover: context window bar, then AI credit used. */
.c-meter-wrap { position: relative; flex: none; }
button.c-meter { width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; display: inline-grid; place-items: center; }
button.c-meter:hover { background: var(--soft); }
.c-ring { --p: 0; width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--line) 0); -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px); mask: radial-gradient(circle, transparent 5px, #000 5.5px); }
.c-meter-pop { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(320px, calc(100vw - 32px)); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14); padding: 14px 16px; display: grid; gap: 8px; z-index: 25; }
.c-meter-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0 2px; width: 100%; }
.m-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.m-name { font-weight: 600; }
.m-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.m-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.m-bar > span { display: block; height: 100%; background: #2f6fde; border-radius: 999px; }
.m-note { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .c-side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(290px, 84vw); transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18); }
  body.side-open .c-side { transform: none; }
  .side-close { display: grid !important; position: absolute; right: 0; top: 0; }
  .side-toggle { display: inline-flex !important; position: absolute; left: 12px; top: 8px; z-index: 5; background: var(--paper); }
  body.chat-page .c-log { padding-top: 52px; }
}
@media (max-width: 720px) {
  .c-row .c-model { max-width: 92px; }
  button.c-meter { width: 28px; height: 28px; }
  .c-row button.c-icon { width: 32px; height: 32px; }
  .c-row > * { flex-shrink: 1; min-width: 0; }
  .c-row > .c-spacer { min-width: 0; }
}
@media (max-width: 720px) {
  .c-row > .c-effort, .c-row > .c-meter-wrap, .c-row > .c-icon { flex: none; }
  .c-row .c-left .c-model { max-width: 78px; }
  .c-row .c-model-wrap:not(.c-left) .c-model { max-width: 84px; }
}
@media (max-width: 900px) {
  .c-side { box-shadow: none; }
  body.side-open .c-side { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18); }
}
@media (max-width: 720px) {
  .c-row > .c-model-wrap { flex: none; }
  .c-row .c-left .c-model { max-width: 70px; }
  .c-row .c-model-wrap:not(.c-left) .c-model { max-width: 76px; }
}

/* Featured cards (Invest, Multi Fund): warm light background, text a touch bolder. */
.pick { background: var(--card); border-color: var(--card-line); }
.pick > div.small { font-weight: 600; }
.pick dt { font-weight: 600; }
.pick dd { font-weight: 700; }

/* Toolbar menus (Type, Provider, Sector, Index) open on click; no drop-down arrow. */


/* Filter panel: one row per field, in order — APY, Risk, Sector, Provider, then the rest. */


/* The model's name, a little smaller than the other composer controls. */
#model-btn { font-size: 13px; }

/* Stored risk report: the AI's research and the MT5-style Strategy Tester report. */
.ai-report .lead { font-size: 21px; }
.ai-report h3 { margin: 22px 0 6px; }
.mt5-legend { display: flex; gap: 18px; font-size: 15px; color: var(--muted); margin-top: 4px; }
.mt5-legend i { display: inline-block; width: 22px; margin-right: 6px; vertical-align: middle; }

/* Cover 2/5 shorter (cropped, not squeezed). */

/* "Vaults:" total: small beige chip like the featured cards, close to them; more room before the list. */
.deposited { display: inline-block; margin: 6px 0 8px !important; padding: 4px 14px !important; border: 1px solid var(--card-line) !important; border-radius: 10px; font-size: 15px !important; font-weight: 700; background: var(--card); box-shadow: none !important; }
.deposited strong { font-size: 17px !important; font-weight: 800; }


/* Risk Management: the asset picker, just under the menu, always in the same place. */
/* Dark themes: the main action takes the theme's accent colour. */
:root[data-theme] .primary, :root[data-theme] .quick-confirm, :root[data-theme] button.c-icon.on, :root[data-theme] .badge { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
:root[data-theme] .nav-link[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
:root[data-theme] .brand img { box-shadow: 0 0 0 1px var(--line-strong); border-radius: 50%; }

/* Header: Wallet, Notifications, Settings (right); the two icons have no frame. */
.header-actions .icon-btn { border: 0; background: none; box-shadow: none; border-radius: 50%; }
.header-actions .icon-btn:hover:not(:disabled) { background: var(--soft); }
.header-actions .icon-btn svg { width: 26px; height: 26px; }
#connect-btn { white-space: nowrap; }

/* Phones: the notification list opens full width under the header instead of running off the screen. */
@media (max-width: 720px) {
  .menu-panel.notify { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: 70vh; overflow-y: auto; }
}
@media (max-width: 720px) {
  #site-header { position: relative; }
  .header-actions .menu { position: static; }
  .menu-panel.notify { position: absolute; top: calc(100% + 4px); left: 12px; right: 12px; }
}

/* The report as MT5 prints it: white sheet, Tahoma, labels right-aligned, values bold. */
.mt5-sheet { max-width: 100%; box-sizing: border-box; --ink: #000; --grid: #d9d9d9; --muted: #555; background: #fff; color: #000; border: 1px solid #c9c9c9; border-radius: 6px; padding: 14px 16px 18px; margin: 20px 0; font-family: Tahoma, Verdana, Arial, sans-serif; overflow-x: auto; }
.mt5-title { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.mt5-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 1px; font-size: clamp(10.5px, 1.3vw, 14.5px); line-height: 1.45; }
.mt5-table td { padding: 2px 4px; white-space: normal; overflow-wrap: anywhere; }
.mt5-table td.k { width: 22%; }
.mt5-table td.v { width: 11.3%; }
.mt5-table td.k { text-align: right; color: #000; font-weight: 400; }
.mt5-table td.v { text-align: left; font-weight: 700; }
.mt5-table tr.head td { text-align: center; font-size: 18px; font-weight: 700; padding: 10px 0 6px; }
.mt5-table tr.gap td { height: 10px; }
.mt5-cap { text-align: center; font-size: 16px; font-weight: 700; margin: 14px 0 0; }
.mt5-sheet .chart { margin: 4px 0 8px; }
.mt5-sheet .mt5-legend { color: #333; font-size: 14px; justify-content: center; }
.mt5-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.mt5-note { text-align: center; font-size: 14px; color: #555; margin: 4px 0 10px; }
@media (max-width: 720px) {
  .mt5-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Composer, right side: read-aloud, model, effort, context, send — close together, one small type size. */
#model-btn, button.c-effort { font-size: 13px; }
.c-row .c-speak { margin-right: -2px; }
.c-row > .c-model-wrap:not(.c-left), .c-row > .c-effort, .c-row > .c-meter-wrap { margin: 0 -2px; }

/* Model list like Claude's: small, compact, names with a tick or number key on the right. */
#model-menu { width: auto; min-width: 190px; max-width: min(260px, calc(100vw - 32px)); padding: 6px; border-radius: 14px; font-size: 13px; }
#model-menu li { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 6px 10px; }
#model-menu li[aria-selected="true"] .c-menu-name::after { content: none; }
#model-menu .c-menu-key { color: var(--muted); font-size: 12px; min-width: 1em; text-align: right; }
#model-menu li[aria-selected="true"] .c-menu-key { color: #2f6fde; font-size: 14px; }
.mt5-table td, .mt5-table tr { border: 0 !important; background: none !important; }
#model-menu .c-menu-name { font-weight: 500; white-space: nowrap; }
.mt5-sheet .chart text { fill: #333; font-size: 14px; }
.mt5-grid .chart text { font-size: 22px; }

/* Featured cards: the score and Deposit buttons share the card's beige. */
.pick button.ra, .pick button.pick-deposit, :root[data-theme] .pick button.pick-deposit { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.pick button.ra:hover:not(:disabled), .pick button.pick-deposit:hover:not(:disabled) { background: var(--card-line); }

/* Small note under a number (market cap, APY period). */


/* Terms of Service consent */
.terms-text { max-height: 46vh; overflow-y: auto; margin: 12px 0; padding-right: 6px; }
.terms-text p { margin: 0 0 4px; }
.terms-text > div { margin-bottom: 12px; }
.terms-agree { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 12px; border: 1px solid var(--line, #3334); border-radius: 8px; }
.terms-agree input { margin-top: 3px; width: 18px; height: 18px; flex: none; }

/* Portfolio: total value and its chart */
td.pos { color: #16a34a; }
td.neg { color: #dc2626; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; background: var(--bg-soft, #8882); white-space: nowrap; }
#history-more { margin-top: 8px; }


/* ─── Compact dialogs (Settings, Manage API) and the consent box ─── */
dialog.compact-dialog { width: fit-content; min-width: 300px; max-width: min(460px, calc(100vw - 16px)); }
.compact-dialog .dialog-body { padding: 16px 18px; }
.compact-dialog h2 { font-size: 1.05rem; margin: 0; }
.srows, .api-form { display: grid; gap: 8px; margin: 10px 0 4px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.srow-label { font-size: .9rem; white-space: nowrap; }
.srow select, .srow input, .srow button { width: auto; min-width: 0; padding: 4px 8px; font-size: .88rem; }
.srow input { width: 14em; }
.api-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.api-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.api-pick { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.api-btns { display: flex; gap: 10px; font-size: .85rem; }
.terms-dialog { width: min(440px, calc(100vw - 32px)); }
.terms-head h2 { font-size: 1.5rem; margin: 0 0 12px; font-weight: 600; }
.terms-dialog hr { border: 0; border-top: 1px solid var(--line, #3334); margin: 16px 0; }
.terms-dialog p { margin: 0 0 10px; font-size: .92rem; }
.toggle-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; cursor: pointer; font-size: .92rem; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle { flex: none; width: 54px; height: 30px; border-radius: 15px; background: #bbb; position: relative; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle-row input:checked + .toggle { background: var(--text, #111); }
.toggle-row input:checked + .toggle::after { transform: translateX(24px); }
.toggle-row input:focus-visible + .toggle { outline: 2px solid currentColor; outline-offset: 2px; }
.terms-foot { display: grid; justify-content: flex-end; margin-top: 18px; grid-template-columns: 1fr 1fr; gap: 14px; }
.terms-foot button { padding: 14px; font-size: .95rem; border-radius: 0; }

/* ─── Create a Fund ─── */
.fund-form { max-width: 560px; }
.fund-form .srow input, .fund-form .srow textarea { width: 14em; }

/* ─── Column sort arrows: a thin bold chevron, up or down; none shows the original order ─── */
th .sort { background: none; color: var(--ink); border: 0; padding: 0; border-radius: 0; font-size: 18px; display: inline-flex; align-items: center; gap: 6px; }
th .sort .arrow { display: none; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; }
th .sort[data-dir="down"] .arrow { display: inline-block; transform: translateY(-2px) rotate(45deg); }
th .sort[data-dir="up"] .arrow { display: inline-block; transform: translateY(2px) rotate(-135deg); }

/* ─── Trust: link under the Provider header, and a thin bar under each provider name ─── */

#trust-dialog .api-list li { gap: 24px; }

/* ─── Wide screens: data columns sit further left, so "Risk Analysis" stops short of the search box ─── */
@media (min-width: 721px) {
  #vault-table th:nth-child(2), #vault-table th:nth-child(3), #vault-table th:nth-child(4), #vault-table th:nth-child(5) { width: 12%; }
}

/* ─── Polish: trust bar as wide as the provider name, columns further left, centred search hint, roomier Manage API ─── */

#search:placeholder-shown { text-align: center; }
#search::placeholder { text-align: center; }
dialog#manage-api { min-width: 400px; max-width: min(460px, calc(100vw - 16px)); overflow-x: hidden; }
#manage-api .srow select, #manage-api .srow input { width: 15em; max-width: 100%; text-overflow: ellipsis; }
#manage-api .api-form { margin: 12px 0 8px; }
#manage-api .actions { margin-top: 10px; }
@media (min-width: 721px) {
  #vault-table { table-layout: fixed; width: 100%; }
  #vault-table th:nth-child(2) { width: 10%; }
  #vault-table th:nth-child(3) { width: 12%; }
  #vault-table th:nth-child(4) { width: 14%; }
  #vault-table th:nth-child(5) { width: 13%; }
  #vault-table td:first-child { overflow-wrap: anywhere; }
}
.api-form[hidden], .srow[hidden], .srows [hidden] { display: none !important; }

/* ─── Toolbar: All, Index, Sector, Type, then two icons (Filter, Search); the Filter panel floats ─── */


/* "Provider" sits level with the other column titles; "Trust" hangs below it. */
#vault-table th { vertical-align: middle; position: relative; }

/* ─── Create a Fund: file picker sized to its content ─── */

.file-btn { padding: 8px 14px; font-weight: 800; font-size: .9rem; background: var(--soft, #f3f3f3); border-right: 1px solid var(--line-strong, var(--ink)); white-space: nowrap; }
.file-name { padding: 8px 14px; font-size: .88rem; color: var(--muted, #666); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.fund-form h2 { font-size: 1.05rem; margin: 20px 0 4px; }
.admin-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ─── Financial AI composer: one height for every control, split mic/speaker buttons, round send ─── */
.c-row { align-items: center; gap: 4px; }
.c-row > *, .c-row .c-split { align-self: center; }
button.c-icon, button.c-meter, button.c-model { height: 32px; min-height: 0; }
button.c-icon { width: 32px; border: 0; background: none; border-radius: 8px; }
button.c-icon:hover:not(:disabled) { background: var(--soft); }
button.c-model { padding: 0 8px; display: inline-flex; align-items: center; line-height: 1; }
button.c-meter { width: 32px; }

/* The big square arrow becomes a small round button of the same height. */
.c-split { position: relative; display: inline-flex; align-items: center; flex: none; }
.c-split[hidden] { display: none; }
button.c-dd { width: 18px; height: 32px; min-height: 0; padding: 0; margin-left: -4px; border: 0; background: none; box-shadow: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
button.c-dd:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
button.c-dd svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.c-split .c-menu { right: auto; left: 0; width: min(300px, calc(100vw - 32px)); }
#speak-menu { left: auto; right: 0; }
.c-menu-head { font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 10px 4px; cursor: default; }
.c-menu-head:hover { background: none !important; }
.c-menu-note { font-size: 12px; color: var(--muted); cursor: default; line-height: 1.35; }
.c-menu-note:hover { background: none !important; }
.c-menu li[role="menuitemradio"] .c-menu-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-menu li[role="menuitemradio"][aria-checked="true"] .c-menu-name::after { content: " ✓"; }
.c-menu-switch { padding: 4px 10px; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0; }
.c-menu-switch:hover { background: none !important; }
.c-menu-switch .toggle-row { justify-content: space-between; margin: 4px 0; font-size: 14px; }
@media (max-width: 720px) {
  button.c-icon { width: 30px; }
  button.c-dd { width: 16px; }
}

/* ─── Quick panels: amount with the asset menu inside the same box (no "$", no spinner arrows) ─── */
.quick-amount { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 4px 6px 4px 12px; font-size: 24px; font-weight: 700; }
.quick-amount input::-webkit-outer-spin-button, .quick-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quick-amount input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.quick-amount select.quick-asset { flex: none; width: auto; min-height: 0; padding: 6px 22px 6px 10px; font-size: 14px; font-weight: 700; border: 1px solid var(--line); border-radius: 9px; background-color: var(--soft); color: var(--ink); cursor: pointer; }
.quick-hint { margin: -2px 2px 0; font-size: 12.5px; color: var(--muted); min-height: 1.2em; line-height: 1.35; }

/* ─── Trust bar, one size for every provider: a fixed thin bar with its percentage, centred under the name ─── */
.prov { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }

/* ─── Wallet button: balance + "$" badge on top, address and copy icon underneath ─── */

/* ─── More menu: a name and a short hint per row ─── */

.terms-read { width: min(560px, calc(100vw - 32px)); }
.terms-long { max-height: 62vh; }

/* ─── Create a Fund: cards, two columns, Apply on the right ─── */


#rule.bad { color: #b00020; font-weight: 700; }

/* ─── Send: a small return arrow inside the text box, there only when there is something to send ─── */
.c-input { position: relative; }
.c-input textarea { display: block; padding-right: 40px; }
button.c-send { position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; min-height: 0; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--ink); }
button.c-send:hover:not(:disabled) { background: var(--soft); }
button.c-send:disabled { display: none; }
button.c-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Wallet button: a plain "$", a larger balance, a wider box that shrinks big numbers to fit ─── */
#connect-btn.connected { display: inline-flex; align-items: baseline; justify-content: center; gap: 6px; padding: 6px 14px; border-radius: 16px; line-height: 1.15; width: auto; min-width: 124px; max-width: 200px; font-weight: 800; font-variant-numeric: tabular-nums; }
#connect-btn .wb-bal { font-size: 20px; line-height: 1.1; }
#connect-btn .wb-usd { font-weight: 800; }
.wb-arrow { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: -10px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.wb-arrow[hidden] { display: none !important; }
.wb-arrow svg path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.wb-arrow svg { width: 24px; height: 24px; fill: currentColor; transition: transform .15s; }
.wb-arrow[aria-expanded="true"] svg { transform: rotate(180deg); }
.wb-arrow:hover { background: var(--soft); color: var(--ink); }
.wb-pop { position: fixed; z-index: 60; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 8px 24px rgba(0,0,0,.14); font-size: 16px; font-weight: 600; color: var(--ink); }
.wb-pop[hidden] { display: none !important; }
.wb-pop .wb-addr-text { white-space: nowrap; }
.wb-pop .wb-copy { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; flex: none; }
.wb-pop .wb-copy:hover, .wb-pop .wb-copy:focus-visible { background: var(--soft); color: var(--ink); outline: none; }
.wb-pop .wb-copy svg { width: 17px; height: 17px; fill: currentColor; }

/* ─── Narrow screens: nothing opens wider than the screen ─── */



/* ─── Phones: header room, one "Market Cap" label per row, Trust percentage never clipped ─── */
@media (max-width: 560px) {
  #site-header .brand span { display: none; }
  #connect-btn.connected { padding: 4px 10px; max-width: 150px; }
}
@media (max-width: 720px) {
  #vault-table td[data-label="Provider"] { overflow: visible; text-overflow: clip; }
}

/* ─── Portfolio: cards, a chart with the current point and a hover card, allocation bar ─── */

.change { font-variant-numeric: tabular-nums; }
.change.pos { color: #1a8d3c; } .change.neg { color: #c43030; }
.pf-ranges { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--soft); }
.pf-ranges button { min-height: 32px; padding: 4px 14px; border: 0; border-radius: 999px; background: none; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.pf-ranges button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.value-chart { position: relative; margin-top: 10px; min-height: 240px; }
.value-svg { display: block; width: 100%; height: 240px; touch-action: pan-y; cursor: crosshair; color: #1a8d3c; overflow: visible; }
.value-svg.down { color: #c43030; }
.value-svg .line { stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.value-svg .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.value-svg .tick { fill: var(--muted); font-size: 11.5px; }
.value-svg .now-dot { fill: currentColor; stroke: var(--paper); stroke-width: 2; }
.value-svg .now-halo { fill: currentColor; opacity: .22; animation: pf-pulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.value-svg .now-label { fill: currentColor; font-size: 12px; font-weight: 700; }
.value-svg .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.value-svg .hover-dot { fill: var(--paper); stroke: currentColor; stroke-width: 2.5; }
@keyframes pf-pulse { 0% { transform: scale(.6); opacity: .35; } 100% { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .value-svg .now-halo { animation: none; } }
.chart-tip { position: absolute; z-index: 3; display: flex; flex-direction: column; gap: 1px; padding: 7px 11px; border-radius: 10px; background: #111; color: #fff; font-size: 14px; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.chart-tip .muted { color: #bdbdbd; }
.chart-tip[hidden] { display: none; }
.chart-empty { display: grid; place-items: center; min-height: 200px; }


/* ─── Panels under a button (popover.js): Settings. Page-sized text, closes with ✕, Escape or a press outside. ─── */
.popover { position: fixed; z-index: 60; box-sizing: border-box; width: min(430px, calc(100vw - 16px)); overflow: auto; padding: 14px 18px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2); font-size: 20px; line-height: 1.5; }
.popover[hidden] { display: none !important; }
.popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.popover-head h2 { margin: 0; font-size: 22px; }
.popover-head .icon { flex: none; min-height: 0; padding: 4px 12px; font-size: 18px; }
.popover .srows { gap: 14px; margin: 12px 0 2px; }
.popover .srow { gap: 16px; }
.popover .srow-label { font-size: 20px; }
.popover .srow select, .popover .srow input, .popover .srow button { padding: 6px 12px; font-size: 18px; }
.popover .srow select { min-width: 9em; }
.popover button.linklike { font-size: 18px; }

/* ─── Toolbar and vault rows on phones (final word; earlier phone rules above are kept for the other pages) ─── */
#f-type { display: none !important; }
@media (max-width: 720px) {
  /* One line: All, Savings, Index, Sector, filter icon, search icon. */

  #f-savings { padding: 3px 9px; }
  #f-more, #f-search { width: 34px; min-width: 34px; padding: 0; }

  /* The table: a header row, then each asset as its name and one line of figures, no labels inside the rows. */
  #vault-table { --vt-cols: 48px minmax(0, 0.85fr) minmax(0, 1.25fr) 34px 68px; width: 100%; }
  #vault-table thead { display: block; }
  #vault-table thead tr { display: grid; grid-template-columns: var(--vt-cols); column-gap: 6px; padding: 6px 0 6px; border-bottom: 1px solid var(--line-strong); align-items: end; }
  #vault-table thead th { display: block; min-width: 0; padding: 0; font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; }
  #vault-table thead th:first-child { grid-column: 1 / -1; text-align: left; padding-bottom: 2px; }
  #vault-table thead th.risk-cell { grid-column: 4 / 6; width: auto; text-align: center; }
  #vault-table thead .sort { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; font-size: 12px; font-weight: 700; margin: 0 auto; }

  #vault-table tbody tr { display: grid; grid-template-columns: var(--vt-cols); column-gap: 6px; row-gap: 4px; padding: 10px 0; align-items: center; }
  #vault-table tbody td:first-child { grid-column: 1 / -1; font-size: 16px; }
  #vault-table tbody td:not(:first-child) { display: block; padding: 0; min-width: 0; text-align: center; font-size: 13px; white-space: nowrap; overflow: visible; text-overflow: clip; }
  #vault-table td[data-label]:not(:first-child)::before { content: none !important; display: none; }
  #vault-table td.num { font-weight: 700; }
  #vault-table td[data-label="Provider"] { overflow: visible; }
  #vault-table td[data-label="Provider"] .prov { display: flex; width: 100%; align-items: center; }
  #vault-table td[data-label="Provider"] .prov > span:first-child { max-width: 100%; text-align: center; }
  #vault-table td.risk-cell, #vault-table td.deposit-cell { text-align: center; width: auto; overflow: visible; }
  #vault-table button.ra { min-width: 0; width: 32px; height: 26px; min-height: 0; padding: 0; font-size: 12px; letter-spacing: 0; }
}

/* ─── Phones: the table header sits over its columns and has no lines under it ─── */
@media (max-width: 720px) {
  #vault-table thead th { width: auto !important; border: 0 !important; }
  #vault-table thead th.risk-cell { width: auto !important; }
}

/* ─── Financial AI composer: the controls under the message box are spaced evenly and wrap instead of running out of it ─── */
.c-row { flex-wrap: wrap; row-gap: 2px; column-gap: 4px; }
.c-row > *, .c-row .c-split { flex: none; min-width: 0; }
.c-row > .c-spacer { flex: 1 1 0; min-width: 0; }
.c-row .c-speak { margin-right: 0; }
.c-row > .c-model-wrap:not(.c-left), .c-row > .c-effort, .c-row > .c-meter-wrap { margin: 0; }
.c-row .c-model { max-width: none; }
@media (max-width: 720px) {
  .c-composer { padding: 10px 10px 6px 14px; }
  .c-row { justify-content: space-between; margin-top: 4px; }
  .c-row .c-left .c-model, .c-row .c-model-wrap:not(.c-left) .c-model { max-width: 96px; }
  button.c-model { padding: 0 6px; font-size: 13px; }
  button.c-icon { width: 32px; height: 32px; }
  button.c-dd { width: 18px; margin-left: -2px; }
  button.c-meter { width: 30px; height: 30px; }
  /* Menus never run past the screen edge. */
  .c-menu, .c-meter-pop { max-width: calc(100vw - 24px); }
}
#mode-menu { width: max-content; min-width: 140px; max-width: min(260px, calc(100vw - 24px)); }

/* ─── Phones, round two: header without "Name", all column titles on one line; Trust hangs under Provider; Financial AI's row stays one line ─── */
@media (max-width: 720px) {
  #vault-table thead th:first-child { display: none; }
  #vault-table thead tr { align-items: center; padding: 6px 0 14px; position: relative; }
  #vault-table thead th { position: relative; }

  .c-row { flex-wrap: nowrap; column-gap: 2px; }
  .c-row > *, .c-row .c-split { flex: 0 1 auto; }
  .c-row > .c-spacer { flex: 1 1 0; min-width: 0; }
  .c-row .c-model { max-width: 74px; overflow: hidden; text-overflow: ellipsis; padding: 0 5px; }
  .c-row .c-left .c-model { max-width: 52px; }
  .c-row button.c-icon { width: 30px; }
  .c-row button.c-dd { width: 16px; margin-left: -3px; }
  .c-row button.c-meter { width: 26px; height: 26px; margin: 0; }
  .c-row .c-effort { flex: none; padding: 0 4px; }
  .c-row .c-meter-wrap { flex: none; }
}

/* ─── Support (support.js) and the staff desk (staff.js) ─────────────── */
.sp-launch-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 60; }
.sp-launch-wrap[hidden], .sp-launch-wrap.covered { display: none; }
.sp-launch { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--card-line); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.sp-hide { position: absolute; top: -8px; left: -8px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--card-line); background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.sp-launch-wrap:hover .sp-hide, .sp-hide:focus-visible { opacity: 1; }
@media (hover: none) { .sp-hide { opacity: 1; } }
.sp-launch:hover { background: var(--card-line); }
.sp-launch-ico { font-size: 18px; }
.sp-dot { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: #e5484d; border: 2px solid var(--paper); }
.sp-dot[hidden] { display: none; }
.sp-panel { position: fixed; right: 16px; bottom: 16px; z-index: 61; width: min(410px, calc(100vw - 24px)); height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3); overflow: hidden; }
.sp-panel[hidden] { display: none; }
.sp-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 0 16px; background: var(--paper); }
.sp-top-btns { display: flex; align-items: center; gap: 2px; }
.sp-min { display: inline-flex; align-items: center; justify-content: center; }
.sp-tabs { display: flex; padding: 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.sp-tab { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; font: inherit; font-size: 16px; font-weight: 700; padding: 10px 8px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); cursor: pointer; box-shadow: none; }
.sp-tab:hover:not(:disabled) { background: var(--soft); box-shadow: none; }
.sp-tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.sp-close { font: inherit; font-size: 26px; line-height: 1; width: 36px; height: 36px; padding: 0; margin: 0; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.sp-close:hover { background: var(--grid); color: var(--ink); }
.sp-pane, .sp-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sp-pane[hidden], .sp-chat[hidden], .sp-pane-inner[hidden] { display: none; }
.sp-pane-inner { overflow-y: auto; padding: 16px; }
.sp-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sp-msg { max-width: 86%; font-size: 16px; line-height: 1.45; word-break: break-word; }
.sp-text { white-space: pre-wrap; padding: 9px 13px; border-radius: 14px; }
.sp-me { align-self: flex-end; }
.sp-me .sp-text { background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.sp-them { align-self: flex-start; }
.sp-them .sp-text { background: var(--soft); border-bottom-left-radius: 4px; }
.sp-sys { align-self: center; max-width: 94%; text-align: center; color: var(--muted); font-size: 14px; }
.sp-who { font-size: 12px; color: var(--muted); margin: 0 4px 2px; }
.sp-me .sp-who { text-align: right; }
.sp-typing { color: var(--muted); letter-spacing: 2px; padding: 4px 10px; }
.sp-link { align-self: flex-start; font: inherit; font-size: 15px; font-weight: 700; text-decoration: underline; background: none; border: 0; padding: 2px 0; color: var(--ink); cursor: pointer; text-align: left; }
.sp-depts { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.sp-dept { font: inherit; font-size: 15px; font-weight: 700; text-align: left; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); cursor: pointer; }
.sp-dept:hover { background: var(--soft); border-color: var(--ink); }
.sp-status { margin: 8px 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-size: 15px; }
.sp-status[hidden] { display: none; }
.sp-wait { border-color: var(--line-strong); }
.sp-live { font-weight: 700; }
.sp-note { margin: 0 12px; color: #c0392b; }
.sp-note[hidden] { display: none; }
.sp-composer { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.sp-row { display: flex; align-items: flex-end; gap: 8px; }
.sp-composer textarea { flex: 1; min-width: 0; min-height: 42px; height: 42px; line-height: 1.3; overflow-y: auto; scrollbar-width: none; resize: none; font: inherit; font-size: 16px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 12px; max-height: 120px; background: var(--paper); color: var(--ink); }
.sp-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); width: 42px; height: 42px; padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); cursor: pointer; }
.sp-send { height: 42px; padding: 0 16px; font-size: 16px; }
.sp-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.sp-chip[hidden] { display: none; }
.sp-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.sp-file { display: inline-block; margin-top: 4px; font-size: 14px; }
.sp-img { display: block; max-width: 220px; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); }
.sp-lead { margin: 0 0 14px; font-size: 16px; }
.sp-plans { display: flex; flex-direction: column; gap: 10px; }
.sp-plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); }
.sp-plan strong { font-size: 22px; min-width: 66px; }
.sp-plan-text { flex: 1; font-size: 15px; line-height: 1.3; }
.sp-confirm { padding: 8px 16px; font-size: 16px; }
.sp-error { margin-top: 10px; color: #c0392b; margin-bottom: 8px; }
.sp-error[hidden] { display: none; }
@media (max-width: 600px) {
  .sp-panel { left: 0; right: 0; bottom: 0; width: auto; height: 100dvh; border-radius: 0; border: 0; }
  .sp-launch-wrap { right: 12px; bottom: 12px; }
  .sp-launch { padding: 11px 16px; font-size: 16px; }
}
body[data-page="ai"] .sp-launch-wrap { bottom: 96px; }

.st-main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.st-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; margin-top: 16px; }
.st-grid[hidden] { display: none; }
.st-queue { display: flex; flex-direction: column; gap: 8px; max-height: 75vh; overflow-y: auto; }
.st-item { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); cursor: pointer; }
.st-item.on { border-color: var(--ink); background: var(--soft); }
.st-item.priv { border-left: 4px solid var(--ink); }
.st-thread { border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 420px; max-height: 75vh; padding: 12px; }
.st-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.st-log { padding: 12px 0; }
.st-reply textarea { width: 100%; min-height: 72px; font: inherit; font-size: 16px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); }
.st-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
@media (max-width: 800px) { .st-grid { grid-template-columns: 1fr; } }

.sp-form { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; }
.sp-form[hidden] { display: none; }
.sp-form .sp-lead { margin: 0 0 4px; font-weight: 700; }
.sp-form input { font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); color: var(--ink); min-width: 0; }
.sp-go { width: 100%; margin-top: 4px; }
.sp-form .sp-error { margin: 0; }
.sp-tab-priv { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.sp-count { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-count[hidden] { display: none; }
.sp-plan-text { display: flex; flex-direction: column; }
.sp-plan-text .muted { font-size: 13px; }

.bln-sale, .login-panel { width: min(440px, calc(100vw - 24px)); }
.bln-sale .dialog-head h2 { display: none; }
.bln-sale .dialog-head { justify-content: flex-end; margin: -4px -4px 6px 0; }
.bln-sale .dialog-head .icon { width: 34px; height: 34px; min-width: 0; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 15px; line-height: 34px; box-shadow: none; }
.bln-sale .dialog-head .icon:hover { background: var(--grid); color: var(--ink); box-shadow: none; }
.bln-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.bln-tab { flex: 1; min-width: 0; font: inherit; font-size: 16px; font-weight: 700; padding: 10px 6px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); cursor: pointer; box-shadow: none; white-space: nowrap; }
.bln-tab:hover:not(:disabled) { background: var(--soft); box-shadow: none; }
.bln-tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.bln-cards { margin-bottom: 18px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-line); color: var(--ink); }
.bln-i { flex: none; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: italic 700 14px/1 Georgia, serif; cursor: pointer; box-shadow: none; }
.bln-bar-title { font-weight: 700; margin-bottom: 26px; }
.bln-bar-wrap { margin-bottom: 16px; }
.bln-bar { position: relative; height: 12px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line-strong); }
.bln-fill { height: 100%; border-radius: 6px; background: var(--ink); }
.bln-mark { position: absolute; top: -6px; width: 0; height: 24px; border-left: 2px solid var(--ink); }
.bln-mark span { position: absolute; bottom: 26px; left: 0; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; white-space: nowrap; }
.bln-mark.at-start span { transform: none; left: -2px; }
.bln-mark.at-end span { transform: none; left: auto; right: -2px; }
.bln-bar-ends { display: flex; justify-content: space-between; margin-top: 6px; }
.bln-hint { margin: 0 0 8px; }
.bln-hint[hidden] { display: none; }
.bln-sale input[type=number] { width: 100%; font: inherit; font-size: 20px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); color: var(--ink); }
.bln-status { margin: 10px 0 0; }
.bln-status[hidden], .bln-error[hidden] { display: none; }
.bln-error { color: #c0392b; }
.bln-confirm { width: 100%; height: 48px; margin-top: 14px; font-size: 18px; background: var(--card); border: 1px solid var(--card-line); color: var(--ink); }
.bln-confirm:hover:not(:disabled) { background: var(--card-line); }
@media (max-width: 420px) { .bln-tab { font-size: 14px; padding-left: 2px; padding-right: 2px; } }
.login-list { display: flex; flex-direction: column; gap: 10px; }
.login-wallet { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; font: inherit; font-size: 17px; font-weight: 700; text-align: left; color: var(--ink); text-decoration: none; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); cursor: pointer; }
.login-wallet:hover { background: var(--soft); border-color: var(--ink); }
.login-wallet img { border-radius: 6px; }
@media (max-width: 420px) { .bln-tab { font-size: 14px; padding-left: 2px; padding-right: 2px; } }
.login-body { display: flex; flex-direction: column; gap: 10px; }
.login-back { align-self: flex-start; font: inherit; font-size: 16px; font-weight: 700; background: none; border: 0; padding: 0 0 4px; color: var(--ink); cursor: pointer; }
.login-body input { font: inherit; font-size: 18px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); color: var(--ink); min-width: 0; }
.login-confirm { width: 100%; height: 46px; font-size: 17px; }
.login-confirm[hidden], .login-body input[hidden], .login-body a[hidden] { display: none; }
.account-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.account-label { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bln-mark.at-start span { transform: none; left: -2px; }
.bln-mark.at-end span { transform: none; left: auto; right: -2px; }
@media (max-width: 380px) { .bln-tab { font-size: 13px; letter-spacing: -0.2px; } }
.bln-sale, .login-panel { width: min(560px, calc(100vw - 24px)); }
.bln-summary { margin: 0; line-height: 1.55; font-size: 16px; }
.bln-quick { display: flex; gap: 8px; margin-top: 8px; }
.bln-chip { padding: 4px 14px; font-size: 14px; font-weight: 600; border-radius: 999px; background: var(--paper); }
.login-list .login-wallet { min-height: 52px; }
.bln-sale .dialog-head { display: none; }
.bln-sale .dialog-body { padding-top: 10px; }
.bln-toolbar { display: flex; align-items: center; justify-content: flex-end; margin: 0 0 8px; }
.bln-tools { display: inline-flex; gap: 4px; }
.bln-tool { width: 28px; height: 28px; min-width: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); box-shadow: none; }
.bln-tool:hover:not(:disabled) { background: var(--grid); color: var(--ink); box-shadow: none; }
.bln-i-top { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: italic 700 15px/1 Georgia, serif; cursor: pointer; box-shadow: none; }
.bln-sale.bln-full { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; }
.bln-sale.bln-full .dialog-body { max-width: 760px; margin: 0 auto; padding: 16px; }
.bln-pill { position: fixed; left: 16px; bottom: 16px; z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--card-line); font-weight: 700; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.bln-info { width: min(620px, calc(100vw - 24px)); }
.bln-info-body h3 { margin: 18px 0 4px; font-size: 18px; }
.bln-info-body p { margin: 0 0 6px; line-height: 1.5; font-size: 16px; }
.login-row { display: flex; gap: 8px; }
.login-row input { flex: 1; min-width: 0; }
.login-row .login-confirm { flex: none; width: auto; height: auto; padding: 0 22px; margin: 0; }
.login-code { position: relative; display: flex; flex-direction: column; gap: 4px; }
.login-code input { width: 100%; }
.login-resend { align-self: flex-end; background: none; border: 0; padding: 0; font-weight: 600; color: var(--muted); text-decoration: underline; cursor: pointer; box-shadow: none; }
.login-resend[hidden] { display: none; }
.login-panel .dialog-head { margin: -2px -2px 6px 0; }
.login-panel .dialog-head .icon { width: 30px; height: 30px; min-width: 0; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 14px; line-height: 30px; box-shadow: none; }
.login-panel .dialog-head h2 { font-size: 26px; margin: 0; }
.login-row .login-confirm { padding: 0 16px; }
.bln-info .dialog-head { margin: -2px -2px 0 0; }
.bln-info .dialog-head .icon { width: 30px; height: 30px; min-width: 0; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 14px; line-height: 30px; box-shadow: none; }
.bln-info .dialog-head h2 { font-size: 24px; margin: 0; }
.login-row .login-confirm { background: var(--card); border: 1px solid var(--card-line); color: var(--ink); padding: 0 18px; font-size: 16px; height: 46px; }
.login-row .login-confirm:hover:not(:disabled), .login-signin:hover:not(:disabled) { background: var(--card-line); }
.login-code-row { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.login-body .login-code-input { width: 112px; flex: none; text-align: center; letter-spacing: 6px; font-size: 22px; padding: 8px 10px; }
.login-code { align-items: stretch; }
.login-code-row span { white-space: nowrap; font-size: 16px; }
.bln-paper { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.bln-paper[hidden] { display: none; }
.bln-paper-open { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.bln-paper-dl { align-self: center; color: var(--muted); }
@media (max-width: 520px) { .bln-tab { font-size: 12.5px; padding-left: 1px; padding-right: 1px; } }
@media (max-width: 520px) { .bln-tab { white-space: normal; line-height: 1.15; padding-top: 8px; padding-bottom: 8px; } }
.login-panel { width: min(380px, calc(100vw - 24px)); }
.login-panel .dialog-body { padding: 18px 22px 22px; }
.login-list { gap: 10px; }
.login-list .login-wallet { justify-content: center; text-align: center; min-height: 50px; }
.login-list .login-wallet img { flex: none; }
.login-list p { text-align: center; margin: 0; }
.login-panel { width: min(470px, calc(100vw - 24px)); }
.login-sent { margin: 2px 0 0; color: var(--muted); }
.login-sent[hidden] { display: none; }
.login-row .login-confirm { white-space: nowrap; }
.login-panel { width: min(540px, calc(100vw - 24px)); }
.login-sent.login-ok { color: #1f7a3a; font-weight: 700; }
/* Invest: the trust bar alone, bigger, black, centred, with a larger number. */


.st-setup { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--card-line); border-radius: 12px; background: var(--card); }
.st-setup h2 { margin: 0 0 4px; font-size: 20px; }
.st-method { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--card-line); }
.st-setup form { margin-top: 10px; flex-wrap: wrap; }
.st-setup input { min-width: 260px; }

/* ─── Invest / Multi Fund menus and catalog (mega.js) ───────────────────────── */
.mega { position: fixed; left: 0; right: 0; top: var(--mm-top, 64px); bottom: 0; z-index: 900; background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.08); }
.mega[hidden] { display: none; }
html.mega-open { overflow: hidden; }
.mm-inner { max-width: 1320px; margin: 0 auto; padding: 32px 40px 48px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
.mm-side { position: sticky; top: 0; align-self: start; padding-top: 4px; }
.mm-label { font-size: 12px; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px 12px; text-transform: uppercase; }
.mm-list { list-style: none; margin: 0; padding: 0; }
.mm-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 15px; color: var(--ink); background: none; border: 0; border-left: 3px solid transparent; border-radius: 0; box-shadow: none; padding: 10px 12px; cursor: pointer; text-decoration: none; }
.mm-opt:hover, .mm-opt:focus-visible { background: var(--soft); color: var(--ink); }
.mm-opt[aria-pressed="true"], .mm-opt[aria-expanded="true"] { font-weight: 700; border-left-color: #FF4713; background: var(--soft); }
.mm-opt .mm-chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; opacity: .5; transition: transform .15s; }
.mm-opt[aria-expanded="true"] .mm-chev { transform: rotate(90deg); }
.mm-sublist { list-style: none; margin: 2px 0 6px; padding: 0 0 0 14px; }
.mm-sublist[hidden] { display: none; }
.mm-subopt { font-size: 14px; padding: 7px 12px; color: var(--muted); }
.mm-subopt small { font-size: 12px; color: var(--muted); font-weight: 400; }
.mm-subopt[aria-pressed="true"] { color: var(--ink); }
.mm-side hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.mm-links .mm-opt { font-size: 14px; padding: 8px 12px; }
.mm-all { font-weight: 600; }
.mm-wait { padding: 10px 12px; color: var(--muted); }
.mm-main { min-width: 0; }
.mm-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; min-height: 36px; }
.mm-h { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; outline: 0; }
.mm-count { color: var(--muted); font-size: 14px; }
.mm-back, .mm-mtop { display: none; }
.mm-close { margin-left: auto; align-self: center; background: none; border: 0; box-shadow: none; color: var(--ink); cursor: pointer; padding: 6px; border-radius: 999px; }
.mm-close svg, .mm-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; display: block; }
.mm-close:hover { background: var(--soft); }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 20px; align-content: start; }
.mm-card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 4px; background: var(--paper); transition: box-shadow .15s, transform .15s; }
.mm-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.08); }
.mm-tag { align-self: flex-start; font-size: 12px; font-weight: 600; color: #1a56db; background: #eaf1ff; border-radius: 4px; padding: 5px 10px; }
.mm-img { display: block; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--soft); margin: 10px 0 4px; }
.mm-img img, .mm-img .bn-tile { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-small { margin: 0; text-align: center; font-size: 12px; color: var(--muted); min-height: 16px; }
.mm-tick { font-size: 13px; font-weight: 700; letter-spacing: .02em; min-height: 18px; margin-top: 6px; }
.mm-card h3 { margin: 0; font-size: 19px; line-height: 1.25; }
.mm-card h3 a { color: var(--ink); text-decoration: none; }
.mm-card h3 a::after { content: ""; position: absolute; inset: 0; }   /* the whole card opens the asset */
.mm-stat { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.mm-stat b { color: var(--ink); font-weight: 600; } .mm-stat b.up { color: #0a7a3b; } .mm-stat b.down { color: #b42318; }
.mm-btns { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 14px; }
.mm-pill { display: block; text-align: center; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); background: var(--paper); font-weight: 600; font-size: 14px; text-decoration: none; }
.mm-pill:hover { background: var(--soft); color: var(--ink); }
.mm-pill-dark { background: var(--ink); color: var(--paper); } .mm-pill-dark:hover { background: #FF4713; border-color: #FF4713; color: var(--paper); }
.mm-empty { color: var(--muted); }
.mm-soon { grid-column: 1 / -1; border: 1px dashed var(--line-strong, var(--line)); border-radius: 12px; padding: 56px 24px; text-align: center; background: var(--soft); }
.mm-soon b { display: block; font-size: 22px; margin-bottom: 6px; }
.mm-soon p { margin: 0; color: var(--muted); }
/* Lettered tile for an asset without a photo. */
.bn-tile { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-weight: 800; font-size: clamp(22px, 4vw, 40px); letter-spacing: .04em; color: #fff; background: #111; }
.bn-tile.t-org { background: linear-gradient(135deg, #FF4713, #ff8a3d); } .bn-tile.t-yel { background: linear-gradient(135deg, #f5b700, #ffd84d); color: #111; }
.bn-tile.t-crm { background: #efe6d8; color: #111; } .bn-tile.t-gry { background: linear-gradient(135deg, #4b5563, #9ca3af); } .bn-tile.t-pnk { background: linear-gradient(135deg, #e0567a, #f7a1b5); }
@media (max-width: 760px) {
  .mega { top: 0; z-index: 2000; border-top: 0; }
  .mm-mtop { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 4px; }
  .mm-mtitle { font-size: 20px; font-weight: 800; }
  .mm-mtop .mm-close { position: static; }
  .mm-inner { display: block; padding: 8px 16px 32px; }
  .mm-side { position: static; }
  .mm-side .mm-opt { padding: 14px 8px; font-size: 16px; border-left: 0; border-bottom: 1px solid var(--line); }
  .mm-side .mm-opt[aria-pressed="true"], .mm-side .mm-opt[aria-expanded="true"] { background: none; }
  .mm-sublist { padding-left: 0; margin: 0; }
  .mm-sublist .mm-opt { padding-left: 32px; font-size: 16px; }
  .mm-label { margin: 10px 8px 4px; }
  .mm-main { display: none; }
  .mm-cat.mm-drill .mm-side { display: none; }
  .mm-cat.mm-drill .mm-main { display: block; }
  .mm-head { flex-wrap: wrap; position: sticky; top: 0; background: var(--paper); z-index: 2; padding: 8px 0; margin: 0; }
  .mm-back { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 14px; background: none; border: 0; box-shadow: none; color: var(--ink); padding: 6px 0; cursor: pointer; width: 100%; }
  .mm-h { font-size: 20px; }
  .mm-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .mm-card { padding: 12px; }
  .mm-card h3 { font-size: 16px; }
  .mm-btns { grid-template-columns: 1fr; gap: 6px; }
  .mm-pill { padding: 7px 8px; font-size: 13px; }
  .mm-close { position: absolute; top: 6px; right: 0; }
  .mega .mm-head { position: relative; }
}
/* The site's general button hover (border, shadow) does not apply inside the catalog. */
.mm-cat button:hover:not(:disabled) { box-shadow: none; }
.mm-cat button.mm-opt:hover:not(:disabled) { background: var(--soft); border-color: transparent; border-left-color: transparent; }
.mm-cat button.mm-opt[aria-pressed="true"]:hover:not(:disabled), .mm-cat button.mm-opt[aria-expanded="true"]:hover:not(:disabled) { border-left-color: #FF4713; }
.mm-cat button.mm-close:hover:not(:disabled), .mm-cat button.mm-back:hover:not(:disabled) { background: var(--soft); border-color: transparent; }
@media (max-width: 760px) { .mm-cat .mm-side button.mm-opt:hover:not(:disabled) { border-color: transparent; border-bottom-color: var(--line); background: none; } }


/* ─── Header underline: one source of truth ─────────────────────────────────
   syncNav() (mega.js) puts data-on on exactly one header item: the open panel's button while a panel is open, else
   the current page's link. Nothing else (current page, open state, hover) draws a line. */
#site-header nav button.nav-link { border: 0; border-radius: 0; border-bottom: 3px solid transparent; }
#site-header nav .nav-link:not([data-on]), #site-header nav button.nav-link:not([data-on]):hover:not(:disabled),
:root[data-theme] #site-header nav .nav-link:not([data-on])[aria-current="page"] { border-bottom-color: transparent; }
#site-header nav button.nav-link[data-on]:hover:not(:disabled) { border-bottom-color: var(--ink); }
:root[data-theme] #site-header nav button.nav-link[data-on]:hover:not(:disabled) { border-bottom-color: var(--accent); }
#site-header nav .nav-link:hover:not([data-on]) { color: var(--muted); }
#site-header nav .nav-link[data-on], :root[data-theme] #site-header nav .nav-link[data-on] { border-bottom-color: var(--ink); color: var(--ink); }
:root[data-theme] #site-header nav .nav-link[aria-current="page"]:not([data-on]) { color: inherit; }
:root[data-theme] #site-header nav .nav-link[data-on] { border-bottom-color: var(--accent); color: var(--accent); }

/* ─── No underline under tickers and names (cards, switcher, rows, results) ─ */
.mm-card a, .mm-card a:visited, .ax-card a, .ax-card a:visited, .asset-card a, .as-switch a, .as-trim a, .as-related a, .as-compare a,
.as-hero a:not(.as-num), .bn-tile, .bn-tile *, .pf5 td a, .pf5 a.strong, .np a, .search-results a, .sr a, .cp a.mm-card-link {
  text-decoration: none; }
.mm-card a:hover, .ax-card a:hover, .asset-card a:hover, .as-switch a:hover, .as-trim a:hover, .as-related a:hover, .pf5 td a:hover, .np a:hover { text-decoration: none; opacity: .72; }

/* ─── Nav panels (navpanels.js) ─────────────────────────────────────────── */
.np .mm-links { margin-top: 0; }
.np hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.np .np-body { max-width: 920px; }
.np .np-lead { font-size: 18px; line-height: 1.45; margin: 0 0 18px; max-width: 46ch; }
.np .np-muted { color: var(--muted); }
.np .np-tiny { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.np .np-k { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.np .np-big { display: block; font: 700 40px/1.1 "Inter", sans-serif; letter-spacing: -.02em; }
.np .pos { color: #0a7a3d; } .np .neg { color: #c62828; }
.np .np-pnl { margin: 8px 0 0; font-weight: 700; }
.np .np-card { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--paper); }
.np .np-center { text-align: left; max-width: 520px; }
.np .np-card h3 { margin: 0 0 8px; font-size: 22px; }
.np .np-grid2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.np .np-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.np .np-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font: 700 15px "Inter", sans-serif; cursor: pointer; box-shadow: none; }
.np .np-btn.dark { background: var(--ink); color: var(--paper); }
.np .np-btn:hover { opacity: .85; }
.np .np-arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.np .np-pos { list-style: none; margin: 0; padding: 0; }
.np .np-pos li > * { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.np .np-pos li:last-child > * { border-bottom: 0; }
.np .np-pos small { grid-column: 2; text-align: right; color: var(--muted); }
.np .np-skel { height: 14px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--soft) 25%, var(--line) 50%, var(--soft) 75%); background-size: 200% 100%; animation: np-sh 1.2s infinite linear; }
.np .np-skel.big { height: 36px; } .np .np-skel.inline { display: inline-block; height: 12px; margin: 0; }
.np .w40 { width: 40%; } .np .w70 { width: 70%; } .np .w90 { width: 90%; }
@keyframes np-sh { to { background-position: -200% 0; } }
.np .np-ask { border: 1.5px solid var(--ink); border-radius: 18px; padding: 14px 14px 10px; background: var(--paper); max-width: 680px; }
.np .np-q { display: block; width: 100%; border: 0; resize: none; font: 400 18px/1.4 "Inter", sans-serif; background: none; color: var(--ink); outline: none; padding: 0; min-height: 52px; }
.np .np-ask-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.np .np-icon { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: 600 14px "Inter", sans-serif; box-shadow: none; cursor: pointer; }
.np .np-icon svg, .np .np-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.np .np-send { width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #FF4713; color: #fff; display: grid; place-items: center; box-shadow: none; cursor: pointer; }
.np .np-send:disabled { background: var(--line); color: var(--muted); cursor: default; }
.np .np-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; max-width: 680px; }
.np .np-chip { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: 500 14px "Inter", sans-serif; box-shadow: none; cursor: pointer; }
.np .np-chip:hover:not(:disabled), .np .np-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); }
.np .np-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.np .np-link { font-weight: 700; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; }
.np .np-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; border: 1px solid var(--line); border-radius: 16px; }
.np .np-steps li { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.np .np-steps li:last-child { border-bottom: 0; }
.np .np-steps span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 13px; }
.np .np-mine { margin-top: 22px; }
.np .np-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.np .np-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 44px 20px 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper); }
.np .np-tile b { font-size: 17px; } .np .np-tile span { color: var(--muted); font-size: 14px; }
.np .np-tile .np-arrow { position: absolute; right: 18px; top: 22px; }
.np .np-tile:hover { border-color: var(--ink); opacity: 1; }
.np .np-linkbtn { padding: 0; min-height: 0; border: 0; background: none; box-shadow: none; color: inherit; font: inherit; cursor: pointer; }

/* BLN buy box */
.bln-w { max-width: 440px; border: 1px solid var(--line); border-radius: 22px; padding: 22px; background: var(--paper); }
.bln-w-top { display: flex; align-items: center; gap: 12px; }
.bln-w-top > div { display: flex; flex-direction: column; line-height: 1.2; }
.bln-w-top b { font-size: 18px; } .bln-w-top .np-muted { font-size: 13px; }
.bln-w-mark { width: 40px; height: 40px; border-radius: 50%; background: #FF4713; color: #fff; display: grid; place-items: center; font: 800 18px "Inter", sans-serif; }
.bln-w-price { margin-left: auto; text-align: right; }
.bln-w-amt { display: block; margin: 22px 0 0; padding: 16px 18px; border-radius: 16px; background: var(--soft); position: relative; }
.bln-w-in { display: flex; align-items: baseline; gap: 4px; font: 700 40px/1.1 "Inter", sans-serif; }
.bln-w-in input { flex: 1; min-width: 0; border: 0; background: none; padding: 0; font: inherit; color: var(--ink); outline: none; box-shadow: none; -moz-appearance: textfield; }
.bln-w-in input::-webkit-outer-spin-button, .bln-w-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bln-w-cur { position: absolute; right: 18px; bottom: 20px; font-weight: 700; color: var(--muted); }
.bln-w .bln-w-chips { margin-top: 12px; }
.bln-w-get { margin: 16px 0 0; font-size: 16px; } .bln-w-get b { font-size: 18px; }
.bln-w-bal { margin: 4px 0 0; font-size: 13px; min-height: 18px; }
.bln-w-buy { display: block; width: 100%; min-height: 56px; margin-top: 16px; border: 0; border-radius: 999px; background: #FF4713; color: #fff; font: 800 17px "Inter", sans-serif; cursor: pointer; box-shadow: none; }
.bln-w-buy:hover:not(:disabled) { background: #e83d0b; }
.bln-w-buy.busy { opacity: .7; cursor: progress; }
.bln-w-msg { margin: 10px 0 0; font-size: 14px; } .bln-w-msg.err { color: #c62828; }
.bln-w-done { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--soft); display: flex; flex-direction: column; gap: 4px; }
.bln-w-done b { font-size: 18px; } .bln-w-done .np-row { margin-top: 10px; }
.bln-w-foot { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.bln-w-foot a, .bln-w-foot button { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.np-bln .np-body { display: flex; }
.np-bln .mm-h { display: none; }

@media (max-width: 760px) {
  .np .np-grid2, .np .np-tiles { grid-template-columns: 1fr; }
  .np .np-big { font-size: 34px; }
  .np .np-lead { font-size: 16px; }
  .np .np-q { font-size: 16px; }
  /* BLN: a bottom sheet with the buy box */
  .mega.np-bln { top: auto; max-height: 92vh; border-radius: 22px 22px 0 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .mega.np-bln .mm-back { visibility: hidden; }
  .mega.np-bln .np-body { display: block; }
  .mega.np-bln .bln-w { border: 0; padding: 0 0 12px; max-width: none; }
}
@media (min-width: 761px) { .mm-suball { display: none; } .bln-w-more { display: none; } }

/* ─── v5: header buttons, Settings panel, BLN panel ─────────────────────────── */
.header-actions { align-items: center; gap: 8px; }
.header-actions .icon-btn, #settings-btn, #notify-btn { width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); box-shadow: none; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.header-actions .icon-btn svg { width: 22px; height: 22px; }
.header-actions .icon-btn:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.header-actions .icon-btn:active:not(:disabled) { background: var(--grid); }
.header-actions .icon-btn[aria-expanded="true"] { background: var(--soft); color: #FF4713; }
.header-actions .icon-btn:focus-visible, #connect-btn:focus-visible, .nav-link:focus-visible { outline: 2px solid #FF4713; outline-offset: 2px; }
#settings-btn svg.line, #settings-btn svg.line path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#connect-btn:not(.connected) { height: 44px; min-height: 44px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center; }
.buy-bln { font: inherit; font-weight: 700; }
@media (max-width: 760px) {
  .header-actions { gap: 4px; }
  .header-actions .icon-btn, #settings-btn, #notify-btn { width: 40px; height: 40px; }
  .header-actions .icon-btn svg { width: 20px; height: 20px; }
  #connect-btn:not(.connected) { height: 40px; min-height: 40px; padding: 0 14px; }
}

.popover.settings-pop { width: 360px; max-width: calc(100vw - 16px); padding: 16px 18px 18px; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 18px 48px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.06); font: 15px/1.4 Inter, system-ui, sans-serif; }
.settings-pop .popover-head { margin: 0 0 4px; }
.settings-pop .popover-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.settings-pop .popover-head .icon { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 14px; box-shadow: none; display: inline-flex; align-items: center; justify-content: center; }
.settings-pop .popover-head .icon:hover { color: var(--ink); background: var(--grid); }
.settings-pop .s-groups { display: flex; flex-direction: column; gap: 6px; }
.settings-pop .s-group { padding: 12px 0 4px; border-top: 1px solid var(--line); }
.settings-pop .s-group:first-child { border-top: 0; padding-top: 6px; }
.settings-pop .s-label { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.settings-pop .srows { display: contents; }
.settings-pop .srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.settings-pop .srow + .srow { margin-top: 4px; }
.settings-pop .srow-label { font-size: 15px; font-weight: 500; color: var(--ink); }
.settings-pop .srow select { min-width: 0; width: 170px; height: 36px; padding: 0 10px; font-size: 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.settings-pop .srow button { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 999px; }
.settings-pop .srow button.linklike { height: auto; padding: 0; border-radius: 0; font-size: 14px; }
.settings-pop .account-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.settings-pop .account-label { font-size: 14px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.seg button, .settings-pop .srow .seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; box-shadow: none; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover:not(:disabled) { color: var(--ink); background: none; box-shadow: none; }
.seg button[aria-pressed="true"], .settings-pop .srow .seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.seg .sw { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }
@media (max-width: 600px) {
  .popover.settings-pop { z-index: 2100; left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: 100%; max-height: 85vh !important; border-radius: 18px 18px 0 0; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0,0,0,.2); }
  .settings-pop .srow select { width: 160px; }
}

/* BLN panel: one title, the tabs, the key figure, the amount and one action. */
.bln-sale { border-radius: 16px; font-family: Inter, system-ui, sans-serif; }
.bln-sale .dialog-body { padding: 14px 20px 20px; }
.bln-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.bln-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.bln-head .bln-toolbar { margin: 0; }
.bln-tab { font-size: 14px; font-weight: 600; }
.bln-tab.on { border-bottom-color: #FF4713; }
.bln-cards { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; }
.bln-summary { font-size: 14px; font-weight: 600; }
.bln-bar-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.bln-sale input[type=number] { height: 48px; padding: 0 14px; font-size: 17px; border-radius: 12px; }
.bln-chip { height: 30px; padding: 0 12px; font-size: 13px; border: 1px solid var(--line-strong); }
.bln-confirm { height: 48px; border-radius: 999px; background: var(--ink); color: var(--paper); border: 0; font-size: 16px; font-weight: 700; }
.bln-confirm:hover:not(:disabled) { background: #FF4713; color: #fff; }
.bln-foot { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.bln-foot a { color: var(--ink); font-weight: 600; }
@media (max-width: 600px) {
  dialog.bln-sale:not(.bln-full) { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; }
}

/* ─── v5: entry Terms panel (terms only) and the Login panel ─── */
dialog.tg, dialog.lp { width: min(440px, calc(100vw - 24px)); border-radius: 20px; font-family: "Inter", system-ui, sans-serif; box-shadow: 0 32px 80px rgba(0,0,0,.28); }
dialog.tg::backdrop, dialog.lp::backdrop { background: rgba(10,10,10,.5); backdrop-filter: blur(3px); }
dialog.tg[open], dialog.lp[open] { animation: bn-pop .18s ease-out; }
@keyframes bn-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.tg[open], dialog.lp[open] { animation: none; } }
.tg-mark, .lp-mark { display: flex; align-items: center; gap: 10px; font: 800 18px/1 "Inter Tight", "Inter", sans-serif; letter-spacing: -0.01em; color: var(--ink); }
.tg-mark img, .lp-mark img { border-radius: 8px; }

.tg .tg-body { padding: 28px 28px 24px; display: flex; flex-direction: column; }
.tg .terms-head h2 { margin: 24px 0 0; font: 700 26px/1.15 "Inter Tight", "Inter", sans-serif; letter-spacing: -0.015em; }
.tg .tg-lead { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.tg .tg-read { align-self: flex-start; min-height: 0; margin: 12px 0 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--ink); font: 600 14px "Inter", sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tg .tg-read:hover { background: none; color: var(--ink); opacity: .75; }
.tg .tg-text { max-height: 220px; overflow-y: auto; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.tg .tg-text p { margin: 0 0 6px; font-size: 13px; }
.tg .tg-agree { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; }
.tg .tg-agree .toggle-row { margin: 0; align-items: flex-start; font-size: 14px; line-height: 1.45; font-weight: 600; }
.tg .tg-agree .toggle { margin-top: 1px; }
.tg .toggle-row .toggle { flex: none; }
.tg .tg-sub { margin: 20px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tg .tg-body > .toggle-row { margin: 8px 0; font-size: 14px; color: var(--muted); }
.tg .tg-foot { display: flex; gap: 10px; margin-top: 22px; }
.tg .tg-foot button { min-height: 48px; border-radius: 999px; font: 600 15px "Inter", sans-serif; padding: 0 22px; }
.tg .tg-foot .tg-no { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.tg .tg-foot .tg-ok { flex: 1; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.tg .tg-foot .tg-ok:disabled { opacity: .35; cursor: not-allowed; }

.lp .lp-in { position: relative; padding: 28px 28px 22px; display: flex; flex-direction: column; gap: 0; }
.lp .lp-x { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 36px; height: 36px; min-height: 0; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); box-shadow: none; cursor: pointer; }
.lp .lp-x:hover { border-color: var(--ink); background: var(--paper); }
.lp .lp-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.lp h2 { margin: 24px 0 0; font: 700 28px/1.15 "Inter Tight", "Inter", sans-serif; letter-spacing: -0.015em; }
.lp .lp-sub { margin: 6px 0 20px; font-size: 15px; color: var(--muted); }
.lp .login-body { gap: 0; }
.lp .login-list { gap: 10px; }
.lp .login-list .login-wallet, .lp .lp-method { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 52px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); color: var(--ink); font: 600 15.5px "Inter", sans-serif; text-align: left; box-shadow: none; transition: border-color .15s, background .15s; }
.lp .login-list .login-wallet:hover, .lp .lp-method:hover { border-color: var(--ink); background: var(--soft); }
.lp .login-wallet:focus-visible, .lp .lp-x:focus-visible, .lp .lp-terms a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lp .login-wallet span { flex: 1; }
.lp .login-wallet img { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.lp .lp-tag { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600; }
.lp .lp-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lp .lp-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 13px; color: var(--muted); }
.lp .lp-or::before, .lp .lp-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.lp .lp-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lp .lp-methods .lp-method { min-height: 48px; font-size: 14.5px; padding: 0 14px; gap: 10px; }
.lp .lp-methods .lp-method:last-child:nth-child(odd) { grid-column: 1 / -1; justify-content: center; }
.lp .lp-methods .lp-method:last-child:nth-child(odd) span { flex: none; }
.lp .bln-error { margin: 12px 0 0; }
.lp .login-back { align-self: flex-start; margin-bottom: 12px; }
.lp .login-row { display: flex; gap: 8px; }
.lp .login-row input { flex: 1; min-height: 48px; }
.lp .login-confirm { min-height: 48px; border-radius: 12px; padding: 0 18px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); font-weight: 600; }
.lp .lp-terms { margin: 20px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.lp .lp-terms a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 560px) {
  dialog.lp, dialog.tg { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  dialog.lp[open], dialog.tg[open] { animation-name: bn-up; }
  @keyframes bn-up { from { transform: translateY(32px); opacity: 0; } }
  .lp .lp-in, .tg .tg-body { padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); }
  .lp h2, .tg .terms-head h2 { margin-top: 18px; font-size: 24px; }
  .lp .lp-x { top: 14px; right: 14px; }
}

/* v8: Risk score and Risk level (risk-ui.js), on cards, asset pages and the methodology page. */
.lv-very-low, .lv-low { --lv: #0a7a3b; } .lv-medium-low, .lv-medium { --lv: #8a6d00; } .lv-medium-high { --lv: #b25500; } .lv-high, .lv-very-high { --lv: #b42318; }
.mm-risk { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.35; text-align: center; }
.mm-risk b { color: var(--ink); font-weight: 600; }
.mm-rk-level b { color: var(--lv, var(--ink)); }
.mm-risk i { font-style: normal; }
.as-score small[class^="lv-"] { color: var(--lv); }
.rk-card { border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 18px; padding: 28px; background: var(--paper); }
.rk-top { display: grid; grid-template-columns: auto 1fr 1fr; gap: 28px; align-items: center; }
.rk-gauge { --v: 0; width: 112px; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--paper) 78%, transparent 79%), conic-gradient(#FF4713 calc(var(--v) * 1%), var(--soft, #eee) 0); }
.rk-gauge b { font: 800 34px/1 var(--hm-fh, "Inter Tight", sans-serif); } .rk-gauge small { color: var(--muted); font-size: 12px; }
.rk-k { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rk-v { margin: 2px 0 4px; font: 800 28px/1.15 var(--hm-fh, "Inter Tight", sans-serif); color: var(--lv, var(--ink)); }
.rk-v i { font: 600 15px "Inter", sans-serif; color: var(--muted); font-style: normal; }
.rk-n { margin: 0; font-size: 14px; color: var(--muted); }
.rk-scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px 0 8px; max-width: 280px; }
.rk-scale span { height: 8px; border-radius: 4px; background: var(--soft, #eee); }
.rk-scale span.on { background: var(--lv, #FF4713); }
.rk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line, rgba(0,0,0,.12)); }
.rk-cols h3 { margin: 0 0 8px; font-size: 18px; }
.rk-why { margin: 0; padding-left: 18px; } .rk-why li { margin: 4px 0; font-size: 16px; }
.rk-foot { margin: 20px 0 0; font-size: 14px; color: var(--muted); } .rk-foot a { color: inherit; }
@media (max-width: 760px) {
  .rk-card { padding: 20px; }
  .rk-top { grid-template-columns: auto 1fr; gap: 16px; } .rk-top > .rk-head:last-child { grid-column: 1 / -1; }
  .rk-gauge { width: 86px; } .rk-gauge b { font-size: 26px; }
  .rk-cols { grid-template-columns: 1fr; gap: 18px; }
}

/* The Risk score methodology page (risk-methodology.html). */
.rm { font-family: "Inter", system-ui, sans-serif; font-size: 17px; line-height: 1.65; }
main.rm { max-width: none; margin: 0; padding: 0; }
.rm h1, .rm h2, .rm h3 { font-family: var(--hm-fh, "Inter Tight", "Inter", sans-serif); letter-spacing: -0.015em; }
.rm-hero { background: #0b0b0b; color: #fff; padding: 96px 40px 80px; }
.rm-hero-in, .rm-body { max-width: 1080px; margin: 0 auto; }
.rm-hero .as-eyebrow { color: #FF4713; }
.rm-hero h1 { margin: 0 0 16px; font-size: clamp(36px, 5vw, 64px); line-height: 1.04; font-weight: 800; }
.rm-hero p { max-width: 760px; font-size: 19px; color: rgba(255,255,255,.78); margin: 0; }
.rm-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 40px; background: rgba(255,255,255,.18); border-radius: 14px; overflow: hidden; }
.rm-facts div { background: #151515; padding: 20px 22px; } .rm-facts b { display: block; font: 800 30px/1.1 var(--hm-fh, "Inter Tight", sans-serif); } .rm-facts span { color: rgba(255,255,255,.7); font-size: 15px; }
.rm-nav { position: sticky; top: 0; z-index: 5; background: #0b0b0b; border-top: 1px solid rgba(255,255,255,.12); }
.rm-nav ul { display: flex; gap: 26px; max-width: 1080px; margin: 0 auto; padding: 0 40px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.rm-nav a { display: block; padding: 15px 0; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.rm-nav a:hover { color: #FF4713; }
.rm-body { padding: 24px 40px 96px; }
.rm-sec { padding: 56px 0 8px; scroll-margin-top: 56px; border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); }
.rm-sec:last-child { border-bottom: 0; }
.rm-sec h2 { margin: 0 0 14px; font-size: clamp(26px, 3vw, 40px); line-height: 1.1; font-weight: 800; }
.rm-sec h3 { margin: 26px 0 8px; font-size: 20px; }
.rm-sec p, .rm-sec li { max-width: 820px; }
.rm-formula { margin: 16px 0; padding: 18px 22px; border-radius: 12px; background: var(--soft, #f2f2f2); font: 500 15.5px/1.7 ui-monospace, "SFMono-Regular", Menlo, monospace; overflow-x: auto; white-space: pre; }
.rm-table { border-collapse: collapse; width: 100%; max-width: 820px; margin: 14px 0; font-size: 15.5px; }
.rm-table th, .rm-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); vertical-align: top; }
.rm-table th { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rm-table td.lvl { font-weight: 700; color: var(--lv); white-space: nowrap; }
.rm-wrap { overflow-x: auto; }
.rm-note { color: var(--muted); font-size: 15px; }
@media (max-width: 760px) {
  .rm-hero { padding: 64px 18px 48px; } .rm-facts { grid-template-columns: 1fr; }
  .rm-nav ul { padding: 0 18px; gap: 18px; } .rm-body { padding: 8px 18px 64px; }
  .rm-sec { padding-top: 40px; } .rm-formula { font-size: 13px; padding: 14px; }
}
