/* ALPHARADAR app — same instrument palette as the marketing site.
   Tokens mirror the inline values in static/index.html; if those move, move these. */

:root {
  --bg:      #080C16;
  --panel:   #0F1626;
  --panel-2: #121B2E;
  --line:    #1B2740;
  --line-2:  #24334F;
  --text:    #E9EFF8;
  --muted:   #8FA3BF;
  --blue:    #2E90FF;
  --aqua:    #29E0C8;
  --cyan:    #5FD3F3;
  --ink:     #061019;
  --warn:    #F2B25C;
  --fail:    #FF6B6B;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --grad:    linear-gradient(100deg, var(--blue), var(--aqua));
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 300; letter-spacing: -0.02em; margin: 0 0 10px; }
h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 8px; }

p { margin: 0 0 14px; text-wrap: pretty; }

code, .mono { font-family: var(--mono); font-size: 0.92em; }

/* ------------------------------------------------------------------ chrome */

.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 22, 0.86);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 500; letter-spacing: 0.14em; font-size: 13px;
}
.brand:hover { text-decoration: none; }
.bar__right { display: flex; align-items: center; gap: 14px; margin: 0; }
.bar__email { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.main { min-height: calc(100vh - 150px); padding: 44px 24px 72px; }

.foot {
  border-top: 1px solid var(--line);
  padding: 20px 24px 34px;
}
.foot p {
  max-width: 760px; margin: 0 auto;
  font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center;
}

/* -------------------------------------------------------------------- auth */

.card {
  max-width: 420px; margin: 4vh auto 0;
  padding: 34px 32px 28px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel);
}
.card h1 { font-size: 26px; }

.lede { color: var(--muted); font-size: 15px; margin-bottom: 24px; }

.stack { display: flex; flex-direction: column; gap: 10px; margin: 0; }
/* Field labels are mono caps; a consent line is a sentence, not a field label. */
.stack label:not(.check) {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-top: 6px;
}

input[type=text], input[type=email], input[type=password], input:not([type]) {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 15px;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
input::placeholder { color: #4A5A75; }

.code-input {
  font-family: var(--mono); font-size: 26px; letter-spacing: 0.42em;
  text-align: center; padding: 16px 14px 16px 24px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 24px; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--grad); color: var(--ink); }
.btn--ghost {
  background: rgba(15, 22, 38, 0.55);
  border: 1px solid var(--line-2); color: var(--text); font-weight: 400;
}
.btn--google { background: #FFF; color: #1F2328; font-weight: 500; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.or {
  position: relative; text-align: center; margin: 22px 0 14px;
  color: var(--muted); font-size: 12px;
}
.or::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--line);
}
.or span { position: relative; background: var(--panel); padding: 0 12px; }

.fine { font-size: 12px; color: var(--muted); margin-top: 18px; }

.alert {
  padding: 11px 14px; border-radius: 10px; font-size: 14px;
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08); color: #FFC4C4;
}
.alert--warn {
  border-color: rgba(242, 178, 92, 0.42);
  background: rgba(242, 178, 92, 0.08); color: #F6D9AC;
}

/* ------------------------------------------------------------- onboarding */

.ob {
  display: grid; grid-template-columns: 210px minmax(0, 640px);
  gap: 56px; max-width: 920px; margin: 0 auto;
}
.ob__body { min-width: 0; }

.rail ol { list-style: none; margin: 6px 0 0; padding: 0; }
.rail li {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0; font-size: 13px; color: #55658020;
}
.rail__label { color: #5C6E8C; }
.rail__dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  border: 1px solid var(--line-2); background: transparent;
}
.rail .is-done .rail__dot { background: var(--aqua); border-color: var(--aqua); }
.rail .is-done .rail__label { color: var(--muted); }
.rail .is-now .rail__dot {
  background: var(--blue); border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(46, 144, 255, 0.16);
}
.rail .is-now .rail__label { color: var(--text); font-weight: 500; }

