/* SQUDAI — design v2 "MISSION CONTROL"
   The site as the engine's own command deck: fixed systems rail, numbered
   screens, artwork presented as camera feeds with HUD framing. Dark, data-first,
   no percentage commitments in copy. v1 lives on at /v1/. */

/* ---------- tokens ---------- */
:root {
  --bg: #04070D;
  --bg-2: #070C16;
  --panel: #0A111D;
  --panel-2: #0D1524;
  --line: #152134;
  --line-2: #1F3049;
  --ink: #E9F1FB;
  --dim: #93A5BC;
  --mute: #55677E;
  --sys: #4DE0F9;            /* system cyan */
  --gold: #E8C56A;
  --violet: #B24DFF;
  --mint: #2FE6B0;
  --indigo: #7B8CFF;
  --red: #FF4D5E;
  --blue: #4DA8FF;
  --ease: cubic-bezier(.22,.9,.3,1);
  --rail-w: 232px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--mono); }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }

/* faint grid — the deck's graph paper */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(77,224,249,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,224,249,.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 90%);
}

.pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 8px var(--mint);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- rail ---------- */
.rail {
  position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--rail-w);
  display: flex; flex-direction: column; padding: 22px 0 16px;
  background: linear-gradient(180deg, rgba(10,17,29,.92), rgba(7,12,22,.96));
  border-right: 1px solid var(--line); backdrop-filter: blur(8px);
}
.rail__brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; }
.rail__logo { width: 30px; height: 30px; object-fit: contain; }
.rail__name { font-weight: 700; letter-spacing: .28em; font-size: .92rem; }
.rail__nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; }
.rail__nav a {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 9px; color: var(--dim);
  font-size: .84rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent; transition: all .22s var(--ease);
}
.rail__nav a i { font-style: normal; font-family: var(--mono); font-size: .62rem; color: var(--mute); }
.rail__nav a .led {
  width: 6px; height: 6px; border-radius: 50%; background: var(--line-2);
  transition: all .25s var(--ease);
}
.rail__nav a:hover { color: var(--ink); border-color: var(--line); }
.rail__nav a.is-active { color: var(--ink); background: rgba(77,224,249,.06); border-color: var(--line-2); }
.rail__nav a.is-active .led { background: var(--sys); box-shadow: 0 0 8px var(--sys); }
.rail__nav a .led--soon { background: var(--mute); }
.rail__nav a .led--gold, .rail__buy .led { background: var(--gold); box-shadow: 0 0 8px rgba(232,197,106,.6); }
.rail__buy { color: var(--gold) !important; }
.rail__foot { padding: 14px 20px 0; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.rail__stat { display: flex; justify-content: space-between; font-size: .64rem; letter-spacing: .1em; }
.rail__stat span { color: var(--mute); }
.rail__stat b { color: var(--dim); font-weight: 500; display: flex; gap: 6px; align-items: center; }

/* collapse toggle — rail is open by default, this tucks it away */
.rail__toggle {
  position: absolute; top: 22px; right: -13px; z-index: 41;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: .7rem; line-height: 1;
  color: var(--dim); background: var(--panel-2); border: 1px solid var(--line-2);
  transition: all .22s var(--ease);
}
.rail__toggle:hover { color: var(--sys); border-color: var(--sys); }
.rail, .deck { transition: transform .32s var(--ease), margin-left .32s var(--ease); }
body.rail-closed .rail { transform: translateX(calc(-1 * var(--rail-w))); }
body.rail-closed .deck { margin-left: 0; }
.rail__open {
  position: fixed; z-index: 39; top: 20px; left: 14px;
  display: none; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 12px; border-radius: 9px; font-size: .62rem; letter-spacing: .14em;
  color: var(--dim); background: rgba(7,12,22,.92); border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); transition: all .22s var(--ease);
}
.rail__open:hover { color: var(--sys); border-color: var(--sys); }
body.rail-closed .rail__open { display: inline-flex; }

/* mobile chrome (hidden on desktop) */
.mtop, .mtabs { display: none; }

/* ---------- deck / screens ---------- */
.deck { position: relative; z-index: 1; margin-left: var(--rail-w); }
.scr { padding: 84px clamp(22px, 4.5vw, 64px) 72px; border-bottom: 1px solid var(--line); position: relative; }
.scr__head { max-width: 760px; margin-bottom: 42px; }
.scr__sys {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .64rem; letter-spacing: .22em; color: var(--sys);
  padding: 5px 0 14px;
}
.scr__sys::before { content: "▮"; font-size: .5rem; animation: pulse 2s infinite; }
.scr h2 { margin: 0 0 14px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: -.015em; }
.scr__head p { margin: 0; color: var(--dim); font-size: .95rem; max-width: 620px; }
.scr__note { margin: 26px 2px 0; font-size: .62rem; line-height: 1.7; color: var(--mute); max-width: 900px; }
.soonchip {
  margin-left: 10px; font-size: .56rem; letter-spacing: .16em; color: var(--indigo);
  border: 1px solid rgba(123,140,255,.4); padding: 3px 8px; border-radius: 999px;
}

