/* THE WALKTHROUGH'S CARDS AND ITS ATTENTION RING (walkthrough/tour.js,
   walkthrough/attention.js), over vendor/driver.css.

   Scoped to `.mira-tour*` and the Help disclosure: nothing of the app's own
   layout is restyled. Colours are the app's tokens and Mira's logo blues
   (--mira-star is the brand Dark Blue, --mira-dot the brand Blue); the pale
   brand blue has no token yet. Timing for the ring is the four variables
   below, so it is tuned in one place. */
:root{
  --tour-pale:#A6E7FF;
  --tour-pale-bg:#EEF9FF;
  --tour-ring:var(--mira-dot);
  --tour-pulse-duration:1.2s;
  --tour-pulse-count:2;
  --tour-pulse-spread:9px;
}

/* ---- the landing page's ? button ---- */
.mira-tour-help{
  position:absolute; right:24px; bottom:20px; width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  font:600 17px/1 var(--disp); color:var(--mira-star); background:var(--panel);
  border:1px solid var(--line-strong); box-shadow:0 4px 14px rgba(10,37,64,.10);
}
.mira-tour-help[hidden]{display:none}
.mira-tour-help:hover{border-color:var(--mira-dot); background:var(--tour-pale-bg)}
.mira-tour-help:focus-visible{outline:2px solid var(--mira-star); outline-offset:2px}
/* The app's own tooltip, opened upward: the button sits on the bottom edge. */
.mira-tour-help .ico-tip{top:auto; bottom:calc(100% + 8px)}
.mira-tour-help:hover .ico-tip,.mira-tour-help:focus-visible .ico-tip{opacity:1; visibility:visible}
@media (max-width:480px){ .mira-tour-help{right:16px; bottom:14px} }

/* ---- the card ----
   Progress, title, description, the action box, then Back and Skip: one
   column with even gaps, natural height, no caret. */
.driver-popover.mira-tour{
  font-family:var(--body); color:var(--ink); background:var(--panel);
  border:1px solid rgba(10,37,64,.10); border-radius:12px;
  box-shadow:0 8px 24px rgba(10,37,64,.12), 0 1px 3px rgba(10,37,64,.06);
  padding:20px 22px 18px; min-width:0;
  width:min(400px, calc(100vw - 32px)); max-width:calc(100vw - 32px);
}
/* Never taller than the screen: on a short one the card scrolls inside itself
   and its footer (Back, Next, Done) stays pinned at the bottom of it. */
.driver-popover.mira-tour{max-height:calc(100dvh - 24px); overflow-y:auto; overscroll-behavior:contain}
.driver-popover.mira-tour:focus{outline:none}
/* The card takes focus so a screen reader reads it; its ring is a quiet one,
   kept apart from the strong ring of a control the user can press. */
.driver-popover.mira-tour:focus-visible{outline:2px solid var(--tour-pale); outline-offset:2px}
.driver-popover.mira-tour .driver-popover-arrow{display:none}

.mira-tour-progress{font-size:12.5px; font-weight:500; letter-spacing:.01em; color:var(--ink-faint); margin:0 32px 10px 0}
.driver-popover.mira-tour .driver-popover-title{
  font-family:var(--disp); font-size:18px; font-weight:700; line-height:1.3; color:var(--ink); margin-right:32px;
}
.driver-popover.mira-tour .driver-popover-description{
  font-size:14px; line-height:1.6; color:var(--ink-soft); margin-top:8px;
}
.driver-popover.mira-tour b{font-weight:600; color:var(--ink)}
.driver-popover.mira-tour .driver-popover-description p{margin:0}
.driver-popover.mira-tour .driver-popover-description p + p{margin-top:10px}

/* What to do, apart from why: a pale-blue box across the card, the control's
   name in bold blue -- emphasis, never a link or a second button. */
