/* Evenkeel pro-polish 2.
   Load order (app): app.css, v2.css, ek.css (landing only), mobile-overrides.css,
   polish.css, polish-2.css, motion.css.
   This file supersedes the card-on-gray scaffold, Inter body face, pill nav,
   eyebrow costume, chart end-pills styling, and the thin 2-column footer
   from v2.css, ek.css, and polish.css. Do not append these rules into v2.css
   alone or the landing (ek.css) will win on .btn, .hero-grid, and .card.
   Docs: load docs-polish-2.css after docs.css.

   Identity: Joint lockup stays. v2 color tokens stay. Usage changes:
   page and surface share one ground, so cards are no longer the layout.
   Type changes: body and display use Geist (already self-hosted in app.css).
   v2.css had swapped it for Inter to mimic BoardUI. That is the amateur tell.
*/

/* ---------- type and ground ---------- */
:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F7F7F6;
  --s1: #F7F7F6;
  --s2: #EFEFEF;
  --s3: #E6E7E6;
  --shadow-card: none;
  --shadow-float: none;
  --r-lg: 12px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --color-bg: var(--bg);
  --color-surface: var(--s1);
}
:root[data-theme="dark"] {
  --bg: #0A0B0B;
  --s1: #0A0B0B;
  --s2: #141616;
  --s3: #1C1F1E;
  --shadow-card: none;
  --shadow-float: none;
}
html, body { background: var(--bg); }
body { font-family: var(--font); font-feature-settings: "cv11", "ss01", "tnum"; }
.num, .stat-value, td, .kv dd, .amount-input, .num-xl, .num-lg, .v-xl, .v-md, .hero-num, .lim-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "cv11";
}

/* ---------- kill BoardUI costume ---------- */
.eyebrow { display: none !important; }
.herobg, .mini, .mini1, .mini2, .card.float.mini { display: none !important; }
.lift, .lift-card, .card.lift, a.lift, .btn.lift { transform: none !important; box-shadow: none !important; }
.card, .ek .card, .kpi.card, .hero-card, .stat-wrap .card, .inner-tile, .sub-card, .cta.card, .form-card,
.actions-card, .limit-m, .risk-tile {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.ek .card.float, .hero-card { padding: 0; }
.inner { background: transparent; border: 0; box-shadow: none; padding: 0; }

/* Inputs, tips, dialogs still need a surface */
.amount, .field, .token-pill, .t-sel, .chart-tip, .toast, .toasts .toast, dialog, .modal, .wc-overlay,
input[type="text"], input[type="number"], .amount-input,
.tabs, .seg, .seg-btns {
  background: #fff;
}
:root[data-theme="dark"] .amount,
:root[data-theme="dark"] .field,
:root[data-theme="dark"] .token-pill,
:root[data-theme="dark"] .t-sel,
:root[data-theme="dark"] .chart-tip,
:root[data-theme="dark"] .toast,
:root[data-theme="dark"] dialog,
:root[data-theme="dark"] .tabs,
:root[data-theme="dark"] .seg,
:root[data-theme="dark"] .seg-btns,
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] .amount-input {
  background: #131514;
}

/* ---------- nav: typographic, not a pill tray ---------- */
.nav { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { height: 56px; }
@media (min-width: 1024px) {
  .nav-inner { height: 60px; display: grid; grid-template-columns: auto 1fr auto; gap: 24px; }
}
.nav-links {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  gap: 4px 20px !important;
  justify-self: start;
}
.nav-links a {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 0 2px !important;
  min-height: 36px;
  font-size: 13px;
  font-weight: 450;
  color: var(--text-2);
  box-shadow: none !important;
}
.nav-links a[aria-current="page"],
.nav-links a:hover { color: var(--text); background: transparent !important; }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--text); }

/* Network label: text only. No costume live dot. */
.net-chip {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  gap: 0;
  font-size: 12px;
  color: var(--text-2);
}
.net-chip .dot { display: none !important; }
.theme-btn {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  width: 36px; height: 36px;
  border-radius: 8px;
}
.theme-btn:hover { background: var(--s2) !important; }

/* X account in nav and footer Social column */
.x-nav {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  flex-shrink: 0;
}
.x-nav:hover { color: var(--text); background: var(--s2); }
.x-nav svg { width: 14px; height: 14px; display: block; }
.x-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.x-link svg { width: 14px; height: 14px; flex: none; display: block; }