/* ---------- buttons ---------- */
.kbtn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 .88rem 'Space Grotesk', sans-serif; letter-spacing: .01em;
  padding: 12px 22px; border-radius: 10px; border: 1px solid var(--line-2);
  color: var(--ink); background: transparent; transition: all .22s var(--ease);
}
.kbtn--primary { background: var(--sys); border-color: var(--sys); color: #04222B; box-shadow: 0 8px 30px -10px rgba(77,224,249,.55); }
.kbtn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 38px -10px rgba(77,224,249,.7); }
.kbtn--ghost:hover { border-color: var(--sys); color: var(--sys); }
.kbtn--sm { padding: 6px 12px; font-size: .68rem; border-radius: 7px; }

/* ---------- camera feed framing (shared) ---------- */
.feed { margin: 0; }
.feed__tag {
  display: flex; align-items: center; gap: 8px;
  font-size: .6rem; letter-spacing: .18em; color: var(--dim); padding-bottom: 9px;
}
.feed__tag .feed__stage { margin-left: auto; color: var(--acc, var(--sys)); font-style: normal; }
.feed__frame {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--panel);
  aspect-ratio: 4 / 3;
}
/* HUD corner ticks */
.feed__frame::before, .feed__frame::after {
  content: ""; position: absolute; width: 16px; height: 16px; z-index: 4; pointer-events: none;
}
.feed__frame::before { top: 8px; left: 8px; border-top: 2px solid var(--acc, var(--sys)); border-left: 2px solid var(--acc, var(--sys)); }
.feed__frame::after { bottom: 8px; right: 8px; border-bottom: 2px solid var(--acc, var(--sys)); border-right: 2px solid var(--acc, var(--sys)); }
.feed__img, .feed__vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed__vid--goal { display: none; }
.feed--goalvid .feed__img { display: none; }
.feed--goalvid .feed__vid--goal { display: block; }
.feed__scan {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: overlay;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.04) 0 1px, transparent 1px 3px);
}
.feed__meta { display: flex; justify-content: space-between; padding-top: 8px; font-size: .6rem; letter-spacing: .12em; color: var(--mute); }
.feed__goalflag {
  display: none; position: absolute; top: 12px; right: 12px; z-index: 5;
  font-size: .58rem; letter-spacing: .18em; font-weight: 700; color: #04222B;
  background: var(--acc, var(--sys)); padding: 5px 11px; border-radius: 999px;
  animation: flagPulse 1.2s ease-in-out infinite alternate;
}
@keyframes flagPulse { from { box-shadow: 0 0 6px var(--acc, var(--sys)); } to { box-shadow: 0 0 22px var(--acc, var(--sys)); } }
.vault.is-goal .feed__goalflag { display: block; }

