/* ── Tooltips (src/tooltips.js) ──
   A dark card above (or below) the control with an arrow pointing at it; text wraps at a readable
   width; the first line is a heading with its shortcut as key caps. */
#tooltip {
  --tip-bg: #262626;
  --tip-border: #3c3c3c;
  position: fixed; z-index: 3000; left: 0; top: 0;
  max-width: 240px; width: max-content;
  padding: 7px 10px 8px;
  background: var(--tip-bg); border: 1px solid var(--tip-border); border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  color: #b4b4b4; font-family: 'Segoe UI', system-ui, sans-serif; font-size: 12px; line-height: 1.45;
  pointer-events: none;
  opacity: 0; transform: translateY(3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
#tooltip.below { transform: translateY(-3px); }
#tooltip.shown { opacity: 1; transform: none; }
/* the arrow: a small rotated square on the edge facing the control */
#tooltip::after {
  content: ''; position: absolute; left: var(--arrow-x, 50%); bottom: -5px;
  width: 8px; height: 8px; margin-left: -5px;
  background: var(--tip-bg);
  border-right: 1px solid var(--tip-border); border-bottom: 1px solid var(--tip-border);
  transform: rotate(45deg);
}
#tooltip.below::after { bottom: auto; top: -5px; transform: rotate(225deg); }
#tooltip.left { transform: translateX(3px); }
#tooltip.left.shown { transform: none; }
#tooltip.left::after { left: auto; right: -5px; bottom: auto; top: var(--arrow-y, 50%); margin: -5px 0 0; transform: rotate(-45deg); }

.tip-head { display: flex; align-items: center; gap: 10px; color: #f2f2f2; font-weight: 600; }
.tip-head > span:first-child { flex: 1; }
.tip-head + .tip-line { margin-top: 3px; }
.tip-line + .tip-line { margin-top: 2px; }
.tip-keys { display: flex; align-items: center; gap: 4px; flex-shrink: 0; font-weight: 400; }
#tooltip kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; text-align: center;
  background: #333; border: 1px solid #4a4a4a; border-bottom-width: 2px; border-radius: 4px;
  color: #e6e6e6; font: 11px/16px ui-monospace, Consolas, monospace;
}
.tip-hold, .tip-or { color: #8a8a8a; font-size: 11px; }
/* disabled controls get no pointer events at all: let them pass through, so the tooltip still shows
   (src/tooltips.js finds the control under the pointer) */
button:disabled[title], button:disabled[data-tooltip] { pointer-events: none; }
