/* Glow player chrome — light, warm, editorial (ShopMy/LTK register, boheme lean).
   The video is the hero; Glow's additions read as warm paper and soft gold light.

   Tokens:
     paper   #FAF6EF   page / glass fills
     linen   #F1E9DC   card fills
     sand    #E4D8C4   hairlines / borders
     ink     #2B2620   text
     fawn    #8C7A62   secondary text
     caramel #A9682F   accents, prices, links
     gold    (canvas)  the silhouette glow: warm champagne light
*/

.glow-root {
  --paper: #faf6ef;
  --linen: #f1e9dc;
  --sand: #e4d8c4;
  --ink: #2b2620;
  --fawn: #8c7a62;
  --caramel: #a9682f;
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  position: relative;
  font-family: var(--sans);
  color: var(--ink);
}

.glow-stage {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--linen); width: fit-content; max-width: 100%; margin: 0 auto;
  box-shadow: 0 1px 2px rgba(64, 50, 32, 0.08), 0 12px 40px -18px rgba(64, 50, 32, 0.25);
  /* container for proportional text: card/shelf font sizes scale with the
     player width via cqw units, so a tiny embed isn't crammed with huge text */
  container-type: inline-size;
}
/* Reasonable at any aspect: portrait phone video caps at ~2/3 viewport height
   instead of flooding the page; landscape still fills the column width. */
.glow-stage video,
.glow-stage img.glow-media {
  display: block; max-width: 100%; max-height: 66vh; width: auto; height: auto;
}
/* Still images: no transport — hide play/pause + mute (objects, glow, card
   and shelf all work exactly as on video). */
.glow-still .glow-playpause, .glow-still .glow-mute { display: none !important; }
.glow-canvas { position: absolute; inset: 0; }

/* honest loading state — the player is never a silent blank box */
.glow-loading {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center; pointer-events: none;
}
.glow-loading span {
  padding: 9px 18px; border-radius: 999px;
  background: rgba(43, 38, 32, 0.6); color: #faf6ef;
  font-family: var(--sans, -apple-system, sans-serif); font-size: 12.5px; font-weight: 500;
  animation: glow-loading-pulse 1.6s ease-in-out infinite;
  max-width: 80%; text-align: center; line-height: 1.4;
}
@keyframes glow-loading-pulse { 50% { opacity: 0.55; } }
.glow-loading-hidden { display: none; }

/* --- pill: quiet linen tab; an assist, not a gate ----------------------- */

