/* Mingo - ui/tour.css: the tours (ui/tour.js; Mingo SPEC section 137): a speech bubble standing beside the corner's mascot and a thin
   box around the stop's target. Both fixed, appended to <body>: nothing on the page moves or is covered by a ground when they appear,
   nothing is dimmed. Colors from ui/theme.css + ui/ridge.css only, so both palettes follow. Every control is fully declared here:
   theme.css's bare <button> rules do not reach in. */

.tr {
  --tr-right: 16px; --tr-bottom: 16px;        /* the bubble's corner, set by tour.js from the mascot's box (16 / 16 without a mascot) */
  --tr-width: 264px;                          /* TourBubbleWidth */
  --tr-radius: 17px; --tr-tail: 4px;          /* the tip cloud's radius (.mp-cloud) on three corners, the tail's toward the mascot */
  --tr-line: 1.5px;                           /* TourBoxLine */
  --tr-fade: 150ms;                           /* TourFadeMs */
}

/* ---------- the bubble: its bottom right corner is the anchor and never moves; the height follows the text ---------- */
.tr-bubble {
  position: fixed; z-index: 60; right: var(--tr-right); bottom: var(--tr-bottom); box-sizing: border-box;
  width: min(var(--tr-width), calc(100vw - var(--tr-right) - 8px));
  padding: 10px 12px;
  border: 1px solid var(--glass-edge); border-radius: var(--tr-radius) var(--tr-radius) var(--tr-tail) var(--tr-radius);
  background: var(--surface); box-shadow: var(--shadow-3);
  color: var(--fg); font: var(--body)/1.45 var(--font-ui); text-align: left;
}
.tr-text { margin: 0; overflow-wrap: break-word; }
.tr-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: var(--space-2); font-size: var(--small); color: var(--fg2); }
.tr-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-count[hidden], .tr .tr-btn[hidden] { display: none; }
.tr-acts { display: flex; align-items: center; gap: 14px; margin-left: auto; }
/* Skip / Replay / Next / Done: text buttons - no fill, no border; underlined under the pointer; the keyboard's ring as every text button */
.tr .tr-btn, .tr .tr-btn:hover, .tr .tr-btn:active {
  height: auto; min-height: 24px; min-width: 0; margin: 0; padding: 0 2px; border: 0; border-radius: 4px; background: none; box-shadow: none;
  font: inherit; font-size: var(--small); line-height: 1.45; color: var(--fg2); cursor: pointer; white-space: nowrap; --press-bg: transparent;
}
.tr .tr-go, .tr .tr-go:hover, .tr .tr-go:active { color: var(--brand); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .tr .tr-btn:hover { text-decoration: underline; text-underline-offset: 3px; } }
.tr .tr-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (pointer: coarse) { .tr .tr-btn, .tr .tr-btn:hover, .tr .tr-btn:active { min-height: 44px; min-width: 44px; } }

/* ---------- the box: a Brand line at 60 %, no fill; it never takes the pointer and never slides ---------- */
.tr-box {
  position: fixed; z-index: 59; box-sizing: border-box; pointer-events: none;
  border: var(--tr-line) solid color-mix(in srgb, var(--brand) 60%, transparent);
}
.tr-box[hidden] { display: none; }
.tr-box.is-out { opacity: 0; }
/* the one animation: the fade out on one target and in on the next. tour.js sets .tr-motion only when motion is allowed */
@media (prefers-reduced-motion: no-preference) { .tr.tr-motion .tr-box { transition: opacity var(--tr-fade) linear; } }

@media (forced-colors: active) { .tr-bubble { border-color: CanvasText; } .tr-box { border-color: Highlight; } }
