/* The dashboard tour (tour.js). Its welcome card is the onboarding card
   (obcard.js, onboard-explain.css). The small cards beside each part wear
   the same look in a smaller size: frosted white, progress dashes, the small
   uppercase label, an Inter Tight title, a round Back, the black Next pill
   and Skip. Like onboarding they stay light in dark mode. */
/* A little darker than the pop-up dim (no blur here), so the ringed part
   stands out on the light dashboard. Dark mode keeps its own. */
html:is([data-view="app"], :has(.rail.shell)) { --tour-dim: rgba(15, 17, 21, 0.4); }
html.dark:is([data-view="app"], :has(.rail.shell)) { --tour-dim: var(--bp-dim, rgba(0, 0, 0, 0.55)); }

/* Over the page while a stop is up: a tap off the card lands here, never on
   the page under it. Clear when a part is ringed (the ring dims the rest),
   dim when nothing is. */
.tour-shield { position: fixed; inset: 0; z-index: 8999; background: transparent; touch-action: none; }
.tour-shield.tour-dim { background: var(--tour-dim, rgba(15, 17, 21, 0.4)); }
.tour-ring {
  position: fixed; z-index: 9000; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--bp-blue, #1570EF), 0 0 0 9999px var(--tour-dim, rgba(15, 17, 21, 0.4));
  transition: left 160ms ease, top 160ms ease, width 160ms ease, height 160ms ease;
}
.tour-ring[hidden], .tour-arrow[hidden] { display: none; }
.tour-arrow { position: fixed; z-index: 9001; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); pointer-events: none; }

.tour-card.obx-mini {
  position: fixed; z-index: 9002; width: min(320px, calc(100vw - 24px)); padding: 16px 18px 14px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: var(--sh), 0 18px 40px rgba(15, 17, 21, 0.18); animation: tour-rise 160ms ease-out both;
}
.tour-card.obx-mini .obx-bar { max-width: none; margin: 0 0 12px; gap: 4px; }
.tour-card.obx-mini .obx-bar li { height: 3px; }
.tour-card.obx-mini .obx-kick { margin: 0 0 4px; font-size: 11px; }
.tour-card.obx-mini .tour-h { margin: 0; font: 600 20px/1.15 var(--head); letter-spacing: -0.02em; color: var(--i); }
.tour-card.obx-mini .tour-p { margin: 6px 0 0; font: 400 14px/1.45 var(--sans); color: var(--s); }
.tour-card.obx-mini .tour-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-card.obx-mini .obx-back { width: 40px; height: 40px; box-shadow: none; }
.tour-card.obx-mini .obx-back .obx-arw { width: 16px; height: 16px; }
.tour-card.obx-mini .obx-go { height: 40px; font-size: 14.5px; padding: 0 12px; gap: 8px; }
.tour-card.obx-mini .obx-ai { width: 22px; height: 22px; }
.tour-card.obx-mini .obx-go .obx-arw { width: 12px; height: 12px; }
.tour-card.obx-mini .obx-skip { flex: none; margin: 0; padding: 4px 2px; }
/* No yellow focus outlines on the tour (Conner, 2026-11-09). A click never
   shows one; Tab shows a soft blue ring so keyboard users still see where
   they are. */
.tour-card:focus { outline: none; }

@keyframes tour-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tour-ring { transition: none; }
  .tour-card.obx-mini { animation: none; }
}

/* The welcome card matches the onboarding card (firstrun-v5.css): same size,
   place, cloud header and colours, light and dark (Conner, 2026-11-18). The
   small step cards after it stay as they are. */
