/* TAN-1124 PTA v2 S6 — Right-Edge Rail (default PTA view)
   Tokens + layout grammar from pta_hybrid frag_dens_b #dens-6
   Polish: proportional bars, HIT column grid, no glows, clickable rows */

.pta-rail-wrap {
  --pta-bg: #0b0f19;
  --pta-panel: #121826;
  --pta-card: #151c2c;
  --pta-border: #1f2a3d;
  --pta-text: #e5e7eb;
  --pta-muted: #9fb0c3;
  --pta-dim: #7a8ba0;
  --pta-close: #34d399;
  --pta-drift: #f87171;
  --pta-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --pta-row: 16px;
  --pta-bar-h: 8px;
  position: relative;
  width: 100%;
  background: var(--pta-panel);
  border: 1px solid var(--pta-border);
  border-radius: 12px;
  /* Hover uses position:fixed — wrap may clip; keep x-clip for bars only */
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 200px;
  margin-bottom: 16px;
}
/* Hide retired chrome if any stale markup remains */
.pta-rail-status,
.pta-hit-cluster-head,
.pta-hs-chips { display: none !important; }
/* C7#124: sort chrome restored (Recent / Proximity / Velocity / Held) */

/* Cross-surface PTA spotlight — asymmetric: quiet bars, loud HIT chips. */
/* Bar rows: left tick + wash (not a full white box on the track). */
.pta-rail-row.pta-tk-spotlight {
  outline: none;
  box-shadow: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.10);
  z-index: 4;
  /* Keep absolute — position:relative overrode row layout and shoved dual
     BT/ST highlights (e.g. META sell+buy) down into the next buy row. */
  position: absolute;
}
.pta-rail-row.pta-tk-spotlight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 3px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.92);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}
.pta-rail-row.pta-tk-spotlight .pta-rail-tkr {
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  font-weight: 700;
}
.pta-rail-row.pta-tk-spotlight .pta-rail-bar {
  filter: brightness(1.22);
}
.pta-rail-row.pta-tk-spotlight .pta-rail-bar-drift {
  opacity: 1;
}