/* ---------- landing hero: the number leads ---------- */
.ek .hero2, .hero-ledger { padding: 28px 0 8px; position: relative; }
.hero-ledger-in {
  display: grid;
  gap: 28px;
  align-items: end;
}
@media (min-width: 960px) {
  .hero-ledger-in { grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.2fr); gap: 48px; align-items: end; }
}
.hero-caption {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; line-height: 16px; color: var(--text-2); margin: 0 0 8px;
}
.hero-num-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-num, #hc-value {
  font-size: 56px; line-height: 56px; font-weight: 560; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
@media (min-width: 768px) {
  .hero-num, #hc-value { font-size: 72px; line-height: 72px; }
}
#hc-delta, .hero-delta {
  font-size: 16px; font-weight: 500; background: none !important;
  border: 0 !important; padding: 0 !important; border-radius: 0 !important;
}
#hc-delta.chip.pos, .hero-delta.pos { color: var(--pos); }
#hc-delta.chip.neg, .hero-delta.neg { color: var(--neg); }
.hero-dek, .ek .h-hero, .ek .h-hero2 {
  font-size: 22px; line-height: 28px; font-weight: 520; letter-spacing: -0.025em;
  margin: 18px 0 10px; max-width: 22ch;
}
@media (min-width: 768px) {
  .hero-dek, .ek .h-hero, .ek .h-hero2 { font-size: 28px; line-height: 34px; }
}
.hero-lead, .ek .lead.hero-lead { font-size: 15px; line-height: 24px; max-width: 42ch; color: var(--text-2); }
.hero-chart-flush, .ek .hero-media, #hero-chart { width: 100%; }
#hero-chart, #chart, #apy-chart { min-height: 180px; }
.hero-card-head { padding: 0 0 8px; }
.legend { font-size: 12px; color: var(--text-2); gap: 14px; }

/* Stat strip: one hairline row, not a card */
.stat-wrap, .ek .stat-wrap { margin-top: 28px; }
.stat-wrap .card, .gstat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 16px 0 !important;
  border-top: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
}
@media (min-width: 800px) {
  .stat-wrap .card, .gstat { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
}
.gstat .v-md { font-size: 22px; line-height: 26px; font-weight: 560; letter-spacing: -0.03em; }
.gstat .chip, .stat-wrap .chip {
  background: none !important; border: 0 !important; padding: 0 0 0 8px !important;
  font-size: 12px; font-weight: 500;
}
.stat-note { margin-top: 10px; }

/* How it works: columns, hairlines, no cards */
#how.sec, .sec { padding-top: 56px; }
.ek #how .h1, .sec .h1 { font-size: 28px; line-height: 34px; margin: 0 0 20px; font-weight: 560; }
@media (min-width: 800px) {
  #how .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  #how .card, #how .s4 {
    padding: 0 24px 0 0; border: 0; background: transparent;
    box-shadow: none; border-radius: 0;
  }
  #how .s4 + .s4 { padding-left: 24px; border-left: 1px solid var(--line); }
}
#how .stepn, .stepn {
  width: 20px; height: 20px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--text-2); font-size: 11px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
}
#how .h3 { font-size: 16px; line-height: 22px; }
#how .inner { margin-top: 16px; }

/* Lower chart: flush, quieter number */
.sec .card.p32, #chart { background: transparent; padding: 0; }
#big-value { font-size: 28px; line-height: 32px; font-weight: 560; }
#big-delta { background: none !important; border: 0 !important; padding: 0 !important; }

/* Yield / risk typographic */
.sec .grid > .card.s4, .sec .grid > .card.s8 {
  background: transparent; border: 0; box-shadow: none; padding: 0;
}
@media (min-width: 800px) {
  .sec .grid > .card.s4 { padding-right: 32px; border-right: 1px solid var(--line); }
  .sec .grid > .card.s8 { padding-left: 32px; }
}

