/* Market terminal — Polymarket + Hyperliquid (read-only public feeds) */
:root {
  --mt-bg: #070a09;
  --mt-panel: #0c1210;
  --mt-border: #1a2822;
  --mt-green: #39ff9c;
  --mt-red: #ff5c7a;
  --mt-orange: #ffb347;
  --mt-dim: #5a7a6a;
  --mt-text: #c8e6d4;
  --mt-font: "JetBrains Mono", "Consolas", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--mt-bg);
  color: var(--mt-text);
  font-family: var(--mt-font);
  font-size: 11px;
  line-height: 1.35;
}

.mt-root {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr minmax(120px, 18vh);
  gap: 0;
}

.mt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--mt-border);
  background: var(--mt-panel);
}

.mt-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--mt-orange);
}

.mt-shortcuts {
  color: var(--mt-dim);
  font-size: 10px;
}

.mt-shortcuts kbd {
  padding: 1px 4px;
  border: 1px solid var(--mt-border);
  border-radius: 2px;
  color: var(--mt-text);
}

.mt-ticker {
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--mt-border);
  background: #050807;
  padding: 4px 0;
}

.mt-ticker-inner {
  display: inline-block;
  padding-left: 100%;
  animation: mt-marquee 80s linear infinite;
}

@keyframes mt-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.mt-ticker span {
  margin-right: 2.5rem;
  color: var(--mt-green);
}

.mt-ticker .no {
  color: var(--mt-red);
}

.mt-main {
  display: grid;
  grid-template-columns: minmax(240px, 32vw) 1fr minmax(200px, 22vw);
  gap: 1px;
  background: var(--mt-border);
  min-height: 0;
}

.mt-pane {
  background: var(--mt-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.mt-pane-h {
  padding: 4px 8px;
  border-bottom: 1px solid var(--mt-border);
  color: var(--mt-orange);
  font-size: 10px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.mt-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.mt-markets-table {
  width: 100%;
  border-collapse: collapse;
}

.mt-markets-table th {
  text-align: left;
  padding: 4px 6px;
  color: var(--mt-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--mt-border);
  position: sticky;
  top: 0;
  background: var(--mt-panel);
  z-index: 1;
}

.mt-markets-table td {
  padding: 3px 6px;
  border-bottom: 1px solid #0f1814;
  vertical-align: middle;
}

.mt-markets-table tr {
  cursor: pointer;
}

.mt-markets-table tr:hover td {
  background: #0f1a15;
}

.mt-markets-table tr.is-selected td {
  background: #12221a;
  outline: 1px solid var(--mt-orange);
  outline-offset: -1px;
}

.mt-yes {
  color: var(--mt-green);
  text-align: right;
}

.mt-no {
  color: var(--mt-red);
  text-align: right;
}

.mt-vol {
  color: var(--mt-dim);
  text-align: right;
}

.mt-spark {
  width: 56px;
  height: 18px;
  display: block;
}

.mt-books {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--mt-border);
  min-height: 0;
}

.mt-book-block {
  flex: 1;
  min-height: 120px;
  background: var(--mt-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mt-book-q {
  font-size: 10px;
  color: var(--mt-text);
  padding: 4px 8px;
  border-bottom: 1px solid var(--mt-border);
  line-height: 1.25;
}

.mt-book-meta {
  display: flex;
  gap: 12px;
  padding: 2px 8px 4px;
  font-size: 10px;
  color: var(--mt-dim);
}

.mt-book-meta strong {
  color: var(--mt-orange);
  font-weight: 600;
}

.mt-depth {
  display: flex;
  height: 48px;
  margin: 4px 8px;
  gap: 2px;
  align-items: flex-end;
}

.mt-depth-bar {
  flex: 1;
  min-width: 2px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
}

.mt-depth-bid {
  background: linear-gradient(180deg, var(--mt-green), #1a5c3a);
  min-height: 1px;
}

.mt-depth-ask {
  background: linear-gradient(0deg, var(--mt-red), #5c1a2a);
  min-height: 1px;
}

.mt-book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
  padding: 0 8px 6px;
  font-size: 10px;
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.mt-book-side {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mt-book-side-title {
  color: var(--mt-dim);
  margin-bottom: 2px;
}

.mt-level {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.mt-level-bid .mt-p {
  color: var(--mt-green);
}

.mt-level-ask .mt-p {
  color: var(--mt-red);
}

.mt-hl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px;
}

.mt-hl-cell {
  border: 1px solid var(--mt-border);
  padding: 4px 6px;
  background: #080d0b;
}

.mt-hl-t {
  font-weight: 700;
  color: var(--mt-orange);
}

.mt-hl-up {
  color: var(--mt-green);
}

.mt-hl-down {
  color: var(--mt-red);
}

.mt-hl-flat {
  color: var(--mt-dim);
}

.mt-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--mt-border);
  min-height: 0;
}

.mt-feed,
.mt-sidepanel {
  background: var(--mt-panel);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mt-feed-h {
  padding: 4px 8px;
  color: var(--mt-orange);
  border-bottom: 1px solid var(--mt-border);
  font-size: 10px;
}

.mt-feed-body {
  flex: 1;
  overflow: auto;
  padding: 4px 8px;
  font-size: 10px;
  color: var(--mt-dim);
}

.mt-feed-line {
  margin: 0 0 2px;
  font-family: var(--mt-font);
}

.mt-feed-line b {
  color: var(--mt-text);
  font-weight: 600;
}

.mt-err {
  color: var(--mt-red);
  padding: 8px;
}

.mt-note {
  color: var(--mt-dim);
  font-size: 9px;
  padding: 4px 8px;
}

@media (max-width: 960px) {
  .mt-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .mt-ticker-inner {
    animation-duration: 120s;
  }
}
