/* Layout for the terminal. Components live in tokens.css. */

.preview-flag {
  display: flex;
  align-items: center;
  min-height: 22px;
  padding: 4px var(--space-3);
  background: #140d05;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-h);
  padding: 8px var(--space-3);
  border-bottom: 2px solid var(--orange);
  background: #000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.mark {
  width: 14px;
  height: 14px;
  background: var(--orange);
  flex: none;
}

.brand b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand span {
  display: block;
  color: var(--text-mute);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav { display: flex; gap: 0; }

.nav a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  text-decoration: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  border: 1px solid transparent;
}

.nav a.on {
  background: var(--orange);
  color: var(--orange-ink);
  font-weight: 600;
}

.nav a:hover { color: var(--text); }
.nav a.on:hover { color: var(--orange-ink); }

.cmd {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 4px 0 0;
  border: 1px solid var(--orange);
  background: #000;
  cursor: text;
  text-align: left;
}

.cmd-go {
  flex: none;
  height: 24px;
  padding: 0 10px;
  border: 0;
  background: var(--orange);
  color: var(--orange-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.cmd-prompt {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
  background: var(--orange);
  color: var(--orange-ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
}

.cmd-hint {
  flex: 1;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

kbd {
  border: 1px solid var(--line-strong);
  padding: 1px 5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange-2);
  letter-spacing: 0.14em;
}

.live-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(253, 111, 11, 0.7);
  animation: pulse 2.2s infinite;
}

.live-pill.is-live {
  color: var(--green);
}

.live-pill.is-live::before,
.chart-status .live-dot {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(62, 224, 162, 0.7);
  animation: pulse-live 2.2s infinite;
}

.chart-status.is-live { color: var(--green); }

.chart-status .live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 4px rgba(253, 111, 11, 0); }
}

@keyframes pulse-live {
  50% { box-shadow: 0 0 0 4px rgba(62, 224, 162, 0); }
}

.ticker {
  height: var(--ticker-h);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #070502;
}

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

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

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ti {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  font-size: var(--text-xs);
}

.ti .k { color: var(--orange); }
.ti .v { color: var(--text); }

.stage {
  padding: 10px;
  padding-bottom: 52px;
  display: grid;
  gap: 8px;
}

.boot-error {
  border: 1px solid var(--orange);
  background: #1a1006;
  color: var(--text);
  padding: 12px 14px;
  font-size: var(--text-sm);
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(280px, 0.84fr) minmax(420px, 1.32fr) minmax(280px, 0.96fr);
  gap: 8px;
  align-items: stretch;
}

.hero { border-top: 2px solid var(--orange); align-self: start; }

.media, .eco {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
}

.grid-main > .media > .gate-blur,
.grid-main > .eco > .gate-blur {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.panel.is-max.media,
.panel.is-max.eco {
  overflow: hidden;
}

.media-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 8px 10px 10px;
  background: #000;
  container-type: size;
  overflow: hidden;
}

.media-frame iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: min(100cqh, calc(100cqw * 9 / 16));
  transform: translate(-50%, -50%) scale(1.02);
  border: 0;
  pointer-events: none;
}

.media-fallback {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
}

.media-fallback:hover,
.media-fallback:focus-visible { text-decoration: underline; }

.media-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}

.media-controls {
  position: absolute;
  z-index: 3;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 4px;
  background: rgba(12, 14, 18, 0.92);
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
}

.media:hover .media-controls,
.media:focus-within .media-controls,
.media-controls.is-touch {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none), (pointer: coarse) {
  .media-controls { opacity: 1; pointer-events: auto; }
}

.media-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.media-btn svg {
  display: block;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.media-btn .ico-play,
.media-btn .ico-low,
.media-btn .ico-high,
.media-btn.is-paused .ico-pause { display: none; }

.media-btn.is-paused .ico-play { display: block; }

#media-mute.is-low .ico-muted,
#media-mute.is-high .ico-muted { display: none; }
#media-mute.is-low .ico-low,
#media-mute.is-high .ico-high { display: block; }

.media-vol { position: relative; display: flex; align-items: center; flex: none; }

.media-pop {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  padding-bottom: 6px;
  opacity: 0;
  pointer-events: none;
}

.media-vol:hover .media-pop,
.media-vol:focus-within .media-pop {
  opacity: 1;
  pointer-events: auto;
}

.media-pop-box {
  position: relative;
  width: 28px;
  height: 84px;
  background: rgba(12, 14, 18, 0.92);
  border: 1px solid var(--line);
}

.media-vol-rot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 16px;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.media-vol-slider {
  width: 68px;
  height: 14px;
  margin: 0;
  accent-color: var(--orange);
  background: transparent;
  cursor: pointer;
}

@media (hover: none), (pointer: coarse) {
  .media-pop {
    position: static;
    transform: none;
    padding: 0 0 0 4px;
    opacity: 1;
    pointer-events: auto;
  }
  .media-pop-box {
    width: auto;
    height: auto;
    background: transparent;
    border: 0;
  }
  .media-vol-rot {
    position: static;
    width: 64px;
    height: 14px;
    transform: none;
  }
  .media-vol-slider { width: 64px; }
}

.media-btn:hover,
.media-btn:focus-visible {
  color: var(--orange);
  border-color: var(--orange);
}

.media-live,
.media-cc {
  width: auto;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.media-cc[aria-pressed="true"] {
  color: var(--orange);
  border-color: var(--orange);
}

.media-seek[hidden] { display: none; }

.media-live.is-behind { color: var(--orange); border-color: var(--orange); }

.media-seek {
  flex: 1 1 auto;
  min-width: 40px;
  height: 12px;
  margin: 0;
  accent-color: var(--orange);
  background: transparent;
  cursor: pointer;
}

.panel.is-max .media-frame {
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  margin: 12px;
}

.panel.is-max .media-frame iframe {
  inset: 0;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  max-width: none;
  transform: translate(-50%, -50%) scale(1.02);
}

.panel.is-max .media-controls {
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 32px;
  gap: 8px;
}

.panel.is-max .media-btn { width: 26px; height: 26px; }
.panel.is-max .media-btn svg { width: 16px; height: 16px; }
.panel.is-max .media-live { font-size: 11px; }

.eco-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

.eco-table th,
.eco-table td {
  padding: 3px 6px;
  font-size: 11px;
  white-space: nowrap;
  vertical-align: middle;
}

.eco-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
}

.eco-table td.ev {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel.is-max .eco-table th,
.panel.is-max .eco-table td {
  padding: 6px 10px;
  font-size: var(--text-sm);
}

.panel.is-max .eco-table td.ev { max-width: none; }

.eco-long { display: none; }
.panel.is-max .eco-short { display: none; }
.panel.is-max .eco-long { display: inline; }

.eco-day td {
  background: var(--panel-hd);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eco-table td.beat { color: var(--green); }
.eco-table td.miss { color: var(--red); }

.rel {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 10px;
}

.rel i {
  display: block;
  width: 3px;
  background: var(--line-strong);
}

.rel i:nth-child(1) { height: 4px; }
.rel i:nth-child(2) { height: 7px; }
.rel i:nth-child(3) { height: 10px; }

.rel[data-n="1"] i:nth-child(1),
.rel[data-n="2"] i:nth-child(-n+2),
.rel[data-n="3"] i { background: var(--orange); }

.eco .panel-foot {
  flex: none;
  padding: 6px 10px 8px;
}

/* Sort chip in the Economic Data header. Active word is the terminal orange. */
#eco > .panel-hd {
  flex-wrap: wrap;
  row-gap: 4px;
  height: auto;
  padding-top: 5px;
  padding-bottom: 5px;
}

#eco > .panel-hd .eco-hd-tools {
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 8px;
}

#eco > .panel-hd .eco-hd-tools .hd-note {
  margin-left: 0;
  white-space: nowrap;
}

