:root {
  --bg: #060807;
  --bg-raised: #0a0e0c;
  --panel: #0d1210;
  --panel-soft: #111713;
  --panel-strong: #151c17;
  --line: rgba(236, 245, 232, 0.075);
  --line-strong: rgba(236, 245, 232, 0.13);
  --text: #eef2ea;
  --muted: #96a198;
  --muted-2: #748078;
  --dim: #576259;
  --lime: #c9f56b;
  --lime-bright: #ddff8e;
  --violet: #b9a2ff;
  --coral: #ff8877;
  --blue: #79baff;
  --amber: #f3cd7b;
  --mint: #78e3b2;
  --red: #ff7367;
  --green: #8fe388;
  --mono: "SFMono-Regular", "SF Mono", "Roboto Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  --radius: 17px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 46% -12%, rgba(190, 235, 112, 0.075), transparent 62%),
    radial-gradient(760px 680px at 105% 42%, rgba(156, 128, 255, 0.045), transparent 64%),
    radial-gradient(700px 500px at -10% 90%, rgba(96, 149, 119, 0.04), transparent 60%),
    var(--bg);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  font-variant-numeric: tabular-nums;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.13'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 1px solid var(--lime);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 auto;
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-rows: 62px 33px minmax(0, 1fr) 34px;
}

/* ── Titlebar ───────────────────────────────────────────────────────── */
.titlebar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 0 20px 0 78px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(7, 10, 8, 0.72);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-app-region: drag;
  user-select: none;
}

.titlebar button,
.titlebar-actions,
.command-trigger {
  -webkit-app-region: no-drag;
}

.brand-block {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-mark {
  width: 37px;
  height: 37px;
  filter: drop-shadow(0 0 18px rgba(201, 245, 107, 0.08));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-type {
  margin-left: 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-type strong {
  font-size: 16px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.brand-type span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.24em;
}

.brand-divider {
  width: 1px;
  height: 25px;
  margin: 0 15px 0 17px;
  background: var(--line);
}

.product-name {
  color: #c6cec5;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.product-name small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.8px;
  letter-spacing: 0.18em;
}

.titlebar-center {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(201, 245, 107, 0.16);
  border-radius: 99px;
  color: #d7e6c9;
  background: rgba(201, 245, 107, 0.045);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.live-pill i,
.status-live i,
.terminal-live i,
.soft-pill i,
.rail-badge i,
.engine-scan .mini-scanner {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(201, 245, 107, 0.08), 0 0 9px rgba(201, 245, 107, 0.6);
  animation: breathe 2.4s ease-in-out infinite;
}

.live-pill.offline {
  color: var(--amber);
  border-color: rgba(243, 205, 123, 0.2);
  background: rgba(243, 205, 123, 0.05);
}

.live-pill.offline i {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(243, 205, 123, 0.08), 0 0 9px rgba(243, 205, 123, 0.5);
}

.latency-label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.latency-label b {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.titlebar-sep {
  width: 1px;
  height: 21px;
  background: var(--line);
}

.session-clock {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-end;
  white-space: nowrap;
}

.session-clock b {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.session-clock span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.11em;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.command-trigger {
  height: 30px;
  padding: 0 8px 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: border-color 180ms, color 180ms, background 180ms;
}

.command-trigger:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.command-trigger .icon {
  width: 12px;
  height: 12px;
}

.command-trigger span {
  font-size: 9.5px;
}

kbd {
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom-color: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
}

.icon-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  transition: 180ms;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.icon-button .icon {
  width: 12px;
  height: 12px;
}

.operator-avatar {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-left: 2px;
  border: 1px solid rgba(201, 245, 107, 0.2);
  border-radius: 50%;
  color: #dff8af;
  background: linear-gradient(145deg, #26311d, #141b13);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.operator-avatar span {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--bg);
  border-radius: 50%;
  background: var(--lime);
}

/* ── Ticker rail ───────────────────────────────────────────────────── */
.ticker-rail {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 8, 6, 0.72);
  -webkit-app-region: drag;
}

.ticker-rail::before,
.ticker-rail::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 50px;
  pointer-events: none;
}

.ticker-rail::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
}

.ticker-rail::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: ticker-scroll 95s linear infinite;
}

.ticker-rail:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  align-items: center;
  height: 100%;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  white-space: nowrap;
}

.ticker-item b {
  color: #c3cbc2;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.ticker-item .tick-price {
  color: #aab4a9;
}

.ticker-item .up {
  color: var(--green);
}

.ticker-item .down {
  color: var(--red);
}

@keyframes ticker-scroll {
  to { transform: translateX(-50%); }
}

/* ── Main layout ───────────────────────────────────────────────────── */
.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr) 342px;
  gap: 11px;
  padding: 12px 16px 11px;
}

.left-rail,
.center-stage,
.right-rail {
  min-height: 0;
}

.left-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 4px 3px;
}

.section-kicker {
  display: block;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.18em;
  line-height: 1.4;
}

.rail-heading h2,
.panel-heading h3 {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 570;
  letter-spacing: 0.01em;
}

.rail-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
}

.rail-badge i {
  width: 4px;
  height: 4px;
}

.strategy-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}

.strategy-card {
  --tone: var(--violet);
  position: relative;
  flex: 1;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 10px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 46%),
    linear-gradient(180deg, rgba(17, 22, 19, 0.9), rgba(11, 15, 13, 0.94));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
  text-align: left;
  transition: border-color 220ms var(--ease), background 220ms var(--ease), transform 220ms var(--ease);
}

.strategy-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  bottom: 17px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--tone);
  opacity: 0.5;
  transition: opacity 220ms, top 220ms, bottom 220ms;
}

.strategy-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -46px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--tone);
  filter: blur(55px);
  opacity: 0;
  transition: opacity 250ms;
}

.strategy-card:hover {
  border-color: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

.strategy-card:hover::after {
  opacity: 0.07;
}

.strategy-card.active {
  border-color: color-mix(in srgb, var(--tone) 38%, transparent);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--tone) 8%, transparent), transparent 55%),
    linear-gradient(180deg, rgba(20, 26, 21, 0.96), rgba(12, 16, 14, 0.97));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone) 7%, transparent) inset, 0 12px 36px rgba(0, 0, 0, 0.2);
}

.strategy-card.active::before {
  top: 11px;
  bottom: 11px;
  opacity: 1;
  box-shadow: 0 0 14px color-mix(in srgb, var(--tone) 60%, transparent);
}

.strategy-card.active::after {
  opacity: 0.09;
}

.strategy-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.strategy-icon {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tone) 24%, transparent);
  border-radius: 10px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 8%, rgba(8, 11, 9, 0.7));
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.strategy-card.active .strategy-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid color-mix(in srgb, var(--tone) 18%, transparent);
  border-radius: 13px;
  animation: strategy-ring 2.8s ease-out infinite;
}

.strategy-name-block {
  min-width: 0;
  flex: 1;
}

.strategy-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 570;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.strategy-code {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.strategy-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9.3px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-state {
  flex: 0 0 auto;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
}

.strategy-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted-2);
}

.strategy-state[data-status="active"] {
  color: var(--lime);
}

.strategy-state[data-status="active"] i {
  background: var(--lime);
  box-shadow: 0 0 8px rgba(201, 245, 107, 0.55);
  animation: breathe 2.4s ease-in-out infinite;
}

.strategy-state[data-status="watch"] {
  color: var(--amber);
}

.strategy-state[data-status="watch"] i {
  background: var(--amber);
}

.strategy-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 6px;
  color: #4b564e;
  font-family: var(--mono);
  font-size: 5.9px;
  letter-spacing: 0.01em;
}

.strategy-logic {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-stats {
  flex: 0 0 auto;
  color: #4b564e;
  white-space: nowrap;
}

.strategy-stats b {
  color: #6e796f;
  font-weight: 500;
}

.strategy-meta {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 7px;
}

.strategy-lead {
  min-width: 0;
  flex: 1;
}

.strategy-lead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
}

.strategy-lead-top b {
  color: #b8c2b7;
  font-size: 8.5px;
  font-weight: 500;
}

.strategy-meter {
  height: 2px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.strategy-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
  opacity: 0.72;
  transition: width 600ms var(--ease);
}

.strategy-candidates {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  white-space: nowrap;
}

.strategy-candidates b {
  color: #c5cec3;
  font-weight: 500;
}

.rail-engine {
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.engine-scan {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 8px;
}

.engine-scan .mini-scanner {
  width: 4px;
  height: 4px;
}

.engine-scan b {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
}

.engine-copy {
  color: #3d463f;
  font-family: var(--mono);
  font-size: 6.2px;
  letter-spacing: 0.11em;
}

/* ── Shared panel ──────────────────────────────────────────────────── */
.panel {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.02), transparent 40%),
    linear-gradient(180deg, rgba(15, 20, 17, 0.96), rgba(10, 14, 12, 0.97));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.028) inset,
    0 18px 45px rgba(0, 0, 0, 0.12);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px 10px;
}