.glow-ctrls {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 7px;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.glow-ctrls.visible { opacity: 1; transform: none; pointer-events: auto; }

/* Glow toggle (was the tag pill): a round glass button matching the others.
   Dims when glow is OFF; the state name flashes in the toast on each tap. */
.glow-pill {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%;
  background: rgba(250, 246, 239, 0.82); color: var(--ink);
  backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 2px 10px rgba(64, 50, 32, 0.16); cursor: pointer;
  transition: color 0.15s ease, opacity 0.2s ease, transform 0.06s ease;
}
.glow-pill:hover { color: var(--caramel); }
.glow-pill:active { transform: scale(0.94); }
.glow-btn-off { opacity: 0.5; }
.glow-btn-off:hover { opacity: 0.8; }

/* Play/pause: same glass round button, sits just left of the volume button. */
.glow-playpause {
  position: absolute; right: 54px; bottom: 12px; z-index: 6;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%;
  background: rgba(250, 246, 239, 0.82); color: var(--ink);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(64, 50, 32, 0.16); cursor: pointer;
  transition: color 0.15s ease, transform 0.06s ease;
}
.glow-playpause:hover { color: var(--caramel); }
.glow-playpause:active { transform: scale(0.94); }

/* Quick semi-opaque label pill for glow-state changes (Glow On / Off / Default). */
/* Glow-state label: an elegant dark pill floating just ABOVE the glow button
   (bottom-left), with a little pointer down to it. Fades on its own. */
.glow-toast {
  position: absolute; left: 12px; bottom: 56px;
  padding: 6px 13px; border-radius: 999px; white-space: nowrap;
  background: rgba(28, 23, 18, 0.82); color: #fff8ef;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translateY(6px); pointer-events: none; z-index: 9;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.glow-toast::after { /* pointer down toward the glow button */
  content: ""; position: absolute; left: 15px; bottom: -5px;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 5px solid rgba(28, 23, 18, 0.82);
}
.glow-toast-show { opacity: 1; transform: translateY(0); transition: opacity 0.12s ease, transform 0.12s ease; }
/* when chips sit bottom-left, the controls (glow button) move bottom-right —
   follow the toast to that side too */
.glow-pill-right ~ .glow-toast, .glow-root:has(.glow-pill-right) .glow-toast {
  left: auto; right: 12px;
}
.glow-root:has(.glow-pill-right) .glow-toast::after { left: auto; right: 15px; }

/* --- product card: warm paper, serif title ------------------------------- */

/* Product card = a BOTTOM SHEET (above the controls), so it never covers the
   subject's face. Slides up from the bottom; full width minus small margins. */
.glow-card {
  position: absolute; left: 8px; right: 8px; bottom: 54px;
  max-height: calc(100% - 66px);
  border-radius: var(--radius); overflow: hidden;
  background: var(--paper); border: 1px solid var(--sand);
  box-shadow: 0 16px 44px -14px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(14px); pointer-events: none; z-index: 12;
  transition: opacity 0.24s ease, transform 0.24s ease;
  display: flex; flex-direction: column;
}
.glow-card.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.glow-card-img { width: 100%; height: clamp(88px, 34cqw, 140px); object-fit: cover; display: block; flex: none; }
.glow-card-body { padding: 13px 15px 15px; min-height: 0; overflow: hidden; }
.glow-card-title {
  font-family: var(--serif); font-size: clamp(12px, 6cqw, 15.5px); font-weight: 600;
  line-height: 1.3; letter-spacing: 0.005em;
  /* clamp long titles to 2 lines instead of overflowing the frame */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.glow-card-price { margin-top: 4px; font-size: clamp(10px, 5cqw, 13px); color: var(--caramel); font-weight: 700; }
/* "Shop this" — taller + custom: warm-dark gradient, gold rim glow, inset
   highlight, and an arrow. The distinctive CTA of the whole card. */
.glow-card-cta {
  display: flex; align-items: center; justify-content: center;
  margin-top: 12px; min-height: clamp(40px, 17cqw, 52px); padding: 0 14px;
  border-radius: 12px; letter-spacing: 0.02em; text-decoration: none;
  background: linear-gradient(180deg, #3a332b 0%, var(--ink) 100%);
  color: var(--paper); font-size: clamp(12px, 5.2cqw, 14px); font-weight: 700;
  box-shadow: 0 5px 16px -5px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12),
              0 0 0 1px rgba(232, 176, 75, 0.35);
  transition: transform 0.06s ease, box-shadow 0.16s ease;
}
.glow-card-cta::after { content: "  →"; opacity: 0.8; }
.glow-card-cta:hover {
  box-shadow: 0 7px 22px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16),
              0 0 0 1px rgba(232, 176, 75, 0.6);
}
.glow-card-cta:active { transform: translateY(1px); }
.glow-card-cta:focus-visible, .glow-pill:focus-visible, .glow-shelf-toggle:focus-visible {
  outline: 2px solid var(--caramel); outline-offset: 2px;
}
.glow-card-close {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border: none; border-radius: 50%; background: rgba(250, 246, 239, 0.92);
  color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(64, 50, 32, 0.25);
}

/* --- in-stage icon buttons (lines toggle, shelf) ---------------------------- */

.glow-iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%;
  background: rgba(250, 246, 239, 0.82); color: var(--ink);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(64, 50, 32, 0.16); cursor: pointer;
  transition: color 0.15s ease, box-shadow 0.15s ease;
}
.glow-iconbtn:hover { color: var(--caramel); }

/* Audio: a small round unmute button pinned bottom-right of the stage. SAME
   glass register + hover as the other in-player controls (.glow-iconbtn) — the
   muted/unmuted state reads from the icon, not a different color. */
.glow-mute {
  position: absolute; right: 12px; bottom: 12px; z-index: 6;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%;
  background: rgba(250, 246, 239, 0.82); color: var(--ink);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(64, 50, 32, 0.16); cursor: pointer;
  transition: color 0.15s ease, transform 0.06s ease;
}
.glow-mute:hover { color: var(--caramel); }
.glow-mute:active { transform: scale(0.94); }
.glow-mute-hidden { display: none; }