#eco > .panel-hd .eco-sort {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  flex: none;
}

#eco > .panel-hd .eco-sort-sep {
  color: var(--text-mute);
  padding: 0 4px;
}

#eco > .panel-hd .eco-sort [data-sort].on {
  color: #fd6f0b;
}

#eco > .panel-hd .eco-sort:hover {
  border-color: var(--orange);
  color: var(--text);
}

#eco > .panel-hd .eco-sort:hover [data-sort].on {
  color: #fd6f0b;
}

/* Narrow screens give this card an automatic height, which collapses a
   flex-basis of 0. Size the list from its rows there, and give the
   maximized card the same phone height as the other panels. */
@media (max-width: 1100px) {
  #eco:not(.is-max) > .gate-blur {
    flex: 1 1 auto;
  }

  #eco:not(.is-max) .eco-scroll {
    flex: 1 1 auto;
    max-height: 320px;
  }
}

@media (max-width: 800px) {
  .panel.is-max#eco {
    height: min(72vh, calc(100vh - var(--dock-top, 128px) - 52px));
    max-height: calc(100vh - var(--dock-top, 128px) - 52px);
  }

  .panel.is-max#eco .eco-scroll {
    max-height: none;
  }
}

@media (max-width: 540px) {
  #eco > .panel-hd {
    display: grid;
    grid-template-columns: 6px minmax(0, 1fr) auto;
    grid-template-areas: "dot title title" "tools tools max";
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
  }

  #eco > .panel-hd::before { grid-area: dot; }

  #eco > .panel-hd > span:first-child {
    grid-area: title;
    min-width: 0;
  }

  #eco > .panel-hd .eco-hd-tools {
    grid-area: tools;
    margin-left: 0;
    max-width: none;
    justify-content: flex-start;
  }

  #eco > .panel-hd > .maxbtn {
    grid-area: max;
    margin-left: 0;
  }
}

.hero-body {
  display: block;
  padding: 14px 14px 8px;
}

.score-num {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  color: var(--orange);
  font-weight: 500;
}

.score-of {
  margin-left: 6px;
  color: var(--text-mute);
  font-size: var(--text-lg);
}

.score-delta { margin-top: 6px; font-family: var(--font-mono); font-size: var(--text-sm); }

.score-regime {
  margin-top: 10px;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  font-weight: 600;
}

.score-verdict {
  font-size: 34px;
  line-height: 1;
  font-weight: 500;
}

.score-sub { margin-top: 8px; color: var(--text-dim); font-size: var(--text-sm); }

.gauge {
  position: relative;
  display: flex;
  height: 16px;
  margin: 4px 14px 0;
  border: 1px solid var(--line);
}

