/* Playground onboarding design system — tokens + shared components.
 *
 * Source of truth is docs/playground-onboarding-prototype.html (Jake's
 * clickable spec): mint #2dce8f on near-white, blurred mint orbs, glass
 * cards, pill buttons, Outfit type. Used by /start (entry flow), the install
 * mini-player, the onboarding module picker + checklist in the shell, and the
 * standalone installer page. Light-only, like the rest of the playground —
 * the EMR replays underneath are all light.
 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --pg-ink: #1a1e1c; --pg-ink2: #4b534f; --pg-ink3: #7d8683;
  --pg-paper: #f6faf8; --pg-card: #ffffff; --pg-glass: rgba(255, 255, 255, .72);
  --pg-line: #e3ebe7; --pg-line2: #c9d6d0;
  --pg-green: #2dce8f; --pg-green-d: #1fae76; --pg-green-bg: #e5f5ee; --pg-green-bg2: #ebfff7;
  --pg-mint: #b0ffe2; --pg-sky: #ddebff; --pg-navy: #15295a;
  --pg-amber: #f5b942; --pg-amber-bg: #fff6e3; --pg-coral: #ff6b6b;
  --pg-sh: 0 1px 2px rgba(26, 30, 28, .05), 0 12px 32px -16px rgba(26, 30, 28, .18);
  --pg-sh2: 0 24px 60px -24px rgba(26, 30, 28, .28);
  --pg-f: "Outfit", "Thicccboi", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  --pg-r: 18px;
}

.pg-font, .pg-font button, .pg-font input, .pg-font textarea { font-family: var(--pg-f); }
/* The shell's brand.css sets an 18px/1.67 body; our overlays don't inherit that. */
.pg-blur, #pg-ck, .pgi, .pg-toast { font-size: 15px; line-height: 1.5; color: var(--pg-ink); font-weight: 400; }
.pg-font button { cursor: pointer; border: 0; background: none; color: inherit; font: inherit; }
.pg-font h1, .pg-font h2, .pg-font h3 { margin: 0; letter-spacing: -.02em; text-wrap: balance; font-weight: 600; }

/* ─── Stage (entry flow background) ──────────────────────────────────── */
/* Flex + margin:auto (not grid place-items:center): a question taller than
   the viewport — the 20-tile EMR grid on a laptop — must scroll from the top,
   not get clipped on both ends by centering. */
