/* FOMO desk — dark dashboard, savip video layout. No neon, no glow on cards, no Withdraw/Deposit. */
:root {
  --bg: #050506;
  --bg-glow: #0b1020;
  --card: #111214;
  --card-2: #191a1e;
  --line: rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.12);
  --text: #f4f4f5;
  --secondary: rgba(235,235,245,0.6);
  --tertiary: rgba(235,235,245,0.32);
  --green: #00d35a;
  --red: #ff453a;
  --orange: #ff9f0a;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --yellow: #ffd60a;
  --pink: #ff6b9a;
  --purple: #bf5af2;
  --radius: 22px;
  --gutter: 22px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --sans: "SF Pro Text", "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --display: "SF Pro Display", "SF Pro Text", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "SF Mono", ui-monospace, "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  min-height: 100%;
}
body {
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(40,70,140,0.18), transparent 70%),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--cyan); text-decoration: none; }
img { max-width: 100%; display: block; }

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) calc(28px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
}

/* Error */
.error-banner {
  position: sticky; top: 0; z-index: 50;
  background: #3b0a0a;
  color: #ff8a84;
  padding: 10px 16px;
  font-size: 13px;
  text-align: center;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.logo {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  filter: drop-shadow(0 0 0 transparent);
}
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.badge-paper {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,159,10,0.14);
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.working-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 12px;
  border-radius: 999px;
  background: #16171b;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--secondary);
}
.working-pill.is-off .blink-dot { background: #666; box-shadow: none; animation: none; }
.blink-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0,211,90,0.5);
  animation: pulse-dot 1.4s ease-out infinite;
}
.clock { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500; }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(0,211,90,0.45); }
  70% { box-shadow: 0 0 0 6px rgba(0,211,90,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,211,90,0); }
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: 1.15fr auto 1.15fr;
  align-items: center;
  gap: 18px;
  margin: 6px 0 22px;
}
.stat-balance .label, .eq-head .label, .comp-title, .jt-head h2 {
  color: var(--secondary);
  font-size: 14px;
  font-weight: 500;
}
.bal {
  display: flex; align-items: baseline;
  font-family: var(--display);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 4px 0 10px;
  font-variant-numeric: tabular-nums;
}
.bal .cur { font-size: clamp(36px, 6vw, 72px); font-weight: 600; margin-right: 2px; }
.bal .whole { font-size: clamp(44px, 8vw, 88px); font-weight: 650; }
.bal .cents { font-size: clamp(22px, 3.6vw, 40px); font-weight: 500; color: var(--tertiary); margin-left: 1px; }
.bal-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--secondary);
  flex-wrap: wrap;
}
.bal-meta .mult { color: var(--green); font-weight: 600; }
.bal-meta .mult.is-down { color: var(--red); }
.dot-sep { color: var(--tertiary); }

/* Spinning coin */
.stat-coin { display: grid; place-items: center; min-width: 148px; }
.coin-3d { perspective: 700px; width: 132px; height: 132px; }
.coin {
  width: 132px; height: 132px;
  position: relative;
  transform-style: preserve-3d;
  animation: spinY 6.5s linear infinite;
}
.coin .face {
  position: absolute; inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 30%, #3a3a40, #161618 55%, #0a0a0c);
  border: 7px solid #c8c8d0;
  box-shadow:
    inset 0 0 0 3px #2a2a2e,
    inset 0 8px 16px rgba(255,255,255,0.08),
    0 10px 24px rgba(0,0,0,0.45);
  display: grid; place-items: center;
}
.coin .face.back { transform: rotateY(180deg); }
.coin .face img { width: 100%; height: 100%; object-fit: cover; }
.coin-letter {
  font-family: var(--display);
  font-weight: 700;
  font-size: 42px;
  letter-spacing: -0.04em;
  color: #eee;
}
@keyframes spinY { to { transform: rotateY(360deg); } }

/* Equity card */
.stat-equity {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 10px;
  min-height: 148px;
}
.eq-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.eq-val { font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.eq-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.eq-val.is-down .eq-dot { background: var(--red); }
#equity-chart { width: 100%; height: 96px; display: block; }

/* Bot's computer */
.computer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 18px;
}
.comp-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.comp-title { font-weight: 600; color: var(--text); white-space: nowrap; }
.urlbar {
  display: flex; align-items: center; gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: #0b0b0d;
  border: 1px solid var(--line);
  color: var(--secondary);
  font-size: 12px;
  overflow: hidden;
}
.url-lock { color: #5a5a60; font-size: 8px; }
.url-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--secondary);
}
.comp-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px;
  color: var(--green);
  white-space: nowrap;
}
.comp-status.is-sell, .comp-status.is-down { color: var(--red); }
.comp-status.is-busy { color: var(--yellow); }
.block-cursor {
  width: 7px; height: 14px;
  background: var(--green);
  display: inline-block;
  animation: blink-block 1s steps(1) infinite;
}
@keyframes blink-block { 50% { opacity: 0; } }

