/* ─────────────────────────────────────────────────────────────
   AgentDesk: pixel desk. Light = beige computer casing,
   dark = black CRT screen with phosphor green. Screens stay dark in both.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #ECE6D8;
  --bg-dot: rgba(74, 62, 38, 0.11);
  --surface: #FBF9F3;
  --surface-2: #F4F0E5;
  --surface-3: #E8E1D1;
  --line: #E0D8C6;
  --line-strong: #CBC0A8;
  --card-bd: #D2C8B1;
  --edge: #2B271E;
  --drop: #D6CDB8;
  --ink: #17150F;
  --ink-2: #4A4539;
  --muted: #847C6A;
  --phos: #4DF08B;
  --phos-hi: #86FFB5;
  --phos-lo: #22B863;
  --phos-deep: #0B8A44;
  --phos-soft: #D9F3E1;
  --phos-ink: #052611;
  --key: #FBF9F3;
  --key-hi: #FFFFFF;
  --key-lo: #D3C9B2;
  --key-bd: #9C917A;
  --up: #0B964B;
  --up-soft: #DAF2E1;
  --down: #D2433A;
  --down-soft: #FAE2DE;
  --amber: #946006;
  --amber-soft: #F9EAC6;
  /* the beige monitor casing + CRT screen (same in both themes) */
  --casing: #E4DBC5;
  --casing-hi: #F4EFE3;
  --casing-lo: #B6AB93;
  --casing-edge: #3A362C;
  --scr: #060A08;
  --scr-2: #0B120E;
  --scr-line: #1B2A21;
  --scr-ink: #E2F7E8;
  --scr-dim: #86A895;
  --tile: var(--scr);          /* small screen tiles (Desk, active tab, CA) */
  --radius: 0px;
  --f-body: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-pix: 'Pixelify Sans', 'IBM Plex Mono', ui-monospace, monospace;
  --f-term: 'VT323', 'IBM Plex Mono', ui-monospace, monospace;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --notch: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px);
  --notch-4: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050706;
    --bg-dot: rgba(77, 240, 139, 0.06);
    --surface: #0A0F0C;
    --surface-2: #0E1511;
    --surface-3: #142019;
    --line: #19251E;
    --line-strong: #263A2F;
    --card-bd: #1E2E25;
    --edge: #3E5A4A;
    --drop: #000000;
    --ink: #E2F3E7;
    --ink-2: #A0BAA9;
    --muted: #64806F;
    --phos-deep: #4DF08B;
    --phos-soft: #0D2618;
    --key: #111A15;
    --key-hi: #1C2A22;
    --key-lo: #070B09;
    --key-bd: #2E4638;
    --up: #4DF08B;
    --up-soft: #0D2618;
    --down: #FF6E64;
    --down-soft: #2B1311;
    --amber: #FFB547;
    --amber-soft: #2A1D07;
    --scr: #030504;
    --scr-2: #08100B;
    --tile: #11231A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #050706;
  --bg-dot: rgba(77, 240, 139, 0.06);
  --surface: #0A0F0C;
  --surface-2: #0E1511;
  --surface-3: #142019;
  --line: #19251E;
  --line-strong: #263A2F;
  --card-bd: #1E2E25;
  --edge: #3E5A4A;
  --drop: #000000;
  --ink: #E2F3E7;
  --ink-2: #A0BAA9;
  --muted: #64806F;
  --phos-deep: #4DF08B;
  --phos-soft: #0D2618;
  --key: #111A15;
  --key-hi: #1C2A22;
  --key-lo: #070B09;
  --key-bd: #2E4638;
  --up: #4DF08B;
  --up-soft: #0D2618;
  --down: #FF6E64;
  --down-soft: #2B1311;
  --amber: #FFB547;
  --amber-soft: #2A1D07;
  --scr: #030504;
  --scr-2: #08100B;
  --tile: #11231A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  /* 2 x 2 pixel dots on a 16px grid, like a desk mat */
  background-image: conic-gradient(at 2px 2px, transparent 270deg, var(--bg-dot) 270deg);
  background-size: 16px 16px;
  min-height: 100vh;
}
/* soft CRT scanlines in dark mode */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 3px);
  opacity: 0; transition: opacity 0.3s;
}
:root[data-theme="dark"] body::after { opacity: 0.5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { opacity: 0.5; } }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px dashed var(--phos-deep); outline-offset: 4px; }
::selection { background: var(--phos); color: var(--phos-ink); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 0.86em; }
.pix { font-family: var(--f-pix); font-weight: 600; letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cursor { display: inline-block; width: 0.55em; height: 0.95em; margin-left: 3px; vertical-align: -0.1em; background: currentColor; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line-strong);
}
.topbar-in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-logo { width: 40px; height: 40px; display: block; flex: none; transition: transform 0.12s steps(2); }
.brand:hover .brand-logo { transform: translateY(-2px) rotate(-3deg); }
.brand-name { display: flex; align-items: center; gap: 3px; font-family: var(--f-pix); font-weight: 700; font-size: 22px; line-height: 1; letter-spacing: 0.01em; }
.brand-desk {
  background: var(--tile); color: var(--phos);
  padding: 3px 6px 4px;
  clip-path: var(--notch);
  text-shadow: 0 0 8px rgba(77, 240, 139, 0.55);
}
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  padding: 7px 11px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
  clip-path: var(--notch);
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.on { background: var(--tile); color: var(--phos); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mode-pill {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 5px 9px;
  clip-path: var(--notch);
  background: var(--amber-soft);
  color: var(--amber);
  white-space: nowrap;
}
.mode-pill.live-pill { background: var(--phos-soft); color: var(--phos-deep); display: inline-flex; align-items: center; gap: 7px; }
.mode-pill.live-pill::before { content: ''; width: 6px; height: 6px; background: currentColor; animation: blink 1.6s steps(1) infinite; }
.icon-btn {
  --bd: var(--key-bd);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0;
  background: var(--key);
  cursor: pointer;
  color: var(--ink-2);
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), inset 0 -3px 0 0 var(--key-lo), inset 0 2px 0 0 var(--key-hi);
}
.icon-btn:hover { color: var(--ink); }
.icon-btn:active { transform: translateY(2px); box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd); }
.icon-btn svg { width: 18px; height: 18px; }