a.rail__label { color: inherit; }
a.rail__label:hover { color: var(--cyan); text-decoration: none; }
.rail .is-link a.rail__label { cursor: pointer; }
.rail__back { margin: 18px 0 0; font-size: 13px; }
.rail__back a { color: var(--muted); }
.rail__back a:hover { color: var(--cyan); text-decoration: none; }

.panel {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); padding: 22px 24px 8px; margin: 0 0 24px;
}
.panel--quiet { background: var(--panel-2); }
.panel--fail { border-color: rgba(255, 107, 107, 0.36); }
.panel h2 { margin-top: 18px; }
.panel h2:first-child { margin-top: 0; }
.panel ul { margin: 0 0 14px; padding-left: 18px; color: var(--muted); }
.panel li { margin-bottom: 6px; }
.panel p { color: var(--muted); font-size: 14.5px; }
.panel strong { color: var(--text); font-weight: 500; }

.check { display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; color: var(--muted); }
.check input { margin-top: 4px; accent-color: var(--blue); }

.choices { display: grid; gap: 12px; margin: 0; }
.choice {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 20px 22px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--panel); color: var(--text);
  font-family: inherit; font-size: 16px; text-align: left; cursor: pointer;
}
.choice:hover { border-color: var(--blue); background: var(--panel-2); }
.choice strong { font-weight: 500; }
.choice span { font-size: 13.5px; color: var(--muted); }

.guide { counter-reset: g; list-style: none; margin: 0 0 26px; padding: 0; }
.guide > li {
  position: relative; padding: 0 0 22px 44px;
  border-left: 1px solid var(--line); margin-left: 13px;
}
.guide > li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.guide > li::before {
  counter-increment: g; content: counter(g);
  position: absolute; left: -13px; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.guide p { color: var(--muted); font-size: 14.5px; }
.guide code {
  padding: 1px 6px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.note {
  border-left: 2px solid var(--blue); padding-left: 12px;
  font-size: 13.5px !important;
}

.copybox {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 16px 16px 20px; margin: 0 0 26px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel);
}
.copybox code { font-size: 17px; letter-spacing: 0.04em; color: var(--cyan); }

/* Chrome fires no event when it autofills, but it DOES apply :-webkit-autofill,
   and applying an animation to that pseudo-class produces an animationstart the
   page can hear. That is the only precise signal available, and it is what
   onboard.js uses to clear a credential the browser inserted uninvited.
   Firefox has :autofill; both are listed so neither is missed. */
@keyframes ar-autofill-detected { from { opacity: 1; } to { opacity: 1; } }
input[data-noautofill]:-webkit-autofill,
input[data-noautofill]:autofill {
  animation-name: ar-autofill-detected;
  animation-duration: 1ms;
}

/* Secret field with a show/hide control. Without a way to check what landed,
   a truncated paste only surfaces as KEY_INVALID two steps later. */
.reveal { position: relative; display: flex; }
.reveal input { padding-right: 66px; }
.reveal__btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--muted); font-family: var(--mono); font-size: 11px;
  padding: 5px 10px; cursor: pointer;
}
.reveal__btn:hover { color: var(--text); border-color: var(--blue); }

.seal {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--muted); margin: 4px 0 8px; display: flex; align-items: center; gap: 8px;
}
.seal::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); flex: none;
}
.seal.is-sealed { color: var(--aqua); }
.seal.is-sealed::before { background: var(--aqua); }
.seal.is-fail { color: var(--fail); letter-spacing: 0; }
.seal.is-fail::before { background: var(--fail); }

.money { display: flex; align-items: center; gap: 10px; }
.money span { font-family: var(--mono); font-size: 28px; color: var(--muted); }
.money input { font-family: var(--mono); font-size: 24px; padding: 12px 14px; }

.inr {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  margin: 2px 0 0; min-height: 1.2em;
}
.hint { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }
.hint strong { color: var(--text); font-weight: 500; }

.coverage {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--cyan); margin: 10px 0 22px;
}
.coverage.is-low { color: var(--warn); }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.inline { margin: 0; display: inline; }