.gauge i { display: block; height: 100%; }
.gauge i:nth-child(1) { flex: 15; background: #12362f; }
.gauge i:nth-child(2) { flex: 20; background: #1c3d28; }
.gauge i:nth-child(3) { flex: 30; background: #1b2129; }
.gauge i:nth-child(4) { flex: 20; background: #3a2c12; }
.gauge i:nth-child(5) { flex: 15; background: #3d1c18; }

.gauge-mark {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 26px;
  background: var(--orange);
}

.gauge-mark::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--orange);
}

.gauge-labels {
  display: grid;
  grid-template-columns: 15fr 20fr 30fr 20fr 15fr;
  gap: 0;
  padding: 6px 14px 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}

.gauge-labels span { text-align: center; }
.gauge-labels span.on { color: var(--orange); }

.spark {
  display: block;
  width: calc(100% - 28px);
  height: 104px;
  margin: 10px 14px 0;
}

.hero-note {
  margin: 8px 14px 14px;
  color: var(--text-mute);
  font-size: var(--text-xs);
  max-width: 62ch;
}

.metric { display: flex; flex-direction: column; }

.metric-val {
  padding: 8px 12px 0;
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1;
}

.metric-read {
  padding: 6px 12px 8px;
  color: var(--text-mute);
  font-size: var(--text-xs);
  line-height: 1.35;
}

.bar {
  height: 3px;
  margin: 0 12px 10px;
  background: #1a212b;
}

.bar i { display: block; height: 100%; width: 0; }

.chart-panel .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 0;
}

.chart-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  color: var(--orange);
}

.chart-box { height: 440px; margin-top: 8px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 12px;
}

.chart-foot {
  padding: 0 12px 12px;
  color: var(--text-mute);
  font-size: var(--text-xs);
}

.grid-lower {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 1.15fr;
  gap: 8px;
  align-items: stretch;
}

.grid-lower > .panel { height: 100%; }

.grid-lower.pair { grid-template-columns: 1fr 1.15fr; }

.mini-level {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.7fr;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  font-size: var(--text-sm);
}

.mini-level:first-child { border-top: 0; }
.mini-level:hover { background: #12161c; }
.mini-level.spot { background: var(--panel-spot); }
.mini-level .num:last-child { text-align: right; }

.news-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.news-row:first-child { border-top: 0; }
.news-row:hover { background: #12161c; }

.news-row img {
  width: 112px;
  height: 63px;
  object-fit: cover;
  background: #161b22;
  display: block;
}

.news-title {
  font-size: var(--text-sm);
  line-height: 1.35;
}

.news-meta {
  margin-top: 4px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
}

.alert-head, .watch-row {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.7fr 0.6fr;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
}

.alert-head {
  color: var(--text-mute);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.watch-row { border-top: 1px solid var(--line); font-size: var(--text-xs); }
.watch-row:first-of-type { border-top: 0; }
.alert-now, .alert-line { text-align: right; }
.alert-state { text-align: right; font-family: var(--font-mono); letter-spacing: 0.08em; font-size: 10px; }

.panel-foot {
  padding: 8px 12px 12px;
  color: var(--text-mute);
  font-size: var(--text-xs);
}

.ladder-row {
  display: grid;
  grid-template-columns: 16px 132px minmax(120px, 0.8fr) 88px minmax(160px, 1.4fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}

.ladder-row:first-child { border-top: 0; }
.ladder-row.spot { background: var(--panel-spot); }
.ladder-px { font-size: 16px; }
.ladder-vs { text-align: right; }
.ladder-mean { color: var(--text-mute); font-size: var(--text-xs); }
.swatch { width: 8px; height: 8px; }

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

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}

.stat-line:first-child { border-top: 0; }
.stat-note { margin: 0; padding: 8px 12px 12px; color: var(--text-mute); font-size: var(--text-xs); }

.table-wrap { overflow-x: auto; }

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

th {
  text-align: left;
  padding: 8px 12px;
  font-size: var(--text-2xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  vertical-align: top;
}

td.num, th.num { text-align: right; }
tr.spot td { background: var(--panel-spot); }

.fnbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--fn-h);
  padding: 0 8px;
  background: #000;
  border-top: 2px solid var(--orange);
  overflow-x: auto;
}

.fnbar button {
  flex: none;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.fnbar button:hover { border-color: var(--orange); color: var(--text); }
.fnbar button.on { color: var(--orange-ink); background: var(--orange); border-color: var(--orange); }

.fn-meta {
  margin-left: auto;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.palette {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.62);
  padding: 12vh 16px 16px;
}

.palette-card {
  width: min(720px, 100%);
  margin: 0 auto;
  background: #0c0e11;
  border: 1px solid var(--orange);
}

.palette-input {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.palette-input input {
  flex: 1;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  outline: none;
}

.palette-list { max-height: 360px; overflow: auto; }

.palette-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: var(--text-sm);
}

.palette-item:first-child { border-top: 0; }
.palette-item.on, .palette-item:hover { background: var(--orange-dim); }

.palette-empty, .palette-foot {
  padding: 10px 12px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.palette-foot { border-top: 1px solid var(--line); letter-spacing: 0.08em; }

.hmr-tip {
  position: fixed;
  z-index: 40;
  max-width: 320px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  font-size: var(--text-xs);
  line-height: 1.4;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .hero { align-self: start; height: auto; overflow: visible; }
  .media, .eco { grid-column: 1; grid-row: auto; height: auto; min-height: 0; overflow: hidden; }
  .media-frame { aspect-ratio: 16 / 9; }
  .media-frame iframe { top: 50%; left: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%) scale(1.02); }
  .eco-scroll { max-height: 320px; }
  .eco-table td.ev { max-width: none; white-space: normal; overflow: visible; text-overflow: clip; }
  .chart-panel .controls { flex-wrap: wrap; overflow: visible; }
  .chart-panel .seg { flex-wrap: wrap; }
  .chart-status { margin-left: 0; }
  .grid-lower { grid-template-columns: 1fr 1fr; }
  #levels-entry { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .panel, tr[id] { scroll-margin-top: 240px; }
  .topbar { flex-wrap: wrap; }
  .cmd { order: 5; flex: 1 1 100%; }
  .brand span, .cmd-hint { display: none; }
  .top-meta { margin-left: 0; }
  .grid-main, .grid-lower, .grid-lower.pair, .stats { grid-template-columns: 1fr; }
  .chart-box { height: 300px; }
  .gauge-labels { font-size: 8px; }
  .alert-head, .alert-row { grid-template-columns: 1.4fr 0.8fr 0.7fr; }
  .alert-line { display: none; }
  .alert-head span:nth-child(3) { display: none; }
  .ladder-row { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .ladder-mean { display: none; }
  .swatch { grid-row: 1 / span 2; align-self: center; }
  .ladder-row > span:nth-child(3) { grid-column: 2; grid-row: 1; }
  .ladder-px { grid-column: 2; grid-row: 2; font-size: 14px; }
  .ladder-vs { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .news-row { grid-template-columns: 84px 1fr; }
  .news-row img { width: 84px; height: 48px; }
  .btn { height: 32px; }
  .fn-meta { display: none; }
  .controls { flex-wrap: wrap; overflow: visible; }
  .seg { flex: 1 1 auto; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .hero-body { grid-template-columns: 1fr; }
  .score-num { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .live-pill::before,
  .chart-status .live-dot { animation: none; }
}

/* Wordmark, page row, and centered maximize. Panel sizes stay the v1 scale. */

.brand img {
  width: 28px;
  height: 28px;
  flex: none;
  display: block;
}

.brand b {
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.navrow {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.navrow a {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  text-decoration: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.navrow a.on {
  background: var(--orange);
  color: var(--orange-ink);
  font-weight: 600;
}

.navrow a:hover { color: var(--text); }
.navrow a.on:hover { color: var(--orange-ink); }

.panel { scroll-margin-top: 124px; }

.panel-hd .maxbtn,
.panel-hd .shotbtn {
  margin-left: 8px;
}

.panel-hd .minbtn + .maxbtn,
.panel-hd .minbtn + .shotbtn,
.panel-hd .shotbtn + .maxbtn,
.panel-hd .draw-slot + .shotbtn,
.panel-hd .draw-slot + .maxbtn {
  margin-left: 0;
}

.panel-hd > .maxbtn:last-child:nth-child(2),
.panel-hd > .shotbtn:nth-child(2) {
  margin-left: auto;
}

.panel-hd .hd-note ~ .shotbtn {
  margin-left: 8px;
}

.maxbtn,
.minbtn,
.shotbtn,
.drawbtn {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex: none;
}

.maxbtn svg,
.minbtn svg,
.shotbtn svg,
.drawbtn svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

.maxbtn .ico-min { display: none; }
.maxbtn[aria-pressed="true"] .ico-max { display: none; }
.maxbtn[aria-pressed="true"] .ico-min { display: block; }
.maxbtn:hover,
.maxbtn[aria-pressed="true"],
.minbtn:hover,
.minbtn[aria-pressed="true"],
.shotbtn:hover,
.shotbtn[aria-pressed="true"],
.drawbtn:hover,
.drawbtn[aria-pressed="true"] {
  color: var(--orange);
  border-color: var(--orange);
}

.shotbtn.is-busy { opacity: 0.45; }

.shot-stage .chart-box {
  display: flex;
  flex-direction: column;
  height: 640px;
  margin: 0;
}
.shot-stage .lwc-fill { flex: 1 1 auto; height: 100%; min-height: 0; }
.shot-stage .lwc-split { flex: 1 1 auto; min-height: 0; height: auto; }

.shotbtn circle { fill: none; }

.panel.is-min {
  align-self: start;
  height: auto;
}

.panel.is-min > :not(.panel-hd) {
  display: none !important;
}

.max-chart { display: none; }

.max-back {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(5, 6, 8, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.max-back[hidden] { display: none !important; }

body.has-max { overflow: hidden; }

.panel.is-max {
  position: fixed;
  z-index: 46;
  top: max(24px, 5vh);
  left: max(24px, 5vw);
  width: calc(100% - 2 * max(24px, 5vw));
  height: calc(100% - 2 * max(24px, 5vh));
  right: auto;
  bottom: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  align-self: auto;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--panel);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.6);
}

.panel.is-max > .panel-hd {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 3;
}

.panel.is-max > .controls,
.panel.is-max > .legend,
.panel.is-max > .chart-foot {
  flex: 0 0 auto;
}

.panel.is-max#score > .gate-blur > :not(.max-chart) { flex: 0 0 auto; }

.panel.is-max > .gate-blur {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.panel.is-max.chart-panel,
.panel.is-max#score,
.panel.is-max.media,
.panel.is-max.eco {
  overflow: hidden;
}

.panel.is-max#score > .gate-blur { overflow: hidden; }

.panel.is-max#score .spark { display: none; }

.panel.is-max#score .hero-body { padding: 10px 14px 4px; }

.panel.is-max#score .score-num { font-size: clamp(36px, 8vh, 68px); }

.panel.is-max#score .hero-note { margin: 6px 14px 8px; }

.panel.is-max .chart-box,
.panel.is-max .perp-chart {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.panel.is-max .max-chart {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  margin: 4px 12px 12px;
  overflow: hidden;
}

.panel.is-max .max-chart .lwc-fill,
.panel.is-max .lwc-fill {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.grid-signals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.parity-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 12px 4px;
}

.parity-pct {
  font-size: var(--text-xl);
  color: var(--orange);
  font-weight: 500;
}

.parity-track {
  height: 10px;
  background: #1a212b;
  border: 1px solid var(--line);
}

.parity-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--orange);
}

.kicker {
  margin: 6px 2px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  align-items: start;
}

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

.chart-box.short { height: 280px; }

.equity-chart { height: 420px; }

.cmp-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
  color: var(--text-mute);
}

.figure {
  font-size: var(--text-2xl);
  color: var(--orange);
  font-weight: 500;
  line-height: 0.95;
}

.mstr-score { padding: 14px 12px 0; }

.tool-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
}

.tool-inputs label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.tool-inputs input,
.tool-inputs select {
  height: 32px;
  border: 1px solid var(--line-strong);
  background: #07080a;
  color: var(--text);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.gav-head {
  margin: 0;
  padding: 10px 12px 0;
  color: var(--text-dim);
  font-size: var(--text-sm);
}

.gav-head b { color: var(--orange); font-weight: 600; }

.gav-min { padding: 0 0 12px; }

.stack-bar {
  display: flex;
  height: 28px;
  margin: 10px 12px 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.stack-seg {
  min-width: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #0d1117;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 12px;
  color: var(--text-dim);
  font-size: 11px;
}

.stack-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  vertical-align: -1px;
}

.gav-max { display: none; }

.panel.is-max .gav-min { display: none; }
.panel.is-max .gav-max { display: block; }

.treemap {
  position: relative;
  height: min(26vh, 260px);
  margin: 8px 12px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.treemap-cell {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 6px 8px;
  border: 1px solid var(--bg);
  color: #0d1117;
}

.treemap-cell.slim { padding: 1px 4px; justify-content: center; }

.treemap-cell .nm {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.82;
  line-height: 1.3;
}

.treemap-cell .vl {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.bt-stat { padding: 10px 12px 12px; }
.bt-stat .v { margin-top: 4px; font-size: var(--text-md); }
.bt-actions { padding: 0 12px 12px; }
.chart-box.mid { height: 380px; }

.page-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stats.etf {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.stats.etf .metric-val { padding-bottom: 12px; }

.etf-flow th,
.etf-flow td {
  padding: 6px 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cmd input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  outline: none;
}

.cmd input::placeholder { color: var(--text-mute); }

.palette-item .cmd-code {
  flex: none;
  min-width: 7.2em;
  font-family: var(--font-mono);
  color: var(--orange);
}

.palette-item .cmd-label { flex: 1; min-width: 0; }

.cmd-hit { box-shadow: inset 0 0 0 1px var(--orange); }

tr[id] { scroll-margin-top: 124px; }

.chart-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.chart-pair > .panel,
.chart-pair .chart-box {
  min-width: 0;
}

@media (max-width: 900px) {
  .chart-pair { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .grid-signals, .page-split, .stats.trio { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .brand b { font-size: 11px; letter-spacing: 0.04em; }
  .grid-signals, .page-split, .stats.duo, .stats.trio { grid-template-columns: 1fr; }
}

.legal {
  --mut3: #5a636e;
  margin: 18px 12px 48px;
  padding: 0 8px;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
  color: #5a636e;
}

.legal a { color: var(--mut3); }

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

.alertsbtn,
.gate-signout,
.gate-signout-btn {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.alertsbtn:hover,
.gate-signout:hover,
.gate-signout-btn:hover {
  border-color: var(--orange);
  color: var(--text);
}

.alertsbtn[hidden],
.gate-signout[hidden] { display: none; }

.free-banner {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 14px;
  background: #140d05;
  border-bottom: 1px solid var(--orange);
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}

body[data-tier="free"] .free-banner { display: flex; }
.free-banner b { color: var(--orange); }

.gate-join,
.gate-cta {
  display: inline-flex;
  align-items: center;
  background: var(--orange);
  color: var(--orange-ink);
  border-radius: 2px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.gate-login {
  background: none;
  border: none;
  color: var(--text-mute);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.gated-panel { position: relative; }

.gate-overlay { display: none; }

.gate-blur { min-width: 0; }

body[data-tier="free"] .gated-panel .gate-blur {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

body[data-tier="free"] .gated-panel .gate-overlay {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 8;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 18px;
  background: rgba(5, 6, 7, 0.55);
}

.gate-lock { font-size: 22px; line-height: 1; }
.gate-title { font-size: 14px; font-weight: 600; color: var(--text); }
.gate-sub { margin: 0; max-width: 340px; font-size: 12px; line-height: 1.45; color: var(--text-dim); }

.boot-error { position: relative; z-index: 9; }

.gate-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  align-items: flex-start;
  justify-content: center;
  padding: 88px 18px 64px;
}

body[data-tier="checking"] .gate-screen.checking,
body[data-tier="pending"] .gate-screen.pending,
body[data-tier="denied"] .gate-screen.denied { display: flex; }

.gate-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px 24px;
}

.gate-card h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.gate-card p {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
}

.modal-back {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.62);
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}

.modal-back.on { display: flex; }

.modal {
  position: relative;
  width: min(640px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px 20px 16px;
}

.modal-x {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
}

.modal-h { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.modal-sub { margin: 0 0 14px; color: var(--text-dim); font-size: 13px; line-height: 1.45; }

.req-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.req-field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
}
.req-field input,
.alert-controls select,
.alert-controls input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px;
}

.req-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.req-email { font-size: 12px; color: var(--text-mute); }

.req-submit {
  background: var(--orange);
  color: var(--orange-ink);
  border: none;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 10px;
}
.alert-on { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.alert-controls { display: flex; gap: 8px; align-items: center; }
.alert-controls input { width: 88px; }

@media (max-width: 640px) {
  .alert-row { grid-template-columns: 1fr; }
}

.desk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.panel > .desk-stats { padding: 8px 10px 4px; }

.desk-stat {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 12px;
  min-width: 0;
}

.desk-stat .k {
  display: block;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.desk-stat {
  display: flex;
  flex-direction: column;
  min-height: 84px;
}
.desk-stat b {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.gate-blur.desk {
  display: grid;
  gap: 8px;
}

.desk-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
}

.desk-note { margin: 0; color: var(--text-dim); font-size: var(--text-sm); }

.wire-list { display: flex; flex-direction: column; }
.wire-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.wire-row:hover { background: var(--panel-spot); }
.wire-src {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.wire-title { font-size: 13px; }
.wire-when { color: var(--text-mute); font-family: var(--font-mono); font-size: 11px; }

.launch-bar, .screen-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.launch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.launch-cell {
  min-height: 160px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.launch-cell header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-hd);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--orange);
  cursor: grab;
}

.launch-body { padding: 10px 12px; font-size: 13px; }
.launch-body p { margin: 0 0 6px; }

.star {
  border: 0;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
}
.star.on { color: var(--orange); }

@media (max-width: 800px) {
  .desk-stats, .desk-grid, .launch-grid { grid-template-columns: 1fr; }
  .wire-row { grid-template-columns: 72px 1fr; }
  .wire-when { grid-column: 2; }
}

.skel-host { position: relative; overflow: hidden; background: var(--panel); }
.skel {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #101318 0%, #1c212b 45%, #101318 100%);
  background-size: 220% 100%;
  animation: skel 1.15s ease-in-out infinite;
}
@keyframes skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.viz-canvas { display: block; width: 100%; height: 220px; }
.viz-canvas.mini { height: 72px; }
.metric-spark { display: block; width: 100%; height: 42px; }

.mp-stack, .mined-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px;
}
.mp-col { flex: 1 0 72px; min-width: 72px; }
.mp-bands {
  display: flex;
  flex-direction: column;
  height: 168px;
  border: 1px solid var(--line);
}
.mp-bands i { flex: 1; display: block; }
.mp-cap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
}
.mp-cap b { color: var(--orange); letter-spacing: 0.08em; }
.mined-block {
  flex: 1 0 88px;
  min-width: 88px;
  min-height: 64px;
  padding: 8px;
  color: #1a0d00;
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.mined-block b { font-size: 11px; letter-spacing: 0.04em; }

.launch-x {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
}
.launch-cell header { touch-action: none; }
.chart-host { height: 280px; min-height: 280px; }

.yield-trio,
.btctc-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.btctc-charts { grid-template-columns: 1fr 1fr; }
.yield-trio .chart-box { margin-top: 0; }
/* Compact row constraints stay on the closed card. A maximized card uses the
   shared modal, so these widths must not follow it. */
#macro-top > .panel:not(.is-max),
#macro-top > .panel:not(.is-max) .chart-box,
#macro-top > .panel:not(.is-max) .controls,
#macro-top > .panel:not(.is-max) .table-wrap {
  min-width: 0;
  max-width: 100%;
}
#macro-top > .chart-panel,
#watch {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#macro-top .equity-chart {
  flex: 1 1 auto;
  min-height: 0;
}
#macro-top > .panel:not(.is-max) .equity-chart {
  height: 280px;
}
#macro-top .chart-foot { padding-bottom: 8px; }
#watch .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}
#watch th,
#watch td {
  white-space: nowrap;
  padding: 3px 8px;
  line-height: 1.25;
}
/* The open card fills the centered modal. Rows grow with it and stay readable. */
#watch.is-max {
  overflow: hidden;
}
#watch.is-max .table-wrap {
  overflow: auto;
}
#watch.is-max table {
  height: 100%;
}
#watch.is-max th,
#watch.is-max td {
  vertical-align: middle;
}
@media (min-width: 1101px) {
  /* Matches a Treasury yield panel: header, one control row, and the 280px chart.
     The open card keeps the shared modal height instead of this row height. */
  #macro-top > .panel:not(.is-max) { height: 351px; }
  #macro-top .controls {
    flex-wrap: nowrap;
    min-width: 0;
  }
  #macro-top .seg,
  #macro-top .cmp-label { flex: none; }
  #macro-top .seg { flex-wrap: nowrap; }
  #macro-top .btn {
    padding: 0 6px;
    letter-spacing: 0;
  }
  #macro-top .seg:last-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  #watch:not(.is-max) .table-wrap { overflow: hidden; }
  #watch:not(.is-max) table { height: 100%; }
  #watch.is-max th,
  #watch.is-max td {
    padding: 8px 16px;
    font-size: 13px;
  }
}
#yield-stack { min-width: 0; }
#yield-stack .panel,
#yield-stack .chart-box,
#yield-stack .viz-canvas { min-width: 0; }
.seg.yield-ranges {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}
.seg.yield-ranges .btn { flex: none; }
.yield-scrub-row { width: 100%; }
.yield-scrub {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  accent-color: #fd6f0b;
}
.scrub-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
}
#wti > .wti-max-controls { display: flex; }
#wti:not(.is-max) #wti-interval,
#wti:not(.is-max) #wti-status { display: none; }

.lwc-host, [data-series] { position: relative; }
.lwc-host a#tv-attr-logo { display: none !important; }
.lwc-fill { height: 100%; min-height: 160px; }
.lwc-mini { width: 148px; height: 56px; }
.spark.lwc-mini { width: calc(100% - 28px); height: 104px; }

.zone-bands,
.zone-labels {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.zone-bands { z-index: 0; }

.zone-labels { z-index: 2; }

.zone-band {
  position: absolute;
  left: 0;
  right: 0;
}

.zone-label {
  position: absolute;
  left: 6px;
  transform: translateY(-50%);
  padding: 0 3px;
  color: #d5dbe3;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.lwc-host:not(.lwc-mini) .zone-label {
  left: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.launch-body .lwc-mini { width: 100%; height: 120px; margin-top: 8px; }
.lwc-legend {
  position: absolute;
  z-index: 4;
  top: 4px;
  left: 8px;
  right: 56px;
  margin: 0;
  pointer-events: none;
}
.lwc-legend .chip-toggle {
  pointer-events: auto;
}
.lwc-legend .chip-toggle:not(.on) {
  opacity: 0.4;
}
.lwc-ends {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.lwc-end {
  position: absolute;
  transform: translateY(-50%);
  padding: 0 4px;
  border-radius: 2px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.lwc-host.is-compact .lwc-end {
  font-size: 8px;
  line-height: 11px;
  padding: 0 2px;
  letter-spacing: 0;
}
.chart-box:has(.lwc-split),
.max-chart:has(.lwc-split) {
  display: flex;
  flex-direction: column;
}
.lwc-split {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}
.lwc-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}
.lwc-pane + .lwc-pane { border-top: 1px solid #23282f; }
.lwc-split .lwc-fill {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}
.chart-tools {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  max-width: 100%;
}
.panel-hd .hd-note ~ .chart-tools { margin-left: 8px; }
.panel-hd:has(.chart-tools) {
  flex-wrap: wrap;
  row-gap: 4px;
}
.chart-tool { display: inline-flex; flex: none; }
.chart-tool button {
  height: 20px;
  margin-left: -1px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}
.chart-tool button:first-child { margin-left: 0; }
.chart-tool button.on {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--orange-ink);
  font-weight: 600;
}
.chart-tool button:hover { border-color: var(--orange); color: var(--text); }
.chart-tool button.on:hover { color: var(--orange-ink); }

.draw-slot {
  display: none;
  position: relative;
  flex: none;
  margin-left: 8px;
}
.panel.is-max .draw-slot { display: inline-flex; }
.panel-hd > .draw-slot:nth-child(2) { margin-left: auto; }
.panel-hd .hd-note ~ .draw-slot { margin-left: 8px; }
.draw-pop {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: min(92vw, 420px);
  padding: 3px;
  background: #12141a;
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.draw-pop[hidden] { display: none !important; }
.draw-tools,
.draw-colors,
.draw-actions {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 2px;
}
.draw-pop button {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex: none;
}
.draw-pop svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}
.draw-pop > button.on,
.draw-tools button.on,
.draw-actions button.on {
  background: #FD6F0B;
  border-color: #FD6F0B;
  color: var(--orange-ink);
}
.draw-pop button:hover { color: var(--text); border-color: var(--line-strong); }
.draw-pop > button.on:hover,
.draw-tools button.on:hover,
.draw-actions button.on:hover { color: var(--orange-ink); border-color: #FD6F0B; }
.draw-pop button:disabled { opacity: 0.35; cursor: default; }
.draw-pop button:disabled:hover { color: var(--text-dim); border-color: transparent; }
.draw-colors button {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-strong);
  background: var(--swatch, #FD6F0B);
}
.draw-colors button.on {
  background: var(--swatch, #FD6F0B);
  box-shadow: 0 0 0 1px #0c0e11, 0 0 0 2px #FD6F0B;
}
.draw-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  pointer-events: none;
  display: block;
}
.chart-box.is-drawing,
.chart-box.is-drawing * { cursor: crosshair !important; }
.chart-box.is-moving,
.chart-box.is-moving * { cursor: grabbing !important; }
.chart-box.is-drawing { user-select: none; }
.chart-box,
.lwc-fill,
.viz-canvas {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.lwc-tip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  min-width: 112px;
  max-width: 240px;
  padding: 6px 8px;
  background: rgba(12, 14, 17, 0.94);
  border: 1px solid var(--orange);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
}
.lwc-tip b {
  display: block;
  margin-bottom: 2px;
  color: var(--text-dim);
  font-weight: 500;
}
.lwc-tip i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
}

.hbars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 12px;
}
.hbar-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 4px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.hbar-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; }
.hbar {
  display: grid;
  grid-template-columns: var(--hbar-label, 92px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  padding: 2px 4px;
}
.hbar:hover { background: rgba(253, 111, 11, 0.08); }
.hbar-k {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.hbar-track {
  height: 10px;
  background: #161b22;
}
.hbar-fill { display: block; height: 100%; min-width: 1px; }
.hbar-n {
  min-width: 58px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.hbar:has(.hbar-track + .hbar-n + .hbar-track) {
  grid-template-columns: var(--hbar-label, 72px) minmax(0, 1fr) auto minmax(0, 1fr) auto;
}
.hbar-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 10px;
  background: #161b22;
}
.hbar-neg, .hbar-pos { height: 100%; }
.hbar-neg span, .hbar-pos span { display: block; height: 100%; }
.hbar-neg span { margin-left: auto; }
.hbar-empty { margin: 0; padding: 12px; color: var(--text-dim); }

.fomc-host, .fomc-list { min-height: 180px; }
.fomc-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px 12px;
}
.fomc-meet header {
  margin-bottom: 4px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.fomc-meet .hbar {
  grid-template-columns: 148px minmax(0, 1fr) auto;
  padding-left: 0;
}
.fomc-meet .hbar-k { white-space: nowrap; }

.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 10px;
  padding: 12px;
}
.mp-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #10141a;
  border: 1px solid #23282f;
}
.mp-block header,
.mp-block footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
}
.mp-block header { border-bottom: 1px solid #23282f; }
.mp-block footer { border-top: 1px solid #23282f; }
.mp-block header b { color: var(--text); letter-spacing: 0.06em; }
.mp-fee {
  color: #1a0d00;
  background: var(--orange);
  padding: 1px 5px;
  font-weight: 600;
}
.mp-bands {
  display: flex;
  flex-direction: column;
  height: 112px;
}
.mp-bands i { flex: 1 1 auto; display: block; min-height: 2px; }
.mined-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  padding: 12px;
}
.mined-block {
  min-height: 88px;
  padding: 8px;
  color: #1a0d00;
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
}
.mined-block b { font-size: 12px; letter-spacing: 0.03em; }

.btctc-table tr { cursor: pointer; }
.btctc-table tr.on { background: var(--panel-spot); }
.desk-note.tight { margin: 0; padding: 0 12px 10px; }

.desk-stat .sub {
  display: block;
  margin-top: 4px;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.35;
}
#headlines .panel-hd { flex-wrap: wrap; gap: 8px; }
.cal-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
}
.cal-card {
  flex: 1 0 168px;
  min-width: 168px;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #10151c;
}
.cal-card .k {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.cal-card b {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.cal-card .when {
  display: block;
  margin-top: 6px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 11px;
}

.regime-wrap {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 12px 14px 4px;
}
.regime-plot {
  width: 100%;
  aspect-ratio: 1;
  min-height: 260px;
}
.regime-plot svg { width: 100%; height: 100%; display: block; }
.panel.metric .panel-hd,
.chart-panel .panel-hd {
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 2px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.panel.metric .hd-note,
.chart-panel .hd-note {
  min-width: 0;
  white-space: normal;
  text-align: right;
  line-height: 1.35;
  max-width: 70%;
}
#regime-bars { padding: 0 12px 8px; }
#regime-bars .hbar { grid-template-columns: 148px minmax(0, 1fr) auto; }
#regime-bars .hbar-k { white-space: nowrap; }

.regime-name {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 500;
}
.regime-blurb { margin: 8px 0 12px; color: var(--text-dim); font-size: 14px; line-height: 1.45; max-width: 46ch; }
.regime-axes { display: grid; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.desk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}
.desk-grid .chart-box { margin-top: 0; }
@media (max-width: 900px) {
  .regime-wrap, .desk-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .yield-trio, .fomc-list { grid-template-columns: 1fr; }
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  align-items: stretch;
}
.chart-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1680px) {
  .chart-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
#wti { grid-column: 1 / -1; }

#wti.is-max > .wti-max-controls { display: flex; }

#wti.is-max .chart-box,
#wti.is-max .chart-box * { touch-action: none !important; }
.chart-grid > .panel,
.chart-grid .chart-box,
.chart-grid .viz-canvas,
.chart-grid .chart-host { min-width: 0; }
.chart-grid .chart-box { margin-top: 0; }
.chart-grid .viz-canvas,
.chart-grid .chart-host { height: 280px; }
@media (max-width: 800px) {
  .chart-grid,
  .chart-grid.cols-3 { grid-template-columns: 1fr; }
}

.regime-card-wrap { display: flex; align-items: stretch; }
.regime-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  flex: 1;
  min-height: 100%;
  margin: 0;
  padding: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.regime-mini { width: 96px; height: 96px; }
.regime-mini svg { width: 100%; height: 100%; display: block; }
.regime-card .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.regime-card .regime-name { font-size: 28px; margin-top: 4px; }
.regime-scores {
  margin-top: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}
.regime-open-hint {
  margin-top: 8px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.modal.regime-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  box-sizing: border-box;
}
#gdpnow-bars { padding: 8px 12px 4px; }
#gdpnow-bars .hbar { grid-template-columns: 108px minmax(0, 1fr) auto; }
#gdpnow-bars .hbar-k { white-space: nowrap; }

.heat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
  padding: 10px;
}
.heat-cell {
  min-height: 72px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.heat-cell b,
.heat-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.heat-cell b { letter-spacing: 0.06em; }
.heat-cell .num { font-family: var(--font-mono); font-size: 13px; }

.alert-empty { padding: 16px 12px; color: var(--text-dim); }
.alert-empty p { margin: 0 0 12px; max-width: 36ch; }
.member-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.member-alert span:first-child { min-width: 0; }
.alerts-expand {
  border: 0;
  background: transparent;
  color: var(--orange);
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.08em;
}
.src-short {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
@media (max-width: 720px) {
  #regime-bars .hbar { grid-template-columns: minmax(0, 46%) minmax(0, 1fr) auto; }
  #regime-bars .hbar-k { white-space: normal; }
  .regime-card { grid-template-columns: 72px minmax(0, 1fr); }
  .regime-mini { width: 72px; height: 72px; }
  .regime-card .regime-name { font-size: 22px; }
}
@media (min-width: 1680px) {
  .btctc-charts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .btctc-charts { grid-template-columns: 1fr; }
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  height: 100%;
  margin: 0;
  padding: 16px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: center;
}

.perp-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.perp-asof {
  flex: 1 1 240px;
  min-width: 0;
  margin-left: auto;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}
.chart-grid.perp-grid { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .chart-grid.perp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .chart-grid.perp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.perp-grid > .panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}
.perp-grid .panel-hd { flex-wrap: wrap; row-gap: 4px; }
.perp-grid .panel-hd .seg { margin-left: auto; }
.perp-grid .panel-hd .hd-note { margin-left: 8px; max-width: none; }
.perp-chart { height: 248px; min-height: 248px; }
.panel.is-max .perp-chart { height: auto; min-height: 0; }
.perp-stack { display: flex; flex-direction: column; min-width: 0; }
.stack-read {
  min-height: 18px;
  padding: 2px 12px 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.01em;
}
.stack-pane { border-top: 1px solid var(--line); }
.stack-pane[hidden] { display: none; }
.stack-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 6px 12px 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.stack-cap b { color: var(--text); font-weight: 500; }
.stack-cap .long { color: var(--green); }
.stack-cap .short { color: var(--orange); }
#perp-stack > .desk-stats { border-top: 1px solid var(--line); }
.panel.is-max#perp-stack > .desk-stats { display: none; }
#perp-stack > .stack-max-controls { display: none; }
#perp-stack.is-max > .stack-max-controls {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--panel);
}
#perp-stack.is-max > .stack-max-controls .seg { flex: none; flex-wrap: wrap; }
/* One time axis on the stack. The scale stays alive so pan is not stuck at width 0. */
.stack-chart:not(.stack-axis) tr:last-child {
  height: 0 !important;
  visibility: collapse !important;
  line-height: 0 !important;
}
.stack-chart:not(.stack-axis) tr:last-child td {
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.stack-chart.stack-price { height: 340px; }
.stack-chart.stack-sub { height: 148px; }
.panel.is-max#perp-stack {
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.panel.is-max#perp-stack .perp-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.panel.is-max#perp-stack .stack-chart.stack-price {
  height: auto;
  flex: 1.8 1 220px;
  min-height: 200px;
}
.panel.is-max#perp-stack .stack-pane {
  flex: 1 1 120px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.panel.is-max#perp-stack .stack-pane[hidden] {
  display: none;
  flex: none;
}
.panel.is-max#perp-stack .stack-pane .stack-chart {
  height: auto;
  flex: 1 1 auto;
  min-height: 96px;
}
.perp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 10px 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}
.perp-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  vertical-align: -1px;
}
.perp-bars { min-height: 180px; }
.perp-bars .hbar { --hbar-label: 112px; }
.perp-bars .hbar-k,
.perp-bars .hbar-n { white-space: nowrap; }
.vol-stack {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 220px;
  padding: 8px 10px 12px;
}
.vol-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.vol-col span {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
}
.vol-col i { display: block; width: 100%; min-height: 0; flex: 1 1 0; }
@media (min-width: 900px) {
  .perp-grid > .panel.span-all { grid-column: 1 / -1; }
}
.perp-table { width: 100%; border-collapse: collapse; }
.perp-table th,
.perp-table td {
  padding: 6px 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.perp-table th { cursor: pointer; color: var(--text-dim); font-weight: 500; }
.perp-table th.on { color: var(--orange); }
.perp-table th.desc::after { content: " \2193"; }
.perp-table th.asc::after { content: " \2191"; }
.perp-table tr:hover td { background: rgba(253, 111, 11, 0.06); }
.fund-matrix td.neg { background: rgba(255, 91, 74, 0.16); }
.perp-etf { padding: 12px; }
.perp-etf .desk-stat { max-width: 280px; min-height: 0; }
.perp-etf a { color: var(--orange); }
.perp-grid .chart-foot { margin-top: auto; }
