/* The live demo: the real app, full screen, with a guide. Prefix: qd- (public/tour/demo.js).
   Colours come from the app's tokens, so the house oxblood, gold and lapis themes all follow. */

.qd-stage {
  --q-ground: var(--color-background);
  --q-card: var(--color-elevated);
  --q-ink: var(--color-foreground);
  --q-muted: var(--color-muted-foreground);
  --q-line: var(--color-border);
  --q-panel: var(--color-muted);
  --q-accent: var(--color-accent);
  --q-dark: var(--color-binding);
  --q-dark-fg: var(--color-binding-foreground);
  /* Done marks: gold leaf in the gold themes, oxblood in the house one. */
  --q-leaf: var(--gold-leaf, var(--color-accent));
  --q-leaf-ink: var(--gold-ink, #fff);
  --q-serif: var(--font-display);
  --q-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --q-spring: cubic-bezier(0.34, 1.36, 0.5, 1);
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--q-ground);
  color: var(--q-ink);
  font-family: var(--font-sans);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.qd-stage.qd-on { opacity: 1; }
.qd-stage svg { width: 18px; height: 18px; flex: none; }
html.qd-lock, html.qd-lock body { overflow: hidden !important; }

/* ---- The bar ---- */
.qd-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  box-sizing: content-box;
  background: var(--q-dark);
  color: var(--q-dark-fg);
}
.qd-bar .qd-emb { width: 24px; height: 24px; color: var(--color-gold-bright); flex: none; }
.qd-title { font-family: var(--q-serif); font-size: 18px; font-weight: 300; white-space: nowrap; }

/* The three acts, done ones gilded. */
.qd-acts { display: flex; align-items: center; gap: 6px; margin: 0 auto; padding: 0; list-style: none; font-size: 13.5px; }
.qd-acts li { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 5px; border-radius: 999px; opacity: 0.55; transition: opacity 0.3s, background-color 0.3s; }
.qd-acts li + li::before { content: ""; width: 18px; height: 1px; margin: 0 6px 0 -10px; background: currentColor; opacity: 0.35; }
.qd-acts li[aria-current] { opacity: 1; background: rgb(255 255 255 / 0.09); }
.qd-acts li.qd-done { opacity: 0.85; }
.qd-act-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.3); }
.qd-act-dot svg { width: 13px; height: 13px; }
.qd-acts li[aria-current] .qd-act-dot { box-shadow: inset 0 0 0 1px var(--color-gold-bright); color: var(--color-gold-bright); }
.qd-acts li.qd-done .qd-act-dot { background: var(--q-leaf); color: var(--q-leaf-ink); box-shadow: none; }

/* Student or teacher: a pill that slides. */
.qd-roles { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: rgb(255 255 255 / 0.1); flex: none; }
.qd-roles button { position: relative; z-index: 1; height: 32px; padding: 0 15px; border: 0; border-radius: 999px; background: transparent; color: inherit; opacity: 0.72; font: inherit; font-size: 14px; cursor: pointer; transition: color 0.3s, opacity 0.3s; }
.qd-roles button[aria-pressed="true"] { color: var(--q-dark); opacity: 1; }
.qd-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--q-dark-fg); transition: transform 0.45s var(--q-spring); }
.qd-stage[data-side="teacher"] .qd-thumb { transform: translateX(100%); }
.qd-skip { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; opacity: 0.8; cursor: pointer; }
.qd-skip:hover { opacity: 1; }
.qd-skip[hidden] { display: none; }
.qd-exit { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22); transition: background-color 0.2s; flex: none; }
.qd-exit:hover { background: rgb(255 255 255 / 0.1); }

/* ---- The app ---- */
.qd-frame-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--q-ground); }
/* Inside a frame the app's own env(safe-area-inset-*) is 0, so the stage
   keeps it clear of the home indicator and the rounded corners instead. */
