:root {
  --ink: #07050f;          /* deep night: page */
  --panel: #0e0a22;        /* chart glass */
  --raise: #181040;
  --line: #2e2468;
  --fog: #e8f0ff;          /* main text */
  --mist: #8f88c4;         /* quiet text */
  --tide: #00ffc8;         /* up: neon mint */
  --coral: #ff2e93;        /* down: hot magenta */
  --amber: #ffe14a;        /* yellow warning */
  --signal: #ff3860;       /* red light */
  --voice: #b86bff;        /* the agent: ultraviolet */
  --cyan: #19e3ff;         /* accents and focus */
  --serif: "Orbitron", "Instrument Sans", system-ui, sans-serif;
  --sans: "Rajdhani", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink); color: var(--fog); font: 500 15px/1.45 var(--sans);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.top {
  display: flex; align-items: center; gap: 20px; padding: 12px 24px;
  padding-top: calc(12px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: var(--ink); position: sticky; top: 0; z-index: 10;
}
.views { display: none; gap: 4px; background: var(--panel); padding: 3px; border-radius: 999px; }
.views button { background: none; border: 0; padding: 7px 16px; border-radius: 999px;
  color: var(--mist); cursor: pointer; }
.views button[aria-pressed="true"] { background: var(--raise); color: var(--fog); }
.brand { font: 400 22px/1 var(--serif); letter-spacing: .01em; }
.spacer { flex: 1; }
.pills { display: flex; gap: 4px; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden;
  flex-wrap: nowrap; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills button { flex: none; white-space: nowrap; scroll-snap-align: center; }
.pills button {
  background: none; border: 0; padding: 6px 12px; border-radius: 999px; color: var(--mist);
  cursor: pointer;
}
.pills button:hover { color: var(--fog); }
.pills button[aria-pressed="true"] { background: var(--raise); color: var(--fog); }
.mode { color: var(--mist); }
.mode b { color: var(--amber); font-weight: 600; }
.mode.live b { color: var(--signal); }
.clock { color: var(--mist); }

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0;
  height: calc(100vh - 51px); height: calc(100dvh - 51px - env(safe-area-inset-top));
}
.market { padding: 20px 24px 24px; overflow-y: auto; min-width: 0; }
.agent {
  border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
  background: var(--panel);
}

/* the lamp: what the owner reads first */
.lamp { display: flex; align-items: center; gap: 20px; padding-bottom: 18px; flex-wrap: wrap; }
.bulbs { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px;
  background: #050310; border: 1px solid var(--line); }
.bulb { width: 18px; height: 18px; border-radius: 50%; display: block; opacity: .22;
  transition: opacity .3s, box-shadow .3s; }
.bulb.yellow { background: var(--amber); }
.bulb.red { background: var(--signal); }
.lamp[data-level="yellow"] .bulb.yellow { opacity: 1; box-shadow: 0 0 14px 2px #ffe14acc; }
.lamp[data-level="red"] .bulb.red { opacity: 1; box-shadow: 0 0 14px 2px #ff3860cc; }
.lamp-text { flex: 1 1 320px; min-width: 0; }
#trend-word { font: 400 52px/1 var(--serif); letter-spacing: -.01em; }
.lamp[data-trend="up"] #trend-word { color: var(--tide); }
.lamp[data-trend="down"] #trend-word { color: var(--coral); }
#trend-note { color: var(--mist); margin-top: 8px; max-width: 62ch; }
.figures { display: flex; gap: 28px; }
.figures div { display: flex; flex-direction: column; }
.figures dt { color: var(--mist); font-size: 12px; }
.figures dd { font-size: 20px; font-weight: 500; }

.zoom { position: absolute; top: 12px; right: 74px; z-index: 2; display: flex; gap: 4px; }
.zoom button { min-width: 32px; height: 28px; padding: 0 9px; border-radius: 6px; cursor: pointer;
  background: #050310cc; border: 1px solid var(--line); color: var(--mist); font-size: 13px; }
.zoom button:hover { color: var(--fog); }
.chart-wrap { position: relative; height: 52vh; min-height: 300px; background: var(--panel);
  border-radius: 6px; }
.rsi-wrap { height: 17vh; min-height: 110px; background: var(--panel); border-radius: 6px;
  margin-top: 4px; }
canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
/* the two charts handle touch themselves: pinch zooms the chart, never the page; sideways drags
   move the chart and up/down drags scroll the page (see wire() in app.js) */
#price, #rsi { touch-action: pan-y; -webkit-user-select: none; user-select: none; }   /* up/down: the page scrolls natively; sideways and pinch: the chart */
.tip { position: absolute; pointer-events: none; z-index: 3; max-width: 320px; padding: 8px 10px;
  background: #050310ee; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.tip b { font-weight: 600; }
.tip .why { color: var(--mist); margin-top: 4px; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--mist); padding: 24px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 2px; color: var(--mist);
  font-size: 12px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 8px; border-radius: 2px; display: inline-block; }

.account { margin-top: 14px; }
.account h2 { font: 500 14px/1.4 var(--sans); color: var(--mist); margin-bottom: 8px; }
.acct-top { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.curve-wrap { flex: 1 1 260px; height: 64px; min-width: 200px; }
.acct-open { margin-top: 10px; }
.open-pos { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.open-pos b { font-weight: 600; }
.open-pos .k { color: var(--mist); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.trades { width: 100%; border-collapse: collapse; margin-top: 8px; max-width: 90ch; }
.trades th { text-align: left; font-weight: 400; color: var(--mist); font-size: 12px; padding: 6px 12px 6px 0; }
.trades td { padding: 6px 12px 6px 0; border-top: 1px solid var(--line); }
.trades .win { color: var(--tide); }
.trades .loss { color: var(--coral); }
.none { color: var(--mist); }
.ghost { margin-top: 22px; padding: 14px 16px 12px; border: 1px dashed var(--line);
  border-left: 3px solid var(--voice); border-radius: 6px; }
.ghost h2 { display: flex; align-items: baseline; gap: 10px; }
.ghost .tag { font-size: 11px; color: var(--voice); border: 1px solid var(--voice);
  border-radius: 999px; padding: 0 8px; font-weight: 500; }
.ghost-note { color: var(--mist); font-size: 13px; max-width: 78ch; margin-bottom: 10px; }
.ghost .trades td, .ghost .open-pos { color: #c3cbe8; }
.signals { margin-top: 10px; }
.signals h2, .proposals h2 { font: 500 14px/1.4 var(--sans); color: var(--mist); margin-bottom: 8px; }
.signals li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 8px 0;
  border-top: 1px solid var(--line); max-width: 90ch; }
.signals li i { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.signals .when { color: var(--mist); font-size: 12px; }
.signals .none { color: var(--mist); }
.signals li.none { display: block; }  /* a note with no dot must not sit in the 14px dot column */

/* agent column */
.agent-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-bottom: 1px solid var(--line); }
.agent-head h2 { font: 400 22px/1 var(--serif); }
.agent-name { margin-left: auto; color: var(--mist); font-size: 12px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--mist); }
.live.on { background: var(--tide); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px #00ffc833; } }
.usage { padding: 8px 20px; color: var(--mist); font-size: 12px; border-bottom: 1px solid var(--line); }
.usage:empty { display: none; }
.summary { padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--raise); }
.summary h3 { font: 500 12px/1.4 var(--sans); color: var(--voice); margin-bottom: 6px; }
.summary p { font: 400 17px/1.45 var(--serif); }
.feed { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px; display: flex; flex-direction: column;
  gap: 14px; min-height: 120px; }
.feed li { border-left: 2px solid var(--line); padding-left: 12px; }
.feed li.agent-msg { border-color: var(--voice); }
.feed li.status { border-color: var(--amber); }
.feed li.proposal { border-color: var(--tide); }
.feed .meta { color: var(--mist); font-size: 12px; margin-bottom: 2px; }
.feed .text { overflow-wrap: anywhere; }
.feed .quiet { color: var(--mist); border: 0; padding: 0; }
.proposals { padding: 14px 20px 18px; border-top: 1px solid var(--line); max-height: 36%;
  overflow-y: auto; }
.proposals li { padding: 8px 0; border-top: 1px solid var(--line); }
.proposals .head { display: flex; gap: 8px; align-items: baseline; }
.proposals .head b { font-weight: 600; }
.proposals .tag { color: var(--mist); font-size: 12px; }
.proposals .tag.proposed { color: var(--amber); }
.proposals .why { color: var(--mist); font-size: 13px; margin-top: 2px; }
.proposals code { font: 12px ui-monospace, Consolas, monospace; color: var(--fog); }

/* tablets and phones: one column, the sections become a bottom tab bar, and the page scrolls as ONE piece */
@media (max-width: 980px) {
  html, body { height: auto; }
  body { overflow-x: clip; }   /* clip, not hidden: hidden would stop the header from sticking */
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .layout { grid-template-columns: 1fr; height: auto; display: block; }
  .agent { border-left: 0; min-height: 0; display: block; }
  /* no scroll areas inside the page: they trap the finger and the page stops moving */
  .feed { overflow: visible; overscroll-behavior: auto; min-height: 0; }
  .proposals { max-height: none; overflow: visible; }
  /* slim sticky header: brand + mode on one line, the pair and timeframe strip under it */
  .top { flex-wrap: wrap; padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 6px 10px; }
  .brand { order: 1; }
  .spacer { order: 2; }
  .mode { order: 3; }
  .clock { order: 4; }
  #markets { order: 5; flex: 1 1 calc(100% - 100px); min-width: 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); padding-right: 22px; }
  #timeframes { order: 6; flex: none; }
  body:not([data-view="market"]) #markets, body:not([data-view="market"]) #timeframes { display: none; }
  /* the tab bar is fixed to the bottom, always in reach of the thumb */
  .views { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 0; border-radius: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
  .views button { flex: 1 1 0; min-height: 48px; padding: 8px 4px; border-radius: 12px; font-size: 15px; }
  .market { padding: 16px; overflow: visible; }
  #trend-word { font-size: 44px; }
  .figures { gap: 22px; flex-wrap: wrap; }
  .chart-wrap { height: 46vh; min-height: 320px; }
  .rsi-wrap { height: 16vh; min-height: 120px; }
  body[data-view="market"] .v-account, body[data-view="market"] .v-agent,
  body[data-view="account"] .v-market, body[data-view="account"] .v-agent,
  body[data-view="agent"] .v-market, body[data-view="agent"] .v-account { display: none !important; }
  body[data-view="market"] .v-strategies, body[data-view="account"] .v-strategies,
  body[data-view="agent"] .v-strategies { display: none !important; }
  body[data-view="strategies"] .v-market, body[data-view="strategies"] .v-account,
  body[data-view="strategies"] .v-agent { display: none !important; }
  body[data-view="agent"] .market { display: none; }
  body[data-view="account"] .market { padding-top: 8px; }
}
@media (max-width: 560px) {
  .top { padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 19px; }
  .mode { font-size: 13px; }
  .clock { display: none; }
  #trend-word { font-size: 36px; }
  .market { padding: 12px; }
  .zoom { right: 70px; }
  .figures dd { font-size: 18px; }
}
/* fingers: bigger targets, no hover-only behaviour */
@media (pointer: coarse) {
  .pills button { min-height: 40px; padding: 8px 15px; }
  .views button { padding: 8px 4px; }
  .zoom button { min-height: 40px; min-width: 40px; font-size: 15px; }
  .zoom { top: 8px; }
  body { font-size: 15px; }
  .trades td, .trades th { padding-top: 10px; padding-bottom: 10px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .chart-wrap { height: 72vh; }
}
@media (prefers-reduced-motion: reduce) {
  .live.on { animation: none; }
  .bulb { transition: none; }
}

/* strategies and pair switches */
.strategies { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; background: var(--panel); }
.strat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.strat-note { color: var(--mist); font-size: 13px; }
.strat-summary { color: var(--mist); font-size: 13px; margin: 8px 0 10px; }
.strat-master { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pair-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pair-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--ink); color: var(--fog);
  font: inherit; cursor: pointer; min-height: 64px; }
.pair-card[aria-checked="false"] { opacity: .6; }
.pair-card .sym { font-weight: 600; font-size: 16px; }
.pair-card .ex { color: var(--mist); font-size: 12px; margin-left: 6px; font-weight: 400; }
.pair-card .stats { grid-column: 1 / -1; color: var(--mist); font-size: 13px; }
.pair-card .stats b { color: var(--fog); font-weight: 500; }
.pair-card .stats .pos { color: var(--tide); }
.pair-card .stats .neg { color: var(--coral); }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--fog); transition: transform .15s; }
[aria-checked="true"] > .switch, .switch[aria-checked="true"] { background: var(--tide); }
[aria-checked="true"] > .switch::after, .switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--ink); }
.strat-foot { color: var(--mist); font-size: 12px; margin: 12px 0 0; }
.strat-err { color: var(--coral); font-size: 13px; }
button.master { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--fog); font: inherit; cursor: pointer; padding: 4px 0; }

.strat-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; font-size: 14px; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--fog); }
.badge.st-live { background: var(--tide); color: var(--ink); }
.badge.st-exchanges, .badge.st-pairs, .badge.st-ready { background: var(--amber); color: var(--ink); }
.strat-h { font-size: 13px; font-weight: 600; color: var(--mist); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px; }
.pair-card.dull { opacity: .4; }
.pair-card:disabled { cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn { border: 1px solid var(--line); background: var(--ink); color: var(--fog); font: inherit; font-size: 15px; padding: 11px 18px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--tide); color: var(--ink); border-color: var(--tide); font-weight: 600; }
.btn.danger { border-color: var(--coral); color: var(--coral); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.confirm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--amber); border-radius: 12px; background: var(--ink); }
.confirm-bar p { margin: 0; flex: 1 1 260px; }
.confirm-bar[hidden] { display: none; }