/* ---------- SYS/00 boot ---------- */
.scr--boot { min-height: 92vh; display: flex; align-items: center; }
.boot { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: center; width: 100%; }
.boot__term {
  border: 1px solid var(--line-2); border-radius: 12px; background: rgba(5,9,16,.85);
  margin-bottom: 30px; overflow: hidden; max-width: 560px;
}
.boot__bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.boot__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.boot__bar i:nth-child(1) { background: #FF5F57; } .boot__bar i:nth-child(2) { background: #FEBC2E; } .boot__bar i:nth-child(3) { background: #28C840; }
.boot__bar span { margin-left: 8px; font-size: .6rem; letter-spacing: .12em; color: var(--mute); }
#bootLines { margin: 0; padding: 13px 15px; font-size: .68rem; line-height: 1.85; color: var(--dim); min-height: 122px; white-space: pre-wrap; }
#bootLines .ok { color: var(--mint); }
#bootLines .val { color: var(--sys); }
.boot__title { margin: 0 0 16px; font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em; }
.boot__title span { color: var(--sys); text-shadow: 0 0 34px rgba(77,224,249,.45); }
.boot__sub { margin: 0 0 10px; color: var(--dim); max-width: 520px; }
.boot__creed { margin: 0 0 28px; color: var(--mute); font-size: .72rem; letter-spacing: .04em; }
.boot__cta { display: flex; gap: 12px; flex-wrap: wrap; }
/* ---- the mascot: v1 presentation, floating free on the page ---- */
.boot__right { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mascot {
  position: relative; width: 100%; height: 540px;
  display: flex; align-items: center; justify-content: center;
  touch-action: pan-y;
}
/* backdrop tuned to the video's own baked-in ground, so the art reads as floating */
.mascot::before {
  content: ""; position: absolute; inset: -6% -10%; border-radius: 50%;
  background: radial-gradient(ellipse 50% 54% at 50% 47%, #0C1826 0%, #081220 46%, transparent 74%);
  filter: blur(30px); z-index: 0;
}
.mascot__halo {
  position: absolute; inset: 12% 14%;
  background: radial-gradient(ellipse at 50% 45%, rgba(77,224,249,.11), transparent 62%);
  filter: blur(38px); z-index: 0;
  animation: halo 6s ease-in-out infinite;
}
@keyframes halo { 50% { opacity: .55; transform: scale(1.04); } }
.mascot img,
.mascot__video {
  /* Oversize the art and centre it, so the squid fills the column and the video's
     own edges land far outside the mask — the frame can never show. The mask
     fades the baked-in background out well INSIDE the painted area. */
  position: absolute; left: 50%; top: 50%;
  width: 134%; height: 134%; max-width: none; max-height: none;
  transform: translate(-50%, -54%) translateZ(0);
  object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 0 44px rgba(77,224,249,.14)) drop-shadow(0 30px 60px rgba(0,0,0,.55)) brightness(.94);
  animation: floatSoft 8s ease-in-out infinite;
  -webkit-mask-image: radial-gradient(ellipse 47% 52% at 50% 47%, #000 54%, transparent 78%);
  mask-image: radial-gradient(ellipse 47% 52% at 50% 47%, #000 54%, transparent 78%);
}
@keyframes floatSoft { 50% { transform: translate(-50%, calc(-54% - 10px)) translateZ(0); } }
.mascot__video {
  z-index: 2; display: block; opacity: 0; transition: opacity .12s ease;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.mascot--ready .mascot__video { opacity: 1; }
.mascot__img-fallback { z-index: 1; pointer-events: none; }
.mascot--ready .mascot__img-fallback { opacity: 0; transition: opacity .12s ease .05s; }
.mascot--static .mascot__img-fallback { opacity: 1 !important; }
.mascot__cap {
  margin: -26px 0 0; text-align: center; font-size: .64rem; letter-spacing: .26em;
  color: var(--dim); text-shadow: 0 1px 8px rgba(0,0,0,.8);
}
.mascot__cap em { font-style: normal; color: var(--sys); }

/* ---------- SYS/01 vaults ---------- */
.vgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.6vw, 38px); }
.vault[data-accent="gold"]   { --acc: var(--gold); }
.vault[data-accent="indigo"] { --acc: var(--indigo); }
.vault[data-accent="mint"]   { --acc: var(--mint); }
.vault__read { padding-top: 16px; }
.vault__big { display: flex; align-items: baseline; gap: 9px; }
.vault__big b { font-size: 1.7rem; font-weight: 700; color: var(--acc); text-shadow: 0 0 26px color-mix(in srgb, var(--acc) 40%, transparent); letter-spacing: -.01em; }
.vault__big span { color: var(--mute); font-size: .78rem; }
.vault__big em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--acc); font-size: .95rem; }
.vault__bar { height: 3px; margin: 12px 0 14px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.vault__bar i { display: block; height: 100%; width: calc(var(--fill, 0) * 1%); background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 30%, transparent), var(--acc)); box-shadow: 0 0 12px -2px var(--acc); border-radius: 999px; transition: width 1.4s var(--ease); }
.vault__rows { margin: 0; display: grid; gap: 0; }
.vault__rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .68rem; letter-spacing: .03em; }
.vault__rows dt { color: var(--mute); margin: 0; }
.vault__rows dd { color: var(--ink); margin: 0; white-space: nowrap; }
.vault__soon { display: inline-block; margin-top: 12px; font-size: .56rem; letter-spacing: .16em; color: var(--indigo); }