.qd-frame { position: absolute; top: 0; left: env(safe-area-inset-left); width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right)); height: calc(100% - env(safe-area-inset-bottom)); border: 0; background: var(--q-ground); }
.qd-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--q-ground); transition: opacity 0.35s; pointer-events: none; }
.qd-loading .qd-emb { width: 46px; height: 46px; color: var(--q-accent); animation: qd-breathe 1.8s ease-in-out infinite; }
.qd-loading.qd-gone { opacity: 0; }
@keyframes qd-breathe { 50% { opacity: 0.35; transform: scale(0.93); } }

/* The spotlight: a ring on the target, and (most steps) a soft dusk over the rest.
   It never takes a tap: the app underneath stays the visitor's to use. */
.qd-ring {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--q-accent), 0 0 0 0 rgb(18 16 16 / 0);
  opacity: 0;
  transition: transform 0.5s var(--q-ease), width 0.5s var(--q-ease), height 0.5s var(--q-ease), border-radius 0.4s, box-shadow 0.45s ease, opacity 0.3s;
}
.qd-ring::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 40%, transparent); animation: qd-halo 2s ease-out infinite; }
.qd-ring.qd-show { opacity: 1; }
.qd-ring.qd-dim { box-shadow: 0 0 0 2px var(--q-accent), 0 0 0 200vmax rgb(18 16 16 / 0.26); }
.qd-ring.qd-hit { box-shadow: 0 0 0 2px var(--color-success), 0 0 0 200vmax rgb(18 16 16 / 0); }
.qd-ring.qd-hit::after { animation: qd-burst 0.7s var(--q-ease) both; }
@keyframes qd-halo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 38%, transparent); } 100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--color-accent) 0%, transparent); } }
@keyframes qd-burst { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-success) 55%, transparent); } 100% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--color-success) 0%, transparent); } }

/* ---- The coach card ---- */
.qd-coach {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 328px;
  box-sizing: border-box;
  padding: 16px 18px 14px;
  border-radius: 22px;
  background: var(--q-card);
  color: var(--q-ink);
  box-shadow: 0 0 0 1px rgb(18 16 16 / 0.06), 0 28px 60px -24px rgb(40 22 16 / 0.42), 0 4px 12px -6px rgb(40 22 16 / 0.15);
  transition: transform 0.55s var(--q-ease), opacity 0.3s;
}
.qd-coach[hidden] { display: none; }
.qd-stage.qd-busy .qd-coach { opacity: 0; pointer-events: none; }
.qd-coach-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qd-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--color-accent) 9%, transparent); color: var(--q-accent); font-size: 13px; }
.qd-chip svg { width: 14px; height: 14px; }
.qd-dots { display: inline-flex; align-items: center; gap: 4px; }
.qd-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--q-line); transition: width 0.4s var(--q-ease), background-color 0.3s; }
.qd-dots i.qd-past { background: color-mix(in srgb, var(--color-accent) 45%, transparent); }
.qd-dots i.qd-now { width: 18px; background: var(--q-accent); }
.qd-coach h4 { margin: 12px 0 0; font-family: var(--q-serif); font-weight: 400; font-size: 23px; line-height: 1.18; letter-spacing: -0.005em; text-wrap: balance; }
.qd-coach-body p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--q-muted); text-wrap: pretty; }
.qd-coach .qd-hint { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--color-mistake) 9%, transparent); color: var(--color-mistake); font-size: 14px; animation: qd-rise 0.35s var(--q-ease); }
.qd-coach .qd-hint[hidden] { display: none; }
.qd-coach-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; margin-top: 12px; }
.qd-go { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.qd-link { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 8px 4px; font: inherit; font-size: 14px; color: var(--q-muted); cursor: pointer; }
.qd-link svg { width: 15px; height: 15px; }
.qd-link:hover { color: var(--q-ink); }
.qd-link[hidden] { display: none; }
.qd-turn { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--q-muted); }
.qd-turn i { width: 8px; height: 8px; border-radius: 50%; background: var(--q-accent); animation: qd-beat 1.4s ease-in-out infinite; }
@keyframes qd-beat { 50% { transform: scale(0.6); opacity: 0.5; } }
.qd-did { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--color-success) 13%, transparent); color: var(--color-success); font-size: 14px; animation: qd-pop 0.4s var(--q-spring); }
.qd-did svg { width: 17px; height: 17px; stroke-width: 2.2; }
.qd-tick { stroke-dasharray: 24; stroke-dashoffset: 0; }
.qd-did .qd-tick { animation: qd-draw 0.45s 0.08s var(--q-ease) both; }
@keyframes qd-draw { from { stroke-dashoffset: 24; } }
@keyframes qd-pop { from { transform: scale(0.7); opacity: 0; } }
@keyframes qd-rise { from { transform: translateY(6px); opacity: 0; } }

