/*
 * Pairs board (board.html / js/board/main.js). Loaded after styles.css +
 * terminal.css, reusing their palette tokens and toast styles.
 */

/* Board text runs at 1.5× the base size: everything sized in rem (text, card
   widths, the HUD rail, tables) scales from here; canvases follow via uiScale(). */
.board-root { font-size: 150%; }
.board-page { min-height: 100vh; }

.board-connect {
  max-width: 26.25rem;
  margin: 12vh auto 0;
  padding: 0 16px;
  text-align: center;
}

.board-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.board-top .brand { color: var(--text); font-weight: 700; text-decoration: none; }
.board-title { font-weight: 600; }
.board-title small { color: var(--muted); font-weight: 400; margin-left: 0.35rem; }
.board-paper { margin-left: auto; font-size: 0.8rem; color: var(--accent); letter-spacing: 0.04em; }

.board-key {
  margin: 10px 16px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.board-key summary {
  padding: 0.6rem 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}
.board-key[open] summary { border-bottom: 1px solid var(--line); }
.key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18.125rem, 1fr));
  gap: 1rem 1.5rem;
  padding: 0.9rem 1rem 1rem;
}
.key-item h3 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.35rem; font-size: 0.86rem; }
.key-item p { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.key-item p b { color: var(--text); font-weight: 600; }
.key-orb {
  --s: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  transform: scale(var(--s));
}
.key-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; background: var(--c); box-shadow: 0 0 6px var(--c); }
.key-line { width: 18px; height: 3px; border-radius: 2px; display: inline-block; flex: none; background: linear-gradient(90deg, #3987e5 0 33%, #d95926 33% 66%, #199e70 66%); }
.key-bar { height: 10px; border-radius: 5px; }
.key-bar-heat {
  background: linear-gradient(90deg, rgb(42, 10, 72) 0%, rgb(96, 26, 128) 35%, rgb(196, 48, 92) 60%, rgb(255, 96, 20) 80%, rgb(255, 150, 30) 100%);
}
.key-bar-vol { background: linear-gradient(90deg, rgb(102, 51, 170) 0%, rgb(255, 70, 160) 50%, rgb(190, 225, 60) 80%, rgb(40, 235, 100) 100%); }
.key-vol { display: inline-flex; color: rgb(255, 70, 160); filter: drop-shadow(0 0 4px rgb(255, 70, 160)); }
.key-item p.key-note { margin-top: 0.45rem; font-size: 0.7rem; font-style: italic; }
.key-arrows { display: inline-flex; gap: 1px; font-size: 0.7rem; }
.key-arrows .up { color: var(--up); font-style: normal; }
.key-arrows .down { color: var(--down); font-style: normal; }
.key-bar-move { background: linear-gradient(90deg, hsl(120 90% 50%), hsl(60 90% 50%), hsl(0 90% 50%)); }
.key-scale { display: flex; justify-content: space-between; margin-top: 0.3rem; font-size: 0.7rem; color: var(--muted); line-height: 1.3; }
.key-scale span:nth-child(2) { text-align: center; }
.key-scale span:last-child { text-align: right; }
.key-sizes { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.5rem; padding-top: 0.4rem; }
.key-sizes span { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; font-size: 0.7rem; line-height: 1.3; text-align: center; color: var(--muted); }
.key-badge {
  padding: 0.05rem 0.4rem;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--muted);
  border-radius: 999px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.75rem, 1fr));
  gap: 14px;
  padding: 8px 16px 32px;
}

.pair-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.pair-card.missing { color: var(--muted); font-size: 0.85rem; justify-content: center; min-height: 140px; }

