/* =========================================================================
   JEVSTOCKS design system  ·  css/jev.css
   Tokens, base rules and every component shared across pages.
   Look: typesafe.ai. Paper white, ink black, a pink band with a dot grid, retro
   System 1 windows (1.5px ink borders, black title bars, hard shadows), Die Grotesk C
   for display type, LisaTerminal pixel labels, JetBrains Mono for numbers.
   Page-specific CSS lives in each page's own file or <style>. Do not redefine
   the classes in this file; add a page-prefixed modifier instead.
   Breakpoints (max-width): 1080px and 760px. Catalogue: tools/FOUNDATION.md.
   ========================================================================= */

/* ---------- tokens ---------- */
:root {
  --paper: #FEFEFE; --ink: #1E1E1E;
  --bg: var(--paper);
  --s1: #FFFFFF; --s2: #F3F3F3; --s3: #E9E9E9;
  --hair: #DEDEDE; --hair2: #C4C4C4;
  --t1: #1E1E1E; --t2: #444444; --t3: #5E5E5E;
  --pink: #F386A1; --pink-2: #F9B4C5; --pink-ink: #5A2436;
  --mag: #E84ABE; --mag-ink: #B41E8C;
  --acc: #0000EE; --acc-a: #0000EE; --acc-b: #3B3BFF; --acc-c: #7A7AFF;
  --grad: var(--mag);
  --acc-ink: var(--paper);
  --acc-dim: rgba(0,0,238,.07); --acc-glow: rgba(0,0,238,.35);
  --pt: var(--mag-ink); --pt-grad: var(--mag); --pt-dim: rgba(232,74,190,.12);
  --yt: var(--acc); --yt-grad: var(--acc); --yt-dim: var(--acc-dim);
  --amb: #8A5A00; --amb-dim: rgba(227,185,60,.22);
  --red: #C62828; --red-dim: rgba(198,40,40,.10);
  --sage: #ABBAB9;

  --f-xs: 11px; --f-sm: 12.5px; --f-md: 14px; --f-lg: 18px; --f-xl: 28px; --f-2xl: 44px;
  --display: "Die Grotesk C", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pixel: "LisaTerminal", "JetBrains Mono", ui-monospace, monospace;

  --line: 1.5px;
  --r-xs: 0; --r-sm: 0; --r-md: 0; --r-lg: 0; --r-xl: 0;
  --nav-h: 64px; --gutter: 24px;
  --w-page: 1344px; --w-read: 1120px; --w-doc: 800px;
  --focus: var(--mag);
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-pop: 6px 6px 0 var(--ink);
  color-scheme: light;
}
@media (max-width: 760px) { :root { --nav-h: 56px; --gutter: 16px; } }

