/* xgen lab — demo shell
   Shared by every project. Do not edit per project. */

@font-face {
  font-family: "YekanBakh";
  src: url("/fonts/YekanBakh-VF.woff2") format("woff2");
  font-weight: 1 1000;
  font-display: swap;
}

:root {
  --x-primary: #bb246d;
  --x-primary-soft: #fbeaf2;
  --x-ink: #111111;
  --x-ink-2: #3d3d3f;
  --x-muted: #77777c;
  --x-line: #e6e6e9;
  --x-bg: #f3f3f5;
  --x-surface: #ffffff;
  --x-dark: #1c1c1c;
  --x-radius: 24px;
  --x-bar-h: 72px;
  --x-foot-h: 52px;
  --x-vh: 100vh;
  --x-shadow: 0 1px 2px rgba(17,17,17,.04), 0 12px 40px -12px rgba(17,17,17,.18);
  --x-font: "YekanBakh", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--x-font);
  background: var(--x-bg);
  color: var(--x-ink);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- top bar ---------- */
.xbar {
  position: fixed; inset: 0 0 auto 0; height: var(--x-bar-h);
  display: flex; justify-content: space-between; align-items: center;
  /* same content width as the gallery header: 1180px container with 20px gutters */
  gap: 16px; padding: 0 max(20px, calc((100% - 1140px) / 2));
  background: var(--x-surface);
  border-bottom: 1px solid var(--x-line);
  z-index: 20;
}
.xbar__start, .xbar__end { display: flex; align-items: center; gap: 12px; min-width: 0; }
.xbar__end { justify-content: flex-end; }
.xtitle { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.xtitle strong { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xtitle span { font-size: 12px; color: var(--x-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.xbadge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--x-surface); border: 1px solid var(--x-line);
  font-size: 12px; font-weight: 600; white-space: nowrap; flex: none;
}
.xbadge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--x-primary); }

/* segmented device switch */
.xseg {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--x-bg); border-radius: 999px; border: 1px solid var(--x-line);
}
.xseg button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--x-muted);
  transition: background .2s, color .2s, box-shadow .2s;
}
.xseg button svg { width: 16px; height: 16px; }
.xseg button:hover { color: var(--x-ink); }
.xseg button[aria-pressed="true"] { background: var(--x-surface); color: var(--x-ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.xseg button[hidden] { display: none; }

/* buttons */
.xbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--x-ink); background: var(--x-ink); color: #fff;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: opacity .2s, background .2s;
}
.xbtn:hover { opacity: .88; }
.xbtn--ghost { background: transparent; color: var(--x-ink); border-color: var(--x-line); }
.xbtn--ghost:hover { border-color: var(--x-ink); opacity: 1; }
.xbtn svg { width: 18px; height: 18px; }

/* header navigation: quiet text actions; the course link is a touch stronger */
.xbar__end { gap: 8px; }
.xnav-course {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .2s, color .2s;
}
.xnav-course { color: var(--x-ink); border: 1px solid var(--x-line); background: var(--x-surface); padding: 0 16px; }
.xnav-course:hover { border-color: var(--x-ink); }

/* course about to start (projects.json courses.*.startsAt): the course link becomes the page's main action,
   with a countdown badge on its top edge. Goes back to the quiet link above once the course starts. */