/* ---------- SYS/02 armory ---------- */
.armory__controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }
.armory__input {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font-size: .92rem; padding: 12px 16px; width: 240px; outline: none;
}
.armory__input:focus { border-color: var(--sys); box-shadow: 0 0 0 3px rgba(77,224,249,.12); }
.armory__tiers { display: flex; gap: 8px; flex-wrap: wrap; }
.tierbtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--dim); font-size: .6rem; letter-spacing: .14em; padding: 8px 14px;
  transition: all .22s var(--ease);
}
.tierbtn em { font-style: normal; font-size: .82rem; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.tierbtn:hover { border-color: var(--sys); }
.tierbtn.is-on { border-color: var(--sys); background: rgba(77,224,249,.08); color: var(--sys); }
.tierbtn--elite.is-on { border-color: var(--gold); background: rgba(232,197,106,.09); color: var(--gold); }

.sword { position: relative; width: 100%; max-width: 940px; margin: 8px 0 10px; aspect-ratio: 1600 / 558; --lit: 52%; --edge: #B24DFF; }
.sword__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sword__img--cold { filter: grayscale(1) brightness(1.35) contrast(.78); opacity: .28; }
.sword__img--hot { clip-path: inset(0 calc(100% - var(--lit)) 0 0); transition: clip-path 1.1s var(--ease); filter: saturate(1.12); }
.sword__edge {
  position: absolute; top: 34%; bottom: 34%; left: var(--lit); width: 2px;
  background: var(--edge); border-radius: 2px;
  box-shadow: 0 0 10px 1px var(--edge), 0 0 26px 5px var(--edge);
  transition: left 1.1s var(--ease), background .6s linear, box-shadow .6s linear;
  animation: edgeFlicker 1.5s ease-in-out infinite alternate;
}
@keyframes edgeFlicker { from { opacity: .55; } to { opacity: .95; } }
.sword.sword--max .sword__edge { animation: none; opacity: 0; }
.sword__ticks { position: absolute; left: 0; right: 0; bottom: -4px; height: 30px; }
.sword__tick { position: absolute; transform: translateX(-50%); text-align: center; font-size: .56rem; letter-spacing: .14em; color: var(--mute); transition: color .4s var(--ease); }
.sword__tick::before { content: ""; display: block; width: 1px; height: 8px; margin: 0 auto 4px; background: currentColor; opacity: .55; }
.sword__tick.is-reached { color: var(--tc); text-shadow: 0 0 12px var(--tc); }
.sword__tick:last-child { transform: translateX(-88%); }

/* module list — terminal-style feature rows */
.modlist { display: grid; gap: 8px; margin-top: 34px; max-width: 980px; }
.mod {
  --tc: var(--sys);
  display: grid; grid-template-columns: 44px 1.15fr 1fr auto; align-items: center; gap: 16px;
  padding: 14px 18px; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008));
  border: 1px solid var(--line); border-left: 3px solid color-mix(in srgb, var(--tc) 35%, transparent);
  border-radius: 11px; transition: all .22s var(--ease);
}
.mod:hover, .mod:focus-visible { outline: none; border-color: color-mix(in srgb, var(--tc) 55%, var(--line)); transform: translateX(4px); }
.mod.is-unlocked { border-left-color: var(--tc); }
.mod__icon {
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.05rem; border-radius: 10px;
  background: color-mix(in srgb, var(--tc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 32%, transparent);
  filter: grayscale(.85); opacity: .55; transition: all .3s var(--ease);
}
.mod.is-unlocked .mod__icon { filter: none; opacity: 1; }
.mod__id h4 { margin: 0 0 3px; font-size: .95rem; }
.mod__id .mono { font-size: .58rem; letter-spacing: .14em; color: var(--tc); }
.mod__metric { font-family: var(--mono); font-size: .78rem; color: var(--tc); }
.mod__metric small { display: block; color: var(--mute); font-size: .6rem; letter-spacing: .06em; margin-top: 2px; }
.mod__state { text-align: right; font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; }
.mod__state b { display: block; color: var(--mute); font-weight: 500; }
.mod.is-unlocked .mod__state b { color: var(--mint); }
.mod__state span { color: var(--tc); opacity: .7; }
.mod:hover .mod__state span { opacity: 1; }

/* ---------- SYS/03 record ---------- */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 30px; }
.pipe {
  position: relative; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px;
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008));
}
.pipe::after {
  content: "›"; position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  color: var(--mute); z-index: 2; font-size: .9rem;
}
.pipe:last-child::after { content: none; }
.pipe span { display: block; font-size: .56rem; letter-spacing: .16em; color: var(--mute); }
.pipe b { display: block; font-size: 1.45rem; font-weight: 700; margin-top: 4px; color: var(--ink); }
.pipe i { display: block; font-style: normal; font-size: .58rem; color: var(--mute); margin-top: 2px; }
.pipe--val { border-color: rgba(47,230,176,.35); }
.pipe--val b { color: var(--mint); text-shadow: 0 0 22px rgba(47,230,176,.4); }

/* live decisions marquee */
.tick { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin-bottom: 22px; background: rgba(5,9,16,.75); }
.tick__head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; font-size: .58rem; letter-spacing: .16em; color: var(--dim); border-bottom: 1px solid var(--line); }
.tick__head span { display: inline-flex; align-items: center; gap: 8px; }
.tick__head span:last-child { color: var(--mute); }
.tick__viewport { overflow: hidden; padding: 11px 0; }
.tick__track { display: inline-flex; gap: 10px; white-space: nowrap; width: max-content; padding-left: 16px; animation: tickmove 90s linear infinite; }
.tick:hover .tick__track, .tick--held .tick__track { animation-play-state: paused; }
@keyframes tickmove { to { transform: translateX(-50%); } }
.tkpill {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 13px;
  font-size: .68rem; background: rgba(255,255,255,.02);
}
.tkpill--buy { border-color: rgba(47,230,176,.45); }
.tkpill__time { color: var(--mute); font-size: .58rem; }
.tkpill__rec { font-weight: 700; font-size: .6rem; letter-spacing: .12em; color: var(--mute); }
.tkpill--buy .tkpill__rec { color: var(--mint); }
.tkpill__sym { font-weight: 700; color: var(--ink); }
.tkpill__score, .tkpill__detail { color: var(--dim); font-size: .6rem; }
.tkpill--buy .tkpill__detail { color: var(--mint); }

