:root {
  color-scheme: dark;
  --bg: #070c10;
  --bg-2: #0a1117;
  --panel: #0e171f;
  --panel-2: #111e27;
  --line: #1d3444;
  --line-2: #2e5368;
  --text: #edf6fa;
  --muted: #94b3c7;
  --quiet: #5f7f93;
  --cyan: #00d8ff;
  --green: #00e08a;
  --amber: #ffb21a;
  --red: #ff4d57;
  --cyan-soft: rgba(0, 216, 255, 0.12);
  --green-soft: rgba(0, 224, 138, 0.12);
  --amber-soft: rgba(255, 178, 26, 0.13);
  --red-soft: rgba(255, 77, 87, 0.12);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Aptos", "Segoe UI", system-ui, sans-serif;
  --display: "DIN Condensed", "Bahnschrift", "Aptos Display", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px) 0 0 / 34px 34px,
    radial-gradient(circle at 78% 12%, rgba(0, 216, 255, 0.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(7, 12, 16, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: var(--cyan-soft);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
}

.brand strong {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.06em;
}

.overline {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 1px 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  border-color: var(--line);
  color: var(--text);
  background: var(--bg-2);
}

.nav-button.active {
  border-color: rgba(0, 216, 255, 0.48);
  background: var(--cyan-soft);
}

.nav-index {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
}

.nav-button span:not(.nav-index) {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 900;
  white-space: nowrap;
}

.nav-button small {
  overflow: hidden;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-panel {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.token-panel h2 {
  margin-top: 10px;
  font-size: 16px;
}

.token-panel p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.main {
  min-width: 0;
  width: 100%;
  max-width: 100vw;
  padding: 22px clamp(14px, 3vw, 38px) 44px;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding-bottom: 18px;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(7, 12, 16, 0.86) 78%, transparent 100%);
  backdrop-filter: blur(16px);
}

.title-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

h1 {
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.88;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.title-block p {
  max-width: 900px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.45;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

.state-chip i {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 999px;
}

.state-chip.good {
  border-color: rgba(0, 224, 138, 0.45);
  color: var(--green);
  background: var(--green-soft);
}

.state-chip.watch {
  border-color: rgba(255, 178, 26, 0.45);
  color: var(--amber);
  background: var(--amber-soft);
}

.state-chip.locked,
.state-chip.bad {
  border-color: rgba(255, 77, 87, 0.45);
  color: var(--red);
  background: var(--red-soft);
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 178, 26, 0.38);
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 14px;
  line-height: 1.45;
}

.screen {
  display: none;
  min-width: 0;
  animation: reveal 180ms ease-out;
}

.screen.active {
  display: grid;
  gap: 18px;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.metric-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.metric-panel,
.panel,
.chart-shell,
.operator-band,
.toolbar,
.filter-bar,
.step-row article {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 30, 39, 0.94), rgba(10, 17, 23, 0.95));
  box-shadow: var(--shadow);
}

.metric-panel {
  display: grid;
  align-content: space-between;
  min-height: 132px;
  gap: 12px;
  padding: 15px;
}

.metric-panel span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.metric-panel strong {
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: clamp(35px, 4vw, 58px);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.operator-band,
.toolbar,
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(16px, 2.2vw, 24px);
}

.operator-band h2,
.toolbar h2,
.panel h2,
.chart-head h2 {
  margin-top: 5px;
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 46px);
  line-height: 0.94;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.operator-band p {
  max-width: 860px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.action-summary {
  display: grid;
  gap: 12px;
}

.action-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.action-title strong {
  overflow-wrap: anywhere;
}

.action-title span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 12px;
}

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

.action-grid div {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 9px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 16, 0.58);
}

.action-grid span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.action-grid strong {
  align-self: end;
  overflow-wrap: anywhere;
}

.action-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.button-row,
.summary-strip,
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  color: var(--text);
  background: var(--panel-2);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.button.primary {
  border-color: var(--cyan);
  color: #001219;
  background: var(--cyan);
}

.button.safe {
  border-color: rgba(0, 224, 138, 0.58);
  color: var(--green);
  background: var(--green-soft);
}

.button.danger {
  border-color: rgba(255, 77, 87, 0.62);
  color: var(--red);
  background: rgba(255, 77, 87, 0.09);
}

.button.ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.field {
  display: grid;
  gap: 6px;
  min-width: min(220px, 100%);
}

.field.compact {
  min-width: 0;
}

.field span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field input,
.field select,
.chart-controls select {
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #060a0e;
  outline: none;
}

.chart-shell {
  display: grid;
  min-width: 0;
  overflow: hidden;
}

.chart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.chart-head p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.4;
}

.chart-stage {
  position: relative;
  min-height: clamp(320px, 48vw, 540px);
  padding: 14px;
}

#market-chart {
  display: block;
  width: 100%;
  height: clamp(290px, 45vw, 510px);
}