/* Escape hatch for a step that a network filter can break. Closed by default:
   the standard route works for most people, and leading with four ways to do
   one thing reads as an unreliable product. It opens where it is needed. */
.drawer {
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel); margin: 0 0 26px;
}
.drawer > summary {
  cursor: pointer; padding: 14px 20px; font-size: 14.5px; color: var(--cyan);
  list-style: none; user-select: none;
}
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary::before { content: '+ '; font-family: var(--mono); }
.drawer[open] > summary::before { content: '\2212 '; }
.drawer > summary:hover { color: var(--fg); }
.drawer__body { padding: 0 20px 4px; border-top: 1px solid var(--line-2); }
.drawer__body > *:first-child { margin-top: 18px; }
.drawer__body h3 { font-size: 15px; margin: 26px 0 10px; }
.drawer__body .copybox { margin-bottom: 14px; }
.drawer__body .copybox code { font-size: 14px; word-break: break-all; }

.checks { list-style: none; margin: 0 0 26px; padding: 0; }
.checks li {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: 14.5px; color: var(--muted);
}
.checks li > span {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--line-2);
}
.checks .wait > span { background: var(--muted); animation: pulse 1.3s ease-in-out infinite; }
.checks .ok { color: var(--text); }
.checks .ok > span { background: var(--aqua); }
.checks .fail > span { background: var(--fail); }

@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .checks .wait > span { animation: none; opacity: 0.6; }
}

.ok-line { color: var(--aqua); font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }
.waiting { color: var(--muted); font-size: 14px; }

/* -------------------------------------------------------------- dashboard */

.wrap { max-width: 920px; margin: 0 auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 28px; }
.tile { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 18px 20px; }
.tile__k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 8px;
}
.tile__v { font-family: var(--mono); font-size: 22px; color: var(--text); }

/* ------------------------------------------------------------------ small */

@media (max-width: 760px) {
  .ob { grid-template-columns: 1fr; gap: 26px; }
  .rail ol { display: flex; flex-wrap: wrap; gap: 0 16px; }
  .rail li { padding: 4px 0; }
  .rail__label { font-size: 12px; }
  .main { padding: 28px 18px 56px; }
  .card { padding: 26px 22px; }
  .bar__email { display: none; }
}

/* ===========================================================================
   DASHBOARD
   The reference language: near-black ground, one cool gradient, glass panels
   with a hairline top edge, thin light type. Colour means something here —
   up/down, live/stale — and is never decoration. If everything glows, nothing
   reads.
   =========================================================================== */

.dash { max-width: 1180px; margin: 0 auto; padding: 8px 0 40px; }

.dash__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin: 0 0 26px;
}
.dash__head h1 { font-size: 34px; font-weight: 200; letter-spacing: -0.02em; margin: 2px 0 0; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
.dash__flags { display: flex; gap: 10px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 11px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--muted);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--on   { color: var(--aqua); border-color: rgba(41,224,200,0.32); }
.chip--warn { color: var(--warn); border-color: rgba(242,178,92,0.32); }
.chip--off  { color: var(--muted); }
.chip--on i { box-shadow: 0 0 0 3px rgba(41,224,200,0.16); }

/* -- grids ---------------------------------------------------------------- */
.grid { display: grid; gap: 16px; margin: 0 0 16px; }
.grid--stats { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
.grid--split { grid-template-columns: 1.15fr 1fr; }

@media (max-width: 1000px) {
  .grid--stats { grid-template-columns: 1fr 1fr; }
  .grid--split { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid--stats { grid-template-columns: 1fr; }
  .dash__head h1 { font-size: 28px; }
}

/* -- surfaces -------------------------------------------------------------- */
/* One shared surface. The hairline highlight along the top edge is what makes
   these read as glass rather than as flat boxes, and it is the whole trick. */
.stat, .dash .panel {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(46,144,255,0.07), transparent 55%),
    var(--panel);
}
.stat::before, .dash .panel::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(95,211,243,0.35), transparent);
}