/* HIT chips: readable white ring — keep bucket color (--c) visible */
.pta-hit-chip.pta-tk-spotlight {
  outline: 1.5px solid rgba(255, 255, 255, 0.9);
  outline-offset: 1px;
  /* Keep hue border; add white outer only via outline/shadow */
  border-color: color-mix(in srgb, var(--c, #94a3b8) 55%, #ffffff) !important;
  background: color-mix(in srgb, var(--c, #94a3b8) 18%, rgba(15, 23, 42, 0.75)) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 10px rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  z-index: 6;
  position: relative;
  transform: none;
}
.pta-hit-chip.pta-tk-spotlight .pta-hit-chip-tk {
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
  font-weight: 800;
}
/* Bucket label keeps bucket color (BT2 green/etc.) — not washed to pure white */
.pta-hit-chip.pta-tk-spotlight .pta-hit-chip-bkt {
  color: var(--c, #f59e0b) !important;
  opacity: 1;
  text-shadow: none;
  font-weight: 800;
}

/* White right-edge rail removed — bars terminate at panel edge; HIT labels are the edge cue */

/* Proposal #1 — live status strip (replaces instructional legend) */
.pta-rail-status {
  position: absolute;
  left: 10px;
  top: 8px;
  right: 230px; /* leave room for Proximity / Velocity / Held */
  font-family: var(--pta-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--pta-dim);
  z-index: 5;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.pta-st-sep {
  margin: 0 3px;
  opacity: 0.55;
  color: var(--pta-dim);
}
.pta-st-hit { color: #e5e7eb; font-weight: 700; }
.pta-st-sell { color: #fdba74; }
.pta-st-buy { color: #93c5fd; }
.pta-st-er { color: var(--pta-drift); }
.pta-st-held { color: #fbbf24; }

/* C7#152: Recent/Prox/Vel/Held chrome removed. HIT chips L→R by fire recency. */

/* C7#124: cyan pulse dot on targets fired in the last 5 minutes.
   Skip ::after while pta-hit-sweep owns that pseudo for the ambient bloom. */
.pta-rail-row.recent-fire,
.pta-hit-chip.recent-fire {
  position: relative;
}
.pta-rail-row.recent-fire:not(.pta-hit-sweep)::after,
.pta-hit-chip.recent-fire:not(.pta-hit-sweep)::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #22d3ee;
  animation: pta-recent-pulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 8;
}
@keyframes pta-recent-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Legacy legend (kept for any leftover markup) */
.pta-rail-legend {
  display: none;
}

.pta-rail-band {
  position: absolute;
  left: 14px;
  font-family: var(--pta-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--pta-dim);
  text-transform: uppercase;
  z-index: 5;
  pointer-events: none;
}
/* C7#32: section headers above their stacks (always visible) */
.pta-rail-band--sell,
.pta-rail-band--buy,
.pta-rail-band--after {
  letter-spacing: 0.1em;
  opacity: 0.95;
}
/* TAN-1561: no "none nearby" — empty sell/buy stays blank under the label */
.pta-rail-sec-empty {
  display: none !important;
}

/* HIT cluster — mid-zone band; chips vertically centered in min-height */
.pta-rail-hit-cluster {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center; /* mid-anchor when band > chip grid */
  align-items: stretch;
  gap: 0;
  box-sizing: border-box;
  padding: 4px 0;
  pointer-events: none; /* chips re-enable */
  /* TAN-1709: never paint over SELL/BUY TARGETS labels (was overflow:visible) */
  overflow: hidden;
}
.pta-hit-cluster-head {
  flex: 0 0 auto;
  min-width: 0;
}
.pta-hs-title {
  font-family: var(--pta-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e5e7eb;
  line-height: 1.15;
}
.pta-hs-sub-inline {
  font-weight: 600;
  font-size: 8px;
  letter-spacing: 0.03em;
  color: var(--pta-dim);
}
.pta-hs-sub {
  font-family: var(--pta-mono);
  font-size: 8px;
  color: var(--pta-dim);
  margin-top: 1px;
  letter-spacing: 0.03em;
}
.pta-hs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}
.pta-hs-chip {
  font-family: var(--pta-mono);
  font-size: 7px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--c, #e5e7eb);
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 45%, transparent);
  background: color-mix(in srgb, var(--c, #94a3b8) 12%, transparent);
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.pta-hit-cluster-grid {
  /* Content-width chips (not 1fr stretch) — pack ~10 per MacBook rail.
     Responsive: JS sets --pta-hit-gap-* / density attrs for large hosts. */
  display: flex;
  flex-wrap: wrap;
  gap: var(--pta-hit-gap-y, 2px) var(--pta-hit-gap-x, 3px);
  align-content: start;
  pointer-events: auto;
}
/* Large desktop density (set by pta-rail.js metrics + redistribute) */
.pta-rail-wrap[data-pta-density="lg"] .pta-hit-chip {
  padding: 2px 6px;
  font-size: 9.5px;
  border-radius: 4px;
}
.pta-rail-wrap[data-pta-density="lg"] .pta-hit-chip-tk {
  font-size: 10px;
  max-width: 6ch;
}
.pta-rail-wrap[data-pta-density="lg"] .pta-hit-chip-bkt {
  font-size: 8.5px;
}
.pta-rail-wrap[data-pta-density="xl"] .pta-hit-chip {
  padding: 3px 7px;
  font-size: 10.5px;
  border-radius: 5px;
}
.pta-rail-wrap[data-pta-density="xl"] .pta-hit-chip-tk {
  font-size: 11px;
  max-width: 6.5ch;
}
.pta-rail-wrap[data-pta-density="xl"] .pta-hit-chip-bkt {
  font-size: 9px;
}
.pta-rail-wrap[data-pta-density="lg"] .pta-rail-cell,
.pta-rail-wrap[data-pta-density="xl"] .pta-rail-cell {
  font-size: 11px;
}
.pta-rail-wrap[data-pta-density="lg"] .pta-rail-tkr,
.pta-rail-wrap[data-pta-density="xl"] .pta-rail-tkr {
  font-size: 12px;
}
.pta-rail-wrap[data-pta-density="xl"] .pta-rail-bar-host {
  /* slightly taller bars via --pta-bar-h */
  min-height: var(--pta-bar-h, 11px);
}
.pta-hit-chip {
  /* tk (≤5ch typical) + bkt (ST1/BT2) — no price; no full-row stretch */
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin: 0;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 40%, transparent);
  background: color-mix(in srgb, var(--c, #94a3b8) 10%, rgba(15, 23, 42, 0.55));
  color: #e5e7eb;
  font-family: var(--pta-mono);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  cursor: pointer;
  text-align: left;
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  box-sizing: border-box;
  pointer-events: auto;
}
.pta-hit-chip:hover,
.pta-hit-chip:focus-visible {
  border-color: color-mix(in srgb, var(--c, #94a3b8) 70%, transparent);
  background: color-mix(in srgb, var(--c, #94a3b8) 18%, rgba(15, 23, 42, 0.7));
  outline: none;
}
.pta-hit-chip-tk {
  font-weight: 700;
  font-size: 8.5px;
  color: #f3f4f6; /* white default */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.02em;
  max-width: 5.5ch; /* denser pack; BTCUSD still fits */
  flex: 0 0 auto;
}
/* Book = font color only (no left-edge gold/cyan bar on chips). */
.pta-hit-chip.pf-held .pta-hit-chip-tk,
.pta-hit-chip.pf-basket .pta-hit-chip-tk {
  color: #fbbf24;
}
.pta-hit-chip.pf-watched .pta-hit-chip-tk {
  color: #22d3ee;
}
.pta-hit-chip-bkt {
  font-weight: 700;
  font-size: 7.5px;
  color: var(--c, #f59e0b);
  text-align: left;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
  min-width: 2.2ch; /* ST1 / BT3 — legacy; face now uses HIT */
}
/* Near Targets / rankings grammar: "AAPL HIT" — blue HIT label */
.pta-hit-chip-hit {
  font-weight: 700;
  font-size: 7.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue, #3b82f6);
  flex: 0 0 auto;
  line-height: 1.15;
}
/* Price column removed from default chips — still used on dashboard override */
.pta-hit-chip-px {
  display: none;
}
.pta-hit-more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pta-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--pta-dim);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 3px;
  padding: 1px 3px;
  min-height: 16px;
  letter-spacing: 0.02em;
}

/* Divider under SELL TARGETS removed (Matt) — keep rule hidden for legacy DOM */
.pta-rail-sep {
  display: none !important;
}

.pta-rail-body {
  position: relative;
  width: 100%;
  /* height set by JS — may fill host; content vertically centered via top offset */
  box-sizing: border-box;
}

/* Hosts: wrap may flex-fill; body height is JS content-sized (C7#32 hotfix —
   do NOT flex-grow body or it tracks host → infinite height on PWA). */
.pta-rail-host,
.pta-rail-host--dashboard,
#pta-rail-host {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pta-rail-host .pta-rail-wrap,
.pta-rail-host--dashboard .pta-rail-wrap,
#pta-rail-host .pta-rail-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pta-rail-host .pta-rail-body,
.pta-rail-host--dashboard .pta-rail-body,
#pta-rail-host .pta-rail-body {
  flex: 0 0 auto;
}

.pta-rail-row {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--pta-row);
  border-radius: 6px;
}

.pta-rail-cell {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--pta-mono);
  font-size: 9px;
  white-space: nowrap;
  z-index: 3;
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Left-edge ticker: white by default; gold held / cyan watched (book).
   Bar bucket color stays on the bar track, not the symbol. */
.pta-rail-tkr {
  font-size: 10px;
  font-weight: 700;
  color: #f3f4f6;
}
.pta-rail-tkr.pf-held,
.pta-rail-tkr.pf-basket {
  color: #fbbf24; /* gold — in portfolio */
}
.pta-rail-tkr.pf-watched {
  color: #22d3ee; /* cyan — watchlist only */
}
/* Book on bar rows = ticker font color only (no left-edge accent). */
.pta-rail-g {
  font-style: normal;
  font-size: 8px;
  margin-right: 5px;
}
.pta-rail-g.buy { color: #93c5fd; }
.pta-rail-g.sell { color: #fdba74; }

.pta-rail-dp { color: var(--pta-close); margin-left: 4px; font-size: 9px; }
.pta-rail-dm { color: var(--pta-drift); margin-left: 4px; font-size: 9px; }

.pta-rail-er-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pta-drift);
  margin-left: 4px;
  vertical-align: middle;
}

/* Bar track — solid |dist| bar + quiet yest hairline (no second colored bar) */
.pta-rail-bar-host {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  height: 10px;
  left: 118px;
  pointer-events: none;
  /* Kill stray text caret when focus lands near chevrons/glyphs */
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

/*
 * Yest drift mark: dashed hairline in the SAME bucket color as the solid bar.
 * Not a second filled bar — not green/red “signal” paint. Readable, not muted.
 */
.pta-rail-bar-drift {
  position: absolute;
  right: 0;
  top: 50%;
  height: 0;
  border: none;
  border-top: 1.5px dashed color-mix(in srgb, var(--c, #94a3b8) 88%, transparent);
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  min-width: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.88;
}
.pta-rail-bar-drift.is-closing,
.pta-rail-bar-drift.is-drifting {
  /* same mark either direction — direction is in tip copy, not bar paint */
  opacity: 0.92;
  border-top-color: color-mix(in srgb, var(--c, #94a3b8) 92%, transparent);
}
.pta-rail-bar-drift.is-flat {
  opacity: 0;
  width: 0 !important;
  border-top-width: 0;
}

/* Current |dist to tgt| — solid core only */
.pta-rail-bar {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--c, #3b82f6) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #3b82f6) 70%, transparent);
  box-shadow: none;
  z-index: 1;
  min-width: 0;
}
/* No colored outer glow on solid bar */
.pta-rail-bar.is-drifting-out,
.pta-rail-bar.is-closing-in {
  box-shadow: none;
}

/* Motion glyph — quiet, same family as bar (no green/red) */
.pta-rail-motion {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--pta-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  z-index: 2;
  width: 10px;
  text-align: center;
  pointer-events: none;
  user-select: none;
  caret-color: transparent;
  color: color-mix(in srgb, var(--c, #94a3b8) 70%, #e5e7eb);
  opacity: 0.55;
  text-shadow: none;
}
.pta-rail-motion.close,
.pta-rail-motion.drift {
  color: color-mix(in srgb, var(--c, #94a3b8) 70%, #e5e7eb);
  opacity: 0.55;
  text-shadow: none;
}
.pta-rail-motion.flat {
  color: var(--pta-dim);
  opacity: 0.4;
  font-size: 10px;
}

/* Hover card 1D vel line — still subtle close/drift tint in tip only */
.pta-hc-vel {
  font-family: var(--pta-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 4px;
}
.pta-hc-vel.close { color: #6ee7b7; }
.pta-hc-vel.drift { color: #fca5a5; }

.pta-rail-chev {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--pta-mono);
  font-size: 10px;
  color: var(--pta-dim);
  line-height: 1;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  caret-color: transparent;
}

/* No typing caret on focusable hit targets / rows */
.pta-rail-wrap,
.pta-rail-row,
.pta-rail-tk,
.pta-hit-chip {
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.pta-rail-tk:focus,
.pta-rail-tk:focus-visible,
.pta-hit-chip:focus,
.pta-hit-chip:focus-visible {
  caret-color: transparent;
  outline: none;
}

/* HIT row — fixed columns: ticker | BT/ST | price (tabular, no glow) */
.pta-rail-hg {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: 5.5ch 3.5ch 8.5ch;
  column-gap: 6px;
  align-items: baseline;
  font-family: var(--pta-mono);
  font-size: 10px;
  color: var(--pta-muted);
  white-space: nowrap;
  line-height: 1.2;
  z-index: 3;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.pta-hg-tk {
  font-size: 11px;
  font-weight: 700;
  color: #e5e7eb;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: none;
}
.pta-hg-bkt {
  font-size: 10px;
  font-weight: 700;
  color: var(--c, #f59e0b);
  text-align: center;
}
.pta-hg-px {
  font-size: 10px;
  color: var(--pta-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Interactive hit target for hover + click (full row) */
.pta-rail-row .pta-rail-tk {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 6;
}
.pta-rail-row .pta-rail-tk:focus-visible {
  outline: 1px solid rgba(229, 231, 235, 0.35);
  outline-offset: -1px;
  border-radius: 6px;
}

/* Hover card — Option A distance track (fixed to viewport; escapes panel overflow)
   TAN-1307: taller card with Target Map staple — no internal scroll; positioners clamp. */
.pta-rail-hcard {
  position: fixed;
  width: 320px;
  display: none;
  flex-direction: column;
  background: #0e1526;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 16px 16px 14px;
  z-index: 9999;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  pointer-events: none;
  overflow: visible;
  max-height: none;
}
.pta-rail-hcard.is-open { display: flex; }
.pta-rail-hcard--a::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 56px;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% -30%, rgba(56, 189, 248, 0.12), transparent 70%);
}
.pta-rail-hcard--a.is-hit::before {
  background: radial-gradient(120% 90% at 50% -30%, rgba(16, 185, 129, 0.16), transparent 70%);
}
.pta-hc-a { position: relative; z-index: 1; min-width: 0; }
.pta-hc-a-hd { display: flex; align-items: center; gap: 9px; }
.pta-hc-spill {
  font-family: var(--pta-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 100px;
  padding: 3px 9px;
  background: rgba(16, 185, 129, 0.08);
}
.pta-hc-spill.near {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.08);
}
.pta-hc-spill.far {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.08);
}
.pta-hc-tick {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--pta-text);
}
.pta-hc-stance {
  font-family: var(--pta-mono);
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.pta-hc-ar { color: #10b981; }
.pta-hc-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--pta-text);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.pta-hc-day {
  font-family: var(--pta-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  margin-left: 6px;
}
.pta-hc-day.up { color: #34d399; background: rgba(16, 185, 129, 0.12); }
.pta-hc-day.down { color: #fca5a5; background: rgba(248, 113, 113, 0.12); }
.pta-hc-day.flat { color: var(--pta-dim); background: rgba(148, 163, 184, 0.1); }
/* TAN-1569: KPI-style intraday spark under price/% — hover card BG unchanged */
.pta-hc-spark {
  width: 100%;
  height: 36px;
  position: relative;
  margin: 6px 0 0;
  background: transparent;
  pointer-events: none;
}
.pta-hc-spark svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.pta-hc-div {
  height: 1px;
  background: #18212f;
  margin: 13px 0 11px;
}
.pta-hc-cap {
  font-family: var(--pta-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
}
.pta-hc-dtrack { position: relative; margin: 4px 0 2px; }
.pta-hc-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--pta-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pta-hc-rail {
  position: relative;
  height: 10px;
  border-radius: 100px;
  background: #20304a;
}
.pta-hc-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 100px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, #38bdf8) 40%, transparent), var(--c, #10b981));
}
.pta-hc-tgt {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c, #10b981);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #10b981) 22%, transparent);
}
.pta-hc-mk {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #eaf0f7;
  border: 2px solid #0e1526;
  box-shadow: 0 0 0 2px #38bdf8;
}
.pta-hc-mkval {
  position: absolute;
  transform: translateX(-50%);
  top: 18px;
  font-family: var(--pta-mono);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}
.pta-hc-far {
  font-family: var(--pta-mono);
  font-size: 10px;
  color: #94a3b8;
  text-align: right;
  margin-top: 22px;
}
.pta-hc-fbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.pta-hc-fl {
  font-size: 11.5px;
  color: #94a3b8;
  width: 42px;
  flex: 0 0 auto;
}
.pta-hc-ft {
  flex: 1;
  height: 6px;
  border-radius: 100px;
  background: #20304a;
  position: relative;
  overflow: hidden;
}
.pta-hc-ff {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 100px;
}
/* Score / Near / Far — one neutral slate family (intensity, not hue).
   Avoids BT1-blue / BT2-green / ST1-amber collision on the Target Map. */
.pta-hc-ff.g {
  /* Score — brightest ice-slate (headline meter) */
  background: linear-gradient(90deg, #64748b, #e2e8f0);
}
.pta-hc-ff.b {
  /* Near — mid cool-slate (same family, slightly cooler) */
  background: linear-gradient(90deg, #4b5d73, #94a3b8);
}
.pta-hc-ff.a {
  /* Far — dimmer warm-slate (same family, quieter) */
  background: linear-gradient(90deg, #3d4a5c, #6b7c90);
}
.pta-hc-fn {
  font-family: var(--pta-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--pta-text);
  width: 28px;
  text-align: right;
  flex: 0 0 auto;
}
/* TAN-1335 — 5-notch tiered gauges (conviction / RR / alignment) */
.pta-hc-tbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.pta-hc-tl {
  font-size: 11.5px;
  color: #94a3b8;
  width: 72px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.pta-hc-tn {
  flex: 1;
  display: flex;
  gap: 3px;
  height: 6px;
  align-items: stretch;
  min-width: 0;
}
.pta-hc-tn-notch {
  flex: 1;
  border-radius: 2px;
  background: transparent;
  border: 1px solid #2a3a52;
  box-sizing: border-box;
}
.pta-hc-tn-notch.on {
  background: var(--c, #10B981);
  border-color: transparent;
}
.pta-hc-tv {
  font-family: var(--pta-mono);
  font-size: 11px;
  font-weight: 700;
  width: 78px;
  text-align: right;
  flex: 0 0 auto;
  color: var(--pta-text, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pta-hc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  align-items: center;
}
/* TAN-1335: match sidebar .grid-pill (app.css) for remaining signal chips */
.pta-hc-chips .grid-pill {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 600;
  font-family: var(--font-body, 'Inter', sans-serif);
  letter-spacing: 0.2px;
  line-height: 1;
  white-space: nowrap;
  color: #0B1120;
  cursor: default;
  position: relative;
  border: none;
}
/* Legacy chip styles kept for any residual markup */
.pta-hc-chip {
  font-family: var(--pta-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #94a3b8;
  border: 1px solid #1e293b;
  border-radius: 100px;
  padding: 3px 9px;
  background: #141b2d;
}
.pta-hc-chip.near { color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
.pta-hc-chip.hot { color: #f5c451; border-color: rgba(245, 196, 81, 0.4); }
.pta-hc-chip.conv { color: var(--c, #94a3b8); border-color: color-mix(in srgb, var(--c, #94a3b8) 45%, transparent); }
.pta-hc-why {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #7a8ba0;
}

/* TAN-1307 — Target Map staple (match detail TARGET MAP / screenshot) */
.pta-hc-map {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #18212f;
}
.pta-hc-map-title {
  font-family: var(--pta-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
}
.pta-hc-map-sec { margin-bottom: 10px; }
.pta-hc-map-sec:last-of-type { margin-bottom: 8px; }
.pta-hc-map-cap {
  font-family: var(--pta-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.pta-hc-map-cap.buy { color: #3b82f6; }
.pta-hc-map-cap.sell { color: #f59e0b; }
.pta-hc-map-cap.muted { color: #64748b; }
.pta-hc-map-row {
  display: grid;
  grid-template-columns: 36px 52px 1fr 56px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.pta-hc-map-row.is-active {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12);
}
.pta-hc-map-chip {
  font-family: var(--pta-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  border-radius: 4px;
  padding: 2px 5px;
  text-align: center;
  line-height: 1.3;
}
.pta-hc-map-px {
  font-family: var(--pta-mono);
  font-size: 11px;
  font-weight: 600;
  color: #eaf0f7;
  font-variant-numeric: tabular-nums;
}
.pta-hc-map-track {
  height: 6px;
  border-radius: 100px;
  background: #20304a;
  overflow: hidden;
  min-width: 0;
}
.pta-hc-map-fill {
  height: 100%;
  border-radius: 100px;
  min-width: 2px;
}
.pta-hc-map-delta {
  font-family: var(--pta-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pta-hc-map-delta.pos { color: #34d399; }
.pta-hc-map-delta.neg { color: #f87171; }
.pta-hc-map-delta.hit {
  color: #eaf0f7;
  letter-spacing: 0.06em;
}
.pta-hc-map-empty {
  font-size: 11px;
  color: #64748b;
}
.pta-hc-map-range {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #18212f;
}
.pta-hc-map-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pta-hc-map-range-px {
  font-family: var(--pta-mono);
  font-size: 10px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.pta-hc-map-range-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 100px;
  min-width: 0;
  background: #20304a;
}
.pta-hc-map-range-grad {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: linear-gradient(90deg, #ef4444 0%, #b45309 28%, #ca8a04 48%, #10b981 78%, #0f766e 100%);
  opacity: 0.85;
}
.pta-hc-map-range-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #0e1526;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.65);
  z-index: 1;
}

/* Toolbar: Rail / Cards toggle */
.pta-view-toggle {
  display: inline-flex; gap: 4px; align-items: center;
}
.pta-view-toggle button {
  font-family: var(--pta-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--pta-border); background: transparent;
  color: var(--pta-dim); cursor: pointer;
}
.pta-view-toggle button.is-on {
  color: var(--pta-text); border-color: rgba(229, 231, 235, 0.25);
  background: rgba(255, 255, 255, 0.04);
}
.pta-view-toggle button:hover {
  color: var(--pta-text);
  border-color: rgba(229, 231, 235, 0.35);
}

/* ── Dashboard PTA rail (full-width page, NOT Terminal column) ──────────
   Terminal densify (4-col tight chips, 6.5ch price) was applied globally and
   made the dashboard rail look squished: $338.… ellipsis, cramped HIT grid.
   Scope roomier chrome to .pta-rail-host--dashboard only. */
.pta-rail-host--dashboard .pta-rail-wrap {
  /* TAN-1584 / GROK: fixed floor that can still grow on busy HIT days */
  /* TAN-1709: JS bumps min-height when HIT band needs room (no clip over SELL) */
  min-height: 380px;
  padding-bottom: 8px;
  --pta-row: 20px;
  --pta-bar-h: 10px;
  --pta-hit-pad: 14px; /* air between HIT chips and sell/buy bands */
}
.pta-rail-host--dashboard .pta-hit-cluster-grid {
  gap: 4px 5px;
}
.pta-rail-host--dashboard .pta-hit-chip {
  padding: 2px 5px;
  font-size: 9.5px;
  border-radius: 5px;
  line-height: 1.15;
}
.pta-rail-host--dashboard .pta-hit-chip-tk {
  font-size: 10px;
  max-width: 5.5ch;
  letter-spacing: 0;
}
.pta-rail-host--dashboard .pta-hit-chip-bkt {
  font-size: 9px;
  letter-spacing: 0;
}
.pta-rail-host--dashboard .pta-hit-chip-hit {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--blue, #3b82f6);
}
.pta-rail-wrap[data-pta-density="lg"] .pta-hit-chip-hit {
  font-size: 8.5px;
}
.pta-rail-wrap[data-pta-density="xl"] .pta-hit-chip-hit {
  font-size: 9.5px;
}
.pta-rail-host--dashboard .pta-hs-title {
  font-size: 11px;
}
.pta-rail-host--dashboard .pta-hs-chip {
  font-size: 8px;
  padding: 2px 5px;
}
.pta-rail-host--dashboard .pta-rail-status {
  font-size: 9px;
  right: 8px;
}
.pta-rail-host--dashboard .pta-rail-bar-host {
  left: 140px; /* more room for ticker cell on wide page */
}
.pta-rail-host--dashboard .pta-rail-cell {
  font-size: 11px;
  max-width: 140px;
}
.pta-rail-host--dashboard .pta-rail-tkr {
  font-size: 12px;
}
/* When dashboard is narrow (phone), tighter chip gap + no clip */
@media (max-width: 720px) {
  .pta-rail-host--dashboard .pta-hit-cluster-grid {
    gap: 3px 4px;
  }
  .pta-rail-host--dashboard .pta-rail-wrap {
    min-height: 0;
    overflow-y: visible;
  }
  .pta-rail-host--dashboard .pta-rail-bar-host {
    left: 96px; /* was 140 — too wide for phone ticker col */
  }
  .pta-rail-host--dashboard .pta-rail-cell {
    max-width: 96px;
  }
}

.pta-rail-empty {
  padding: 28px 16px; text-align: center; color: var(--pta-dim);
  font-family: var(--pta-mono); font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  .pta-rail-bar {
    box-shadow: none !important;
    text-shadow: none !important;
  }
}

/* Terminal / CC: denser chrome, fill available column height.
   TAN-1554/1555: landscape = no scroll (JS trims). Portrait = may scroll
   (do not shrink the PTA panel — Matt: portrait was perfect). */
.cc-pta-rail-host {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
@media (orientation: landscape) {
  .cc-pta-rail-host,
  .cc-pta-rail-host .pta-rail-wrap {
    overflow: hidden;
  }
}
@media (orientation: portrait) {
  .cc-pta-rail-host {
    overflow: auto;
  }
  .cc-pta-rail-host .pta-rail-wrap {
    overflow: visible;
  }
}
.cc-pta-rail-host .pta-rail-wrap {
  border-radius: 8px;
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cc-pta-rail-host .pta-rail-legend {
  display: none;
}
.cc-pta-rail-host .pta-rail-body {
  /* C7#32 hotfix: explicit height from JS only — no flex-grow height loop */
  flex: 0 0 auto;
  min-height: 0;
}
/* Terminal: denser status (sort chrome gone) */
.cc-pta-rail-host .pta-rail-status {
  font-size: 8px;
  right: 8px;
  left: 8px;
  top: 8px;
}
.cc-pta-rail-host .pta-hit-chip {
  padding: 1px 4px;
}
.cc-pta-rail-host .pta-hit-chip-tk {
  max-width: 5.5ch;
}

/* Portrait pulse+PTA: let PTA panel grow into remaining row space */
#view-c .vc-pulse-pta-row .vc-pta-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* was fixed 272px — fill remaining track under Pulse */
  height: auto;
  flex: 1 1 auto;
  max-height: none;
  overflow: hidden;
}
#view-c .vc-pulse-pta-row .vc-pta-panel .section-header {
  flex: 0 0 auto;
}
#view-c .vc-pulse-pta-row .vc-pta-panel .cc-pta-rail-host {
  flex: 1;
  min-height: 0;
  overflow: auto; /* TAN-1555: portrait PTA restores scroll; do not shrink */
}
@media (orientation: landscape) {
  #view-c .vc-pulse-pta-row .vc-pta-panel .cc-pta-rail-host {
    overflow: hidden; /* landscape: fit-trim, no scrollbar */
  }
}