.comp-screen { position: relative; background: #0a0b10; min-height: 420px; }
.live-photos, .live-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.fomo-mock { position: relative; min-height: 420px; }
.fomo-chrome {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--secondary);
  font-size: 12px;
}
.fomo-word { font-weight: 700; color: var(--text); letter-spacing: -0.03em; font-size: 14px; }
.fomo-search {
  margin-left: auto;
  background: #14151a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  color: var(--tertiary);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fomo-cols {
  display: grid;
  grid-template-columns: 200px 1fr 230px;
  min-height: 380px;
  min-width: 780px;
}
.token-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  max-height: 420px;
}
.tok {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 44px;
}
.tok:hover, .tok.is-on { background: rgba(255,255,255,0.04); }
.tok.is-on { box-shadow: inset 2px 0 0 var(--green); }
.tok-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: #222;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  overflow: hidden;
}
.tok-av img { width: 100%; height: 100%; object-fit: cover; }
.tok-name { font-size: 12px; font-weight: 600; }
.tok-px { font-size: 10px; color: var(--tertiary); }
.tok-right { text-align: right; font-size: 11px; }
.tok-right .chg { font-weight: 600; }
.up { color: var(--green); }
.down { color: var(--red); }

.chart-col { padding: 10px 12px 12px; min-width: 0; }
.pair-head { margin-bottom: 8px; }
.pair-title { font-weight: 650; font-size: 15px; letter-spacing: -0.02em; }
.pair-stats {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-top: 6px;
  font-size: 11px; color: var(--secondary);
}
.pair-stats b { color: var(--text); font-weight: 600; }
.candle-wrap { position: relative; height: 320px; }
#candle-chart { width: 100%; height: 320px; display: block; }
.chart-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--tertiary); font-size: 13px;
  pointer-events: none;
}