.mira-tour-instruction{
  margin:16px 0 0; padding:11px 14px; font-size:14px; line-height:1.5; color:var(--ink-soft);
  background:var(--tour-pale-bg); border-radius:8px;
}
.driver-popover.mira-tour .mira-tour-instruction b{color:var(--mira-star); font-weight:600}

/* ---- a read card's body (tour.js's `readBody`): goal, diagram, table,
   example, who qualifies, note -- one column, even gaps. ---- */
.mira-tour-readbody{display:flex; flex-direction:column; gap:12px; margin-top:12px; font-size:14px; line-height:1.5; color:var(--ink-soft)}
.mira-tour-readbody p{margin:0}
.mira-tour-subhead{font-weight:600; color:var(--ink); margin-bottom:-6px !important}

/* Two aligned columns, the control's name in the second. */
.mira-tour-rows{display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); border:1px solid var(--line-strong); border-radius:8px; overflow:hidden}
.mira-tour-row{display:contents}
.mira-tour-cell{padding:8px 12px; border-top:1px solid var(--line)}
.mira-tour-row.is-head .mira-tour-cell{border-top:0; background:var(--cream); font-size:12px; font-weight:600; letter-spacing:.02em; color:var(--ink-faint)}
.mira-tour-cell + .mira-tour-cell{border-left:1px solid var(--line)}

/* The example, drawn: an illustration in the walkthrough's pale blue, dashed,
   captioned "Example", never the panel's criterion cards -- so it cannot be
   read as a rule the user has set. A keeps its place from card to card. */
.mira-tour-figure{position:relative; padding:18px 12px 12px; border:1px dashed var(--tour-pale); border-radius:10px; background:var(--tour-pale-bg)}
.mira-tour-fcap{position:absolute; top:-8px; left:10px; padding:0 6px; background:var(--panel); border-radius:4px;
  font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-faint)}
.mira-tour-flane{display:flex; align-items:center; flex-wrap:wrap; gap:8px}
.mira-tour-fzone{font-size:12.5px; font-weight:600; color:var(--mira-star); margin-right:2px}
.mira-tour-chip{display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:28px; padding:0 10px;
  border:1px solid var(--mira-dot); border-radius:6px; background:var(--panel); font-weight:600; color:var(--ink)}
.mira-tour-fgroup{display:inline-flex; flex-direction:column; gap:6px; padding:6px 8px 8px; border:1.5px solid var(--mira-star); border-radius:8px; background:var(--panel)}
.mira-tour-fglabel{font-size:11.5px; font-weight:600; color:var(--mira-star)}
.mira-tour-fgrules{display:flex; gap:6px}

/* Who qualifies: a mark per line, the line's words carrying the meaning. */
.mira-tour-outcomes{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px}
.mira-tour-outcomes li{display:flex; gap:8px; align-items:baseline}
.mira-tour-mark{flex:none; width:1em; font-weight:700}
.mira-tour-outcomes .is-ok .mira-tour-mark{color:var(--good)}
.mira-tour-outcomes .is-no .mira-tour-mark{color:var(--bad)}
.mira-tour-note-line{font-size:13px; color:var(--ink-faint)}
.mira-tour-readbody .mira-tour-instruction{margin:0}

/* The last card's one action: the app's own sign-in control (`.sb-signin`, Mira's
   mark and label), across the card. */
.driver-popover.mira-tour .mira-tour-signin{width:100%; justify-content:center; margin-top:16px}

/* × closes the whole walkthrough, from every card. */
.mira-tour-close{
  position:absolute; top:12px; right:12px; display:flex; align-items:center; justify-content:center;
  width:32px; height:32px; border:0; border-radius:8px; background:transparent; color:var(--ink-faint); cursor:pointer;
}
.mira-tour-close svg{width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round}
.mira-tour-close:hover{background:var(--cream); color:var(--ink)}
.mira-tour-close:focus-visible{outline:2px solid var(--mira-star); outline-offset:1px; color:var(--ink)}

.mira-tour-foot{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:16px; flex-wrap:wrap;
  position:sticky; bottom:-18px; background:var(--panel)}
