/* Reusable components: help overlay, buttons, etc. */

/* ============================================================
   Help overlay (triggered by `?`)
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 31, 38, 0.32);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 100;
  opacity: 0;
  transition: opacity var(--motion-fast);
}

.overlay[data-open="true"] {
  display: flex;
  opacity: 1;
}

.overlay-panel {
  background: var(--bg-card);
  border-radius: var(--radius-4);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-default);
  padding: var(--space-6);
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.overlay-panel h2 {
  font-size: var(--fs-lg);
}

.overlay-panel .shortcut-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3) var(--space-5);
  align-items: center;
}

.overlay-panel .shortcut-list .keys {
  display: flex;
  gap: var(--space-1);
}
.overlay-panel .shortcut-list .keys--clickable {
  background: none;
  border: none;
  padding: 2px;
  margin: -2px;
  cursor: pointer;
  border-radius: var(--radius-1);
  justify-content: flex-start;
}
.overlay-panel .shortcut-list .keys--clickable:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.overlay-panel .shortcut-list .label {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
}

.overlay-foot {
  display: flex;
  justify-content: flex-end;
  font-size: var(--fs-xs);
  color: var(--fg-subtle);
}

/* ============================================================
   Tooltip (cursor-following, used by chart modules later)
   ============================================================ */

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--mauve-12);
  color: var(--fg-inverse);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  font-size: var(--fs-xs);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity var(--motion-fast);
  z-index: 50;
  white-space: nowrap;
}

.tooltip[data-open="true"] { opacity: 1; }