.chart-empty {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  background: rgba(7, 12, 16, 0.64);
  text-align: center;
}

.chart-empty[hidden] {
  display: none;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.preset-card {
  display: grid;
  min-height: 236px;
  gap: 14px;
  align-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.preset-card.selected {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.preset-card h3 {
  margin-top: 10px;
  font-family: var(--display);
  font-size: 32px;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preset-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.preset-card .preset-cadence {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.job-panel {
  margin-top: 14px;
}

.job-current {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.job-current-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.job-current h3 {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  text-transform: uppercase;
}

.job-current p {
  margin-top: 6px;
  color: var(--muted);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-1);
}

.progress-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  background: var(--cyan);
  transition: width 220ms ease;
}

.job-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.job-metrics div {
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 216, 255, 0.035);
}

.job-metrics span {
  display: block;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.job-metrics strong {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 22px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
  gap: 14px;
}

.research-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.research-review-grid > section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.026);
}

.mini-head span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.mini-head strong {
  font-family: var(--display);
  font-size: 25px;
  line-height: 0.9;
}

.list.compact {
  gap: 8px;
}

.research-row {
  padding: 10px;
}

.panel {
  min-width: 0;
  padding: clamp(15px, 2vw, 22px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.list,
.candidate-list {
  display: grid;
  gap: 10px;
}

.list-row,
.candidate-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.026);
}

.list-row strong,
.candidate-row strong {
  overflow-wrap: anywhere;
}

.list-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.row-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.chip-stack {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.row-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.row-mono {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
}

.candidate-row {
  grid-template-columns: minmax(220px, 1.1fr) repeat(4, minmax(110px, 0.45fr)) minmax(132px, 0.45fr);
  align-items: center;
}

.candidate-row:hover {
  border-color: rgba(0, 216, 255, 0.42);
}

.candidate-row.top {
  border-color: rgba(0, 224, 138, 0.44);
  background: linear-gradient(90deg, rgba(0, 224, 138, 0.10), rgba(255, 255, 255, 0.026) 46%);
}

.candidate-actions {
  display: grid;
  gap: 8px;
}

.table-button {
  width: auto;
  min-height: 32px;
  margin-top: 8px;
  padding: 7px 10px;
  font-size: 12px;
}

.mini-stat {
  display: grid;
  gap: 4px;
}

.mini-stat span:first-child {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.mini-stat span:last-child {
  font-weight: 900;
}

.progress {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
}

.progress i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--green);
}

.progress.large {
  height: 14px;
}

.filter-bar {
  flex-wrap: wrap;
  align-items: end;
}

.step-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.step-row article {
  display: grid;
  gap: 8px;
  min-height: 122px;
  padding: 14px;
}

.step-row strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--mono);
}

.step-row span {
  font-weight: 900;
}