.stat { padding: 20px 22px 22px; }
.stat__label { font-size: 12px; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 10px; }
.stat__value {
  font-size: 30px; font-weight: 200; letter-spacing: -0.02em; margin: 0;
  font-variant-numeric: tabular-nums;
}
.stat__sub { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.stat--hero .stat__value { font-size: 40px; }

.is-up   { color: var(--aqua); }
.is-down { color: var(--fail); }

.spark { margin: 16px 0 -6px; height: 44px; }
.spark svg { width: 100%; height: 44px; display: block; }

.dash .panel { padding: 20px 22px 22px; margin: 0; }
.panel__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin: 0 0 18px;
}
.panel__head h2 { font-size: 16px; font-weight: 500; margin: 0; }
.panel__sub { font-size: 12.5px; color: var(--muted); margin: 5px 0 0; }

/* -- radar ---------------------------------------------------------------- */
.radar { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.radar__stage {
  position: relative; flex: 1 1 260px; min-width: 240px;
  display: flex; justify-content: center;
}
/* The glow lives behind the canvas rather than in it — cheaper than painting it
   every frame, and it survives the reduced-motion path where nothing animates. */
.radar__stage::after {
  content: ''; position: absolute; inset: 12%; border-radius: 50%;
  background: radial-gradient(circle, rgba(41,224,200,0.10), transparent 62%);
  pointer-events: none;
}
.radar__stage canvas { position: relative; z-index: 1; }
.radar__read { flex: 1 1 190px; min-width: 180px; }

.radar__price {
  font-size: 30px; font-weight: 200; letter-spacing: -0.02em; margin: 0;
  font-variant-numeric: tabular-nums;
}
.radar__change { font-size: 13px; margin: 4px 0 16px; font-variant-numeric: tabular-nums; }
.radar__change.is-up { color: var(--aqua); }
.radar__change.is-down { color: var(--fail); }

.radar__state {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--aqua); margin: 0; white-space: nowrap;
}
.radar__state.is-stale { color: var(--warn); }
.radar__state.is-off { color: var(--muted); }

.radar__meta { margin: 0 0 16px; display: grid; gap: 8px; }
.radar__meta div { display: flex; justify-content: space-between; gap: 12px; }
.radar__meta dt { font-size: 12px; color: var(--muted); margin: 0; }
.radar__meta dd { font-family: var(--mono); font-size: 12px; margin: 0; color: var(--text); }

