/* Product pass: one quiet financial language across the public and app routes.
   Presentation only. Market data, wallet state, routes and contract calls are unchanged. */
body.app-mode {
  --product-space: clamp(20px, 3vw, 48px);
  font-family: Inter, Geist, "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
body.app-mode :is(h1,h2,h3,p,dt,dd,th,td,button,input,select,a) { font-family: Inter, Geist, "Segoe UI", Arial, sans-serif; }
body.app-mode :is(h1,h2,h3) { color: var(--sc-text); }
body.app-mode :is(button,a,input,select,summary):focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
body.app-mode :is(.home-shell,.app-shell,.dashboard-shell,.learn-shell) { overflow-x: clip; }

/* The existing company marks make the loan flow identifiable at a glance. */
html[data-site-route="home"] body.app-mode .home-loan-drawing .drawing-logo-back {
  fill: #fff;
  stroke: var(--sc-border);
  stroke-width: .7;
}
html[data-site-route="home"] body.app-mode .home-loan-drawing .drawing-token {
  font-size: 10px;
  font-weight: 650;
}
html[data-site-route="home"] body.app-mode .home-loan-drawing .drawing-logo {
  animation: sc-diagram-logo-in .65s both;
}
html[data-site-route="home"] body.app-mode .home-loan-drawing .drawing-logo-apple { animation-delay: .18s; }
html[data-site-route="home"] body.app-mode .home-loan-drawing .drawing-logo-nvidia { animation-delay: .36s; }
html[data-site-route="home"] body.app-mode .home-loan-drawing .drawing-line {
  stroke-dasharray: 7 8;
  animation: sc-diagram-flow 3.8s linear infinite;
}
html[data-site-route="home"] body.app-mode .home-loan-drawing .drawing-arrow {
  animation: sc-diagram-arrow 2.4s ease-in-out infinite;
}
@keyframes sc-diagram-logo-in {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes sc-diagram-flow {
  from { stroke-dashoffset: 30; }
  to { stroke-dashoffset: 0; }
}
@keyframes sc-diagram-arrow {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}

/* Place live terms in the open part of the hero. The right column is a single
   explanatory illustration, rather than a second set of paragraph cards. */
html[data-site-route="home"] body.app-mode .home-lead-copy {
  padding-top: clamp(34px, 4vw, 58px);
  padding-bottom: 24px;
}
html[data-site-route="home"] body.app-mode .home-caution {
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
}
html[data-site-route="home"] body.app-mode .home-market-tape {
  display: block;
  width: 100%;
  margin: 31px 0 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--sc-border);
  background: transparent;
}
html[data-site-route="home"] body.app-mode .home-market-tape-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 15px 0 10px;
}
html[data-site-route="home"] body.app-mode .home-market-tape-heading strong { font-size: 15px; }
html[data-site-route="home"] body.app-mode .home-market-tape-heading span { font-size: 12px; }
html[data-site-route="home"] body.app-mode .home-market-tape-rows {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  border-top: 1px solid var(--sc-border);
  border-bottom: 0;
}
html[data-site-route="home"] body.app-mode .home-market-tape-row,
html[data-site-route="home"] body.app-mode .home-market-tape-row:first-child {
  min-height: 58px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--sc-border);
  transition: background-color .15s ease, padding-left .15s ease;
}
html[data-site-route="home"] body.app-mode .home-market-tape-row + .home-market-tape-row { border-left: 0; }
html[data-site-route="home"] body.app-mode .home-market-tape-row:hover,
html[data-site-route="home"] body.app-mode .home-market-tape-row:first-child:hover {
  padding-left: 6px;
  background: var(--sc-surface);
}
html[data-site-route="home"] body.app-mode .home-market-tape-mark { flex-basis: 34px; width: 34px; height: 34px; }
html[data-site-route="home"] body.app-mode .home-market-tape-mark img { width: 30px; height: 30px; }
html[data-site-route="home"] body.app-mode .home-market-tape-asset strong { font-size: 14px; }
html[data-site-route="home"] body.app-mode .home-market-tape-asset small,
html[data-site-route="home"] body.app-mode .home-market-tape-quote small { font-size: 12px; }
html[data-site-route="home"] body.app-mode .home-market-tape-quote strong { font-size: 19px; }
html[data-site-route="home"] body.app-mode .home-market-tape-all { display: inline-block; margin-top: 13px; }
html[data-site-route="home"] body.app-mode .home-activity-strip { display:flex; flex-wrap:wrap; align-items:center; gap:0; margin-top:18px; color:var(--sc-muted); font-size:12px; font-weight:650; letter-spacing:.055em; line-height:1.4; text-transform:uppercase; font-variant-numeric:tabular-nums; }
html[data-site-route="home"] body.app-mode .home-activity-strip > p:not([hidden]) { display:inline-flex; align-items:center; gap:6px; margin:0; padding:0; color:var(--sc-muted); font-size:12px; font-weight:650; letter-spacing:.055em; }
html[data-site-route="home"] body.app-mode .home-activity-strip > p:not([hidden]) ~ p:not([hidden])::before { content:"·"; margin:0 10px; color:var(--sc-muted); }
html[data-site-route="home"] body.app-mode .home-activity-strip strong { color:var(--sc-text); font-size:13px; font-weight:750; letter-spacing:0; }
html[data-site-route="home"] body.app-mode .home-online-count strong { color:var(--sc-success); }
html[data-site-route="home"] body.app-mode .home-loan-plate { display: flex; flex-direction: column; }
html[data-site-route="home"] body.app-mode .home-loan-drawing {
  display: grid;
  align-content: center;
  flex: 1 1 auto;
  min-height: 260px;
  margin: 0;
  padding: clamp(26px, 5vw, 68px) 0;
  border-bottom: 0;
}
html[data-site-route="home"] body.app-mode .home-loan-drawing svg { max-width: 520px; margin: 0 auto; }
html[data-site-route="home"] body.app-mode .home-loan-summary {
  padding: 20px 0 27px;
  border-top: 1px solid var(--sc-border);
}
html[data-site-route="home"] body.app-mode .home-loan-summary strong { color: var(--sc-text); font-size: 18px; font-weight: 630; }
html[data-site-route="home"] body.app-mode .home-loan-summary p {
  max-width: 410px;
  margin: 7px 0 12px;
  color: var(--sc-muted);
  font-size: 13px;
  line-height: 1.55;
}
html[data-site-route="home"] body.app-mode .home-loan-summary a { color: var(--sc-accent); font-size: 13px; font-weight: 650; text-decoration: none; }
html[data-site-route="home"] body.app-mode .home-loan-summary a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  html[data-site-route="home"] body.app-mode .home-market-tape { margin-top: 25px; padding: 0; }
  html[data-site-route="home"] body.app-mode .home-loan-drawing { min-height: 220px; padding: 22px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-site-route="home"] body.app-mode .home-market-tape-row { transition: none; }
}

