/* Desk app — STEP 10. Black iOS, no neon, no glow, no double borders,
   no all-caps eyebrows, no gradients on cards. */
:root {
  --bg: #000;
  --text: #fff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.55);
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --green: #00d35a;
  --red: #ff453a;
  --orange: #ff9f0a;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --yellow: #ffd60a;
  --pink: #ff6b9a;
  --purple: #bf5af2;
  --gutter: 16px;
  --tab-h: 49px;
  --nav-h: 48px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --scanner: #64d2ff;
  --analyst: #ffd60a;
  --brain: #bf5af2;
  --executor: #00d35a;
  --risk: #ff6b9a;
  --radius: 16px;
  --live-radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  font-family: "SF Pro Text", -apple-system, system-ui, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.3;
}
img { max-width: 100%; border: 0; display: block; }
button, input, select { font: inherit; color: inherit; }
button {
  background: none;
  border: 0;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  color: var(--text);
}
a { color: var(--blue); text-decoration: none; }

.num, .odometer, .price, .mult, .pct {
  font-family: "SF Pro Display", -apple-system, system-ui, "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.mono, .pill {
  font-family: "SF Mono", ui-monospace, "Menlo", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

/* banners */
#demo-banner {
  position: relative;
  z-index: 40;
  padding: 6px var(--gutter);
  padding-top: calc(6px + var(--safe-t));
  background: var(--card);
  color: var(--orange);
  font-size: 12px;
  text-align: center;
  border-bottom: 0.5px solid var(--sep);
}
#demo-banner[hidden], #error-banner[hidden], .hidden, [hidden] { display: none !important; }
body.has-demo #nav { top: auto; }
#error-banner {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 8px var(--gutter);
  background: var(--red);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
}

/* navbar */
#nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--nav-h) + var(--safe-t));
  padding: var(--safe-t) 10px 0 10px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
body.has-demo #nav { /* demo banner already ate the safe top */ }
body.has-demo { --safe-t-nav: 0px; }
#nav .avatar {
  width: 32px;
  height: 32px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#nav .avatar span {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
#nav .brand {
  font-size: 17px;
  font-weight: 600;
  padding: 0 4px;
  min-width: 44px;
  text-align: left;
}
#nav .brand .chev { color: var(--tertiary); font-weight: 400; }
#nav .spacer { flex: 1; }
#nav .icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text);
}
#nav .icon-btn .dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--red);
}
#nav .icon-btn .dot.off { display: none; }

/* layout */
#app {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  min-height: 100dvh;
}
.view { padding: 8px 0 24px; }
.gutter { padding-left: var(--gutter); padding-right: var(--gutter); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px var(--gutter) 10px;
  font-size: 17px;
  font-weight: 600;
}
.section-head .link {
  font-size: 15px;
  font-weight: 400;
  color: var(--blue);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* balance */
.hero { padding: 8px var(--gutter) 4px; }
.hero-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}
.odometer {
  font-size: clamp(52px, 15vw, 80px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  display: flex;
  align-items: flex-end;
  min-width: 0;
}
.odometer.empty {
  font-size: 28px;
  color: var(--tertiary);
  letter-spacing: 0;
  font-weight: 600;
}
.odometer .digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  position: relative;
  width: 0.62em;
  text-align: center;
}
.odometer .digit .strip {
  display: flex;
  flex-direction: column;
  transition: transform 600ms ease-out;
}
.odometer .ch { width: auto; display: inline-block; }
.odometer .digit .strip span {
  display: block;
  height: 1em;
  line-height: 1em;
}
.badge-paper {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  margin-top: 14px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--orange);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 15px;
}
.hero-meta .pct { color: var(--green); font-weight: 600; }
.hero-meta .pct.neg { color: var(--red); }
.mult {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(0, 211, 90, 0.18);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

/* range switch */
.ranges {
  display: flex;
  gap: 4px;
  padding: 8px var(--gutter) 4px;
  overflow-x: auto;
}
.ranges button {
  min-width: 44px;
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
}
.ranges button.on { color: var(--text); background: var(--card-2); }

.chart-wrap { padding: 0 0 8px; position: relative; height: 200px; }
.chart-wrap canvas { width: 100%; height: 200px; display: block; }

/* live screen */
.live-card {
  display: block;
  width: calc(100% - 2 * var(--gutter));
  box-sizing: border-box;
  margin: 8px var(--gutter) 0;
  border-radius: var(--live-radius);
  overflow: hidden;
  background: var(--card);
  position: relative;
  text-align: left;
}
.live-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
}
.live-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms linear;
}
.live-frame img.show { opacity: 1; }
.live-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 11px;
  font-weight: 600;
}
.live-tag .led {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--red);
}
.live-tag .led.stale { background: var(--tertiary); }
.live-lane {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 12px;
  font-size: 13px;
}
.checks { display: flex; gap: 6px; }
.check {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--tertiary);
}
.check.ok { color: var(--green); }
.check.no { color: var(--red); }
.live-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tertiary);
  font-size: 14px;
}
.live-frame.is-empty .live-tag,
.live-frame.is-empty .live-lane { display: none; }

