:root {
  color-scheme: dark;
  --bg: #030407;
  --panel: #070a13;
  --panel-soft: #0c111d;
  --line: #20283d;
  --text: #f4f5fb;
  --muted: #969aaa;
  --cyan: #63edf2;
  --magenta: #e63e91;
  --gold: #e6bd42;
  --green: #56d992;
  --red: #ff6076;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(99, 237, 242, 0.06), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.screen {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.topbar,
.controls,
.quick-strip article,
.overnight-panel,
.overnight-grid article,
.accuracy-panel,
.summary-grid article,
.today-grid article,
.heatmap-card,
.panel,
.csv-panel,
.setup-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  border-color: #263249;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 6px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1;
}

h2 {
  font-size: 16px;
}

.spot-copy {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 30px);
}

.feed-state {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  min-width: 250px;
}

.feed-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 16px rgba(86, 217, 146, 0.85);
}

.feed-dot.bad {
  background: var(--red);
  box-shadow: 0 0 16px rgba(255, 96, 118, 0.85);
}

.quick-strip {
  display: grid;
  grid-template-columns: 0.85fr 1fr 0.8fr;
  gap: 12px;
  margin-top: 14px;
}

.quick-strip article {
  min-height: 78px;
  padding: 14px;
  display: grid;
  align-content: space-between;
}

.quick-strip span {
  color: var(--muted);
  font-size: 12px;
}

.quick-strip strong {
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.controls {
  display: grid;
  grid-template-columns: 150px 150px 130px auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding: 14px;
}

.setup-panel {
  margin-top: 10px;
  padding: 0;
}

.setup-panel summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 14px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-radius: 0;
}

