/* Guided tour: dimmed page with a rounded spotlight, and an explanation card beside it (docked at the bottom on phones). */
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour[hidden] { display: none; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: absolute; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(14, 17, 42, .58), 0 0 0 3px #f5b400 inset; pointer-events: none; transition: left .3s, top .3s, width .3s, height .3s; }
.tour-hole[hidden] { display: block; left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 200vmax rgba(14, 17, 42, .58); }
.tour-card { position: absolute; width: min(380px, calc(100vw - 24px)); box-sizing: border-box; background: var(--d-panel, #fff); color: var(--ink, #14162b); border-radius: 18px; padding: 16px 18px 14px; box-shadow: 0 24px 60px -20px rgba(14, 17, 42, .55); font-family: "Plus Jakarta Sans", system-ui, sans-serif; transition: left .3s, top .3s; }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); }
.tour-card.docked { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; transform: none; }
.tour-card.docked.center { top: auto !important; }
.tour-card.docked.top { top: calc(12px + var(--sat, 0px)) !important; bottom: auto; }
.tour-top { display: flex; align-items: center; gap: 8px; }
.tour-n { font: 700 11px "JetBrains Mono", monospace; letter-spacing: .08em; color: var(--muted, #6b6f85); }
.tour-card:not([lang="en"]) .tour-n { font-family: inherit; letter-spacing: 0; }
.tour-card h2 { margin: 8px 0 6px; font-size: 19px; letter-spacing: -.01em; }
.tour-card p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--d-muted, #3b3f58); }
.tour-card p.tour-note { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--d-warn, #fff6dc); color: var(--d-warn-ink, #7a5600); font-size: 13.5px; font-weight: 600; }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 12px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line, #e3e5ef); }
.tour-dots i.on { background: var(--indigo, #3d46c8); width: 16px; border-radius: 3px; }
.tour-nav { display: flex; gap: 8px; }
.tour-nav button { min-height: 42px; border-radius: 12px; font: 700 14.5px inherit; font-family: inherit; cursor: pointer; padding: 0 16px; }
.tour-back { border: 1px solid var(--line, var(--d-line, #e3e5ef)); background: var(--d-panel, #fff); color: var(--indigo, #3d46c8); }
.tour-next { flex: 1; border: 0; background: var(--indigo, #3d46c8); color: #fff; }
.tour-next:focus-visible, .tour-back:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }
.tour-open b { font-size: 12px; padding-inline-start: 2px; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }
/* Phones (tour.js showMe): the card has Previous, Show me and Next; Show me puts it away, the feature plays undimmed for a
   few seconds with a progress line on top, then the next card comes. "Back to card" stops it early. */
.tour.showing { pointer-events: none; } /* only the block (clipped around the hole) and the chips take touches */
.tour.showing :is(.tour-block, .tour-again) { pointer-events: auto; }
.tour-chips { display: none; }
/* Glass chips over the body (backdrop-filter) are drawn broken under the tour's dimmed layer on iPhones: solid while touring. */
html.touring .app > :is(.mrail, .stage) :is(button, .mhelp) { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.touring .m-pill { visibility: hidden; } /* a body step folds the Treatment sheet (tour.js sheetFor); its pill would sit under the chips */
/* tour.js place(): while a phone reads a body step's card, the body takes only the room above the card. */
/* Only while a tour card is on screen: a class left behind must never shorten the body. */
@media (max-width: 1024px) { html.touring.tour-fit:not(.guest-tour):has(.tour:not([hidden]):not(.showing)) .app.app.app > .stage { height: calc(100svh - var(--tour-card-h, 0px)) !important; } }
.tour.showing .tour-card { display: none; }
.tour.showing .tour-hole { box-shadow: 0 0 0 3px #f5b400 inset; } /* the show plays undimmed */
.tour.showing .tour-chips { position: absolute; inset: 0; display: block; pointer-events: none; }
.tour-bar { position: absolute; inset: 0 0 auto; height: 4px; background: #f5b400; transform-origin: left; transform: scaleX(0); animation: tour-bar linear forwards; }
[dir="rtl"] .tour-bar { transform-origin: right; }
@keyframes tour-bar { to { transform: scaleX(1); } }
.tour-again { position: absolute; inset-inline-start: 12px; top: calc(12px + var(--sat, 0px)); pointer-events: auto; min-height: 44px; max-width: 70%; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(14, 17, 42, .72); color: #fff; font: 700 14.5px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; box-shadow: 0 10px 24px -8px rgba(14, 17, 42, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-chips.down .tour-again { top: auto; bottom: calc(14px + var(--sab, 0px)); }
.tour-again:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }
@media (max-width: 700px) { .tour-open { display: none; } }
.tour-in-hiw { display: none; }
@media (max-width: 700px) { .tour-in-hiw { display: block; width: 100%; min-height: 44px; margin: 0 0 12px; border: 0; border-radius: 12px; background: var(--indigo, #3d46c8); color: #fff; font: 700 15px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; } }
/* Animated how-to cursor on the body steps (tour-demo.js). */
.tour-cursor { position: fixed; left: 0; top: 0; z-index: 1001; pointer-events: none; width: 0; height: 0; will-change: transform; }
.tour-cursor[hidden] { display: none; }
.tour-cursor svg { position: absolute; left: -4px; top: -2px; width: 28px; height: 28px; fill: #fff; stroke: #14162b; stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 3px 6px rgba(14, 17, 42, .45)); transition: transform 120ms ease-out; }
.tour-cursor i { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; background: rgba(245, 180, 0, .35); box-shadow: 0 0 0 2px #f5b400; opacity: 0; transform: scale(.4); transition: opacity 140ms, transform 140ms; }
.tour-cursor.down i { opacity: 1; transform: scale(1); }
.tour-cursor.down svg { transform: scale(.88); }
/* The self-playing tour (tour-guest.js): a bar that fills while the step plays. */
.tg-bar { height: 3px; margin: 12px 0 2px; border-radius: 2px; background: var(--line, #e3e5ef); overflow: hidden; }
.tg-bar i { display: block; height: 100%; width: 100%; background: var(--indigo, #3d46c8); transform-origin: left; animation: tg-fill linear forwards; }
.tour-card[dir="rtl"] .tg-bar i { transform-origin: right; }
@keyframes tg-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* tour-guest.js: the card waits while the step's item plays alone, then fades in. */
.tour-card.tg-wait { visibility: hidden; }
.tour-guest .tour-card:not(.tg-wait) { animation: tg-in .35s ease-out; }
.tour-guest .tour-card.center:not(.tg-wait) { animation: none; }
@keyframes tg-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tg-bar i { animation: none; transform: none; } }
.tour-guest .tour-nav { margin-top: 12px; }
/* tour-guest.js: the tour plays full screen, like a picture — no side bar, top bar or phone tab bar. The panels a step opens stay where they are. */
html.guest-tour :is(.bar, .sidenav.mode) { display: none; }
html.guest-tour .app { margin-inline-start: 0; padding-bottom: 0; }
/* Phones: where the body is the whole view (its height leaves room for both bars) it takes the screen; the quiz and the
   treatment keep their panel under the body. */
@media (max-width: 1024px) {
  html.guest-tour .app:is(.mer, .methods, .study-anat) > .stage { height: calc(100svh - var(--sat, 0px) - var(--sab, 0px)) !important; }
}
/* tour.js (the signed-in tour): the top bar goes and the body takes its room; the tab bar stays, as a step points at it. */
html.touring:not(.guest-tour):has(.tour:not([hidden])) .app > .bar { display: none; }
@media (min-width: 1025px) { html.touring:not(.guest-tour):has(.tour:not([hidden])) .app { grid-template-rows: 0 minmax(0, 1fr); } }
@media (max-width: 1024px) {
  html.touring:not(.guest-tour):has(.tour:not([hidden])) .app.app.app > .stage { height: calc(100svh - 58px); }
  html.touring.app-cover:not(.guest-tour):has(.tour:not([hidden])) .app.app.app > .stage { height: calc(100svh - 58px - var(--sat) - var(--sab)); }
}
/* anatomy-tour.js: a tour over the page itself. On a phone its card sits at the top, so it never hides the panel it points at. */
.tour-inplace .tour-card.docked { top: calc(12px + var(--sat, 0px)) !important; bottom: auto; }
.tour-inplace .tour-card.docked.bottom { top: auto !important; bottom: 12px; }
/* welcome-card.js: the invitation to the tour after sign-in. */
.welcome-card { width: min(400px, calc(100vw - 32px)); box-sizing: border-box; border: 0; border-radius: 18px; padding: 20px 22px 16px; background: var(--d-panel, #fff); color: var(--ink, #14162b); box-shadow: 0 24px 60px -20px rgba(14, 17, 42, .55); font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
.welcome-card::backdrop { background: rgba(14, 17, 42, .45); }
.welcome-card h2 { margin: 0 0 6px; font-size: 20px; }
.welcome-card p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.5; color: var(--d-muted, #3b3f58); }
.wc-btns { display: flex; gap: 8px; }
.wc-btns button { min-height: 42px; padding: 0 16px; border-radius: 12px; font: 700 14.5px inherit; font-family: inherit; cursor: pointer; }
.wc-go { flex: 1; border: 0; background: var(--indigo, #3d46c8); color: #fff; }
.wc-later { border: 1px solid var(--line, #e3e5ef); background: none; color: var(--indigo, #3d46c8); }
.wc-btns button:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }
.wc-never { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted, #6b6f85); cursor: pointer; }
.wc-never input { accent-color: var(--indigo, #3d46c8); width: 16px; height: 16px; }
:root[data-theme="dark"] .welcome-card { background: #2d3668; box-shadow: 0 0 0 1px #9aa5ff8c, 0 24px 60px -20px #000c; }
:root[data-theme="dark"] .welcome-card p { color: #dfe3f8; }
:root[data-theme="dark"] :is(.wc-never, .wc-later) { color: #d3d8fc; }