.radar__key { list-style: none; margin: 0 0 12px; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.radar__key li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot--call { background: var(--aqua); }
.dot--put  { background: var(--blue); }
.dot--spot { background: var(--text); }
.radar__note { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.5; }

/* -- positions ------------------------------------------------------------- */
.poslist { list-style: none; margin: 0; padding: 0; }
.poslist li {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.poslist li:last-child { border-bottom: 0; padding-bottom: 0; }
.poslist__sym { display: flex; align-items: center; gap: 10px; min-width: 0; }
.poslist__sym code { font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
.poslist__num { display: flex; gap: 16px; align-items: baseline; white-space: nowrap; }
.poslist__num span { font-family: var(--mono); font-size: 12.5px; }
.poslist__num span:first-child { color: var(--muted); }

.tag {
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted);
}
.tag--long, .tag--buy   { color: var(--aqua); border-color: rgba(41,224,200,0.3); }
.tag--short, .tag--sell { color: var(--blue); border-color: rgba(46,144,255,0.3); }

.empty { padding: 26px 0 6px; }
.empty p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.empty .fine { font-size: 12px; }

/* -- table ----------------------------------------------------------------- */
.tablewrap { overflow-x: auto; margin: 0 -22px -22px; padding: 0 22px 22px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 660px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); padding: 0 14px 12px 0;
  border-bottom: 1px solid var(--line);
}
.tbl td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl th.num { text-align: right; padding-right: 0; }
.tbl .mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.tbl code { font-size: 12px; }
.tbl .muted { color: var(--muted); font-size: 12px; }
.tbl tbody tr:hover td { background: rgba(46,144,255,0.04); }

.pill {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.pill--ok  { color: var(--aqua); border-color: rgba(41,224,200,0.28); }
.pill--bad { color: var(--fail); border-color: rgba(255,107,107,0.28); }

.dash__foot { font-size: 11.5px; color: var(--muted); margin: 22px 0 0; }

/* ---------------------------------------------------------------------------
   DASHBOARD — depth pass
   The first version was correct and flat. What the reference boards actually
   have is DEPTH: ambient light sitting behind the glass, edges that catch that
   light, and a foreground that is legibly closer than the background. None of
   it is decoration for its own sake — it is what separates the layers.
   --------------------------------------------------------------------------- */

/* Ambient light. Two slow blobs behind everything, fixed to the viewport so
   panels drift over them rather than carrying their own gradient. Pinned
   behind content and non-interactive; it can never eat a click. */
.dash::before, .dash::after {
  content: ''; position: fixed; z-index: -1; pointer-events: none;
  border-radius: 50%; filter: blur(90px); opacity: 0.55;
}
.dash::before {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -14vh; left: -8vw;
  background: radial-gradient(circle, rgba(46,144,255,0.30), transparent 68%);
  animation: drift-a 34s ease-in-out infinite alternate;
}
.dash::after {
  width: 40vw; height: 40vw; max-width: 540px; max-height: 540px;
  top: 32vh; right: -10vw;
  background: radial-gradient(circle, rgba(41,224,200,0.22), transparent 68%);
  animation: drift-b 41s ease-in-out infinite alternate;
}
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 7vh, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-5vw, -6vh, 0) scale(1); }
}

/* Glass. The panels sit ON the ambient light, so they are translucent and
   blurred rather than opaque — that is the whole difference between a card on
   a dark page and a pane of glass over a lit one. */
.stat, .dash .panel {
  background:
    linear-gradient(158deg, rgba(24,36,60,0.82), rgba(13,20,34,0.72));
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  border-color: rgba(95,211,243,0.10);
  box-shadow:
    0 1px 0 0 rgba(233,239,248,0.05) inset,
    0 18px 40px -24px rgba(0,0,0,0.9);
  transition: border-color 220ms cubic-bezier(0.16,1,0.3,1),
              transform 220ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 220ms cubic-bezier(0.16,1,0.3,1);
}
.stat:hover, .dash .panel:hover {
  border-color: rgba(95,211,243,0.22);
  box-shadow:
    0 1px 0 0 rgba(233,239,248,0.07) inset,
    0 24px 52px -26px rgba(0,0,0,0.95);
}

/* The hero number carries the gradient the brand is built on. Reserved for
   exactly one element on the page — a second would make neither of them read. */
