/* The one-minute tour (tour.ts): a still opening card, then a stage with a caption under it and the controls below. */
dialog.tour { width: min(1000px, calc(100vw - 32px)); max-width: 1000px; max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line2); border-radius: 18px; background: var(--bg, var(--panel)); color: var(--text); overflow: auto; }
dialog.tour::backdrop { background: rgb(0 0 0 / 0.6); }

/* The opening card */
.tourcard { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: clamp(24px, 5vw, 56px); max-width: 620px; }
.tourcard h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; letter-spacing: -0.02em; margin: 4px 0 0; }
.tourcard p { font-size: 17px; color: var(--soft); margin: 0; }
.tourrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.tourrow .primary { font-size: 16px; padding: 10px 18px; }

/* The stage: a small Office, drawn with the app's own colours, so it follows light and dark */
.tourplayer { display: flex; flex-direction: column; }
.tourstage { display: grid; grid-template-columns: 92px minmax(0, 1fr); aspect-ratio: 16 / 7.4; min-height: 340px; background: var(--panel); border-bottom: 1px solid var(--line); overflow: hidden; }
.tourrail { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 0; background: var(--bg); border-inline-end: 1px solid var(--line); }
.tourrail > .logo { margin-bottom: 10px; }
.tourrailitem { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 72px; padding: 5px 0; border-radius: 10px; color: var(--muted); font-size: 12px; transition: background 0.4s, color 0.4s; }
.tourrailitem.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.tourrailitem.on .ico { color: var(--accent); }
.tourgap { flex: 1; }
.touracct { display: grid; place-items: center; width: 32px; height: 32px; margin-top: 6px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line2); font-size: 12px; transition: box-shadow 0.4s; }
.touracct.on { box-shadow: 0 0 0 3px var(--accent); }
.tourpage { display: flex; flex-direction: column; gap: 12px; padding: clamp(18px, 4vw, 40px); overflow: hidden; }
.tourhead { font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.01em; }
.tourlogo { display: flex; align-items: center; gap: 14px; font-size: clamp(22px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; }
.tourbox { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line2); font-size: 15px; }
.tourbox.quiet { color: var(--soft); background: transparent; }
.tourask { justify-content: flex-start; border-color: var(--accent); }
.tourcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tourcards .tourbox { flex-direction: column; align-items: flex-start; gap: 4px; }
.tourcards .tourbox span { color: var(--soft); font-size: 13px; }
.tourcards .tourbox.dashed { border-style: dashed; justify-content: center; color: var(--soft); }
.tourcards .tourbox.lit { border-color: var(--accent); }
.tourchip { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line2); white-space: nowrap; color: var(--soft); }
.tourchip.lit { border-color: var(--accent); color: var(--text); }
.touryes { padding: 6px 16px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-weight: 700; white-space: nowrap; }

/* The caption: the whole explanation, large and plain, under the picture rather than over it */
.tourcap { margin: 0; padding: 16px clamp(16px, 4vw, 40px); min-height: 3.6em; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.4; font-weight: 500; text-align: center; color: var(--text); }

/* The controls */
.tourcontrols { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 16px; }
.tourbtn { min-height: 38px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 9px; }
.tourbars { flex: 1 1 160px; display: flex; gap: 4px; }
.tourbars span { flex: 1; height: 5px; border-radius: 3px; background: var(--line2); overflow: hidden; }
.tourbars b { display: block; height: 100%; width: 0; background: var(--accent); }
.tourtime { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Movement: each part of a scene rises in turn, the request types itself, and Yes glows. Paused, it all holds still. */
.tourin { animation: tour-up 0.6s both; }
.tourpage > .tourin:nth-child(2) { animation-delay: 0.5s; }
.tourpage > .tourin:nth-child(3) { animation-delay: 1s; }
.tourpage > .tourin:nth-child(4) { animation-delay: 1.5s; }
.tourtyped { display: inline-block; overflow: hidden; white-space: nowrap; max-width: 100%; animation: tour-type 2.6s steps(36) 0.6s both; }
.tourpulse { animation: tour-glow 1.2s 2.2s 2; }
dialog.tour.paused * { animation-play-state: paused !important; }
@keyframes tour-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes tour-type { from { width: 0; } to { width: 100%; } }
@keyframes tour-glow { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  .tourin, .tourtyped, .tourpulse { animation: none; }
  .tourrailitem, .touracct { transition: none; }
}

@media (max-width: 640px) {
  .tourstage { grid-template-columns: 58px minmax(0, 1fr); aspect-ratio: auto; min-height: 320px; }
  .tourrailitem { width: 48px; font-size: 10px; }
  .tourcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tourbars { order: 10; flex-basis: 100%; }
}
.helptour { margin-top: 14px; }