.pg-stage { position: fixed; inset: 0; background: linear-gradient(180deg, #f7fbf9 0%, #eef8f3 100%);
  color: var(--pg-ink); overflow: auto; display: flex; padding: 24px 16px; box-sizing: border-box; }
.pg-stage > .pg-q { margin: auto; }
.pg-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
/* Decorative — fixed so the stage's own scroll area never grows to fit them. */
.pg-stage > .pg-orb { position: fixed; }
.pg-o1 { width: 60vmax; height: 60vmax; background: radial-gradient(circle at 30% 30%, var(--pg-green), transparent 62%);
  top: -25vmax; left: -15vmax; animation: pg-spin 34s linear infinite; }
.pg-o2 { width: 55vmax; height: 55vmax; background: radial-gradient(circle at 60% 40%, var(--pg-green-d), transparent 62%);
  right: -15vmax; top: -10vmax; animation: pg-spin 44s linear infinite reverse; }
.pg-o3 { width: 45vmax; height: 45vmax; background: radial-gradient(circle, var(--pg-mint), transparent 62%);
  right: 20%; bottom: -25vmax; animation: pg-spin 52s linear infinite; }
@keyframes pg-spin { from { transform: rotate(0) translateX(6vmax) rotate(0); } to { transform: rotate(360deg) translateX(6vmax) rotate(-360deg); } }
.pg-stage > *:not(.pg-orb) { position: relative; z-index: 1; }
@keyframes pg-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ─── Question card ──────────────────────────────────────────────────── */
.pg-q { width: min(560px, 100%); animation: pg-in .35s ease-out; }
.pg-q .pg-num { font-size: 14px; color: var(--pg-ink3); margin-bottom: 10px; }
.pg-q h2 { font-size: clamp(28px, 3.8vw, 40px); font-weight: 600; line-height: 1.1; margin-bottom: 22px; }
.pg-q .pg-sub { color: var(--pg-ink2); margin: -12px 0 18px; font-size: 16px; }
/* Solid white cards with a real border: the glass version read as flat
   washed-out rectangles against the mint background. */
.pg-opt { display: flex; align-items: center; gap: 14px; width: 100%; box-sizing: border-box; text-align: left; background: #fff;
  border: 1.5px solid #b3c3ba; border-radius: 16px; padding: 15px 18px; margin-bottom: 10px;
  font-weight: 500; color: var(--pg-ink); transition: .18s;
  box-shadow: 0 1px 3px rgba(26, 30, 28, .10), 0 12px 28px -12px rgba(26, 30, 28, .32); }
.pg-opt:hover, .pg-opt:focus-visible { border-color: var(--pg-green); box-shadow: 0 0 0 3px rgba(45, 206, 143, .18), 0 12px 28px -14px rgba(26, 30, 28, .3);
  transform: translateY(-1px); outline: none; }
.pg-opt .pg-k { width: 26px; height: 26px; border-radius: 8px; background: var(--pg-green-bg); color: var(--pg-green-d);
  font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; }
.pg-opt small { display: block; font-weight: 400; color: var(--pg-ink2); font-size: 13px; }
.pg-opt.pg-soon { opacity: .7; }
.pg-opt.pg-soon small { color: var(--pg-amber); }
.pg-optgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.pg-optgrid .pg-opt { margin: 0; justify-content: center; text-align: center; flex-direction: column; gap: 6px; min-height: 64px; }
.pg-optgrid .pg-opt img { max-height: 26px; max-width: 110px; object-fit: contain; }
.pg-inp { width: 100%; box-sizing: border-box; background: #fff; border: 1.5px solid #b3c3ba; border-radius: 14px;
  padding: 15px 18px; font-size: 18px; color: var(--pg-ink); font-family: var(--pg-f); outline: none;
  box-shadow: var(--pg-sh); transition: .15s; }
.pg-inp:focus { border-color: var(--pg-green); box-shadow: 0 0 0 4px rgba(45, 206, 143, .18); }
.pg-inp::placeholder { color: var(--pg-ink3); }
.pg-inp.pg-sm { font-size: 14px; padding: 11px 14px; margin-top: 10px; border-radius: 12px; }
.pg-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.pg-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--pg-green); color: #fff; font-weight: 600;
  border-radius: 999px; padding: 12px 22px; font-size: 15px; transition: .15s; box-shadow: 0 8px 20px -8px rgba(45, 206, 143, .7);
  text-decoration: none; cursor: pointer; border: 0; font-family: var(--pg-f); }
.pg-cta:hover { background: var(--pg-green-d); }
.pg-cta.pg-ghost { background: #fff; color: var(--pg-ink); border: 1.5px solid #b3c3ba; box-shadow: none; }
.pg-cta.pg-ghost:hover { background: var(--pg-card); color: var(--pg-ink); }
.pg-cta:disabled { opacity: .4; cursor: not-allowed; }
.pg-hint { font-size: 13px; color: var(--pg-ink2); margin-top: 14px; }
.pg-err { color: #c0392b; font-size: 13.5px; margin-top: 10px; min-height: 1em; }
.pg-prog { height: 4px; background: var(--pg-line); border-radius: 3px; margin-bottom: 24px; overflow: hidden; }
.pg-prog i { display: block; height: 100%; background: var(--pg-green); transition: width .3s; border-radius: 3px; }
.pg-chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--pg-ink2); }
.pg-chk input { width: 16px; height: 16px; accent-color: var(--pg-green); }
.pg-grp { margin-bottom: 16px; }
.pg-gl { font-size: 14px; font-weight: 500; margin-bottom: 8px; color: var(--pg-ink2); }
.pg-gl span { color: var(--pg-ink3); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-chip { background: #fff; border: 1.5px solid #b3c3ba; border-radius: 999px; padding: 8px 14px;
  font-size: 13.5px; font-weight: 500; color: var(--pg-ink); backdrop-filter: blur(8px); transition: .15s; }
.pg-chip:hover { border-color: var(--pg-green); }
.pg-chip.pg-on { background: var(--pg-green); border-color: var(--pg-green); color: #fff; }
.pg-badge { width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(135deg, var(--pg-mint), var(--pg-green));
  display: grid; place-items: center; font-size: 42px; margin: 0 auto 16px; box-shadow: 0 20px 40px -12px rgba(45, 206, 143, .6); }
.pg-code { font: inherit; background: var(--pg-green-bg); padding: 1px 6px; border-radius: 6px; }

.pg-busy { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--pg-line); border-top-color: var(--pg-green); animation: pg-rot .7s linear infinite; vertical-align: -3px; box-sizing: border-box; }
@keyframes pg-rot { to { transform: rotate(360deg); } }

/* ─── Blur + module picker (Playground home) ─────────────────────────── */
/* Flex + margin:auto so a card taller than the viewport scrolls from its
   top instead of being clipped at both ends by centering. */
.pg-blur { position: fixed; inset: 0; z-index: 99980; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(246, 250, 248, .55); display: flex; padding: 16px; overflow: auto; animation: pg-in .3s; box-sizing: border-box; }
.pg-modcard { background: var(--pg-card); color: var(--pg-ink); border-radius: 24px; padding: 20px 22px; width: min(460px, 100%); margin: auto;
  box-shadow: var(--pg-sh2); border: 1px solid var(--pg-line); animation: pg-in .35s; box-sizing: border-box; }
.pg-modcard h2 { font-size: 22px; margin-bottom: 4px; }
.pg-modcard .pg-sub { color: var(--pg-ink3); font-size: 13.5px; margin: 0 0 8px; }
.pg-mrow { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--pg-line); border-radius: 14px;
  margin-top: 8px; width: 100%; text-align: left; color: var(--pg-ink); transition: .15s; background: var(--pg-card); box-sizing: border-box; }