.stat--hero .stat__value {
  font-size: clamp(34px, 4vw, 46px);
  background: linear-gradient(100deg, #E9EFF8 10%, var(--cyan) 60%, var(--aqua));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.stat--hero .stat__value.is-down {
  background: linear-gradient(100deg, #E9EFF8 10%, #FFA3A3 55%, var(--fail));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Labels read as instrument graduations, not form labels. */
.stat__label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: #6F82A0;
}

/* A live account should look live. One dot, one pulse, and only when active. */
.chip--on i { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(41,224,200,0.16); }
  50%      { box-shadow: 0 0 0 6px rgba(41,224,200,0.04); }
}

/* Entrance. Expo-out, staggered down the page — the panels arrive as a wave
   instead of appearing all at once, which is what makes a dashboard feel
   assembled rather than dumped. */
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.dash .stat, .dash .panel {
  animation: rise 520ms cubic-bezier(0.16,1,0.3,1) backwards;
}
.dash .grid--stats .stat:nth-child(1) { animation-delay: 40ms; }
.dash .grid--stats .stat:nth-child(2) { animation-delay: 90ms; }
.dash .grid--stats .stat:nth-child(3) { animation-delay: 140ms; }
.dash .grid--stats .stat:nth-child(4) { animation-delay: 190ms; }
.dash .grid--split .panel:nth-child(1) { animation-delay: 240ms; }
.dash .grid--split .panel:nth-child(2) { animation-delay: 290ms; }
.dash > .panel { animation-delay: 340ms; }

/* The radar gets its own light well behind the canvas. */
.panel--radar { overflow: visible; }
.radar__stage::after {
  inset: 6%;
  background:
    radial-gradient(circle, rgba(41,224,200,0.16), rgba(46,144,255,0.06) 45%, transparent 68%);
}
.radar__price {
  font-family: var(--mono); font-weight: 400;
  font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.01em;
}
.radar__state {
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid rgba(41,224,200,0.22); background: rgba(41,224,200,0.06);
}
.radar__state.is-stale { border-color: rgba(242,178,92,0.28); background: rgba(242,178,92,0.06); }
.radar__state.is-off   { border-color: var(--line-2); background: transparent; }

/* Every one of the above is atmosphere, and atmosphere is exactly what a
   reduced-motion setting is asking not to have moving. The scene stays; only
   the movement stops. */
@media (prefers-reduced-motion: reduce) {
  .dash::before, .dash::after,
  .dash .stat, .dash .panel, .chip--on i { animation: none; }
}

/* ---------------------------------------------------------------------------
   DASHBOARD — layout pass 2 and the hover beam
   --------------------------------------------------------------------------- */

/* The two live instruments lead the page, side by side. */
.grid--scopes { grid-template-columns: 1.12fr 1fr; }
@media (max-width: 1000px) { .grid--scopes { grid-template-columns: 1fr; } }

/* -- market pressure ------------------------------------------------------- */
.flow { display: flex; flex-direction: column; gap: 14px; }
.flow__stage {
  position: relative; border-radius: 12px; overflow: hidden;
  background: #090E19; border: 1px solid var(--line);
}
.flow__stage canvas { display: block; }
/* Vignette, so the grains fade at the edges instead of stopping at a hard
   rectangle — the field should look like a window onto something larger. */
.flow__stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 42%, rgba(9,14,25,0.92));
}
.flow__meta { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.flow__meta div { min-width: 0; }
.flow__meta dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #6F82A0; margin: 0 0 4px;
}
.flow__meta dd {
  font-family: var(--mono); font-size: 14px; margin: 0; color: var(--text);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.flow__bias {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  margin: 0; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--muted);
}
.flow__bias.is-up   { color: var(--aqua); border-color: rgba(41,224,200,0.28); background: rgba(41,224,200,0.06); }
.flow__bias.is-down { color: var(--blue); border-color: rgba(46,144,255,0.30); background: rgba(46,144,255,0.06); }
.flow__bias.is-flat { color: var(--muted); }

/* -- the hover beam --------------------------------------------------------- */
/* A light that travels the edge of the card, plus a short lift. Built from a
   conic gradient rotated by a registered custom property — the only way to
   animate a gradient angle on the compositor rather than by repainting a
   border every frame.
   The beam lives on ::after, masked to a 1px ring, so it never covers content
   and never intercepts a pointer event. */