.lb { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.lb__head { display: flex; justify-content: space-between; padding: 12px 16px; font-size: .6rem; letter-spacing: .16em; color: var(--sys); border-bottom: 1px solid var(--line); background: var(--panel); }
.lb__head span:last-child { color: var(--mute); }
.lb__rows { list-style: none; margin: 0; padding: 0; }
.lbrow {
  display: grid; grid-template-columns: 200px 1fr 96px; gap: 20px; align-items: center;
  width: 100%; padding: 13px 18px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background .18s var(--ease);
}
.lbrow:last-child { border-bottom: 0; }
.lbrow:hover { background: rgba(255,255,255,.025); }
.lbrow__lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lbrow__rank { font-family: var(--mono); font-size: .68rem; color: var(--mute); width: 26px; flex: none; }
.lbrow__id { min-width: 0; }
.lbrow__id b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbrow__id small { font-family: var(--mono); font-size: .56rem; color: var(--mute); letter-spacing: .05em; }
/* journey bar: entry → now → peak */
.lbrow__journey { display: block; min-width: 0; }
.lbrow__bar { position: relative; display: block; height: 4px; border-radius: 999px; background: rgba(255,255,255,.045); }

.lbrow__bar i {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px;
  background: linear-gradient(90deg, #FFD34D, #FF8A3D 55%, #FF3D2E);
  box-shadow: 0 0 10px -2px rgba(255,122,0,.65);
}
.lbrow__dot { position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); }
.lbrow__dot--peak { background: #FF4D2E; box-shadow: 0 0 12px rgba(255,61,46,.9); }
.lbrow__legend { display: flex; gap: 14px; margin-top: 7px; font-family: var(--mono); font-size: .58rem; color: var(--dim); }
.lbrow__legend em { font-style: normal; color: var(--mute); }
.lbrow__legend .pk { color: var(--gold); font-weight: 700; }
.lbrow__id small.now { display: block; color: var(--mute); margin-top: 1px; }
.lbrow__gain { font-family: var(--mono); font-weight: 700; color: var(--mint); text-shadow: 0 0 12px rgba(47,230,176,.5); font-size: .95rem; text-align: right; }

/* coin detail dialog */
.cmodal__sym { font-weight: 700; font-size: .8rem; letter-spacing: .04em; }
.cmodal__pnl { font-size: 1.7rem; font-weight: 700; color: var(--mint); text-shadow: 0 0 26px rgba(47,230,176,.45); }
.cmodal__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.cmodal__grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.cmodal__grid span { display: block; font-size: .54rem; letter-spacing: .16em; color: var(--mute); }
.cmodal__grid b { display: block; margin-top: 4px; font-size: .95rem; color: var(--ink); }
.cmodal__addr { font-size: .64rem; color: var(--mute); margin-bottom: 14px; word-break: break-all; }

/* ---------- SYS/04 payouts ---------- */
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.pstat { padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008)); }
.pstat b { display: block; font-size: 1.3rem; font-weight: 700; }
.pstat span { display: block; margin-top: 5px; font-size: .56rem; letter-spacing: .14em; color: var(--mute); }
.pstat--hot b { color: var(--mint); text-shadow: 0 0 22px rgba(47,230,176,.4); }
.ptable__scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.ptable { width: 100%; min-width: 920px; border-collapse: collapse; font-size: .74rem; }
.ptable thead th { position: sticky; top: 0; text-align: left; white-space: nowrap; padding: 12px 15px; font-size: .55rem; letter-spacing: .16em; font-weight: 600; color: var(--mute); background: var(--panel); border-bottom: 1px solid var(--line-2); }
.ptable tbody td { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable tbody tr:hover { background: rgba(255,255,255,.02); }
.ptable tr.is-top td { background: rgba(232,197,106,.05); }
.pr-rank { color: var(--mute); width: 40px; }
.ptable tr.is-top .pr-rank { color: var(--gold); font-weight: 700; }
.pr-addr { color: var(--ink); letter-spacing: .04em; }
.pr-holder { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .55rem; letter-spacing: .12em; border: 1px solid var(--line-2); color: var(--mute); }
.pr-holder--y { color: var(--mint); border-color: rgba(47,230,176,.4); background: rgba(47,230,176,.08); }
.pr-tok { color: var(--ink); font-weight: 600; }
.pr-tok small, .pr-pot small { display: block; margin-top: 2px; font-size: .58rem; font-weight: 400; color: var(--mute); }
.pr-gain { margin-left: 7px; font-weight: 700; color: #3DFFA8; text-shadow: 0 0 10px rgba(61,255,168,.8); }
.pr-pot { color: var(--sys); font-weight: 600; }
.pr-pot .u { font-size: .58rem; color: var(--mute); font-weight: 400; letter-spacing: .1em; }
.pr-age--max { color: var(--sys); text-shadow: 0 0 12px rgba(77,224,249,.5); }

/* ---------- SYS/05 flow ---------- */
.flowline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: fl; max-width: 1180px; }
.flowline li { position: relative; padding: 20px 18px 18px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008)); }
.flowline li::after { content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); color: var(--mute); z-index: 2; }
.flowline li:last-child::after { content: none; }
.flowline i { font-style: normal; font-size: .6rem; letter-spacing: .18em; color: var(--indigo); }
.flowline h5 { margin: 8px 0; font-size: .97rem; }
.flowline p { margin: 0; font-size: .76rem; line-height: 1.55; color: var(--dim); }