/* Each step's words arrive afresh. */
.qd-coach.qd-swap .qd-coach-body,
.qd-coach.qd-swap .qd-coach-head { animation: qd-rise 0.45s var(--q-ease) both; }
.qd-coach.qd-swap .qd-coach-body { animation-delay: 0.05s; }

/* The beak points at the target (desktop). */
.qd-beak { position: absolute; width: 14px; height: 14px; background: var(--q-card); transform: rotate(45deg); box-shadow: -1px 1px 0 rgb(18 16 16 / 0.05); display: none; }
.qd-coach[data-beak="right"] .qd-beak { display: block; left: -7px; top: calc(var(--beak) - 7px); }
.qd-coach[data-beak="left"] .qd-beak { display: block; right: -7px; top: calc(var(--beak) - 7px); }
.qd-coach[data-beak="below"] .qd-beak { display: block; top: -7px; left: calc(var(--beak) - 7px); }
.qd-coach[data-beak="above"] .qd-beak { display: block; bottom: -7px; left: calc(var(--beak) - 7px); }

/* Phones: across the width, at the bottom or under the app's header. */
.qd-coach.qd-phone { left: 10px; right: 10px; width: auto; padding: 14px 16px 10px; border-radius: 20px; }
.qd-coach.qd-phone[data-dock="bottom"] { top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); transform: none; }
.qd-coach.qd-phone h4 { font-size: 20px; margin-top: 10px; }
.qd-coach.qd-phone .qd-coach-body p { font-size: 14.5px; }
.qd-coach.qd-compact .qd-coach-head,
.qd-coach.qd-compact .qd-coach-body p:not(.qd-hint) { display: none; }
.qd-coach.qd-compact h4 { margin-top: 0; }
.qd-coach.qd-compact .qd-coach-foot { margin-top: 6px; }

