/* Presentation-only polish. Market data, routing and transactions remain unchanged. */
html[data-theme="dark"] {
  --bg:#121619;
  --p:#1b2023;
  --line:#394247;
  --ink:#f0f2f2;
  --muted:#b9c3c5;
  --lime:#c2d0d6;
  --sc-bg:var(--bg);
  --sc-surface:var(--p);
  --sc-border:var(--line);
  --sc-text:var(--ink);
  --sc-muted:var(--muted);
  --sc-accent:#c2d0d6;
  --sc-success:#c2d0d6;
}
html[data-theme="dark"] body.app-mode .site-header { background:var(--bg); border-bottom-color:var(--line); }
html[data-theme="dark"] body.app-mode :is(.search-wrap,.search,#marketSort,.refresh,.market-choice) { background:var(--sc-surface); border-color:var(--sc-border); color:var(--sc-text); }
html[data-theme="dark"] body.app-mode.stock-detail-mode :is(.field,.lend-card) { background:var(--sc-bg); border-color:var(--sc-border); }
html[data-theme="dark"] body.app-mode.stock-detail-mode .lend-summary { background:var(--sc-surface); border-color:var(--sc-border); }
html[data-theme="dark"] body.app-mode .max-btn { color:var(--sc-text); border-color:var(--sc-border); }
html[data-theme="dark"] body.app-mode .max-btn:hover { background:var(--sc-surface) !important; }
html[data-theme="dark"] body.app-mode .modal { background:var(--sc-surface); border-color:var(--sc-border); }
html[data-theme="dark"] body.app-mode .primary { background:var(--sc-accent); border-color:var(--sc-accent); color:var(--sc-bg); }
html[data-theme="dark"] body.app-mode .primary:hover:not(:disabled) { background:#d8e2e6; }
html[data-theme="dark"] body.app-mode.stock-detail-mode #action:disabled { background:var(--sc-border); border-color:var(--sc-border); color:var(--sc-text); }
html[data-theme="dark"] body.app-mode .compact-market { background:var(--sc-surface); border-color:var(--sc-border); }
html[data-theme="dark"] body.app-mode .compact-market:hover, html[data-theme="dark"] body.app-mode .table tbody tr:hover, html[data-theme="dark"] body.app-mode .table tbody tr.active { background:#242b2f; }
html[data-theme="dark"] body.app-mode .table th { color:var(--sc-muted); border-color:var(--sc-border); }
html[data-theme="dark"] body.app-mode .table td { color:var(--sc-text); border-color:var(--sc-border); }
html[data-theme="dark"] body.app-mode :is(.search,.field input)::placeholder { color:var(--sc-muted); }
html[data-theme="dark"] body.app-mode :is(.refresh,.theme-toggle):hover { background:#242b2f; color:var(--sc-text); }
html[data-theme="dark"] body.app-mode .header-actions .wallet { background:var(--sc-surface); border-color:var(--sc-border); color:var(--sc-text) !important; }
html[data-theme="dark"] body.app-mode .header-actions .wallet:hover { background:#242b2f; }
html[data-theme="dark"] body.app-mode.stock-detail-mode :is(.market-choice-label,.field label,.balance-row,.lend-label,.lend-balance) { color:var(--sc-muted); }
html[data-theme="dark"] body.app-mode .site-nav a, html[data-theme="dark"] body.app-mode .network-badge { color:var(--sc-muted); }
html[data-theme="dark"] body.app-mode a { color:var(--sc-accent); }
html[data-theme="dark"] body.app-mode :is(.footer-navigation,.footer-credits) a { color:var(--sc-accent) !important; }
body.app-mode .site-header { display:flex; flex-wrap:nowrap !important; align-items:center; gap:18px; }
body.app-mode .header-left { display:flex; flex:1 1 auto; min-width:0; width:auto !important; align-items:center; gap:26px; }
body.app-mode .site-nav { display:flex; flex-wrap:nowrap; align-items:center; white-space:nowrap; }
html[data-site-route="home"] body.app-mode .site-nav { display:none !important; }
body.app-mode .header-actions { display:flex !important; flex:0 0 auto; width:auto !important; align-items:center; gap:8px; }
body.app-mode .network-badge { display:inline-flex; margin-right:0; }
body.app-mode .theme-toggle { flex:0 0 35px; font-size:17px; line-height:1; }
body.app-mode #walletControl { position:relative; min-width:0; }
body.app-mode #walletControl.is-connected > #wallet { position:relative; display:flex; align-items:center; justify-content:flex-start; min-width:142px; min-height:36px; padding:8px 35px 8px 12px; border:1px solid var(--sc-border); border-radius:6px !important; background:var(--sc-surface) !important; color:var(--sc-text) !important; text-align:left; font-variant-numeric:tabular-nums; }
body.app-mode #walletControl.is-connected > #wallet::before { flex:0 0 7px; margin-right:8px; }
body.app-mode #walletControl.is-connected > #wallet::after { content:"⌄"; position:absolute; right:11px; top:50%; transform:translateY(-55%); padding-left:9px; border-left:1px solid var(--sc-border); color:var(--sc-muted); font-size:18px; line-height:18px; }
body.app-mode .wallet-menu { z-index:30; }
body.app-mode #walletMenuToggle { display:none !important; }
html[data-site-route="home"] body.app-mode .home-lead { min-height:0 !important; align-items:start; row-gap:28px; padding-block:clamp(48px,6vh,82px) 35px; }
html[data-site-route="home"] body.app-mode .home-stat-strip { margin-top:10px; padding-top:22px; }
html[data-site-route="home"] body.app-mode .home-credit-flow { color:var(--sc-text); margin-top:22px; }
html[data-site-route="home"] body.app-mode .home-credit-flow-track { background:var(--sc-border); }
html[data-site-route="home"] body.app-mode .home-credit-flow-track::after { border-color:var(--sc-muted); }
html[data-site-route="home"] body.app-mode .home-credit-flow-track > span { display:none; }
html[data-site-route="home"] body.app-mode .home-credit-flow + .home-actions { margin-top:25px; }
html[data-site-route="home"] body.app-mode .home-primary { display:inline-flex; align-items:center; gap:24px; }
html[data-site-route="home"] body.app-mode .home-primary span { display:inline; transition:transform .15s ease; }
html[data-site-route="home"] body.app-mode .home-primary:hover span { transform:translate(2px,-2px); }
html[data-site-route="home"] body.app-mode .home-caution { max-width:560px; margin:30px 0 0; color:var(--sc-muted); font-size:13px; line-height:1.55; }
html[data-site-route="home"] body.app-mode .home-visitor-count:not([hidden]) { display:flex; align-items:baseline; gap:12px; margin:20px 0 0; color:var(--sc-muted); font-size:13px; line-height:1.4; }
html[data-site-route="home"] body.app-mode .home-visitor-count strong { color:var(--sc-text); font-size:20px; font-weight:650; font-variant-numeric:tabular-nums; }

html[data-production-route="markets"] body.app-mode .app-heading { margin-bottom:22px; }
html[data-production-route="markets"] body.app-mode #stockListPanel .ph { justify-content:flex-end; margin:0 0 4px; padding:0; }
html[data-production-route="markets"] body.app-mode #stockListPanel .ph h2,
html[data-production-route="markets"] body.app-mode #exploreCaption { display:none; }
html[data-production-route="markets"] body.app-mode #stockListPanel .count { padding:0; border:0; background:none; color:var(--sc-muted); font-size:12px; }
html[data-production-route="markets"] body.app-mode #stockListPanel .market-toolbar { margin:0 0 5px; }
html[data-production-route="markets"] body.app-mode #stockListPanel #marketSort { min-width:150px; padding:8px 30px 8px 10px; border:1px solid var(--sc-border); border-radius:6px; background:var(--sc-surface); color:var(--sc-text); }
html[data-production-route="markets"] body.app-mode .hide-full-control { min-height:30px; }
html[data-production-route="markets"] body.app-mode .hide-full-control input { width:15px; height:15px; margin:0; accent-color:var(--sc-accent); }
html[data-production-route="markets"] body.app-mode #refresh { display:inline-flex; align-items:center; gap:7px; min-width:90px; min-height:38px; padding:7px 10px; border:1px solid var(--sc-border); border-radius:6px; background:var(--sc-surface); color:var(--sc-text); }
html[data-production-route="markets"] body.app-mode #refresh .refresh-word { display:inline !important; font-size:12px; }
html[data-production-route="markets"] body.app-mode #refresh .refresh-icon { font-size:16px; line-height:1; }
html[data-production-route="markets"] body.app-mode #marketlist .table { width:100%; min-width:730px; table-layout:fixed; }
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(1) { width:25%; text-align:left; }
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(2),
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(3) { width:13%; }
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(4) { width:21%; }
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(5) { display:none !important; }
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(6) { width:15%; display:table-cell !important; }
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(7) { width:13%; }
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(2) .market-sort-button,
html[data-production-route="markets"] body.app-mode #marketlist .table :is(th,td):nth-child(3) .market-sort-button { white-space:nowrap; }
html[data-production-route="markets"] body.app-mode #marketlist .table td.is-primary-rate { font-weight:700; }
html[data-production-route="markets"] body.app-mode #marketlist .table td.apy:not(.is-primary-rate) { color:var(--sc-muted) !important; }
html[data-production-route="markets"] body.app-mode #marketlist .table tbody tr.is-full { opacity:1; }
html[data-production-route="markets"] body.app-mode #marketlist .market-utilization { height:4px; border-radius:4px; background:var(--sc-border); }
html[data-production-route="markets"] body.app-mode #marketlist .market-utilization-fill { background:var(--sc-accent); }
html[data-production-route="markets"] body.app-mode .market-row-action { opacity:1; }
html[data-production-route="markets"] body.app-mode .pending-markets { margin-top:25px; }
html[data-production-route="markets"] body.app-mode .pending-market-list { display:grid; gap:0; }
html[data-production-route="markets"] body.app-mode .pending-market { display:grid !important; grid-template-columns:minmax(0,1fr) auto auto; min-height:68px; gap:16px; align-items:center; padding:9px 0; border-bottom:1px solid var(--sc-border); opacity:1; color:var(--sc-text); }
html[data-production-route="markets"] body.app-mode .pending-market .quote-identity { min-width:0; }
html[data-production-route="markets"] body.app-mode .pending-market .quote-name strong { color:var(--sc-text); }
html[data-production-route="markets"] body.app-mode .pending-state { margin:0; padding:4px 7px; border:1px solid var(--sc-border); border-radius:4px; color:var(--sc-muted); font-size:12px; }
html[data-production-route="markets"] body.app-mode .pending-market-request { margin:0; padding:7px 10px; border:1px solid var(--sc-border); border-radius:5px; color:var(--sc-text); font-size:12px; font-weight:600; text-decoration:none; white-space:nowrap; }
html[data-production-route="markets"] body.app-mode .pending-market-request:hover { border-color:var(--sc-accent); color:var(--sc-accent); }

body.app-mode .site-footer .footer-disclaimer { display:block; color:var(--sc-muted); font-size:12px !important; line-height:1.5; }
body.app-mode .site-footer .footer-navigation { align-content:start; }
html[data-site-route="dashboard"] body.app-mode #dashboardRefresh { display:inline-flex; align-items:center; justify-content:center; gap:7px; width:auto; min-width:90px; padding:0 10px; font-size:12px; }
html[data-site-route="dashboard"] body.app-mode #dashboardRefresh .dashboard-refresh-icon { font-size:18px; line-height:1; }
html[data-site-route="dashboard"] body.app-mode #dashboardRefresh.is-loading .dashboard-refresh-icon { animation:dashboard-spin .8s linear infinite; }
html[data-site-route="dashboard"] body.app-mode #dashboardRefresh.is-loading span:last-child { animation:none; }

/* Risks page: concise overview, measured example, then the original FAQ. */
body.app-mode .learn-shell { max-width:1440px; color:var(--sc-text); }
body.app-mode .risk-intro { max-width:760px; margin:0 0 36px; }
body.app-mode .risk-kicker { margin:0 0 10px; color:var(--sc-accent); font-size:12px; font-weight:650; }
body.app-mode .risk-intro h1 { margin:0; color:var(--sc-text); font:650 clamp(30px,3vw,40px)/1.18 Inter,Geist,"Segoe UI",sans-serif; letter-spacing:-.02em; }
body.app-mode .risk-intro > p:last-child { margin:14px 0 0; color:var(--sc-muted); font-size:15px; line-height:1.6; }
body.app-mode .risk-topics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:50px; }
body.app-mode .risk-topics article { min-width:0; padding:18px; border:1px solid var(--sc-border); border-radius:8px; background:var(--sc-surface); }
body.app-mode .risk-topics h2 { margin:0 0 10px; color:var(--sc-text); font:650 16px/1.3 Inter,Geist,"Segoe UI",sans-serif; }
body.app-mode .risk-topics p { margin:0; color:var(--sc-muted); font-size:13px; line-height:1.55; }
body.app-mode .risk-example { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr); gap:24px 44px; margin:0 0 60px; padding:25px 0; border-block:1px solid var(--sc-border); scroll-margin-top:80px; }
body.app-mode .risk-example h2 { max-width:560px; margin:0; color:var(--sc-text); font:650 23px/1.25 Inter,Geist,"Segoe UI",sans-serif; letter-spacing:-.015em; }
body.app-mode .risk-example-copy > p:last-child { max-width:590px; margin:15px 0 0; color:var(--sc-muted); font-size:14px; line-height:1.65; }
body.app-mode .risk-example-graphic { align-self:center; padding:18px; border:1px solid var(--sc-border); border-radius:8px; background:var(--sc-surface); }
body.app-mode .risk-example-line { display:flex; justify-content:space-between; gap:16px; color:var(--sc-muted); font-size:12px; }
body.app-mode .risk-example-line strong { color:var(--sc-text); font-size:14px; font-variant-numeric:tabular-nums; }
body.app-mode .risk-example-bar { height:12px; margin:9px 0 21px; border-radius:4px; background:var(--sc-border); overflow:hidden; }
body.app-mode .risk-example-bar i { display:block; height:100%; border-radius:4px; background:var(--sc-accent); }
body.app-mode .risk-collateral-bar i { width:100%; }
body.app-mode .risk-debt-bar i { width:50%; background:var(--sc-warning); }
body.app-mode .risk-example-marker { display:flex; justify-content:space-between; gap:12px; padding-top:11px; border-top:1px solid var(--sc-border); color:var(--sc-warning); font-size:12px; }
body.app-mode .risk-example-marker strong { font-weight:650; }
body.app-mode .risk-review-note { grid-column:1/-1; margin:0; padding:12px 14px; border-left:3px solid var(--sc-warning); background:color-mix(in srgb,var(--sc-warning) 8%,var(--sc-surface)); color:var(--sc-text); font-size:13px; line-height:1.5; }
body.app-mode .learn-shell .faq-layout { grid-template-columns:minmax(220px,.65fr) minmax(0,1.35fr); gap:50px; }
body.app-mode .learn-shell .faq-layout h2 { color:var(--sc-text); font:650 22px/1.3 Inter,Geist,"Segoe UI",sans-serif; letter-spacing:-.01em; }
body.app-mode .learn-shell .section-copy { color:var(--sc-muted); font-size:14px; }
body.app-mode .learn-shell .faq details { border-color:var(--sc-border); }
body.app-mode .learn-shell .faq summary { align-items:center; gap:20px; min-height:32px; color:var(--sc-text); font-size:15px; font-weight:600; line-height:1.4; }
body.app-mode .learn-shell .faq summary::after { flex:0 0 18px; color:var(--sc-accent); line-height:1; text-align:center; }
body.app-mode .learn-shell .faq details p { color:var(--sc-muted); font-size:14px; line-height:1.65; }
body.app-mode .risk-resources { display:flex; flex-wrap:wrap; gap:14px 23px; margin:40px 0 12px; padding-top:18px; border-top:1px solid var(--sc-border); color:var(--sc-muted); font-size:12px; }
body.app-mode .risk-resources a { color:var(--sc-accent); text-decoration:underline; text-underline-offset:3px; }
@media(max-width:980px) { body.app-mode .risk-topics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) {
  body.app-mode .site-header { gap:8px; padding:11px 14px; }
  body.app-mode .header-left { gap:10px; }
  body.app-mode .header-actions { gap:5px; }
  body.app-mode .site-nav { gap:1px; }
  body.app-mode .site-nav a { padding:5px 7px; font-size:11px; }
  body.app-mode .network-badge { padding:5px 7px; }
  body.app-mode .theme-toggle { flex-basis:29px; width:29px; height:29px; min-height:29px; }
  html[data-production-route="markets"] body.app-mode #marketlist .table-scroll { display:none !important; }
  html[data-production-route="markets"] body.app-mode #marketlist .compact-market-list { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  html[data-production-route="markets"] body.app-mode .compact-market { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px 14px; padding:15px; border:1px solid var(--sc-border); border-radius:8px; background:var(--sc-surface); }
  html[data-production-route="markets"] body.app-mode .compact-market .quote-identity { grid-column:1/-1; }
  html[data-production-route="markets"] body.app-mode .compact-market .quote-rates,
  html[data-production-route="markets"] body.app-mode .compact-market .quote-footer { display:contents; }
  html[data-production-route="markets"] body.app-mode .compact-market :is(.quote-primary-rate,.quote-secondary-rate,.quote-liquidity,.quote-lltv) { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; font-variant-numeric:tabular-nums; }
  html[data-production-route="markets"] body.app-mode .compact-market :is(.quote-primary-rate,.quote-secondary-rate,.quote-liquidity,.quote-lltv) > :first-child { color:var(--sc-muted); font-size:12px; font-weight:500; }
  html[data-production-route="markets"] body.app-mode .compact-market :is(.quote-primary-rate,.quote-secondary-rate,.quote-liquidity,.quote-lltv) > :last-child { color:var(--sc-text); font-size:16px; font-weight:650; }
  html[data-production-route="markets"] body.app-mode .compact-market .quote-link { grid-column:1/-1; justify-self:start; margin-top:2px; }
  html[data-production-route="markets"] body.app-mode .compact-market > .market-utilization { grid-column:1/-1; width:100%; margin:0; }
  body.app-mode .risk-example { grid-template-columns:1fr; }
  body.app-mode .learn-shell .faq-layout { grid-template-columns:1fr; gap:25px; }
}
@media(max-width:620px) {
  body.app-mode .site-header { padding:9px 10px; gap:4px; }
  body.app-mode .app-brand-name { display:none; }
  body.app-mode .header-left { gap:4px; }
  body.app-mode .site-nav a { padding:4px 4px; font-size:10px; }
  body.app-mode .network-badge { font-size:10px; padding:4px 5px; }
  body.app-mode .theme-toggle { flex-basis:26px; width:26px; height:26px; min-height:26px; }
  body.app-mode #walletControl > #wallet { max-width:95px; min-height:30px; padding:6px 7px; font-size:10px; white-space:nowrap; overflow:hidden; }
  body.app-mode #walletControl.is-connected > #wallet { min-width:92px; max-width:100px; padding:6px 24px 6px 7px; font-size:10px; }
  body.app-mode #walletControl.is-connected > #wallet::after { right:5px; padding-left:4px; }
  html[data-production-route="markets"] body.app-mode #marketlist .compact-market-list { grid-template-columns:1fr; }
  body.app-mode .risk-topics { grid-template-columns:1fr 1fr; gap:8px; }
  body.app-mode .risk-topics article { padding:14px; }
  body.app-mode .pending-market { grid-template-columns:minmax(0,1fr) auto !important; }
  body.app-mode .pending-market-request { grid-column:1/-1; justify-self:start; }
}
@media(max-width:420px) {
  body.app-mode .site-header { gap:3px; }
  body.app-mode .header-left { gap:2px; }
  body.app-mode .site-nav a { padding:3px 2px; font-size:9px; }
  body.app-mode .network-badge { padding:4px; }
}
