/* SHEAF — shell stylesheet (tokens · page scale · one page frame · atmosphere · chrome · rule classes · shared components · motion)
   Design width 1920 (LUAT 50): 1 --u = 1 CSS px at 1920; everything scales with the viewport from 1280 to 2560.
   Route bodies use these tokens/classes and never declare border/outline, max-width, side padding or page background. */

:root {
  /* page scale */
  --u: calc(100vw / 1920);
  /* colour tokens (DESIGN.md §3) */
  --paper: #154B11;
  --ground-deep: #003C05;
  --ground-lift: #1D5A1A;
  --footer: #0B5015;
  --surface: #F9DC99;
  --surface-container: #FDE39F;
  --surface-input: #FFF5D6;
  --straw-edge: #E7BD6B;
  --straw-lip: #BA9441;
  --primary: #7C08C7;
  --primary-hi: #9641D7;
  --primary-container: #F5AB5F;
  --nav-strip: #FFFCF4;
  --chip-soft: #F3DDA3;
  --chip-nav: #EED9A0;
  --ink: #12300F;
  --ink-2: #4F5A2C;
  --straw-hi: #FFF5D6;
  --secondary: #8CC7E8;
  --tertiary: #97FCE4;
  --outline: #4F7A3C;
  --ripe-line: #E8B030;
  --rule-straw-c: #D0BB7A;
  --gain: #2E7D1F;
  --loss: #C0341D;
  --st-growing: #B9E08A;
  --st-ripe: #F7C948;
  --st-repaid: #C9E3A0;
  --st-lost: #E8A08C;
  --lost-card: #E9C2F2;
  --sunset: #E7B84A;
  /* fonts (DESIGN.md §2; chrome keeps its own faces verbatim) */
  --f-display: "Playfair Display", Georgia, serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --f-num: "DM Sans", "Source Sans 3", system-ui, sans-serif;
  --f-chrome: "Source Sans 3", sans-serif;
  --f-chrome-brand: "Playfair Display", serif;
  /* type scale (USER FIX: body 15–16, labels 13–14, display 48–56, hero 88) — never below 12px */
  --fs-hero: calc(88 * var(--u));
  --fs-display: calc(56 * var(--u));
  --fs-card-title: calc(34 * var(--u));
  --fs-fig: calc(48 * var(--u));
  --fs-lede: max(14px, calc(20 * var(--u)));
  --fs-body: max(13px, calc(16 * var(--u)));
  --fs-label: max(12px, calc(14 * var(--u)));
  --fs-small: max(12px, calc(13 * var(--u)));
  /* radii */
  --r-card: calc(18 * var(--u));
  --r-slip: calc(14 * var(--u));
  --r-ctl: calc(12 * var(--u));
  --r-pill: 999px;
  /* elevation (green-tinted) */
  --e1: 0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(0, 40, 0, .25);
  --e2: 0 calc(8 * var(--u)) calc(24 * var(--u)) rgba(0, 40, 0, .35);
  --e3: 0 calc(16 * var(--u)) calc(40 * var(--u)) rgba(0, 30, 0, .45);
  /* page frame (frame.json @1920) */
  --side-w: calc(575 * var(--u));
  --gut-l: calc(9 * var(--u));
  --gut-r: calc(1 * var(--u));
  --nav-h: calc(110 * var(--u));
  /* rule tokens (BORDER_TABLE / DESIGN.md §4b) — width + colour per rule kind; hairlines never below 1px */
  --rule-nav-w: max(1px, calc(1.3 * var(--u)));   --rule-nav-c: #485141;
  --rule-row-w: max(1px, calc(1.7 * var(--u)));   --rule-row-c: var(--rule-straw-c);
  --rule-lip-w: max(2px, calc(3.4 * var(--u)));   --rule-lip-c: var(--straw-lip);
  --rule-div-w: max(1px, calc(2 * var(--u)));     --rule-div-c: #849643;
  --rule-fact-w: max(1px, calc(1.5 * var(--u)));  --rule-fact-c: #8A9A4E;
  --rule-footer-w: max(1px, calc(2 * var(--u)));  --rule-footer-c: #487538;
  --rule-receipt-w: max(1px, calc(1.7 * var(--u))); --rule-receipt-c: #D3C28D;
  --rule-select-w: max(1px, calc(2 * var(--u)));  --rule-select-c: #8B8F5B;
  --rule-seg-w: max(1px, calc(2 * var(--u)));     --rule-seg-c: #8F7B48;
  --rule-scen-w: max(1px, calc(1.1 * var(--u)));  --rule-scen-c: #C0A75C;
  --rule-sel-w: max(2px, calc(3.2 * var(--u)));   --rule-sel-c: var(--primary);
  --rule-notice-w: max(1px, calc(2.3 * var(--u))); --rule-notice-c: #CEB674;
  --rule-pop-w: max(1px, calc(1.1 * var(--u)));   --rule-pop-c: #BBA374;
  --rule-preset-w: max(1px, calc(2 * var(--u)));  --rule-preset-c: var(--ground-deep);
  --rule-ledger-w: max(1px, calc(1.4 * var(--u))); --rule-ledger-c: #E2C992;
  --rule-ledger-head-w: max(1px, calc(1.5 * var(--u))); --rule-ledger-head-c: #D7852C;
  --rule-perf-w: max(2px, calc(4 * var(--u)));    --rule-perf-c: #FFFDE8;
  --rule-slip-w: max(1px, calc(1.4 * var(--u)));  --rule-slip-c: var(--rule-straw-c);
  --rule-summary-w: max(2px, calc(4 * var(--u))); --rule-summary-c: #F4F4DA;
  --rule-summary-sel-w: max(2px, calc(2.3 * var(--u))); --rule-summary-sel-c: #F8ECF9;
  --rule-cut-w: max(1px, calc(1.7 * var(--u)));   --rule-cut-c: #C8B78B;
  --rule-cut-div-w: max(1px, calc(1.8 * var(--u))); --rule-cut-div-c: #B9A87B;
  --rule-empty-w: max(1px, calc(1.8 * var(--u))); --rule-empty-c: rgba(124, 8, 199, .35);
  --rule-alm-seg-w: max(1px, calc(1.8 * var(--u))); --rule-alm-seg-c: #B6A46F;
  --rule-book-w: max(1px, calc(2.2 * var(--u)));  --rule-book-c: #4C6127;
  --rule-step-w: max(1px, calc(2.4 * var(--u)));  --rule-step-c: #DFC995;
  --rule-step-open-w: max(1px, calc(2.3 * var(--u))); --rule-step-open-c: #EBA84B;
  --rule-step-row-w: max(1px, calc(1.7 * var(--u))); --rule-step-row-c: #E1CD9E;
  --rule-token-w: max(2px, calc(3 * var(--u)));   --rule-token-c: var(--straw-edge);
  --rule-token-src-w: max(1px, calc(2 * var(--u))); --rule-token-src-c: #A4A77A;
  /* motion family (DESIGN.md §10) */
  --ease-settle: cubic-bezier(.22, .8, .26, 1);
  --t-quick: 160ms;
  --t-tilt: 220ms;
  --t-count: 700ms;
  --t-grow: 900ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
:where(button, input, select, textarea, fieldset) { border: 0; font: inherit; color: inherit; }
:where(button) { background: none; cursor: pointer; padding: 0; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: max(2px, calc(3 * var(--u))) solid var(--primary); outline-offset: 2px; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--ink); font: 400 var(--fs-body)/1.5 var(--f-body);
  background: var(--paper); display: flex; flex-direction: column; }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