/* ---------- SYS/06 treasury ---------- */
.tsy__strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; max-width: 1100px; }
.tstat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008)); }
.tstat b { display: block; font-size: 1.25rem; font-weight: 700; color: var(--indigo); text-shadow: 0 0 20px rgba(123,140,255,.35); }
.tstat span { display: block; margin-top: 5px; font-size: .55rem; letter-spacing: .14em; color: var(--mute); }
.tsy { display: grid; grid-template-columns: 1fr 1.35fr; gap: 18px; max-width: 1100px; }
.tsy__panel { border: 1px solid var(--line); border-radius: 13px; padding: 20px; background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008)); }
.tsy__clock { display: grid; gap: 3px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tsy__clock span { font-size: .56rem; letter-spacing: .18em; color: var(--mute); }
.tsy__clock b { font-size: 1.5rem; color: var(--indigo); text-shadow: 0 0 24px rgba(123,140,255,.4); }
.tsy__clock i { font-style: normal; font-size: .64rem; color: var(--dim); }
.tsy__rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: .7rem; color: var(--dim); }
.tsy__rules b { color: var(--ink); }
.tsy__holdings { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; align-self: start; }
.tsy__row { display: grid; grid-template-columns: 62px 1fr 76px 120px; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: .72rem; }
.tsy__row:last-child { border-bottom: 0; }
.tsy__row .sym { color: var(--sys); font-weight: 700; }
.tsy__row .nm { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsy__row .px { text-align: right; color: var(--ink); font-weight: 600; }
.tsy__row--head { background: var(--panel); color: var(--mute); font-size: .55rem; letter-spacing: .16em; }
/* 24h change: % on top, thin diverging bar beneath (red grows left, green right) */
.tchg { display: grid; gap: 4px; justify-items: end; }
.tchg b { font-size: .6rem; font-weight: 700; line-height: 1; }
.tchg b.up { color: var(--mint); }
.tchg b.dn { color: var(--red); }
.tchg .z { font-size: .58rem; color: var(--mute); line-height: 1; }
.tchg .rail24 { position: relative; width: 100%; height: 3px; border-radius: 999px; background: rgba(255,255,255,.06); }
.tchg .rail24::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line-2); }
.tchg .rail24 i { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.tchg .rail24 i.up { left: 50%; background: var(--mint); box-shadow: 0 0 6px rgba(47,230,176,.6); }
.tchg .rail24 i.dn { right: 50%; background: var(--red); box-shadow: 0 0 6px rgba(255,77,94,.6); }
.tsy__note { margin-top: 10px; font-size: .58rem; letter-spacing: .05em; color: var(--mute); }

/* ---------- SYS/07 buy ---------- */
.scr--buy { border-bottom: 0; padding-bottom: 40px; }
.buy__ca { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; padding: 13px 16px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--panel); max-width: 760px; }
.buy__ca span { font-size: .58rem; letter-spacing: .18em; color: var(--mute); }
.buy__ca code { font-size: .74rem; color: var(--sys); word-break: break-all; }
.buy__price { display: none; gap: 18px; margin-bottom: 18px; font-size: .72rem; color: var(--dim); }
.buy__price.is-live { display: flex; flex-wrap: wrap; }
.buy__price b { color: var(--sys); font-weight: 700; }
.buy__row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.buy__disc { max-width: 720px; font-size: .6rem; line-height: 1.8; color: var(--mute); }
.deckfoot { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .6rem; letter-spacing: .08em; color: var(--mute); }
.deckfoot a { color: var(--dim); text-decoration: underline; }