.panel-heading.compact {
  padding: 12px 15px 6px;
}

.heading-block {
  min-width: 0;
}

.panel-heading h3 {
  font-size: 13.5px;
}

.heading-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.soft-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(201, 245, 107, 0.11);
  border-radius: 99px;
  color: #a9bb9e;
  background: rgba(201, 245, 107, 0.035);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.soft-pill i {
  width: 4px;
  height: 4px;
}

.flow-range {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.7px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ── Center stage ──────────────────────────────────────────────────── */
.center-stage {
  display: grid;
  grid-template-rows: 178px 136px minmax(0, 1fr);
  gap: 10px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 224px 196px;
  align-items: stretch;
  padding: 20px 0 17px 22px;
  border-color: rgba(201, 245, 107, 0.13);
  background:
    radial-gradient(85% 180% at 2% 0%, rgba(201, 245, 107, 0.11), transparent 43%),
    radial-gradient(80% 180% at 94% 18%, rgba(174, 145, 255, 0.12), transparent 44%),
    linear-gradient(135deg, #121811 0%, #0b0f0c 58%, #111410 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 22px 55px rgba(0, 0, 0, 0.22);
}

.hero-glow {
  position: absolute;
  right: 12%;
  top: -120px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(194, 242, 108, 0.09);
  filter: blur(90px);
  pointer-events: none;
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent 25%, #000 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #aab6a6;
  font-family: var(--mono);
  font-size: 7.2px;
  letter-spacing: 0.13em;
}

.eyebrow > span:not(.live-dot) {
  color: var(--dim);
}

.eyebrow > span:last-child {
  color: var(--lime);
  letter-spacing: 0.08em;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(201, 245, 107, 0.08), 0 0 10px rgba(201, 245, 107, 0.55);
  animation: breathe 2.4s ease-in-out infinite;
}

.hero-copy h1 {
  margin: 9px 0 0;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 560;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.hero-copy h1 span {
  margin-left: 4px;
  color: var(--lime);
  background: linear-gradient(100deg, #f0f6e8 0%, #d7f9a3 58%, #b7ed58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy p {
  max-width: 370px;
  margin: 7px 0 0;
  color: var(--muted-2);
  font-size: 10.2px;
  line-height: 1.55;
}

.hero-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
}

.primary-button {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(201, 245, 107, 0.3);
  border-radius: 8px;
  color: #dfff9c;
  background: rgba(201, 245, 107, 0.085);
  font-size: 9.5px;
  transition: 180ms var(--ease);
}

.primary-button:hover {
  background: rgba(201, 245, 107, 0.14);
  border-color: rgba(201, 245, 107, 0.45);
  box-shadow: 0 0 24px rgba(201, 245, 107, 0.08);
}

.primary-button .icon {
  width: 12px;
  height: 12px;
}

.primary-button.spinning .icon {
  animation: spin 700ms linear infinite;
}

.interval-tabs {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.interval-tabs button {
  height: 24px;
  min-width: 32px;
  padding: 0 7px;
  border-radius: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  transition: 160ms;
}

.interval-tabs button:hover {
  color: var(--text);
}

.interval-tabs button.active {
  color: #dff5be;
  background: rgba(201, 245, 107, 0.1);
  box-shadow: 0 0 0 1px rgba(201, 245, 107, 0.12) inset;
}

.hero-counter {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.055);
}

.counter-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.counter-label span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.2px;
  letter-spacing: 0.14em;
}

.counter-value {
  margin: 3px 0 1px -2px;
  color: #f4f8ef;
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 450;
  line-height: 1.05;
  letter-spacing: -0.07em;
  text-shadow: 0 0 36px rgba(201, 245, 107, 0.08);
}

.counter-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--dim);
  font-size: 7.5px;
}

.counter-caption b {
  color: #59645b;
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.counter-track {
  height: 2px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.counter-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(201, 245, 107, 0.2), var(--lime));
  box-shadow: 0 0 10px rgba(201, 245, 107, 0.4);
  transition: width 900ms var(--ease);
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 18px 4px 0;
}

.hero-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-stat:last-child {
  border-bottom: 0;
}

.hero-stat > span {
  flex: 1;
  color: var(--muted-2);
  font-size: 8.5px;
  white-space: nowrap;
}

.hero-stat strong {
  color: #f0f4ed;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.hero-stat em {
  min-width: 42px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.2px;
  font-style: normal;
  letter-spacing: 0.03em;
  text-align: right;
  white-space: nowrap;
}

.hero-stat em.tag-lime {
  color: var(--lime);
}

.hero-corner-label {
  position: absolute;
  right: 18px;
  bottom: 8px;
  color: rgba(255, 255, 255, 0.12);
  font-family: var(--mono);
  font-size: 5.6px;
  letter-spacing: 0.12em;
}

/* ── Strategy flow ─────────────────────────────────────────────────── */
.flow-panel {
  display: flex;
  flex-direction: column;
}

.strategy-flow {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  padding: 2px 12px 0;
}

.strategy-flow::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 27px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 8%, rgba(255, 255, 255, 0.1) 92%, transparent);
}

.flow-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 3px;
  color: var(--muted-2);
  transition: color 160ms;
}

.flow-node:hover {
  color: var(--text);
}

.flow-node-icon {
  --tone: var(--violet);
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tone) 20%, transparent);
  border-radius: 50%;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 7%, #0c110e);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  transition: 200ms var(--ease);
}

.flow-node.selected .flow-node-icon {
  border-color: color-mix(in srgb, var(--tone) 52%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 6%, transparent), 0 0 18px color-mix(in srgb, var(--tone) 15%, transparent);
}

.flow-node.has-signal .flow-node-icon::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  width: 6px;
  height: 6px;
  border: 1.5px solid #0d120f;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 7px color-mix(in srgb, var(--tone) 60%, transparent);
}

.flow-node-name {
  max-width: 100%;
  overflow: hidden;
  color: #9aa49a;
  font-size: 8.2px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-node.selected .flow-node-name {
  color: var(--text);
}

.flow-node-count {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.5px;
}

.flow-node-count b {
  color: var(--muted);
  font-weight: 500;
}

.flow-node.selected .flow-node-count b {
  color: var(--lime);
}

.flow-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 29px;
  padding: 0 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--dim);
  font-size: 7.7px;
}

.flow-footer span {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.flow-footer b {
  color: #b7c1b6;
  font-family: var(--mono);
  font-size: 8.2px;
  font-weight: 500;
}

.flow-footer .flow-average {
  margin-left: auto;
  color: #4d574f;
  font-family: var(--mono);
  font-size: 6.6px;
  letter-spacing: 0.08em;
}

.flow-footer .flow-average b {
  color: var(--lime);
}

/* ── Center split ──────────────────────────────────────────────────── */
.center-split {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(300px, 1fr);
  gap: 10px;
}

.signals-panel,
.factor-panel {
  display: flex;
  flex-direction: column;
}

.filter-tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.12);
}

.filter-tabs button {
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--dim);
  font-size: 8px;
  transition: 160ms;
}

.filter-tabs button:hover {
  color: var(--text);
}

.filter-tabs button.active {
  color: #e1eade;
  background: rgba(255, 255, 255, 0.07);
}

.signal-table-head {
  display: grid;
  grid-template-columns: 26px minmax(78px, 1.15fr) minmax(78px, 1fr) 74px 55px 14px;
  gap: 8px;
  align-items: center;
  height: 23px;
  margin: 0 8px;
  padding: 0 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #475149;
  font-family: var(--mono);
  font-size: 6.2px;
  letter-spacing: 0.05em;
}

.signal-table-head span:nth-child(4),
.signal-table-head span:nth-child(5) {
  text-align: right;
}

.signal-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px;
}

.signal-row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(78px, 1.15fr) minmax(78px, 1fr) 74px 55px 14px;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 5px 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.042);
  text-align: left;
  transition: background 160ms;
}

.signal-row:hover {
  background: rgba(255, 255, 255, 0.024);
}

.signal-row.selected {
  background:
    linear-gradient(90deg, rgba(201, 245, 107, 0.055), transparent 75%);
}

.signal-row.selected::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 13px;
  bottom: 13px;
  width: 2px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 11px rgba(201, 245, 107, 0.5);
}

.signal-rank {
  color: #424c44;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: -0.03em;
}

.signal-row:nth-child(1) .signal-rank {
  color: var(--lime);
}