.num, .mono { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--surface); padding: 8px 12px; }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- typography helpers for routes ---------- */
.t-hero { font: 700 var(--fs-hero)/1 var(--f-display); color: var(--ink); letter-spacing: 0; }
.t-display { font: 700 var(--fs-display)/1.05 var(--f-display); letter-spacing: -.01em; color: var(--ink); }
.t-card-title { font: 700 var(--fs-card-title)/1.1 var(--f-display); color: var(--ink); }
.t-fig { font: 700 var(--fs-fig)/1 var(--f-num); font-variant-numeric: tabular-nums; color: var(--ink); }
.t-lede { font: 400 var(--fs-lede)/1.4 var(--f-body); color: var(--ink); }
.t-label { font: 600 var(--fs-label)/1.2 var(--f-body); color: var(--ink-2); }
.t-small { font: 400 var(--fs-small)/1.35 var(--f-body); color: var(--ink-2); }
.on-dark { color: var(--straw-hi); }

/* ---------- NAV (chrome/nav.html, px → --u) ---------- */
[data-chrome="nav"] { position: relative; z-index: 50; height: var(--nav-h); font-family: var(--f-chrome); color: var(--ink); background: linear-gradient(180deg, #FFFFFF, var(--nav-strip) 55%, #FFF8EA); flex: none; }
[data-chrome="nav"] .nav-wrap { position: absolute; top: calc(26 * var(--u)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: calc(18 * var(--u)); white-space: nowrap; }
[data-chrome="nav"] .capsule { position: relative; height: calc(64 * var(--u)); display: flex; align-items: center; gap: calc(28 * var(--u)); padding: 0 calc(26 * var(--u)); border-radius: calc(32 * var(--u)); background: var(--primary-container); box-shadow: 0 calc(12 * var(--u)) calc(28 * var(--u)) rgba(0, 60, 5, .28), 0 calc(4 * var(--u)) calc(14 * var(--u)) rgba(232, 197, 138, .55); }
[data-chrome="nav"] .brand { display: flex; align-items: center; gap: calc(10 * var(--u)); font: 700 calc(25 * var(--u)) var(--f-chrome-brand); color: var(--ink); text-decoration: none; }
[data-chrome="nav"] .brand img { width: calc(34 * var(--u)); height: calc(45 * var(--u)); min-height: 36px; min-width: 27px; object-fit: contain; }
[data-chrome="nav"] a { color: var(--ink); text-decoration: none; font-size: max(13px, calc(16 * var(--u))); }
[data-chrome="nav"] .capsule > a:not(.brand) { transition: color var(--t-quick) var(--ease-settle); }
[data-chrome="nav"] .capsule > a:not(.brand):hover { color: var(--primary); }
[data-chrome="nav"] a.is-active { font-weight: 700; text-decoration: underline; text-underline-offset: calc(6 * var(--u)); text-decoration-color: var(--primary); text-decoration-thickness: max(2px, calc(3 * var(--u))); }
[data-chrome="nav"] .outside { height: calc(54 * var(--u)); display: flex; align-items: center; justify-content: center; padding: 0 calc(20 * var(--u)); border-radius: calc(18 * var(--u)); background: var(--chip-nav); box-shadow: 0 calc(9 * var(--u)) calc(22 * var(--u)) rgba(0, 60, 5, .24); font-weight: 700; font-size: max(13px, calc(16 * var(--u))); color: var(--ink); transition: transform var(--t-quick) var(--ease-settle); }
[data-chrome="nav"] .outside:hover { transform: translateY(calc(-2 * var(--u))); }
[data-chrome="nav"] .outside .ico { display: none; width: 18px; height: 18px; }
[data-chrome="nav"] .outside.is-soon { cursor: default; }
[data-chrome="nav"] .wallet { background: linear-gradient(180deg, var(--primary-hi), var(--primary)); color: #fff; padding-inline: calc(24 * var(--u)); font-family: var(--f-chrome); }
[data-chrome="nav"] .wallet.is-connected { background: var(--primary); }
.nav-menu { display: none; }
.nav-mobile { display: none; }

/* wallet picker (shared popover) */
.wallet-pop { position: absolute; z-index: 60; top: calc(96 * var(--u)); right: calc(50% - 640 * var(--u)); width: calc(295 * var(--u)); min-width: 260px; padding: calc(16 * var(--u)); border-radius: var(--r-slip); background: linear-gradient(180deg, var(--surface-container), #F6D892); box-shadow: var(--e3); font-family: var(--f-body); color: var(--ink); transform-origin: top right; animation: sheaf-unfold var(--t-tilt) var(--ease-settle); }
.wallet-pop__title { font: 700 max(15px, calc(18 * var(--u)))/1.2 var(--f-display); margin-bottom: calc(8 * var(--u)); }
.wallet-pop__list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(9 * var(--u)) 0; }
.wallet-pop__list li > button { flex: 1; text-align: left; font-weight: 600; font-size: var(--fs-body); }
.wallet-pop__list a, .wallet-pop__list .ok { font-size: var(--fs-small); color: var(--primary); font-weight: 600; }
.wallet-pop__state { font-size: var(--fs-small); color: var(--ink-2); margin-top: 6px; }
.wallet-pop__state:empty { display: none; }
.wallet-pop__acct { display: grid; gap: 8px; margin-top: 8px; font-size: var(--fs-body); }
.wallet-pop__btn { height: max(36px, calc(42 * var(--u))); border-radius: var(--r-ctl); background: var(--primary); color: #fff; font-weight: 600; }
.wallet-pop__btn.is-ghost { background: var(--chip-soft); color: var(--ink); }

/* ---------- ONE PAGE FRAME ---------- */
.frame { position: relative; flex: 1 0 auto; isolation: isolate; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); column-gap: var(--gut-l); padding-right: var(--gut-r);
  background:
    radial-gradient(calc(900 * var(--u)) calc(500 * var(--u)) at 55% calc(330 * var(--u)), rgba(231, 184, 74, .35), rgba(231, 184, 74, 0) 70%),
    linear-gradient(180deg, var(--ground-lift) 0%, var(--paper) 45%, var(--ground-deep) 100%);
}
body[data-route="home"] .frame { grid-template-columns: minmax(0, 1fr); column-gap: 0; padding-right: 0; }
body[data-route="home"] .frame-side { display: none; }
.page { position: relative; z-index: 1; min-width: 0; min-height: calc(1080 * var(--u) - var(--nav-h)); }
/* scene plates (art job declares them in ASSETS_READY.json `plates`; routes set --plate on .page or a section) */
.atm { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.atm i { position: absolute; display: block; }
.atm-glow { left: 30%; top: calc(120 * var(--u)); width: calc(900 * var(--u)); height: calc(500 * var(--u)); background: radial-gradient(closest-side, rgba(231, 184, 74, .28), rgba(231, 184, 74, 0)); }
.atm-meadow { left: 0; right: 0; top: calc(760 * var(--u)); height: calc(300 * var(--u)); opacity: .25; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 300' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%234F7A3C' stroke-width='1.4'%3E%3Cpath d='M0 40 C480 0 1200 90 1920 30'/%3E%3Cpath d='M0 95 C520 55 1240 150 1920 85'/%3E%3Cpath d='M0 155 C420 120 1300 210 1920 140'/%3E%3Cpath d='M0 215 C560 175 1180 270 1920 200'/%3E%3Cpath d='M0 275 C470 240 1260 320 1920 262'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.atm::after { content: ""; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* shared sidebar (inner routes): full page height, nothing slides under it */
.frame-side { position: relative; z-index: 1; min-width: 0; overflow: hidden; }
.frame-side__plate { position: absolute; inset: 0; z-index: -1;
  background: var(--plate-side, none) center top / cover no-repeat,
    radial-gradient(calc(500 * var(--u)) calc(380 * var(--u)) at 70% calc(260 * var(--u)), rgba(231, 184, 74, .45), rgba(231, 184, 74, 0) 70%),
    linear-gradient(180deg, #E9B266 0%, #B98A45 22%, var(--ground-lift) 42%, var(--paper) 70%, var(--ground-deep) 100%); }
.frame-side__stack { position: sticky; top: calc(24 * var(--u)); display: grid; gap: calc(28 * var(--u)); padding: calc(64 * var(--u)) calc(44 * var(--u)) calc(48 * var(--u)) calc(52 * var(--u)); }

/* ---------- shared components ---------- */
.straw-card { position: relative; border-radius: var(--r-card); background: linear-gradient(180deg, var(--surface-container), #F6D892); box-shadow: inset 0 1px 0 rgba(255, 255, 240, .6), var(--e2); color: var(--ink); }
.straw-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"); }
.straw-card.is-lift { transition: transform var(--t-tilt) var(--ease-settle); }
.straw-card.is-lift:hover { transform: translateY(calc(-3 * var(--u))); }
.pill-apricot { display: inline-block; padding: calc(10 * var(--u)) calc(26 * var(--u)); min-height: 28px; white-space: nowrap; border-radius: var(--r-pill); background: var(--primary-container); color: var(--ink); font: 400 max(14px, calc(20 * var(--u)))/1.2 var(--f-body); }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; height: calc(48 * var(--u)); min-height: 40px; padding: 0 calc(28 * var(--u)); border-radius: var(--r-ctl); background: linear-gradient(180deg, var(--primary-hi), var(--primary)); color: #fff; font: 600 max(14px, calc(20 * var(--u)))/1 var(--f-body); box-shadow: var(--e1); text-decoration: none; transition: transform var(--t-quick) var(--ease-settle); }
.btn-primary:hover { transform: translateY(calc(-2 * var(--u))); }
.btn-primary[disabled], .btn-primary[aria-disabled="true"] { background: #D8CDA0; color: #8C8462; box-shadow: none; cursor: not-allowed; transform: none; }
.input-straw { display: block; width: 100%; height: calc(48 * var(--u)); min-height: 40px; padding: 0 calc(22 * var(--u)); border-radius: var(--r-ctl); background: var(--surface-input); color: var(--ink); font: 400 max(14px, calc(20 * var(--u)))/1 var(--f-body); box-shadow: inset 0 1px 3px rgba(0, 40, 0, .18); }
.input-straw::placeholder { color: #5E6650; }
.seg { display: inline-flex; padding: calc(3 * var(--u)); border-radius: var(--r-pill); background: var(--surface-input); }
.seg > button { height: calc(40 * var(--u)); min-height: 32px; padding: 0 calc(22 * var(--u)); border-radius: var(--r-pill); font: 600 var(--fs-body)/1 var(--f-body); color: var(--ink); transition: background-color var(--t-quick) var(--ease-settle), color var(--t-quick) var(--ease-settle); }
.seg > button[aria-pressed="true"], .seg > button.is-on { background: var(--primary); color: #fff; }
.status-pill { display: inline-flex; align-items: center; height: calc(28 * var(--u)); min-height: 20px; padding: 0 calc(12 * var(--u)); border-radius: var(--r-pill); font: 600 var(--fs-small)/1 var(--f-body); color: var(--ink); }
.status-pill[data-status="growing"] { background: var(--st-growing); }
.status-pill[data-status="ripe"] { background: var(--st-ripe); }
.status-pill[data-status="repaid"] { background: var(--st-repaid); }
.status-pill[data-status="lost"] { background: var(--st-lost); }
.amt-gain { color: var(--gain); } .amt-loss { color: var(--loss); }
.src-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-body); }
.src-link::after { content: " ↗"; }
.snapshot-note { font-size: var(--fs-small); color: var(--ink-2); }

/* sidebar cards */
.side-held { padding: calc(28 * var(--u)) calc(30 * var(--u)) calc(30 * var(--u)); text-align: center; }
.side-held__title { display: flex; align-items: center; justify-content: center; gap: calc(12 * var(--u)); font: 700 var(--fs-card-title)/1.1 var(--f-display); }
.side-held__ico { width: calc(54 * var(--u)); height: calc(54 * var(--u)); flex: none; }
.side-held__fig { margin: calc(16 * var(--u)) 0 calc(14 * var(--u)); font: 700 var(--fs-fig)/1 var(--f-num); font-variant-numeric: tabular-nums; }
.token-card { padding: calc(26 * var(--u)) calc(30 * var(--u)) calc(22 * var(--u)); }
.token-card__head { display: flex; gap: calc(18 * var(--u)); align-items: flex-start; }
.token-card__mark { width: calc(62 * var(--u)); height: calc(100 * var(--u)); min-height: 40px; object-fit: contain; flex: none; }
.token-card__name { font: 700 calc(44 * var(--u))/1 var(--f-display); }
.token-card__on, .token-card__ca { font: 400 max(13px, calc(21 * var(--u)))/1.35 var(--f-body); margin-top: calc(6 * var(--u)); }
.copy-btn { font: 600 var(--fs-small)/1 var(--f-body); color: var(--primary); text-decoration: underline; }
.buy-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: calc(48 * var(--u)); min-height: 36px; margin-top: calc(18 * var(--u)); border-radius: var(--r-pill); background: #D8CDA0; color: #8C8462; font: 600 max(14px, calc(22 * var(--u)))/1 var(--f-body); cursor: not-allowed; text-decoration: none; }
.buy-btn[data-launch-done] { background: linear-gradient(180deg, var(--primary-hi), var(--primary)); color: #fff; cursor: pointer; box-shadow: var(--e1); }
.token-card__note { margin-top: calc(12 * var(--u)); font: italic 400 var(--fs-label)/1.35 var(--f-body); color: var(--ink); }
[data-launch="ca-short"] { white-space: nowrap; font-family: var(--f-num); }

/* ---------- FOOTER (chrome/footer.html) ---------- */
[data-chrome="footer"] { position: relative; z-index: 2; flex: none; height: calc(64 * var(--u)); min-height: 48px; display: flex; align-items: center; gap: calc(16 * var(--u)); padding: 0 calc(52 * var(--u)); background: var(--footer); color: #F7E8BF; font: max(12px, calc(15 * var(--u))) var(--f-chrome); }
[data-chrome="footer"] .footer-mark { width: calc(22 * var(--u)); height: calc(36 * var(--u)); min-height: 24px; min-width: 15px; object-fit: contain; flex: none; }
[data-chrome="footer"] .footer-line { flex: 1; min-width: 0; }
[data-chrome="footer"] .links { display: flex; gap: calc(30 * var(--u)); }
[data-chrome="footer"] a { color: #F7E8BF; text-underline-offset: 4px; }

/* ---------- RULE CLASSES (one per framed component in BORDER_TABLE / DESIGN.md §4b) ----------
   Only these classes draw lines. Adjacent rows draw only their bottom edge (no doubled lines); last row drops it. */
.rule-nav-pill { border-bottom: var(--rule-nav-w) solid var(--rule-nav-c); }
.rule-row { border-bottom: var(--rule-row-w) solid var(--rule-row-c); }
.rule-row:last-child { border-bottom: 0; }
.rule-card-lip { border-bottom: var(--rule-lip-w) solid var(--rule-lip-c); }
.rule-divider-v { border-left: var(--rule-div-w) solid var(--rule-div-c); }
.rule-fact-row { border-bottom: var(--rule-fact-w) solid var(--rule-fact-c); }
.rule-fact-row:last-child { border-bottom: 0; }
.rule-footer { border-top: var(--rule-footer-w) solid var(--rule-footer-c); }
.rule-receipt-row { border-bottom: var(--rule-receipt-w) solid var(--rule-receipt-c); }
.rule-select { border: var(--rule-select-w) solid var(--rule-select-c); border-radius: var(--r-slip); }
.rule-seg { border: var(--rule-seg-w) solid var(--rule-seg-c); border-radius: var(--r-pill); }
.rule-seg > * + * { border-left: var(--rule-seg-w) solid var(--rule-seg-c); }
.rule-scenario-card { border-bottom: var(--rule-scen-w) solid var(--rule-scen-c); }
.rule-card-selected { border: var(--rule-sel-w) solid var(--rule-sel-c); border-radius: var(--r-card); box-shadow: 0 0 0 calc(3 * var(--u)) rgba(124, 8, 199, .18), var(--e2); }
.rule-notice-row { border-bottom: var(--rule-notice-w) solid var(--rule-notice-c); }
.rule-pop { border-bottom: var(--rule-pop-w) solid var(--rule-pop-c); }
.rule-pop:last-child { border-bottom: 0; }
.rule-preset { border: var(--rule-preset-w) solid var(--rule-preset-c); border-radius: calc(10 * var(--u)); }
.rule-ledger-row { border-bottom: var(--rule-ledger-w) solid var(--rule-ledger-c); }
.rule-ledger-head { border-bottom: var(--rule-ledger-head-w) solid var(--rule-ledger-head-c); }
.rule-receipt-perf { border: var(--rule-perf-w) dashed var(--rule-perf-c); border-radius: var(--r-slip); }
.rule-receipt-perf-row { border-bottom: max(1px, calc(1.5 * var(--u))) solid var(--rule-row-c); }
.rule-slip-open { border-bottom: var(--rule-slip-w) solid var(--rule-slip-c); }
.rule-summary-card { border: var(--rule-summary-w) solid var(--rule-summary-c); border-radius: var(--r-card); }
.rule-summary-selected { border: var(--rule-summary-sel-w) solid var(--rule-summary-sel-c); border-radius: var(--r-card); }
.rule-cut-row { border-bottom: var(--rule-cut-w) solid var(--rule-cut-c); }
.rule-cut-row:last-child { border-bottom: 0; }
.rule-cut-divider { border-left: var(--rule-cut-div-w) solid var(--rule-cut-div-c); }
.rule-empty-dashed { border: var(--rule-empty-w) dashed var(--rule-empty-c); border-radius: calc(22 * var(--u)); }
.rule-alm-seg { border: var(--rule-alm-seg-w) solid var(--rule-alm-seg-c); border-radius: var(--r-pill); }
.rule-book-head { border-bottom: var(--rule-book-w) solid var(--rule-book-c); }
.rule-step { border-bottom: var(--rule-step-w) solid var(--rule-step-c); }
.rule-step-open { border-left: var(--rule-step-open-w) solid var(--rule-step-open-c); border-right: var(--rule-step-open-w) solid var(--rule-step-open-c); border-radius: var(--r-slip); }
.rule-step-row { border-bottom: var(--rule-step-row-w) solid var(--rule-step-row-c); }
.rule-step-row:last-child { border-bottom: 0; }
.rule-token-card { border-bottom: var(--rule-token-w) solid var(--rule-token-c); border-radius: var(--r-card); }
.rule-token-src { border-bottom: var(--rule-token-src-w) solid var(--rule-token-src-c); }
.rule-pop-frame { border: 0; }
/* an input wrapped by a frame: the frame owns padding, the control fills it */
.rule-select > :is(input, select, button) { width: 100%; background: transparent; }

/* ---------- MOTION (DESIGN.md §10 — grow from the ground, cut notches, settle; transform/opacity only) ---------- */
@keyframes sheaf-grow { from { opacity: 0; transform: translateY(calc(14 * var(--u))) scaleY(.92); } to { opacity: 1; transform: none; } }
@keyframes sheaf-notch { from { opacity: 0; transform: scaleY(0); } 70% { opacity: 1; transform: scaleY(1.08); } to { opacity: 1; transform: scaleY(1); } }
@keyframes sheaf-sway { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(calc(2 * var(--u))) rotate(.15deg); } }
@keyframes sheaf-stalk { 0%, 100% { transform: rotate(-.8deg); } 50% { transform: rotate(.8deg); } }
@keyframes sheaf-settle { from { opacity: 0; transform: translateY(calc(12 * var(--u))) scaleY(.985); } to { opacity: 1; transform: none; } }
@keyframes sheaf-unfold { from { opacity: 0; transform: scaleY(.9) translateY(calc(-6 * var(--u))); } to { opacity: 1; transform: none; } }
@keyframes sheaf-ripen { 0% { opacity: .0; } 30% { opacity: .9; } 100% { opacity: 0; } }
/* grow-in: blocks rise out of the field from their base */
.js [data-grow]:not(.is-grown) { opacity: 0; }
[data-grow] { transform-origin: 50% 100%; }
[data-grow].is-grown { animation: sheaf-grow var(--t-grow) var(--ease-settle) both; animation-delay: var(--grow-delay, 0ms); }
/* wheat / bar height: element scales up from the ground to its data height */
[data-grow-y] { transform-origin: 50% 100%; transform: scaleY(var(--grow-from, 0)); transition: transform var(--t-grow) var(--ease-settle); }
[data-grow-y].is-grown { transform: scaleY(1); }
/* tally notches: each child is cut in turn */
[data-notch] > * { transform-origin: 50% 100%; }
[data-notch].is-cut > * { animation: sheaf-notch 260ms var(--ease-settle) both; animation-delay: calc(var(--i, 0) * 80ms); }
.js [data-notch]:not(.is-cut) > * { opacity: 0; }
/* the dashed ripe string sways like a fence wire */
[data-sway] { animation: sheaf-sway 6s ease-in-out infinite; }
[data-stalk] { transform-origin: 50% 100%; animation: sheaf-stalk 5.5s ease-in-out infinite; }
/* live tick: a straw-gold glint under the value when a live read replaces the snapshot */
[data-cell] { position: relative; }
[data-cell].is-ripened::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--ripe-line); animation: sheaf-ripen 1.2s var(--ease-settle) both; pointer-events: none; }
/* route change: the field settles in from its base */
.page.is-entering { animation: sheaf-settle 260ms var(--ease-settle) both; transform-origin: 50% 0; }
.page.is-leaving { opacity: .55; transition: opacity 120ms linear; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  [data-sway], [data-stalk] { animation: none !important; }
  .js [data-grow]:not(.is-grown), .js [data-notch]:not(.is-cut) > * { opacity: 1; }
  [data-grow-y] { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  :root { --u: .62px; --side-w: 100%; --gut-l: 0px; --gut-r: 0px; --fs-hero: 44px; --fs-display: 34px; --fs-card-title: 24px; --fs-fig: 34px; }
  .frame { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .frame-side__stack { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); padding: 20px 16px; }
  .frame-side .side-held { display: none; }
  .page { min-height: 60vh; }
  .wallet-pop { right: 12px; top: 64px; }
}
@media (max-width: 767px) {
  [data-chrome="nav"] { height: 64px; }
  [data-chrome="nav"] .nav-wrap { top: 8px; left: 8px; right: 8px; transform: none; gap: 8px; }
  [data-chrome="nav"] .capsule { height: 48px; padding: 0 14px; gap: 14px; flex: 1; min-width: 0; }
  [data-chrome="nav"] .capsule > a:not(.brand) { display: none; }
  [data-chrome="nav"] .brand { font-size: 20px; }
  [data-chrome="nav"] .brand img { width: 24px; height: 38px; min-height: 0; }
  [data-chrome="nav"] .outside { height: 44px; width: 44px; padding: 0; border-radius: 14px; }
  [data-chrome="nav"] .outside .lbl { display: none; }
  [data-chrome="nav"] .outside .ico { display: block; }
  [data-chrome="nav"] .wallet { width: auto; padding: 0 12px; font-size: 13px; }
  .nav-menu { display: grid; place-content: center; gap: 4px; width: 44px; height: 44px; border-radius: 14px; background: var(--chip-nav); flex: none; }
  .nav-menu span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
  .nav-mobile:not([hidden]) { display: grid; position: absolute; top: 64px; left: 8px; right: 8px; z-index: 55; padding: 8px; border-radius: 16px; background: var(--primary-container); box-shadow: var(--e3); animation: sheaf-unfold var(--t-tilt) var(--ease-settle); }
  .nav-mobile a { padding: 12px 14px; font-size: 16px; text-decoration: none; color: var(--ink); }
  .nav-mobile a.is-active { font-weight: 700; text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 6px; text-decoration-thickness: 3px; }
  [data-chrome="footer"] { height: auto; flex-wrap: wrap; padding: 14px 16px; gap: 10px; }
  [data-chrome="footer"] .footer-line { flex-basis: calc(100% - 40px); }
}
@media (max-width: 400px) { [data-chrome="nav"] .brand span { display: none; } }