.pg-mrow:hover:not(:disabled) { border-color: var(--pg-green); background: var(--pg-green-bg2); }
.pg-mrow:disabled { opacity: .45; cursor: default; }
.pg-mrow .pg-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--pg-paper); border: 1px solid var(--pg-line);
  color: var(--pg-ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.pg-mrow.pg-done .pg-ic { background: var(--pg-green); border-color: var(--pg-green); color: #fff; }
.pg-mrow .pg-nm { font-weight: 600; font-size: 14.5px; }
.pg-mrow .pg-ds { font-size: 12.5px; color: var(--pg-ink3); line-height: 1.4; }
.pg-mrow .pg-tm { margin-left: auto; font-size: 12.5px; color: var(--pg-ink3); white-space: nowrap; }
.pg-mrow .pg-tm b { color: var(--pg-green-d); font-weight: 600; }
.pg-modcard .pg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--pg-ink3); }
.pg-modcard .pg-foot button { color: var(--pg-ink3); text-decoration: underline; font-size: 12.5px; }

/* ─── Checklist widget ───────────────────────────────────────────────── */
#pg-ck { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 99985; font-family: var(--pg-f); }
#pg-ck .pg-pill { display: flex; align-items: center; gap: 10px; background: var(--pg-ink); color: #fff; border-radius: 999px;
  padding: 10px 18px 10px 12px; font-weight: 500; font-size: 13.5px; box-shadow: var(--pg-sh2); }
#pg-ck .pg-pill:hover { background: #2a312d; }
.pg-ring { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.pg-ring::after { content: attr(data-n); position: absolute; inset: 4px; background: var(--pg-ink); border-radius: 50%;
  display: grid; place-items: center; font-size: 9px; font-weight: 600; }
#pg-ck .pg-panel { width: min(360px, calc(100vw - 32px)); background: var(--pg-card); color: var(--pg-ink); border: 1px solid var(--pg-line);
  border-radius: 22px; box-shadow: var(--pg-sh2); overflow: hidden; animation: pg-in .25s; }
#pg-ck .pg-hd { background: linear-gradient(160deg, var(--pg-green) 0%, var(--pg-green-d) 100%); color: #fff; padding: 16px 18px; position: relative; overflow: hidden; }
#pg-ck .pg-hd .pg-orb { filter: blur(24px); width: 200px; height: 200px; right: -60px; top: -90px;
  background: radial-gradient(circle, var(--pg-mint), transparent 65%); opacity: .8; }
#pg-ck .pg-hd > * { position: relative; }
#pg-ck .pg-hd h3 { font-size: 16px; color: #fff; }
#pg-ck .pg-hd small { opacity: .85; font-size: 12.5px; }
#pg-ck .pg-hd .pg-x { position: absolute; right: 0; top: -2px; color: #fff; opacity: .8; font-size: 18px; }
.pg-pbar { height: 6px; background: rgba(255, 255, 255, .28); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.pg-pbar i { display: block; height: 100%; background: #fff; transition: width .4s; border-radius: 3px; }
.pg-ci { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--pg-line); align-items: flex-start; width: 100%;
  text-align: left; color: var(--pg-ink); box-sizing: border-box; }
.pg-ci:last-of-type { border-bottom: 0; }
.pg-ci .pg-box { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--pg-line2); flex: none; display: grid;
  place-items: center; font-size: 12px; margin-top: 1px; box-sizing: border-box; }