/* Section moods. A band re-scopes the tokens so every component inside just works. */
.on-pink {
  --bg: var(--pink); --s1: #FFFFFF; --s2: rgba(255,255,255,.55); --s3: rgba(255,255,255,.85);
  --hair: rgba(30,30,30,.18); --hair2: rgba(30,30,30,.32); --t2: #3A1F28; --t3: var(--pink-ink);
  background-color: var(--pink); color: var(--t1);
}
.on-dark {
  --bg: var(--ink); --paper: #1E1E1E; --ink: #FEFEFE;
  --s1: #262626; --s2: #2E2E2E; --s3: #3A3A3A;
  --hair: rgba(255,255,255,.14); --hair2: rgba(255,255,255,.26);
  --t1: #FEFEFE; --t2: #D6D6D6; --t3: #A9A9A9;
  --acc: #9A9AFF; --acc-dim: rgba(154,154,255,.12); --pt: #FF8AD9; --mag-ink: #FF8AD9; --amb: #F0C24B; --red: #FF7A6E;
  --shadow-hard: 4px 4px 0 #000; --shadow-pop: 6px 6px 0 #000;
  background-color: #1E1E1E; color: var(--t1); color-scheme: dark;
}
.on-sage { --bg: var(--sage); --s2: rgba(255,255,255,.5); --s3: rgba(255,255,255,.8); --hair: rgba(30,30,30,.18); --hair2: rgba(30,30,30,.32); --t3: #34403F; --mag-ink: #7A125F; --pt: #7A125F; background-color: var(--sage); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
/* html owns the page colour. body must stay transparent: an opaque body background
   paints above the fixed z-index:-1 layers and hides the video, dot field and mark. */
body {
  color: var(--t1);
  font-family: var(--sans); font-size: var(--f-md); line-height: 1.5;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: 500; line-height: 1.2; }
p { overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font: inherit; color: inherit; }
img, video { max-width: 100%; }
table { border-collapse: collapse; }
code, kbd, pre, samp { font-family: var(--mono); }
code { font-size: .95em; }
::selection { background: var(--mag); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--w-page); margin-inline: auto; padding-inline: var(--gutter); position: relative; }
.wrap-read { max-width: var(--w-read); }
.wrap-doc { max-width: var(--w-doc); }
.g2, .g3, .g4 { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 > *, .g3 > *, .g4 > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.hstack { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.divider { height: 1px; background: var(--hair); border: 0; }
/* The dot grid typesafe prints on its pink bands. Works on paper too. */
.dots { background-image: radial-gradient(rgba(30,30,30,.20) .9px, transparent 1.1px); background-size: 7px 7px; }
.on-dark.dots { background-image: radial-gradient(rgba(255,255,255,.16) .9px, transparent 1.1px); }
/* Corner ticks around a section, like the ┌ ┐ └ ┘ marks on typesafe.ai. */
.ticks { position: relative; }
.ticks::before, .ticks::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.ticks::before { left: 0; top: 0; border-top: var(--line) solid var(--ink); border-left: var(--line) solid var(--ink); }
.ticks::after { right: 0; bottom: 0; border-bottom: var(--line) solid var(--ink); border-right: var(--line) solid var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(254,254,254,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: var(--line) solid var(--ink);
}
.nav-in {
  max-width: var(--w-page); margin-inline: auto; height: var(--nav-h);
  padding-inline: var(--gutter); display: flex; align-items: center; gap: 28px; position: relative;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--t1); flex: none; min-height: 40px; }
.brand:hover { color: var(--t1); }
.brand-logo { width: 28px; height: 28px; border-radius: 0; display: block; flex: none; image-rendering: -webkit-optimize-contrast; }
.brand-word { font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: -.02em; line-height: 1; }
.nav-menu { display: flex; align-items: center; gap: 24px; font-size: var(--f-md); min-width: 0; }
.nav-link { color: var(--t2); white-space: nowrap; transition: color .15s; }
.nav-link:hover, .nav-link.is-on { color: var(--t1); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.nav-menu-extra { display: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.nav-connect { min-width: 84px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nav-connect:hover { background: var(--mag); border-color: var(--mag); color: #fff; }
.nav-burger {
  display: none; width: 40px; height: 40px; border: var(--line) solid var(--ink); background: var(--s1);
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none;
}
.nav-burger:hover { background: var(--s2); }
.nav-burger i { display: block; width: 16px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.nav-burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding-inline: 14px; border-radius: 0;
  background: var(--s1); color: var(--ink); border: var(--line) solid var(--ink);
  font-size: var(--f-sm); font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
  -webkit-user-select: none; user-select: none; text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--ink); color: var(--paper); font-weight: 500; }
.btn-primary:hover { background: var(--mag); border-color: var(--mag); color: #fff; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-warn { background: var(--amb); border-color: var(--amb); color: #fff; font-weight: 500; }
.btn-warn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-lg { height: 46px; padding-inline: 22px; font-size: var(--f-md); }
.btn-sm { height: 28px; padding-inline: 11px; font-size: var(--f-xs); }
.btn-block { display: flex; width: 100%; }
.btn-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 10px 16px; border: var(--line) solid var(--ink);
  background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 500; line-height: 1.25; text-align: center;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-cta:hover { background: var(--mag); border-color: var(--mag); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--s2); color: var(--t3); border-color: var(--hair2); cursor: not-allowed; }
.btn-primary:disabled, .btn-primary[aria-disabled="true"],
.btn-cta:disabled, .btn-cta[aria-disabled="true"] { background: var(--s2); color: var(--t3); border-color: var(--hair2); }
.btn.is-connected { font-family: var(--mono); font-weight: 400; }
.btn.is-wrong { background: var(--amb-dim); color: var(--amb); border-color: var(--amb); }
.btn.is-done { background: var(--acc-dim); color: var(--acc); border-color: var(--acc); }
.btn[aria-busy="true"] { cursor: progress; }
.btn .icon { width: 14px; height: 14px; }
.link { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--mag-ink); }

/* ---------- pills, dots, badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding-inline: 10px;
  border: var(--line) solid var(--hair2); background: var(--s1); color: var(--t2);
  font-family: var(--pixel); font-size: 12px; letter-spacing: .02em; line-height: 1; white-space: nowrap; text-transform: uppercase;
}
.pill-sm { height: 26px; padding-inline: 8px; font-size: 11px; gap: 6px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 0; background: var(--t3); flex: none; }
.dot-live, .pill-live .dot { background: var(--acc); box-shadow: none; }
.dot-pre, .pill-pre .dot { background: var(--mag); box-shadow: none; }
.dot-bad { background: var(--red); }
.pill-status { border-color: var(--ink); color: var(--ink); }
.pill-buy { border-color: var(--hair2); color: var(--t3); border-style: dashed; }
.pill-buy[aria-disabled="true"] { cursor: default; }
a.pill-buy { background: var(--ink); border: var(--line) solid var(--ink); color: var(--paper); font-weight: 500; }
a.pill-buy:hover { background: var(--mag); border-color: var(--mag); color: #fff; }
.pill-ca { border-color: var(--ink); color: var(--ink); font-weight: 500; cursor: pointer; }
.pill-ca:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.pill-ca:disabled { color: var(--t3); border-color: var(--hair2); cursor: default; }
.pill-ca.is-done { color: var(--acc); border-color: var(--acc); }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding-inline: 7px; border: 1px solid var(--hair2);
  background: var(--s1); color: var(--t2); font-family: var(--pixel); font-size: 11px; font-weight: 500;
  letter-spacing: .02em; line-height: 1; white-space: nowrap; vertical-align: middle; text-transform: uppercase;
}
.badge-ok { border-color: var(--acc); color: var(--acc); }
.badge-pt { border-color: var(--mag-ink); color: var(--mag-ink); }
.badge-amb { border-color: var(--amb); color: var(--amb); }
.badge-red { border-color: var(--red); color: var(--red); }

/* ---------- icons (inline SVG, stroke currentColor) ---------- */
.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }
.spinner { display: inline-block; width: 14px; height: 14px; flex: none; border: 2px solid var(--hair2); border-top-color: var(--ink); animation: jev-spin .8s steps(8) infinite; }
@keyframes jev-spin { to { transform: rotate(360deg); } }

/* ---------- fields and inputs ---------- */
.field { background: var(--s1); border: var(--line) solid var(--ink); padding: 14px 16px; transition: box-shadow .15s; }
.field:focus-within { box-shadow: 0 0 0 2px var(--mag); }
.field-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); margin-bottom: 8px; min-width: 0; }
.field-bal { color: var(--t2); white-space: nowrap; }
button.field-bal:hover { color: var(--mag-ink); }
.field-mid { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-width: 0; }
.field-input {
  font-family: var(--mono); font-size: var(--f-xl); font-weight: 400; letter-spacing: -.01em;
  width: 100%; min-width: 0; background: none; border: 0; outline: none; padding: 0; color: var(--t1);
}
.field-input::placeholder { color: var(--t3); }
.field-input:focus-visible { outline: none; }
.label { display: block; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); margin-bottom: 6px; }
.input, .textarea, .select {
  display: block; width: 100%; min-height: 40px; background: var(--s1); color: var(--t1);
  border: var(--line) solid var(--ink); border-radius: 0; padding: 9px 12px; font-size: var(--f-md); line-height: 1.4; outline: none;
  transition: box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--t3); }