/* HOME — terms, context, and a concrete next action share one visual cadence. */
html[data-site-route="home"] body.app-mode .home-stocks {
  padding-bottom: 24px;
}
html[data-site-route="home"] body.app-mode .home-stocks-heading {
  align-items: end;
  gap: 24px;
}
html[data-site-route="home"] body.app-mode .home-coming-soon {
  display: grid;
  grid-template-columns: 120px repeat(2, minmax(0,1fr));
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--sc-border);
}
html[data-site-route="home"] body.app-mode .home-coming-soon[hidden] { display: none; }
html[data-site-route="home"] body.app-mode .home-coming-soon > strong {
  color: var(--sc-muted);
  font-size: 12px;
  font-weight: 600;
}
html[data-site-route="home"] body.app-mode .home-coming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
}
html[data-site-route="home"] body.app-mode .home-coming-item .home-asset { min-width: 0; gap: 9px; }
html[data-site-route="home"] body.app-mode .home-coming-item .home-asset span:last-child { display: grid; gap: 1px; }
html[data-site-route="home"] body.app-mode .home-coming-item .home-asset strong {
  color: var(--sc-text);
  font-size: 13px;
  font-weight: 550;
}
html[data-site-route="home"] body.app-mode .home-coming-item .home-asset small { color: var(--sc-muted); font-size: 12px; }
html[data-site-route="home"] body.app-mode .home-coming-badge {
  flex: none;
  color: var(--sc-muted);
  font-size: 12px;
}
@media (max-width: 1100px) {
  html[data-site-route="home"] body.app-mode .home-calculator {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
  html[data-site-route="home"] body.app-mode .home-calculator-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    column-gap: 28px;
  }
  html[data-site-route="home"] body.app-mode .home-calculator-results > div { min-width: 0; }
  html[data-site-route="home"] body.app-mode .home-calculator-results dd { overflow-wrap: anywhere; }
}
html[data-site-route="home"] body.app-mode .home-risk {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, .88fr);
  gap: 0 clamp(28px, 5vw, 96px);
  margin-top: 40px;
  padding: 32px clamp(24px, 3vw, 48px) 0;
  border: 1px solid var(--sc-border);
  border-radius: 4px;
  background: var(--sc-surface);
}
html[data-site-route="home"] body.app-mode .home-risk > div:first-child {
  padding-bottom: 32px;
}
html[data-site-route="home"] body.app-mode .home-risk h2 {
  margin: 0 0 14px;
  font: 620 clamp(25px, 2.4vw, 34px)/1.14 Inter, Geist, "Segoe UI", Arial, sans-serif !important;
  letter-spacing: -.03em;
}
html[data-site-route="home"] body.app-mode #homeRiskExample {
  max-width: 670px;
  margin: 0;
  color: var(--sc-text);
  font-size: 15px;
  line-height: 1.58;
}
html[data-site-route="home"] body.app-mode .home-risk-bars {
  max-width: 540px;
  margin-top: 28px;
  gap: 13px;
}
html[data-site-route="home"] body.app-mode .home-risk-bars > span {
  grid-template-columns: 112px minmax(0, 1fr);
  color: var(--sc-muted);
  font-size: 13px;
}
html[data-site-route="home"] body.app-mode .home-risk-bars i {
  height: 10px;
  border-radius: 2px;
}
html[data-site-route="home"] body.app-mode .home-risk-bars > span:first-child i {
  background: color-mix(in srgb, var(--sc-accent) 55%, var(--sc-border));
}
html[data-site-route="home"] body.app-mode .home-risk-bars > span:nth-child(2) i {
  background: var(--sc-warning);
}
html[data-site-route="home"] body.app-mode .home-risk-copy {
  align-self: start;
  padding: 7px 0 32px;
}
html[data-site-route="home"] body.app-mode .home-risk-copy p {
  max-width: 370px;
  margin: 0 0 20px;
  color: var(--sc-muted);
  font-size: 15px;
  line-height: 1.62;
}
html[data-site-route="home"] body.app-mode .home-risk-copy a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--sc-accent);
  font-size: 14px;
  font-weight: 620;
  text-underline-offset: 4px;
}
html[data-site-route="home"] body.app-mode .home-contracts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 150px repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px 24px;
  max-width: none;
  padding: 18px 0 20px;
  border: 0;
  border-top: 1px solid var(--sc-border);
}
html[data-site-route="home"] body.app-mode .home-contracts > span {
  color: var(--sc-muted);
  font-size: 13px;
  font-weight: 600;
}
html[data-site-route="home"] body.app-mode .home-contracts a {
  width: fit-content;
  color: var(--sc-text);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
}
html[data-site-route="home"] body.app-mode .home-contracts a:hover { color: var(--sc-accent); text-decoration: underline; text-underline-offset: 3px; }
html[data-site-route="home"] body.app-mode .home-contracts a[hidden] { display: none; }
html[data-site-route="home"] body.app-mode .home-contracts small {
  grid-column: 2 / -1;
  margin: 2px 0 0;
  color: var(--sc-muted);
  font-size: 12px;
  line-height: 1.5;
}
html[data-site-route="home"] body.app-mode .home-lending {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, .28fr) auto;
  align-items: center;
  gap: clamp(20px, 3vw, 52px);
  margin-top: 0;
  padding: 32px clamp(24px, 3vw, 48px) 33px;
  border: 0;
  border-bottom: 1px solid var(--sc-border);
  border-radius: 0;
  background: transparent;
}
html[data-site-route="home"] body.app-mode .home-lending-copy { min-width: 0; }
html[data-site-route="home"] body.app-mode .home-lending .home-kicker {
  margin: 0 0 5px;
  color: var(--sc-muted);
  font-size: 12px;
  font-weight: 600;
}
html[data-site-route="home"] body.app-mode .home-lending h2 {
  margin: 0 0 8px;
  font: 620 25px/1.15 Inter, Geist, "Segoe UI", Arial, sans-serif !important;
  letter-spacing: -.025em;
}
html[data-site-route="home"] body.app-mode .home-lending p:not(.home-kicker) {
  max-width: 610px;
  margin: 0;
  color: var(--sc-muted);
  font-size: 14px;
  line-height: 1.56;
}
html[data-site-route="home"] body.app-mode .home-lending-quote {
  gap: 2px;
  padding-left: 22px;
  border-left: 1px solid var(--sc-border);
}
html[data-site-route="home"] body.app-mode .home-lending-quote > span { color: var(--sc-muted); font-size: 12px; }
html[data-site-route="home"] body.app-mode .home-lending-quote > strong { color: var(--sc-text); font-size: 27px; line-height: 1.15; }
html[data-site-route="home"] body.app-mode .home-lending-quote > small { color: var(--sc-muted); font-size: 12px; }
html[data-site-route="home"] body.app-mode .home-lending-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--sc-border);
  border-radius: 4px;
  color: var(--sc-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
html[data-site-route="home"] body.app-mode .home-lending-link:hover { background: var(--sc-raised); color: var(--sc-text); }
html[data-site-route="home"] body.app-mode .home-lending-link span { margin-left: 10px; color: var(--sc-muted); }

/* Shared footer: navigational utility, not a second marketing section. */
body.app-mode .site-footer {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr);
  gap: 18px clamp(32px, 7vw, 120px);
  align-items: start;
  margin-top: 36px;
  padding: 28px 0 32px;
  border-top: 1px solid var(--sc-border);
}
body.app-mode .site-footer .footer-brand { display: inline-flex; align-items: center; gap: 10px; }
body.app-mode .site-footer .footer-brand b { color: var(--sc-text); font-size: 15px; font-weight: 650; }
body.app-mode .site-footer .footer-mark, body.app-mode .site-footer .brand-logo { width: 30px; height: 30px; }
body.app-mode .site-footer p { max-width: 310px; margin: 10px 0 0; color: var(--sc-muted); font-size: 13px; line-height: 1.5; }
body.app-mode .site-footer .footer-navigation {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 22px;
}
body.app-mode .site-footer .footer-navigation :is(a,button) {
  justify-self: start;
  min-height: 25px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sc-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
}
body.app-mode .site-footer .footer-navigation :is(a,button):hover { color: var(--sc-accent); text-decoration: underline; text-underline-offset: 3px; }
body.app-mode .site-footer .footer-disclaimer {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 15px;
  border-top: 1px solid var(--sc-border);
  color: var(--sc-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

/* MARKETS — a compact information header and an uncluttered trading ledger. */
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) .app-heading {
  margin-bottom: 20px;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) .app-heading h1 {
  margin: 6px 0 4px;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 630;
  letter-spacing: -.035em;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics {
  padding-block: 20px !important;
  border-bottom: 1px solid var(--sc-border) !important;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) .market-toolbar {
  margin-top: 22px;
  padding: 0 0 19px;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) .explore-switch {
  border-bottom: 1px solid var(--sc-border);
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) .market-risk-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 20px;
  padding: 13px 17px;
  border-radius: 3px;
  border-left: 3px solid var(--sc-warning);
  background: var(--sc-surface);
  color: var(--sc-text);
  font-size: 13px;
  line-height: 1.5;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) .market-risk-note a { flex: none; font-weight: 600; }
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #stockListPanel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketlist .table { border-top: 1px solid var(--sc-border); }
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketlist .table th { padding-block: 15px; font-size: 12px; font-weight: 600; }
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketlist .table td { padding-block: 16px; font-size: 14px; }
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketlist .table .asset strong { font-size: 14px; }

/* DASHBOARD — portfolio value and account health have a different weight from supporting totals. */
html[data-site-route="dashboard"] body.app-mode .dashboard-heading { margin-bottom: 28px; }
html[data-site-route="dashboard"] body.app-mode .dashboard-heading h1 { font-size: 28px; letter-spacing: -.025em; }
html[data-site-route="dashboard"] body.app-mode .dashboard-summary {
  grid-template-columns: 1.35fr 1fr 1fr .95fr;
  gap: 0;
  border-top: 1px solid var(--sc-border);
  border-bottom: 1px solid var(--sc-border);
}
html[data-site-route="dashboard"] body.app-mode .dashboard-summary-card {
  min-height: 126px;
  padding: 20px 22px !important;
}
html[data-site-route="dashboard"] body.app-mode .dashboard-summary-card:first-child { padding-left: 0 !important; }
html[data-site-route="dashboard"] body.app-mode .dashboard-summary-card:first-child strong { font-size: clamp(30px, 2.7vw, 38px); }
html[data-site-route="dashboard"] body.app-mode .dashboard-summary-card strong { margin-top: 15px; font-size: 25px; }
html[data-site-route="dashboard"] body.app-mode .dashboard-positions,
html[data-site-route="dashboard"] body.app-mode .dashboard-balances { margin-top: 42px; }
html[data-site-route="dashboard"] body.app-mode .dashboard-section-heading { margin-bottom: 16px; }
html[data-site-route="dashboard"] body.app-mode .dashboard-section-heading h2 { font-size: 19px; }
html[data-site-route="dashboard"] body.app-mode .dashboard-table-wrap {
  border: 0;
  border-top: 1px solid var(--sc-border);
  border-bottom: 1px solid var(--sc-border);
  border-radius: 0;
  background: transparent;
}
html[data-site-route="dashboard"] body.app-mode .dashboard-table th { padding-block: 13px; background: transparent; }
html[data-site-route="dashboard"] body.app-mode .dashboard-table td { padding-block: 15px; }
html[data-site-route="dashboard"] body.app-mode .dashboard-wallet-total {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 2px 16px;
  margin: 20px 0 24px;
  padding: 22px 24px;
  border: 1px solid var(--sc-border);
  border-radius: 3px;
  background: var(--sc-surface);
}
html[data-site-route="dashboard"] body.app-mode .dashboard-wallet-total > span { grid-column: 1; }
html[data-site-route="dashboard"] body.app-mode .dashboard-wallet-total strong { grid-column: 1; font-size: clamp(33px,4vw,48px); }
html[data-site-route="dashboard"] body.app-mode .dashboard-wallet-total small { grid-column: 2; grid-row: 2; max-width: 245px; margin: 0; line-height: 1.5; }

/* RISK GUIDE — a worked example is the anchor; supporting risks read like notes. */
body.app-mode .risk-intro { max-width: 950px; padding-bottom: 12px; }
body.app-mode .risk-intro h1 { max-width: 760px; font-size: clamp(32px,4.5vw,54px); font-weight: 630; line-height: 1.09; letter-spacing: -.042em; }
body.app-mode .risk-intro > p:last-child { max-width: 610px; color: var(--sc-muted); font-size: 16px; line-height: 1.58; }
body.app-mode .risk-topics { margin: 36px 0 40px; border-bottom: 1px solid var(--sc-border); }
body.app-mode .risk-topics article:first-child { padding-top: 20px !important; }
body.app-mode .risk-topics article:first-child h2 { font-size: clamp(25px,2.5vw,34px); }
body.app-mode .risk-topics article:not(:first-child) { display: grid; grid-template-columns: 170px minmax(0,1fr); align-items: start; gap: 22px; padding: 19px 0 !important; }
body.app-mode .risk-topics article:not(:first-child) :is(h2,p) { margin: 0; }
body.app-mode .risk-topics article:not(:first-child) p { color: var(--sc-muted); font-size: 14px; line-height: 1.55; }
body.app-mode .risk-example {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(280px,.88fr);
  gap: 22px clamp(28px,5vw,78px);
  margin-top: 40px;
  padding: clamp(24px,3vw,44px);
  border: 1px solid var(--sc-border);
  border-radius: 4px;
  background: var(--sc-surface);
}
body.app-mode .risk-example-copy h2 { max-width: 540px; font-size: clamp(23px,2.5vw,33px); line-height: 1.2; }
body.app-mode .risk-example-copy p:last-child { max-width: 540px; color: var(--sc-muted); font-size: 15px; line-height: 1.6; }
body.app-mode .risk-example-graphic { align-self: center; margin: 0; }
body.app-mode .risk-review-note { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid var(--sc-border); font-size: 13px; }
body.app-mode .faq-layout { margin-top: 50px; }
body.app-mode .faq-layout h2 { font-size: 26px; line-height: 1.2; }
body.app-mode .faq details { border-color: var(--sc-border); }
body.app-mode .faq summary { color: var(--sc-text); font-size: 15px; font-weight: 560; }
body.app-mode .faq details p { color: var(--sc-muted); font-size: 14px; line-height: 1.6; }

/* MARKET DETAIL — fewer boxes and more decisive type, without changing the ticket. */
body.app-mode.stock-detail-mode .market-overview { margin-bottom: 14px; }
body.app-mode.stock-detail-mode .overview-pair strong { font-size: clamp(30px,3vw,42px); }
body.app-mode.stock-detail-mode .overview-stats { margin-top: 28px; }
body.app-mode.stock-detail-mode .overview-stats > div { min-height: 101px; padding-block: 17px !important; }
body.app-mode.stock-detail-mode .overview-stats strong { font-size: 22px !important; }
body.app-mode.stock-detail-mode .rate-pair { margin-bottom: 30px; }
body.app-mode.stock-detail-mode .layout > aside > .panel { border: 1px solid var(--sc-border); background: var(--sc-surface); }
body.app-mode.stock-detail-mode .layout > aside .ph { border-bottom: 1px solid var(--sc-border); }
body.app-mode.stock-detail-mode #details .tabs { border-bottom: 1px solid var(--sc-border); }
body.app-mode.stock-detail-mode #details .field { padding-top: 18px; padding-bottom: 13px; }
body.app-mode.stock-detail-mode #details .field .amount input { font-variant-numeric: tabular-nums; }

@media (max-width: 1050px) {
  html[data-site-route="home"] body.app-mode .home-lending { grid-template-columns: minmax(0,1fr) auto; }
  html[data-site-route="home"] body.app-mode .home-lending-link { grid-column: 1 / -1; justify-self: start; }
  body.app-mode .site-footer .footer-navigation { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  html[data-site-route="home"] body.app-mode .home-risk { grid-template-columns: 1fr; margin-top: 28px; padding: 25px 22px 0; }
  html[data-site-route="home"] body.app-mode .home-risk > div:first-child { padding-bottom: 12px; }
  html[data-site-route="home"] body.app-mode .home-risk-copy { padding: 0 0 25px; }
  html[data-site-route="home"] body.app-mode .home-contracts { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 16px 0 18px; }
  html[data-site-route="home"] body.app-mode .home-contracts > span,
  html[data-site-route="home"] body.app-mode .home-contracts small { flex-basis: 100%; }
  html[data-site-route="home"] body.app-mode .home-lending { grid-template-columns: 1fr auto; margin-top: 0; padding: 27px 22px; }
  html[data-site-route="home"] body.app-mode .home-lending-quote { padding-left: 17px; }
  body.app-mode .site-footer { grid-template-columns: 1fr; gap: 22px; }
  body.app-mode .site-footer .footer-navigation { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html[data-site-route="dashboard"] body.app-mode .dashboard-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html[data-site-route="dashboard"] body.app-mode .dashboard-summary-card:first-child { padding-left: 16px !important; }
  html[data-site-route="dashboard"] body.app-mode .dashboard-summary-card:nth-child(odd) { border-left: 0 !important; }
  html[data-site-route="dashboard"] body.app-mode .dashboard-summary-card:nth-child(n+3) { border-top: 1px solid var(--sc-border); }
  html[data-site-route="dashboard"] body.app-mode .dashboard-wallet-total { grid-template-columns: 1fr; }
  html[data-site-route="dashboard"] body.app-mode .dashboard-wallet-total small { grid-column: 1; grid-row: auto; max-width: none; margin-top: 5px; }
  body.app-mode .risk-topics article:not(:first-child) { grid-template-columns: 1fr; gap: 6px; }
  body.app-mode .risk-example { grid-template-columns: 1fr; }
  body.app-mode .risk-review-note { grid-column: 1; }
}
@media (max-width: 520px) {
  html[data-site-route="home"] body.app-mode .home-coming-soon { grid-template-columns: 1fr; gap: 12px; }
  html[data-site-route="home"] body.app-mode .home-coming-item { justify-content: flex-start; }
  html[data-site-route="home"] body.app-mode .home-calculator-results { grid-template-columns: 1fr; }
  html[data-site-route="home"] body.app-mode .home-lending { grid-template-columns: 1fr; gap: 18px; }
  html[data-site-route="home"] body.app-mode .home-lending-quote { max-width: none; }
  html[data-site-route="home"] body.app-mode .home-lending-link { grid-column: 1; }
  html[data-site-route="home"] body.app-mode .home-risk-bars > span { grid-template-columns: 99px minmax(0,1fr); }
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) .market-risk-note { align-items: start; flex-direction: column; }
  body.app-mode .site-footer .footer-navigation { gap: 10px 17px; }
  body.app-mode .site-footer .footer-navigation :is(a,button) { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body.app-mode :is(.home-lending-link,.home-risk-copy a,.site-footer a,.site-footer button) { transition: none !important; }
  html[data-site-route="home"] body.app-mode .home-loan-drawing :is(.drawing-logo,.drawing-line,.drawing-arrow) { animation: none !important; }
}

/* Markets: keep the live context visible without making visitors scroll past a
   near-full-screen summary before they can reach the market list. */
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: auto !important;
  column-gap: 0;
  align-items: stretch;
  margin: 13px 0 23px !important;
  padding: 0 !important;
  border-top: 1px solid var(--sc-border) !important;
  border-bottom: 1px solid var(--sc-border) !important;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric,
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > #totalStockTvl {
  grid-column: auto !important;
  grid-row: auto !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 100px !important;
  padding: 14px 19px !important;
  border: 0 !important;
  border-left: 1px solid var(--sc-border) !important;
  background: transparent !important;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric:not(.liquidity-hero) {
  grid-column: auto !important;
  grid-row: auto !important;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric:first-child { padding-left: 0 !important; border-left: 0 !important; }
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric :is(span,small) { font-size: 12px !important; line-height: 1.4; }
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric strong,
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric:not(.liquidity-hero) strong {
  grid-column: auto;
  grid-row: auto;
  margin: 6px 0 2px;
  font-size: clamp(20px, 2vw, 25px) !important;
  line-height: 1.15;
  text-align: left;
}
html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric.liquidity-hero strong { font-size: clamp(26px, 2.6vw, 34px) !important; }

/* A compact version of the header follows the reader at the top after scrolling. */
body.app-mode .scroll-route-nav[hidden] { display: none !important; }
body.app-mode .scroll-route-nav {
  position: fixed;
  z-index: 90;
  left: 50%;
  top: max(10px, env(safe-area-inset-top));
  bottom: auto;
  display: flex;
  align-items: stretch;
  width: max-content;
  max-width: calc(100vw - 24px);
  transform: translate(-50%, -66px) scale(.98);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, transform .5s cubic-bezier(.2,1.28,.38,1), visibility 0s linear .5s;
  padding: 5px 7px;
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  background: var(--sc-surface);
  box-shadow: 0 10px 25px rgb(0 0 0 / .17);
}
body.app-mode .scroll-route-nav.is-visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
body.app-mode .scroll-route-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 103px;
  min-height: 38px;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--sc-muted);
  font-size: 12px;
  font-weight: 590;
  text-decoration: none;
  opacity: 0;
  transform: translateY(7px);
  transition: background-color .15s ease, color .15s ease, opacity .18s ease, transform .28s cubic-bezier(.22,1,.36,1);
}
body.app-mode .scroll-route-nav.is-visible a {
  opacity: 1;
  transform: translateY(0);
}
body.app-mode .scroll-route-nav.is-visible a:nth-child(1) { transition-delay: 0s, 0s, .04s, .04s; }
body.app-mode .scroll-route-nav.is-visible a:nth-child(2) { transition-delay: 0s, 0s, .12s, .12s; }
body.app-mode .scroll-route-nav.is-visible a:nth-child(3) { transition-delay: 0s, 0s, .17s, .17s; }
body.app-mode .scroll-route-nav.is-visible a:nth-child(4) { transition-delay: 0s, 0s, .22s, .22s; }
body.app-mode .scroll-route-nav .scroll-wallet-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:36px;
  max-width:148px;
  margin-left:6px;
  padding:0 12px;
  border:1px solid var(--sc-accent);
  border-radius:999px;
  background:var(--sc-accent);
  color:var(--sc-bg);
  font-size:12px;
  font-weight:650;
  white-space:nowrap;
  cursor:pointer;
  opacity:0;
  transform:translateY(7px);
  transition:background-color .15s ease, color .15s ease, opacity .18s ease, transform .28s cubic-bezier(.22,1,.36,1);
}
body.app-mode .scroll-route-nav.is-visible .scroll-wallet-button { opacity:1; transform:translateY(0); transition-delay:0s,0s,.26s,.26s; }
body.app-mode .scroll-route-nav .scroll-wallet-button:hover { background:var(--sc-text); border-color:var(--sc-text); }
body.app-mode .scroll-route-nav .scroll-wallet-button.is-connected { border-color:var(--sc-border); background:var(--sc-raised); color:var(--sc-text); }
body.app-mode .scroll-route-nav .scroll-wallet-button.is-connected:hover { background:var(--sc-surface); border-color:var(--sc-accent); }
body.app-mode .scroll-route-nav .scroll-wallet-button:disabled { opacity:.65; cursor:wait; }
body.app-mode .scroll-route-nav .scroll-wallet-label { overflow:hidden; text-overflow:ellipsis; }
body.app-mode .scroll-route-nav .scroll-wallet-dot { display:none; flex:none; width:7px; height:7px; border-radius:50%; background:#32835f; }
body.app-mode .scroll-route-nav .scroll-wallet-button.is-connected .scroll-wallet-dot { display:block; }
body.app-mode .scroll-route-nav .scroll-route-brand {
  flex: none;
  min-width: 41px;
  width: 41px;
  padding: 5px 9px 5px 6px;
  margin-right: 5px;
  border-right: 1px solid var(--sc-border);
  border-radius: 0;
}
body.app-mode .scroll-route-nav .scroll-route-brand img { display:block; width:25px; height:25px; object-fit:contain; }
body.app-mode .scroll-route-nav a:hover { color: var(--sc-text); background: var(--sc-raised); }
body.app-mode .scroll-route-nav a[aria-current="page"] { color: var(--sc-accent); background: var(--sc-raised); }
body.app-mode .scroll-route-nav svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
body.app-mode .scroll-route-nav svg circle { fill: var(--sc-surface); }
body.app-mode .scroll-route-nav a:focus-visible { outline-offset: -2px; }
@media (max-width: 900px) {
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric,
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > #totalStockTvl { min-height: 88px !important; padding: 12px 14px !important; }
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric:nth-child(odd) { padding-left: 0 !important; border-left: 0 !important; }
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric:nth-child(n+3) { border-top: 1px solid var(--sc-border) !important; }
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric strong { font-size: 21px !important; }
  html[data-production-route="markets"] body.app-mode:not(.stock-detail-mode) #marketMetrics > .market-metric.liquidity-hero strong { font-size: 27px !important; }
}
@media (max-width: 760px) {
  body.app-mode .scroll-route-nav { top: max(8px, env(safe-area-inset-top)); bottom:auto; width:calc(100% - 18px); max-width:500px; justify-content:space-around; padding:5px; border:1px solid var(--sc-border); border-radius:12px; }
  body.app-mode .scroll-route-nav a:not(.scroll-route-brand) { flex:1 1 0; min-width:0; gap:5px; padding:6px 5px; font-size:11px; }
  body.app-mode .scroll-route-nav .scroll-route-brand { min-width:37px; width:37px; margin-right:2px; padding:6px 7px 6px 3px; }
  body.app-mode .scroll-route-nav .scroll-route-brand img { width:23px; height:23px; }
  body.app-mode .scroll-route-nav .scroll-wallet-button { flex:0 1 112px; min-width:85px; max-width:112px; margin-left:2px; padding:0 8px; font-size:11px; }
  body.app-mode .scroll-route-nav svg { width:14px; height:14px; }
}
@media (max-width: 430px) {
  body.app-mode .scroll-route-nav a:not(.scroll-route-brand) { gap:3px; font-size:10px; }
  body.app-mode .scroll-route-nav svg { width:13px; height:13px; }
  body.app-mode .scroll-route-nav .scroll-wallet-button { flex-basis:94px; min-width:78px; }
}
@media (prefers-reduced-motion: reduce) {
  body.app-mode .scroll-route-nav,
  body.app-mode .scroll-route-nav a,
  body.app-mode .scroll-route-nav .scroll-wallet-button { transition: none; }
}