.signal-asset {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.coin-mark {
  --coin: #c9f56b;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--coin) 24%, transparent);
  border-radius: 9px;
  color: var(--coin);
  background:
    radial-gradient(circle at 34% 25%, color-mix(in srgb, var(--coin) 16%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}

.signal-pair {
  min-width: 0;
}

.signal-pair b {
  display: block;
  overflow: hidden;
  color: #e6ece3;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-pair span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--dim);
  font-size: 7.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-strategy {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.signal-strategy i {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: var(--tone, var(--lime));
}

.signal-strategy div {
  min-width: 0;
}

.signal-strategy b {
  display: block;
  overflow: hidden;
  color: #b9c3b8;
  font-size: 8.8px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-strategy span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 6.2px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.signal-strategy span.confirmed {
  color: var(--lime);
}

.signal-score {
  min-width: 0;
}

.signal-score-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.signal-score-line b {
  color: #edf3e9;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.grade {
  min-width: 13px;
  padding: 1px 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 5.5px;
  line-height: 1.2;
  text-align: center;
}

.grade[data-grade="A"] {
  color: var(--lime);
  border-color: rgba(201, 245, 107, 0.25);
  background: rgba(201, 245, 107, 0.05);
}

.signal-score-bar {
  height: 2px;
  margin-top: 4px;
  margin-left: auto;
  width: 58px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.signal-score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(201, 245, 107, 0.35), var(--lime));
}

.signal-change {
  color: var(--green);
  font-family: var(--mono);
  font-size: 8.5px;
  text-align: right;
}

.signal-change.down {
  color: var(--red);
}

.signal-arrow {
  color: #3f4941;
  transition: 160ms;
}

.signal-arrow .icon {
  width: 12px;
  height: 12px;
}

.signal-row:hover .signal-arrow,
.signal-row.selected .signal-arrow {
  color: var(--lime);
}

.panel-footnote {
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  color: #414a43;
  font-size: 6.8px;
}

.panel-footnote span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.panel-footnote .icon {
  width: 9px;
  height: 9px;
}

.signal-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 9px;
}

/* ── Factor panel ──────────────────────────────────────────────────── */
.engine-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid rgba(185, 162, 255, 0.14);
  border-radius: 5px;
  color: #a99bdd;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.engine-chip span {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 4px;
  color: #0e120c;
  background: var(--violet);
  font-size: 7.5px;
  font-weight: 700;
}

.factor-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 15px 14px;
}

.factor-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 9px;
}

.factor-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 3px 0 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.score-orb {
  --score: 0;
  --tone: var(--lime);
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--tone) calc(var(--score) * 1%), rgba(255, 255, 255, 0.065) 0);
  box-shadow: 0 0 25px color-mix(in srgb, var(--tone) 7%, transparent);
}

.score-orb::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  background: #0e1410;
}

.score-orb-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.score-orb-inner strong {
  color: #f1f6ec;
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.07em;
}

.score-orb-inner span {
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.11em;
}

.factor-asset {
  min-width: 0;
  flex: 1;
}

.factor-asset-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.factor-asset-head .coin-mark {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  border-radius: 8px;
  font-size: 10px;
}

.factor-asset-head b {
  color: #e8eee4;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.factor-state {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--lime);
  font-size: 7px;
  white-space: nowrap;
}

.factor-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lime);
}

.factor-state.watch {
  color: var(--amber);
}

.factor-state.watch i {
  background: var(--amber);
}

.factor-asset p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.35;
}

.factor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
}

.factor-tags span {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  color: #647067;
  font-family: var(--mono);
  font-size: 5.8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.factor-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.factor-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  gap: 7px;
  align-items: center;
}

.factor-label {
  color: var(--muted-2);
  font-size: 7.5px;
}

.factor-track {
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.065);
}

.factor-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone, var(--lime));
  opacity: 0.78;
  transition: width 700ms var(--ease);
}

.factor-value {
  color: #aeb8ad;
  font-family: var(--mono);
  font-size: 7.5px;
  text-align: right;
}

.factor-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 9px 0;
}

.factor-level {
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.014);
}

.factor-level span {
  display: block;
  color: var(--dim);
  font-size: 6.5px;
}

.factor-level b {
  display: block;
  margin-top: 3px;
  color: #c8d1c6;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.factor-level b.risk {
  color: var(--coral);
}

.factor-level b.target {
  color: var(--lime);
}

.factor-note {
  position: relative;
  margin: 0;
  padding: 9px 10px 9px 12px;
  border: 1px solid rgba(185, 162, 255, 0.1);
  border-radius: 8px;
  color: #aeb8b0;
  background: rgba(185, 162, 255, 0.035);
  font-size: 8.2px;
  line-height: 1.6;
}

.factor-note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--violet);
  opacity: 0.6;
}

.factor-note b {
  color: #c9b9ff;
  font-family: var(--mono);
  font-size: 6.4px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.factor-checks {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.factor-checks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  color: #4f5a51;
  font-family: var(--mono);
  font-size: 5.9px;
  letter-spacing: 0.08em;
}

.factor-checks-head b {
  color: #8b9a8a;
  font-family: var(--sans);
  font-size: 6.8px;
  font-weight: 400;
  letter-spacing: 0;
}

.check-row {
  display: grid;
  grid-template-columns: 12px 58px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 3.5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #69756b;
  font-size: 7px;
}

.check-row b {
  color: #929d93;
  font-size: 7px;
  font-weight: 400;
  text-align: right;
}

.check-mark {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  text-align: center;
}

.factor-stamp {
  margin-top: 7px;
  color: #3f4a42;
  font-family: var(--mono);
  font-size: 5.7px;
  letter-spacing: 0.05em;
  text-align: right;
}

/* ── Right rail ────────────────────────────────────────────────────── */
.right-rail {
  display: grid;
  grid-template-rows: minmax(0, 1.05fr) minmax(0, 0.89fr) minmax(0, 0.99fr);
  gap: 10px;
}

.radar-panel {
  display: flex;
  flex-direction: column;
}

.radar-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
}

.radar-tools .icon {
  width: 12px;
  height: 12px;
}

.radar-count {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
}

.market-head {
  display: grid;
  grid-template-columns: minmax(72px, 0.9fr) minmax(50px, 0.8fr) 66px 42px;
  gap: 6px;
  align-items: center;
  height: 20px;
  margin: 0 13px;
  padding: 0 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #455047;
  font-family: var(--mono);
  font-size: 5.9px;
}

.market-head span:nth-child(3),
.market-head span:nth-child(4) {
  text-align: right;
}

.market-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px;
}

.market-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(72px, 0.9fr) minmax(50px, 0.8fr) 66px 42px;
  gap: 6px;
  align-items: center;
  padding: 4px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  text-align: left;
  transition: background 150ms;
}

.market-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.market-asset {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.market-asset .coin-mark {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border-radius: 7px;
  font-size: 8.8px;
}

.market-names {
  min-width: 0;
}

.market-names b {
  display: block;
  color: #d2dad0;
  font-family: var(--mono);
  font-size: 8.8px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.market-names span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--dim);
  font-size: 6.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spark {
  width: 100%;
  height: 22px;
  display: block;
  opacity: 0.9;
}

.market-price {
  color: #c5cec4;
  font-family: var(--mono);
  font-size: 8.7px;
  text-align: right;
  white-space: nowrap;
}

.market-change {
  color: var(--green);
  font-family: var(--mono);
  font-size: 7.8px;
  text-align: right;
  white-space: nowrap;
}

.market-change.down {
  color: var(--red);
}

.radar-footer {
  flex: 0 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  color: #455048;
  font-size: 6.4px;
}

.radar-footer span {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.radar-footer b {
  color: #8e998e;
  font-family: var(--mono);
  font-size: 6.8px;
  font-weight: 400;
}

.up-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}

/* ── AI brief ──────────────────────────────────────────────────────── */
.insight-panel {
  display: flex;
  flex-direction: column;
  border-color: rgba(185, 162, 255, 0.1);
  background:
    radial-gradient(110% 130% at 100% 0%, rgba(185, 162, 255, 0.075), transparent 50%),
    linear-gradient(150deg, rgba(16, 21, 18, 0.98), rgba(11, 14, 12, 0.98));
}

.brief-badge {
  padding: 3px 6px;
  border: 1px solid rgba(185, 162, 255, 0.15);
  border-radius: 4px;
  color: #ad9de3;
  background: rgba(185, 162, 255, 0.04);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.brief-badge.positive {
  color: var(--lime);
  border-color: rgba(201, 245, 107, 0.16);
  background: rgba(201, 245, 107, 0.04);
}

.brief-badge.negative {
  color: var(--coral);
  border-color: rgba(255, 136, 119, 0.16);
  background: rgba(255, 136, 119, 0.04);
}

.brief-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0 15px 8px;
  overflow: hidden;
}

.brief-signal {
  position: absolute;
  right: 14px;
  top: 0;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.4;
}

.brief-signal span {
  width: 2px;
  border-radius: 2px;
  background: var(--violet);
  animation: equalize 2.2s ease-in-out infinite;
}

.brief-signal span:nth-child(1) { height: 5px; animation-delay: -0.2s; }
.brief-signal span:nth-child(2) { height: 10px; animation-delay: -0.8s; }
.brief-signal span:nth-child(3) { height: 6px; animation-delay: -1.3s; }
.brief-signal span:nth-child(4) { height: 14px; animation-delay: -0.5s; }
.brief-signal span:nth-child(5) { height: 8px; animation-delay: -1.7s; }
.brief-signal span:nth-child(6) { height: 12px; animation-delay: -1s; }
.brief-signal span:nth-child(7) { height: 5px; animation-delay: -1.5s; }
.brief-signal span:nth-child(8) { height: 9px; animation-delay: -0.3s; }

.brief-body h4 {
  max-width: 270px;
  margin: 0 30px 4px 0;
  color: #e6ede2;
  font-size: 12.5px;
  font-weight: 540;
  letter-spacing: -0.01em;
}

.brief-body p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #818c82;
  font-size: 8.6px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.brief-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.brief-chips span {
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  color: #727e74;
  font-family: var(--mono);
  font-size: 5.7px;
  white-space: nowrap;
}

.breadth-bar {
  margin-top: 7px;
}

.breadth-labels {
  display: flex;
  justify-content: space-between;
  color: #424d44;
  font-size: 5.8px;
}

.breadth-labels span:nth-child(2) {
  color: #5f6b61;
}

.breadth-track {
  position: relative;
  height: 3px;
  margin-top: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 115, 103, 0.35), rgba(255, 255, 255, 0.08) 50%, rgba(143, 227, 136, 0.35));
}

