.tour-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin-top: 24px;
  padding: 10px 8px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font-size: .75rem;
}
.tour-launch > span:first-child { border: 1px solid currentColor; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }
.tour-launch > span:last-child { margin-left: auto; }
.tour-launch:hover { color: var(--brand-deep); background: var(--brand-tint); }
.tour-card {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 20px 24px 24px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: 0 12px 44px color-mix(in oklch, var(--ink) 15%, transparent);
}
.tour-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-kicker { font-size: .5625rem; letter-spacing: .09em; color: var(--muted); }
.tour-topline button { min-height: 44px; padding: 8px 0 8px 8px; border: 0; background: transparent; font-size: .75rem; white-space: nowrap; }
.tour-topline button span { font-size: 1.2rem; margin-left: 6px; }
.tour-heading { display: flex; align-items: center; gap: 20px; margin: 12px 0 16px; }
.tour-number { font: 500 3.5rem/1 var(--display); letter-spacing: -.06em; color: var(--brand-deep); }
.tour-counter { font-size: .6875rem; color: var(--muted); margin: 0 0 6px; }
.tour-card h2 { font-size: 1.5rem; margin: 0; letter-spacing: -.04em; line-height: 1.1; }
.tour-card h2:focus { outline: none; }
.tour-description { font-size: .9375rem; line-height: 1.5; margin: 0 0 14px; }
.tour-hint { font-size: .75rem; line-height: 1.5; color: var(--muted); border-left: 2px solid var(--line); padding-left: 12px; margin: 0 0 24px; }
.tour-progress { display: block; appearance: none; width: 100%; height: 3px; border: 0; background: var(--line); color: var(--brand); }
.tour-progress::-webkit-progress-bar { background: var(--line); }
.tour-progress::-webkit-progress-value { background: var(--brand); }
.tour-progress::-moz-progress-bar { background: var(--brand); }
.tour-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.tour-controls .button { font-size: .8125rem; padding: 12px 16px; gap: 8px; }
.tour-controls .text-button { min-height: 44px; }
.tour-controls button:disabled { opacity: .4; cursor: default; }
.tour-target { outline: 2px solid var(--brand-deep); outline-offset: 8px; border-radius: 2px; }
body.tour-open { padding-bottom: var(--tour-clearance, 440px); }
.tour-open .toast { bottom: calc(var(--tour-clearance, 440px) + 8px); z-index: 31; }
@media (max-width: 860px) {
  .tour-launch { width: auto; margin: 0; border: 0; padding: 8px; white-space: nowrap; }
  .sidebar { flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .tour-launch { margin-left: auto; padding-block: 4px; }
  .tour-card { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 24px); padding: 12px 20px 16px; }
  .tour-heading { margin: 4px 0 12px; gap: 16px; }
  .tour-number { font-size: 2.5rem; }
  .tour-card h2 { font-size: 1.25rem; }
  .tour-description { font-size: .875rem; margin-bottom: 10px; }
  .tour-hint { margin-bottom: 16px; }
  .tour-controls { margin-top: 12px; }
}
/* In a short/zoomed viewport the guide occupies its own document row.
   No fixed sheet may cover the whole workspace or its keyboard focus. */
@media (max-height: 600px) {
  .tour-card { position: relative; right: auto; bottom: auto; width: auto; max-height: none; margin: 16px; }
  body.tour-open { padding-bottom: 0; }
  .tour-open .toast { bottom: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tour-card { animation: tour-arrive .22s var(--ease); }
  @keyframes tour-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media print {
  .tour-card, .tour-launch { display: none !important; }
  .tour-target { outline: 0; }
  body.tour-open { padding-bottom: 0; }
}