/* Volume orb: color + glow from heat, size from hold time. */
.orb-slot {
  height: 96px;
  display: grid;
  place-items: center;
}
.orb {
  --orb: rgb(42, 10, 72);
  --orb-core: rgb(96, 26, 128);
  --orb-scale: 1;
  --orb-glow: 4px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, var(--orb-core) 0%, var(--orb) 62%, transparent 100%);
  box-shadow: 0 0 var(--orb-glow) var(--orb), 0 0 calc(var(--orb-glow) * 2) color-mix(in srgb, var(--orb) 45%, transparent);
  transform: scale(var(--orb-scale));
  transition: transform 1.2s ease, background 0.6s ease, box-shadow 0.6s ease;
}
.orb.fire { animation: orb-flicker 0.9s ease-in-out infinite alternate; }
@keyframes orb-flicker {
  0%   { filter: brightness(1) saturate(1.1); }
  50%  { filter: brightness(1.25) saturate(1.3); }
  100% { filter: brightness(1.05) saturate(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .orb.fire { animation: none; transition: none; }
}

.pair-head { display: flex; align-items: center; justify-content: space-between; }
.pair-signals { display: flex; align-items: center; gap: 0.6rem; }
.vol-sym {
  --vol: rgb(102, 51, 170);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.vol-icon { display: inline-flex; color: var(--vol); filter: drop-shadow(0 0 4px var(--vol)); transition: color 0.6s ease; }
.pair-sym { font-weight: 700; font-size: 1.05rem; }
.pair-sym span { color: var(--muted); font-weight: 400; }
.move-dot {
  --move: hsl(120 90% 50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--move);
  box-shadow: 0 0 8px var(--move);
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

.pair-price {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
}
.pair-price.tick { animation: price-tick 0.5s ease-out; }
@keyframes price-tick { from { background: color-mix(in srgb, var(--text) 12%, transparent); } to { background: transparent; } }

.pair-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pair-change.up { color: var(--up); }
.pair-change.down { color: var(--down); }

.pair-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair-actions button { padding: 0.5rem 0; font-weight: 600; border: 0; border-radius: 8px; color: #fff; cursor: pointer; }
.btn-buy { background: var(--up); }
.btn-sell { background: var(--down); }
.pair-actions button:hover:not(:disabled) { filter: brightness(1.12); }

/* ── Overlay chart (js/board/overlay.js) ───────────────────────────────── */

.overlay-panel {
  margin: 4px 16px 14px;
  padding: 0.8rem 1rem 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ov-head { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.ov-tfs { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ov-tf {
  padding: 0.3rem 0.7rem;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ov-tf:last-child { border-right: 0; }
.ov-tf.on { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); font-weight: 700; }
.ov-progress-track { height: 2px; margin-top: 0.5rem; background: var(--line); border-radius: 2px; overflow: hidden; }
.ov-progress { height: 100%; width: 100%; background: var(--muted); transform-origin: left; }
.ov-progress.held { transform: scaleX(0); }
.ov-progress-track.off { visibility: hidden; }
@keyframes ov-countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ov-sub { color: var(--muted); font-size: 0.78rem; }
.ov-speed-wrap { margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.78rem; }
.ov-speed {
  padding: 0.25rem 0.4rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
}
.ov-pause { padding: 0.2rem 0.6rem; }

.ov-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.6rem 0 0.4rem; }
.ov-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ov-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ov-chip-sym { color: var(--text); font-weight: 600; }
.ov-chip.on { border-color: var(--text); color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
.ov-chip.on::after { content: "locked"; font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

.ov-plot { position: relative; }
.ov-canvas { display: block; width: 100%; height: 17.5rem; cursor: crosshair; touch-action: pan-y; }
@media (max-width: 600px) { .ov-canvas { height: 12.5rem; } }
.ov-tip {
  position: absolute;
  top: 8px;
  z-index: 2;
  min-width: 9.375rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.ov-tip-t { color: var(--muted); margin-bottom: 0.25rem; }
.ov-tip-row { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 0.45rem; color: var(--muted); }
.ov-tip-row em { font-style: normal; }
.ov-tip-row i { width: 8px; height: 8px; border-radius: 50%; }
.ov-tip-row b { color: var(--text); font-weight: 500; }
.ov-tip-row.on span, .ov-tip-row.on b { color: var(--text); font-weight: 700; }

/* Card ↔ chart identity: series-color stripe; a locked card keeps a ring. */
.pair-card { border-top: 3px solid var(--series, var(--line)); transition: box-shadow 0.3s ease; cursor: pointer; }
.pair-card.missing { cursor: default; }
.pair-card.locked::before {
  content: "Locked";
  position: absolute;
  top: 10px;
  left: 12px;
  padding: 0.1rem 0.45rem;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--series);
  border-radius: 999px;
}
.pair-card.locked { box-shadow: 0 0 0 1px var(--series), 0 0 18px color-mix(in srgb, var(--series) 35%, transparent); }

/* Per-card order box: amount + unit, "≈" hint, Buy/Sell (Long/Short), position row */
.order-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.3rem;
  padding: 0.55rem 0.6rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: default;
}
.pair-amount { display: flex; align-items: stretch; gap: 6px; }
.amt-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.amt-units { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.amt-unit {
  padding: 0 0.5rem;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  font-size: 0.72rem;
  white-space: nowrap;
  cursor: pointer;
}
.amt-unit + .amt-unit { border-left: 1px solid var(--line); }
.amt-unit.on { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); font-weight: 700; }
.amt-hint { min-height: 1.1em; font-size: 0.72rem; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; }
.pair-pos { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; min-height: 1.5rem; font-size: 0.72rem; }
.pos-text { color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.35; }
.pos-text.up { color: var(--up); }
.pos-text.down { color: var(--down); }
.pos-btn {
  flex: none;
  padding: 0.15rem 0.55rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.7rem;
  cursor: pointer;
}
.pos-btn:hover:not(:disabled) { border-color: var(--muted); }

/* API keys dialog (hosts js/trade/keysUI.js; its inner styles come from terminal.css) */
.keys-btn { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.keys-dialog {
  width: min(35rem, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
}
.keys-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.keys-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}
.keys-dialog-head h2 { margin: 0; font-size: 1rem; }
.keys-dialog-note { margin: 0.8rem 1rem 0; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.keys-dialog-note b { color: var(--text); }
#keys-body { padding: 0.8rem 1rem 1rem; }

/* Pump / dump + count-up timers (js/board/moves.js) */
.moves {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.2rem 0 0.1rem;
  padding: 0.45rem 0.6rem;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}
.mv-row { display: grid; grid-template-columns: 2.9em auto 1fr; align-items: baseline; gap: 0.5rem; white-space: nowrap; }
.mv-k { color: var(--muted); }
.mv-val.up, .mv-arrow.up { color: var(--up); }
.mv-val.down, .mv-arrow.down { color: var(--down); }
.mv-ago { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; }
.mv-caption { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.68rem; }
.mv-tv { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.mv-time { font-weight: 600; color: var(--text); }
.mv-arrow { font-style: normal; font-size: 0.62rem; }

/* Spot ↔ perp switch (per card) */
.mkt-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: 0.7rem; }
.mkt-seg.mkt-only { padding: 0.22rem 0.5rem; color: var(--muted); }
.mkt-btn {
  padding: 0.22rem 0.55rem;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  font-size: 0.7rem;
  cursor: pointer;
}
.mkt-btn { white-space: nowrap; }
.mkt-btn + .mkt-btn { border-left: 1px solid var(--line); }
.mkt-btn.on { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); font-weight: 700; }
.pair-card.is-perp .mkt-btn.on { background: color-mix(in srgb, var(--series) 30%, transparent); }
.perp-info { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.lev-wrap { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; color: var(--muted); }
.lev-select {
  padding: 0.15rem 0.25rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.75rem;
}
/* Class display rules (flex/grid) would otherwise beat the UA [hidden] rule. */
.board-page [hidden] { display: none !important; }

/* Colored hover tip for price ranges (low · difference · high) */
.hover-tip {
  position: fixed;
  z-index: 50;
  display: flex;
  gap: 0.7rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}
.tip-lo { color: #ff5252; }
.tip-diff { color: #ff9800; }
.tip-hi { color: #2ee66b; }

/* ── Pair HUD (js/board/hud.js): full-screen popup opened from a card's HUD button ── */
.pair-sym .hud-open {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  padding: 0.12rem 0.45rem;
  vertical-align: 2px;
  background: color-mix(in srgb, var(--series, var(--primary)) 16%, transparent);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--series, var(--primary)) 55%, transparent);
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.pair-sym .hud-open span { color: inherit; display: inline-flex; }
.pair-sym .hud-open:hover { background: color-mix(in srgb, var(--series, var(--primary)) 32%, transparent); }

.hud-dialog {
  width: min(1560px, calc(100vw - 16px));
  height: calc(100vh - 16px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--series, var(--line)) 60%, var(--line));
  border-radius: 14px;
  box-shadow: 0 0 60px color-mix(in srgb, var(--series, #000) 25%, transparent);
  overflow: hidden;
}
.hud-dialog[open] { display: flex; }
.hud-dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(3px); }
.hud-dialog .up { color: var(--up); }
.hud-dialog .down { color: var(--down); }
.hud-dialog .muted { color: var(--muted); }
.hud-dialog .hot { color: #ff9a3c; }

.hud-top { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.hud-tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: thin; }
.hud-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 4.875rem;
  padding: 0.25rem 0.6rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-top: 2px solid var(--series);
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.25;
}
.hud-tab b { color: var(--text); }
.hud-tab small { font-variant-numeric: tabular-nums; }
.hud-tab:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.hud-tab.on { background: color-mix(in srgb, var(--series) 18%, transparent); border-color: color-mix(in srgb, var(--series) 50%, transparent); }
.hud-close { flex: none; width: 1.9rem; height: 1.9rem; font-size: 1.2rem; }

.hud-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.6rem; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.hud-id { display: flex; align-items: center; gap: 0.7rem; }
.hud-orb { width: 14px; height: 14px; border-radius: 50%; background: var(--c, #555); box-shadow: 0 0 12px var(--c, transparent); }
.hud-sym { display: flex; align-items: baseline; gap: 0.15rem; flex-wrap: wrap; }
.hud-sym b { font-size: 1.35rem; }
.hud-sym span { color: var(--muted); font-size: 1rem; }
.hud-sym small { width: 100%; color: var(--muted); font-size: 0.68rem; }
.hud-mkt { align-self: center; }
.hud-mkt .mkt-only { padding: 0.22rem 0.5rem; color: var(--muted); }
.hud-quote { display: flex; flex-direction: column; }
.hud-price { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; border-radius: 6px; }
.hud-price.tick-up { animation: hud-flash-up 0.6s ease-out; }
.hud-price.tick-down { animation: hud-flash-down 0.6s ease-out; }
@keyframes hud-flash-up { from { color: var(--up); text-shadow: 0 0 14px var(--up); } }
@keyframes hud-flash-down { from { color: var(--down); text-shadow: 0 0 14px var(--down); } }
.hud-chg { font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: pre; }
.hud-headstats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; margin-left: auto; }
.hud-hs { display: flex; flex-direction: column; font-size: 0.7rem; }
.hud-hs span { color: var(--muted); }
.hud-hs b { font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.hud-hs-range { min-width: 6.875rem; justify-content: space-between; }
.hud-range { position: relative; height: 6px; margin: 6px 0 3px; border-radius: 3px; background: linear-gradient(90deg, var(--down), #f5c542, var(--up)); opacity: 0.85; }
.hud-range i { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; background: var(--text); border-radius: 2px; box-shadow: 0 0 6px var(--text); }

.hud-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 20.625rem; }
.hud-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 8px 10px 10px 14px; gap: 6px; overflow-y: auto; }
.hud-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.hud-tfs, .hud-inds { display: flex; flex-wrap: wrap; gap: 4px; }
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.72rem;
}
.hud-chip i { width: 10px; height: 3px; border-radius: 2px; opacity: 0.4; }
.hud-chip.on { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.hud-chip.on i { opacity: 1; }
.hud-readout { min-height: 1.1em; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-chartbox { position: relative; flex: 1 0 auto; min-height: max(300px, 48vh); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.hud-chart, .hud-over { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-over { pointer-events: none; }
.hud-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; pointer-events: none; }
.hud-rsibox { position: relative; flex: none; height: 4.875rem; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.hud-rsi { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-rsi-label { position: absolute; top: 3px; left: 8px; font-size: 0.68rem; color: #c792ea; pointer-events: none; }

.hud-stats { flex: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 8px; }
.hud-sg { padding: 0.5rem 0.7rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.hud-sg h4 { margin: 0 0 0.3rem; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hud-si { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.74rem; line-height: 1.55; }
.hud-si span { color: var(--muted); white-space: nowrap; }
.hud-si b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.hud-si-wide b { text-align: left; font-weight: 500; }

.hud-rail { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 8px 12px 10px 4px; overflow-y: auto; }
.hud-card { padding: 0.6rem 0.7rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.hud-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin: 0 0 0.45rem; font-size: 0.8rem; }
.hud-card h3 small { color: var(--muted); font-weight: 400; font-size: 0.66rem; text-align: right; }
.hud-ticket { display: flex; flex-direction: column; gap: 6px; }
.hud-ticket h3 { margin-bottom: 0; }
.hud-ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hud-quick { display: flex; gap: 4px; }
.hud-quick button { padding: 0.15rem 0.4rem; font-size: 0.68rem; border-radius: 5px; color: var(--muted); }
.hud-quick button:hover { color: var(--text); }
.hud-pos { color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.35; }

.hud-imb { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.hud-imb-bid { background: var(--up); width: 50%; transition: width 0.3s; }
.hud-imb-ask { background: var(--down); width: 50%; transition: width 0.3s; }
.hud-book-head, .hud-lvl { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 4px; font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.hud-book-head { margin: 0.45rem 0 0.15rem; color: var(--muted); font-size: 0.64rem; }
.hud-book-head span:not(:first-child), .hud-lvl span:not(:first-child) { text-align: right; }
.hud-lvl { position: relative; line-height: 1.5; }
.hud-lvl span { position: relative; }
.hud-bar { position: absolute; top: 1px; bottom: 1px; right: 0; border-radius: 2px; opacity: 0.18; }
.hud-bar.bid { background: var(--up); }
.hud-bar.ask { background: var(--down); }
.hud-spread { margin: 0.2rem 0; padding: 0.2rem 0; border-block: 1px dashed var(--line); text-align: center; font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.hud-flow { display: flex; flex-direction: column; gap: 4px; }
.hud-flowrow { display: grid; grid-template-columns: 1.4rem 1fr 4.4rem; align-items: center; gap: 6px; font-size: 0.7rem; }
.hud-flowrow b { text-align: right; font-variant-numeric: tabular-nums; }
.hud-tapecard { flex: 1 0 auto; }
.hud-tape { max-height: 16.25rem; overflow-y: auto; }
.hud-trade.up span:first-child { color: var(--up); }
.hud-trade.down span:first-child { color: var(--down); }
.hud-trade.big { font-weight: 700; background: color-mix(in srgb, currentColor 10%, transparent); }
.hud-trade.big.up { box-shadow: inset 3px 0 0 var(--up); }
.hud-trade.big.down { box-shadow: inset 3px 0 0 var(--down); }
.hud-trade.fresh { animation: hud-fresh 0.8s ease-out; }
@keyframes hud-fresh { from { background: color-mix(in srgb, var(--text) 14%, transparent); } }

.hud-note { margin: 0; padding: 5px 14px; border-top: 1px solid var(--line); font-size: 0.68rem; color: var(--muted); }
.hud-note kbd { padding: 0 0.3rem; border: 1px solid var(--line); border-radius: 4px; font-size: 0.64rem; font-family: inherit; }

@media (max-width: 900px) {
  .hud-dialog { width: 100vw; height: 100vh; border-radius: 0; }
  .hud-body { display: block; overflow-y: auto; }
  .hud-main { overflow: visible; padding: 8px 16px; }
  .hud-chartbox { flex: none; height: 52vh; min-height: 260px; }
  .hud-rail { overflow: visible; padding: 0 16px 12px; }
  .hud-headstats { margin-left: 0; }
  .hud-price { font-size: 1.5rem; }
  .hud-tape { max-height: 15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hud-price.tick-up, .hud-price.tick-down, .hud-trade.fresh { animation: none; }
}

/* ── Pump / dump rankings (js/board/moveRank.js); --rank = direction color ── */
.rank-pump { --rank: var(--up); }
.rank-dump { --rank: var(--down); }
.rank-title { font-weight: 700; }
.rank-title.up { color: var(--up); }
.rank-title.down { color: var(--down); }
.rank-panel { margin: 0 16px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
#dump-rank { margin-bottom: 32px; }
.rank-panel summary { padding: 0.6rem 1rem; color: var(--muted); font-size: 0.82rem; cursor: pointer; user-select: none; }
.rank-panel[open] summary { border-bottom: 1px solid var(--line); }
.rank-scroll { overflow-x: auto; padding: 0.5rem 0.6rem 0; }
.rank-table { width: 100%; min-width: 44rem; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; }
.rank-table thead th { padding: 0; }
.rank-table thead button {
  width: 100%;
  padding: 0.3rem 0.4rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
}
.rank-table thead button:hover { color: var(--text); }
.rank-table thead th.sorted button { color: var(--text); border-color: var(--rank); background: color-mix(in srgb, var(--rank) 14%, transparent); }
.rank-table thead th.sorted button::after { content: " ↓"; color: var(--rank); }
.rank-table th.rank-pair { width: 6.2rem; text-align: left; font-size: 0.72rem; color: var(--muted); font-weight: 400; padding-right: 0.3rem; }
.rank-name {
  padding: 0.25rem 0.55rem;
  background: transparent;
  color: var(--text);
  border: 0;
  border-left: 3px solid var(--series);
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.rank-name:hover { background: color-mix(in srgb, var(--series) 18%, transparent); }
.rank-table td {
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  border: 1px solid transparent;
}
.rank-table td.sorted { border-color: color-mix(in srgb, var(--rank) 30%, var(--line)); }
.rank-table td.none { background: transparent; color: var(--muted); }
.rank-cell { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.4rem; align-items: baseline; }
.rank-n { grid-row: span 2; align-self: center; font-style: normal; font-size: 0.66rem; color: var(--muted); min-width: 1.4em; }
.rank-cell b { font-size: 0.8rem; white-space: nowrap; }
.rank-cell small { font-size: 0.66rem; color: var(--rank); line-height: 1.3; }
.rank-table td.none .rank-cell small { color: var(--muted); }
.rank-table td.ongoing .rank-cell small { color: color-mix(in srgb, var(--rank) 70%, var(--muted)); }
.rank-note { margin: 0.4rem 1rem 0.7rem; font-size: 0.7rem; color: var(--muted); line-height: 1.45; }
.rank-note b { color: var(--text); }

/* Overdue analysis in the rankings: --od / --od-bg / --od-edge set per cell by moveRank.js (overdueColor). */
.rank-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; padding: 0.55rem 1rem 0; font-size: 0.72rem; color: var(--muted); }
.rank-bar-k { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.64rem; }
.rank-mode { align-self: center; }
.rank-mode .mkt-btn.on { background: color-mix(in srgb, var(--rank) 22%, transparent); }
.rank-source { margin-left: auto; font-size: 0.66rem; }
.rank-table td {
  background: var(--od-bg, transparent);
  box-shadow: inset 3px 0 0 var(--od-edge, transparent);
}
.rank-table td.late .rank-due { color: var(--od); font-weight: 700; }
.rank-table td.few { opacity: 0.6; border-style: dashed; border-color: var(--line); }
.rank-due { grid-column: 2; font-size: 0.64rem; color: var(--muted); line-height: 1.3; }
.rank-n { grid-row: span 3; }
.rank-foot { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: flex-start; padding: 0.3rem 1rem 0.7rem; }
.rank-foot .rank-note { flex: 1 1 24rem; margin: 0; }
.rank-legend { flex: 0 1 22rem; min-width: 14rem; }
.rank-legend-bar {
  height: 0.55rem;
  border-radius: 0.3rem;
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.15) 0%, rgb(245, 197, 66) 25%, rgb(255, 150, 50) 50%, rgb(239, 83, 80) 75%, rgb(224, 64, 251) 100%);
}
.rank-legend-scale { display: flex; justify-content: space-between; margin-top: 0.25rem; font-size: 0.6rem; color: var(--muted); line-height: 1.25; text-align: center; }
.rank-legend-scale span:first-child { text-align: left; }
.rank-legend-scale span:last-child { text-align: right; }
.rank-table td.active { box-shadow: inset 0 0 0 2px var(--rank); background: color-mix(in srgb, var(--rank) 16%, transparent); }
.rank-table td.active .rank-cell b { color: var(--rank); }

/* ── Exposure bar + caps (js/board/exposure.js) ── */
.exposure-bar { margin: 10px 16px 0; padding: 0.55rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 0.8rem; }
.exposure-bar.over { border-color: var(--down); box-shadow: 0 0 0 1px color-mix(in srgb, var(--down) 40%, transparent); }
.exp-main, .exp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.exp-sub { margin-top: 0.3rem; color: var(--muted); font-size: 0.74rem; }
.exp-k { color: var(--muted); }
.exp-sep { color: var(--line); }
.exp-muted { color: var(--muted); font-size: 0.72rem; }
.exp-meter { position: relative; flex: 0 1 12rem; min-width: 6rem; height: 0.55rem; border-radius: 0.3rem; background: var(--line); overflow: visible; }
.exp-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 0.3rem; background: var(--accent); transition: width 0.4s; }
.exposure-bar.over .exp-meter i { background: var(--down); }
.exp-meter em { position: absolute; top: -0.2rem; width: 2px; height: 0.95rem; margin-left: -1px; background: var(--text); }
.exp-stress { color: var(--down); cursor: help; }
.exp-btn { padding: 0.15rem 0.6rem; font-size: 0.72rem; border-radius: 6px; margin-left: auto; }
.amt-hint.over-cap { color: var(--down); }
.caps-form { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.caps-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.caps-row input[type="number"] { width: 4.5rem; padding: 0.3rem 0.4rem; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.caps-actions { display: flex; justify-content: flex-end; }

/* ── News panel (js/board/news.js) ── */
.news-panel { --rank: var(--primary); margin-top: 0; }
.news-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; padding: 0.6rem 1rem 0.2rem; }
.news-cats .mkt-btn { font-size: 0.72rem; padding: 0.25rem 0.6rem; }
.news-coin { font-size: 0.72rem; }
.news-status { margin-left: auto; font-size: 0.68rem; color: var(--muted); }
.news-list { list-style: none; margin: 0; padding: 0.3rem 1rem; max-height: 34rem; overflow-y: auto; }
.news-item { padding: 0.5rem 0 0.55rem 0.7rem; border-bottom: 1px solid var(--line); border-left: 3px solid var(--line); margin-bottom: 0.1rem; }
.news-item.cat-crypto { border-left-color: #f5a623; }
.news-item.cat-markets { border-left-color: var(--primary); }
.news-item.cat-world { border-left-color: #b388ff; }
.news-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; font-size: 0.66rem; color: var(--muted); }
.news-cat { text-transform: uppercase; letter-spacing: 0.05em; }
.news-coin-tag { padding: 0 0.35rem; border: 1px solid var(--line); border-radius: 4px; color: var(--text); }
.news-title { display: block; margin: 0.15rem 0 0.25rem; color: var(--text); font-size: 0.84rem; line-height: 1.35; text-decoration: none; }
.news-title:hover { text-decoration: underline; }
.news-rets { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.news-ret { padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.66rem; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--line) 60%, transparent); }
.news-ret.up { color: var(--up); }
.news-ret.down { color: var(--down); }
.news-ret.big-up { color: #fff; background: color-mix(in srgb, var(--up) 60%, transparent); }
.news-ret.big-down { color: #fff; background: color-mix(in srgb, var(--down) 60%, transparent); }
.news-ret.pending { color: var(--muted); }
.news-empty { padding: 1rem 0; color: var(--muted); }
.news-note { padding: 0 1rem 0.7rem; }
.rank-legend-bar.likely {
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.55) 0%, rgba(91, 140, 255, 0.15) 18%, rgba(120, 120, 120, 0.15) 25%, rgba(120, 120, 120, 0.15) 32%, rgb(245, 197, 66) 55%, rgb(255, 150, 50) 75%, rgb(239, 83, 80) 100%);
}

/* ── Bot-activity meter (js/board/botmeter.js) ── */
.bot-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.35rem; margin: 0.25rem 0 0.1rem; font-size: 0.66rem; color: var(--muted); cursor: help; }
.bot-meter.stale { opacity: 0.45; }
.bm-k { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.6rem; }
.bm-bar { position: relative; flex: 0 0 3.2rem; height: 0.4rem; border-radius: 0.2rem; background: var(--line); overflow: hidden; }
.bm-bar.big { flex: none; height: 0.55rem; margin: 0.2rem 0 0.5rem; }
.bm-fill { position: absolute; inset: 0 auto 0 0; border-radius: 0.2rem; transition: width 0.6s, background 0.6s; }
.bm-word { font-weight: 700; min-width: 3.4em; }
.bm-chip { padding: 0 0.3rem; border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bm-chip.hot { color: #fff; background: hsl(300 60% 45% / 0.7); border-color: transparent; }
.bm-spark { display: inline-flex; margin-left: auto; }
.bot-meter .bm-spark { flex-basis: 100%; margin-left: 0; }
.bot-meter .bm-spark svg { width: 100%; height: 14px; }
.hud-bots .bm-panel { display: flex; flex-direction: column; gap: 0.2rem; }
.bm-head { display: flex; align-items: baseline; gap: 0.5rem; }
.bm-big { font-size: 1.05rem; font-weight: 800; text-transform: capitalize; }
.bm-sub, .bm-muted { color: var(--muted); font-size: 0.68rem; }
.bm-row { display: grid; grid-template-columns: 4.8rem 4rem 5rem minmax(0, 1fr); align-items: center; gap: 0.4rem; font-size: 0.72rem; font-variant-numeric: tabular-nums; cursor: help; }
.bm-row b.hot { color: hsl(300 75% 68%); }
.bm-label { color: var(--muted); }
.bm-ratio { color: var(--muted); font-size: 0.66rem; white-space: nowrap; }
.bm-row .bm-spark { justify-content: flex-end; min-width: 0; }
.bm-row .bm-spark svg { width: 100%; max-width: 90px; }
.bm-row .bm-muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-ratio.up { color: var(--up); }
.bm-ratio.down { color: var(--down); }
.bm-flow { height: 0.45rem; }
.bm-note, .bm-empty { margin: 0.3rem 0 0; font-size: 0.64rem; color: var(--muted); line-height: 1.35; }

/* ── Pump & Dump Radar (js/board/moveRank.js) ── */
.rd-panel { --up-rgb: 38, 166, 154; --down-rgb: 239, 83, 80; }
.rd-title { font-weight: 800; color: var(--text); }
.rd-title .up { color: var(--up); margin-right: 1px; }
.rd-title .down { color: var(--down); margin-right: 0.35rem; }
.rd-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.7rem 1rem 0.3rem; }
.rd-ctl { display: flex; align-items: center; gap: 0.45rem; }
.rd-k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.rd-seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.rd-pill { padding: 0.22rem 0.7rem; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.rd-pill:hover { color: var(--text); }
.rd-pill.on { color: var(--text); background: color-mix(in srgb, var(--primary) 26%, transparent); border-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.rd-pill.sort-pump.on { background: rgba(var(--up-rgb), 0.22); border-color: rgba(var(--up-rgb), 0.6); }
.rd-pill.sort-dump.on { background: rgba(var(--down-rgb), 0.22); border-color: rgba(var(--down-rgb), 0.6); }
.rd-controls > .rd-pill { border-color: var(--line); }
.rd-source { margin-left: auto; font-size: 0.66rem; color: var(--muted); }

.rd-scroll { overflow-x: auto; padding: 0.3rem 0.8rem 0.4rem; }
.rd-grid { min-width: 54rem; }
.rd-row { display: grid; grid-template-columns: 7.2rem 10.5rem repeat(6, minmax(4.4rem, 1fr)) 9.5rem; align-items: center; gap: 0.3rem; }
.rd-head { padding: 0.2rem 0 0.35rem; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.rd-size { justify-self: center; padding: 0.15rem 0.55rem; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.rd-size:hover { color: var(--text); }
.rd-size.on { color: var(--text); border-color: color-mix(in srgb, var(--primary) 55%, transparent); background: color-mix(in srgb, var(--primary) 18%, transparent); }
.rd-item { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.rd-item.open { background: color-mix(in srgb, var(--text) 3%, transparent); }
.rd-item .rd-row { padding: 0.35rem 0; }
.rd-pair { display: flex; align-items: center; gap: 0.2rem; }
.rd-name { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.4rem; background: transparent; color: var(--text); border: 0; border-left: 3px solid var(--series); border-radius: 3px; font-weight: 800; font-size: 0.86rem; }
.rd-name:hover { background: color-mix(in srgb, var(--series) 16%, transparent); }
.rd-chev { color: var(--muted); font-size: 0.7rem; width: 0.8em; }
.rd-hud { padding: 0.1rem 0.35rem; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; font-size: 0.7rem; }
.rd-hud:hover { color: var(--text); }

.rd-outlook { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem; border-radius: 8px; border: 1px solid var(--line); cursor: help; }
.rd-head .rd-outlook, .rd-head .rd-last { border: 0; padding: 0; cursor: default; }
.rd-o-icon { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; flex: none; border-radius: 50%; font-size: 0.95rem; font-weight: 900; background: var(--line); }
.rd-o-text { display: block; font-size: 0.78rem; font-weight: 800; line-height: 1.15; }
.rd-o-odds { display: block; font-size: 0.66rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: pre; }
.rd-outlook.tone-up { border-color: rgba(var(--up-rgb), 0.55); background: rgba(var(--up-rgb), 0.1); }
.rd-outlook.tone-up .rd-o-icon { background: rgba(var(--up-rgb), 0.85); color: #fff; }
.rd-outlook.tone-up .rd-o-text { color: var(--up); }
.rd-outlook.tone-down { border-color: rgba(var(--down-rgb), 0.55); background: rgba(var(--down-rgb), 0.1); }
.rd-outlook.tone-down .rd-o-icon { background: rgba(var(--down-rgb), 0.85); color: #fff; }
.rd-outlook.tone-down .rd-o-text { color: var(--down); }
.rd-outlook.tone-hot { border-color: #f5a623; background: rgba(245, 166, 35, 0.12); }
.rd-outlook.tone-hot .rd-o-icon { background: #f5a623; color: #111; }
.rd-outlook.tone-even .rd-o-icon { background: color-mix(in srgb, var(--primary) 70%, transparent); color: #fff; }
.rd-outlook.tone-muted .rd-o-text { color: var(--muted); }
.rd-outlook.o-pumping .rd-o-icon, .rd-outlook.o-dumping .rd-o-icon, .rd-outlook.o-both .rd-o-icon { animation: rd-pulse 1.4s ease-in-out infinite; }

.rd-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0.2rem 0.1rem; border-radius: 8px; }
.rd-panel:not(.rd-nums) .rd-slot { grid-template-columns: 30px; }
.rd-cell.focus { background: color-mix(in srgb, var(--primary) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
.rd-slot { display: grid; grid-template-columns: 30px auto; align-items: center; justify-items: center; column-gap: 0.25rem; min-height: 32px; }
.rd-slot .rd-num { justify-self: start; min-width: 2.2rem; }
.rd-bub { --d: 12px; --a: 0.7; display: inline-block; width: var(--d); height: var(--d); border-radius: 50%; flex: none; cursor: help; transition: width 0.4s, height 0.4s; }
.rd-bub.pump { background: rgba(var(--up-rgb), var(--a)); box-shadow: 0 0 0 1px rgba(var(--up-rgb), 0.9); }
.rd-bub.dump { background: rgba(var(--down-rgb), var(--a)); box-shadow: 0 0 0 1px rgba(var(--down-rgb), 0.9); }
.rd-bub.pump.strong { box-shadow: 0 0 10px rgba(var(--up-rgb), 0.9), 0 0 0 1px rgba(var(--up-rgb), 1); }
.rd-bub.dump.strong { box-shadow: 0 0 10px rgba(var(--down-rgb), 0.9), 0 0 0 1px rgba(var(--down-rgb), 1); }
.rd-bub.hollow { background: transparent; }
.rd-bub.lowconf { outline: 1.5px dashed color-mix(in srgb, var(--text) 45%, transparent); outline-offset: 2px; }
.rd-bub.none { background: var(--line); box-shadow: none; opacity: 0.5; }
.rd-bub.active { background: rgba(var(--up-rgb), 1); animation: rd-ring 1.4s ease-out infinite; }
.rd-bub.dump.active { background: rgba(var(--down-rgb), 1); animation-name: rd-ring-down; }
@keyframes rd-ring { 0% { box-shadow: 0 0 0 0 rgba(var(--up-rgb), 0.8); } 100% { box-shadow: 0 0 0 10px rgba(var(--up-rgb), 0); } }
@keyframes rd-ring-down { 0% { box-shadow: 0 0 0 0 rgba(var(--down-rgb), 0.8); } 100% { box-shadow: 0 0 0 10px rgba(var(--down-rgb), 0); } }
@keyframes rd-pulse { 50% { transform: scale(1.12); } }
.rd-num { display: none; font-size: 0.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rd-nums .rd-num { display: block; }
.rd-num.pump { color: var(--up); }
.rd-num.dump { color: var(--down); }

.rd-last { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.rd-lastline { white-space: nowrap; }
.rd-lastline.up { color: color-mix(in srgb, var(--up) 85%, var(--text)); }
.rd-lastline.down { color: color-mix(in srgb, var(--down) 85%, var(--text)); }

.rd-detail { padding: 0.3rem 0.6rem 0.8rem 7.8rem; }
.rd-det-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; margin-bottom: 0.4rem; font-size: 0.72rem; font-weight: 700; }
.rd-det-key { font-weight: 400; color: var(--muted); font-size: 0.66rem; }
.rd-det-key .up { color: var(--up); }
.rd-det-key .down { color: var(--down); }
.rd-det-row { display: grid; grid-template-columns: 6.5rem 1fr 3rem 1fr 6.5rem; align-items: center; gap: 0.4rem; padding: 0.12rem 0; font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.rd-det-row.focus { background: color-mix(in srgb, var(--primary) 9%, transparent); border-radius: 6px; }
.rd-det-size { text-align: center; font-weight: 800; }
.rd-det-when { white-space: nowrap; }
.rd-det-when.down { text-align: right; color: color-mix(in srgb, var(--down) 80%, var(--text)); }
.rd-det-when.up { color: color-mix(in srgb, var(--up) 80%, var(--text)); }
.rd-det-bar { position: relative; height: 1.05rem; background: color-mix(in srgb, var(--line) 55%, transparent); border-radius: 4px; overflow: hidden; }
.rd-det-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; transition: width 0.4s; }
.rd-det-bar.pump i { left: 0; background: linear-gradient(90deg, rgba(var(--up-rgb), 0.55), rgba(var(--up-rgb), 0.95)); }
.rd-det-bar.dump i { right: 0; background: linear-gradient(270deg, rgba(var(--down-rgb), 0.55), rgba(var(--down-rgb), 0.95)); }
.rd-det-bar.lowconf i { opacity: 0.55; }
.rd-det-bar.active i { animation: rd-pulse-bar 1.4s ease-in-out infinite; }
@keyframes rd-pulse-bar { 50% { filter: brightness(1.4); } }
.rd-det-bar em { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.8; }
.rd-det-bar.dump em { margin-left: 0; margin-right: -1px; }
.rd-det-val { position: absolute; top: 50%; transform: translateY(-50%); font-size: 0.64rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.rd-det-bar.pump .rd-det-val { left: 0.35rem; }
.rd-det-bar.dump .rd-det-val { right: 0.35rem; }

.rd-legend { padding: 0.5rem 1rem 0.8rem; border-top: 1px solid var(--line); }
.rd-leg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; }
.rd-leg { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.68rem; color: var(--muted); }
.rd-legend .rd-bub { cursor: default; }
.rd-leg-note { margin: 0.45rem 0 0; font-size: 0.66rem; color: var(--muted); line-height: 1.45; }

.rd-tip { position: fixed; z-index: 60; max-width: 19rem; padding: 0.6rem 0.75rem; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 0.72rem; line-height: 1.4; pointer-events: none; }
.rd-tip.up { border-color: rgba(38, 166, 154, 0.7); }
.rd-tip.down { border-color: rgba(239, 83, 80, 0.7); }
.rd-tip-head { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.rd-tip.up .rd-tip-arrow { color: var(--up); }
.rd-tip.down .rd-tip-arrow { color: var(--down); }
.rd-tip-big { font-size: 0.95rem; font-weight: 800; margin-bottom: 0.2rem; }
.rd-tip-line.muted { color: var(--muted); }
.rd-tip-line.up { color: var(--up); }
.rd-tip-line.down { color: var(--down); }
.rd-tip-chance { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.45rem; margin: 0.35rem 0 0.15rem; }
.rd-tip-chance b { font-size: 0.9rem; }
.rd-tip-bar { position: relative; height: 0.5rem; background: var(--line); border-radius: 4px; }
.rd-tip-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--primary); }
.rd-tip.up .rd-tip-bar i { background: var(--up); }
.rd-tip.down .rd-tip-bar i { background: var(--down); }
.rd-tip-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); }
.rd-tip-warn { margin-top: 0.3rem; color: #f5c542; font-size: 0.66rem; }
@media (prefers-reduced-motion: reduce) { .rd-bub.active, .rd-outlook .rd-o-icon, .rd-det-bar.active i { animation: none; } }
@media (max-width: 700px) { .rd-detail { padding-left: 0.6rem; } .rd-source { margin-left: 0; } }
