/* ============================================================
   Prompts page: a compact library in the getlayers mould.
   Small type, four columns, no hero. Loaded on prompts.html only,
   after library.css, so the dark tokens there still apply.
   ============================================================ */
body.lib {
  --pg-gut: clamp(16px, 2.2vw, 32px);
  --pg-gap: 6px;
  --pg-ink: #f5f5f5;
  --pg-ink-2: #a6a6a6;
  --pg-ink-3: #868686;
  --pg-line: rgba(255,255,255,.08);
  --pg-card: rgba(255,255,255,.027);
  --pg-well: rgba(255,255,255,.05);
  --pg-well-hi: rgba(255,255,255,.075);
  --pg-rim: inset 0 1px 0 0 rgba(255,255,255,.06);
  --pg-surface: #0d0d0d;
  --pg-prem: linear-gradient(90deg, #bcc0ca -1%, #feeae1 42%, #c0cef2 102%);
  --pg-sheen: linear-gradient(180deg, rgba(255,255,255,.035) 0%, rgba(255,255,255,0) 45%);
  --pg-aurora: radial-gradient(120% 90% at 0% 0%, rgba(254,234,225,.045), transparent 55%),
               radial-gradient(120% 90% at 100% 100%, rgba(192,206,242,.04), transparent 60%);
  font-size: 15px;
}

/* ---------- head: title, category tabs, pricing, facets ---------- */
.pg-head {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(92px, 8.4vw, 116px) var(--pg-gut) 0;
}
.pg-eyebrow {
  display: inline-block; margin: 0 0 14px;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--pg-line); background: var(--pg-card);
  font-size: 12px; color: var(--pg-ink-2);
}
.pg-title {
  margin: 0; width: fit-content; max-width: 100%;
  font-family: var(--display); font-weight: 300;
  font-size: clamp(30px, 3.35vw, 48px); line-height: 1.06; letter-spacing: -.03em;
  background: linear-gradient(122deg, #f5f5f5 0%, #f5f5f5 18%, #a6a6a6 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  padding-bottom: .14em; margin-bottom: -.14em;
}
.pg-title--sm { font-size: clamp(24px, 2.4vw, 34px); }

.pg-tabsrow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 22px calc(var(--pg-gut) * -1) 16px;
  padding: 0 var(--pg-gut) 16px;
  border-bottom: 1px solid var(--pg-line);
}
.pg-tabs, .pg-price {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
  border: 1px solid var(--pg-line); border-radius: 10px; background: var(--pg-card);
}
.pg-tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pg-tabs::-webkit-scrollbar, .pg-facets::-webkit-scrollbar { display: none; }
.pg-tab, .pg-seg {
  flex: none; height: 34px; padding: 0 15px; border: 0; border-radius: 6px;
  background: none; color: var(--pg-ink-2); font: inherit; font-size: 14px;
  white-space: nowrap; cursor: pointer; transition: color .2s, background .2s;
}
.pg-seg { height: 28px; padding: 0 11px; font-size: 13px; }
.pg-tab:hover, .pg-seg:hover { color: var(--pg-ink); }
.pg-tab.on, .pg-seg.on { color: var(--pg-ink); background: var(--pg-well-hi); box-shadow: var(--pg-rim); }
.pg-price { flex: none; padding-left: 12px; }
.pg-price-l { margin-right: 6px; font-size: 13px; color: var(--pg-ink-3); }