/* ---------- modal (ported from v1, deck-styled) ---------- */
.fmodal { width: min(620px, calc(100vw - 32px)); max-height: min(86vh, 780px); padding: 0; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel-2); color: var(--ink); overflow: hidden; box-shadow: 0 40px 120px -30px #000; }
.fmodal::backdrop { background: rgba(2,5,10,.8); backdrop-filter: blur(7px); }
.fmodal[open] { animation: fmIn .28s var(--ease) both; }
@keyframes fmIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.fmodal__head { display: flex; align-items: flex-start; gap: 13px; padding: 22px 22px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--tc, var(--sys)) 10%, transparent), transparent); }
.fmodal__icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 1.35rem; border-radius: 12px; background: color-mix(in srgb, var(--tc, var(--sys)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tc, var(--sys)) 36%, transparent); }
.fmodal__titles { flex: 1; min-width: 0; }
.fmodal__titles h3 { margin: 0 0 6px; font-size: 1.16rem; }
.fmodal__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fmchip { font-size: .55rem; letter-spacing: .14em; padding: 3px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tc, var(--sys)) 32%, transparent); color: var(--tc, var(--sys)); }
.fmchip--ok { color: var(--mint); border-color: rgba(47,230,176,.4); background: rgba(47,230,176,.09); }
.fmchip--no { color: var(--mute); border-color: var(--line-2); }
.fmodal__x { flex: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--dim); }
.fmodal__x:hover { color: var(--ink); border-color: var(--line-2); }
.fmodal__body { padding: 20px 22px 24px; overflow-y: auto; }
.fmodal__metric { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--tc, var(--sys)); text-shadow: 0 0 26px color-mix(in srgb, var(--tc, var(--sys)) 40%, transparent); }
.fmodal__metric small { display: block; font-size: .58rem; font-weight: 500; letter-spacing: .14em; color: var(--mute); text-shadow: none; margin-top: 4px; }
.fmodal__lede { margin: 16px 0 0; font-size: .86rem; line-height: 1.66; color: var(--dim); }
.fmodal__h { margin: 22px 0 10px; font-size: .58rem; letter-spacing: .17em; color: var(--mute); }
.fmodal__steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 9px; }
.fmodal__steps li { counter-increment: s; position: relative; padding-left: 30px; font-size: .8rem; line-height: 1.55; color: var(--dim); }
.fmodal__steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; font-family: var(--mono); font-size: .6rem; font-weight: 700; color: var(--tc, var(--sys)); background: color-mix(in srgb, var(--tc, var(--sys)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tc, var(--sys)) 30%, transparent); }
.fmodal__need { margin-top: 20px; padding: 13px 15px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); font-size: .78rem; line-height: 1.55; color: var(--dim); }
.fmodal__need b { color: var(--ink); }

.rollup { font-variant-numeric: tabular-nums; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pulse, .scr__sys::before, .sword__edge, .feed__goalflag,
  .mascot img, .mascot__halo { animation: none !important; }
  .mascot__video { display: none; }
  html { scroll-behavior: auto; }
}

