/* shared-ui -- the welcome tour (T-280 item 2). Pairs with tour.js. Every
 * selector is scoped to .td-tour-* or .td-helper, which only tour.js adds,
 * so loading this on a page without a tour changes nothing.
 */

/* Bottom-right helper box: the offer, the "Take the tour" button, and later
 * the helper robot's icon (.td-helper-icon, empty for now). */
.td-helper {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--td-space-2, 8px);
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.td-helper > * { pointer-events: auto; }
.td-helper [hidden] { display: none !important; }
.td-helper-icon:empty { display: none; }

.td-tour-offer,
.td-tour-card {
  box-sizing: border-box;
  padding: var(--td-space-4, 16px);
  border: 1px solid var(--td-border);
  border-radius: var(--td-radius, 10px);
  background: var(--td-bg-elev);
  color: var(--td-text);
  box-shadow: var(--td-shadow, 0 8px 24px rgba(0, 0, 0, 0.25));
  font-family: var(--td-font, inherit);
  font-size: var(--td-text-md, 15px);
  line-height: 1.45;
}
.td-tour-offer {
  position: relative;
  width: 320px;
  max-width: 100%;
}
/* The speech-bubble tail, pointing at where the robot icon will sit. */
.td-tour-offer::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--td-bg-elev);
  border-right: 1px solid var(--td-border);
  border-bottom: 1px solid var(--td-border);
  transform: rotate(45deg);
}
.td-tour-offer-title,
.td-tour-title {
  margin: 0 0 var(--td-space-1, 4px);
  font-size: var(--td-text-lg, 17px);
  font-weight: 600;
  color: var(--td-text);
}
.td-tour-text { margin: 0 0 var(--td-space-3, 12px); color: var(--td-text-dim, var(--td-text)); }
.td-tour-count {
  margin: 0 0 var(--td-space-1, 4px);
  font-size: var(--td-text-sm, 13px);
  color: var(--td-muted, var(--td-text-dim));
}
.td-tour-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--td-space-2, 8px);
}

.td-tour-btn {
  padding: 7px 14px;
  border: 1px solid var(--td-border);
  border-radius: var(--td-radius-sm, 6px);
  background: var(--td-bg-elev-2, transparent);
  color: var(--td-text);
  font: inherit;
  cursor: pointer;
}
.td-tour-btn:hover { border-color: var(--td-accent); }
.td-tour-btn:focus-visible { outline: 2px solid var(--td-accent); outline-offset: 2px; }
.td-tour-primary {
  background: var(--td-accent);
  border-color: var(--td-accent);
  color: var(--td-accent-text, #fff);
  font-weight: 600;
}
.td-tour-primary:hover { background: var(--td-accent-hover, var(--td-accent)); }
.td-tour-quiet {
  margin-right: auto;
  border-color: transparent;
  background: none;
  color: var(--td-text-dim, var(--td-text));
  text-decoration: underline;
  padding-left: 4px;
  padding-right: 4px;
}
.td-tour-launcher {
  border-radius: 999px;
  background: var(--td-bg-elev);
  box-shadow: var(--td-shadow, 0 4px 12px rgba(0, 0, 0, 0.2));
}

/* The running tour: a layer over the page (clicks go nowhere but the card),
 * a cut-out around the real element, and the step card beside it. */
.td-tour-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.td-tour-layer.td-tour-dim { background: rgba(0, 0, 0, 0.45); }
.td-tour-spot {
  position: fixed;
  border-radius: var(--td-radius-sm, 6px);
  box-shadow: 0 0 0 3px var(--td-accent), 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: left 0.15s, top 0.15s, width 0.15s, height 0.15s;
}
.td-tour-spot[hidden] { display: none; }
.td-tour-card {
  position: fixed;
  max-width: calc(100vw - 32px);
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .td-tour-spot { transition: none; }
}
@media print {
  .td-helper, .td-tour-layer { display: none !important; }
}