/* ---------- limits: desktop grid, mobile list ---------- */
.glim, .limit-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
.lim-row, .glim > .inner, .limit-m {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr);
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
@media (min-width: 800px) {
  .glim, .limit-list, #limit-meters.limit-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    border-top: 0;
  }
  .lim-row, .glim > .inner, #limit-meters .limit-m {
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }
}
.lim-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lim-val, .glim .v-md, .limit-m .lm-val b, #limit-meters .lm-val b {
  font-size: 20px; line-height: 24px; font-weight: 560; letter-spacing: -0.03em;
}
.lim-name, .glim .h3, .limit-m .lbl2 { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text); }
.lim-help, .glim .sm, .limit-m .caption { font-size: 12px; line-height: 16px; color: var(--text-2); }
.lm-val { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.lm-val span { font-size: 12px; color: var(--text-2); }

/* Static cap scale: a line with an end tick. Not a 0% usage bar. */
.lim-scale { display: block; height: 10px; position: relative; }
.lim-scale-line {
  display: block; height: 1px; background: var(--line-2); width: 100%;
  position: absolute; top: 4px; left: 0;
}
.lim-scale-end {
  position: absolute; right: 0; top: 1px; width: 1px; height: 8px; background: var(--text-3);
}

/* Usage meter, SVG width attribute (no inline CSS). Hidden fill when data is absent. */
.lim-meter, .meter.lim-meter {
  display: block; width: 100%; height: 8px; background: transparent;
}
.lim-meter svg { display: block; width: 100%; height: 8px; }
.lim-meter .lim-track { fill: var(--s3); }
.lim-meter .lim-fill { fill: var(--accent); }
.lim-meter.is-warn .lim-fill { fill: var(--warn); }
.lim-meter.is-static .lim-fill { display: none; }

/* Hedge band: range, not a 0-102 usage bar. Marker only when a live ratio exists. */
.band { display: flex; flex-direction: column; gap: 4px; }
.band-track {
  position: relative; display: block; height: 8px; width: 100%;
  background: var(--s3); border-radius: 2px; overflow: visible;
}
.band-zone {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 35%, var(--s3));
  border-radius: 2px;
}
.band-mark {
  position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text);
  margin-left: -1px; border-radius: 1px;
}
.band-mark.hidden { display: none; }
.band-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }

/* Bottom CTA: typographic, not a banner card */
.sec-last .cta, .ek .card.cta {
  background: transparent !important;
  border: 0 !important; box-shadow: none !important;
  padding: 28px 0 8px !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
}
.sec-last .h1 { font-size: 28px; line-height: 34px; }

/* ---------- footer (app) ---------- */
.footer, .foot-pro {
  margin-top: 64px;
  padding: 40px 0 28px;
  border-top: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
}
.foot-in { display: flex; flex-direction: column; gap: 32px; }
.foot-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px 40px;
}
@media (min-width: 900px) {
  .foot-top { grid-template-columns: minmax(140px, 1.1fr) repeat(4, minmax(0, 1fr)); align-items: start; }
}
.foot-brand .brand { margin: 0; }
.foot-brand .logo.brand svg { height: 22px; width: auto; }
.foot-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.foot-h {
  margin: 0 0 2px;
  font-size: 11px; line-height: 14px; font-weight: 520;
  color: var(--text-3); letter-spacing: 0.02em;
}
.foot-col nav, .foot-addrs { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.foot-col nav a, .foot-addr, .footer nav a, .foot-in nav a {
  color: var(--text-2); text-decoration: none;
  min-height: 0; padding: 2px 0;
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 13px; line-height: 20px;
}
.foot-col nav a:hover, .foot-addr:hover { color: var(--text); }
.foot-addr .mono { font-size: 12px; color: var(--text-3); }
.foot-tbd {
  color: var(--text-3);
  font-size: 13px;
}
.foot-tbd::after {
  content: " (placeholder)";
  font-size: 11px;
  color: var(--text-3);
}
.foot-bot {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px 24px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-3);
}
.foot-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.foot-legal { margin: 0; }
.foot-live { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.foot-live .dot, .dot.live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos); display: inline-block;
}
.foot-sep { color: var(--text-3); }
@media (max-width: 767px) {
  .footer, .foot-pro { padding: 32px 0 88px; margin-top: 40px; }
  .foot-top { gap: 24px 20px; }
  @media (min-width: 420px) {
    .foot-top { grid-template-columns: 1fr 1fr; }
    .foot-brand { grid-column: 1 / -1; }
  }
}