/* ---------- tablet ---------- */
@media (max-width: 1200px) {
  .vgrid { grid-template-columns: 1fr; max-width: 560px; }
  .lbrow { grid-template-columns: 150px 1fr 74px; gap: 12px; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipe::after { content: none; }
  .flowline { grid-template-columns: repeat(2, 1fr); }
  .flowline li::after { content: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  :root { --rail-w: 0px; }
  .rail, .rail__open { display: none !important; }
  .mtop {
    display: flex; position: fixed; z-index: 40; top: 0; left: 0; right: 0;
    align-items: center; justify-content: space-between; padding: 11px 16px;
    background: rgba(5,9,16,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
    font-size: .68rem; letter-spacing: .18em;
  }
  .mtop__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
  .mtop__brand img { width: 22px; height: 22px; }
  .mtop__live { display: flex; gap: 7px; align-items: center; color: var(--mint); font-size: .56rem; }
  .mtabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40;
    bottom: 0; left: 0; right: 0; background: rgba(5,9,16,.95); border-top: 1px solid var(--line);
    backdrop-filter: blur(10px); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mtabs a { text-align: center; padding: 10px 2px; font-size: .58rem; letter-spacing: .1em; color: var(--dim); border-radius: 8px; }
  .mtabs a.is-buy { color: var(--gold); }
  .mtabs a.is-active { color: var(--sys); background: rgba(77,224,249,.07); }
  .deck { margin-left: 0; padding-top: 46px; padding-bottom: 66px; }
  .scr { padding: 56px 18px 48px; }
  .scr--boot { min-height: auto; }
  .boot { grid-template-columns: 1fr; }
  .boot__right { order: -1; max-width: 340px; margin: 0 auto; }
  .mascot { height: 300px; }
  .mascot__cap { font-size: .52rem; letter-spacing: .18em; margin-top: -14px; }
  .boot__term { max-width: none; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pstats { grid-template-columns: repeat(2, 1fr); }
  .flowline { grid-template-columns: 1fr; }
  .tsy { grid-template-columns: 1fr; }
  .tsy__strip { grid-template-columns: repeat(2, 1fr); }
  .tsy__row { grid-template-columns: 54px 1fr 66px 92px; gap: 8px; }
  .mod { grid-template-columns: 38px 1fr auto; }
  .lbrow { grid-template-columns: 1fr 74px; }
  .lbrow__journey { grid-column: 1 / -1; }
  .mod__metric { display: none; }
  .armory__input { width: 100%; }
  .vault__big b { font-size: 1.45rem; }
  .boot__title { font-size: 2.1rem; }
}

/* ---------- leaderboard window filter (3d/7d/14d/30d) ----------
   Injected by v2.js only when the snapshot carries SQUDAI_WINDOWS, so an older
   payload renders exactly as before. .lb__head is a space-between flex row; the bar
   is centred between the title and the hint, and drops to its own line on narrow
   screens rather than squeezing either. */
.winfilter { display: flex; gap: 5px; align-items: center; }
.winfilter__btn {
  font-family: var(--mono);
  font-size: .58rem; letter-spacing: .1em;
  color: var(--mute);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.winfilter__btn:hover { color: var(--ink); border-color: var(--sys); }
.winfilter__btn:focus-visible { outline: 1px solid var(--sys); outline-offset: 2px; }
.winfilter__btn.is-active {
  color: var(--bg);
  background: var(--sys);
  border-color: var(--sys);
}
/* empty state matches the row rhythm rather than collapsing the panel */
.lb__empty { padding: 22px 18px; color: var(--mute); font-size: .72rem; }

@media (max-width: 720px) {
  .lb__head { flex-wrap: wrap; gap: 8px; }
  .winfilter { order: 3; width: 100%; }
}

/* ---------- treasury: new-feature chip + unfunded explainer ---------- */
.newchip {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  font-size: .52rem; letter-spacing: .14em; font-style: normal;
  color: var(--bg); background: var(--mint);
  border-radius: 999px; vertical-align: middle;
}
.tsy__fresh {
  margin: 10px 0 0; padding: 9px 13px;
  font-size: .58rem; letter-spacing: .1em; line-height: 1.6;
  color: var(--dim);
  border: 1px dashed var(--line-2); border-radius: 9px;
  background: rgba(47,230,176,.04);
}

/* ---------- top tape: live $SQUDAI market cap + xStocks ----------
   Fixed to the very top; the systems rail and page content shift down only when the
   tape is actually present (body.has-tape), so a failed price fetch leaves the layout
   untouched instead of opening a gap. */
/* An author `display` beats the [hidden] attribute's UA rule, so without this the bar
   renders as an empty strip whenever the snapshot has no quotes. Must come first. */
.tape[hidden] { display: none !important; }
.tape {
  /* starts AFTER the rail so it never crosses the blade/logo. --rail-w collapses to 0
     on narrow screens, so the same rule spans full width there without a second case.
     Sits BELOW the rail's z-index for the same reason. */
  position: fixed; top: 0; right: 0; left: var(--rail-w); z-index: 30;
  height: 34px; display: flex; align-items: center;
  background: linear-gradient(90deg, rgba(4,7,13,.97), rgba(10,17,29,.97));
  border-bottom: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.tape__vp { overflow: hidden; width: 100%; }
.tape__track {
  display: inline-flex; gap: 34px; white-space: nowrap; width: max-content;
  padding-left: 28px; animation: tapemove 44s linear infinite;
  will-change: transform;
}
.tape:hover .tape__track { animation-play-state: paused; }
@keyframes tapemove { to { transform: translateX(-50%); } }

.tape__cell { display: inline-flex; align-items: baseline; gap: 8px; flex: none; font-family: var(--mono); font-size: .66rem; }
.tape__sym { color: var(--mute); letter-spacing: .1em; }
.tape__val { color: var(--ink); font-weight: 600; }
.tape__unit { color: var(--mute); font-size: .52rem; letter-spacing: .12em; }
.tape__chg { font-size: .58rem; color: var(--mute); }
.tape__chg--up { color: var(--mint); }
.tape__chg--dn { color: var(--red); }
/* our own token gets the accent so the eye finds it first */
.tape__cell--native .tape__sym { color: var(--sys); }
.tape__cell--native .tape__val { color: var(--sys); text-shadow: 0 0 18px rgba(77,224,249,.35); }

body.has-tape .deck { padding-top: 34px; }
body.rail-closed .tape { left: 0; }
.tape { transition: left .32s var(--ease); }
@media (max-width: 720px) {
  .tape { height: 30px; }
  /* duration is set inline by v2.js (scales with item count) and an inline style
     beats a media query — only the gap is adjustable here. */
  .tape__track { gap: 24px; }
  body.has-tape .deck { padding-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .tape__track { animation: none; }
}