.pg-facets {
  display: flex; align-items: center; gap: 18px;
  margin: 0 calc(var(--pg-gut) * -1); padding: 0 var(--pg-gut) 2px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
}
.pg-fgroup { display: flex; align-items: center; gap: 9px; flex: none; }
.pg-fgroup + .pg-fgroup { position: relative; padding-left: 18px; }
.pg-fgroup + .pg-fgroup::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 1px; height: 18px; margin-top: -9px; background: var(--pg-line);
}
.pg-flabel { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pg-ink-3); }
.pg-chips { display: flex; gap: 6px; }
.pg-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 31px; padding: 0 7px 0 11px; border: 0; border-radius: 10px;
  background: var(--pg-well); box-shadow: var(--pg-rim);
  color: var(--pg-ink-2); font: inherit; font-size: 13px; white-space: nowrap;
  cursor: pointer; transition: color .2s, background .2s, opacity .2s;
}
.pg-chip:hover { color: var(--pg-ink); background: var(--pg-well-hi); }
.pg-chip.on {
  color: var(--pg-ink); background: rgba(255,255,255,.15);
  box-shadow: 0 1px 4px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(255,255,255,.06);
}
.pg-chip.is-empty { opacity: .38; }
.pg-glyph { width: 14px; height: 14px; flex: none; opacity: .85; }
.pg-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 5px; border-radius: 6px;
  font-size: 11px; color: var(--pg-ink-3); font-variant-numeric: tabular-nums;
}
.pg-chip.on .pg-count { background: var(--pg-prem); color: #060606; }

/* ---------- grids ---------- */
.pg-lib, .pg-sec { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--pg-gut) 0; }
.pg-sec { padding-top: clamp(56px, 6vw, 96px); }
.pg-sechead { margin-bottom: 16px; }
.pg-rows { position: relative; }
.lib-grid, .pieces-grid {
  display: grid; gap: var(--pg-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) { .lib-grid, .pieces-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1152px) { .lib-grid, .pieces-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lib-grid > [hidden], .pieces-grid > [hidden], .pg-rows .is-cut { display: none !important; }

/* ---------- cards: prompts and components share one shape ---------- */
.lcard, .piece {
  position: relative; display: flex; flex-direction: column;
  padding: 5.6px; border-radius: 12px; cursor: pointer; outline: none;
  /* keeps the .rv reveal (opacity, transform) alongside the hover fill */
  transition: background .3s var(--ease), opacity .7s var(--ease), transform .7s var(--ease);
}
.lcard:hover, .piece:hover, .lcard.is-open { background: rgba(255,255,255,.035); }
/* the Explore button's orbiting light, run round whichever card is hovered */
.lcard::after, .piece::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  padding: 1.5px; opacity: 0; transition: opacity .35s var(--ease);
  background: conic-gradient(from var(--pg-a),
    transparent 0 6%, rgba(232,234,239,.35) 11%, #fff 15%, rgba(232,234,239,.35) 19%, transparent 25% 56%,
    rgba(255,190,162,.4) 61%, #feeae1 65%, rgba(255,190,162,.4) 69%, transparent 75% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: pg-orbit 4.2s linear infinite paused;
}
.lcard:hover::after, .piece:hover::after, .lcard:focus-visible::after, .piece:focus-visible::after { opacity: 1; animation-play-state: running; }
@media (hover: none) { .lcard::after, .piece::after { display: none; } }
@media (prefers-reduced-motion: reduce) { .lcard::after, .piece::after { animation: none; } }
.lcard:focus-visible, .piece:focus-visible { box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.lcard-media, .piece-stage {
  position: relative; isolation: isolate; overflow: hidden;
  aspect-ratio: 16 / 10; border-radius: 9px; background: #141414;
}
.piece-stage { display: grid; place-items: center; background-image: radial-gradient(120% 100% at 50% 0%, #12161c, #0a0c0f); }
.piece-stage--poster { background-size: cover; background-position: center; }
.lcard-media img, .lcard-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .8s var(--ease), opacity .4s linear;
}
.lcard-media video { opacity: 0; }
.lcard-media video.on { opacity: 1; }
.lcard:hover .lcard-media img, .lcard:hover .lcard-media video { transform: scale(1.03); }
.lcard-new {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  padding: 3px 8px; border-radius: 999px; background: var(--pg-prem);
  font-size: 11px; font-weight: 600; line-height: 1.2; color: #121212;
}
.lcard-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-width: 0; padding: 9px 5px 3px;
}
.lcard-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lcard-arrow {
  display: flex; flex: none; width: 0; margin-right: -8px; overflow: hidden;
  opacity: 0; color: var(--pg-ink);
  transition: width .35s var(--ease), margin .35s var(--ease), opacity .3s;
}
.lcard:hover .lcard-arrow, .piece:hover .lcard-arrow { width: 15px; margin-right: 0; opacity: 1; }
.lcard-arrow svg { flex: none; width: 15px; height: 15px; }
.lcard-name {
  margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--display); font-weight: 500; font-size: 14.5px; letter-spacing: -.01em;
  line-height: 1.4; color: var(--pg-ink);
}
.lcard-sub {
  flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: -.01em; color: var(--pg-ink-3);
}
.tier {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--pg-line);
  background: #1d1d1d; color: var(--pg-ink); font-size: 11.5px; line-height: 1.15;
}
.tier--prem { background: var(--pg-prem); border-color: transparent; color: #121212; font-weight: 600; }
.tier svg { width: 11px; height: 11px; flex: none; }
/* the heart moves to the right corner, clear of the New badge */
.lcard-fav { left: auto; right: 8px; top: 8px; width: 30px; height: 30px; }
.lcard-fav svg { width: 14px; height: 14px; }

.lib-more {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  min-height: 200px; margin: 5.6px; padding: 18px; border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.16); color: var(--pg-ink); text-decoration: none;
  transition: border-color .3s, background .3s;
}
.lib-more-n { font-family: var(--display); font-weight: 300; font-size: 34px; letter-spacing: -.03em; }
.lib-more b { font-weight: 400; font-size: 15px; line-height: 1.35; color: var(--pg-ink-2); }
.lib-more-go { font-size: 13px; }
.lib-more:hover { border-color: rgba(255,255,255,.36); background: rgba(255,255,255,.03); }

.pg-empty { margin: 28px 0 0; text-align: center; font-size: 14px; color: var(--pg-ink-2); }
.pg-empty[hidden] { display: none; }
.pg-clear {
  margin-left: 6px; padding: 6px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--pg-well-hi); box-shadow: var(--pg-rim); color: var(--pg-ink); font: inherit; font-size: 13px;
}