/* ---- neon cyberpunk lighting ---- */
body {
  background:
    radial-gradient(ellipse 70% 40% at 12% -5%, #ff2e9326, transparent 70%),
    radial-gradient(ellipse 60% 45% at 100% 8%, #19e3ff1f, transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 120%, #b86bff26, transparent 70%),
    var(--ink);
  background-attachment: fixed;
}
/* faint scan lines over everything, never in the way of a tap */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, #00000026 2px 3px); opacity: .5; }
.brand, #trend-word, .agent-head h2, .summary p { font-family: var(--serif); }
.brand { font-weight: 800; font-size: 19px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan); text-shadow: 0 0 8px var(--cyan), 0 0 22px #19e3ff88, 0 0 2px #fff; }
.top { background: #07050fe6; border-bottom: 1px solid var(--cyan);
  box-shadow: 0 1px 0 #19e3ff55, 0 6px 26px -6px #19e3ff66; }   /* no backdrop-filter here: it would trap the fixed bottom tab bar inside the header */
.pills button, .views button { text-transform: uppercase; letter-spacing: .06em; font-weight: 600; transition: color .2s, box-shadow .2s, background .2s; }
.pills button:hover, .views button:hover { color: var(--cyan); text-shadow: 0 0 8px #19e3ffaa; }
.pills button[aria-pressed="true"], .views button[aria-pressed="true"] {
  background: #19e3ff1a; color: var(--cyan); border: 0; text-shadow: 0 0 8px #19e3ffcc;
  box-shadow: inset 0 0 0 1px var(--cyan), 0 0 14px #19e3ff66; }
.mode b { text-shadow: 0 0 10px #ffe14a99; letter-spacing: .08em; }
.mode.live b { text-shadow: 0 0 10px #ff3860cc; }
.clock { font-variant-numeric: tabular-nums; color: var(--cyan); text-shadow: 0 0 6px #19e3ff66; }

.chart-wrap, .rsi-wrap { background: linear-gradient(180deg, #120c2e, var(--panel)); border: 1px solid var(--line);
  box-shadow: 0 0 0 1px #00000066, 0 0 22px -6px #b86bff66, inset 0 0 40px -18px #19e3ff55; border-radius: 10px; }
.strategies, .ghost, .agent { box-shadow: 0 0 22px -8px #b86bff66; }
.strategies { border-color: #4a2fa0; background: linear-gradient(180deg, #140e33, var(--panel)); }
.agent { background: linear-gradient(180deg, #120c2e, var(--panel)); border-left: 1px solid #4a2fa0; }
.bulbs { box-shadow: inset 0 0 14px #000, 0 0 16px -6px #b86bff88; border-color: #4a2fa0; }
.bulb.yellow { box-shadow: 0 0 0 transparent; }

#trend-word { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 44px; }
.lamp[data-trend="up"] #trend-word { color: var(--tide); text-shadow: 0 0 10px var(--tide), 0 0 30px #00ffc888; }
.lamp[data-trend="down"] #trend-word { color: var(--coral); text-shadow: 0 0 10px var(--coral), 0 0 30px #ff2e9388; }
.figures dd { font-weight: 700; color: #fff; text-shadow: 0 0 8px #19e3ff55; }
.figures dt, .strat-h, .account h2, .signals h2, .proposals h2 { text-transform: uppercase; letter-spacing: .1em; }

.zoom button { background: #07050fcc; border-color: #4a2fa0; color: var(--cyan); }
.zoom button:hover { box-shadow: 0 0 12px #19e3ff88; border-color: var(--cyan); }
.tip { background: #07050ff2; border-color: var(--cyan); box-shadow: 0 0 18px #19e3ff55; }

.agent-head h2 { font-size: 17px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--voice);
  text-shadow: 0 0 10px #b86bffaa; }
.live.on { box-shadow: 0 0 10px var(--tide); }
.summary { background: linear-gradient(135deg, #1d1250, #130b33); border-left: 3px solid var(--voice); }
.summary p { font-size: 14px; line-height: 1.55; font-weight: 500; }
.summary h3 { text-shadow: 0 0 8px #b86bff99; letter-spacing: .1em; text-transform: uppercase; }
.feed li.agent-msg { border-color: var(--voice); box-shadow: -6px 0 12px -8px var(--voice); }
.feed li.status { border-color: var(--amber); box-shadow: -6px 0 12px -8px var(--amber); }
.feed li.proposal { border-color: var(--tide); box-shadow: -6px 0 12px -8px var(--tide); }

.trades .win, .pair-card .stats .pos { color: var(--tide); text-shadow: 0 0 8px #00ffc866; }
.trades .loss, .pair-card .stats .neg { color: var(--coral); text-shadow: 0 0 8px #ff2e9366; }
.ghost { border-color: #4a2fa0; border-left-color: var(--voice); }
.ghost .tag { box-shadow: 0 0 10px #b86bff88; text-shadow: 0 0 6px var(--voice); }

.pair-card { background: linear-gradient(160deg, #150e38, var(--ink)); border-color: #3a2c85; transition: box-shadow .2s, border-color .2s, transform .1s; }
.pair-card:not(:disabled):hover { border-color: var(--cyan); box-shadow: 0 0 16px #19e3ff66; }
.pair-card:active { transform: scale(.985); }
.pair-card[aria-checked="true"] { border-color: var(--tide); box-shadow: 0 0 14px -2px #00ffc888, inset 0 0 18px -10px #00ffc8; }
.pair-card .sym { letter-spacing: .06em; }
.switch { background: #2a2060; box-shadow: inset 0 0 6px #000; }
[aria-checked="true"] > .switch, .switch[aria-checked="true"] { background: var(--tide); box-shadow: 0 0 12px var(--tide); }
.badge { letter-spacing: .1em; text-transform: uppercase; }
.badge.st-live { box-shadow: 0 0 14px var(--tide); }
.badge.st-exchanges, .badge.st-pairs, .badge.st-ready { box-shadow: 0 0 14px #ffe14a99; }
.btn { background: #120c2e; border-color: #4a2fa0; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; transition: box-shadow .2s, border-color .2s; }
.btn:not(:disabled):hover { border-color: var(--cyan); box-shadow: 0 0 14px #19e3ff77; }
.btn.primary { background: linear-gradient(135deg, #00ffc8, #19e3ff); border-color: transparent; color: #04101a;
  box-shadow: 0 0 18px #00ffc899; }
.btn.primary:not(:disabled):hover { box-shadow: 0 0 28px #00ffc8; }
.btn.danger { box-shadow: inset 0 0 10px #ff2e9333, 0 0 10px #ff2e9344; }
.confirm-bar { border-color: var(--amber); background: #1a1405; box-shadow: 0 0 20px -4px #ffe14a88, inset 0 0 20px -12px #ffe14a;
  animation: neon-pulse 2.6s ease-in-out infinite; }
@keyframes neon-pulse { 50% { box-shadow: 0 0 30px -2px #ffe14acc, inset 0 0 24px -10px #ffe14a; } }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a2c85; border-radius: 10px; box-shadow: 0 0 8px #b86bff; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: #ff2e9366; }
@media (max-width: 980px) {
  .views { background: #07050ff2; border-top: 1px solid var(--cyan); box-shadow: 0 -6px 26px -8px #19e3ff88; }
  #trend-word { font-size: 34px; }
}
@media (max-width: 560px) { #trend-word { font-size: 28px; } .brand { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .confirm-bar { animation: none; } }

/* ---- top bar (desktop): nothing wraps, the pair strip scrolls inside its own space with a fade at the edge ---- */
.brand, .mode, .clock { white-space: nowrap; }
@media (min-width: 981px) {
  .brand, .mode, .clock { flex: none; }
  .spacer { flex: 0 0 0; }
  .top { gap: 14px; }
  #markets { flex: 1 1 0; min-width: 0; padding-right: 26px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  #timeframes { flex: none; }
}
@media (max-width: 1280px) and (min-width: 981px) { .clock { display: none; } .top { padding-left: 16px; padding-right: 16px; } }

/* results over time (Strategies tab) */
.perf { margin: 0 0 14px; }
.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.perf-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.perf-card h4 { margin: 0 0 6px; font: 600 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }
.perf-card dl { display: flex; gap: 16px; margin: 0; }
.perf-card dt { font-size: 12px; color: var(--mist); }
.perf-card dd { margin: 0; font: 600 20px var(--sans); }
.perf-card dd.pos { color: var(--tide); text-shadow: 0 0 8px #00ffc866; }
.perf-card dd.neg { color: var(--coral); text-shadow: 0 0 8px #ff2e9366; }
.perf-curve { display: block; width: 100%; height: 90px; margin-top: 10px; }

.demo-banner { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: #ffe14a; color: #07050f; padding: 6px 14px; font: 600 13px var(--sans); text-align: center; }
.demo-banner b { letter-spacing: .12em; margin-right: 8px; }
