/* Expandable Price vs 200DMA overlay. Loaded on the desk only.
   The dialog is a body child (not under #main) so it is never inside a zoomed
   element. Size comes from this file; JS must not set style attributes.
   The expand button is hidden at max-width 800px; JS also skips the overlay. */

.dma-expand {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.dma-expand:hover,
.dma-expand:focus-visible {
  color: var(--accent);
}
.dma-expand svg {
  display: block;
}
/* Expand button (focus returns on close) and the close button (focused on open):
   index.js adds .no-ring when the chart was opened with the mouse. */
.dma-expand.no-ring:focus-visible,
.dma-overlay-close.no-ring:focus-visible {
  outline: none;
}

@media (max-width: 800px) {
  .dma-expand { display: none; }
}

.dma-overlay {
  padding: 0;
  border: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.86);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: var(--text);
}
.dma-overlay:not([open]) {
  display: none;
}
.dma-overlay[open],
.dma-overlay:modal {
  display: flex;
  align-items: center;
  justify-content: center;
}
.dma-overlay-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: min(1240px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  /* Same panel as the desk cards. */
  background: #0c0c0e;
  border: 1px solid #1e1f23;
  border-radius: 6px;
  overflow: hidden;
  box-sizing: border-box;
}
@media (max-height: 600px) {
  /* Short viewports (for example a squat desktop window): near full screen,
     with a thin backdrop ring so a click outside the panel still closes it.
     Phones at max-width 800px never open this dialog. */
  .dma-overlay-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
  }
}
.dma-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 2px 6px 2px 20px;
  border-bottom: 1px solid #1e1f23;
}
.dma-overlay-bar .h {
  margin: 0;
}
.dma-overlay-bar .legend {
  margin: 0 auto 0 24px;
}
.dma-overlay-bar form {
  margin: 0;
}
.dma-overlay-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 32px/1 "IBM Plex Sans", "Segoe UI", sans-serif;
  cursor: pointer;
}
.dma-overlay-close:hover,
.dma-overlay-close:focus-visible {
  color: var(--accent);
}
.dma-overlay-chart {
  position: relative;
  flex: 1 1 auto;
  margin: 14px 16px 10px 12px;
  min-width: 0;
  min-height: 0;
}
.dma-overlay-chart canvas {
  display: block;
  width: 100%;
  height: 100%;
}