/* ---------- the veil over the last rows, and its explore button ---------- */
.pg-veil, .pg-explore { display: none; }
.pg-rows.is-capped .pg-veil, .pg-rows.is-capped .pg-explore { display: block; }
.pg-veil { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; pointer-events: none; }
.pg-veil span { position: absolute; left: 0; right: 0; bottom: 0; display: block; }
.pg-veil span:nth-child(1) {
  height: 100%; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  -webkit-mask-image: linear-gradient(transparent 0%, #000 45%); mask-image: linear-gradient(transparent 0%, #000 45%);
}
.pg-veil span:nth-child(2) {
  height: 80%; -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  -webkit-mask-image: linear-gradient(transparent 0%, #000 55%); mask-image: linear-gradient(transparent 0%, #000 55%);
}
.pg-veil span:nth-child(3) {
  height: 62%; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, transparent 0%, rgba(7,8,10,.72) 45%, #07080a 88%);
  -webkit-mask-image: linear-gradient(transparent 0%, #000 35%); mask-image: linear-gradient(transparent 0%, #000 35%);
}
.pg-explore { position: absolute; left: 50%; bottom: 12%; z-index: 2; transform: translateX(-50%); white-space: nowrap; }

@property --pg-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.pg-more {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px 13px 26px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-family: var(--display); font-size: 15px; letter-spacing: -.01em; color: var(--pg-ink);
  background: rgba(255,255,255,.065);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.16), inset 0 -14px 24px -16px rgba(255,255,255,.18), 0 14px 40px -14px rgba(0,0,0,.85);
  transition: background .3s, box-shadow .3s;
}
/* the resting silver edge, and the light that runs round it */
.pg-more::before, .pg-more-ring {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.pg-more::before {
  padding: 1px; opacity: .6;
  background: linear-gradient(140deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.06) 38%, rgba(255,255,255,0) 60%, rgba(255,255,255,.34) 100%);
}
.pg-more-ring {
  padding: 1.5px;
  background: conic-gradient(from var(--pg-a),
    transparent 0 6%, rgba(232,234,239,.35) 11%, #fff 15%, rgba(232,234,239,.35) 19%, transparent 25% 56%,
    rgba(255,190,162,.4) 61%, #feeae1 65%, rgba(255,190,162,.4) 69%, transparent 75% 100%);
  animation: pg-orbit 4.2s linear infinite;
}
@keyframes pg-orbit { to { --pg-a: 360deg; } }
.pg-more svg { width: 14px; height: 14px; flex: none; }
.pg-more:hover { background: rgba(255,255,255,.11); box-shadow: inset 0 1px 1px rgba(255,255,255,.2), inset 0 -20px 40px -16px rgba(255,255,255,.22), 0 14px 40px -14px rgba(0,0,0,.85); }
@media (prefers-reduced-motion: reduce) { .pg-more-ring { animation: none; } }

/* ============================================================
   Modal: the build on the left, scrollable; the details on the right
   ============================================================ */
.lib-modal { position: fixed; inset: 0; z-index: 200; display: none; padding: 40px; }
.lib-modal.on { display: flex; }
.lib-modal .scrim {
  position: fixed; inset: 0; background: rgba(4,5,7,.74);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .4s var(--ease);
}
.lib-modal.in .scrim { opacity: 1; }
.pm-split {
  position: relative; display: flex; gap: 20px;
  width: 100%; max-width: 1560px; height: calc(100dvh - 80px); margin: auto;
  opacity: 0; transform: translateY(18px) scale(.985);
  transition: opacity .45s var(--ease), transform .55s var(--ease);
}
.lib-modal.in .pm-split { opacity: 1; transform: none; }
.pm-main, .pm-info {
  position: relative; min-width: 0; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--pg-line); border-radius: 24px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent;
}
.pm-main { flex: 1 1 0; padding: 14px; background: var(--pg-surface); }
.pm-info {
  flex: 0 0 clamp(330px, 32vw, 470px); padding: 26px 28px;
  background: var(--pg-sheen), var(--pg-aurora), var(--pg-surface);
}
.pm-stage, .piece-modal .piece-live {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: 14px; background: #0b0d10;
}
.pm-stage img, .pm-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-stage video { opacity: 0; transition: opacity .4s linear; }
.pm-stage video.on { opacity: 1; }

/* how to use it */
.pm-guide { padding: 26px 12px 12px; }
.pm-sectitle { margin: 0 0 12px; font-family: var(--display); font-weight: 500; font-size: 15px; color: var(--pg-ink); }
.pm-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pm-acc {
  border-radius: 16px; background: var(--pg-sheen), var(--pg-aurora), var(--pg-card);
  box-shadow: var(--pg-rim), inset 0 0 0 1px rgba(255,255,255,.035);
  transition: background .3s;
}
.pm-acc:hover { background: var(--pg-sheen), var(--pg-aurora), var(--pg-well); }
.pm-acc-h {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px;
  border: 0; background: none; color: var(--pg-ink); font: inherit; text-align: left; cursor: pointer;
}
.pm-num {
  --g: 255,190,162;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 28px; border-radius: 9px;
  font-family: var(--display); font-size: 12.5px; font-weight: 500; color: rgb(var(--g));
  background: radial-gradient(90% 70% at 50% 115%, rgba(var(--g),.24), transparent 72%), linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  box-shadow: var(--pg-rim), inset 0 0 0 1px rgba(255,255,255,.04);
}
.pm-acc:nth-child(3n+2) .pm-num { --g: 162,183,245; }
.pm-acc:nth-child(3n) .pm-num { --g: 212,217,228; }
.pm-acc-t { flex: 1; font-family: var(--display); font-weight: 500; font-size: 14.5px; letter-spacing: -.005em; }
.pm-mark {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px;
  color: var(--pg-ink-2); background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  box-shadow: var(--pg-rim), inset 0 0 0 1px rgba(255,255,255,.04);
}
.pm-acc:hover .pm-mark { color: var(--pg-ink); }
.pm-mark svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.pm-acc.is-open .pm-mark svg { transform: rotate(180deg); }
.pm-acc-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.pm-acc.is-open .pm-acc-b { grid-template-rows: 1fr; }
.pm-acc-in { min-height: 0; overflow: hidden; padding: 0 16px 0 62px; font-size: 13.5px; line-height: 1.6; color: var(--pg-ink-2); }
.pm-acc-in::after { content: ""; display: block; height: 15px; }
.pm-acc-in p { margin: 0; }
.pm-acc-in ul { margin: 10px 0 0; padding-left: 16px; }
.pm-acc-in li { margin-top: 6px; }
.pm-acc-in li::marker { color: var(--pg-ink-3); }
.pm-acc-in b { font-weight: 500; color: var(--pg-ink); }
.pm-acc-in code { font-family: var(--mono); font-size: 12px; color: var(--pg-ink); }

/* the ebook banner */
@property --pm-s { syntax: "<number>"; inherits: true; initial-value: 1; }
.pm-book {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center;
  gap: 10px; min-height: 290px; margin-top: 22px; padding: 28px 0 28px 28px;
  overflow: hidden; border-radius: 18px; color: var(--pg-ink); text-decoration: none;
  background:
    radial-gradient(80% 120% at 100% 55%, rgba(252,71,120,.17), transparent 62%),
    radial-gradient(70% 90% at 0% 0%, rgba(254,234,225,.06), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 0 0 1px rgba(255,255,255,.05);
}
.pm-book-eye { margin: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--pg-ink-3); }
.pm-book-h { margin: 12px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 1.9vw, 30px); line-height: 1.08; letter-spacing: -.03em; }
.pm-book-h em { display: block; font-style: normal; color: #ff7aa0; }
.pm-book-p { margin: 12px 0 0; max-width: 40ch; font-size: 13.5px; line-height: 1.55; color: var(--pg-ink-2); }
.pm-book-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 10px 18px;
  border-radius: 999px; background: #f5f5f5; color: #0a0a0a; font-size: 14px; font-weight: 500;
  transition: background .3s, color .3s, gap .3s var(--ease);
}
.pm-book-cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pm-book:hover .pm-book-cta { gap: 12px; background: var(--cursor); color: #fff; }
.pm-book-pages { position: relative; height: 240px; animation: pm-breathe 3.6s ease-in-out infinite alternate; }
@keyframes pm-breathe { from { --pm-s: .7; } to { --pm-s: 1.15; } }
.pm-book:hover .pm-book-pages { animation: none; --pm-s: 1.7; }
.pm-book-pages img {
  position: absolute; top: 50%; left: 30%; width: 124px; aspect-ratio: 1400 / 1980; object-fit: cover;
  border-radius: 4px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.07);
  transform-origin: 50% 130%;
  transform: translate(-50%, -50%) translateX(calc(var(--i) * 19px * var(--pm-s))) rotate(calc(var(--i) * 6deg * var(--pm-s)));
  transition: transform .7s var(--ease);
}
@media (prefers-reduced-motion: reduce) { .pm-book-pages { animation: none; } }

/* details */
.pm-close {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 10px; cursor: pointer; color: var(--pg-ink);
  background: rgba(255,255,255,.06); box-shadow: inset 0 1px 1px rgba(255,255,255,.08);
  transition: background .25s, transform .3s var(--ease);
}
.pm-close svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.pm-close:hover { background: rgba(255,255,255,.12); transform: rotate(90deg); }
.pm-pills { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 44px; }
.pm-pills .tier { padding: 4px 10px; font-size: 12px; }
.pm-pill {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  background: var(--pg-well); box-shadow: var(--pg-rim); font-size: 12px; color: var(--pg-ink);
}
.pm-title { margin: 16px 0 0; font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.1; letter-spacing: -.03em; color: var(--pg-ink); }
.pm-hook { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--pg-ink); }
.pm-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--pg-ink-2); }
.pm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pm-tags span {
  padding: 4px 9px; border-radius: 8px; background: var(--pg-well); box-shadow: var(--pg-rim);
  font-size: 12px; color: var(--pg-ink-2);
}
.pm-up {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding: 6px 6px 6px 20px; border-radius: 999px;
  background: var(--pg-prem); color: #121212; text-decoration: none;
  font-family: var(--display); font-size: 15px; font-weight: 500;
  box-shadow: 0 12px 32px -14px rgba(254,234,225,.5);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.pm-up[hidden] { display: none; }
.pm-up i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #121212; }
.pm-up i svg { width: 15px; height: 15px; fill: #feeae1; transition: transform .5s var(--ease); }
.pm-up:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -14px rgba(254,234,225,.65); }
.pm-up:hover i svg { transform: rotate(90deg); }
.pm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pm-up:not([hidden]) + .pm-actions { margin-top: 10px; }
.pm-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: inherit; font-family: var(--display); font-size: 14px; color: var(--pg-ink);
  background: rgba(255,255,255,.05); box-shadow: inset 0 1px 1px rgba(255,255,255,.08);
  transition: background .25s, box-shadow .25s, color .25s, opacity .25s;
}
.pm-btn::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none; opacity: .5;
  background: linear-gradient(140deg, rgba(255,255,255,.48) 0%, rgba(255,255,255,.06) 38%, rgba(255,255,255,0) 60%, rgba(255,255,255,.26) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.pm-btn--main {
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.18), inset 0 -16px 28px -16px rgba(255,190,162,.55), inset 16px 0 28px -18px rgba(162,183,245,.5);
}
.pm-btn--main::before { opacity: .7; }
.pm-btn:hover { background: rgba(255,255,255,.1); box-shadow: inset 0 1px 1px rgba(255,255,255,.16), inset 0 -12px 28px -16px rgba(255,190,162,.6); }
.pm-btn[hidden] { display: none; }
.pm-btn[disabled] { opacity: .5; cursor: default; }
.pm-btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pm-btn .pm-lk { display: none; width: 12px; height: 12px; opacity: .75; stroke: none; }
.pm-btn.is-locked { color: var(--pg-ink-2); }
.pm-btn.is-locked .pm-lk { display: block; }
.pm-minor { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pm-icon {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: var(--pg-well); box-shadow: inset 0 1px 1px rgba(255,255,255,.08);
  font: inherit; font-size: 13px; color: var(--pg-ink-2);
  transition: background .25s, color .25s;
}
.pm-icon:hover { color: var(--pg-ink); background: rgba(255,255,255,.09); }
.pm-icon[hidden] { display: none; }
.pm-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pm-icon[aria-pressed="true"] { color: var(--pg-ink); }
.pm-icon[aria-pressed="true"] svg { fill: var(--cursor); stroke: var(--cursor); }
.pm-note { margin: 16px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--pg-ink-3); }