.breadth-track span {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: #ecf4e7;
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.4);
  transition: left 700ms var(--ease);
}

.brief-next {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.brief-next span {
  padding-top: 1px;
  color: #5f557a;
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.06em;
}

.brief-next p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #667268;
  font-size: 6.9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.brief-footer {
  flex: 0 0 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  color: #3f4841;
  font-family: var(--mono);
  font-size: 5.7px;
  letter-spacing: 0.05em;
}

.brief-footer span:first-child {
  color: #625a78;
}

/* ── Terminal ──────────────────────────────────────────────────────── */
.log-panel {
  display: flex;
  flex-direction: column;
}

.terminal-live {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 6.3px;
  letter-spacing: 0.1em;
}

.terminal-live i {
  width: 4px;
  height: 4px;
}

.terminal {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 13px 2px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 22%);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.48;
}

.log-line {
  display: grid;
  grid-template-columns: 35px 31px minmax(0, 1fr);
  gap: 5px;
  padding: 2.5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.022);
  animation: log-in 300ms ease both;
}

.log-time {
  color: #3f4941;
}

.log-type {
  color: var(--muted-2);
  font-size: 6.2px;
  letter-spacing: 0.03em;
}

.log-text {
  color: #8b978d;
  overflow-wrap: anywhere;
}

.log-line[data-type="SYS"] .log-type { color: var(--violet); }
.log-line[data-type="SCAN"] .log-type { color: var(--blue); }
.log-line[data-type="SIG"] .log-type { color: var(--lime); }
.log-line[data-type="SIG"] .log-text { color: #bdc9b8; }
.log-line[data-type="RISK"] .log-type { color: var(--amber); }
.log-line[data-type="USER"] .log-type { color: var(--coral); }
.log-line[data-type="USER"] .log-text { color: #d2b9b4; }

.command-form {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 11px 8px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 160ms;
}

.command-form:focus-within {
  border-color: rgba(201, 245, 107, 0.28);
  box-shadow: 0 0 0 3px rgba(201, 245, 107, 0.025);
}

.prompt {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
}

.command-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #c5cec3;
  background: transparent;
  font-family: var(--mono);
  font-size: 7.4px;
}

.command-form input::placeholder {
  color: #3d473f;
}

.command-form kbd {
  padding: 2px 4px;
  font-size: 7px;
}

/* ── Statusbar ─────────────────────────────────────────────────────── */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 8, 6, 0.7);
  color: #465047;
  font-size: 7px;
  letter-spacing: 0.015em;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  white-space: nowrap;
}

.status-left b {
  color: #778277;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
}

.status-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #687568;
  font-family: var(--mono);
  font-size: 6.4px;
  letter-spacing: 0.06em;
}

.status-live i {
  width: 4px;
  height: 4px;
}

.status-sep {
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, 0.06);
}

.keyboard-hint {
  display: flex;
  align-items: center;
  gap: 3px;
}

.keyboard-hint kbd {
  padding: 2px 4px;
  font-size: 7px;
}

/* ── Boot + toast ──────────────────────────────────────────────────── */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(600px 400px at 50% 42%, rgba(201, 245, 107, 0.06), transparent 65%),
    #060807;
  transition: opacity 500ms var(--ease), visibility 500ms;
}

.boot-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-mark {
  width: 54px;
  height: 54px;
  color: var(--lime);
  filter: drop-shadow(0 0 24px rgba(201, 245, 107, 0.18));
  animation: boot-pulse 2.4s ease-in-out infinite;
}

.boot-mark svg {
  width: 100%;
  height: 100%;
}

.boot-word {
  margin-top: 14px;
  color: #dce7d7;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}

.boot-line {
  width: 150px;
  height: 2px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.boot-line span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  animation: boot-load 1.5s var(--ease) infinite;
}

.boot-copy {
  margin-top: 12px;
  color: #4f5a51;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 52px;
  z-index: 200;
  max-width: 460px;
  padding: 9px 13px;
  border: 1px solid rgba(201, 245, 107, 0.18);
  border-radius: 8px;
  color: #cdd9c6;
  background: rgba(18, 24, 19, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  font-size: 9px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: 220ms var(--ease);
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

html.capture-mode .boot-screen {
  display: none;
}

html.capture-mode *,
html.capture-mode *::before,
html.capture-mode *::after {
  animation: none !important;
  transition: none !important;
}

/* ── Utilities / animations ────────────────────────────────────────── */
.up {
  color: var(--green) !important;
}

.down {
  color: var(--red) !important;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.09);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes strategy-ring {
  0% { opacity: 0.4; transform: scale(0.95); }
  75%, 100% { opacity: 0; transform: scale(1.18); }
}

@keyframes equalize {
  0%, 100% { transform: scaleY(0.6); }
  50% { transform: scaleY(1); }
}

@keyframes log-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes boot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes boot-load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@media (max-height: 820px) {
  .app-shell {
    grid-template-rows: 62px minmax(0, 1fr) 34px;
  }

  .ticker-rail {
    display: none;
  }

  .workspace {
    padding-top: 9px;
    padding-bottom: 8px;
  }

  .center-stage {
    grid-template-rows: 154px 116px minmax(0, 1fr);
    gap: 8px;
  }

  .hero-panel {
    padding-top: 15px;
    padding-bottom: 13px;
  }

  .hero-copy h1 {
    font-size: 23px;
  }

  .hero-copy p {
    display: none;
  }

  .counter-value {
    font-size: 38px;
  }

  .insight-panel {
    display: none;
  }

  .right-rail {
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.92fr);
  }

  .strategy-card {
    min-height: 76px;
    padding-top: 9px;
    padding-bottom: 8px;
  }

  .strategy-detail {
    display: none;
  }

  .strategy-sub {
    font-size: 8.6px;
  }

  .rail-engine {
    flex-basis: 24px;
  }

  .panel-heading {
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .panel-heading.compact {
    padding-top: 9px;
  }

  .market-row {
    padding-top: 2.5px;
    padding-bottom: 2.5px;
  }

  .market-asset .coin-mark {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    font-size: 8px;
  }
}

@media (max-height: 940px) and (min-width: 1201px) {
  .score-orb {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .score-orb-inner strong {
    font-size: 19px;
  }

  .factor-hero {
    gap: 11px;
    padding-bottom: 7px;
  }

  .factor-asset p {
    margin-top: 3px;
  }

  .factor-tags {
    margin-top: 4px;
  }

  .factor-bars {
    gap: 5px;
    padding: 7px 0;
  }

  .factor-levels {
    gap: 5px;
    padding: 7px 0;
  }

  .factor-level {
    padding: 4px 6px;
  }

  .factor-note {
    padding: 7px 8px 7px 10px;
    font-size: 7.7px;
    line-height: 1.5;
  }

  .factor-checks {
    margin-top: 6px;
    padding-top: 6px;
  }

  .check-row {
    padding: 2.5px 0;
  }

  .factor-stamp {
    display: none;
  }

  .brief-next {
    display: none;
  }

  .brief-body p {
    -webkit-line-clamp: 3;
  }

  .market-row {
    padding-top: 3.5px;
    padding-bottom: 3.5px;
  }

  .market-asset .coin-mark {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
  }
}

@media (max-width: 1380px) {
  .workspace {
    grid-template-columns: 254px minmax(0, 1fr) 316px;
    gap: 9px;
    padding-left: 13px;
    padding-right: 13px;
  }

  .center-stage {
    grid-template-rows: 172px 132px minmax(0, 1fr);
    gap: 9px;
  }

  .center-split {
    gap: 9px;
    grid-template-columns: minmax(0, 1.3fr) minmax(286px, 1fr);
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) 200px 168px;
    padding-left: 18px;
  }

  .hero-copy h1 {
    font-size: 25px;
  }

  .counter-value {
    font-size: 42px;
  }

  .hero-copy p {
    max-width: 310px;
  }

  .product-name {
    display: none;
  }

  .brand-divider {
    display: none;
  }

  .titlebar-center {
    gap: 10px;
  }
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 236px minmax(0, 1fr) 286px;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) 178px;
  }

  .hero-stats {
    display: none;
  }

  .hero-copy h1 {
    font-size: 23px;
  }

  .counter-value {
    font-size: 39px;
  }

  .center-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .factor-panel {
    display: none;
  }

  .session-clock span,
  .latency-label,
  .command-trigger span {
    display: none;
  }

  .command-trigger {
    width: 30px;
    padding: 0;
    justify-content: center;
  }

  .command-trigger kbd {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Futures execution ─────────────────────────────────────────────── */
.trade-trigger {
  height: 30px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(201, 245, 107, 0.20);
  border-radius: 9px;
  color: #d9efb6;
  background:
    linear-gradient(110deg, rgba(201, 245, 107, 0.075), rgba(201, 245, 107, 0.015));
  transition: 180ms var(--ease);
}

.trade-trigger:hover {
  border-color: rgba(201, 245, 107, 0.38);
  background: rgba(201, 245, 107, 0.11);
}

.trade-trigger .icon {
  width: 13px;
  height: 13px;
}

.trade-trigger span {
  font-size: 9px;
  white-space: nowrap;
}

.trade-trigger em {
  padding: 2px 5px;
  border-radius: 3px;
  color: #a9b69f;
  background: rgba(255, 255, 255, 0.055);
  font-family: var(--mono);
  font-size: 5.7px;
  font-style: normal;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.trade-trigger em.live {
  color: #ffb2a8;
  background: rgba(255, 115, 103, 0.14);
}

.trade-trigger em.unconfigured {
  color: #b6a47d;
  background: rgba(243, 205, 123, 0.10);
}

.trade-trigger em.off {
  color: var(--dim);
}

.factor-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.factor-trade-mini {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid rgba(201, 245, 107, 0.18);
  border-radius: 5px;
  color: #cce99d;
  background: rgba(201, 245, 107, 0.045);
  font-size: 7px;
  transition: 160ms;
}

.factor-trade-mini:hover {
  border-color: rgba(201, 245, 107, 0.35);
  background: rgba(201, 245, 107, 0.09);
}

.factor-trade-mini .icon {
  width: 10px;
  height: 10px;
}

.trade-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(2, 4, 3, 0.68);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 260ms var(--ease);
}

.trade-backdrop.open {
  opacity: 1;
}

.trade-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 310;
  width: min(492px, 100vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(201, 245, 107, 0.14);
  background:
    radial-gradient(120% 55% at 100% 0%, rgba(201, 245, 107, 0.075), transparent 54%),
    radial-gradient(80% 45% at 0% 100%, rgba(185, 162, 255, 0.04), transparent 55%),
    linear-gradient(180deg, #0d120f 0%, #080b09 100%);
  box-shadow: -35px 0 90px rgba(0, 0, 0, 0.52);
  transform: translateX(103%);
  visibility: hidden;
  transition: transform 340ms var(--ease), visibility 340ms;
}

.trade-sheet.open {
  transform: translateX(0);
  visibility: visible;
}

.trade-sheet-head {
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(8, 12, 9, 0.62);
  backdrop-filter: blur(15px);
}

.trade-sheet-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 570;
  letter-spacing: -0.01em;
}

.trade-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.trade-mode-pill {
  height: 23px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid rgba(243, 205, 123, 0.17);
  border-radius: 99px;
  color: #cfb986;
  background: rgba(243, 205, 123, 0.055);
  font-family: var(--mono);
  font-size: 6.3px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.trade-mode-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 7px rgba(243, 205, 123, 0.55);
}

.trade-mode-pill.live {
  color: #ffb7ae;
  border-color: rgba(255, 115, 103, 0.2);
  background: rgba(255, 115, 103, 0.07);
}

.trade-mode-pill.live i {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 115, 103, 0.65);
}

.trade-mode-pill.off {
  color: var(--dim);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.trade-mode-pill.off i {
  background: var(--dim);
  box-shadow: none;
}

.trade-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-2);
  transition: 160ms;
}

.trade-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.trade-close .icon {
  width: 12px;
  height: 12px;
}

.trade-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 15px 18px 26px;
}