.input:focus, .textarea:focus, .select:focus { box-shadow: 0 0 0 2px var(--mag); }
.textarea { min-height: 72px; resize: vertical; }
.select { -webkit-appearance: none; appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------- token chips and icons ---------- */
.tok {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: var(--line) solid var(--ink);
  background: var(--s1); color: var(--t1); font-size: var(--f-sm); font-weight: 500; line-height: 1.2;
  white-space: nowrap; flex: none;
}
button.tok:hover { background: var(--s2); }
.tokline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.ico {
  display: inline-block; width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #E6E6E6, #9A9A9A);
  box-shadow: 0 0 0 1px var(--hair2);
}
.ico-pt { background: var(--mag); }
.ico-yt { background: var(--acc); }
.ico-eth { background: linear-gradient(135deg, #8C9EEA, #4A5BB5); }
.ico-usdg { background: linear-gradient(135deg, #7CD9BB, #2C9A83); }
.ico-jev { background: var(--mag) url("/img/jev-64.png") center / cover no-repeat; border-radius: 0; }
.ico-sm { width: 16px; height: 16px; }
.ico-md { width: 18px; height: 18px; }
.ico-lg { width: 32px; height: 32px; }
/* Real stock logos: any .ico carrying data-stock="TICKER" shows /img/stocks/TICKER.png (js/logos.js sets it). */
.ico[data-stock] { background-color: #fff; background-position: center; background-size: cover; background-repeat: no-repeat; box-shadow: 0 0 0 1px var(--ink); }
.ico[data-stock="AAPL"] { background-image: url("/img/stocks/AAPL.png"); }
.ico[data-stock="SPY"] { background-image: url("/img/stocks/SPY.png"); }
.ico[data-stock="QQQ"] { background-image: url("/img/stocks/QQQ.png"); }
.ico[data-stock="PFE"] { background-image: url("/img/stocks/PFE.png"); }
.ico[data-stock="SCHD"] { background-image: url("/img/stocks/SCHD.png"); }
.ico[data-stock="NVDA"] { background-image: url("/img/stocks/NVDA.png"); }
.ico[data-stock="MSFT"] { background-image: url("/img/stocks/MSFT.png"); }
.ico[data-stock="SGOV"] { background-image: url("/img/stocks/SGOV.png"); }
.ico[data-stock="JNJ"] { background-image: url("/img/stocks/JNJ.png"); }
.ico[data-stock="GOOGL"] { background-image: url("/img/stocks/GOOGL.png"); }
.ico[data-stock="META"] { background-image: url("/img/stocks/META.png"); }
.ico[data-stock="COST"] { background-image: url("/img/stocks/COST.png"); }
.ico[data-stock="XOM"] { background-image: url("/img/stocks/XOM.png"); }
.ico[data-stock="AVGO"] { background-image: url("/img/stocks/AVGO.png"); }
.ico[data-stock="LLY"] { background-image: url("/img/stocks/LLY.png"); }
/* Principal and yield legs keep their stock's logo, told apart by a coloured ring and a corner square. */
.ico-pt[data-stock], .ico-yt[data-stock] { position: relative; }
.ico-pt[data-stock] { box-shadow: 0 0 0 1.5px var(--s1), 0 0 0 3px var(--mag); }
.ico-yt[data-stock] { box-shadow: 0 0 0 1.5px var(--s1), 0 0 0 3px var(--acc); }
.ico-pt[data-stock]::after, .ico-yt[data-stock]::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--s1); }
.ico-pt[data-stock]::after { background: var(--mag); }
.ico-yt[data-stock]::after { background: var(--acc); }

/* ---------- receive legs and the cleave ---------- */
.legs { background: var(--s1); border: var(--line) solid var(--ink); overflow: hidden; }
.legs-head, .legs-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); padding-inline: 16px; }
.legs-head { padding-block: 10px 4px; }
.legs-foot { padding-block: 10px; border-top: 1px solid var(--hair); }
.legs-foot b { color: var(--t1); font-weight: 500; font-family: var(--mono); text-transform: none; }
.leg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; }
.leg + .leg { border-top: 1px solid var(--hair); }
.leg-name { font-weight: 500; min-width: 0; overflow-wrap: break-word; }
.leg-name small { display: block; margin-top: 2px; font-size: var(--f-xs); font-weight: 400; color: var(--t3); }
.leg-val { font-family: var(--mono); font-size: var(--f-lg); font-weight: 400; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.leg-val small { display: block; margin-top: 2px; font-size: var(--f-xs); font-weight: 400; color: var(--t3); }
.leg-val.is-pt { color: var(--pt); }
.leg-val.is-yt { color: var(--yt); }
.cleave { height: 28px; display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); }
.cleave::before, .cleave::after { content: ""; display: block; width: 90px; height: 0; border-top: 1.5px dashed var(--hair2); }

/* ---------- cards (windows) ---------- */
.card { background: var(--s1); border: var(--line) solid var(--ink); padding: 20px 22px; min-width: 0; }
.card-win { box-shadow: var(--shadow-hard); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card-h { font-family: var(--pixel); font-size: 13px; text-transform: uppercase; font-weight: 500; color: var(--t1); }
.card-title { font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 8px; }
.card-text { color: var(--t2); font-size: var(--f-sm); }
.card-text b { color: var(--t1); font-weight: 500; }
.hint { font-size: var(--f-sm); color: var(--t3); }
/* Inverse pixel label, like the [Not Chat] tags on typesafe.ai. */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; padding: 4px 6px; background: var(--ink); color: var(--paper); margin-bottom: 10px; }
.eyebrow-pt { background: var(--mag-ink); color: #fff; }
.eyebrow-amb { background: var(--amb); color: #fff; }
/* Retro window with a black title bar. */
.win { background: var(--s1); border: var(--line) solid var(--ink); box-shadow: var(--shadow-hard); min-width: 0; }
.win-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; padding: 3px 8px; background: var(--ink); color: var(--paper); font-family: var(--pixel); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.win-bar b { font-weight: 500; }
.win-body { padding: 16px 18px; }
.win-foot { padding: 10px 18px; border-top: var(--line) solid var(--ink); background: var(--s2); font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); }

/* ---------- kv rows ---------- */
.kvs { display: flex; flex-direction: column; }
.kvs-box { background: var(--s1); border: var(--line) solid var(--ink); padding: 4px 18px; }
.kvs-box > .kv:first-child, .kvs-flush > .kv:first-child { border-top: 0; }
.kv {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; row-gap: 2px;
  min-height: 44px; padding-block: 10px; border-top: 1px solid var(--hair); font-size: var(--f-sm);
}
.kv .k { color: var(--t2); }
.kv .v { margin-left: auto; min-width: 0; font-family: var(--mono); color: var(--t1); text-align: right; overflow-wrap: anywhere; }
.kv .v a { color: var(--t1); text-decoration: underline; text-underline-offset: 2px; }
.kv .v a:hover { color: var(--mag-ink); }
.kv .v.is-acc { color: var(--acc); }
.kv .v.is-pt { color: var(--pt); }
.kv .v.is-amb { color: var(--amb); }
.kv .v.is-red { color: var(--red); }
.kv .v.is-dim { color: var(--t3); }
.kv-sect { font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); margin: 18px 0 4px; }
.kv-sect:first-child { margin-top: 0; }

/* ---------- KPI tiles, progress, states ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--s1); border: var(--line) solid var(--ink); padding: 12px 14px; min-width: 0; }
.kpi-l { font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); margin-bottom: 6px; }
.kpi-n { font-family: var(--display); font-size: 24px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.kpi-s { font-size: var(--f-xs); color: var(--t3); margin-top: 4px; }
.progress { height: 6px; border: 1px solid var(--ink); background: var(--s1); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .6s steps(12); }
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 20px; text-align: center; font-size: var(--f-sm); color: var(--t3); }
.state-inline { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; padding: 0; gap: 8px; text-align: left; }
.state-fail { color: var(--t2); }
.state-fail .icon { color: var(--red); }

/* ---------- tables ---------- */
.table-wrap {
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  border: var(--line) solid var(--ink);
  background:
    linear-gradient(90deg, var(--s1) 30%, rgba(255,255,255,0)) left center / 36px 100% no-repeat local,
    linear-gradient(270deg, var(--s1) 30%, rgba(255,255,255,0)) right center / 36px 100% no-repeat local,
    linear-gradient(90deg, rgba(30,30,30,.10), rgba(30,30,30,0)) left center / 12px 100% no-repeat scroll,
    linear-gradient(270deg, rgba(30,30,30,.10), rgba(30,30,30,0)) right center / 12px 100% no-repeat scroll,
    var(--s1);
}
.table { width: 100%; min-width: 720px; border-collapse: collapse; font-family: var(--mono); font-size: var(--f-sm); }
.table-fit { min-width: 0; }
.table th { text-align: left; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; font-weight: 400; color: var(--t3); padding: 12px 16px; border-bottom: var(--line) solid var(--ink); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--hair); color: var(--t2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table td.sym { color: var(--t1); font-family: var(--sans); font-weight: 500; }
.table td.sym small { display: block; margin-top: 3px; font-family: var(--mono); font-size: var(--f-xs); font-weight: 400; color: var(--t3); }
.table td.state { display: table-cell; text-align: center; padding: 28px 16px; color: var(--t3); font-family: var(--sans); }

/* ---------- tabs, segmented controls, choice chips ---------- */
.tabs { display: inline-flex; gap: 0; max-width: 100%; padding: 0; border: var(--line) solid var(--ink); background: var(--s1); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; justify-content: center; padding: 7px 14px; font-size: var(--f-sm); font-weight: 500; line-height: 1.5; color: var(--t2); white-space: nowrap; transition: color .15s, background-color .15s; }
.tab + .tab { border-left: var(--line) solid var(--ink); }
.tab:hover:not(.is-on):not(:disabled) { color: var(--t1); background: var(--s2); }
.tab.is-on, .tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab:disabled { color: var(--t3); }
.seg { display: inline-flex; gap: 0; padding: 0; border: var(--line) solid var(--ink); background: var(--s1); }
.seg-item { display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; font-size: var(--f-xs); line-height: 1.5; color: var(--t3); white-space: nowrap; }
.seg-item + .seg-item { border-left: var(--line) solid var(--ink); }
.seg-item.is-on, .seg-item[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
button.seg-item:hover:not(.is-on) { color: var(--t1); background: var(--s2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 12px; border: var(--line) solid var(--hair2); background: var(--s1); color: var(--t2); font-size: var(--f-sm); white-space: nowrap; transition: color .15s, background-color .15s, border-color .15s; }
.chip:hover:not(.is-on):not(:disabled) { color: var(--t1); border-color: var(--ink); }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:disabled { color: var(--t3); }

/* ---------- section headers ---------- */
.sec { padding-top: 80px; }
.sec-title { font-family: var(--display); font-size: clamp(30px, 4.2vw, 54px); font-weight: 500; letter-spacing: -.035em; line-height: .98; margin-bottom: 14px; }
.sec-sub { color: var(--t2); font-size: 15px; max-width: 640px; margin-bottom: 28px; }
.sec-sub b { color: var(--t1); font-weight: 500; }
.page-title { font-family: var(--display); font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; letter-spacing: -.03em; line-height: 1.02; margin: 56px 0 10px; }
.page-lead { color: var(--t2); font-size: 15px; max-width: 680px; margin-bottom: 28px; }
.page-lead b { color: var(--t1); font-weight: 500; }
.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin: 44px 0 14px; font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; color: var(--t1); }
.sec-num { font-family: var(--pixel); font-size: 12px; font-weight: 400; color: var(--mag-ink); letter-spacing: 0; }
.sec-aside { margin-left: auto; font-family: var(--pixel); font-size: 12px; font-weight: 400; color: var(--t3); letter-spacing: 0; text-transform: uppercase; }
.note { font-size: var(--f-sm); color: var(--t3); margin-top: 12px; line-height: 1.55; }
.note b { color: var(--t2); font-weight: 500; }
.grad-text { color: var(--mag-ink); }

/* ---------- code ---------- */
.code, .math {
  display: block; max-width: 100%; overflow-x: auto; white-space: pre; tab-size: 2;
  background: var(--s2); border: 1px solid var(--hair2); padding: 16px 18px;
  font-family: var(--mono); font-size: var(--f-sm); line-height: 1.7; color: var(--t2);
}
.math { color: var(--t1); padding-block: 14px; }
.code b, .math b { color: var(--t1); font-weight: 500; }
.code .c, .math .c { color: var(--t3); }
.code .hl, .math .hl { color: var(--acc); }
.code .pt, .math .pt { color: var(--pt); }
.code .s { color: var(--amb); }
code.ic { background: var(--s2); border: 1px solid var(--hair); padding: 1px 5px; color: var(--t1); }

/* ---------- notices ---------- */
.notice { display: flex; align-items: flex-start; gap: 16px; background: var(--s1); border: var(--line) solid var(--ink); border-left-width: 6px; border-left-color: var(--amb); padding: 14px 18px; color: var(--t2); font-size: var(--f-sm); line-height: 1.55; }
.notice-tag { flex: none; margin-top: 2px; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: var(--amb); white-space: nowrap; }
.notice p { margin: 0; min-width: 0; }
.notice b { color: var(--t1); font-weight: 500; }
.notice-info { border-left-color: var(--acc); }
.notice-info .notice-tag { color: var(--acc); }
.notice-bad { border-left-color: var(--red); }
.notice-bad .notice-tag { color: var(--red); }

/* ---------- $JEVSTOCK contract bar ---------- */
.ca-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; background: var(--s1); border: var(--line) solid var(--ink); box-shadow: var(--shadow-hard); padding: 14px 18px; }
.ca-label { font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); white-space: nowrap; }
.ca-addr { flex: 1 1 220px; min-width: 0; font-family: var(--mono); font-size: var(--f-sm); color: var(--t1); overflow-wrap: anywhere; }
.ca-addr.is-blank { font-family: var(--sans); color: var(--t2); }
.ca-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- popover menu (wallet picker, account menu) ---------- */
.menu-pop { position: fixed; z-index: 95; min-width: 232px; max-width: calc(100vw - 16px); padding: 4px; background: var(--s1); border: var(--line) solid var(--ink); box-shadow: var(--shadow-pop); }
.menu-pop-title { padding: 8px 10px 6px; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: var(--t3); }
.menu-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding-inline: 10px; color: var(--t1); font-size: var(--f-sm); text-align: left; }
.menu-pop-item:hover, .menu-pop-item:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.menu-pop-item img { width: 22px; height: 22px; flex: none; }
.menu-pop-item .icon { color: inherit; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px;
  padding: 12px 10px 12px 14px; background: var(--s1); color: var(--t1); border: var(--line) solid var(--ink);
  font-size: var(--f-sm); line-height: 1.45; box-shadow: var(--shadow-hard);
  animation: jev-toast-in .18s steps(4);
}
.toast > .icon, .toast > .spinner { margin-top: 2px; }
.toast-info > .icon, .toast-ok > .icon { color: var(--acc); }
.toast-warn > .icon { color: var(--amb); }
.toast-bad > .icon { color: var(--red); }
.toast-msg { min-width: 0; overflow-wrap: anywhere; }
.toast-msg a { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; margin-left: 6px; white-space: nowrap; }
.toast-close { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin: -4px 0 -4px 0; color: var(--t3); }
.toast-close:hover { background: var(--ink); color: var(--paper); }
@keyframes jev-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- footer (dark band, like the typesafe.ai close) ---------- */
.foot { position: relative; margin-top: 72px; padding-block: 48px 36px; background: #1E1E1E; color: #A9A9A9; font-size: var(--f-xs);
  --ink: #FEFEFE; --paper: #1E1E1E; --s1: #262626; --s2: #2E2E2E; --s3: #3A3A3A; --hair: rgba(255,255,255,.14); --hair2: rgba(255,255,255,.26); --t1: #FEFEFE; --t2: #D6D6D6; --t3: #A9A9A9; --acc: #9A9AFF; --mag-ink: #FF8AD9; }
.foot-flush { margin-top: 0; }
.foot-mark { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 36px; color: #FEFEFE; }
.foot-mark img { width: 56px; height: 56px; flex: none; }
.foot-mark-word { font-family: var(--display); font-size: clamp(40px, 6vw, 72px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 14px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); }
.foot-brand { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.foot-word { font-family: var(--pixel); font-size: 12px; font-weight: 500; letter-spacing: .02em; color: #FEFEFE; text-transform: uppercase; }
.foot-credit { font-family: var(--pixel); font-size: 12px; color: #FEFEFE; }
.foot-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.foot-links a { color: #D6D6D6; transition: color .15s; }
.foot-links a:hover { color: #FEFEFE; text-decoration: underline; text-underline-offset: 3px; }
.foot-links a.pill-buy, .foot-links a.pill-buy:hover { color: #1E1E1E; }
.foot p { max-width: 900px; margin-top: 6px; line-height: 1.55; }

/* ---------- background layers (built by js/shell.js) ---------- */
.bg { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden; }
.bg-media, .bg-veil { position: absolute; left: 0; right: 0; top: 0; height: 100%; }
.bg-media { opacity: 0; transition: opacity .9s ease; }
.bg-media.is-ready { opacity: 1; }
.bg-video, .bg-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; filter: saturate(.85) contrast(1.05); }
/* The hero veil keeps the ink headline on a near-paper field; the pink city shows through at the edges. */
.bg-hero .bg-veil {
  background:
    linear-gradient(180deg, rgba(254,254,254,.62) 0%, rgba(254,254,254,.70) 45%, rgba(254,254,254,.86) 72%, var(--paper) 100%),
    radial-gradient(90% 70% at 50% 42%, rgba(254,254,254,.55) 0%, rgba(254,254,254,0) 100%);
}
.bg-quiet .bg-media, .bg-quiet .bg-veil { height: 78vh; }
.bg-quiet .bg-veil {
  background:
    linear-gradient(180deg, rgba(254,254,254,.72) 0%, rgba(254,254,254,.84) 45%, var(--paper) 100%),
    radial-gradient(120% 90% at 80% 10%, rgba(254,254,254,0) 30%, rgba(254,254,254,.6) 100%);
}
#bgfx, #bgmark { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bgfx { z-index: -2; }
#bgmark { z-index: -1; transition: opacity .25s linear; }
@media (max-width: 1080px) {
  .bg-hero .bg-veil {
    background:
      linear-gradient(180deg, rgba(254,254,254,.70) 0%, rgba(254,254,254,.74) 45%, rgba(254,254,254,.9) 75%, var(--paper) 100%),
      radial-gradient(140% 90% at 60% 30%, rgba(254,254,254,.4) 35%, rgba(254,254,254,0) 100%);
  }
}

/* ---------- utilities ---------- */
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.sans { font-family: var(--sans); }
.display { font-family: var(--display); letter-spacing: -.03em; }
.pixel { font-family: var(--pixel); letter-spacing: .02em; text-transform: uppercase; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus, .skip-link:focus-visible { position: fixed !important; left: 12px; top: 10px; z-index: 100; width: auto; height: auto; margin: 0; padding: 10px 14px; overflow: visible; clip: auto; clip-path: none; background: var(--s1); color: var(--t1); border: var(--line) solid var(--ink); font-size: var(--f-sm); box-shadow: var(--shadow-hard); }
.c-t1 { color: var(--t1); } .c-t2 { color: var(--t2); } .c-t3 { color: var(--t3); }
.c-acc { color: var(--acc); } .c-pt { color: var(--pt); } .c-yt { color: var(--yt); }
.c-amb { color: var(--amb); } .c-red { color: var(--red); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.min-0 { min-width: 0; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
@media (min-width: 761px) { .show-sm { display: none !important; } }

/* ---------- 1080px ---------- */
@media (max-width: 1080px) {
  .nav-in { gap: 20px; }
  .nav-menu { gap: 16px; }
  .nav-right .pill-status, .nav-right .pill-buy { display: none; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-md { display: none !important; }
}

@media (max-width: 900px) {
  .nav-right .pill-ca { display: none; }
  .nav-menu { gap: 14px; }
}

/* ---------- 760px ---------- */
@media (max-width: 760px) {
  .nav-in { gap: 12px; }
  .nav-menu {
    display: none; position: absolute; top: calc(100% + 10px); left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 0; padding: 6px;
    background: var(--s1); border: var(--line) solid var(--ink); box-shadow: var(--shadow-pop);
    max-height: calc(100vh - var(--nav-h) - 24px); overflow-y: auto; font-size: var(--f-md);
  }
  .nav-menu.is-open { display: flex; }
  .nav-link { display: flex; align-items: center; min-height: 44px; padding-inline: 12px; }
  .nav-link:hover { background: var(--s2); text-decoration: none; }
  .nav-link.is-on { background: var(--ink); color: var(--paper); text-decoration: none; }
  .nav-menu-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 12px 8px 6px; border-top: 1px solid var(--hair); }
  .nav-menu-extra .pill { height: 40px; }
  a.pill-buy, button.pill-ca { min-height: 40px; }
  .nav-right .pill-status, .nav-right .pill-buy, .nav-right .pill-ca { display: none; }
  .nav-burger { display: flex; }
  .brand { min-height: 44px; }

  .btn, .btn-sm { min-height: 40px; }
  .btn-sm { padding-inline: 12px; }
  .ctas-sm-fill > .btn { flex: 1 1 0; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hide-sm { display: none !important; }

  .field { padding: 12px 14px; }
  .field-input { font-size: 24px; min-height: 40px; }
  button.field-bal { display: inline-flex; align-items: center; min-height: 40px; margin-block: -10px; }
  .input, .textarea, .select { font-size: 16px; }
  .leg { padding: 12px 14px; gap: 10px; }
  .leg-val { font-size: 15px; }
  .legs-head, .legs-foot { padding-inline: 14px; }
  .cleave::before, .cleave::after { width: 64px; }
  .card { padding: 16px 14px; }
  .card-win, .win, .ca-bar { box-shadow: 3px 3px 0 var(--ink); }
  .win-body { padding: 14px; }
  .kvs-box { padding: 4px 14px; }
  .kpis { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-n { font-size: 20px; }
  .tabs { display: flex; width: 100%; }
  .tabs .tab { flex: 1 0 auto; min-height: 40px; padding-inline: 10px; }
  button.seg-item { min-height: 40px; min-width: 40px; padding-inline: 12px; }
  .kv .v a, .table td a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .chip { height: auto; min-height: 40px; }
  .sec { padding-top: 48px; }
  .sec-sub { font-size: var(--f-md); margin-bottom: 20px; }
  .page-title { margin-top: 36px; }
  .sec-head { margin-top: 36px; font-size: 20px; }
  .code, .math { padding: 14px 16px; font-size: 12px; }
  .notice { flex-direction: column; gap: 6px; padding: 12px 14px; }
  .ca-bar { padding: 12px 14px; }
  .ca-actions { margin-left: 0; }
  .toasts { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .toast-close { width: 40px; height: 40px; margin: -10px -4px -10px 0; }
  .menu-pop-item { min-height: 48px; }
  .foot { margin-top: 56px; padding-block: 36px 28px; }
  .foot-mark { gap: 12px; margin-bottom: 28px; }
  .foot-mark img { width: 40px; height: 40px; }
  .foot-links { gap: 0 16px; }
  .foot-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; }
  .foot-links .pill { margin-block: 7px; }
}
@media (max-width: 380px) {
  .leg { grid-template-columns: auto minmax(0, 1fr); }
  .leg-val { grid-column: 2; text-align: left; }
}

/* ---------- print ---------- */
@media print {
  .bg, #bgfx, #bgmark, .toasts, .menu-pop, .nav-burger { display: none !important; }
  .nav { position: static; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
