/* PrepBuddy shared: Clips (adda 10 + the Clips view on adda 00; 2026-10-26, backlog row 61, proposed; redesigned the same day
   after the owner's look: "looks like a story" — the stage now shows the clip's own content (a slide per kind), a thin top progress
   line instead of story segments, an author row, a source line and a filled action pill, the rail bottom-anchored with counts).
   The cover grid under Adda's icon row (PbClipRail) and the full-screen player (PbClipPlayer). One recipe, one file:
   the data and the grid/player markup live in clips.js. Tokens only; the stage is the media surface (--media-ink / --on-media). */

/* ---- the Clips view (adda 00): a hero tile for today's question, then a tight three-column cover grid ---- */
.cl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 359px) { .cl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 840px) { .cl-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.cl-cover { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; aspect-ratio: 9 / 16; border: 0; border-radius: 16px; overflow: hidden; padding: 36px 10px 30px; text-align: center; cursor: pointer; color: var(--on-media);
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent, var(--primary)) 70%, var(--media-ink)), color-mix(in srgb, var(--accent, var(--primary)) 22%, var(--media-ink)) 70%, var(--media-ink)); }
.cl-cover:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cl-cover .cl-kic { position: absolute; inset-inline-start: 8px; top: 8px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--media-ink) 45%, transparent); font-size: 16px; }
.cl-cover .cl-dur { position: absolute; inset-inline-end: 8px; top: 8px; font-size: calc(12px * var(--font-scale)); font-weight: 700; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--media-ink) 55%, transparent); }
.cl-cover b { font-size: calc(14px * var(--font-scale)); line-height: calc(16px * var(--font-scale)); font-weight: 800; overflow-wrap: normal; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px color-mix(in srgb, var(--media-ink) 50%, transparent); }
.cl-cover .cl-views { position: absolute; inset-inline-start: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--font-scale)); font-weight: 700; }
.cl-cover .cl-views .mi { font-size: 14px; }
.cl-cover.seen::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--media-ink) 45%, transparent); }
.cl-cover.seen .cl-seen { position: absolute; inset-inline-end: 8px; bottom: 8px; z-index: 1; font-size: 14px; }
/* the hero tile: today's question, the day's one hook, spans the grid */
.cl-hero { grid-column: 1 / -1; position: relative; display: flex; align-items: center; gap: 14px; min-height: 112px; padding: 14px 16px; border: 0; border-radius: 20px; text-align: start; cursor: pointer; color: var(--on-media); overflow: hidden;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent, var(--primary)) 85%, var(--media-ink)), color-mix(in srgb, var(--accent, var(--primary)) 35%, var(--media-ink))); }
.cl-hero:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cl-hero .cl-play { width: 56px; height: 56px; border-radius: 999px; flex: 0 0 auto; display: grid; place-items: center; background: var(--on-media); color: var(--accent, var(--primary)); font-size: 28px; }
.cl-hero .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-hero .k { font-size: calc(12px * var(--font-scale)); font-weight: 800; letter-spacing: .04em; opacity: .9; }
.cl-hero b { font-size: calc(16px * var(--font-scale)); line-height: calc(24px * var(--font-scale)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-hero .s { font-size: calc(12px * var(--font-scale)); opacity: .9; }

/* ---- the player (adda 10) ---- */
.cl-wrap { min-height: 100dvh; display: flex; align-items: stretch; justify-content: center; background: var(--media-ink); color: var(--on-media); }
.cl-stage { position: relative; width: min(100%, 430px); min-height: 100dvh; box-sizing: border-box; overflow: hidden; background: var(--media-ink); user-select: none; -webkit-user-select: none; }
@media (min-width: 600px) { .cl-stage { min-height: 0; height: min(100dvh, 820px); align-self: center; border-radius: 24px; } .cl-wrap { padding: 16px; box-sizing: border-box; align-items: center; } }
/* the frame: what the clip shows, a slide per kind (the build plays the video here; captions burn in at the bottom band) */
.cl-frame { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 20px 220px; box-sizing: border-box; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent, var(--primary)) 72%, var(--media-ink)), color-mix(in srgb, var(--accent, var(--primary)) 26%, var(--media-ink)) 60%, var(--media-ink)); }
.cl-frame::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 46%; background: linear-gradient(to top, color-mix(in srgb, var(--media-ink) 88%, transparent), transparent); pointer-events: none; }
.cl-frame::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 120px; background: linear-gradient(to bottom, color-mix(in srgb, var(--media-ink) 55%, transparent), transparent); pointer-events: none; }
.cl-slide { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 340px; }
.cl-slide .k { font-size: calc(12px * var(--font-scale)); font-weight: 800; letter-spacing: .06em; opacity: .85; }
.cl-slide h1 { margin: 0; font-size: calc(28px * var(--font-scale)); line-height: calc(32px * var(--font-scale)); font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.cl-code { width: 100%; box-sizing: border-box; margin: 0; padding: 12px 14px; border-radius: 16px; text-align: start; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: calc(12px * var(--font-scale)); line-height: calc(19px * var(--font-scale)); white-space: pre-wrap; overflow-wrap: anywhere; background: color-mix(in srgb, var(--media-ink) 55%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-media) 14%, transparent); }
.cl-code .hl { color: var(--reward); font-weight: 700; }
.cl-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-align: start; background: color-mix(in srgb, var(--media-ink) 45%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-media) 14%, transparent); }
.cl-tile .ic { width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; font-size: 24px; font-weight: 800; background: var(--on-media); color: var(--accent, var(--primary)); }
.cl-tile b { display: block; font-size: calc(16px * var(--font-scale)); }
.cl-tile span { font-size: calc(14px * var(--font-scale)); opacity: .85; }
/* the question of the day: the options sit in the frame; answering marks them and the action changes */
.cl-opts { display: grid; gap: 8px; width: 100%; box-sizing: border-box; padding-inline-end: 60px; }   /* clear of the rail on the right */
.cl-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px; text-align: start; font: inherit; font-size: calc(14px * var(--font-scale)); font-weight: 600; color: var(--on-media); cursor: pointer; background: color-mix(in srgb, var(--media-ink) 45%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-media) 22%, transparent); }
.cl-opt i { width: 24px; height: 24px; border-radius: 999px; flex: 0 0 auto; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; background: color-mix(in srgb, var(--on-media) 18%, transparent); }
.cl-opt.right { background: var(--success); box-shadow: none; }
.cl-opt.wrong { background: var(--error); box-shadow: none; }
.cl-opt[disabled] { cursor: default; }
.cl-opt:focus-visible { outline: 2px solid var(--on-media); outline-offset: 2px; }
/* captions: the subtitle band of the playing clip */
.cl-sub { position: absolute; inset-inline: 16px; bottom: 212px; z-index: 2; display: flex; justify-content: center; pointer-events: none; }
.cl-sub span { max-width: 300px; padding: 4px 10px; border-radius: 8px; font-size: calc(14px * var(--font-scale)); line-height: calc(20px * var(--font-scale)); font-weight: 600; text-align: center; background: color-mix(in srgb, var(--media-ink) 70%, transparent); }
/* the top: a thin progress line for this clip, then Back · (path) · sound · more */
.cl-bar { position: absolute; inset-inline: 0; top: 0; height: 3px; z-index: 4; background: color-mix(in srgb, var(--on-media) 25%, transparent); }
.cl-bar b { display: block; height: 100%; width: 0; background: var(--on-media); animation: cl-play var(--dur) linear forwards; }
.cl-stage.paused .cl-bar b { animation-play-state: paused; }
@keyframes cl-play { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .cl-bar b { animation: none; width: 35%; } }
.cl-top { position: absolute; inset-inline: 8px; top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 3; }
.cl-top .trail { display: flex; gap: 8px; }
.cl-top .cl-ctx { font-size: calc(14px * var(--font-scale)); font-weight: 700; opacity: .9; text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-paused { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1; pointer-events: none; }
.cl-paused span { width: 72px; height: 72px; border-radius: 999px; display: grid; place-items: center; font-size: 32px; background: color-mix(in srgb, var(--media-ink) 45%, transparent); }
.cl-burst { position: absolute; left: 50%; top: 50%; z-index: 5; font-size: 32px; color: var(--on-media); transform: translate(-50%, -50%) scale(1); opacity: 0; pointer-events: none; animation: cl-burst 500ms ease-out forwards; }
@keyframes cl-burst { 20% { opacity: 1; transform: translate(-50%, -50%) scale(3.2); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(3); } }
/* the rail: bottom-anchored, counts under the icons */
.cl-rail { position: absolute; inset-inline-end: 8px; bottom: max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; align-items: center; z-index: 3; }
.cl-rail .tbtn { width: 48px; height: 48px; }
.cl-rail .tbtn .mi { font-size: 24px; }
.cl-rail .tbtn[aria-pressed="true"] .mi { color: var(--accent, var(--primary)); }
.cl-rail .cl-n { font-size: calc(12px * var(--font-scale)); font-weight: 700; margin-top: -9px; }
/* the caption block: who, what, source, the one action */
.cl-cap { position: absolute; inset-inline-start: 16px; inset-inline-end: 72px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.cl-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.cl-who .pb-logo { width: 32px; height: 32px; border-radius: 999px; background-color: var(--on-media); background-size: 80%; }
.cl-who b { font-size: calc(14px * var(--font-scale)); display: inline-flex; align-items: center; gap: 4px; }
.cl-who b .mi { font-size: 16px; color: var(--accent, var(--primary)); }
.cl-kind { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 2px 8px; border-radius: 999px; font-size: calc(12px * var(--font-scale)); font-weight: 800; letter-spacing: .02em; background: color-mix(in srgb, var(--accent, var(--primary)) 52%, var(--media-ink)); }
.cl-kind .mi { font-size: 14px; }
.cl-cap p { margin: 0; font-size: calc(14px * var(--font-scale)); line-height: calc(19px * var(--font-scale)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-cap p.open { -webkit-line-clamp: unset; display: block; }
.cl-cap .cl-tags { font-size: calc(14px * var(--font-scale)); font-weight: 700; opacity: .9; }
.cl-src { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px 6px 8px; border: 0; border-radius: 999px; font: inherit; font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--on-media); cursor: pointer; background: color-mix(in srgb, var(--on-media) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-media) 22%, transparent); align-self: flex-start; }
.cl-src::after { content: ""; position: absolute; inset: min(0px, calc((100% - 44px) / 2)) 0; }   /* the 44 dp hit area of a 32 dp pill */
.cl-src .mi { font-size: 16px; }
.cl-src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; font: inherit; font-size: calc(14px * var(--font-scale)); font-weight: 700; color: var(--on-primary); background: var(--primary); cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--media-ink) 40%, transparent); }
.cl-cta .mi { font-size: 20px; }
.cl-cta:focus-visible { outline: 2px solid var(--on-media); outline-offset: 2px; }
.cl-up { position: absolute; inset-inline: 0; bottom: 6px; z-index: 2; text-align: center; font-size: 24px; opacity: .7; animation: cl-up 500ms ease-in-out infinite alternate; pointer-events: none; }
@keyframes cl-up { to { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .cl-up { animation: none; } }
/* the soft stop and the offline/empty covers: a card in the stage */
.cl-stop { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; box-sizing: border-box; background: color-mix(in srgb, var(--media-ink) 86%, transparent); }
.cl-stop h2 { margin: 0; font-size: calc(24px * var(--font-scale)); }
.cl-stop p { margin: 0; font-size: calc(14px * var(--font-scale)); opacity: .85; max-width: 300px; }
.cl-stop .mi[data-duo] { font-size: 32px; }
.cl-stop .cl-cta { align-self: center; margin-top: 6px; }
.cl-stop .cl-stats { display: flex; gap: 20px; margin: 6px 0; }
.cl-stop .cl-stats b { display: block; font-size: calc(24px * var(--font-scale)); }
.cl-stop .cl-stats span { font-size: calc(12px * var(--font-scale)); opacity: .8; }

/* ---- the web queue (≥1024 dp): the player centred, the coming clips beside it ---- */
.cl-queue { display: none; }
@media (min-width: 1024px) {
  .cl-wrap { gap: 24px; }
  .cl-queue { display: flex; flex-direction: column; gap: 8px; width: 320px; align-self: center; max-height: min(100dvh, 820px); overflow: auto; }
  .cl-queue h2 { margin: 0 0 4px; font-size: calc(14px * var(--font-scale)); color: var(--on-media); opacity: .8; }   /* the queue sits on the media-ink wrap */
  .cl-q { display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 16px; background: var(--surface); color: var(--text-primary); text-align: start; cursor: pointer; }
  .cl-q .th { width: 44px; height: 64px; border-radius: 12px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: var(--on-media); background: linear-gradient(170deg, color-mix(in srgb, var(--accent, var(--primary)) 55%, var(--media-ink)), var(--media-ink)); }
  .cl-q b { font-size: calc(14px * var(--font-scale)); line-height: calc(16px * var(--font-scale)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cl-q span.s { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
  .cl-q[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--primary); }
  .cl-q.seen .th { opacity: .6; }   /* a watched clip dims its cover only: the whole row at 60% took the kind and the length under 3:1 */
}

/* ---- the rail inside the For you feed (adda 00): a horizontal strip of covers between feed cards ---- */
.cl-lead { display: flex; align-items: flex-start; gap: 8px; } .cl-lead > .lead { flex: 1; min-width: 0; }   /* the Clips view's heading with New clip beside it (row 67) */
.cl-held { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: calc(12px * var(--font-scale)); font-weight: 800; background: color-mix(in srgb, var(--warning) 52%, var(--media-ink)); }
.cl-who .cht-avb { position: relative; } .cl-who .cht-avb::after { content: ""; position: absolute; inset: -6px; }   /* the 44 dp hit area of the 32 dp avatar */   /* your clip, waiting for its check */
.cl-strip .lead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.cl-strip .lead h2 { margin: 0; font-size: calc(18px * var(--font-scale)); }
.cl-strip-row { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-block-end: 4px; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
.cl-strip-row::-webkit-scrollbar { display: none; }
.cl-strip-row .cl-cover { flex: 0 0 112px; scroll-snap-align: start; }
@media (min-width: 600px) { .cl-strip-row { margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; } .cl-strip-row .cl-cover { flex-basis: 132px; } }