/* ── Buttons: keyboard keycaps with pixel corners ── */
.btn {
  --bd: var(--key-bd);
  --face: var(--key);
  --hi: var(--key-hi);
  --lo: var(--key-lo);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px 3px;
  border: 0; border-radius: 0;
  font-family: var(--f-body); font-weight: 700; font-size: 14px;
  cursor: pointer;
  background: var(--face);
  color: var(--ink);
  box-shadow:
    -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd),
    inset 0 -4px 0 0 var(--lo), inset 0 2px 0 0 var(--hi);
  transition: transform 0.06s steps(2), filter 0.12s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.04); }
.btn:active:not([disabled]) {
  transform: translateY(2px);
  padding-bottom: 0;
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), inset 0 2px 0 0 var(--lo);
}
.btn-primary {
  --bd: var(--edge);
  --face: var(--phos);
  --hi: var(--phos-hi);
  --lo: var(--phos-lo);
  color: var(--phos-ink);
  font-family: var(--f-pix); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
}
:root[data-theme="dark"] .btn-primary { --bd: #0A3A1E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { --bd: #0A3A1E; } }
.btn-primary:hover { --face: var(--phos-hi); filter: none; }
.btn-lg { height: 50px; padding: 0 24px 4px; font-size: 16px; }
.btn-lg.btn-primary { font-size: 17px; }
.btn-sm { height: 32px; padding: 0 12px 3px; font-size: 13px; }
.btn-sm.btn-primary { font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(0.4); }
.btn-wallet { font-family: var(--f-body); }
.btn-wallet .dot { width: 8px; height: 8px; background: var(--up); box-shadow: 0 0 0 2px var(--up-soft); }
.btn-wallet .w-ic { width: 18px; height: 18px; margin-right: 2px; vertical-align: -4px; }

/* ── Ticker tape: a strip of CRT ── */
.tape {
  background: var(--scr);
  color: var(--scr-dim);
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--f-term);
  font-size: 19px;
  line-height: 1;
  height: 34px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid #000;
  position: relative;
}
.tape::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px); }
.tape-track { display: inline-flex; gap: 26px; padding-left: 26px; animation: tape 80s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-item { display: inline-flex; gap: 8px; align-items: baseline; }
.tape-item b { font-weight: 400; color: var(--scr-ink); }
.tape-item .up { color: var(--phos); text-shadow: 0 0 6px rgba(77, 240, 139, 0.5); }
.tape-item .down { color: #FF7D73; }
.tape-item .flat { color: var(--scr-dim); }
.tape-sep { color: #2C4A38; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } }

/* ── Layout + cards ── */
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px 20px 64px; display: grid; gap: 22px; }
.card {
  --bd: var(--card-bd);
  background: var(--surface);
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), 5px 5px 0 0 var(--drop);
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px 11px;
  background: var(--surface-2);
  border-bottom: 2px solid var(--line);
}
.card-head h2 { font-family: var(--f-pix); font-weight: 600; font-size: 16px; letter-spacing: 0.03em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 9px; }
.card-head h2::before { content: ''; width: 8px; height: 8px; flex: none; background: var(--phos); box-shadow: 0 0 0 2px var(--scr); }
.card-head .sub { color: var(--muted); font-size: 13px; }
.card-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-foot { display: block; padding: 12px 18px; border-top: 2px solid var(--line); font-family: var(--f-pix); font-weight: 600; font-size: 13.5px; letter-spacing: 0.03em; color: var(--phos-deep); }
.card-foot:hover { background: var(--surface-2); }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--f-pix); font-weight: 700; font-size: clamp(28px, 4vw, 38px); letter-spacing: 0.01em; }
.page-head h1::before { content: '> '; color: var(--phos-deep); }
.page-head p { color: var(--ink-2); max-width: 64ch; margin-top: 8px; }
.page-head .right { margin-left: auto; }

/* segmented control: a row of small keys */
.seg { display: inline-flex; background: var(--surface-3); padding: 3px; gap: 3px; flex-wrap: wrap; clip-path: var(--notch); }
.seg button {
  border: 0; background: transparent; cursor: pointer;
  padding: 4px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--tile); color: var(--phos); clip-path: var(--notch); }

/* live indicator: blinking pixel */
.live { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--up); }
.live::before { content: ''; width: 7px; height: 7px; background: var(--up); animation: blink 1.4s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .live::before, .mode-pill.live-pill::before { animation: none; } }

