/* Two-finger click expands the stock and portfolio charts; the header shows the
   selected range's change in ₹/$ and % with its date range (js/run-46.js). */

/* selected date range in the top-right of the chart, with markers at its start and end */
#hpChart, #pvChart { position: relative; }
.rh-range-marks { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.rh-rm { position: absolute; width: 1px; background: rgba(230, 230, 230, .55); }
.rh-range-label {
  position: absolute; top: 6px; right: 4px; white-space: nowrap;
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #9aa0a6;
}
/* the expanded chart's own hint would sit under the range label */
.hp-chart.hp-chart-expanded::after { display: none; }

/* stock chart: no horizontal reference lines at rest; they show only while the chart is touched */
#hpChart .rh-hline { display: none; }
#hpChart.rh-touching .rh-hline { display: inline; }
#hpChart { touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* portfolio chart: same rule */
#pvChart .rh-hline { display: none; }
#pvChart.rh-touching .rh-hline { display: inline; }
#pvChart { touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* expanded stock chart: header with price, change and dates */
#rhExpHead {
  position: fixed; top: 12px; left: calc(3vw + 64px); right: 3vw; z-index: 10000;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  color: #f5f5f5; pointer-events: none;
}
#rhExpHead[hidden] { display: none; }
#rhExpHead .rh-eh-name { font-size: 17px; font-weight: 600; }
#rhExpHead .rh-eh-px { font-size: 24px; font-weight: 600; }
#rhExpHead .rh-eh-chg { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; }
#rhExpHead .pos { color: #00c805; }
#rhExpHead .neg { color: #ff5000; }
#rhExpHead .muted { color: #9aa0a6; }
#rhExpHead .rh-dates { margin-left: 0; }

/* expanded portfolio chart: the card itself becomes the overlay */
#pvCard.pv-card-expanded {
  position: fixed !important; inset: 70px 3vw 4vh !important; z-index: 9999 !important;
  width: auto !important; max-width: none !important; height: auto !important; margin: 0 !important;
  overflow-y: auto; box-sizing: border-box; padding: 22px 26px !important;
  background: var(--bg, #000) !important; border: 1px solid #262626; border-radius: 8px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .78) !important;
}
#pvCard.pv-card-expanded #pvChart {
  height: calc(100vh - 380px) !important; min-height: 260px; margin-top: 12px !important;
}

/* close button for the expanded portfolio chart (matches the stock page back button) */
#rhPvClose {
  position: fixed; top: 12px; left: calc(3vw + 2px); z-index: 10001;
  width: 44px; height: 44px; display: none; place-items: center;
  border: 0; border-radius: 50%; background: rgba(40, 40, 44, .9); color: #f5f5f5; cursor: pointer;
}
#rhPvClose svg { width: 22px; height: 22px; }
body.rh-pv-open #rhPvClose { display: grid; }