.pg-ci.pg-done .pg-box { background: var(--pg-green); border-color: var(--pg-green); color: #fff; }
.pg-ci.pg-done .pg-n { text-decoration: line-through; color: var(--pg-ink3); }
.pg-ci.pg-next { background: var(--pg-green-bg2); }
.pg-ci.pg-next .pg-box { border-color: var(--pg-green); border-width: 2px; }
.pg-ci.pg-lock { opacity: .5; cursor: default; }
.pg-ci .pg-n { font-weight: 600; font-size: 14px; }
.pg-ci .pg-d { font-size: 12.5px; color: var(--pg-ink3); }
.pg-ci .pg-t { margin-left: auto; font-size: 12px; color: var(--pg-ink3); white-space: nowrap; padding-top: 3px; }
.pg-ci .pg-go { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--pg-green-d); }
#pg-ck .pg-ft { padding: 10px 18px; font-size: 11.5px; color: var(--pg-ink3); background: var(--pg-paper); display: flex; justify-content: space-between; }

/* ─── Install mini-player ────────────────────────────────────────────── */
/* Compact on purpose: under half the viewport on a laptop, body scrolls if a
   step ever runs long. */
.pgi { position: fixed; right: 20px; bottom: 20px; width: min(320px, calc(100vw - 40px)); max-height: min(46vh, 520px);
  display: flex; flex-direction: column; background: var(--pg-card); color: var(--pg-ink);
  border: 1px solid var(--pg-line); border-radius: 18px; box-shadow: var(--pg-sh2); overflow: hidden; z-index: 100001;
  animation: pg-in .3s; font-family: var(--pg-f); font-size: 13.5px; line-height: 1.45; box-sizing: border-box; }
.pgi * { box-sizing: border-box; }
.pgi button { cursor: pointer; border: 0; background: none; color: inherit; font: inherit; font-family: var(--pg-f); }
.pgi .pgi-hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--pg-line); font-weight: 600; font-size: 13px; flex: none; }
.pgi .pgi-hd i { width: 18px; height: 18px; border-radius: 6px; background: var(--pg-green); flex: none; display: block; }
.pgi .pgi-hd .pgi-sp { margin-left: auto; color: var(--pg-ink3); font-weight: 400; font-size: 12px; }
.pgi .pgi-ib { color: var(--pg-ink3); font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.pgi .pgi-ib:hover { background: var(--pg-green-bg); color: var(--pg-ink); }
.pgi .pgi-bd { padding: 12px 14px 14px; overflow: auto; min-height: 0; }
.pgi .pgi-stp { font-size: 11.5px; color: var(--pg-ink3); }
.pgi h3 { font-size: 15.5px; margin: 3px 0 4px; font-weight: 600; letter-spacing: -.01em; }
.pgi p { font-size: 13px; color: var(--pg-ink2); margin: 0 0 10px; }
.pgi .pgi-btnp { display: block; width: 100%; text-align: center; background: var(--pg-green); color: #fff; border-radius: 999px;
  padding: 9px; font-weight: 600; font-size: 13px; text-decoration: none; }
.pgi .pgi-btnp:hover { background: var(--pg-green-d); }
.pgi .pgi-btnp:disabled { opacity: .5; cursor: default; }
.pgi .pgi-btnp.pgi-sec { background: var(--pg-green-bg); color: var(--pg-ink); margin-top: 8px; }
.pgi .pgi-btns { display: block; width: 100%; text-align: center; color: var(--pg-ink3); font-size: 12.5px; margin-top: 10px; line-height: 1.45; }
.pgi .pgi-btns button, .pgi .pgi-btns a { color: var(--pg-green-d); font-weight: 600; text-decoration: none; font-size: 12.5px; }
.pgi .pgi-det { display: flex; align-items: center; gap: 8px; background: var(--pg-paper); border: 1px solid var(--pg-line);
  border-radius: 10px; padding: 7px 10px; font-size: 12.5px; margin-bottom: 6px; }
/* Chrome Web Store's own "Add to Chrome" button, drawn as they'll see it. */
.pgi .pgi-store-btn { display: inline-block; background: #1a73e8; color: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 500;
  font-size: 13px; line-height: 1.4; vertical-align: 1px; white-space: nowrap; font-family: "Google Sans", Roboto, system-ui, sans-serif; }
.pgi .pgi-note { background: var(--pg-amber-bg); border: 1px solid var(--pg-amber); border-radius: 10px; padding: 7px 10px;
  font-size: 12px; color: var(--pg-ink); margin: 0 0 10px; line-height: 1.45; }
.pgi .pgi-note b { font-weight: 600; }
.pgi .pgi-note button { color: var(--pg-green-d); font-weight: 600; text-decoration: underline; font-size: 12px; padding: 0; }
.pgi .pgi-copy { display: flex; gap: 6px; margin-bottom: 12px; }
.pgi .pgi-copy input { flex: 1; min-width: 0; font: inherit; font-size: 12.5px; padding: 9px 11px; border: 1px solid var(--pg-line);
  border-radius: 10px; background: var(--pg-paper); color: var(--pg-ink); }
.pgi .pgi-copy button { background: var(--pg-green); color: #fff; border-radius: 10px; padding: 0 12px; font-weight: 600; font-size: 12.5px; }
.pgi .pgi-pin { display: block; width: 100%; max-height: 86px; height: auto; margin: 0 0 10px; border-radius: 10px; border: 1px solid var(--pg-line); background: #fff; }
.pg-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--pg-amber); animation: pg-pulse 1.4s infinite; flex: none; }
.pg-pulse.pg-ok { background: var(--pg-green); animation: none; }
@keyframes pg-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 185, 66, .6); } 50% { box-shadow: 0 0 0 6px rgba(245, 185, 66, 0); } }
.pgi-placeholder { position: fixed; right: 20px; bottom: 20px; z-index: 100000; display: flex; align-items: center; gap: 8px;
  background: var(--pg-card); color: var(--pg-ink); border: 1px solid var(--pg-line); border-radius: 14px; padding: 10px 14px;
  font-family: var(--pg-f); font-size: 13px; box-shadow: var(--pg-sh2); }