/* ---- Buttons ---- */
.qd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 50px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--q-dark); color: var(--q-dark-fg); font: inherit; font-size: 15.5px; cursor: pointer; white-space: nowrap; transition: transform 0.2s var(--q-ease), box-shadow 0.3s, background-color 0.25s; }
.qd-btn svg { width: 17px; height: 17px; transition: transform 0.3s var(--q-ease); }
.qd-btn:hover svg { transform: translateX(3px); }
.qd-btn:active { transform: scale(0.97); }
.qd-btn:focus-visible { outline: 2px solid var(--q-accent); outline-offset: 3px; }
.qd-btn.qd-small { height: 40px; padding: 0 16px; font-size: 14.5px; }
.qd-btn.qd-quiet { background: transparent; color: var(--q-ink); box-shadow: inset 0 0 0 1px var(--color-input, var(--q-line)); }
.qd-btn.qd-quiet:hover { background: var(--q-panel); }
.qd-btn.qd-quiet:hover svg { transform: none; }
.qd-btn:not(.qd-quiet) { color: #f3e1a8; box-shadow: inset 0 0 0 1px rgb(226 194 122 / 0.45), 0 12px 26px -16px rgb(23 17 10 / 0.6); }

/* ---- Scenes: the welcome, the two hand-overs and the end ---- */
.qd-scene { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-y: auto; background: color-mix(in srgb, var(--color-background) 64%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1); opacity: 0; transition: opacity 0.35s ease; }
.qd-scene[hidden] { display: none; }
.qd-scene.qd-in { opacity: 1; }
.qd-scene.qd-out { opacity: 0; pointer-events: none; }
.qd-scene-card { width: min(500px, 100%); box-sizing: border-box; padding: 30px clamp(20px, 5vw, 38px) 28px; border-radius: 28px; background: var(--q-card); text-align: center; box-shadow: 0 0 0 1px rgb(18 16 16 / 0.05), 0 40px 80px -36px rgb(40 22 16 / 0.45); transform: translateY(14px) scale(0.985); transition: transform 0.6s var(--q-ease); }
.qd-scene.qd-in .qd-scene-card { transform: none; }
.qd-scene.qd-out .qd-scene-card { transform: translateY(-8px) scale(0.985); }
.qd-scene-card h3 { margin: 26px 0 0; font-family: var(--q-serif); font-weight: 300; font-size: clamp(1.9rem, 5vw, 2.35rem); line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
.qd-scene-body { margin: 10px auto 0; max-width: 26em; font-size: 16px; line-height: 1.55; color: var(--q-muted); text-wrap: pretty; }
.qd-scene-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.qd-scene-card .qd-again { margin-top: 12px; }
.qd-scene-card > * { animation: qd-rise 0.6s var(--q-ease) both; }
.qd-scene-card > h3 { animation-delay: 0.08s; }
.qd-scene-card > .qd-scene-body { animation-delay: 0.14s; }
.qd-scene-card > .qd-scene-pick { animation-delay: 0.2s; }
.qd-scene-card > .qd-scene-actions { animation-delay: 0.26s; }
.qd-scene-card > .qd-again { animation-delay: 0.32s; }

/* The road through the three acts, as on the Journey: medallions on a gilded line. */
.qd-road { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); }
.qd-road-line { position: absolute; top: 27px; left: 16.667%; right: 16.667%; height: 2px; border-radius: 2px; background: var(--q-line); }
.qd-road-line i { position: absolute; inset: 0 auto 0 0; width: calc(var(--fill, 0) * 50%); border-radius: inherit; background: var(--q-leaf); transition: width 0.9s var(--q-ease); }
.qd-road .qd-stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qd-road b { margin-top: 8px; font-family: var(--q-serif); font-weight: 400; font-size: 18px; line-height: 1.1; }
.qd-road small { font-size: 12.5px; color: var(--q-muted); }
.qd-med { position: relative; display: grid; place-items: center; width: 56px; height: 56px; color: var(--q-muted); }
.qd-star, .qd-star-in { position: absolute; clip-path: polygon(50% 0%, 64.6% 14.6%, 85.4% 14.6%, 85.4% 35.4%, 100% 50%, 85.4% 64.6%, 85.4% 85.4%, 64.6% 85.4%, 50% 100%, 35.4% 85.4%, 14.6% 85.4%, 14.6% 64.6%, 0% 50%, 14.6% 35.4%, 14.6% 14.6%, 35.4% 14.6%); }
.qd-star { inset: 0; background: var(--q-line); transition: background 0.4s; }
.qd-star-in { inset: 2px; background: var(--q-card); transition: background 0.4s; }
.qd-med svg { position: relative; width: 20px; height: 20px; }
.qd-road .qd-stop.qd-now .qd-med { color: var(--q-accent); animation: qd-med 0.7s 0.5s var(--q-spring) both; }
.qd-road .qd-stop.qd-now .qd-star { background: var(--q-accent); }
.qd-road .qd-stop.qd-now .qd-med::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; animation: qd-glow 2.4s 1s ease-in-out infinite; }
.qd-road .qd-stop.qd-done .qd-star { background: var(--q-leaf); }
.qd-road .qd-stop.qd-done .qd-star-in { background: transparent; }
.qd-road .qd-stop.qd-done .qd-med { color: var(--q-leaf-ink); }
.qd-road .qd-stop.qd-done .qd-med svg { stroke-width: 2.2; }
.qd-road .qd-stop.qd-done b, .qd-road .qd-stop.qd-now b { color: var(--q-ink); }
.qd-road .qd-stop:not(.qd-done, .qd-now) b { color: var(--q-muted); }
@keyframes qd-med { 0% { transform: scale(0.75); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes qd-glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-accent) 12%, transparent); } }
/* At the end each medallion strikes in turn. */
.qd-scene-card[data-scene="finale"] .qd-road .qd-stop.qd-done .qd-med { animation: qd-med 0.7s var(--q-spring) both; }
.qd-scene-card[data-scene="finale"] .qd-road .qd-stop:nth-child(3) .qd-med { animation-delay: 0.25s; }
.qd-scene-card[data-scene="finale"] .qd-road .qd-stop:nth-child(4) .qd-med { animation-delay: 0.5s; }
/* A bead of gold carries the recitation (or the reply) along the road. */
.qd-flyer { position: absolute; top: 21px; left: var(--to); width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--q-leaf); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 14%, transparent), 0 0 18px 2px color-mix(in srgb, var(--color-gold-bright) 70%, transparent); opacity: 0; animation: qd-fly 1.1s 0.2s var(--q-ease) both; }
@keyframes qd-fly { 0% { left: var(--from); opacity: 0; transform: scale(0.4); } 15% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { left: var(--to); opacity: 0; transform: scale(1.6); } }

