/* pmr_chart_modal_html — the Left to PMR "items by date" chart pop-up.
 *
 * NOT :where(.pmr-chart-root)-SCOPED. pxShowOverlay moves #pmr-chart-overlay
 * into #px-modal-portal on every open and pxHideOverlay only returns it 300 ms
 * after it closes, so for that whole window the overlay sits outside this
 * form's root. A root-scoped rule would stop matching exactly when the pop-up
 * is on screen. Every class below is private (pmr-chart-*) or doubled with the
 * shared class it must beat.
 *
 * ORDER. This head link sits BEFORE the dependency theme, so every tie on
 * specificity is lost. Nothing here ties:
 *   .pmr-chart-overlay.px-modal-overlay and .pmr-chart-modal.px-modal are
 *   (0,2,0) against the dependency's (0,1,0); #pmr-chart-container is an id;
 *   .pmr-chart-close declares only position and offsets, which the
 *   dependency's .px-modal-close does not declare. The webkit scrollbar rules
 *   sit on .pmr-chart-modal.px-modal, not on .themed-scrollbar.
 *
 * var(--accent) in .pmr-chart-title::before keeps working while the node is
 * portaled: pxShowOverlay copies the five accent custom properties onto the
 * overlay's inline style before it moves the node, and removes them on
 * restore.
 *
 * Everything that hides this pop-up belongs to the dependency's
 * .px-modal-overlay, which the designer never loads, so the canvas shows the
 * modal expanded as flowed content.
 */

/* ========================================
   MODAL OVERRIDES
   ======================================== */
.pmr-chart-overlay.px-modal-overlay {
  padding: 0;
}

.pmr-chart-modal.px-modal {
  max-width: 720px;
  width: 90%;
}

.pmr-chart-modal.px-modal::-webkit-scrollbar {
  width: 6px;
}

.pmr-chart-modal.px-modal::-webkit-scrollbar-track {
  background: transparent;
}

.pmr-chart-modal.px-modal::-webkit-scrollbar-thumb {
  background: var(--px-border);
  border-radius: 3px;
}

.pmr-chart-modal.px-modal::-webkit-scrollbar-thumb:hover {
  background: var(--px-text-muted);
}

/* ========================================
   MODAL HEADER (centered title)
   ======================================== */
.pmr-chart-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--px-border);
  position: relative;
}

.pmr-chart-title {
  font-family: var(--px-font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--px-text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.pmr-chart-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent);
  border-radius: 2px;
}

.pmr-chart-close {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

/* ========================================
   CHART CONTAINER
   ======================================== */
#pmr-chart-container {
  width: 100%;
  min-height: 360px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
  .pmr-chart-modal.px-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  #pmr-chart-container {
    min-height: 260px;
  }

  .pmr-chart-title {
    font-size: 1.1rem;
  }
}