.obx-stage.tour-welcome { --cardh: clamp(600px, calc(100vh - 190px), 690px); padding-left: calc(16px + var(--onb-rw, 0px));
  --tw-card: #FFFFFF; --tw-ink: #0F1115; --tw-soft: #3B4049; --tw-mute: #5E6672; --tw-line: #E6E9EE; --tw-page: #F4F6F9; --tw-cob: #1570EF; }
html.dark .obx-stage.tour-welcome { --tw-card: #1C1D22; --tw-ink: #F2F1EE; --tw-soft: #C5C7CC; --tw-mute: #8B9098; --tw-line: #2A2C32; --tw-page: #121316; --tw-cob: #7AA7FF; }
.obx-stage.tour-welcome .obx-dim { left: var(--onb-rw, 0px); }
html.dark .obx-stage.tour-welcome .obx-dim { background: rgba(8, 8, 10, .55); }
.obx-stage.tour-welcome .obx-col { max-width: 760px; }
.obx-stage.tour-welcome .obx-card { height: var(--cardh); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 98px 26px 24px; background: var(--tw-card); backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 0 0 1px rgba(15,17,21,.05), 0 8px 24px rgba(0,0,0,.18), 0 40px 80px rgba(0,0,0,.28); }
.obx-stage.tour-welcome .obx-art { height: 98px; }
html.dark .obx-stage.tour-welcome .obx-art { background:
  radial-gradient(42% 120% at 90% 8%, rgba(255,165,110,.55), rgba(255,199,154,.22) 45%, transparent 75%),
  radial-gradient(44% 130% at 14% 0%, rgba(141,184,255,.55), rgba(185,211,255,.22) 45%, transparent 75%),
  radial-gradient(34% 100% at 56% 92%, rgba(130,218,175,.4), rgba(155,227,191,.16) 45%, transparent 75%), #23242A; }
.obx-stage.tour-welcome .obx-kick { color: var(--tw-mute); }
.obx-stage.tour-welcome .obx-h { color: var(--tw-ink); }
.obx-stage.tour-welcome .obx-p { color: var(--tw-soft); max-width: 520px; }
.obx-stage.tour-welcome .tw-stops { list-style: none; margin: 18px 0 0; padding: 0; width: 100%; max-width: 420px; text-align: left; }
.obx-stage.tour-welcome .tw-stops li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-top: 6px; border-radius: 12px; font: 600 14px var(--sans); color: var(--tw-ink); background: var(--tw-page); border: 1px solid var(--tw-line); }
.obx-stage.tour-welcome .tw-n { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 700 11px var(--sans); color: #fff; background: var(--tw-cob); }
html.dark .obx-stage.tour-welcome .obx-go { background: #F2F1EE; color: #121316; }
html.dark .obx-stage.tour-welcome .obx-skip { color: #8B9098; }
/* Skip sits under the button without moving the card, so it lines up with onboarding's. */
.obx-stage.tour-welcome .obx-foot { margin-top: 12px; }
.obx-stage.tour-welcome .obx-skip { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; white-space: nowrap; }

/* Smaller than the onboarding card, still centred with the coloured header
   (Conner, 2026-11-18): a step between onboarding and the small tour cards. */
.obx-stage.tour-welcome .obx-col { max-width: 600px; }
.obx-stage.tour-welcome .obx-card { height: auto; min-height: 0; padding: 110px 28px 28px; }
.obx-stage.tour-welcome .obx-art { height: 98px; }
.obx-stage.tour-welcome .tw-stops { max-width: 380px; }
.obx-stage.tour-welcome .obx-foot { width: 380px; }

/* A formal card, smaller than onboarding's (Conner, 2026-11-18): why it shows
   on top as a pill, the words, then the steps they'll take. */
.obx-stage.tour-welcome .obx-card { min-height: 470px; padding: 118px 32px 30px; }
.obx-stage.tour-welcome .obx-kick { margin: 0 0 10px; letter-spacing: normal; text-transform: none; }
.obx-stage.tour-welcome .tw-why { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; font: 600 12.5px var(--sans); color: var(--tw-mute); background: var(--tw-page); border: 1px solid var(--tw-line); }
.obx-stage.tour-welcome .tw-why.on { color: #0A7A45; background: #E3F9EC; border-color: transparent; }
html.dark .obx-stage.tour-welcome .tw-why.on { color: #5FD394; background: #15301F; }
.obx-stage.tour-welcome .tw-dot { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 800; color: #fff; background: var(--tw-line); }
.obx-stage.tour-welcome .tw-why.on .tw-dot { background: #12B76A; }
.obx-stage.tour-welcome .obx-p { margin-top: 8px; max-width: 440px; }
.obx-stage.tour-welcome .tw-stops { margin-top: 20px; }

/* Words to send their AI, with Copy on the card (lessons.js, 2026-11-18) */
.tour-card.obx-mini .tour-say { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: rgba(15, 17, 21, 0.05); }
.tour-card.obx-mini .tour-say code { flex: 1; min-width: 0; font: 500 13px/1.4 var(--sans); color: var(--i); }
.tour-card.obx-mini .tour-copy { flex: none; min-height: 0; height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: #121316; color: #fff; font: 600 12.5px var(--sans); cursor: pointer; }

/* No Back on the welcome card, so no room kept for one: its button sits in the middle (Conner, 2026-11-18). */
.obx-stage.tour-welcome .obx-foot .obx-back-ph { display: none; }
/* Steps that ring sidebar rows (Conner, 2026-11-18): one veil with holes over
   the ringed part and the sidebar; the sidebar's own background takes the same
   dimming so the edge is one tone, and its rows stay crisp where ringed. */
.tour-veil { position: fixed; inset: 0; z-index: 8998; pointer-events: none; background: var(--tour-dim, rgba(15, 17, 21, 0.4)); }
.tour-ring.tour-ring-plain { box-shadow: 0 0 0 3px var(--bp-blue, #1570EF); }
body.tour-rail .rail.shell::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--tour-dim, rgba(15, 17, 21, 0.4)); }

/* Which lesson a card belongs to (Conner, 2026-11-18). */
.tour-card.obx-mini .tour-lesson { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.tour-card.obx-mini .tour-lesson-n { flex: none; padding: 3px 9px; border-radius: 999px; font: 700 11px var(--sans); color: #fff; background: var(--bp-blue, #1570EF); }
.tour-card.obx-mini .tour-lesson b { font: 600 13.5px var(--sans); color: var(--i); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-card.obx-mini .obx-kick.tour-stepn { text-align: center; margin: 0 0 6px; }
/* No focus ring on the welcome card's buttons unless someone is tabbing (Conner: no outlines). */
.obx-stage.tour-welcome .obx-go:focus:not(:focus-visible), .obx-stage.tour-welcome .obx-go:focus { outline: none; }