body.course-live .xnav-course {
  position: relative; height: 40px; padding: 0 20px; border-color: var(--x-primary); background: var(--x-primary); color: #fff;
  font-weight: 700; box-shadow: 0 6px 18px -8px rgba(187,36,109,.7);
  animation: xctaPulse 1.8s ease-out .8s 3;
}
body.course-live .xnav-course:hover { background: #a11d5d; border-color: #a11d5d; }
/* the link sits at the window's left edge, so its tooltip opens toward the page */
body.course-live .xnav-course[data-tip]:hover::after { left: 0; transform: none; }
.xcbadge {
  position: absolute; top: -11px; left: 14px; display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: 999px; background: var(--x-ink); color: #fff;
  font-size: 11px; font-weight: 700; white-space: nowrap; box-shadow: 0 0 0 2px var(--x-surface);
}
.xcbadge i { width: 6px; height: 6px; border-radius: 50%; background: #ff5fa2; animation: xcuePulse 1.6s ease-out infinite; }
/* phones: the course lives in ••• — a dot on the button, the badge inside the menu */
.xmbadge {
  margin-inline-start: auto; padding: 2px 8px; border-radius: 999px; background: var(--x-primary-soft); color: var(--x-primary);
  font-size: 11px; font-weight: 700;
}
body.course-live .xmenu .xcourse span { color: var(--x-primary); font-weight: 700; }
body.course-live.is-full [data-act="menu"]::before {
  content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--x-primary); box-shadow: 0 0 0 2px var(--x-surface);
}
@media (prefers-reduced-motion: reduce) {
  body.course-live .xnav-course, .xcbadge i { animation: none; }
}

/* floating surfaces on the canvas share one quiet elevation */
.xdock, .xmenu {
  background: var(--x-surface); border: 1px solid rgba(17,17,17,.08);
  box-shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px -8px rgba(17,17,17,.14);
}

/* build video: in the header, the one accent outside the demo */
.xvbtn {
  display: inline-flex; align-items: center; gap: 8px; flex: none; height: 36px; padding-inline: 4px 14px; border-radius: 999px;
  border: 1px solid var(--x-line); background: var(--x-surface);
  color: var(--x-primary); font-size: 13px; font-weight: 700; white-space: nowrap; transition: border-color .2s, background .2s;
}
.xvbtn[hidden] { display: none; }
.xvbtn:hover { border-color: #eebcd3; background: #fffafc; }
.xvbtn i { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--x-primary); color: #fff; }
.xvbtn svg { width: 12px; height: 12px; margin-left: 2px; }
.xdur { font-weight: 500; }

/* viewer dock: bottom-centre, reset · device switch · more */
.xdock {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px;
}
.xdock .xseg { border: 0; }
.xdock__btn {
  width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--x-muted);
  display: inline-grid; place-items: center; transition: background .2s, color .2s;
}
.xdock__btn:hover:not(:disabled), .xdock__btn[aria-expanded="true"], .xdock__btn[aria-pressed="true"] { background: var(--x-bg); color: var(--x-ink); }
.xdock__btn:disabled { opacity: .35; cursor: default; }
.xdock__btn svg { width: 18px; height: 18px; }
.xdock [data-tip]:hover::after { top: auto; bottom: calc(100% + 10px); }

/* overflow menu (•••) */
.xmenu {
  position: fixed; z-index: 30; min-width: 220px; padding: 6px; border-radius: 16px;
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.xmenu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.xmenu button, .xmenu a {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--x-ink); font-size: 13px; font-weight: 600; text-align: start; white-space: nowrap;
}
.xmenu button:hover:not(:disabled), .xmenu a:hover { background: var(--x-bg); }
.xmenu button:disabled { opacity: .4; cursor: default; }
.xmenu svg, .xmenu i { width: 18px; height: 18px; flex: none; color: var(--x-muted); }
.xmenu hr { border: 0; border-top: 1px solid var(--x-line); margin: 6px 4px; }
.xmenu__info { padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--x-line); }
.xsize { font: 600 12px/1 var(--x-font); color: var(--x-muted); direction: ltr; display: block; text-align: start; }
.xmenu .xfull { display: none; }


/* tooltips */
[data-tip] { position: relative; }
body.pop-open [data-tip]:hover::after { display: none; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--x-ink); color: #fff; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 40;
}

/* ---------- footer: one slim row, same dark as the gallery footer.
   It sits just below the first screen, so it only shows once you scroll. ---------- */