.trade-notice {
  --notice: var(--amber);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--notice) 16%, transparent);
  border-radius: 8px;
  color: color-mix(in srgb, var(--notice) 70%, #d9e1d7);
  background: color-mix(in srgb, var(--notice) 4%, transparent);
  font-size: 8.8px;
  line-height: 1.6;
}

.trade-notice .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex: 0 0 12px;
}

.trade-notice.ok {
  --notice: var(--lime);
}

.trade-notice.danger {
  --notice: var(--red);
}

.trade-account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.trade-account-cell {
  min-width: 0;
  padding: 9px 7px 8px;
  background: #0c110e;
}

.trade-account-cell span {
  display: block;
  color: var(--dim);
  font-size: 6.9px;
  white-space: nowrap;
}

.trade-account-cell b {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: #dfe8db;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-account-cell em {
  display: block;
  margin-top: 2px;
  color: #3f4941;
  font-family: var(--mono);
  font-size: 5.7px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.trade-form-section,
.trade-positions-section {
  margin-bottom: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.018), transparent 45%),
    rgba(12, 17, 13, 0.86);
}

.trade-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.trade-section-head h3 {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 550;
}

.trade-type-label,
.trade-position-count {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 5.9px;
  letter-spacing: 0.06em;
}

.trade-position-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-2);
  font-size: 7px;
}

.trade-symbol-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 143px;
  gap: 8px;
  align-items: end;
}

.trade-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.trade-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--muted-2);
  font-size: 7.9px;
}

.trade-field > span b {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 7.4px;
  font-weight: 500;
}

.trade-field > span em {
  color: var(--coral);
  font-size: 5.8px;
  font-style: normal;
}

.trade-field select,
.trade-field input {
  width: 100%;
  height: 37px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 7px;
  outline: 0;
  color: #dce5d8;
  background: rgba(0, 0, 0, 0.18);
  font-family: var(--mono);
  font-size: 9.6px;
  transition: border-color 150ms, background 150ms;
}

.trade-field select {
  padding: 0 8px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23748078' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.trade-field select option {
  color: #dce5d8;
  background: #101611;
}

.trade-field input {
  padding: 0 9px;
}

.trade-field select:focus,
.trade-field input:focus {
  border-color: rgba(201, 245, 107, 0.28);
  background: rgba(201, 245, 107, 0.025);
}

.trade-input-wrap {
  position: relative;
}

.trade-input-wrap input {
  padding-right: 40px;
}

.trade-input-wrap em {
  position: absolute;
  right: 9px;
  top: 50%;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  transform: translateY(-50%);
}

.trade-mark-box {
  height: 37px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
}

.trade-mark-box span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.trade-mark-box b {
  color: #cdd8c8;
  font-family: var(--mono);
  font-size: 10.2px;
  font-weight: 500;
}

.trade-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.trade-range-wrap {
  height: 37px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 2px;
}

.trade-range-wrap input[type="range"] {
  height: 14px;
  accent-color: var(--lime);
  cursor: pointer;
}

.range-marks {
  display: flex;
  justify-content: space-between;
  color: #3f4941;
  font-family: var(--mono);
  font-size: 7px;
}

.range-marks b {
  color: var(--dim);
  font-weight: 400;
}

.side-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.14);
}

.side-switch button {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-2);
  transition: 160ms;
}

.side-switch button span {
  font-size: 9px;
}

.side-switch button em {
  color: #3f4941;
  font-family: var(--mono);
  font-size: 5.8px;
  font-style: normal;
  letter-spacing: 0.06em;
}

.side-switch button[data-side="LONG"].active {
  color: #d8f5ad;
  border-color: rgba(201, 245, 107, 0.20);
  background: rgba(201, 245, 107, 0.09);
}

.side-switch button[data-side="SHORT"].active {
  color: #ffb3aa;
  border-color: rgba(255, 115, 103, 0.20);
  background: rgba(255, 115, 103, 0.08);
}

.side-switch button.active em {
  color: inherit;
  opacity: 0.65;
}

.trade-estimates {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--dim);
  font-size: 6.8px;
}

.trade-estimates span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.trade-estimates b {
  color: #aab5a8;
  font-family: var(--mono);
  font-size: 7.8px;
  font-weight: 500;
}

.trade-stop-grid {
  margin-top: 10px;
}

.trade-risk-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.12);
}

.trade-risk-line div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.trade-risk-line span {
  color: var(--dim);
  font-size: 6.3px;
}

.trade-risk-line b {
  color: #b5c0b2;
  font-family: var(--mono);
  font-size: 8.9px;
  font-weight: 500;
}

.trade-risk-line div:first-child b {
  color: var(--coral);
}

.trade-error {
  margin: 8px 0 0;
  padding: 7px 8px;
  border: 1px solid rgba(255, 115, 103, 0.16);
  border-radius: 6px;
  color: #e0a49d;
  background: rgba(255, 115, 103, 0.045);
  font-size: 7.4px;
  line-height: 1.5;
}