@property --beam {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.dash .stat, .dash .panel { --beam: 0deg; }

.dash .stat::after, .dash .panel::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; pointer-events: none; opacity: 0;
  background: conic-gradient(from var(--beam),
    transparent 0deg, transparent 300deg,
    rgba(95,211,243,0.85) 340deg, rgba(41,224,200,1) 352deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity 260ms cubic-bezier(0.16,1,0.3,1);
}

.dash .stat:hover::after, .dash .panel:hover::after,
.dash .stat:focus-within::after, .dash .panel:focus-within::after {
  opacity: 1;
  animation: beam 2.6s linear infinite;
}

@keyframes beam { to { --beam: 360deg; } }

/* The punch: a short lift with a light bloom under it, so the card reads as
   coming forward rather than merely changing colour. */
.dash .stat:hover, .dash .panel:hover {
  transform: translate3d(0, -3px, 0);
  box-shadow:
    0 1px 0 0 rgba(233,239,248,0.09) inset,
    0 28px 60px -28px rgba(0,0,0,0.95),
    0 0 42px -14px rgba(41,224,200,0.30);
}

/* Fallback for engines without @property (Firefox before 128): the angle cannot
   animate, so the ring is shown as a steady glow. The affordance survives; only
   the travel is lost. */
@supports not (background: conic-gradient(from var(--beam), red, blue)) {
  .dash .stat::after, .dash .panel::after {
    background: linear-gradient(135deg, rgba(95,211,243,0.55), rgba(41,224,200,0.35));
  }
  .dash .stat:hover::after, .dash .panel:hover::after { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  /* The beam is decorative travel — exactly what this setting asks to stop.
     The ring still appears on hover, so the card still answers the pointer. */
  .dash .stat:hover::after, .dash .panel:hover::after { animation: none; }
  .dash .stat:hover, .dash .panel:hover { transform: none; }
}

@media (hover: none) {
  /* Touch: there is no hover, and a stuck beam after a tap looks broken. */
  .dash .stat::after, .dash .panel::after { display: none; }
}

/* Subscription banner. Only rendered when something is actually expiring, so it
   is allowed to be loud — a permanent bar is wallpaper and gets ignored, which
   is the failure mode that matters here. */
.subbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; padding: 15px 20px; margin: 0 0 16px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: linear-gradient(158deg, rgba(24,36,60,0.82), rgba(13,20,34,0.72));
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}
.subbar strong { font-weight: 500; font-size: 15px; }
.subbar p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.subbar--soon    { border-color: rgba(242,178,92,0.30); }
.subbar--urgent  { border-color: rgba(242,178,92,0.55); }
.subbar--urgent strong { color: var(--warn); }
.subbar--expired { border-color: rgba(255,107,107,0.45); }
.subbar--expired strong { color: var(--fail); }
.subbar .btn { flex: none; }

/* ---------------------------------------------------------------- admin ---
   The desk's own view. Denser than the client dashboard on purpose: this is a
   working surface for someone who already knows what they are looking at. */
.admin .tbl--admin { min-width: 940px; }
.admin .who { display: flex; flex-direction: column; gap: 3px; }
.admin .who strong { font-weight: 500; font-size: 13px; }
.admin .who .muted { font-size: 11.5px; }
.admin .row--tight { gap: 6px; margin: 0; flex-wrap: nowrap; }
.admin .days { display: inline-flex; align-items: center; gap: 6px; }
.admin .days input {
  width: 62px; padding: 6px 8px; font-family: var(--mono); font-size: 12px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.admin .btn[disabled] { opacity: 0.32; cursor: not-allowed; }
.admin .fine { font-size: 11px; }
.pill--warn { color: var(--warn); border-color: rgba(242,178,92,0.30); }
.alert--ok {
  border-color: rgba(41,224,200,0.42); background: rgba(41,224,200,0.07);
  color: #BFF3EA;
}
/* Master-only view switch. Two tabs, the current one lit. Only the desk ever
   sees this, and its purpose is that the client dashboard can be inspected as
   a client actually receives it rather than through an "admin view" variant
   that would be free to drift. */
.deskswitch {
  display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 22px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(15,22,38,0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.deskswitch__tab {
  padding: 8px 18px; border-radius: 999px; font-size: 13px;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color 180ms cubic-bezier(0.16,1,0.3,1),
              background 180ms cubic-bezier(0.16,1,0.3,1);
}
.deskswitch__tab:hover { color: var(--text); text-decoration: none; }
.deskswitch__tab.is-on {
  color: var(--ink); background: var(--grad); font-weight: 500;
}
/* Equity curve. A shape with an axis, not a chart library. */
.equity { margin: 4px 0 6px; }
.equity svg { width: 100%; height: 240px; display: block; }
.equity__axis {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10.5px; color: #6F82A0; margin-top: 2px;
}
.equity__stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  margin: 18px 0 14px; padding-top: 16px; border-top: 1px solid var(--line);
}
.equity__stats div { min-width: 0; }
.equity__stats dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #6F82A0; margin: 0 0 5px;
}
.equity__stats dd {
  font-family: var(--mono); font-size: 14px; margin: 0;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .equity__stats { grid-template-columns: repeat(2, 1fr); }
  .equity svg { height: 190px; }
}

/* Maintenance banner on the desk panel. Loud because it is a state that must
   never be forgotten about: entries are suppressed for everyone not named. */
.maint {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; padding: 15px 20px; margin: 0 0 16px; border-radius: 14px;
  border: 1px solid rgba(242,178,92,0.55); background: rgba(242,178,92,0.07);
}
.maint strong { color: var(--warn); font-weight: 500; }
.maint p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.maint code { color: var(--text); }
/* Maintenance control on the desk panel. Loud when ON, quiet when off — an
   always-loud banner becomes wallpaper and this is a state that must never be
   forgotten about. */
.maint--off { border-color: var(--line-2); background: rgba(15,22,38,0.55); }
.maint--off strong { color: var(--text); }
.maint__pick { display: inline-flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #6F82A0; }
.maint__pick select {
  min-width: 210px; padding: 7px 9px; font-family: inherit; font-size: 12px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--bg); color: var(--text); text-transform: none;
  letter-spacing: 0;
}
/* Client-side capital control. Folded away: it is a rare action, and a live
   input beside a headline figure invites accidental edits. */
.capedit { margin-top: 12px; }
.capedit > summary {
  cursor: pointer; font-size: 12px; color: var(--cyan); list-style: none;
  display: inline-block; padding: 3px 0;
}
.capedit > summary::-webkit-details-marker { display: none; }
.capedit > summary::after { content: ' \2192'; }
.capedit__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.money--sm { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); }
.money--sm span { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.money--sm input { width: 110px; border: 0; background: transparent; color: var(--text);
  font-family: var(--mono); font-size: 14px; outline: none; padding: 0; }
.capedit__form .fine { flex-basis: 100%; margin: 4px 0 0; font-size: 11px; }
/* ---------------------------------------------- client drill-down (master) */
/* Reached from the fleet table. The name is the affordance, so it has to look
   like one without turning every row into a wall of blue. */
.admin .who__link { color: inherit; text-decoration: none; }
.admin .who__link strong { border-bottom: 1px solid transparent; transition: border-color .15s ease, color .15s ease; }
.admin .who__link:hover strong,
.admin .who__link:focus-visible strong { color: var(--aqua); border-bottom-color: rgba(41,224,200,0.45); }

.backlink { color: var(--muted); text-decoration: none; }
.backlink:hover, .backlink:focus-visible { color: var(--aqua); }

.checklist { list-style: none; margin: 0 0 18px; padding: 0;
  display: flex; flex-direction: column; gap: 8px; }
.checklist__item { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg); font-size: 12.5px; }
.checklist__item strong { font-weight: 500; text-transform: capitalize; }
.checklist__item .muted { font-size: 11.5px; }
.checklist__item.is-ok  { border-color: rgba(41,224,200,0.28); }
.checklist__item.is-bad { border-color: rgba(255,107,107,0.34); }

/* ------------------------------------------------------- the error log page */
/* Dense on purpose: this is read during an incident, not browsed. */
.errlog { list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px; }
.errlog__item { border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg); overflow-x: auto; }
.errlog__item pre { margin: 0; padding: 10px 12px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  color: var(--text); white-space: pre; }
/* The first line carries the timestamp and message; the trace is dimmer so the
   eye lands on what happened before where it happened. */
.errlog__item pre::first-line { color: var(--aqua); }
.chip--link { text-decoration: none; cursor: pointer; }
.chip--link:hover, .chip--link:focus-visible { color: var(--aqua); }