/* ---------- app pages: one number, no billboard title ---------- */
.page-head { margin: 20px 0 16px; align-items: baseline; }
.page-head .h1 { font-size: 15px; line-height: 20px; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.page-head .muted { display: none; }
.container > .page-head { max-width: none; }

/* Dashboard: compact empty, typographic KPIs */
#position.is-empty {
  min-height: 0; padding: 0 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
#position.is-empty .empty-hero {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 0; text-align: left;
}
#position.is-empty .empty-ico { display: none; }
#position.is-empty .empty-hero .h2,
#position.is-empty .empty-hero h2 { font-size: 22px; line-height: 28px; font-weight: 560; letter-spacing: -0.03em; }
#position.is-empty .empty-actions { margin-top: 8px; }
.actions-card { padding: 0; }
.actions-card .btn-block { width: auto; }
.grid.cols-4, section[aria-label="Vault stats"] {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px;
  border-top: 1px solid var(--line); margin-top: 8px;
}
@media (min-width: 900px) {
  .grid.cols-4, section[aria-label="Vault stats"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.kpi.card, .card.kpi {
  padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent;
}
.k-ico { display: none !important; }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 450; }
.stat-value, .kpi .stat-value { font-size: 22px; line-height: 26px; }
#s-px, #s-px.stat-value { font-size: 28px; line-height: 32px; } /* share price is the book number when disconnected */

/* Deposit / withdraw: flatten wells, keep input surface */
.form-card, #wd-card, #dep-card { padding: 0; background: transparent; border: 0; }
.split .card, .grid .card.span8, .grid .card.span4 { padding: 0; }
.kv { font-size: 13px; }
.kv div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tabs, .seg { border-radius: 10px; }

/* Transparency: live limits already use #limit-meters; flatten the rest */
#limit-meters { display: grid; }
.limit-grid, #limit-meters.limit-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 800px) {
  .limit-grid, #limit-meters.limit-grid, #limit-meters.limit-list {
    grid-template-columns: 1fr 1fr; column-gap: 40px;
  }
}
.role-grid .sub-card { padding: 16px 0; border-top: 1px solid var(--line); }
.table { font-size: 13px; }
.table th { font-size: 11px; color: var(--text-3); font-weight: 500; }

/* 404: typographic, not a void with two equal buttons */
.empty-page, .nf, main.nf, #main.nf { min-height: calc(100vh - 200px); display: flex; flex-direction: column; justify-content: center; }
.nf .eyebrow, .nf .lbl { display: none; }

/* Charts sit on the page */
.chart-wrap { background: transparent; }
.chart-axis { font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; margin-top: 6px; }
.chart-tip {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
  font-size: 12px; box-shadow: none;
}
.chart-end { font-size: 11px; font-weight: 500; font-family: var(--font); }

/* Chips as type, already in polish; keep them quiet */
.chip, .sample, .badge-est, .badge-sample, .sample {
  background: none !important; border: 0 !important; box-shadow: none !important;
  padding: 0 !important; border-radius: 0 !important;
  font-size: 11px; letter-spacing: 0.04em; font-weight: 500; color: var(--text-3);
}
.chip.pos { color: var(--pos) !important; }
.chip.neg { color: var(--neg) !important; }
.chip.live { color: var(--pos) !important; }

/* Primary buttons stay solid accent. Light text is white for AA (6.41:1 on #0E6B5C). */
.btn.p, .btn-primary, .ek .btn.p, .wallet-btn.btn-primary {
  background: #0E6B5C; color: #fff; border: 0; box-shadow: none;
}
:root[data-theme="dark"] .btn.p,
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .ek .btn.p,
:root[data-theme="dark"] .wallet-btn.btn-primary {
  background: #7DDFC6; color: #101614;
}
.btn.s, .btn-secondary, .ek .btn.s {
  background: transparent; color: var(--text); border: 1px solid var(--line-2);
}

/* Browser surfaces (craft floor) */
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hide leftover grey icon wells */
.icotile, .empty-ico { background: none; border: 0; box-shadow: none; }

.band .lim-track { fill: color-mix(in srgb, var(--accent) 35%, var(--s3)); }
.band-mark-svg { fill: var(--text); }
.band-mark-svg.hidden, rect.hidden { display: none; }