/* --- seek bar: TikTok-register scrub line on the video's bottom edge -------- */
.glow-seek {
  position: absolute; left: 0; right: 0; bottom: 0; height: 18px; z-index: 5;
  display: flex; align-items: flex-end; cursor: pointer; touch-action: none;
}
.glow-seek-line {
  width: 100%; height: 3px; background: rgba(246, 239, 228, 0.28);
  transition: height 0.12s ease;
}
.glow-seek-fill { height: 100%; width: 0; background: #e8c98a; }
.glow-seek-active .glow-seek-line, .glow-seek:hover .glow-seek-line { height: 6px; }

/* --- session shelf: a sheet INSIDE the stage (self-contained for embeds) ----- */

.glow-shelf {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6;
  /* Cap the width and centre it. Spanning the full stage is right on a portrait
     video, where the stage IS narrow, but on a landscape one it produced a
     sheet wider than anything it contained: a 48px thumbnail, a title and a
     small button stretched across 600px of glass. With both left and right set,
     an auto inline margin centres the over-constrained box. Portrait stages are
     narrower than the cap, so this is a no-op there. */
  max-width: 420px; margin-inline: auto;
  max-height: 62%; overflow: hidden; border-radius: 14px;
  background: rgba(250, 246, 239, 0.96); border: 1px solid var(--sand);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -6px 30px rgba(64, 50, 32, 0.25);
  /* closed = GONE, not slid down: in the staged feed the shelf anchors to the
     video's bottom edge, and a landscape video leaves a letterbox gap taller
     than the shelf — a translate-only hide parked the "closed" sheet fully
     visible in that gap. visibility guarantees invisible at any geometry. */
  opacity: 0; visibility: hidden; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
  display: flex; flex-direction: column;
  /* the shelf is its OWN width container: the narrow-shelf graceful-hide rule
     below measures the shelf, not the stage, so it works identically in the
     studio, the scroll feed (which drops stage containment) and embeds */
  container-type: inline-size;
}
.glow-shelf.open {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.glow-shelf-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px 6px; flex: none;
  /* FIXED sizes throughout the shelf (no cqw): the popup must render
     identically in the studio preview, the public scroll view and embeds —
     container-relative units made the feed's version slim and cramped. */
  font-family: var(--serif); font-size: 14.5px; font-weight: 700; color: var(--ink);
  /* embeds wrap the player in line-height:0 (kills inline gaps); without an
     own line-height the title span is a 0-height box and its overflow:hidden
     clips the text invisible */
  line-height: 1.3;
}
/* never wrap the header — on a narrow shelf it collided with the × ("Sidejoin this") */
.glow-shelf-head span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.glow-shelf-close {
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: rgba(43, 38, 32, 0.07); color: var(--ink);
  font-size: 15px; line-height: 1; cursor: pointer;
}
/* the list scrolls INSIDE the shelf (never the page): contain the chain and
   keep the scrollbar quiet so rows, thumbs and buttons stay cleanly aligned */
.glow-shelf ul {
  overflow-y: auto; overflow-x: hidden; padding: 0 10px 10px;
  min-height: 0; overscroll-behavior: contain; scrollbar-width: thin;
}
.glow-shelf ul::-webkit-scrollbar { width: 5px; }
.glow-shelf ul::-webkit-scrollbar-thumb { background: rgba(43, 38, 32, 0.2); border-radius: 999px; }
/* cap the visible list at ~2 rows; a 3rd+ scrolls inside (never the page) */
.glow-shelf-list { list-style: none; margin: 0; display: grid; gap: 8px; max-height: 148px; }
/* Only at a truly tiny width does the GLOW toggle collapse (it goes first). The
   bag/play/volume always stay; the card + object taps always work. */
.glow-compact .glow-pill,
.glow-compact .glow-stack { display: none !important; }

/* [thumb][meta][Shop] — three columns, all vertically centered. Shop is its
   OWN right column (not in the text row), so it's centered against the whole
   row and never cramped. Text NEVER wraps/overflows — the title ellipsizes,
   and on a cramped-narrow player the whole meta column hides (see @container),
   gracefully leaving just the picture + Shop button. */
.glow-shelf-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--sand); border-radius: 12px;
  background: rgba(241, 233, 220, 0.45); min-width: 0;
}
.glow-shelf-item img, .glow-shelf-thumbstub {
  width: 48px; height: 48px;
  flex: none; object-fit: cover; border-radius: 9px; border: 1px solid var(--sand);
}
.glow-shelf-meta { flex: 1; min-width: 0; overflow: hidden; }
/* text scales with the player width (cqw), clamped so it's never tiny or huge */
.glow-shelf-title {
  font-family: var(--serif); font-size: 14.5px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* one clean line, never overflows */
}
.glow-shelf-row {
  display: flex; align-items: center; gap: 8px; margin-top: 3px;
  flex-wrap: nowrap; overflow: hidden; /* never wrap or spill */
}
.glow-shelf-price { font-size: 12.5px; color: var(--caramel); font-weight: 700; flex: none; }
.glow-shelf-seek {
  border: none; background: none; padding: 0; min-width: 0;
  font-family: var(--sans); font-size: 12px; color: var(--fawn);
  cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.glow-shelf-seek:hover { color: var(--caramel); }
.glow-shelf-shop {
  flex: none; /* its own right-side column now — align-items:center on the item vertically centers it */
  padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background 0.15s ease;
}
.glow-shelf-shop:hover { background: #4a4237; }
/* Cramped-narrow SHELF: drop the text column entirely, keep picture + a
   full-size Shop button. We hide gracefully BEFORE anything can cram,
   truncate to nonsense ("Rasp… $8.99 a.") or overflow. */
@container (max-width: 260px) {
  .glow-shelf-meta { display: none; }
  .glow-shelf-shop { margin-left: auto; }
}

/* --- in-frame stack: what's clickable right now, color-keyed --------------- */

.glow-stack {
  position: absolute; right: 14px; bottom: 14px; width: min(220px, 62%);
  max-height: calc(100% - 28px); overflow-y: auto;  /* many products can't overflow the frame */
  display: none; flex-direction: column; gap: 4px; padding: 8px;
  border-radius: 14px; background: rgba(250, 246, 239, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 6px 24px rgba(64, 50, 32, 0.22);
}
.glow-stack.open { display: flex; }

.glow-stack-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border: none; border-radius: 9px; background: transparent;
  font-family: var(--sans); font-size: 12.5px; color: var(--ink);
  cursor: pointer; text-align: left; width: 100%;
  transition: background 0.12s ease;
}
.glow-stack-item:hover { background: rgba(43, 38, 32, 0.06); }
.glow-stack-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  box-shadow: 0 0 6px currentColor;
}
.glow-stack-title {
  flex: 1; min-width: 0; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.glow-stack-price { color: var(--caramel); font-weight: 700; flex: none; }

/* --- monogram fallback (no product image scraped) --------------------------- */

.glow-monogram {
  display: grid; place-items: center; height: 124px;
  font-family: var(--serif); font-size: 44px; font-weight: 700;
}
/* sized by the shared .glow-shelf-item rule above — a stub row must be the
   same height as an image row or the list jumps when images resolve */
.glow-shelf-thumbstub { border: 1px solid; }
.glow-shelf-nomoment { font-size: 12px; color: var(--fawn); font-style: italic; }

/* --- configurable corners (chips + card share a corner; pill sits opposite) --- */

.glow-at-br { top: auto; bottom: 14px; left: auto; right: 14px; }
.glow-at-bl { top: auto; bottom: 14px; right: auto; left: 14px; }
.glow-at-tr { bottom: auto; top: 14px; left: auto; right: 14px; }
.glow-at-tl { bottom: auto; top: 14px; right: auto; left: 14px; }

.glow-ctrls.glow-pill-left { left: 14px; right: auto; }
.glow-ctrls.glow-pill-right { left: auto; right: 14px; }

/* free-tier credit on embeds — quiet, bottom-left, above the gradient */
.glow-credit {
  position: absolute; left: 10px; bottom: 8px; z-index: 6;
  font: 600 10.5px/1 -apple-system, "SF Pro Text", sans-serif;
  letter-spacing: 0.04em; color: rgba(245, 239, 227, 0.85);
  background: rgba(20, 16, 12, 0.45); border-radius: 999px;
  padding: 5px 9px; text-decoration: none; backdrop-filter: blur(4px);
}
.glow-credit:hover { color: #ffe9c2; }

/* Davis 2026-07-19: the auto-appearing corner chip popups are RETIRED — the
   shelf (bag) is the one product surface besides the objects themselves.
   Kept in the DOM so player logic is untouched; simply never shown. */
.glow-root .glow-stack { display: none !important; }

/* Affiliate disclosure. Deliberately quiet but never hidden: the FTC standard is
   "clear and conspicuous", and Amazon's Associates terms make it a condition of
   the programme. Sits above the shelf list so it is read before a click, not
   after. Never truncated — if space is tight the SHELF scrolls, not this. */
.glow-disclosure {
  list-style: none;
  font-size: 11px;
  line-height: 1.4;
  color: #6b6154;
  opacity: .85;
  /* Aligned with the shelf heading above it. It sits between the head
     (padding-inline 14px) and the list (10px), and had 2px, so the one line of
     small print started further left than every other thing in the panel. */
  padding: 0 14px 8px;
  margin: 0;
}