.segmented button.active {
  background: var(--cyan);
  color: #061113;
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

select,
input,
button,
textarea {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

select,
input,
button {
  height: 42px;
  border-radius: 8px;
  padding: 0 12px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  color: var(--text);
  white-space: nowrap;
}

button {
  cursor: pointer;
}

.action {
  background: var(--cyan);
  color: #061113;
  border-color: var(--cyan);
  font-weight: 800;
}

button.is-loading {
  opacity: 0.86;
  pointer-events: none;
  position: relative;
}

button.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

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

button:active {
  transform: translateY(1px);
}

.csv-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.hidden {
  display: none;
}

textarea {
  min-height: 128px;
  resize: vertical;
  border-radius: 8px;
  padding: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.summary-grid article {
  min-height: 106px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.summary-grid span,
.today-grid span,
.summary-grid small,
.today-grid small,
th,
td {
  color: var(--muted);
}

.summary-grid strong {
  font-size: clamp(24px, 2.8vw, 40px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.today-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 12px;
  margin-top: 14px;
}

.today-grid article {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.today-grid strong {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.overnight-panel {
  margin-top: 14px;
  padding: 16px;
}

.gameplan-panel {
  margin-top: 14px;
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(230, 189, 66, 0.13), transparent 38%),
    var(--panel);
  border: 1px solid rgba(230, 189, 66, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 34px var(--shadow);
}

.gameplan-body {
  display: grid;
  grid-template-columns: 0.82fr 0.92fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.gameplan-body article {
  min-height: 86px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
}

.gameplan-body article.high-conviction {
  border-color: rgba(86, 217, 146, 0.58);
  border-left-color: var(--green);
  box-shadow: 0 0 24px rgba(86, 217, 146, 0.12);
}

.gameplan-body article.needs-confirmation {
  border-color: rgba(230, 189, 66, 0.42);
}

.gameplan-body span,
.gameplan-body small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.gameplan-body strong {
  display: block;
  margin: 7px 0 6px;
  font-size: clamp(16px, 1.8vw, 22px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.motion-panel {
  margin-top: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px var(--shadow);
}

.motion-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.motion-board article {
  overflow: hidden;
  background: #050913;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.motion-lane-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.motion-lane-head strong {
  color: var(--text);
  font-size: 16px;
}

.motion-lane {
  display: grid;
  gap: 2px;
  padding: 6px;
}

.motion-row {
  position: relative;
  min-height: 36px;
  display: grid;
  grid-template-columns: 70px 48px 42px minmax(78px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  border-radius: 5px;
  background: #0d1622;
  color: var(--text);
  font-size: 13px;
}

.motion-fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  opacity: 0.75;
}

.motion-row > *:not(.motion-fill) {
  position: relative;
  z-index: 1;
}

.motion-row strong,
.motion-row b {
  font-variant-numeric: tabular-nums;
}

.motion-row b {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.motion-tag {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 20px;
  border-radius: 999px;
  color: #061113;
  background: rgba(255, 255, 255, 0.84);
  font-size: 10px;
  font-weight: 900;
}

.motion-row.pin .motion-fill {
  background: linear-gradient(90deg, rgba(99, 237, 242, 0.92), rgba(99, 237, 242, 0.2));
}

.motion-row.motion .motion-fill {
  background: linear-gradient(90deg, rgba(230, 62, 145, 0.92), rgba(230, 62, 145, 0.2));
}

.motion-row.major .motion-fill {
  background: linear-gradient(90deg, rgba(230, 189, 66, 0.95), rgba(86, 217, 146, 0.28));
}

.motion-row.major .motion-tag {
  background: var(--gold);
}

.motion-row.at-spot {
  outline: 2px solid rgba(244, 245, 251, 0.88);
}

.motion-empty {
  min-height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel-soft);
  border-radius: 5px;
  font-size: 12px;
}

.session-note {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.overnight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.overnight-grid article {
  min-height: 98px;
  padding: 12px;
  display: grid;
  align-content: space-between;
}

.overnight-grid span,
.overnight-grid small {
  color: var(--muted);
}

.overnight-grid strong {
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.positive {
  color: var(--cyan);
}

.negative {
  color: var(--magenta);
}

.ok {
  color: var(--cyan);
}

.warn {
  color: var(--gold);
}

.bad {
  color: var(--red);
}

.heatmap-card {
  margin-top: 14px;
  padding: 18px 18px 20px;
}

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

.heatmap-head span {
  color: var(--muted);
  font-size: 12px;
}

.map-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.map-tools button {
  height: 38px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
}

.map-tools button.active {
  background: var(--cyan);
  color: #061113;
  font-weight: 900;
}

.level-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.level-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  padding: 12px;
}

.level-card.neg {
  border-left-color: var(--magenta);
}

.level-card.major {
  box-shadow: 0 0 26px rgba(241, 191, 87, 0.18);
}

.level-card-top,
.level-card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.level-card-top {
  margin-bottom: 10px;
}

.level-card h3 {
  margin: 0;
  font-size: 19px;
}

.level-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #120f03;
  font-size: 11px;
  font-weight: 900;
}

.level-card-row {
  color: var(--muted);
  font-size: 13px;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.level-card-row strong {
  color: var(--text);
}

.map-hint {
  display: none;
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.compact-secondary {
  opacity: 0.92;
}

body.edge-mode .compact-secondary {
  display: none;
}

body.edge-mode .heatmap-card.show-grid .level-cards {
  display: none;
}

body.classic-mode .level-cards {
  display: none;
}

body.classic-mode .heatmap-scroll,
body.classic-mode .compact-secondary {
  display: block;
}

body.classic-mode .legend {
  display: flex;
}

.heatmap-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 7px;
  scrollbar-color: var(--line) transparent;
}

.heatmap-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.2;
  min-height: 430px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 7px;
}

.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 28px);
}

.legend i {
  display: inline-block;
  width: 38px;
  height: 16px;
  border-radius: 8px;
  margin-right: 10px;
  vertical-align: middle;
}

.legend .pos {
  background: var(--cyan);
}

.legend .neg {
  background: var(--magenta);
}

.legend .spot {
  width: 38px;
  height: 0;
  border-top: 3px dashed var(--gold);
  background: transparent;
  border-radius: 0;
}

.lower-grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title button {
  height: 34px;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-actions button {
  height: 34px;
}

.signals {
  display: grid;
  gap: 10px;
}

.signal {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
}

.signal strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.trade-panel {
  grid-column: 1 / -1;
}

.trade-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.trade-plan {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.trade-step {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 88px;
  padding: 12px;
}

.trade-step span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.trade-step strong {
  display: block;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.stale {
  color: var(--gold);
}

.accuracy-panel {
  margin-top: 14px;
  padding: 16px;
}

.accuracy-list {
  display: grid;
  gap: 8px;
}

.accuracy-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
}

.accuracy-item strong {
  color: var(--text);
}

.accuracy-item.ok strong {
  color: var(--cyan);
}

.accuracy-item.warn strong {
  color: var(--gold);
}

.accuracy-item.bad strong {
  color: var(--red);
}

.contract-panel {
  grid-column: 1 / -1;
}

.contract-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.contract-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  padding: 12px;
}

.contract-card.put {
  border-left-color: var(--magenta);
}

.contract-top,
.contract-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.contract-top {
  margin-bottom: 10px;
}

.contract-card h3 {
  margin: 0;
  font-size: 18px;
}

.contract-card .pill {
  min-width: 34px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--cyan);
  color: #061113;
  font-weight: 900;
}

.contract-card.put .pill {
  background: var(--magenta);
  color: var(--text);
}

.contract-row {
  color: var(--muted);
  font-size: 13px;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contract-row strong {
  color: var(--text);
}

.mobile-actions,
.app-tabbar {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th:first-child,
td:first-child {
  text-align: left;
}

@media (max-width: 980px) {
  .controls,
  .quick-strip,
  .overnight-grid,
  .gameplan-body,
  .contract-cards,
  .summary-grid,
  .today-grid,
  .lower-grid {
    grid-template-columns: 1fr 1fr;
  }

  .endpoint,
  .quote-endpoint,
  .heatmap-card,
  .panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  body {
    background:
      linear-gradient(180deg, rgba(99, 237, 242, 0.08), transparent 220px),
      var(--bg);
  }

  .screen {
    width: 100%;
    padding: 0 8px 150px;
  }

  .topbar,
  .controls,
  .summary-grid,
  .today-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    margin: 8px 0 0;
    padding: 14px;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 4px;
  }

  h1 {
    font-size: 27px;
  }

  .spot-copy {
    font-size: 18px;
  }

  .controls,
  .quick-strip,
  .summary-grid,
  .today-grid,
  .heatmap-card,
  .lower-grid {
    margin-top: 10px;
  }

  .feed-state {
    justify-content: flex-start;
    min-width: 0;
    gap: 7px;
    font-size: 12px;
  }

  .quick-strip {
    grid-template-columns: 1fr;
  }

  .quick-strip article {
    min-height: 68px;
    padding: 12px;
  }

  .switch-row {
    height: auto;
    min-height: 34px;
  }

  select,
  input,
  button {
    height: 46px;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .summary-grid article,
  .today-grid article {
    min-height: 88px;
    padding: 13px;
  }

  .summary-grid strong,
  .today-grid strong {
    font-size: 22px;
  }

  .heatmap-card {
    padding: 12px;
  }

  .accuracy-panel {
    padding: 12px;
  }

  .accuracy-item {
    display: grid;
  }

  .overnight-panel {
    padding: 12px;
  }

  .gameplan-panel {
    padding: 12px;
  }

  .gameplan-body {
    grid-template-columns: 1fr;
  }

  .gameplan-body article {
    min-height: 76px;
  }

  .motion-panel {
    padding: 12px;
  }

  .motion-board {
    grid-template-columns: 1fr;
  }

  .motion-row {
    min-height: 40px;
    grid-template-columns: 68px 44px 38px minmax(74px, 1fr);
    font-size: 12px;
  }

  .overnight-grid {
    grid-template-columns: 1fr 1fr;
  }

  .overnight-grid article {
    min-height: 86px;
  }

  .heatmap-head {
    align-items: flex-start;
    display: grid;
  }

  .map-tools {
    width: 100%;
  }

  .level-cards {
    grid-template-columns: 1fr;
  }

  .map-hint {
    display: block;
  }

  .compact-secondary {
    display: none;
  }

  body.classic-mode .compact-secondary {
    display: block;
  }

  body.classic-mode .heatmap-card:not(.show-grid) .heatmap-scroll,
  body.classic-mode .heatmap-card:not(.show-grid) .legend {
    display: flex;
  }

  body.classic-mode .heatmap-card:not(.show-grid) .heatmap-scroll {
    display: block;
  }

  body.classic-mode .heatmap-card .level-cards {
    display: none;
  }

  body.classic-mode .map-hint {
    display: block;
  }

  .heatmap-wrap {
    width: 720px;
    min-height: 440px;
    aspect-ratio: 16 / 9.4;
  }

  .legend {
    gap: 14px;
    justify-content: flex-start;
    font-size: 15px;
  }

  .legend i {
    width: 28px;
    height: 12px;
    margin-right: 6px;
  }

  th,
  td {
    padding: 9px 4px;
    font-size: 13px;
  }

  .trade-controls,
  .trade-plan,
  .contract-cards {
    grid-template-columns: 1fr;
  }

  .trade-step {
    min-height: 74px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .mobile-actions {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 58px);
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    background: rgba(7, 10, 19, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    backdrop-filter: blur(12px);
  }

  .mobile-actions button {
    height: 42px;
    padding: 0 8px;
    font-size: 13px;
  }

  .app-tabbar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: env(safe-area-inset-bottom, 8px);
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    background: rgba(7, 10, 19, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    backdrop-filter: blur(14px);
  }

  .app-tabbar button {
    height: 42px;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 800;
  }
}


/* Focused Edge UI: one decisive motion area, readable map, compact scanner */
.motion-board-focus {
  grid-template-columns: 1fr;
}

.motion-focus-card {
  background: linear-gradient(135deg, rgba(230, 189, 66, 0.08), rgba(86, 217, 146, 0.04)) !important;
  border-color: rgba(230, 189, 66, 0.38) !important;
}

.motion-focus-lane {
  padding: 10px;
  gap: 8px;
}

.motion-hero-head,
.motion-hero-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.motion-hero-head {
  padding: 2px 4px;
}

.motion-hero-head strong {
  color: var(--text);
  font-size: 15px;
}

.motion-hero-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(74px, 0.7fr) minmax(122px, 1fr) minmax(120px, 1fr) minmax(90px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(255, 218, 74, 0.78);
  border-radius: 7px;
  color: #090b0c;
  background: linear-gradient(90deg, #f2cd3f, #f9df62 52%, #d6b730);
  box-shadow: 0 0 24px rgba(230, 189, 66, 0.22);
  font-variant-numeric: tabular-nums;
}

.motion-hero-row.negative-zone {
  background: linear-gradient(90deg, #f0c83c, #ffd95b 52%, #e5aa48);
}

.motion-hero-strike {
  font-size: clamp(20px, 2.4vw, 30px);
}

.motion-score {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  color: #eafff3;
  background: #075537;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.motion-direction {
  font-weight: 800;
}

.motion-hero-row b {
  justify-self: end;
  font-size: clamp(16px, 2vw, 23px);
  white-space: nowrap;
}

.motion-hero-note {
  padding: 0 4px 2px;
}

.contract-panel {
  padding-top: 12px;
  padding-bottom: 12px;
}

.contract-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.contract-card {
  padding: 9px 10px;
}

.contract-top {
  margin-bottom: 6px;
}

.contract-card h3 {
  font-size: 15px;
}

.contract-row {
  padding: 4px 0;
  font-size: 12px;
}

.heatmap-scroll {
  border: 1px solid rgba(99, 237, 242, 0.14);
  background: #050913;
}

@media (max-width: 680px) {
  .motion-hero-row {
    min-height: 70px;
    grid-template-columns: 0.7fr 1.1fr;
    padding: 10px;
  }

  .motion-direction {
    font-size: 12px;
  }

  .motion-hero-row b {
    justify-self: end;
  }

  .motion-hero-note {
    align-items: flex-start;
    font-size: 11px;
  }

  .heatmap-card {
    overflow: hidden;
  }

  .heatmap-scroll {
    overflow-x: hidden;
  }

  .heatmap-wrap {
    width: 100%;
    min-height: 510px;
    aspect-ratio: auto;
  }

  .map-hint {
    display: none;
  }

  .contract-cards {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .contract-card {
    min-width: 0;
    padding: 8px;
  }

  .contract-card h3 {
    font-size: 13px;
    line-height: 1.2;
  }

  .contract-card .pill {
    min-width: 28px;
    padding: 3px 6px;
    font-size: 11px;
  }

  .contract-row {
    display: grid;
    gap: 2px;
    align-items: start;
  }

  .contract-row strong {
    overflow-wrap: anywhere;
  }

  .contract-secondary {
    display: none;
  }
}


/* Desktop ladder restoration */
.motion-focus-lane {
  padding: 10px;
}

.motion-ladder-head,
.motion-ladder-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 12px;
}

.motion-ladder-head strong {
  color: var(--text);
  font-size: 15px;
}

.motion-ladder-rows {
  display: grid;
  gap: 3px;
}

.motion-ladder-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(82px, 0.8fr) 80px 64px minmax(100px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(111, 230, 166, 0.28);
  border-radius: 5px;
  color: #f4fff8;
  background: linear-gradient(90deg, rgba(59, 154, 101, 0.96), rgba(45, 119, 79, 0.9));
  font-variant-numeric: tabular-nums;
}

.motion-ladder-row > strong {
  font-size: 16px;
}

.motion-ladder-row > b {
  justify-self: end;
  color: #f4fff8;
  white-space: nowrap;
}

.motion-ladder-score {
  justify-self: start;
  min-width: 58px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #eafff3;
  background: rgba(4, 68, 43, 0.9);
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

.motion-ladder-direction {
  color: rgba(244, 255, 248, 0.8);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.motion-ladder-row.highest-conviction {
  border-color: #ffe26a;
  color: #080a08;
  background: linear-gradient(90deg, #f5ce3e, #ffe570 54%, #d9b92f);
  box-shadow: 0 0 20px rgba(230, 189, 66, 0.22);
}

.motion-ladder-row.highest-conviction > b,
.motion-ladder-row.highest-conviction .motion-ladder-direction {
  color: #080a08;
}

.motion-ladder-row.highest-conviction .motion-ladder-score {
  color: #effff5;
  background: #075537;
}

.motion-ladder-note {
  justify-content: flex-start;
  padding-top: 5px;
  line-height: 1.35;
}

@media (min-width: 681px) {
  .heatmap-wrap {
    max-height: 680px;
  }
}

@media (max-width: 680px) {
  .motion-ladder-row {
    min-height: 42px;
    grid-template-columns: 70px 62px 44px minmax(70px, 1fr);
    gap: 6px;
    padding: 6px 8px;
  }

  .motion-ladder-row > strong {
    font-size: 14px;
  }

  .motion-ladder-score {
    min-width: 50px;
    padding: 3px 5px;
    font-size: 10px;
  }

  .motion-ladder-row > b {
    font-size: 12px;
  }
}


/* Dual-symbol motion board and compact market focus */
.motion-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.motion-symbol-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050913;
}

.motion-symbol-card .motion-ladder-head {
  padding: 1px 2px 7px;
}

.motion-symbol-card .motion-ladder-row {
  min-height: 34px;
  grid-template-columns: minmax(68px, 0.75fr) 68px 48px minmax(78px, 1fr);
  padding: 4px 8px;
}

.market-focus-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.market-focus-item {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 7px;
  background: var(--panel-soft);
}

.market-focus-item span,
.market-focus-item small {
  color: var(--muted);
  font-size: 11px;
}

.market-focus-item strong {
  color: var(--text);
  font-size: clamp(17px, 1.7vw, 23px);
  line-height: 1.05;
}

.market-focus-item.positive-focus {
  border-left-color: var(--green);
}

.market-focus-item.negative-focus {
  border-left-color: var(--magenta);
}

body.edge-mode .heatmap-card.show-grid .market-focus-strip {
  display: none;
}

@media (max-width: 680px) {
  .motion-dual-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .motion-symbol-card {
    padding: 5px;
  }

  .motion-symbol-card .motion-ladder-head {
    display: grid;
    gap: 2px;
  }

  .motion-symbol-card .motion-ladder-head strong {
    font-size: 11px;
  }

  .motion-symbol-card .motion-ladder-row {
    min-height: 38px;
    grid-template-columns: 47px 45px minmax(42px, 1fr);
    gap: 4px;
    padding: 4px 5px;
  }

  .motion-symbol-card .motion-ladder-row > strong {
    font-size: 12px;
  }

  .motion-symbol-card .motion-ladder-score {
    min-width: 42px;
    padding: 3px;
    font-size: 9px;
  }

  .motion-symbol-card .motion-ladder-direction {
    display: none;
  }

  .motion-symbol-card .motion-ladder-row > b {
    font-size: 10px;
  }

  .market-focus-strip {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .market-focus-item {
    min-height: 68px;
    scroll-snap-align: start;
  }
}


/* Reliability dashboard */
.provider-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.provider-strip article {
  min-width: 0;
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 7px;
  background: var(--panel-soft);
}

.provider-strip span,
.provider-strip small {
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-strip strong {
  color: var(--text);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .provider-strip {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .provider-strip article {
    min-height: 64px;
    padding: 8px;
  }

  .provider-strip strong {
    font-size: 13px;
  }
}


/* Verified SPX Global Trading Hours mode */
body.overnight-active .topbar {
  box-shadow: inset 0 -2px 0 rgba(255, 210, 31, 0.72);
}
body.overnight-active .overnight-panel {
  border-color: rgba(255, 210, 31, 0.58);
  background: linear-gradient(135deg, rgba(255, 210, 31, 0.07), rgba(7, 10, 19, 0.98) 42%);
}
body.overnight-active #overnightMode {
  color: #ffd21f;
  font-weight: 900;
  letter-spacing: 0.06em;
}
body.overnight-active #spotLabel {
  color: #ffd21f;
}
.overnight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.schwab-connect-card {
  gap: 5px;
}

.schwab-connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 5px;
  padding: 7px 12px;
  border: 1px solid rgba(99, 237, 242, 0.55);
  border-radius: 9px;
  color: #061015;
  background: #63edf2;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.schwab-connect:hover,
.schwab-connect:focus-visible {
  filter: brightness(1.08);
  outline: 2px solid rgba(99, 237, 242, 0.3);
  outline-offset: 2px;
}

.schwab-connect.disabled {
  pointer-events: none;
  color: #788394;
  background: #151b24;
  border-color: #303947;
}

.study-archive-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #263247;
  border-radius: 12px;
  background: #080d17;
}

.study-archive-panel .panel-title > div small {
  color: #8d99ad;
}

.study-archive {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.study-day,
.study-empty {
  min-width: 0;
  padding: 11px;
  border: 1px solid #222e42;
  border-radius: 10px;
  background: #0c1220;
}

.study-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.study-day-head span {
  color: #63edf2;
  font-size: 0.7rem;
  font-weight: 800;
}

.study-day-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 9px;
  color: #8d99ad;
  font-size: 0.74rem;
}

.study-day-grid b {
  color: #f1f5fb;
}

.study-day > small,
.study-empty {
  display: block;
  margin-top: 8px;
  color: #8d99ad;
  font-size: 0.7rem;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .study-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .study-archive { grid-template-columns: 1fr; }
  .study-archive-panel { padding: 10px; }
}
.night-es-card {
  border-color: rgba(99, 237, 242, 0.42) !important;
  background: linear-gradient(145deg, rgba(20, 68, 77, 0.34), var(--panel-soft)) !important;
}
@media (max-width: 760px) {
  .overnight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