/* Beat .ek .grid 12-column spans so how and limits lay out as intended. */
.ek #how .grid,
#how.sec .grid,
#how .grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 28px !important;
}
#how .s4, #how .card, #how .card.s4, .ek #how .s4 {
  grid-column: auto !important;
  width: auto !important;
  max-width: none !important;
}
@media (min-width: 800px) {
  .ek #how .grid, #how .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
  }
}

#limits-grid,
#limits-grid.grid,
.ek #limits-grid,
.glim.grid,
.limit-list.grid,
#limit-meters,
#limit-meters.limit-grid,
#limit-meters.limit-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
}
#limits-grid > .lim-row,
#limit-meters > .limit-m,
#limit-meters > .lim-row {
  grid-column: 1 / -1;
}
@media (min-width: 800px) {
  #limits-grid,
  #limits-grid.grid,
  .glim.grid,
  .limit-list.grid,
  #limit-meters,
  #limit-meters.limit-list {
    grid-template-columns: 1fr 1fr !important;
    column-gap: 40px !important;
  }
  #limits-grid > .lim-row,
  #limit-meters > .limit-m,
  #limit-meters > .lim-row {
    grid-column: auto;
  }
}

#how, #limits-grid, #limit-meters, .sec { scroll-margin-top: calc(72px + var(--ca-bar-h)); }

/* Official $KEEL contract bar, above the sticky header. */
:root { --ca-bar-h: 36px; }
.top-stack {
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-stack .nav {
  position: relative;
  top: auto;
  z-index: auto;
}
.ca-bar {
  background: color-mix(in srgb, var(--bg) 82%, var(--accent));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  color: var(--text);
  padding-top: env(safe-area-inset-top, 0px);
}
.ca-bar-in {
  min-height: var(--ca-bar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  line-height: 16px;
}
.ca-bar-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 520;
  letter-spacing: .06em;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.ca-bar-addr, .ca-bar-addr.mono {
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  line-height: 16px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ca-bar-addr:hover { color: var(--accent); }
.ca-bar-addr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ca-short { display: none; }
@media (max-width: 640px) {
  .ca-bar-in { gap: 8px; justify-content: flex-start; }
  .ca-full {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .ca-short { display: inline; }
}
.ca-bar-copy {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  height: 24px;
  min-width: 58px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--s1);
  color: var(--text);
  font: 520 12px/1 var(--font, inherit);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ca-bar-copy::after {
  content: "";
  position: absolute;
  inset: -8px;
}
.ca-bar-copy:hover { background: var(--s3); color: var(--text); }
.ca-bar-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Mobile type density for risk cards and matching grids. Desktop unchanged. */
@media (max-width: 640px) {
  .ek, .ek .sec {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .ek .sec .h1,
  .ek #how .h1,
  .sec .h1,
  .ek .sec-last .h1,
  .sec-last .h1 {
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }

  /* "Yield comes from" / "What can go wrong" */
  .ek .sec .card.s4 > .h3,
  .ek .sec .card.s8 > .row > .h3 {
    font-size: 20px;
    line-height: 1.25;
    font-weight: 560;
    letter-spacing: -0.02em;
  }
  .ek .sec .card.s8 > .row.between > .sm.acc {
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
  }
  .ek .sec .card.s8.col { gap: 10px; }

  .ek #risk-short.grid,
  .ek #risk-short.g2,
  #risk-short {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ek #risk-short .inner.risk-tile,
  .ek #risk-short .risk-tile {
    padding: 14px 16px;
    gap: 6px;
  }
  .ek #risk-short .row {
    gap: 8px;
    align-items: center;
  }
  .ek #risk-short .icotile {
    width: 18px;
    height: 18px;
    flex: none;
  }
  .ek #risk-short .icotile svg {
    width: 18px;
    height: 18px;
    display: block;
  }
  .ek #risk-short .h3,
  .ek #risk-short .h3.f15 {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.015em;
  }
  .ek #risk-short .sm,
  .ek #risk-short p {
    font-size: 13px;
    line-height: 1.4;
  }

  .ek .sec .card.s4 .h3.f15 {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
  }
  .ek .sec .card.s4 .sm {
    font-size: 13px;
    line-height: 1.4;
  }

  .ek #how .h3,
  #how .h3 {
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
  }
  .ek #how .body,
  #how .body {
    font-size: 13.5px;
    line-height: 1.4;
  }
  .ek #how .grid,
  #how.sec .grid,
  #how .grid {
    gap: 16px !important;
  }

  #risk-long { gap: 8px; }
  #risk-long .risk-tile {
    padding: 14px 16px;
    gap: 6px;
  }
  #risk-long .risk-tile h3 {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
  }
  #risk-long .risk-tile p {
    font-size: 13px;
    line-height: 1.4;
  }
}