.step-row small {
  color: var(--muted);
  line-height: 1.35;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

td {
  color: var(--muted);
  font-size: 14px;
}

td strong {
  display: block;
  color: var(--text);
}

.log-box {
  min-height: 260px;
  max-height: 460px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #05090d;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.link-grid a {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.026);
  font-weight: 900;
  text-decoration: none;
}

.link-grid a:hover {
  border-color: var(--cyan);
  color: var(--text);
}

.empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 22px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.bot-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.bot-drawer.open {
  display: block;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(3px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(720px, 100vw);
  height: 100vh;
  border-left: 1px solid var(--line-2);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 30px 30px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px) 0 0 / 30px 30px,
    #071018;
  box-shadow: -28px 0 90px rgba(0, 0, 0, 0.52);
  animation: drawerIn 180ms ease-out;
}

@keyframes drawerIn {
  from {
    transform: translateX(28px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 17, 23, 0.9);
}

.drawer-head h2 {
  margin-top: 6px;
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drawer-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-2);
  color: var(--text);
  background: var(--panel-2);
  font-weight: 900;
}

.icon-button:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.drawer-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
}

.thinking-card {
  border-color: rgba(0, 216, 255, 0.4);
  background: linear-gradient(135deg, rgba(0, 216, 255, 0.10), rgba(255, 255, 255, 0.026) 44%);
}

.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.detail-head h3 {
  margin-top: 5px;
  font-family: var(--display);
  font-size: 30px;
  line-height: 0.96;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-card p,
.detail-card small {
  color: var(--muted);
  line-height: 1.45;
}

.detail-card small {
  font-family: var(--mono);
  font-size: 12px;
}

.prediction-strip,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

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

.prediction-strip div,
.detail-grid div {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 16, 0.58);
}

.prediction-strip span,
.detail-grid span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.prediction-strip strong,
.detail-grid strong {
  align-self: end;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.mini-tape,
.blocker-list,
.attribution-list {
  display: grid;
  gap: 8px;
}

.prediction-tape {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.prediction-tape::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 5px;
  width: 1px;
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.78), rgba(255, 255, 255, 0.08));
}

.prediction-event {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
}

.prediction-dot {
  position: absolute;
  top: 17px;
  left: -18px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--bg);
  background: var(--amber);
  box-shadow: 0 0 0 1px rgba(255, 184, 0, 0.7);
}

.prediction-dot.good {
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.7);
}

.prediction-dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(255, 69, 69, 0.7);
}

.prediction-event-body {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 16, 0.58);
}

.prediction-event-top,
.prediction-event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.prediction-event-top strong,
.prediction-event-top span,
.prediction-event-meta span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.prediction-event-body p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.mini-tape div,
.blocker-list div,
.attribution-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 16, 0.58);
}

.attribution-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.attribution-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.attribution-values {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.mini-tape span,
.blocker-list div {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-bottom: 8px;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: relative;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    overscroll-behavior-x: contain;
  }

  .nav-button {
    min-width: 154px;
  }

  .token-panel {
    display: none;
  }

  .metric-grid.four,
  .metric-grid.three,
  .action-grid,
  .job-metrics,
  .research-review-grid,
  .preset-grid,
  .step-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .candidate-row {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-metrics,
  .prediction-strip,
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 26px 26px;
  }

  .main {
    padding: 15px 11px 30px;
  }

  .topbar,
  .operator-band,
  .toolbar,
  .chart-head {
    position: relative;
    grid-template-columns: 1fr;
    display: grid;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .metric-grid.four,
  .metric-grid.three,
  .action-grid,
  .job-metrics,
  .research-review-grid,
  .preset-grid,
  .step-row,
  .candidate-row,
  .drawer-metrics,
  .prediction-strip,
  .detail-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .job-current-head {
    grid-template-columns: 1fr;
  }

  .metric-panel {
    min-height: 118px;
  }

  .chart-stage {
    min-height: 330px;
    padding: 8px;
  }

  #market-chart {
    height: 312px;
  }

  .chart-empty {
    inset: 8px;
  }

  .field {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  .button-row {
    width: 100%;
  }

  .button-row .button {
    flex: 1 1 160px;
  }

  .drawer-panel {
    width: 100vw;
  }

  .attribution-row {
    grid-template-columns: 1fr;
  }

  .attribution-values {
    justify-items: start;
  }

  .drawer-head {
    padding: 16px 12px;
  }

  .drawer-body {
    padding: 12px;
  }
}