.trade-preview {
  width: 100%;
  height: 38px;
  margin-top: 10px;
  border: 1px solid rgba(201, 245, 107, 0.27);
  border-radius: 8px;
  color: #e0ffa8;
  background:
    linear-gradient(100deg, rgba(201, 245, 107, 0.14), rgba(201, 245, 107, 0.045));
  font-size: 9.6px;
  letter-spacing: 0.02em;
  transition: 180ms var(--ease);
}

.trade-preview:hover {
  border-color: rgba(201, 245, 107, 0.45);
  background: rgba(201, 245, 107, 0.16);
  box-shadow: 0 0 25px rgba(201, 245, 107, 0.06);
}

.trade-preview:disabled {
  opacity: 0.45;
  cursor: wait;
}

.trade-hint {
  margin: 6px 0 0;
  color: #3f4941;
  font-size: 6.4px;
  line-height: 1.5;
}

.trade-ticket {
  margin-top: 11px;
  padding: 10px;
  border: 1px dashed rgba(201, 245, 107, 0.25);
  border-radius: 9px;
  background:
    repeating-linear-gradient(135deg, rgba(201, 245, 107, 0.018) 0 1px, transparent 1px 7px),
    rgba(201, 245, 107, 0.025);
}

.trade-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #4f5a51;
  font-family: var(--mono);
  font-size: 5.6px;
  letter-spacing: 0.05em;
}

.trade-ticket-head > b {
  color: var(--lime);
  font-size: 7px;
  font-weight: 400;
}

.trade-ticket-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ticket-side {
  padding: 3px 6px;
  border-radius: 4px;
  color: #d9f5ad;
  background: rgba(201, 245, 107, 0.09);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
}

.ticket-side.short {
  color: #ffb5ac;
  background: rgba(255, 115, 103, 0.09);
}

.trade-ticket-main > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.trade-ticket-main strong {
  color: #e4eddf;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

.trade-ticket-main > div span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 5.8px;
}

.ticket-entry {
  margin-left: auto;
  align-items: flex-end;
}

.ticket-entry span {
  color: var(--dim) !important;
  font-size: 5.2px !important;
  letter-spacing: 0.06em;
}

.ticket-entry b {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.trade-ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 8px 0;
}

.trade-ticket-grid div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
}

.trade-ticket-grid span {
  color: var(--dim);
  font-size: 5.8px;
}

.trade-ticket-grid b {
  color: #a7b2a4;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
}

.ticket-warnings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 7px;
  color: #675f4a;
  font-size: 5.8px;
  line-height: 1.45;
}

.ticket-warnings span::before {
  content: "· ";
  color: var(--amber);
}

.ticket-ack {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 0;
  color: #8b958a;
  font-size: 7.3px;
  line-height: 1.5;
  cursor: pointer;
}

.ticket-ack input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--lime);
}

.trade-confirm {
  width: 100%;
  height: 37px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: #171d13;
  background: var(--lime);
  font-size: 9.2px;
  font-weight: 600;
  transition: 160ms;
}

.trade-confirm:hover:not(:disabled) {
  background: var(--lime-bright);
  box-shadow: 0 0 26px rgba(201, 245, 107, 0.14);
}

.trade-confirm:disabled {
  color: #485044;
  background: rgba(255, 255, 255, 0.055);
  cursor: not-allowed;
}

.trade-confirm.live {
  color: #fff1ed;
  background: var(--red);
}

.trade-confirm.live:hover:not(:disabled) {
  background: #ff8b80;
}

.ticket-blocked {
  margin: 7px 0 0;
  color: var(--amber);
  font-size: 6.2px;
  line-height: 1.45;
}

.trade-positions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trade-empty {
  padding: 14px 6px 10px;
  text-align: center;
}

.trade-empty span {
  color: #414b43;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.trade-empty p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 7.4px;
}

.trade-position-card {
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.trade-position-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.trade-position-top strong {
  color: #d8e1d4;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
}

.trade-position-top .ticket-side {
  font-size: 5.8px;
}

.trade-position-top .position-close {
  margin-left: auto;
  height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(255, 115, 103, 0.18);
  border-radius: 5px;
  color: #dfa39b;
  font-size: 6.5px;
  transition: 150ms;
}

.trade-position-top .position-close:hover {
  border-color: rgba(255, 115, 103, 0.38);
  background: rgba(255, 115, 103, 0.07);
}

.trade-position-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 7px;
}

.trade-position-stats span {
  display: block;
  color: var(--dim);
  font-size: 5.5px;
}

.trade-position-stats b {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #a7b1a4;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.trade-position-stats b.positive {
  color: var(--green);
}

.trade-position-stats b.negative {
  color: var(--red);
}

.trade-api-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  color: #4d584f;
  background: rgba(255, 255, 255, 0.012);
}

.trade-api-note .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: #5a675b;
}

.trade-api-note p {
  margin: 0;
  font-size: 6.2px;
  line-height: 1.55;
}

.trade-api-note code {
  color: #849580;
  font-family: var(--mono);
  font-size: 5.9px;
}

.confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 4, 3, 0.75);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms;
}

.confirm-layer.open {
  opacity: 1;
}

.confirm-card {
  width: min(390px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    radial-gradient(120% 100% at 0 0, rgba(255, 115, 103, 0.07), transparent 50%),
    #0e1410;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(6px) scale(0.985);
  transition: transform 220ms var(--ease);
}

.confirm-layer.open .confirm-card {
  transform: none;
}

.confirm-card h3 {
  margin: 5px 0 8px;
  font-size: 16px;
  font-weight: 550;
}

.confirm-card p {
  margin: 0;
  color: #8b968b;
  font-size: 9px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 17px;
}

.confirm-actions button {
  height: 31px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-2);
  font-size: 8px;
  transition: 150ms;
}

.confirm-actions button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.confirm-actions #confirmAccept {
  border-color: rgba(255, 115, 103, 0.3);
  color: #ffd0ca;
  background: rgba(255, 115, 103, 0.12);
}

.confirm-actions #confirmAccept:hover {
  background: rgba(255, 115, 103, 0.2);
}

.confirm-actions #confirmAccept.safe {
  border-color: rgba(201, 245, 107, 0.25);
  color: #d9f3ae;
  background: rgba(201, 245, 107, 0.09);
}

body.trade-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1380px) {
  .trade-trigger span {
    display: none;
  }

  .trade-trigger {
    padding: 0 7px;
  }
}

@media (max-width: 1200px) {
  .trade-trigger em {
    display: none;
  }
}

@media (max-width: 620px) {
  .trade-sheet {
    width: 100vw;
  }

  .trade-account-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trade-symbol-line {
    grid-template-columns: minmax(0, 1fr) 120px;
  }
}

.trade-result {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(201, 245, 107, 0.17);
  border-radius: 8px;
  color: #b6cc9b;
  background: rgba(201, 245, 107, 0.04);
  font-size: 7.6px;
  line-height: 1.55;
}

.trade-result strong {
  display: block;
  margin-bottom: 3px;
  color: #dcf3b3;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 500;
}

.trade-result.danger {
  border-color: rgba(255, 115, 103, 0.2);
  color: #d8a39c;
  background: rgba(255, 115, 103, 0.05);
}

.trade-result.danger strong {
  color: #ffc6bf;
}

.log-line[data-type="ORDER"] .log-type {
  color: var(--mint);
}

.log-line[data-type="ORDER"] .log-text {
  color: #b9d8c6;
}

.trade-trigger.live-mode {
  border-color: rgba(255, 115, 103, 0.28);
  color: #ffc4bc;
  background: rgba(255, 115, 103, 0.06);
}

html.non-mac-shell .titlebar {
  padding-left: 20px;
}

.trade-notice code {
  color: #b7c7a6;
  font-family: var(--mono);
  font-size: 0.95em;
}

/* ── DeepSeek autonomous desk ──────────────────────────────────────── */
.auto-trigger {
  height: 30px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(185, 162, 255, 0.20);
  border-radius: 9px;
  color: #d9ccff;
  background: linear-gradient(110deg, rgba(185, 162, 255, 0.075), rgba(185, 162, 255, 0.015));
  transition: 180ms var(--ease);
}

.auto-trigger:hover {
  border-color: rgba(185, 162, 255, 0.38);
  background: rgba(185, 162, 255, 0.11);
}

.auto-trigger .icon {
  width: 13px;
  height: 13px;
}

.auto-trigger span {
  font-size: 9px;
  white-space: nowrap;
}

.auto-trigger em {
  padding: 2px 5px;
  border-radius: 3px;
  color: #a99bcc;
  background: rgba(185, 162, 255, 0.09);
  font-family: var(--mono);
  font-size: 5.7px;
  font-style: normal;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.auto-trigger em.running {
  color: #e8ddff;
  background: rgba(185, 162, 255, 0.19);
}

.auto-trigger em.live {
  color: #ffb7ae;
  background: rgba(255, 115, 103, 0.14);
}

.auto-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(2, 4, 3, 0.70);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 260ms var(--ease);
}