.order-panel {
  border-left: 1px solid var(--line);
  padding: 12px;
  background: #0c0d12;
}
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.side-tabs button {
  height: 36px; border-radius: 8px;
  background: #17181d; color: var(--secondary); font-weight: 600;
}
.side-tabs button.is-on.buy { background: var(--green); color: #04150a; }
.side-tabs button.is-on.sell { background: var(--red); color: #fff; }
.amt-box {
  background: #14151a; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 8px;
}
.amt-box .hint { font-size: 11px; color: var(--tertiary); }
.amt-box .num { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.pills span, .pills button {
  height: 28px; padding: 0 8px; border-radius: 7px;
  background: #17181d; border: 1px solid var(--line);
  font-size: 11px; color: var(--secondary);
  display: inline-flex; align-items: center;
}
.go-btn {
  width: 100%; height: 44px; border-radius: 10px;
  background: var(--green); color: #04150a;
  font-weight: 700; font-size: 15px;
}
.go-btn.sell { background: var(--red); color: #fff; }
.go-btn:disabled, .go-btn.is-idle { opacity: 0.55; cursor: default; }
.order-meta { margin-top: 10px; font-size: 11px; color: var(--secondary); display: grid; gap: 4px; }
.order-meta b { color: var(--text); font-weight: 600; }

.bot-cursor {
  position: absolute; left: 80px; top: 120px;
  width: 22px; height: 22px;
  pointer-events: none;
  z-index: 5;
  transition: left 0.8s ease, top 0.8s ease;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.7));
}

/* Bottom */
.bottom {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.6fr;
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 10px;
  min-height: 220px;
}
.agents-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.agents-token { display: flex; gap: 10px; align-items: center; }
.agents-token .tok-av { width: 36px; height: 36px; font-size: 13px; }
.agents-token .nm { font-weight: 700; font-size: 15px; }
.agents-token .sub { font-size: 12px; color: var(--secondary); }
.agents-count { font-size: 12px; color: var(--secondary); white-space: nowrap; }
.agents-body { display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: center; }
.agent-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; font-size: 13px;
}
.agent-ico {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: #000;
}
.agent-note { color: var(--tertiary); font-size: 11px; }
.agent-mark { margin-left: auto; width: 16px; text-align: center; }
.agent-mark.ok { color: var(--green); }
.agent-mark.no { color: var(--red); }
.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.agents-orb {
  display: grid; place-items: center; text-align: center;
}
.orb {
  width: 72px; height: 72px; border-radius: 50%;
  background: #f4f4f5; color: #111;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.orb-sub { margin-top: 8px; font-size: 11px; color: var(--secondary); }

.jt-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.jt-left, .jt-right { display: flex; align-items: center; gap: 8px; }
.jt-head h2 { color: var(--text); font-size: 16px; margin: 0; }
.jt-sub, .jt-right { color: var(--tertiary); font-size: 12px; }
.jt-icon { color: var(--purple); }
.journal-list { display: flex; flex-direction: column; }
.j-row {
  display: grid;
  grid-template-columns: 52px 22px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  min-height: 44px;
}
.j-row:first-child { border-top: 0; }
.j-time { color: var(--tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }
.j-kind {
  font-size: 9px; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 0; border-radius: 4px; text-align: center;
}
.j-kind.kill, .j-kind.rejected, .j-kind.stopped { color: var(--red); }
.j-kind.bought, .j-kind.buy { color: var(--green); }
.j-kind.sold, .j-kind.sell { color: var(--pink); }
.j-title { font-size: 13px; font-weight: 650; }
.j-sub { font-size: 12px; color: var(--secondary); margin-top: 2px; }
.j-val { font-weight: 650; font-size: 13px; white-space: nowrap; }
.empty-copy { color: var(--tertiary); font-size: 13px; padding: 28px 8px; text-align: center; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  overflow: auto;
  padding: calc(12px + var(--safe-t)) 16px calc(24px + var(--safe-b));
}
.overlay-bar {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; margin-bottom: 12px;
}
.overlay-bar h1, .ov-title { font-size: 20px; margin: 0; letter-spacing: -0.02em; }
.ov-sub { font-size: 12px; color: var(--secondary); }
.back {
  width: 44px; height: 44px;
  font-size: 28px; line-height: 1; color: var(--text);
}
.overlay-body { max-width: 720px; margin: 0 auto; }
.setting-group { margin: 0 0 22px; }
.setting-group h3 { font-size: 14px; color: var(--secondary); font-weight: 600; margin: 0 0 8px; }
.setting-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.setting-row input[type="range"] { width: 100%; accent-color: var(--green); }
.setting-row input[type="text"], .setting-row input[type="number"] {
  width: 88px; height: 32px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 8px; text-align: right;
}
.account-hero { margin-bottom: 18px; }
.account-hero .bal { margin: 0; }
.link-btn, .quiet-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  margin: 6px 8px 6px 0;
}
.note { color: var(--secondary); font-size: 13px; margin: 8px 0 16px; }

/* Sheet + toast */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.55);
  display: grid; align-items: end;
}
.sheet-card {
  background: #1c1c1e;
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(20px + var(--safe-b));
}
.sheet-handle { width: 36px; height: 4px; border-radius: 4px; background: #444; margin: 4px auto 12px; }
.sheet-card h3 { margin: 0 0 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-b));
  transform: translateX(-50%);
  background: #2c2c2e; color: #fff;
  padding: 10px 16px; border-radius: 12px;
  font-size: 13px; z-index: 70;
}

/* Honor the hidden attribute even when a class sets display */
[hidden] { display: none !important; }

/* Loading pulse */
.skel-text { color: transparent; background: #1c1c1e; border-radius: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .coin { animation: none; }
  .blink-dot, .block-cursor, .spinner, .skel-text { animation: none; }
  .bot-cursor { transition: none; }
}

/* iPhone / narrow: stack the page zones */
@media (max-width: 800px) {
  :root { --gutter: 14px; }
  .stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .stat-coin { margin: 4px 0; }
  .coin-3d, .coin { width: 108px; height: 108px; }
  .stat-equity { min-height: 128px; }
  .comp-head {
    grid-template-columns: 1fr auto;
    grid-template-areas: "title status" "url url";
  }
  .comp-title { grid-area: title; }
  .comp-status { grid-area: status; }
  .urlbar { grid-area: url; }
  .comp-screen { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bottom { grid-template-columns: 1fr; }
  .agents-body { grid-template-columns: 1fr 96px; }
}

@media (max-width: 480px) {
  .bal .cur { font-size: 40px; }
  .bal .whole { font-size: 52px; }
  .bal .cents { font-size: 26px; }
  .working-pill { padding: 0 10px; }
}