/* ── Desk bots (agent avatars), token icons ── */
.av { display: inline-block; position: relative; flex: none; line-height: 0; filter: drop-shadow(2px 2px 0 color-mix(in srgb, var(--ink) 16%, transparent)); }
.av .bot { width: 100%; height: 100%; display: block; }
.av-28 { width: 28px; height: 28px; }
.av-36 { width: 36px; height: 36px; }
.av-42 { width: 42px; height: 42px; }
.av-56 { width: 56px; height: 56px; }
.av-120 { width: 120px; height: 120px; }
.av.stand { aspect-ratio: 25 / 28; height: auto; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: var(--notch-4); background: var(--surface); }
.tok {
  width: 22px; height: 22px; flex: none;
  display: inline-grid; place-items: center;
  background: var(--tc);
  color: #17150F;
  font-family: var(--f-pix); font-weight: 700; font-size: 11px;
  clip-path: var(--notch);
  position: relative; overflow: hidden;
}
.tok-lg { width: 32px; height: 32px; font-size: 14px; }
.tok img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.fi-tx { margin-left: auto; font-size: 12px; }
.pill-live { background: var(--phos-soft); color: var(--phos-deep); }
.p-note { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.p-note:empty, .p-foot:empty { display: none; }
.p-foot { display: grid; gap: 10px; }
.actions .btn-sm { flex: 1; }
.tokname { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }

/* pills + tags: little pixel labels */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  padding: 3px 8px; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2);
  clip-path: var(--notch);
}
.pill-active { background: var(--up-soft); color: var(--up); }
.pill-active::before { content: ''; width: 6px; height: 6px; background: currentColor; }
.pill-unfunded { background: var(--amber-soft); color: var(--amber); }
.pill-low { background: var(--down-soft); color: var(--down); }
.pill-paper { background: var(--amber-soft); color: var(--amber); }
.side {
  font-family: var(--f-pix); font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  padding: 2px 8px 3px; white-space: nowrap; clip-path: var(--notch);
}
.side-buy { background: var(--up); color: var(--surface); }
.side-sell { background: var(--down); color: #FFFFFF; }
.side-hold { background: var(--surface-3); color: var(--ink-2); }
:root[data-theme="dark"] .side-buy { color: var(--phos-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side-buy { color: var(--phos-ink); } }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 2px 8px;
  background: var(--surface-2); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  white-space: nowrap;
}
.chip-tp { background: var(--up-soft); box-shadow: none; color: var(--up); }
.chip-sl { background: var(--down-soft); box-shadow: none; color: var(--down); }
.agent-tag { font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }

/* ── Home: hero is a CRT monitor ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.crt {
  position: relative;
  background: var(--casing);
  padding: 12px 12px 30px;
  box-shadow:
    -3px 0 0 0 var(--casing-edge), 3px 0 0 0 var(--casing-edge), 0 -3px 0 0 var(--casing-edge), 0 3px 0 0 var(--casing-edge),
    inset 3px 3px 0 0 var(--casing-hi), inset -4px -4px 0 0 var(--casing-lo), 7px 7px 0 0 var(--drop);
  min-width: 0;
}
/* power LED + vent in the bottom bezel, like the logo */
.crt::after {
  content: ''; position: absolute; right: 22px; bottom: 11px; width: 10px; height: 8px;
  background: var(--phos); box-shadow: -16px 0 0 0 #6E6755, -26px 0 0 0 #6E6755, 0 0 8px rgba(77, 240, 139, 0.8);
}
.screen {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #0C1A12 0%, var(--scr) 60%);
  color: var(--scr-ink);
  box-shadow: 0 0 0 3px #7C7462, inset 0 0 40px rgba(0, 0, 0, 0.7);
  clip-path: var(--notch-4);
}
.screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.32) 0 1px, transparent 1px 3px); }
.hero-main { padding: 30px 32px 24px; display: grid; gap: 22px; align-content: start; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-copy { display: grid; gap: 16px; align-content: start; min-width: 0; }
.eyebrow { font-family: var(--f-term); font-size: 19px; line-height: 1.1; letter-spacing: 0.04em; color: var(--phos-deep); text-transform: uppercase; }
.screen .eyebrow { color: var(--phos); text-shadow: 0 0 8px rgba(77, 240, 139, 0.45); }
.hero h1 { font-family: var(--f-pix); font-weight: 700; font-size: clamp(32px, 4.2vw, 54px); line-height: 1.04; max-width: 16ch; color: #F1FFF5; text-shadow: 0 0 18px rgba(77, 240, 139, 0.18); }
.hero h1 em { font-style: normal; color: var(--phos); text-shadow: 0 0 14px rgba(77, 240, 139, 0.55); }
.hero p.lede { color: #A9C6B4; max-width: 60ch; font-size: 15.5px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 0 2px 2px; }
.screen .btn:not(.btn-primary) { --face: transparent; --hi: transparent; --lo: transparent; --bd: var(--phos); color: var(--phos); }
.screen .btn:not(.btn-primary):hover { --face: rgba(77, 240, 139, 0.1); }
.screen .btn-primary { --bd: #000; }
.hero-desk { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.desk-row { display: flex; align-items: flex-end; justify-content: center; gap: 12px; width: 100%; max-width: 440px; padding: 0 12px; border-bottom: 5px solid #8A7F66; box-shadow: 0 5px 0 0 #4B4536; }
.desk-row .av { filter: none; }
.desk-row .av-120 { width: 88px; }
.desk-row .brand-big { width: 150px; height: 150px; display: block; margin-bottom: -5px; flex: none; }
.desk-cap { font-family: var(--f-term); font-size: 24px; color: var(--scr-dim); margin-top: 12px; white-space: nowrap; }
.desk-cap b { font-weight: 400; color: var(--scr-ink); }

/* agent loop: RESEARCH → BUILD → SOCIAL → OPS */
.loop { list-style: none; margin: 0; padding: 18px 0 0; border-top: 2px dashed var(--scr-line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.loop li { display: grid; justify-items: center; align-content: start; text-align: center; gap: 6px; position: relative; }
.loop li + li::before { content: ''; position: absolute; top: 25px; right: calc(50% + 34px); width: calc(100% - 58px); height: 2px; background: var(--phos); opacity: 0.7; }
.loop-ic {
  width: 52px; height: 52px; display: grid; place-items: center; color: var(--phos);
  background: #06120B;
  box-shadow: -2px 0 0 0 var(--phos), 2px 0 0 0 var(--phos), 0 -2px 0 0 var(--phos), 0 2px 0 0 var(--phos), 0 0 16px rgba(77, 240, 139, 0.25);
  margin-top: 2px;
}
.loop-ic svg { width: 26px; height: 26px; filter: drop-shadow(0 0 4px rgba(77, 240, 139, 0.6)); }
.loop b { font-family: var(--f-pix); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; color: var(--scr-ink); margin-top: 2px; }
.loop span { font-size: 12px; line-height: 1.35; color: var(--scr-dim); max-width: 17ch; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat > .v { margin-top: auto !important; padding-top: 6px; overflow-wrap: anywhere; min-width: 0; }
.stat .k { font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--f-term); font-size: clamp(30px, 2.6vw, 38px); font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1; margin-top: 4px; }
.stat .v small { display: inline-block; font-size: 0.55em; color: var(--muted); margin-left: 5px; }
.stat .v.name-v { font-family: var(--f-pix); font-weight: 600; font-size: 20px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Home: grid ── */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.side-col { display: grid; gap: 22px; align-content: start; }

/* Active Agent Trades feed */
.feed-card { display: flex; flex-direction: column; }
.feed { flex: 1 1 0; min-height: 560px; overflow-y: auto; }
.fi {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.fi:last-child { border-bottom: 0; }
.fi.fresh { animation: fresh 2.4s steps(6) both; }
@keyframes fresh {
  0% { background: color-mix(in srgb, var(--phos) 35%, transparent); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) { .fi.fresh { animation: none; } }
.fi-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fi-top .agent-tag { color: var(--phos-deep); }
.fi-top .name { font-weight: 700; }
.fi-time { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fi-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.fi-main .tokname { font-size: 15px; }
.fi-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.fi-amt small { color: var(--muted); font-weight: 600; }
.fi-pnl { font-family: var(--f-term); font-size: 22px; line-height: 1; }
.fi-reason { margin-top: 6px; color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-empty { padding: 40px 18px; text-align: center; color: var(--muted); }

/* top agents */
.top-list { list-style: none; margin: 0; padding: 6px 0; }
.top-list li a { display: grid; grid-template-columns: 26px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 18px; }
.top-list li a:hover { background: var(--surface-2); }
.rank { font-family: var(--f-pix); font-size: 13px; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); clip-path: var(--notch); }
.rank-1 { background: var(--phos); color: var(--phos-ink); }
.rank-2, .rank-3 { background: var(--tile); color: var(--phos); }
.who { min-width: 0; }
.who .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.who .agent-tag { display: block; }
.score { text-align: right; font-variant-numeric: tabular-nums; }
.score b { display: block; font-family: var(--f-term); font-size: 22px; font-weight: 400; line-height: 1; }
.score span { font-size: 12px; color: var(--muted); }

/* recently launched */
.recent { display: grid; }
.recent a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.recent a:last-child { border-bottom: 0; }
.recent a:hover { background: var(--surface-2); }
.recent .t { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent .t small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.recent .by { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent .m { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.recent .m span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.new-badge { font-family: var(--f-pix); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--phos-ink); background: var(--phos); padding: 1px 5px; margin-left: 6px; vertical-align: 2px; clip-path: var(--notch); }

/* agent cards: little windows on the desk */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; padding: 18px 18px 22px; }
.acard {
  --bd: var(--line-strong);
  display: grid; gap: 12px;
  padding: 14px;
  background: var(--surface);
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), 0 0 0 0 var(--drop);
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
}
.acard:hover { --bd: var(--edge); transform: translate(-2px, -2px); box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), 5px 5px 0 0 var(--phos); }
.acard-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.acard-top .name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.acard-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acard-nums .k { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.acard-nums .v { font-family: var(--f-term); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.acard-nums .v small { font-size: 16px; }
.acard .spark { width: 100%; height: 38px; display: block; }
.acard-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; border-top: 2px dotted var(--line-strong); padding-top: 10px; }

.spark { color: var(--muted); overflow: visible; }
.spark.up { color: var(--up); }
.spark.down { color: var(--down); }

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th {
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); text-align: left; padding: 10px 14px; white-space: nowrap;
  border-bottom: 2px solid var(--line); background: var(--surface-2);
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl tbody tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--phos); }
.tbl .b { font-weight: 700; }
.tbl .spark { width: 96px; height: 28px; display: block; margin-left: auto; }
.cell-agent { display: flex; align-items: center; gap: 10px; }
.cell-agent .name { font-weight: 700; }
.chg { display: inline-block; font-weight: 700; font-size: 12.5px; padding: 2px 7px; clip-path: var(--notch); }
.chg.up { background: var(--up-soft); }
.chg.down { background: var(--down-soft); }
.chg.flat { background: var(--surface-3); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 2px solid var(--line); background: var(--surface-2); }
.toolbar .right { margin-left: auto; }
.search, .input, .textarea {
  --bd: var(--line-strong);
  border: 0; border-radius: 0; background: var(--surface);
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), inset 0 2px 0 0 var(--surface-3);
}
.search { height: 36px; padding: 0 12px; min-width: 0; width: 230px; max-width: 100%; }
.search:focus, .input:focus, .textarea:focus { outline: none; --bd: var(--phos-deep); }

/* ── Agent page ── */
.agent-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; padding: 22px; align-items: center; }
.agent-hero .av-120 { width: 128px; }
.agent-hero h1 { font-family: var(--f-pix); font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; letter-spacing: 0.01em; }
.agent-hero .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.agent-hero .actions { display: grid; gap: 12px; justify-items: end; }
.fund-note { max-width: 220px; text-align: right; }
.next-think { font-family: var(--f-term); font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kv-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.addr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addr code { font-family: var(--f-mono); font-size: 12.5px; background: var(--tile); color: var(--phos); padding: 5px 8px; word-break: break-all; clip-path: var(--notch); }
.copy { border: 0; background: transparent; cursor: pointer; color: var(--phos-deep); font-weight: 700; font-size: 12.5px; padding: 4px 6px; }
.copy:hover { background: var(--phos-soft); }
.ext { color: var(--phos-deep); font-weight: 700; font-size: 12.5px; }
.ext:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.chart-box { position: relative; padding: 8px 12px 12px; min-height: 240px; }
.eq-chart { display: block; width: 100%; height: auto; color: var(--muted); }
.eq-chart.up { color: var(--up); }
.eq-chart.down { color: var(--down); }
.eq-chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.eq-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--f-mono); }
.eq-chart .base { stroke: var(--ink-2); stroke-dasharray: 4 4; stroke-width: 1; opacity: 0.6; }
.eq-chart .base-label { fill: var(--ink-2); font-size: 11px; font-family: var(--f-mono); }
.eq-chart .eq-line { shape-rendering: crispEdges; }
.eq-chart .eq-end { stroke: var(--surface); stroke-width: 2; }
.eq-chart .cross { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
  --bd: var(--edge);
  position: absolute; pointer-events: none;
  background: var(--surface);
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), 4px 4px 0 0 var(--drop);
  padding: 8px 10px; font-size: 12.5px; min-width: 140px;
  font-variant-numeric: tabular-nums;
}
.tip-time { color: var(--muted); font-size: 11.5px; }
.tip-val { font-family: var(--f-term); font-size: 22px; line-height: 1; }
.chart-empty { padding: 60px 10px; text-align: center; color: var(--muted); }

.range { position: relative; width: 150px; height: 22px; }
.range .track { position: absolute; left: 0; right: 0; top: 8px; height: 6px; background: linear-gradient(90deg, var(--down-soft) 0 33.3%, var(--up-soft) 33.3% 100%); }
.range .zero { position: absolute; top: 4px; width: 2px; height: 14px; background: var(--ink-2); left: 33.3%; }
.range .fill { position: absolute; top: 8px; height: 6px; }
.range .fill.up { background: var(--up); }
.range .fill.down { background: var(--down); }
.range .mk { position: absolute; top: 4px; width: 8px; height: 14px; margin-left: -4px; box-shadow: 0 0 0 2px var(--surface); }
.range .mk.up { background: var(--up); }
.range .mk.down { background: var(--down); }
.range-lbl { display: flex; justify-content: space-between; width: 150px; font-family: var(--f-mono); font-size: 9.5px; color: var(--muted); }

.decisions { list-style: none; margin: 0; padding: 0; max-height: 470px; overflow-y: auto; }
.decisions li { padding: 11px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.decisions li:last-child { border-bottom: 0; }
.decisions .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.decisions .when { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.decisions p { font-size: 13.5px; color: var(--ink-2); }
.blocked { font-size: 12.5px; color: var(--down); font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.blocked::before { content: 'RISK CHECK'; flex: none; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.08em; background: var(--down-soft); padding: 1px 5px; clip-path: var(--notch); }
.blocked.failed::before { content: 'FAILED'; }
.approved { font-size: 12px; color: var(--up); font-weight: 600; }

.coin-card { display: grid; gap: 14px; padding: 18px; }
.coin-head { display: flex; gap: 12px; align-items: center; }
.coin-head .t { font-weight: 700; font-size: 18px; }
.coin-head .t small { color: var(--muted); font-size: 13px; font-weight: 700; margin-left: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rule { background: var(--surface-2); padding: 10px 12px; box-shadow: inset 0 0 0 2px var(--line); }
.rule .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.rule .v { font-family: var(--f-term); font-size: 26px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rule .v.v-text { font-family: var(--f-body); font-size: 14px; font-weight: 600; line-height: 1.35; margin-top: 3px; }

/* ── Launch page ── */
.launch { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.form { display: grid; gap: 20px; padding: 22px; }
.fieldset { display: grid; gap: 16px; }
.fieldset-title { font-family: var(--f-pix); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--phos-deep); display: flex; align-items: center; gap: 10px; }
.fieldset-title::before { content: '>'; }
.fieldset-title::after { content: ''; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-weight: 700; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input, .textarea { width: 100%; min-width: 0; padding: 10px 12px; font-size: 14.5px; }
.textarea { min-height: 84px; resize: vertical; }
.input-affix { position: relative; }
.input-affix .input { padding-left: 28px; }
.input-affix .pre { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.input-affix.suf .input { padding-left: 12px; padding-right: 50px; }
.input-affix .suf-t { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; font-size: 13px; }
/* desk picker: five bots on a shelf, click one or get a new desk */
.desk-picker {
  display: grid; gap: 0;
  padding: 14px 16px 14px;
  background: var(--scr);
  background-image: radial-gradient(90% 70% at 50% 10%, rgba(77, 240, 139, 0.08), transparent 70%);
  color: var(--scr-ink);
  clip-path: var(--notch-4);
}
.dp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dp-title { font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--phos); text-shadow: 0 0 8px rgba(77, 240, 139, 0.45); }
.dp-no { font-family: var(--f-term); font-size: 19px; line-height: 1; padding: 2px 7px 3px; background: #10231A; color: var(--scr-dim); }
.dp-actions { margin-left: auto; display: flex; gap: 12px; padding: 2px; }
.dp-actions .btn svg { width: 12px; height: 12px; flex: none; }
.dp-actions .btn:not(.btn-primary) { --face: #111A15; --hi: #1C2A22; --lo: #070B09; --bd: #2E4638; color: var(--scr-ink); }
.dp-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 22px 6px 0; }
.dp-bot {
  position: relative; border: 0; background: transparent; padding: 0; margin: 0; cursor: pointer; line-height: 0;
  transition: transform 0.12s steps(2), filter 0.12s steps(2);
  filter: brightness(0.5) saturate(0.55);
}
.dp-bot .bot { width: 100%; height: auto; display: block; }
.dp-bot:hover { filter: brightness(0.85) saturate(0.9); transform: translateY(-3px); }
.dp-bot.on { filter: none; transform: translateY(-10px); }
.dp-bot.on .bot { filter: drop-shadow(0 0 10px var(--bot-phos)) drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.6)); }
.dp-bot.on::after {
  content: ''; position: absolute; left: 50%; bottom: -16px; width: 12px; height: 6px; margin-left: -6px;
  background: var(--phos); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.dp-bot:focus-visible { outline: 2px dashed var(--phos); outline-offset: 6px; }
.dp-bot.drop { animation: dpdrop 0.36s steps(4) both; animation-delay: var(--d); }
@keyframes dpdrop { from { opacity: 0; transform: translateY(-22px); } }
.dp-bot.on.drop { animation-name: dpdropon; }
@keyframes dpdropon { from { opacity: 0; transform: translateY(-30px); } to { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .dp-bot, .dp-bot.drop { animation: none; transition: none; } }
.dp-shelf { height: 10px; margin: 0 -16px; background: var(--casing); box-shadow: inset 0 3px 0 var(--casing-hi), inset 0 -3px 0 var(--casing-lo), 0 3px 0 #000; }
.dp-info { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding-top: 14px; font-size: 13px; color: var(--scr-dim); }
.dp-info b { font-family: var(--f-pix); font-weight: 600; color: var(--phos); letter-spacing: 0.04em; }
.dp-info span:not(.dp-hint)::before { content: '■ '; font-size: 9px; color: var(--scr-dim); }
.dp-hint { flex-basis: 100%; font-size: 12.5px; }
@media (max-width: 460px) {
  .dp-row { gap: 6px; padding: 20px 0 0; }
  .dp-actions { margin-left: 0; width: 100%; }
  .dp-actions .btn { flex: 1; }
}
.logo-row { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.input.locked { display: flex; align-items: center; background: var(--surface-2); color: var(--ink-2); font: 600 13px/1.2 var(--f-mono); cursor: default; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.presets button {
  --bd: var(--line-strong);
  border: 0; background: var(--surface); padding: 4px 10px; font-weight: 700; font-size: 13px; cursor: pointer; margin: 2px;
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), inset 0 -3px 0 0 var(--surface-3);
}
.presets button:hover { --bd: var(--edge); }
.presets button.on { --bd: var(--phos-deep); background: var(--phos-soft); color: var(--phos-deep); }
.err { color: var(--down); font-size: 12.5px; font-weight: 600; }
.preview { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); display: grid; gap: 20px; }
.preview-card { padding: 18px; display: grid; gap: 14px; }
.preview-stage {
  padding: 16px; display: flex; gap: 16px; align-items: center;
  background: var(--scr); color: var(--scr-ink);
  clip-path: var(--notch-4);
}
.preview-stage .agent-tag { color: var(--scr-dim); }
.preview-stage .pv-name { font-family: var(--f-pix); font-weight: 700; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; color: #F1FFF5; }
.preview-stage .chip { background: #10231A; color: var(--phos); box-shadow: none; }
.preview-stage .pill-active { background: #10311F; color: var(--phos); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.checklist li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; }
.checklist li::before { content: '■'; color: var(--phos-deep); font-size: 10px; line-height: 2; }
.note { font-size: 12.5px; color: var(--muted); }
.note b { color: var(--ink-2); }

/* ── How it works ── */
.steps { list-style: none; margin: 0; padding: 20px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.steps li { padding: 14px; background: var(--surface-2); display: grid; gap: 6px; align-content: start; box-shadow: inset 0 0 0 2px var(--line); }
.steps li .n { font-family: var(--f-term); font-size: 26px; line-height: 1; color: var(--phos-deep); }
.steps li b { font-size: 15px; }
.steps li p { font-size: 13px; color: var(--ink-2); }
.pipe { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; padding: 20px 18px; }
.pipe .node { flex: 1 1 140px; padding: 12px; background: var(--surface); display: grid; gap: 4px; align-content: start; box-shadow: inset 0 0 0 2px var(--line-strong); }
.pipe .node.key { background: var(--scr); color: var(--scr-ink); box-shadow: inset 0 0 0 2px var(--phos); }
.pipe .node.key span { color: var(--scr-dim); }
.pipe .node b { font-family: var(--f-pix); font-weight: 600; font-size: 14px; letter-spacing: 0.03em; }
.pipe .node span { font-size: 12.5px; color: var(--ink-2); }
.pipe .arrow { align-self: center; color: var(--phos-deep); font-family: var(--f-term); font-size: 24px; }
.prose { padding: 18px; display: grid; gap: 12px; color: var(--ink-2); max-width: 75ch; }
.prose b { color: var(--ink); }
.how-loop { padding: 20px 18px 22px; }
.how-loop .loop { margin: 0; padding: 18px 16px 16px; border: 0; background: var(--scr); clip-path: var(--notch-4); }

/* ── Modal & toast: little OS windows ── */
.modal-back {
  position: fixed; inset: 0; z-index: 80;
  background: color-mix(in srgb, #020403 55%, transparent);
  display: grid; place-items: center; padding: 16px;
  animation: fade 0.15s steps(3);
}
.modal {
  --bd: var(--edge);
  width: min(460px, 100%); max-height: 90vh; overflow: auto;
  background: var(--surface);
  box-shadow: -3px 0 0 0 var(--bd), 3px 0 0 0 var(--bd), 0 -3px 0 0 var(--bd), 0 3px 0 0 var(--bd), 8px 8px 0 0 rgba(0, 0, 0, 0.35);
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; background: var(--scr); color: var(--scr-ink); position: sticky; top: 0; z-index: 1; }
.modal-head h3 { font-family: var(--f-pix); font-size: 17px; font-weight: 600; letter-spacing: 0.02em; min-width: 0; overflow-wrap: anywhere; }
.modal-head h3::before { content: '> '; color: var(--phos); }
.modal-head .x { margin-left: auto; border: 0; background: var(--casing); color: #2B271E; cursor: pointer; font: 700 18px/1 var(--f-pix); width: 30px; height: 30px; display: grid; place-items: center; clip-path: var(--notch); flex: none; }
.modal-head .x:hover { background: var(--phos); color: var(--phos-ink); }
.modal-body { padding: 18px 20px 22px; display: grid; gap: 14px; }
.modal-body p { color: var(--ink-2); font-size: 14px; }
.wallet-list { display: grid; gap: 10px; margin: 4px 2px 2px; }
.wallet-opt {
  --bd: var(--line-strong);
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border: 0; background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; font: inherit;
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd);
}
.wallet-opt:hover:not([disabled]) { --bd: var(--phos-deep); background: var(--phos-soft); }
.wallet-opt[disabled] { opacity: 0.6; cursor: progress; }
.wallet-opt .wicon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: var(--tile); color: var(--phos); font-family: var(--f-pix); font-weight: 700; overflow: hidden; clip-path: var(--notch); }
.wallet-opt .wicon img { width: 100%; height: 100%; object-fit: contain; }
.wallet-opt .wtext { flex: 1; min-width: 0; }
.wallet-opt.get .wicon { background: var(--surface-3); color: var(--ink-2); }
.wallet-opt.get b { color: var(--ink-2); }
.wallet-opt .wget { font-size: 12px; font-weight: 700; color: var(--phos-deep); }
.wallet-opt b { display: block; }
.wallet-opt small { color: var(--muted); }
.progress { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.progress li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.progress li .ic { width: 22px; height: 22px; display: grid; place-items: center; font: 700 12px/1 var(--f-pix); box-shadow: inset 0 0 0 2px var(--line-strong); }
.progress li.doing { color: var(--ink); font-weight: 600; }
.progress li.doing .ic { box-shadow: inset 0 0 0 2px var(--phos-deep); background: linear-gradient(var(--phos), var(--phos)) no-repeat center / 8px 8px; animation: loadpix 0.9s steps(4) infinite; }
@keyframes loadpix { 0% { background-size: 4px 4px; } 50% { background-size: 12px 12px; } 100% { background-size: 4px 4px; } }
.progress li.done { color: var(--ink-2); }
.progress li.done .ic { background: var(--phos); color: var(--phos-ink); box-shadow: inset 0 0 0 2px var(--edge); }
.progress li.fail .ic { background: var(--down); color: #FFFFFF; box-shadow: none; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: grid; gap: 12px; width: min(360px, calc(100vw - 36px)); }
.toast {
  --bd: var(--edge);
  background: var(--surface); padding: 12px 14px;
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), 5px 5px 0 0 var(--phos);
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; font-size: 13.5px;
  animation: toast 0.25s steps(4);
}
.toast b { display: block; }
@keyframes toast { from { transform: translateY(12px); opacity: 0; } }

/* ── Footer, CA chip, X link ── */
.foot { max-width: 1320px; margin: 0 auto; padding: 0 20px 40px; color: var(--muted); font-size: 12.5px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; }
.foot-brand img { width: 26px; height: 26px; }
.foot-brand b { font-family: var(--f-pix); font-weight: 700; color: var(--ink); }
.foot-x { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 600; }
.foot-x svg { width: 20px; height: 20px; }
.foot-x:hover { color: var(--phos-deep); }
.ca-chip {
  --bd: var(--key-bd);
  margin-left: -6px; display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px 0 5px;
  border: 0; background: var(--key); color: var(--ink);
  font: 600 13px/1 var(--f-mono); letter-spacing: 0.01em; cursor: pointer; white-space: nowrap; flex: none;
  box-shadow: -2px 0 0 0 var(--bd), 2px 0 0 0 var(--bd), 0 -2px 0 0 var(--bd), 0 2px 0 0 var(--bd), inset 0 -3px 0 0 var(--key-lo);
}
.ca-chip:hover:not(.soon) { --bd: var(--phos-deep); }
.ca-chip:active:not(.soon) { transform: translateY(2px); }
.ca-tag { font: 700 13px/1 var(--f-pix); letter-spacing: 0.06em; background: var(--tile); color: var(--phos); padding: 5px 6px 6px; clip-path: var(--notch); text-shadow: 0 0 6px rgba(77, 240, 139, 0.6); }
.ca-chip.soon { cursor: default; color: var(--muted); }
.ca-chip.soon .ca-tag { color: var(--scr-dim); text-shadow: none; }
.ca-copy { width: 15px; height: 15px; color: var(--muted); }
.ca-chip:hover .ca-copy { color: var(--phos-deep); }
.x-link {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: var(--tile); color: var(--phos);
  box-shadow: -2px 0 0 0 #000, 2px 0 0 0 #000, 0 -2px 0 0 #000, 0 2px 0 0 #000, inset 0 -3px 0 0 #000;
  transition: transform 0.1s steps(2);
}
.x-link svg { width: 20px; height: 20px; filter: drop-shadow(0 0 4px rgba(77, 240, 139, 0.6)); }
.x-link:hover { transform: translateY(-2px); }
.feed-empty.boot { display: grid; justify-items: center; gap: 16px; padding: 70px 18px; font-family: var(--f-term); font-size: 22px; color: var(--ink-2); }
.feed-empty.boot img { width: 130px; height: 130px; animation: bootbob 1.2s steps(2) infinite; }
@keyframes bootbob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .feed-empty.boot img, .brand-logo { animation: none; transition: none; } }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .mode-pill, .mode-pill.live-pill { display: none; }
  .btn-wallet .long { display: none; }
}
@media (max-width: 1060px) {
  .topbar-in { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .ca-chip { margin-left: 0; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 18px; }
  .brand-logo { width: 34px; height: 34px; }
  .top-right { gap: 8px; }
  .x-link, .icon-btn { width: 34px; height: 34px; }
}
@media (max-width: 600px) {
  /* the contract address gets its own row on phones */
  .ca-chip { order: 4; width: calc(100% - 4px); margin: 2px 2px 4px; justify-content: center; }
}
@media (max-width: 1100px) {
  .hero, .home-grid, .two, .launch { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 20px; }
  .desk-row .brand-big { width: 120px; height: 120px; }
  .desk-row .av-120 { width: 70px; }
  .feed { flex: none; max-height: 640px; min-height: 0; }
  .kv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .three { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 760px) {
  .topbar-in { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .fund-note { text-align: left; }
  .kv-grid > :last-child:nth-child(odd), .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mode-pill, .mode-pill.live-pill { display: none; }
  .wrap { padding: 18px 16px 48px; gap: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .stat .v { font-size: 32px; }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .agent-hero { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 14px; align-items: start; }
  .agent-hero .av-120 { width: 80px; }
  .agent-hero .actions { grid-column: 1 / -1; justify-items: start; }
  .row2, .rules { grid-template-columns: minmax(0, 1fr); }
  .crt { padding: 8px 8px 24px; }
  .crt::after { right: 16px; bottom: 8px; }
  .hero-main { padding: 20px 16px 18px; gap: 18px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hero-desk { order: -1; justify-items: start; }
  .desk-row { justify-content: flex-start; max-width: 280px; gap: 8px; padding: 0 8px; border-bottom-width: 4px; box-shadow: 0 4px 0 0 #4B4536; }
  .desk-row .brand-big { width: 96px; height: 96px; margin-bottom: -4px; }
  .desk-row .av-120 { width: 58px; }
  .desk-cap { display: none; }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .loop li:nth-child(3)::before { display: none; }
  .foot { padding: 0 16px 32px; }
}