.auto-backdrop.open {
  opacity: 1;
}

.auto-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 330;
  width: min(680px, 100vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(185, 162, 255, 0.15);
  background:
    radial-gradient(120% 50% at 100% 0%, rgba(185, 162, 255, 0.09), transparent 55%),
    radial-gradient(80% 50% at 0% 100%, rgba(201, 245, 107, 0.035), transparent 55%),
    linear-gradient(180deg, #0e1110 0%, #080a09 100%);
  box-shadow: -35px 0 90px rgba(0, 0, 0, 0.55);
  transform: translateX(103%);
  visibility: hidden;
  transition: transform 340ms var(--ease), visibility 340ms;
}

.auto-sheet.open {
  transform: translateX(0);
  visibility: visible;
}

.auto-sheet-head {
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(8, 11, 9, 0.62);
  backdrop-filter: blur(15px);
}

.auto-sheet-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 570;
  letter-spacing: -0.01em;
}

.auto-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.auto-provider-pill {
  height: 23px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid rgba(185, 162, 255, 0.18);
  border-radius: 99px;
  color: #b4a3e2;
  background: rgba(185, 162, 255, 0.055);
  font-family: var(--mono);
  font-size: 6.2px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.auto-provider-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 7px rgba(185, 162, 255, 0.7);
}

.auto-provider-pill.ready {
  color: #d6c8ff;
  border-color: rgba(185, 162, 255, 0.3);
}

.auto-provider-pill.off {
  color: var(--dim);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.auto-provider-pill.off i {
  background: var(--dim);
  box-shadow: none;
}

.auto-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 15px 18px 26px;
}

.auto-notice {
  --notice: var(--amber);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--notice) 17%, transparent);
  border-radius: 8px;
  color: color-mix(in srgb, var(--notice) 68%, #d9e1d7);
  background: color-mix(in srgb, var(--notice) 4%, transparent);
  font-size: 8.6px;
  line-height: 1.6;
}

.auto-notice .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex: 0 0 12px;
}

.auto-notice.ok {
  --notice: var(--lime);
}

.auto-notice.danger {
  --notice: var(--red);
}

.auto-notice code {
  color: #c4d3b4;
  font-family: var(--mono);
  font-size: 0.94em;
}

.auto-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.auto-metric {
  min-width: 0;
  padding: 9px 9px 8px;
  background: #0c100e;
}

.auto-metric span {
  display: block;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.auto-metric b {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #dfe8db;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-metric b.on {
  color: var(--violet);
}

.auto-metric em {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #454f47;
  font-family: var(--mono);
  font-size: 5.4px;
  font-style: normal;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(225px, 0.86fr);
  gap: 10px;
  margin-bottom: 10px;
}

.auto-analysis-card,
.auto-control-card,
.auto-position-section,
.auto-log-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.018), transparent 45%),
    rgba(12, 16, 13, 0.88);
}

.auto-analysis-card {
  padding: 13px;
}

.auto-control-card {
  padding: 13px;
  border-color: rgba(185, 162, 255, 0.12);
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(185, 162, 255, 0.06), transparent 56%),
    rgba(12, 16, 13, 0.9);
}

.auto-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.auto-section-head h3 {
  margin: 3px 0 0;
  font-size: 12.5px;
  font-weight: 550;
}

.auto-analyze {
  height: 25px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid rgba(185, 162, 255, 0.22);
  border-radius: 5px;
  color: #d4c6ff;
  background: rgba(185, 162, 255, 0.065);
  font-size: 7px;
  transition: 160ms;
}

.auto-analyze:hover {
  border-color: rgba(185, 162, 255, 0.42);
  background: rgba(185, 162, 255, 0.11);
}

.auto-analyze:disabled {
  opacity: 0.45;
  cursor: wait;
}

.auto-analyze .icon {
  width: 10px;
  height: 10px;
}

.auto-decision {
  min-height: 210px;
}

.auto-empty {
  display: grid;
  place-items: center;
  min-height: 205px;
  padding: 20px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.065);
  border-radius: 8px;
}

.auto-empty.small {
  min-height: 66px;
  padding: 10px;
}

.auto-empty span {
  color: #4d5750;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.auto-empty p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 7.4px;
  line-height: 1.5;
}

.ai-decision-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.ai-risk {
  padding: 2px 5px;
  border: 1px solid rgba(201, 245, 107, 0.18);
  border-radius: 3px;
  color: var(--lime);
  background: rgba(201, 245, 107, 0.045);
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.05em;
}

.ai-risk.medium {
  color: var(--amber);
  border-color: rgba(243, 205, 123, 0.2);
  background: rgba(243, 205, 123, 0.045);
}

.ai-risk.high {
  color: var(--coral);
  border-color: rgba(255, 136, 119, 0.2);
  background: rgba(255, 136, 119, 0.045);
}

.ai-decision-top span:last-child {
  margin-left: auto;
  color: #454f47;
  font-family: var(--mono);
  font-size: 5.5px;
  white-space: nowrap;
}

.ai-market-view {
  margin: 0 0 9px;
  color: #9ea99e;
  font-size: 8.5px;
  line-height: 1.65;
}

.ai-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-action-card {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
}

.ai-action-card.open {
  border-color: rgba(201, 245, 107, 0.13);
  background: rgba(201, 245, 107, 0.025);
}

.ai-action-card.close {
  border-color: rgba(255, 136, 119, 0.14);
  background: rgba(255, 136, 119, 0.025);
}

.ai-action-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-action-type {
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--lime);
  background: rgba(201, 245, 107, 0.08);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.04em;
}

.ai-action-card.close .ai-action-type {
  color: var(--coral);
  background: rgba(255, 136, 119, 0.08);
}

.ai-action-head strong {
  color: #dce6d8;
  font-family: var(--mono);
  font-size: 8.6px;
  font-weight: 500;
}

.ai-action-side {
  color: #81907f;
  font-family: var(--mono);
  font-size: 5.8px;
}

.ai-action-head em {
  margin-left: auto;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 7.2px;
  font-style: normal;
}

.ai-action-card.close .ai-action-head em {
  color: var(--coral);
}

.ai-action-rationale {
  margin: 5px 0 0;
  color: #7f8b80;
  font-size: 7px;
  line-height: 1.5;
}

.ai-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
  color: #576259;
  font-family: var(--mono);
  font-size: 5.6px;
}

.ai-action-meta b {
  color: #829080;
  font-weight: 400;
}

.ai-executed {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 7px;
}

.ai-executed span {
  padding: 2px 5px;
  border: 1px solid rgba(201, 245, 107, 0.13);
  border-radius: 3px;
  color: #9cbf7a;
  background: rgba(201, 245, 107, 0.035);
  font-family: var(--mono);
  font-size: 5.6px;
}

.ai-reviews {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.ai-reviews-head {
  margin-bottom: 4px;
  color: #4c574f;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.06em;
}

.ai-review {
  display: grid;
  grid-template-columns: 58px 36px 28px minmax(0, 1fr);
  gap: 5px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  color: #6e7b70;
  font-size: 6.4px;
}

.ai-review strong {
  color: #a8b4a4;
  font-family: var(--mono);
  font-size: 6.7px;
  font-weight: 500;
}

.ai-review span {
  font-family: var(--mono);
  font-size: 5.6px;
  text-transform: uppercase;
}

.ai-review em {
  color: #5d6a5e;
  font-family: var(--mono);
  font-size: 5.8px;
  font-style: normal;
}

.ai-review p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-risk-notes {
  margin-top: 7px;
  padding: 6px 7px;
  border: 1px solid rgba(243, 205, 123, 0.1);
  border-radius: 5px;
  color: #77725a;
  background: rgba(243, 205, 123, 0.025);
  font-size: 6.2px;
  line-height: 1.55;
}

.ai-risk-notes b {
  color: #a18f62;
  font-family: var(--mono);
  font-size: 5.4px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.auto-control-status {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.auto-control-status > b {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.auto-control-status > b.on {
  color: var(--violet);
  text-shadow: 0 0 22px rgba(185, 162, 255, 0.2);
}

.auto-control-status p {
  margin: 5px 0 0;
  color: #69756b;
  font-size: 7px;
  line-height: 1.55;
}

.auto-toggle,
.auto-run {
  width: 100%;
  height: 34px;
  margin-top: 9px;
  border-radius: 7px;
  font-size: 8.4px;
  transition: 160ms var(--ease);
}

.auto-toggle {
  border: 1px solid rgba(185, 162, 255, 0.3);
  color: #e5dcff;
  background: rgba(185, 162, 255, 0.12);
}

.auto-toggle:hover:not(:disabled) {
  background: rgba(185, 162, 255, 0.2);
  box-shadow: 0 0 24px rgba(185, 162, 255, 0.08);
}

.auto-toggle.running {
  border-color: rgba(255, 115, 103, 0.3);
  color: #ffc7c0;
  background: rgba(255, 115, 103, 0.1);
}

.auto-toggle.running:hover:not(:disabled) {
  background: rgba(255, 115, 103, 0.17);
}

.auto-toggle.live {
  border-color: rgba(255, 115, 103, 0.38);
  color: #fff0ed;
  background: rgba(255, 115, 103, 0.2);
}

.auto-toggle:disabled,
.auto-run:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.auto-run {
  margin-top: 6px;
  border: 1px solid var(--line);
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.025);
}

.auto-run:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.auto-limit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 9px;
}

.auto-limit-grid div {
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.1);
}

.auto-limit-grid span {
  display: block;
  color: var(--dim);
  font-size: 5.5px;
  white-space: nowrap;
}

.auto-limit-grid b {
  display: block;
  margin-top: 2px;
  color: #9da99b;
  font-family: var(--mono);
  font-size: 7.4px;
  font-weight: 500;
}

.auto-control-note {
  margin: 8px 0 0;
  color: #414b43;
  font-size: 5.9px;
  line-height: 1.55;
}

.auto-position-section,
.auto-log-section {
  padding: 12px 13px;
  margin-bottom: 10px;
}

.auto-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.auto-positions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-pos-card {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.016);
}