.pgi-placeholder i { width: 14px; height: 14px; border-radius: 5px; background: var(--pg-green); display: block; }
.pgi-placeholder button { color: var(--pg-green-d); font-weight: 600; font-size: 13px; margin-left: 4px; }
/* Inside the Picture-in-Picture window the player IS the window: fill it
   edge to edge and let the body scroll if a step runs long. */
html.pgi-pip-root, body.pgi-pip-host { margin: 0; padding: 0; height: 100%; overflow: hidden; background: var(--pg-card); font-family: var(--pg-f); }
body.pgi-pip-host .pgi { position: static; width: 100%; max-width: none; height: 100%; max-height: none;
  border: 0; border-radius: 0; box-shadow: none; animation: none; }
body.pgi-pip-host .pgi .pgi-bd { flex: 1 1 auto; }
body.pgi-pip-host .pgi .pgi-popout, body.pgi-pip-host .pgi .pgi-sp { display: none; }

/* ─── Celebrations ───────────────────────────────────────────────────── */
#pg-fx { position: fixed; inset: 0; pointer-events: none; z-index: 100010; }
.pg-toast { position: fixed; left: 50%; top: 14%; transform: translateX(-50%); z-index: 100011; background: var(--pg-card); color: var(--pg-ink);
  border: 1px solid var(--pg-line); border-radius: 22px; padding: 20px 28px; text-align: center; box-shadow: var(--pg-sh2);
  animation: pg-in .3s; max-width: min(420px, calc(100vw - 32px)); font-family: var(--pg-f); }
.pg-toast h3 { font-size: 21px; margin-bottom: 4px; font-weight: 600; }
.pg-toast p { margin: 0; color: var(--pg-ink2); font-size: 14.5px; }
.pg-toast .pg-e { font-size: 40px; }

@media (prefers-reduced-motion: reduce) {
  .pg-orb, .pg-pulse { animation: none !important; }
  .pg-q, .pg-modcard, .pg-blur, .pgi, .pg-toast, #pg-ck .pg-panel { animation: none; }
}

/* The QR on the "Comprehend on your phone" lesson. Sized so it still scans
   from a phone held at arm's length in front of a laptop screen. */
.pg-qr { display: flex; justify-content: center; margin: 4px 0 10px; }
.pg-qr svg { border-radius: 10px; border: 1px solid var(--pg-line); background: #fff; padding: 8px; }
.pg-qr-url { text-align: center; color: var(--pg-ink2); font-size: 13px; margin: 0 0 10px; }
.pg-qr-url b { color: var(--pg-ink); }