/* phones and tablets: one scrolling sheet, build first, then details, then the guide */
@media (max-width: 1023px) {
  .lib-modal { padding: 10px; }
  .pm-split {
    flex-direction: column; gap: 0; height: calc(100dvh - 20px);
    overflow-y: auto; overscroll-behavior: contain;
    border: 1px solid var(--pg-line); border-radius: 22px; background: var(--pg-surface);
  }
  .pm-main { display: contents; }
  .pm-stage, .piece-modal .piece-live { order: 1; flex: none; border-radius: 21px 21px 0 0; }
  .pm-info { order: 2; flex: none; overflow: visible; padding: 20px 18px 6px; border: 0; border-radius: 0; box-shadow: none; background: none; }
  .pm-guide { order: 3; padding: 20px 10px 10px; }
  .pm-close { position: fixed; top: 20px; right: 20px; background: rgba(10,10,10,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .pm-pills { padding-right: 0; }
}
@media (max-width: 640px) {
  .pm-book { grid-template-columns: 1fr; padding: 22px; min-height: 0; }
  .pm-book-pages { order: -1; height: 190px; }
  .pm-book-pages img { left: 32%; width: 100px; }
  .pm-acc-in { padding-left: 16px; }
}

/* ---------- phones: the head stacks, the grid keeps two columns ---------- */
@media (max-width: 767px) {
  .pg-tabsrow { flex-direction: column; align-items: stretch; gap: 10px; }
  .pg-tabs { display: flex; }
  .pg-price { align-self: flex-start; }
  .pg-tab { height: 32px; padding: 0 12px; font-size: 13px; }
  .lcard-sub { display: none; }
  .tier { padding: 2px 6px; font-size: 10.5px; }
  .lcard-name { font-size: 13.5px; }
  .pg-more { padding: 11px 18px 11px 22px; font-size: 14px; }
}

/* ---------- the ebook sections and footer, brought down to the library's scale ---------- */
body.lib #ebook, body.lib #get-ebook { padding: clamp(56px, 6vw, 88px) var(--pg-gut); }
body.lib #ebook .section-head h2 { font-size: clamp(26px, 2.5vw, 36px); line-height: 1.08; letter-spacing: -.03em; }
body.lib #ebook .section-head > p:not(.mono) { font-size: 14px; }
body.lib #ebook .fcard { padding: 20px; }
body.lib #ebook .fcard h3 { font-size: 17px; line-height: 1.2; }
body.lib #ebook .fcard p { font-size: 13.5px; line-height: 1.5; }
body.lib #get-ebook h2 { font-size: clamp(28px, 2.9vw, 42px); line-height: 1; }
body.lib .foot h2 { font-size: clamp(36px, 4.6vw, 66px); }