.auto-pos-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.auto-pos-top .ticket-side {
  font-size: 5.6px;
}

.auto-pos-top strong {
  color: #ccd7c8;
  font-family: var(--mono);
  font-size: 8.2px;
  font-weight: 500;
}

.auto-pos-top span:last-child {
  margin-left: auto;
  color: #59645b;
  font-family: var(--mono);
  font-size: 5.5px;
}

.auto-pos-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 6px;
}

.auto-pos-stats span {
  display: block;
  color: #475149;
  font-size: 5.3px;
}

.auto-pos-stats b {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #8d9a8c;
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.auto-pos-stats b.positive {
  color: var(--green);
}

.auto-pos-stats b.negative {
  color: var(--red);
}

.auto-live-dot {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #566258;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.06em;
}

.auto-live-dot i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet);
  animation: breathe 2.4s ease-in-out infinite;
}

.auto-logs {
  max-height: 145px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 6.2px;
  line-height: 1.5;
}

.auto-log-line {
  display: grid;
  grid-template-columns: 52px 32px minmax(0, 1fr);
  gap: 5px;
  padding: 2.5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.022);
}

.auto-log-line span:first-child {
  color: #3e4840;
}

.auto-log-line b {
  font-size: 5.6px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.auto-log-line span:last-child {
  color: #7f8b80;
  overflow-wrap: anywhere;
}

.auto-log-line[data-type="AI"] b { color: var(--violet); }
.auto-log-line[data-type="ORDER"] b { color: var(--mint); }
.auto-log-line[data-type="RISK"] b { color: var(--amber); }
.auto-log-line[data-type="SKIP"] b { color: #707c70; }
.auto-log-line[data-type="SYS"] b { color: var(--blue); }

.auto-config-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(185, 162, 255, 0.09);
  border-radius: 8px;
  background: rgba(185, 162, 255, 0.025);
}

.auto-config-note .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex: 0 0 12px;
  color: #7b6a9e;
}

.auto-config-note b {
  display: block;
  color: #a99bd0;
  font-size: 6.8px;
  font-weight: 500;
}

.auto-config-note p {
  margin: 3px 0 0;
  color: #5c5766;
  font-size: 7px;
  line-height: 1.55;
}

.auto-config-note code {
  color: #9388a9;
  font-family: var(--mono);
  font-size: 0.95em;
}

body.auto-open {
  overflow: hidden;
}

@media (max-width: 1380px) {
  .auto-trigger span {
    display: none;
  }

  .auto-trigger {
    padding: 0 7px;
  }
}

@media (max-width: 1200px) {
  .auto-trigger em {
    display: none;
  }
}

@media (max-width: 760px) {
  .auto-sheet {
    width: 100vw;
  }

  .auto-layout {
    grid-template-columns: 1fr;
  }

  .auto-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.auto-panic {
  width: 100%;
  height: 31px;
  margin-top: 6px;
  border: 1px solid rgba(255, 115, 103, 0.18);
  border-radius: 7px;
  color: #d9a29a;
  background: rgba(255, 115, 103, 0.045);
  font-size: 7.4px;
  transition: 160ms;
}

.auto-panic:hover:not(:disabled) {
  border-color: rgba(255, 115, 103, 0.38);
  color: #ffc8c1;
  background: rgba(255, 115, 103, 0.10);
}

.auto-panic:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.signal-side,
.factor-side {
  padding: 1px 3px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.03em;
  vertical-align: 1px;
}

.signal-side.long,
.factor-side.long {
  color: var(--green);
  background: rgba(143, 227, 136, 0.09);
}

.signal-side.short,
.factor-side.short {
  color: var(--coral);
  background: rgba(255, 136, 119, 0.10);
}


.icon-button.muted {
  opacity: 0.42;
}

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-trigger {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin: 0 1px 0 2px;
}

.settings-trigger:hover {
  color: var(--lime);
  border-color: rgba(201, 245, 107, 0.32);
  background: rgba(201, 245, 107, 0.06);
}

.settings-trigger .icon {
  width: 14px;
  height: 14px;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(2, 5, 4, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.settings-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-sheet {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 50%;
  width: min(780px, calc(100vw - 40px));
  height: min(830px, calc(100vh - 40px));
  transform: translate(-50%, -48%) scale(0.985);
  display: flex;
  flex-direction: column;
  background: #0a0e0c;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.settings-sheet.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.settings-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(201, 245, 107, 0.045), transparent);
}

.settings-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.settings-scroll {
  overflow-y: auto;
  padding: 0 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 245, 107, 0.22) transparent;
}

.settings-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 9px 10px;
  border: 1px solid rgba(201, 245, 107, 0.16);
  border-radius: 7px;
  background: rgba(201, 245, 107, 0.035);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.settings-notice .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: var(--lime);
  margin-top: 1px;
}

.settings-section {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.settings-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-section-head h3 {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 600;
}

.settings-pill {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
}

.settings-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-wide {
  grid-column: 1 / -1;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.settings-field > span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.settings-field > span em {
  color: var(--dim);
  font-style: normal;
  font-size: 7px;
}

.settings-field input,
.settings-field select {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #080c0a;
  color: var(--text);
  font-family: var(--mono);
  font-size: 9px;
  outline: none;
}

.settings-field input::placeholder {
  color: #4b5a50;
}

.settings-field input:focus,
.settings-field select:focus {
  border-color: rgba(201, 245, 107, 0.45);
  box-shadow: 0 0 0 2px rgba(201, 245, 107, 0.06);
}

.settings-field select option {
  background: #0b100d;
  color: var(--text);
}

.settings-checks {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.settings-check input {
  width: 13px;
  height: 13px;
  margin: 2px 0 0;
  accent-color: var(--lime);
  flex: 0 0 auto;
}

.settings-check span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-check b {
  color: var(--text);
  font-size: 9px;
  font-weight: 500;
}

.settings-check em {
  color: var(--dim);
  font-size: 7px;
  font-style: normal;
  line-height: 1.4;
}

.settings-check.compact b {
  font-size: 8px;
}

.settings-key-status {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.5;
  text-align: right;
}

.settings-error {
  margin: 12px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 136, 119, 0.3);
  border-radius: 5px;
  background: rgba(255, 136, 119, 0.06);
  color: var(--coral);
  font-size: 9px;
  line-height: 1.5;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: #0a0e0c;
}

.settings-footer > span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
}

.settings-footer > span b {
  color: var(--muted);
  font-weight: 400;
}

.settings-footer > div {
  display: flex;
  gap: 7px;
}

.settings-reset,
.settings-save {
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 8px;
  cursor: pointer;
}

.settings-reset {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.settings-reset:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.settings-save {
  border: 1px solid var(--lime);
  background: var(--lime);
  color: #0a0d08;
  font-weight: 700;
}

.settings-save:disabled {
  opacity: 0.45;
  cursor: wait;
}

@media (max-width: 760px) {
  .settings-sheet {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .settings-grid,
  .settings-grid-3 {
    grid-template-columns: 1fr;
  }

  .settings-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.settings-notice.danger {
  border-color: rgba(255, 136, 119, 0.3);
  background: rgba(255, 136, 119, 0.06);
  color: var(--coral);
}

.auto-sync {
  border-color: rgba(201, 245, 107, 0.2);
}


/* NEXUS web client: AI-only mode */
#tradeTrigger[hidden], #factorTradeButton[hidden], #settingsTrigger[hidden] { display: none !important; }


/* NEXUS web client: manual execution is disabled; keep the account sheet read-only. */
#tradeSheet .trade-form-section,
#tradeSheet .trade-api-note,
#tradeSheet .position-close,
#tradeSheet .trade-result { display: none !important; }
#tradeSheet .trade-scroll { padding-bottom: 28px; }