/* ---------- precision pass: alignment, rhythm, targets, type ---------- */

/* Landing sections use .wrap (1360px incl. padding). Nav and footer use
   .container (1360px content + gutter). Unify so edges line up. */
.ek .wrap {
  max-width: calc(1360px + 2 * var(--gutter));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

#position.is-empty #pos-body {
  flex: none;
  align-items: flex-start;
}

h1, h2, .h1, .hero-dek, .h-hero, .h-hero2, .empty-hero .h2 {
  text-wrap: balance;
}

.theme-btn, .x-nav {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
}
.nav-links a { min-height: 40px; display: inline-flex; align-items: center; }
.foot-col nav a, .foot-addr, .footer nav a, .foot-in nav a, .x-link {
  min-height: 40px;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
}
.x-nav:focus-visible, .x-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.legend { gap: 16px; }
.foot-col { gap: 12px; }
.foot-col nav, .foot-addrs { gap: 8px; }
.page-head .h1 + p { margin-top: 8px; }

.lim-val, .kv .v, .kv dd, .stat-value, .v-md, .v-lg, .v-xl, .v-sm,
.hero-num, #hc-value, #big-value, .lm-val b, .amount-input, .num, .num-lg {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Token and step icons sit on the text cap height. */
.tok, .tk-l, .flow, .brand, .logo.brand, .x-link, .foot-live, .legend {
  align-items: center;
}
.tok img, .tk, .tokic, .t-ico { display: block; }

@media (max-width: 767px) {
  .ek .flow { gap: 8px; }
}
@media (max-width: 374px) {
  .ek .tok { padding: 0 8px; gap: 4px; }
  .ek .flow { gap: 4px; }
}

/* Keep the visually smaller mobile theme/X control, 40px hit via ::after. */
@media (max-width: 767px) {
  .theme-btn, .x-nav {
    width: 32px;
    height: 32px;
    min-height: 32px;
    min-width: 32px;
  }
}

.lim-row, .glim > .inner, .limit-m {
  padding-top: 16px;
  padding-bottom: 16px;
}
.grid.g12 { align-items: stretch; }
.mono, .foot-addr .mono { font-variant-numeric: tabular-nums; }
.logo.brand, a.brand {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.nav-right .btn,
.nav-right .btn-sm,
.nav-right .wallet-btn {
  min-height: 40px;
  height: 40px;
}
.tabs .tab, .tab {
  min-height: 40px;
}

.addr, a.ext, .mono.ext, button.copy, .copy, .icon-btn {
  min-height: 40px;
  min-width: 40px;
}
.addr, a.ext, .mono.ext { display: inline-flex; align-items: center; }


/* Withdrawal path picker and deposit checklist confirmation */
.wd-paths { display: flex; flex-direction: column; gap: 8px; }
.wd-path {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-md, 12px);
  background: var(--s1, transparent); padding: 12px 14px;
  color: inherit; font: inherit;
}
.wd-path strong { font-size: 14px; font-weight: 600; }
.wd-path span { font-size: 13px; line-height: 18px; color: var(--text-2, var(--muted)); }
.wd-path.is-on { border-color: var(--accent-line, var(--color-primary)); background: var(--s2); }
.wd-path:focus-visible { outline: 2px solid var(--accent-line, var(--color-primary)); outline-offset: 2px; }
.checklist .chk-confirmed {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--text-1);
}
.checklist.is-confirmed .chk-confirmed { display: flex; }
.wallet-hint { display: inline; }


/* Wallet restore: neutral skeleton, no Connect flash. */
.wallet-btn.is-restoring {
  pointer-events: none;
  min-width: 120px;
  background: var(--s2, var(--color-surface-2));
  color: var(--text-2, var(--muted));
  border: 1px solid var(--line);
}
.skel-wallet {
  display: inline-block;
  width: 72px;
  height: 10px;
  border-radius: 4px;
  vertical-align: middle;
}
#wv-min-hint, #pv-min-hint { margin: 6px 0 0; }
.min-hint-row dt { visibility: hidden; }