/* bot carousel */
.carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 8px;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.bot-card {
  scroll-snap-align: start;
  flex: 0 0 240px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 148px;
}
.bot-card .name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bot-card .name .swatch { width: 8px; height: 8px; border-radius: 4px; }
.bot-card .headline { font-size: 20px; font-weight: 600; margin: 8px 0 10px; }
.feed-line { font-size: 12px; color: var(--secondary); margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-line.kill { color: var(--tertiary); }
.feed-line.kill .why { color: var(--red); text-decoration: line-through; }
.feed-line.pass { color: var(--secondary); }
.layers-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.layer-strip { font-size: 11px; color: var(--secondary); display: flex; gap: 4px; align-items: center; }
.layer-strip .mark { width: 6px; height: 6px; border-radius: 3px; background: var(--tertiary); }
.layer-strip.green .mark { background: var(--green); }
.layer-strip.red .mark { background: var(--red); }
.score-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ring { width: 36px; height: 36px; }
.hint { font-size: 12px; color: var(--secondary); margin-top: 6px; }
.exec-bar {
  margin-top: 8px;
  background: var(--card-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill {
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  background: var(--card-2);
}
.pill.red { color: var(--red); }
.pill.green { color: var(--green); }

/* activity rows */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px var(--gutter);
  border-top: 0.5px solid var(--sep);
}
.row .mid { flex: 1; min-width: 0; }
.row .title { font-size: 15px; font-weight: 600; }
.row .sub { font-size: 12px; color: var(--secondary); margin-top: 2px; }
.row .right { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.row .right.pos { color: var(--green); }
.row .right.neg { color: var(--red); }
.row .open {
  display: block;
  font-size: 12px;
  color: var(--blue);
  font-weight: 400;
  margin-top: 2px;
}

.empty-msg {
  padding: 28px var(--gutter);
  color: var(--secondary);
  text-align: center;
  font-size: 15px;
}

/* bots tab */
.bot-full {
  margin: 0 var(--gutter) 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
}
.bot-full .top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bot-full .top .title { flex: 1; font-weight: 600; font-size: 17px; }
.status-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--green); }
.status-dot.off { background: var(--tertiary); }
.status-dot.paused { background: var(--orange); }
.switch {
  width: 51px;
  height: 31px;
  min-width: 51px;
  min-height: 31px;
  border-radius: 16px;
  background: var(--card-2);
  position: relative;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 14px;
  background: #fff;
  transition: transform 200ms ease;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }
.switch.locked { opacity: 0.45; }
.bot-full .count { color: var(--secondary); font-size: 13px; margin: 6px 0 8px; }
.decision {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 0.5px solid var(--sep);
  font-size: 13px;
}
.decision a { color: var(--blue); }
.settings-shortcut { color: var(--blue); font-size: 15px; min-height: 44px; }

/* audit */
.audit-discs {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 8px var(--gutter) 16px;
  position: relative;
}
.disc {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  position: relative;
  color: var(--secondary);
}
.disc.green { color: var(--green); }
.disc.red { color: var(--red); }
.beam {
  position: absolute;
  top: 8px;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--cyan);
  pointer-events: none;
  transition: left 350ms ease;
}
.audit-layers { padding: 0 var(--gutter); }
.audit-layer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-top: 0.5px solid var(--sep);
  font-size: 15px;
}
.audit-layer .val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--secondary); }
.social-row {
  margin: 14px var(--gutter) 0;
  padding: 12px;
  background: var(--card);
  border-radius: var(--radius);
  color: var(--secondary);
  font-size: 14px;
}