/* The welcome's surahs. */
.qd-pick { margin-top: 22px; }
.qd-pick-label { margin: 0 0 10px; font-size: 14px; color: var(--q-muted); }
.qd-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qd-surah { display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 70px; padding: 6px 6px 9px; border: 0; border-radius: 16px; background: var(--q-panel); color: var(--q-ink); font: inherit; cursor: pointer; transition: background-color 0.25s, color 0.25s, transform 0.2s var(--q-ease), box-shadow 0.25s; }
.qd-surah .quran { font-size: 22px; line-height: 1.75; }
.qd-surah small { font-size: 12.5px; color: var(--q-muted); transition: color 0.25s; }
.qd-surah:hover { box-shadow: inset 0 0 0 1px var(--q-accent); }
.qd-surah:active { transform: scale(0.97); }
.qd-surah:focus-visible { outline: 2px solid var(--q-accent); outline-offset: 2px; }
.qd-surah[aria-checked="true"] { background: var(--q-dark); color: var(--q-dark-fg); box-shadow: none; }
.qd-surah[aria-checked="true"] small { color: inherit; opacity: 0.75; }
.qd-surah[aria-checked="true"] .quran { color: #f3e1a8; }

/* ---- Smaller screens ---- */
@media (max-width: 900px) {
  .qd-acts { display: none; }
  .qd-roles { margin-left: auto; }
}
@media (max-width: 520px) {
  .qd-bar { height: 50px; gap: 8px; }
  .qd-title { display: none; }
  .qd-roles button { height: 30px; padding: 0 12px; font-size: 13.5px; }
  .qd-skip { padding: 0 6px; font-size: 13.5px; }
  .qd-exit { width: 34px; height: 34px; }
  .qd-scene { place-items: end center; }
  .qd-scene-card { padding: 26px 18px 20px; border-radius: 26px; }
  .qd-scene-card h3 { margin-top: 20px; }
  .qd-scene-body { font-size: 15px; }
  .qd-scene-actions .qd-btn { flex: 1 1 auto; }
  .qd-med { width: 50px; height: 50px; }
  .qd-road-line { top: 24px; }
  .qd-flyer { top: 18px; }
  .qd-chips { gap: 6px; }
  .qd-surah { min-height: 64px; }
  .qd-surah .quran { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .qd-stage, .qd-ring, .qd-coach, .qd-scene, .qd-scene-card, .qd-thumb, .qd-road-line i, .qd-dots i { transition: none !important; }
  .qd-stage *, .qd-stage *::after { animation: none !important; }
  .qd-flyer { display: none; }
}

/* Two acts, both the student's: the road between the scenes has two stops. */
.qd-road { grid-template-columns: repeat(2, 1fr); }
.qd-road-line { left: 25%; right: 25%; }
.qd-road-line i { width: calc(var(--fill, 0) * 100%); }

/* The coach: a plain light card. What to do, then a quiet line: back, how far along, next. */
.qd-coach-row { display: block; }
.qd-coach h4 { margin: 0; font-size: 21px; }
.qd-coach-foot { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-top: 12px; }
.qd-coach .qd-back {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--q-muted); cursor: pointer; transition: background-color 0.2s, color 0.2s;
}
.qd-coach .qd-back:hover { background: var(--q-line); color: inherit; }
.qd-coach .qd-back[hidden] { display: none; }
.qd-coach .qd-back svg { width: 16px; height: 16px; }
.qd-num { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--q-muted); }
.qd-coach .qd-go { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.qd-coach.qd-swap .qd-coach-row { animation: qd-rise 0.45s var(--q-ease) both; }
.qd-coach.qd-phone h4 { font-size: 19px; }
.qd-coach.qd-compact .qd-coach-body p:not(.qd-hint) { display: none; }

/* The welcome's surah picker as the Journey (components/landing/DemoPath.tsx): its road,
   art and medallions, all gold; the chosen stop larger, in a turning gold ring. */
.qd-scene-pick .qd-path { position: relative; margin: 26px auto 0; }
.qd-path ol { margin: 0; padding: 0; list-style: none; }
/* The stage sizes its icons; the path's road and medallions fill their boxes. */
.qd-stage .qd-path > svg, .qd-stage .qd-path-med svg { display: block; width: 100%; height: 100%; }
.qd-path-stop { width: 0; height: 0; }
.qd-path-med {
  position: absolute; left: -29px; top: -29px; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; transition: transform 0.35s var(--q-spring), width 0.35s var(--q-spring), height 0.35s var(--q-spring), left 0.35s var(--q-spring), top 0.35s var(--q-spring);
}
.qd-path-ring { position: absolute; left: -22%; top: -22%; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.qd-stage .qd-path-med .qd-path-ring { width: 144%; height: 144%; }
.qd-path-med[aria-checked="true"] .qd-path-ring { opacity: 1; }
.qd-path-med[aria-checked="true"] { left: -38px; top: -38px; width: 76px; height: 76px; }
/* A gold glow behind the chosen one. */
.qd-path-med[aria-checked="true"]::before {
  content: ""; position: absolute; inset: -40%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(220 184 103 / 0.45), transparent);
  animation: qd-path-glow 2.4s ease-in-out infinite;
}
@keyframes qd-path-glow { 50% { opacity: 0.55; transform: scale(0.92); } }
.qd-path-med:not([aria-checked="true"]):hover { transform: scale(1.06); }
.qd-path-med:focus-visible { outline: 2px solid var(--q-accent); outline-offset: 4px; }
.qd-path-name {
  position: absolute; left: 0; top: 34px; transform: translateX(-50%); white-space: nowrap; padding: 2px 10px; border-radius: 999px;
  background: var(--q-ground); font-size: 12.5px; color: #8f6514; pointer-events: none; transition: top 0.35s var(--q-spring), color 0.25s;
}
.qd-path-med[aria-checked="true"] ~ .qd-path-name { top: 50px; color: var(--q-ink); font-weight: 500; background: var(--q-card); box-shadow: 0 0 0 1px var(--q-line); }
/* Words on the left and the path on the right where there's room; stacked on a phone. */
@media (min-width: 820px) {
  .qd-scene-card.qd-has-path { width: min(880px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: center; column-gap: 40px; text-align: left; }
  .qd-has-path .qd-scene-main { padding: 8px 0; }
  .qd-has-path .qd-scene-body { margin-left: 0; }
  .qd-has-path .qd-scene-actions { justify-content: flex-start; }
  .qd-has-path .qd-scene-pick .qd-path { margin-top: 0; }
}
@media (max-width: 400px) {
  .qd-scene-pick .qd-path { zoom: 0.86; }
}