.mira-tour-foot-start,.mira-tour-foot-end{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.mira-tour-foot-end{margin-left:auto}
.mira-tour-foot:not(:has(.mira-tour-btn)){display:none}

.mira-tour-btn{font:500 13.5px/1 var(--body); border-radius:8px; padding:9px 16px; cursor:pointer; border:1px solid transparent}
.mira-tour-btn:focus-visible{outline:2px solid var(--mira-star); outline-offset:2px}
.mira-tour-btn-primary{color:#fff; background:var(--mira-star); border-color:var(--mira-star)}
.mira-tour-btn-primary:hover{background:#004AD6; border-color:#004AD6}
.mira-tour-btn-secondary{color:var(--ink); background:var(--panel); border-color:var(--line-strong)}
.mira-tour-btn-secondary:hover{background:var(--cream)}
/* Skip / Finish walkthrough / Replay walkthrough: text, never a second button. */
.mira-tour-btn-quiet{color:var(--ink-soft); background:transparent; padding:9px 4px}
.mira-tour-btn-quiet:hover{color:var(--ink); text-decoration:underline; text-underline-offset:3px}

/* ---- welcome and completion: one family, roomier than a step card ---- */
.driver-popover.mira-tour-welcome,.driver-popover.mira-tour-completion{
  width:min(540px, calc(100vw - 32px)); padding:36px 40px 28px; border-radius:18px;
}
/* Wide enough for its one-line heading at desktop widths; below ~600px the
   heading wraps at the same size rather than shrinking. */
.driver-popover.mira-tour-completion{width:min(600px, calc(100vw - 32px))}
.mira-tour-logo{display:inline-flex; align-items:center; gap:.224em; line-height:1; vertical-align:-.08em}
.driver-popover.mira-tour-welcome .driver-popover-title{font-size:31px; line-height:1.2; margin-right:28px}
.driver-popover.mira-tour-welcome .driver-popover-description,.driver-popover.mira-tour-completion .driver-popover-description{font-size:15.5px; line-height:1.6; margin-top:14px}
.mira-tour-support{margin:14px 0 0; font-size:15.5px; line-height:1.55; color:var(--ink)}
.mira-tour-welcome .mira-tour-foot,.mira-tour-completion .mira-tour-foot{margin-top:28px}
/* The welcome card has one action, centred under the copy. */
.mira-tour-welcome .mira-tour-foot{justify-content:center}
/* The landing tiles' icons, wordless, centred above the one action. */
.mira-tour-icons{display:flex; justify-content:center; gap:56px; margin:24px 0 0}
.mira-tour-icon{display:flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:12px; background:var(--tour-pale-bg)}
.mira-tour-icon svg{width:22px; height:22px; color:var(--mira-star); fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round}
.mira-tour-welcome .mira-tour-foot-start{display:none}
.mira-tour-welcome .mira-tour-foot-end{margin:0; flex:1; flex-direction:column; gap:8px}
/* Start Walkthrough and Play Tutorial Video run the card's whole width. */
.mira-tour-welcome .mira-tour-foot-end .mira-tour-btn-primary,
.mira-tour-welcome .mira-tour-foot-end .mira-tour-btn-secondary{width:100%}
/* Skip for Now: small, beneath the two ways on. */
.mira-tour-welcome .mira-tour-foot-end .mira-tour-btn-quiet{font-size:13px; padding:8px 4px}
.mira-tour-welcome .mira-tour-btn,.mira-tour-completion .mira-tour-btn{font-size:14.5px; padding:12px 20px}
.mira-tour-welcome .mira-tour-btn-quiet,.mira-tour-completion .mira-tour-btn-quiet{padding:12px 4px}

.mira-tour-brandhead{margin-bottom:20px}
.mira-tour-brandhead .mira-tour-logo{font-size:32px}
/* The × sits in the brand row above, so the title runs the card's full width. */
.driver-popover.mira-tour-completion .driver-popover-title{font-size:24px; line-height:1.25; margin-right:0}
/* The two paragraphs under the heading share one body size and leading. */
.mira-tour-note{margin:14px 0 0; font-size:15.5px; line-height:1.6; color:var(--ink-soft)}

@media (max-width:480px){
  .driver-popover.mira-tour{padding:16px 16px 14px}
  .mira-tour-foot{bottom:-14px}
  .driver-popover.mira-tour-welcome,.driver-popover.mira-tour-completion{padding:26px 20px 18px}
  .driver-popover.mira-tour-welcome .driver-popover-title{font-size:24px}
  .mira-tour-icons{gap:32px}
  }

/* ---- waiting ---- */
.mira-tour-wait{display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--ink-soft); padding-right:28px}
.mira-tour-wait .spinner{width:16px; height:16px; border-width:2px; margin:0}

/* Step 3's signed-in body, which the page renders under its sign-in card:
   shown whole and readable, the card set aside. The Analyze card is `inert`
   (example-session.js) and its button dimmed. */
.mira-tour-signed-in-view .lockcard{display:none}
.mira-tour-signed-in-view .locked-body{pointer-events:auto; user-select:text; max-height:none; overflow:visible;
  -webkit-mask-image:none; mask-image:none}
.mira-tour-signed-in-view .locked-body .sqltab,.mira-tour-signed-in-view .locked-body .access-analyze{filter:none}
.mira-tour-signed-in-view .locked-body .rowtable-wrap{max-height:340px; overflow:auto}
/* The lock's two wrappers stretch as the panel does signed in, so the records
   box grows to its cap (styles.css's .rowtable-wrap) instead of a few rows. */
.mira-tour-signed-in-view,.mira-tour-signed-in-view .locked-body{flex:1 1 auto; display:flex; flex-direction:column; min-height:0}
/* Analyze is the signed-in researcher's; in the example it reads as unavailable. */
.mira-tour-signed-in-view .analyze-btn{opacity:.45; cursor:not-allowed; box-shadow:none}

/* ---- the veil (tour.js's `wear`) ----
   A card with no spotlight: the page behind it is blurred as well as dimmed,
   so no control on it reads as the way on. The card (Driver appends it to
   the body, or to its layer inside an open dialog), the dim, the rings and
   Driver's anchor are body's own children and stay sharp. */
body.mira-tour-veil > :not(.driver-popover):not(.driver-overlay):not(.driver-layer):not(.mira-tour-ring):not(#driver-dummy-element){filter:blur(4px)}
/* The panel's own Refine Cohort pulse (styles.css's .step-next--nudge, after
   a selection change) is held while a card says the way on is its Next; the
   card that asks for Refine Cohort rings it instead. */
body.mira-tour-hush .step-next--nudge{animation:none}

/* ---- the attention ring (attention.js) ----
   Its own element, so the control keeps its look, size, focus ring and click
   area. Above the dim, below the card; never takes a pointer. */
.mira-tour-ring{
  position:fixed; z-index:10001; pointer-events:none; box-sizing:border-box;
  border:2px solid var(--tour-ring); box-shadow:0 0 0 0 rgba(0,187,255,0);
}
.mira-tour-ring[hidden]{display:none}
.mira-tour-ring.is-pulsing{animation:mira-tour-pulse var(--tour-pulse-duration) ease-out var(--tour-pulse-count)}
@keyframes mira-tour-pulse{
  0%{box-shadow:0 0 0 0 rgba(0,187,255,.45)}
  100%{box-shadow:0 0 0 var(--tour-pulse-spread) rgba(0,187,255,0)}
}
@media (prefers-reduced-motion:reduce){
  .mira-tour-ring.is-pulsing{animation:none}
}

/* An app dialog opened from a highlighted area sits above the dim and takes
   clicks, as it would without the walkthrough. */
.driver-active :has(> [aria-modal="true"]){z-index:10002}
.driver-active :has(> [aria-modal="true"]),.driver-active :has(> [aria-modal="true"]) *{pointer-events:auto}