/* coin */
.coin-head { padding: 8px var(--gutter) 0; }
.coin-kicker { color: var(--secondary); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.shield {
  display: inline-flex;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--card-2);
  font-size: 12px;
  font-weight: 600;
  align-items: center;
}
.coin-name { font-size: 28px; font-weight: 700; margin: 6px 0 4px; display: flex; align-items: center; gap: 8px; }
.price { font-size: 40px; font-weight: 700; letter-spacing: -0.5px; }
.since { margin-top: 4px; font-size: 15px; color: var(--green); font-weight: 600; }
.since.neg { color: var(--red); }
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px var(--gutter);
}
.stat { background: var(--card); border-radius: 12px; padding: 10px; }
.stat .k { font-size: 11px; color: var(--secondary); }
.stat .v { font-size: 15px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.position-card {
  margin: 0 var(--gutter);
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
}
.actions {
  display: flex;
  gap: 10px;
  padding: 16px var(--gutter);
}
.btn {
  flex: 1;
  min-height: 50px;
  border-radius: 12px;
  background: var(--card-2);
  font-size: 16px;
  font-weight: 600;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }

/* account */
.account-block {
  margin: 0 var(--gutter) 16px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}
.account-block .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px;
  border-top: 0.5px solid var(--sep);
  font-size: 15px;
}
.account-block .item:first-child { border-top: 0; }
.account-block .item .sub { color: var(--secondary); font-size: 13px; }
.seg {
  display: flex;
  background: var(--card-2);
  border-radius: 9px;
  padding: 2px;
}
.seg button {
  min-height: 32px;
  min-width: 64px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}
.seg button.on { background: var(--card); color: var(--text); }
.setting { padding: 10px 14px; border-top: 0.5px solid var(--sep); }
.setting .lab { font-size: 13px; margin-bottom: 6px; }
.setting .row { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; min-height: 44px; }
.setting input[type="range"] { flex: 1; accent-color: var(--blue); }
.setting input[type="number"], .setting input[type="text"], .setting input[type="time"], .setting select {
  width: 96px;
  background: var(--card-2);
  border: 0;
  border-radius: 8px;
  padding: 8px;
  min-height: 36px;
  font-variant-numeric: tabular-nums;
}
.group-title {
  font-size: 13px;
  color: var(--secondary);
  padding: 16px var(--gutter) 6px;
  font-weight: 600;
}
.note { font-size: 13px; color: var(--secondary); padding: 4px 14px 12px; }

/* sheets */
.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 12px var(--gutter) calc(16px + var(--safe-b));
}
.sheet h2 { font-size: 17px; margin: 8px 0 12px; font-weight: 600; }
.sheet .choice {
  width: 100%;
  min-height: 48px;
  text-align: left;
  border-top: 0.5px solid var(--sep);
  font-size: 16px;
}
.sheet input[type="text"] {
  width: 100%;
  background: var(--card-2);
  border: 0;
  border-radius: 10px;
  padding: 12px;
  min-height: 44px;
  margin-bottom: 10px;
}
.search-results { max-height: 50dvh; overflow: auto; }

/* live fullscreen */
#view-live {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  padding: var(--safe-t) var(--gutter) calc(16px + var(--safe-b));
  display: flex;
  flex-direction: column;
}
#view-live .stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
#view-live .stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
}
#view-live .live-actions { display: flex; gap: 10px; padding-top: 12px; }

/* tab bar */
#tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(22, 22, 24, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
#tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--tertiary);
  font-size: 10px;
  font-weight: 500;
  min-height: var(--tab-h);
}
#tabs button.on { color: var(--blue); }
#tabs svg { width: 24px; height: 24px; }

/* loading skeletons — pulse 0.5 to 1, 1.2s, #1c1c1e blocks in final layout */
.skel {
  background: var(--card);
  border-radius: 8px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.skel-hero { height: 72px; margin: 8px var(--gutter); border-radius: 8px; }
.skel-chart { height: 200px; margin: 8px 0; border-radius: 0; }
.skel-live { aspect-ratio: 16 / 9; margin: 8px var(--gutter); border-radius: var(--live-radius); }
.skel-card { flex: 0 0 240px; height: 148px; border-radius: var(--radius); }
.skel-row { height: 56px; margin: 0 var(--gutter) 8px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  z-index: 70;
  background: var(--card-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  max-width: 80%;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .odometer .digit .strip { transition: none; }
  .live-frame img { transition: none; }
  .skel { animation: none; opacity: 0.7; }
  .beam { transition: none; }
  .switch::after { transition: none; }
}

select, input[type="time"], input[type="number"], input[type="text"] {
  color-scheme: dark;
  background: var(--card-2);
  color: var(--text);
}
#copy-picks, #copy-picks-time {
  min-width: 120px;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  min-height: 36px;
}
.price.muted { font-size: 28px; color: var(--tertiary); font-weight: 600; letter-spacing: 0; }