.xfoot {
  position: absolute; top: var(--x-vh); left: 0; right: 0; height: var(--x-foot-h); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(20px, calc((100% - 1140px) / 2));
  background: var(--x-dark); color: #a9a9ae; font-size: 12px;
}
.xfoot__logo { display: flex; color: #fff; }
.xfoot__logo svg { height: 24px; width: auto; display: block; }

/* ---------- stage ---------- */
.xstage {
  position: absolute; top: var(--x-bar-h); left: 0; right: 0; height: calc(var(--x-vh) - var(--x-bar-h));
  display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(17,17,17,.07) 1px, transparent 0) 0 0 / 22px 22px,
    var(--x-bg);
}
.xdevice {
  position: absolute; top: 50%; left: 50%;
  transform-origin: center center;
  transition: width .45s cubic-bezier(.2,.8,.2,1), height .45s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.xscreen {
  position: absolute; overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.xscreen iframe { border: 0; width: 100%; flex: 1; min-height: 0; display: block; background: #fff; }

/* phone status bar: sits under the Dynamic Island, keeps it off the app's header */
.xstatus {
  display: none; flex: none; height: 54px; padding: 4px 34px 0 40px; direction: ltr;
  align-items: center; justify-content: space-between;
  font: 700 15px/1 -apple-system, "SF Pro Text", var(--x-font); color: #111; background: #fff;
  transition: background .3s, color .3s;
}
.xdevice[data-device="mobile"]:not(.is-landscape) .xstatus { display: flex; }
.xstatus__icons { display: flex; gap: 2.5px; align-items: flex-end; }
.xstatus__icons i { display: block; width: 3.5px; border-radius: 1.5px; background: currentColor; }
.xstatus__icons i:nth-child(1) { height: 5px; } .xstatus__icons i:nth-child(2) { height: 8px; } .xstatus__icons i:nth-child(3) { height: 11px; }
.xstatus__icons::after { content: ""; width: 24px; height: 12px; border-radius: 4px; margin-left: 7px; border: 1.5px solid currentColor; opacity: .9; background: linear-gradient(currentColor, currentColor) 2px 2px / 15px 5px no-repeat; }

/* ---------- device frames (iPhone / iPad style) ---------- */
.xhw, .xisland, .xcam { display: none; position: absolute; }
.xdevice[data-device="mobile"], .xdevice[data-device="tablet"] {
  /* brushed titanium / aluminium rim */
  background:
    linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,0) 40%, rgba(255,255,255,.35) 60%, rgba(255,255,255,0)),
    linear-gradient(180deg, #dcdcdf 0%, #9e9ea3 12%, #d2d2d5 30%, #8c8c91 52%, #cfcfd2 74%, #87878c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.7),
    inset 0 0 0 2px rgba(0,0,0,.18),
    0 2px 4px rgba(0,0,0,.08),
    0 30px 60px -20px rgba(17,17,17,.35),
    0 60px 120px -40px rgba(17,17,17,.3);
}
.xdevice[data-device="mobile"]::before, .xdevice[data-device="tablet"]::before {
  content: ""; position: absolute; background: #050505;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2.5px #1b1b1d;
}
.xdevice[data-device="mobile"] .xhw, .xdevice[data-device="tablet"] .xhw {
  display: block; background: linear-gradient(90deg, #8f8f93, #e4e4e6 45%, #a3a3a7); border-radius: 2px;
}

/* iPhone: 390 × 844 screen, 14px rim+bezel */
.xdevice[data-device="mobile"] { border-radius: 64px; }
.xdevice[data-device="mobile"]::before { inset: 4.5px; border-radius: 59.5px; }
.xdevice[data-device="mobile"] .xscreen { inset: 15px; border-radius: 49px; }
/* landscape phone: keep app content clear of the island (like Safari's safe area) */
.xdevice[data-device="mobile"].is-landscape .xscreen { flex-direction: row; direction: ltr; }
.xdevice[data-device="mobile"].is-landscape .xstatus { display: block; width: 56px; height: auto; padding: 0; }
.xdevice[data-device="mobile"].is-landscape .xstatus > * { display: none; }
.xdevice[data-device="mobile"] .xisland {
  display: block; z-index: 3; top: 11px; left: 50%; width: 124px; height: 36px; margin-left: -62px;
  background: #000; border-radius: 20px;
}
.xdevice[data-device="mobile"] .xisland::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4b5378 0 15%, #161a2e 45%, #07080d 75%);
  box-shadow: 0 0 0 1.5px #101010;
}
.xdevice[data-device="mobile"] .xhw--a { left: -3px; top: 118px; width: 4px; height: 30px; }
.xdevice[data-device="mobile"] .xhw--b { left: -3px; top: 178px; width: 4px; height: 58px; }
.xdevice[data-device="mobile"] .xhw--c { left: -3px; top: 248px; width: 4px; height: 58px; }
.xdevice[data-device="mobile"] .xhw--d { right: -3px; top: 205px; width: 4px; height: 92px; }
/* landscape: phone turned counter-clockwise */
.xdevice[data-device="mobile"].is-landscape .xisland { top: 50%; left: 11px; width: 36px; height: 124px; margin: -62px 0 0 0; }
.xdevice[data-device="mobile"].is-landscape .xisland::after { right: auto; left: 50%; top: auto; bottom: 13px; margin: 0 0 0 -6px; }
.xdevice[data-device="mobile"].is-landscape .xhw { background: linear-gradient(180deg, #8f8f93, #e4e4e6 45%, #a3a3a7); }
.xdevice[data-device="mobile"].is-landscape .xhw--a { left: 118px; top: auto; bottom: -3px; width: 30px; height: 4px; }
.xdevice[data-device="mobile"].is-landscape .xhw--b { left: 178px; top: auto; bottom: -3px; width: 58px; height: 4px; }
.xdevice[data-device="mobile"].is-landscape .xhw--c { left: 248px; top: auto; bottom: -3px; width: 58px; height: 4px; }
.xdevice[data-device="mobile"].is-landscape .xhw--d { left: 205px; right: auto; top: -3px; width: 92px; height: 4px; }

/* iPad: 820 × 1180 screen, 23px rim+bezel */
.xdevice[data-device="tablet"] { border-radius: 46px; }
.xdevice[data-device="tablet"]::before { inset: 3px; border-radius: 43px; background: #1d1d1f; box-shadow: inset 0 0 0 1px #0c0c0d; }
.xdevice[data-device="tablet"] .xscreen { inset: 23px; border-radius: 22px; }
.xdevice[data-device="tablet"] .xcam {
  display: block; z-index: 2; top: 8px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #545c80 0 15%, #1a1d30 50%, #050508 80%);
}
.xdevice[data-device="tablet"] .xhw { background: linear-gradient(180deg, #8f8f93, #e4e4e6 45%, #a3a3a7); }
.xdevice[data-device="tablet"] .xhw--a { top: -3px; right: 64px; width: 54px; height: 4px; }
.xdevice[data-device="tablet"] .xhw--b { right: -3px; top: 96px; width: 4px; height: 50px; background: linear-gradient(90deg, #8f8f93, #e4e4e6 45%, #a3a3a7); }
.xdevice[data-device="tablet"] .xhw--c { right: -3px; top: 156px; width: 4px; height: 50px; background: linear-gradient(90deg, #8f8f93, #e4e4e6 45%, #a3a3a7); }
.xdevice[data-device="tablet"] .xhw--d { display: none; }
.xdevice[data-device="tablet"].is-landscape .xcam { top: 50%; left: 8px; margin: -3.5px 0 0 0; }
.xdevice[data-device="tablet"].is-landscape .xhw--a { top: 64px; right: auto; left: -3px; width: 4px; height: 54px; background: linear-gradient(90deg, #8f8f93, #e4e4e6 45%, #a3a3a7); }
.xdevice[data-device="tablet"].is-landscape .xhw--b { right: 96px; top: -3px; width: 50px; height: 4px; background: linear-gradient(180deg, #8f8f93, #e4e4e6 45%, #a3a3a7); }
.xdevice[data-device="tablet"].is-landscape .xhw--c { right: 156px; top: -3px; width: 50px; height: 4px; background: linear-gradient(180deg, #8f8f93, #e4e4e6 45%, #a3a3a7); }

.xdevice[data-device="desktop"] {
  background: var(--x-surface); border-radius: 16px;
  box-shadow: 0 0 0 1px var(--x-line), var(--x-shadow), 0 40px 80px -30px rgba(17,17,17,.25);
}
.xdevice[data-device="desktop"] .xscreen { inset: 40px 0 0 0; border-radius: 0 0 16px 16px; }
.xchrome {
  display: none; position: absolute; inset: 0 0 auto 0; height: 40px;
  align-items: center; gap: 14px; padding: 0 16px;
  border-bottom: 1px solid var(--x-line); direction: ltr;
}
.xdevice[data-device="desktop"] .xchrome { display: flex; }
.xchrome i { width: 11px; height: 11px; border-radius: 50%; background: #e3e3e6; display: inline-block; margin-right: 6px; }
.xchrome__url {
  flex: 1; max-width: 520px; margin: 0 auto; height: 24px; border-radius: 999px;
  background: var(--x-bg); font: 500 12px/24px var(--x-font); color: var(--x-muted);
  text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 12px;
}

/* first-visit "this is interactive" cue: just above the dock, then goes away */
.xcue {
  position: absolute; bottom: 78px; left: 50%; z-index: 6;
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 14px;
  border: 1px solid rgba(17,17,17,.08); border-radius: 999px; background: var(--x-surface); color: var(--x-ink);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px -6px rgba(17,17,17,.14);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.xcue.is-on { opacity: 1; transform: translate(-50%, 0); }
.xcue svg { width: 18px; height: 18px; color: var(--x-muted); }
.xcue__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-primary); animation: xcuePulse 1.6s ease-out infinite; }
@keyframes xcuePulse { 0% { box-shadow: 0 0 0 0 rgba(187,36,109,.5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(187,36,109,0); } }


/* ---------- QR popover ---------- */
.xpop {
  position: fixed; top: calc(var(--x-bar-h) + 10px); left: 24px; width: 260px;
  background: var(--x-surface); border: 1px solid var(--x-line); border-radius: var(--x-radius);
  box-shadow: var(--x-shadow); padding: 20px; z-index: 30; text-align: center;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.xpop.is-open { opacity: 1; transform: none; pointer-events: auto; }
.xpop h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.xpop p { margin: 0 0 14px; font-size: 12px; color: var(--x-muted); line-height: 1.8; }
.xqr { width: 196px; height: 196px; margin: 0 auto 14px; padding: 10px; border-radius: 16px; border: 1px solid var(--x-line); }
.xqr svg, .xqr img { width: 100%; height: 100%; display: block; }
.xpop .xbtn { width: 100%; }

/* ---------- downloads (project.json "downloads") ----------
   A quiet header button, same weight as the course link; the accent stays with the build video. */
.xdlbtn {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 12px 0 14px; border-radius: 999px;
  border: 1px solid var(--x-line); background: var(--x-surface); color: var(--x-ink);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: border-color .2s, background .2s;
}
.xdlbtn[hidden] { display: none; }
.xdlbtn:hover { border-color: var(--x-ink); }
.xdlbtn[aria-expanded="true"] { background: var(--x-bg); border-color: var(--x-ink); }
.xdlbtn svg { width: 17px; height: 17px; }

.xdl {
  position: fixed; top: calc(var(--x-bar-h) + 10px); left: 24px; width: 320px; max-width: calc(100vw - 24px);
  background: var(--x-surface); border: 1px solid var(--x-line); border-radius: var(--x-radius);
  box-shadow: var(--x-shadow); padding: 8px; z-index: 30;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.xdl.is-open { opacity: 1; transform: none; pointer-events: auto; }
.xdl__item { padding: 12px; }
.xdl__item + .xdl__item { border-top: 1px solid var(--x-line); }
.xdl__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.xdl__head > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.xdl__head strong { font-size: 14px; font-weight: 700; line-height: 1.5; }
.xdl__head span { font-size: 12px; color: var(--x-muted); }
.xdl__meta bdi { direction: ltr; }
.xdl__icon {
  width: 48px; height: 48px; flex: none; border-radius: 12px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(17,17,17,.06);
}
i.xdl__icon { display: grid; place-items: center; background: var(--x-bg); color: var(--x-muted); }
i.xdl__icon svg { width: 22px; height: 22px; }
.xdl__get { width: 100%; height: 44px; font-size: 14px; }
.xdl__hint { margin: 10px 2px 0; font-size: 12px; line-height: 1.9; color: var(--x-muted); }
.xdl__hint.is-warn { color: #9a5b00; }
/* laptop → phone handoff: one compact row under the files, never the main action */
.xdl__phone {
  display: flex; align-items: center; gap: 12px; margin: 4px; padding: 12px;
  border-radius: 16px; background: var(--x-bg);
}
.xdl__phone[hidden] { display: none; }
.xdl__qr { width: 76px; height: 76px; flex: none; padding: 6px; border-radius: 10px; background: #fff; }
.xdl__qr svg { width: 100%; height: 100%; display: block; }
.xdl__phone > div { display: flex; flex-direction: column; gap: 3px; }
.xdl__phone strong { font-size: 13px; font-weight: 700; }
.xdl__phone span { font-size: 12px; line-height: 1.8; color: var(--x-muted); }

/* ---------- build video modal ---------- */
.xvideo { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; visibility: hidden; opacity: 0; transition: opacity .25s, visibility 0s .25s; }
.xvideo.is-open { visibility: visible; opacity: 1; transition: opacity .25s; }
.xvideo__bg { position: absolute; inset: 0; background: rgba(17,17,17,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.xvideo__box {
  position: relative; width: min(960px, 100%); max-height: 100%; overflow: auto;
  background: var(--x-surface); border-radius: var(--x-radius); padding: 20px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.4);
  transform: translateY(10px) scale(.98); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.xvideo.is-open .xvideo__box { transform: none; }
.xvideo__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 4px 4px 16px; }
.xvideo__head h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; line-height: 1.6; }
.xvideo__head p { margin: 0; font-size: 13px; line-height: 1.9; color: var(--x-muted); }
.xvideo__close {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--x-line);
  display: grid; place-items: center; background: var(--x-surface); color: var(--x-ink); transition: border-color .2s;
}
.xvideo__close:hover { border-color: var(--x-ink); }
.xvideo__close svg { width: 18px; height: 18px; }
/* 16:9 player; other shapes (e.g. vertical) are letterboxed inside it */
.xvideo__frame { aspect-ratio: 16 / 9; max-height: calc(100vh - 280px); width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.xvideo__frame video, .xvideo__frame iframe { width: 100%; height: 100%; display: block; border: 0; background: #000; object-fit: contain; }
.xvideo__frame .xerror { color: #aaa; height: 100%; display: grid; place-items: center; }
.xvideo__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 18px 4px 2px; }
.xvideo__foot span { font-size: 15px; font-weight: 700; }
.xvideo__cta {
  display: inline-flex; align-items: center; height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--x-primary); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; transition: opacity .2s;
}
.xvideo__cta:hover { opacity: .9; }
.xvideo.is-ended .xvideo__cta { animation: xctaPulse 1.8s ease-out 2; }
@keyframes xctaPulse { 0% { box-shadow: 0 0 0 0 rgba(187,36,109,.5); } 70%, 100% { box-shadow: 0 0 0 14px rgba(187,36,109,0); } }
body.video-open [data-tip]:hover::after { display: none; }
@media (max-width: 767px) {
  .xvideo { padding: 10px; }
  .xvideo__box { padding: 14px; border-radius: 20px; }
  .xvideo__head h2 { font-size: 16px; }
  .xvideo__frame { border-radius: 12px; max-height: calc(100vh - 300px); }
  .xvideo__foot { flex-direction: column; align-items: stretch; text-align: center; }
  .xvideo__cta { justify-content: center; }
}

/* ---------- loading ---------- */
.xloading {
  position: absolute; inset: 0; display: grid; place-items: center; background: #fff; z-index: 1;
  transition: opacity .3s;
}
.xloading.is-hidden { opacity: 0; pointer-events: none; }
.xloading span {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--x-line); border-top-color: var(--x-primary);
  animation: xspin .8s linear infinite;
}
@keyframes xspin { to { transform: rotate(360deg); } }

/* ---------- toast ---------- */
.xtoast {
  position: absolute; bottom: 20px; right: 20px; z-index: 30;
  background: var(--x-ink); color: #fff; border-radius: 16px; padding: 12px 16px;
  font-size: 13px; line-height: 1.7; max-width: 320px;
  opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; pointer-events: none;
}
.xtoast.is-on { opacity: 1; transform: none; }

/* ---------- error ---------- */
.xerror { padding: 40px; text-align: center; color: var(--x-muted); font-size: 14px; line-height: 2; }

/* ---------- narrow screens: collapse labels, never crowd the header ---------- */
@media (max-width: 1180px) {
  .xbadge { display: none; }
}
@media (max-width: 1000px) {
  .xtitle > span { display: none; }
}
@media (max-width: 900px) {
  .xdur { display: none; }
}

/* ---------- real phones & small tablets: the app fills the screen under a slim bar ----------
   Same hierarchy: identity on the right; video + ••• on the left (••• also holds reset and navigation).
   Nothing floats over the app itself. */
body.is-full { --x-bar-h: 52px; overflow: hidden; }
body.is-full .xstage { position: fixed; inset: var(--x-bar-h) 0 0 0; height: auto; }
body.is-full .xcue, body.is-full .xtoast { position: fixed; }
body.is-full .xfoot { display: none; }
body.is-full .xbar { padding: 0 12px; }
body.is-full .xnav-course { display: none; }
/* the stage starts below the bar; lifting its layer lets its fixed children (video, •••) sit on top of the bar */
body.is-full .xstage { z-index: 21; }
/* own device: the app fills the screen */
body.is-native .xstage { background: #fff; display: block; }
body.is-native .xdevice {
  position: absolute; inset: 0; top: 0; left: 0; width: 100% !important; height: 100% !important;
  transform: none !important; padding: 0; border-radius: 0; box-shadow: none; background: #fff;
}
body.is-native .xdevice::before, body.is-native .xhw, body.is-native .xisland, body.is-native .xcam, body.is-native .xstatus, body.is-native .xchrome { display: none !important; }
body.is-native .xdevice .xscreen { inset: 0; border-radius: 0; }

/* back to all projects, where the logo used to be */
.xback {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--x-line);
  display: grid; place-items: center; color: var(--x-ink); background: var(--x-surface); transition: border-color .2s;
}
.xback:hover { border-color: var(--x-ink); }
.xback svg { width: 18px; height: 18px; }
body.is-full .xback { width: 36px; height: 36px; }

/* device dropdown (phones & tablets only) */
.xdevbtn { display: none; }
body.is-full .xdevbtn {
  position: fixed; top: 8px; left: 50px; z-index: 21; height: 36px; padding: 0 8px 0 10px;
  display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--x-line); border-radius: 999px;
  background: var(--x-surface); color: var(--x-ink);
}
.xdevbtn svg { width: 17px; height: 17px; }
.xdevbtn svg + svg { width: 14px; height: 14px; color: var(--x-muted); }
.xdevbtn[aria-expanded="true"] { background: var(--x-bg); }
.xdevmenu { min-width: 200px; }
.xdevmenu .xmenu__info { font: 600 12px/1 var(--x-font); color: var(--x-muted); }
.xdevmenu [aria-checked="true"] { background: var(--x-bg); }
.xdevmenu [aria-checked="true"] svg { color: var(--x-ink); }
.xnative { display: none; margin-inline-start: auto; font-size: 11px; font-weight: 600; color: var(--x-muted); }
.xdevmenu .is-native .xnative { display: inline; }
/* narrow phones: shorter video label so the project name keeps its room */
@media (max-width: 430px) { body.is-full .xvb-more { display: none; } }
body.is-full .xdock {
  position: fixed; top: 7px; left: 8px; bottom: auto; transform: none; z-index: 21;
  padding: 0; border: 0; box-shadow: none; background: transparent;
}
body.is-full .xdock > :not([data-act="menu"]) { display: none; }
body.is-full .xvbtn { position: fixed; top: 8px; left: 116px; z-index: 21; height: 36px; box-shadow: none; }
body.is-full .xvbtn i { width: 26px; height: 26px; }
/* download: after the video button (left set in shell.js); the panel drops the QR, the visitor is already on the phone */
body.is-full .xdlbtn { position: fixed; top: 8px; left: 116px; z-index: 21; padding: 0 10px 0 12px; }
body.is-full .xdl__phone { display: none; }
@media (max-width: 430px) { body.is-full.has-video .xdl-txt { display: none; } body.is-full.has-video .xdlbtn { width: 36px; padding: 0; justify-content: center; } }
body.is-full .xmenu .xfull { display: flex; }
body.is-full .xmenu hr.xfull { display: block; }
body.is-full .xmenu .xdesk { display: none; }
body.is-full .xcue { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); max-width: calc(100% - 32px); }
body.is-full .xcue span { overflow: hidden; text-overflow: ellipsis; }
body.is-full .xtoast { top: calc(var(--x-bar-h) + 10px); bottom: auto; left: 12px; right: 12px; max-width: none; text-align: center; font-size: 12px; transform: translateY(-8px); }
body.is-full .xtoast.is-on { transform: none; }
