/* ==========================================================================
   app.css — Community UX/UI, one component set
   --------------------------------------------------------------------------
   Sections 1-6 and 15 are the home prototype's chrome, carried over so these
   screens sit inside the product that already exists rather than beside it.
   Where a rule is identical to demos/home-series-rails/css/components.css it
   says so and is not re-explained; where it differs, the difference is the
   comment.

   Sections 7-14 are the new components. There are six of them and every
   screen is built from those six plus the chrome. See source.md §4.
   ========================================================================== */


/* ==========================================================================
   1. APP BAR — carried over from the home prototype, unchanged
   --------------------------------------------------------------------------
   NOTHING WAS ADDED TO THE NAV. There was a SHELVES item here for a while
   and it is gone: a feature that has to be reached from the masthead is a
   feature that has not earned a place in the page. Shelves are found the
   way everything else on this service is found — on a rail — and the ones a
   member keeps are on their profile, behind the avatar that is already
   there. The only change to the bar is that the avatar is now a link.
   ========================================================================== */

.app-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 960px;
  padding: var(--space-2xl) var(--frame-gutter);
  background-color: transparent;
  background-image: linear-gradient(to bottom,
              rgba(10, 10, 12, 0.62) 0%,
              rgba(10, 10, 12, 0.34) 42%,
              rgba(10, 10, 12, 0.10) 74%,
              rgba(10, 10, 12, 0) 100%);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* Scrolled: frosted glass rather than a black slab, so the page keeps
   showing through it.

   The HOME screen earns this on scroll, exactly as the home prototype
   does — it has a 16:9 hero for the gradient above to sit on. Every other
   screen here has no hero, so the gradient would be a dark smear over the
   page ground; js/app.js puts .is-stuck on those from the start. */
.app-bar.is-stuck {
  background-color: rgba(18, 18, 18, 0.58);
  background-image: none;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  text-shadow: none;
}

.app-bar__menu {
  display: flex;
  align-items: center;
  gap: var(--menu-gap);
}

.brand-logo {
  display: flex;
  align-items: center;
  width: 120px;
  height: var(--avatar-s);
  color: var(--color-primary);
  font-size: var(--wordmark-size);
  font-weight: 800;
  letter-spacing: var(--wordmark-tracking);
  line-height: 1;
  white-space: nowrap;
}

.brand-logo--footer { justify-content: center; }

.brand-logo__mark {
  width: 100%;
  height: auto;
  display: block;
}

.app-bar__links {
  display: flex;
  align-items: center;
  gap: var(--space-5xl);
}

.app-bar__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  color: var(--color-on-surface);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  white-space: nowrap;
}

.app-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-s);
  height: var(--avatar-s);
  border-radius: var(--radius-full);
  /* The member's own colour, falling back to the muted primary for an
     avatar drawn with no member behind it. See §8, "The six". */
  background: var(--tone, var(--color-primary-muted));
  color: var(--color-on-surface);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
  text-shadow: none;
}

/* THE BUBBLE GOES NOWHERE. It is the handle the account menu hangs off and
   nothing else — a control that both opens a menu and navigates makes the
   menu something you find by failing to click where you meant to. It is a
   <button>, so it is focusable and the menu opens on focus; every
   destination is a row inside it. */
button.avatar {
  cursor: pointer;
  transition: box-shadow var(--dur-ring) ease;
  font-family: inherit;
}

button.avatar:hover,
button.avatar:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-ring-hover);
  outline: none;
}


/* ---- The account menu ---------------------------------------------------
   Hangs off the bubble, opens on hover and on keyboard focus — :focus-within
   matters, or the menu would exist only for pointer users.

   The hit area runs the full gap between the avatar and the panel (the
   ::after below) so the pointer can travel down to the menu without passing
   over the page and closing it. A 10px gap is a 10px hole otherwise.
   -------------------------------------------------------------------------- */

.account-menu { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  min-width: 268px;
  padding: var(--space-s) 0;
  border-radius: var(--radius-s);
  border: 1px solid var(--color-white-20);
  background: color-mix(in srgb, var(--color-background) 94%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  text-shadow: none;
  transition: opacity var(--dur-ring) var(--ease-standard),
              transform var(--dur-ring) var(--ease-standard);
}

/* Bridges the gap so travelling from the bubble to the menu never leaves
   the hover. */
.menu::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.account-menu:hover .menu,
.account-menu:focus-within .menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.menu__row {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-s) var(--space-l);
  min-height: 44px;
  color: var(--color-on-surface);
  font-size: var(--type-body-m-size);
  transition: background var(--dur-ring) ease;
}

.menu__row:hover,
.menu__row:focus-visible { background: var(--color-surface); outline: none; }

.menu__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: var(--tone, var(--color-surface-variant));
  color: var(--color-on-surface);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
}

.menu__glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex: 0 0 auto;
  color: var(--color-on-surface-variant);
}

.menu__label { min-width: 0; }

.menu__rule {
  height: 1px;
  margin: var(--space-s) 0;
  background: var(--color-white-20);
}

.menu__row--out .menu__label { color: var(--color-on-surface-variant); }

@media (prefers-reduced-motion: reduce) {
  .menu { transition: none; }
}


/* ==========================================================================
   2. BUTTONS — carried over, plus one
   ========================================================================== */

.button-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-m);
  padding: var(--space-s) var(--space-xl);
  border-radius: var(--radius-s);
  background: var(--accent-action);
  color: var(--color-on-primary);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  white-space: nowrap;
  cursor: pointer;
  transition: opacity var(--dur-ring) ease;
}

.button-primary:hover,
.button-primary:focus-visible { opacity: 0.88; outline: none; }

/* The ghost. ONE primary action per view (the companion's rule, kept), so
   every other action on a screen is this: the same box, drawn rather than
   filled. The familiar, zero-risk option does not need selling. */
.button-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-m);
  padding: var(--space-s) var(--space-xl);
  border: 1px solid var(--color-primary-30);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-on-surface);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-ring) ease, background var(--dur-ring) ease;
}

.button-ghost:hover,
.button-ghost:focus-visible {
  border-color: var(--accent-ring-hover);
  background: var(--color-white-5);
  outline: none;
}

.button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-primary-30);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--dur-ring) ease;
}

.button-icon:hover,
.button-icon:focus-visible { border-color: var(--accent-ring-hover); outline: none; }

/* The same button, filled. One primary action per view is the rule, and in
   the hover panel that action is Play — so it takes the accent and the dark
   ink the hero's Play button takes, in the round shape the panel's row of
   actions is in. */
.button-icon--accent {
  background: var(--accent-action);
  border-color: transparent;
  color: var(--color-on-primary);
  transition: opacity var(--dur-ring) ease;
}

.button-icon--accent:hover,
.button-icon--accent:focus-visible { opacity: 0.88; border-color: transparent; }

.button-primary .icon,
.button-ghost .icon { width: var(--icon-xs); height: var(--icon-xs); }


/* ==========================================================================
   3. HERO — the home prototype's geometry, none of its show reel
   --------------------------------------------------------------------------
   THREE NUMBERS, transcribed unchanged from demos/home-series-rails and all
   a share of the viewport width so the hero stays full bleed and
   proportional at any size:

     plate    56.250vw   the 16:9 media itself         (810px at 1440)
     visible  39.444vw   the hero's own box, 568/1440  (568px at 1440)
     overlap  16.806vw   plate minus visible           (242px at 1440)

   The plate is absolutely positioned inside a SHORTER .hero box, so it
   bleeds past the bottom and the first rail sits over it; a bottom gradient
   dissolves it into the page. That overlap is the single thing that makes
   this read as the Apollo home page rather than as a banner with rows
   under it, which is why it is the part that was kept.

   WHAT IS NOT HERE, on the brief: the carousel and its pagination, the
   auto-advance, the Ken Burns drift, the trailer and its mute control, the
   cinema drop, the scroll-driven recede, and the three separate transform
   layers that existed to keep those from fighting each other. With one
   still there is nothing to keep apart.

   ONE DEVIATION. The home prototype's scrims are built from rgba(18,18,18)
   — a Streamit-era grey that survives into its BritBox build. Over this
   navy ground that grey reads warm and muddy where it meets the page, so
   the scrims here are mixed from --color-background instead. It is the one
   value on this screen that is not what the other prototype ships.
   ========================================================================== */

.hero {
  --hero-plate:   56.25vw;
  --hero-visible: 39.444vw;
  --hero-overlap: 16.806vw;

  position: relative;
  z-index: 0;
  height: var(--hero-visible);

  /* THE RECEDE, carried over from demos/home-series-rails/css/hero.css.
     Driven by js/app.js on scroll: the hero dims away as it leaves rather
     than simply scrolling off, so the first rail arrives over a ground
     instead of over a picture sliding out from under it. Two properties
     and both of them are written by the same handler, so nothing here is
     owned by two systems. */
  opacity: var(--hero-opacity, 1);
  /* The plate overflows downward on purpose — do not clip it here. */
}

/* THE MEDIA IS THE ONLY THING THAT PARALLAXES. The scrims and the action
   panel are its siblings inside the stage, so they stay anchored —
   parallaxing the stage instead would drift the lockup and the buttons
   down into the first rail. Same split, same reason, as .hero__reel in the
   home prototype. */
.hero__media { transform: translate3d(0, var(--hero-parallax, 0px), 0); }

.hero__stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-background);
}

.hero__media { position: absolute; inset: 0; }

/* The marker js/app.js watches to decide when the app bar stops being a
   gradient over artwork and becomes frosted glass over the page. A third
   of the way down the hero's visible box — far enough that the bar is
   still over the picture while the picture is still the subject. */
.scroll-trip {
  position: absolute;
  top: 33%;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero__scrim--bottom {
  background: linear-gradient(to top,
    var(--color-background) 0%,
    rgba(0, 16, 21, 0.72) 18%,
    rgba(0, 16, 21, 0.15) 42%,
    rgba(0, 16, 21, 0) 58%);
}

.hero__scrim--left {
  background: linear-gradient(to right,
    rgba(0, 16, 21, 0.88) 0%,
    rgba(0, 16, 21, 0.55) 26%,
    rgba(0, 16, 21, 0.12) 48%,
    rgba(0, 16, 21, 0) 66%);
}

.hero__action {
  position: absolute;
  left: 0;
  bottom: calc(var(--hero-overlap) + var(--space-3xl));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-m);
  /* A max, not a width: at 960 this box would otherwise be wider
     than the column it sits in. */
  width: min(calc(535px + var(--frame-gutter)), 62%);
  padding-left: var(--frame-gutter);
}

/* SHORTER, FOR A PAGE WHOSE CONTENT STARTS UNDER IT. The home page's
   billboard is 39.4vw of visible box because the rail that follows it is
   allowed to be a tease. A collection page is a grid of posters and the
   grid is the page, so the hero gives 9.4vw back — at 1280 that is 120px,
   which is most of a poster's top edge. Same component, same geometry,
   one number. */
/* ---- A CONTAINED HERO, which is what a collection gets ----------------
   The home page's billboard is full-bleed and starts under the app bar,
   because it is the top of the product. A collection is a page you
   arrived at from somewhere, so its hero is a CARD: inset at the frame
   gutter, cornered like every other surface in this set, sitting under
   the back control rather than behind it. That is the Apple TV
   arrangement, and it is also what stops a 16:9 plate eating the whole
   window on the way to the titles.

   The height is capped rather than left to the aspect ratio. 1152 wide
   at 16:9 is 648 tall, which with the 180 of clearance above it leaves
   nothing of the page; `max-height` lets the picture crop instead, which
   is what `object-fit: cover` on the media is already doing. */
/* IT HAS TO END WHERE THE GRID ENDS. The card was the full frame less
   its gutters — 1312 at 1440 — while the covers under it sit in the
   shell's 1208 content column, so the billboard overhung the grid by
   104px on the right and the page had two right edges. Invisible while
   the ground was a soft blurred field; impossible to miss the moment it
   became a photograph with a hard edge. Capped to the shell's own
   content width and left-aligned to the same gutter, so there is one
   column on this page. Below ~1336 the cap is not reached and nothing
   changes. */
.hero--contained {
  position: relative;
  height: auto;
  max-width: 1208px;
  margin: var(--back-clear) auto var(--space-4xl) var(--frame-gutter);
  border-radius: var(--radius-s);
  overflow: hidden;
  box-shadow: var(--shadow-tile);
}

/* THE SAME HAIRLINE EVERY CARD ON THE PAGE HAS. The billboard had a
   shadow and no outline, which on a near-black ground is almost nothing:
   a shadow under a dark photograph reads as more dark, so the card's
   edges dissolved into the page and the picture looked like it was
   bleeding rather than sitting in a container. The covers beneath it
   have carried `--card-outline` at white@20 since the first round — this
   is that, on the same inset-pseudo-element pattern as
   `.card-shelf::after`, so the two cannot drift apart.

   Above the scrims and below nothing: `pointer-events: none` keeps it
   out of the way of the buttons centred underneath it. */
.hero--contained::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border: 1px solid var(--card-outline);
  border-radius: var(--radius-s);
}

.hero--contained .hero__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 46vh;
  overflow: hidden;
}

/* NO PARALLAX IN A BOX. The full-bleed hero can drift its media because
   the plate behind it is 56.25vw against a 39.4vw window — there is
   always more picture to show. In a contained hero the media exactly
   fills the card, so moving it opens a gap at the bottom edge. */
.hero--contained .hero__media { transform: none; }

.hero--contained .hero__action {
  bottom: var(--space-4xl);
  width: min(calc(535px + var(--space-4xl)), 62%);
  padding-left: var(--space-4xl);
}

.hero--contained .hero__name { min-height: 0; font-size: var(--type-heading-hero-contained-size); }

/* THE CLEARANCE BELONGS TO WHATEVER IS FIRST, and on this page the hero
   is. `.head` carries `--back-clear` so that it clears the app bar and
   the back control; under a hero it was adding all 180 of it again,
   which put a screenful of nothing between the billboard and the byline
   under it. */
.hero + .shell .head { padding-top: var(--space-s); }

/* ---- CENTRED, which is what a collection's hero is ---------------------
   The home page's billboard is left-aligned against right-aligned key
   art: the artwork leaves a column clear and the type fills it. A
   collection has no single subject to align against — its ground is an
   even, blurred field — so the composition has nothing to hang off and
   centring is the honest answer rather than a style.

   Three things and no more: the name, the tags, and the two things you
   can do with a collection. */
/* Centred on both axes, so it is actually in the middle of the card
   rather than sitting where a bottom-anchored panel happens to land. */
.hero--centred .hero__action {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: auto;
  align-items: center;
  justify-content: center;
  gap: var(--space-l);
  padding: 0 var(--frame-gutter);
  text-align: center;
}

.hero--centred .hero__name {
  max-width: 100%;
  min-height: 0;
  justify-content: center;
}

/* THE META IS TAGS HERE, not a dot-divided line. A centred row of
   dot-separated words reads as a sentence that has lost its verbs; the
   same facts as pills read as labels, which is what they are. */
.hero__meta--tags {
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-s);
}

.hero__meta--tags .dot-divider { display: none; }

.hero__meta--tags > span {
  padding: 5px var(--space-m);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-full);
  background: rgba(0, 16, 21, 0.4);
  color: var(--color-on-surface);
  font-size: var(--type-body-s-size);
  line-height: 20px;
}

.hero--centred .hero__buttons { justify-content: center; }

/* Nothing to light from the left when the type is in the middle. */
.hero--centred .hero__scrim--left { display: none; }

/* ---- THE CENTRE WASH, which real photography made necessary ----------
   The ground under this hero used to be a blurred composite of the
   collection's own covers — an even, soft field with no subject, which
   type sat on perfectly well with no scrim at all. It is a real
   production still now, and a centred name laid straight over faces is
   unreadable at the top and illegible at the bottom.

   Two gradients doing two jobs. The radial pools light-removal exactly
   where the lockup is and fades out well before the card's edges, so
   the photograph is still a photograph in all four corners. The linear
   takes a little off the whole frame, which is what stops the pool
   reading as a vignette pasted on top. Neither is heavy: 0.62 at the
   centre is enough for 40px semi-bold over a lit face, and the tags
   carry their own pill backgrounds for the smaller type.

   IT IS A 3:1 BILLBOARD NOW, so the pool is wider than it is tall — a
   circular one on a 3:1 card darkens the sky and the floor and leaves
   the sides alone, which is the opposite of what the type needs. */
.hero--centred .hero__scrim--centre {
  background:
    radial-gradient(62% 86% at 50% 50%,
      rgba(0, 16, 21, 0.62) 0%,
      rgba(0, 16, 21, 0.50) 38%,
      rgba(0, 16, 21, 0.22) 66%,
      rgba(0, 16, 21, 0.00) 88%),
    linear-gradient(to bottom,
      rgba(0, 16, 21, 0.26) 0%,
      rgba(0, 16, 21, 0.14) 50%,
      rgba(0, 16, 21, 0.30) 100%);
}

/* ---- A COLLECTION'S BILLBOARD IS 3:1, NOT 16:9 -----------------------
   THE RIGHT SHAPE IS THE ONE THE ARTWORK IS. The contained hero was
   16:9 because that is what the generated composites were; the real
   library art is 1920x640. Forcing 3:1 photography through a 16:9 box
   with `object-fit: cover` crops 41% of its width away, and these
   images are composed with their subject off to one side — so the crop
   took the faces out and left the landscape, which is the same
   wrong-cut error this prototype has made before.

   Used at its own ratio there is no crop at all. It is also 100px
   shorter at this width, which puts the first row of covers that much
   further up the page — the thing that has been asked for twice. */
/* AND IT BARELY NEEDS A BOTTOM SCRIM. That gradient exists to seat a
   lockup anchored to the bottom edge; a centred hero has nothing down
   there, and at 3:1 the same ramp covers a third of the card and reads
   as a letterbox bar across the photograph. Enough to settle the lower
   edge of the card and no more — the centre wash is what the type is
   sitting on. */
.hero--contained.hero--centred .hero__scrim--bottom {
  background: linear-gradient(to top,
    rgba(0, 16, 21, 0.55) 0%,
    rgba(0, 16, 21, 0.24) 12%,
    rgba(0, 16, 21, 0.00) 30%);
}

/* 2.5:1, AND THE RATIO IS A BALANCE OF TWO THINGS THAT PULL APART.
   3:1 was the artwork's own shape and it made a billboard that read as
   a strip: 378px of a 900px window, with half the page below it empty
   before the covers started. 16:9, which it was before that, is 680 at
   this width — the covers are then entirely below the fold and the page
   opens as a picture with nothing else on it.

   2.5:1 is 483 here. It fills the top of the page properly and still
   leaves about two thirds of the first row of covers showing at 900,
   which is the thing that must not be given up: you should be able to
   see that this page is a list of programmes without scrolling to find
   out.

   The art is 3:1, so this crops ~17% of its width — centred, and these
   images carry their subject off to one side with room around it, so
   what goes is edge, not faces. Checked on all three. */
.hero--contained.hero--centred .hero__stage {
  aspect-ratio: 2.5 / 1;
  /* The cap is what protects the covers on a short window: below about
     1000px of height it takes over from the ratio and the billboard
     stops growing. */
  max-height: 54vh;
}

/* The ground to fade into is the card's own bottom edge, not a page. */
.hero--contained .hero__scrim--bottom {
  background: linear-gradient(to top,
    rgba(0, 16, 21, 0.92) 0%,
    rgba(0, 16, 21, 0.55) 26%,
    rgba(0, 16, 21, 0.10) 48%,
    rgba(0, 16, 21, 0) 64%);
}

/* A collection has no title treatment and never will — the lockups in the
   asset library are per programme — so the name is set as type in the
   lockup's slot, at the lockup's height, so the meta and the buttons
   under it sit in the same place either way. */
.hero__name {
  display: flex;
  align-items: flex-end;
  max-width: 720px;
  min-height: 108px;
  margin: 0;
  color: var(--color-on-surface);
  font-size: var(--type-heading-xl-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.1;
}

/* A COLLECTION'S PLATE HAS SUBJECTS ACROSS ITS WHOLE WIDTH, where a
   programme's right-aligned hero art leaves its left third clear. The
   home page's left scrim is tuned for the second case, so on a plate it
   let the synopsis sit on a face. Deeper and further across, on the
   heroes whose artwork is a composite. */
.hero--plate .hero__scrim--left {
  background: linear-gradient(to right,
    rgba(0, 16, 21, 0.96) 0%,
    rgba(0, 16, 21, 0.92) 30%,
    rgba(0, 16, 21, 0.70) 46%,
    rgba(0, 16, 21, 0.20) 62%,
    rgba(0, 16, 21, 0.00) 78%);
}

.hero__logo { width: 326px; height: 108px; margin: 0; }

.hero__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  color: var(--color-white-80);
  font-size: var(--type-body-m-size);
  white-space: nowrap;
}

/* The synopsis, at the home prototype's own width. */
.hero__synopsis {
  width: 471px;
  max-width: 100%;
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
}

/* Figma 7539:164397: a 202x44 primary and 44x44 secondaries. */
.hero__buttons {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  margin-top: var(--space-xs);
}

.hero .button-primary { width: 202px; height: 44px; }
.hero .button-icon    { width: 44px;  height: 44px; padding: 12px; }


/* ==========================================================================
   4. RAIL — carried over from the home prototype
   ========================================================================== */

.rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: var(--frame-gutter);
  padding-bottom: var(--space-5xl);
  overflow: hidden;
}

/* The first rail after a reading column needs the air the hero gives the
   first rail on the home page. Rails after it already have 64px below
   them, so only the join needs it. */
.shell + .rail { padding-top: var(--space-4xl); }

.rail__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding-right: var(--frame-gutter);
  padding-bottom: var(--space-l);
}

.rail__header-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
}

.rail__title {
  color: var(--color-on-surface);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

.rail__title-slot { display: flex; width: 450px; }
.rail__title-slot--grow { flex: 1 0 0; min-width: 0; width: auto; }

/* The header's action slot. The home prototype keeps a "see all" caret
   here; this uses it for the one action that belongs to a rail rather than
   to the page. It holds the right gutter, so it lines up with the last card
   that fits rather than floating in the overflow. */
.rail__action {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  margin-right: calc(var(--space-s) * -1);
  border-radius: var(--radius-xs);
  color: var(--color-primary);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  white-space: nowrap;
  transition: background var(--dur-ring) ease;
}

.rail__link:hover,
.rail__link:focus-visible { background: var(--color-white-5); outline: none; }

.rail__link .icon { width: 18px; height: 18px; }

.rail__subtitle {
  width: 100%;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-regular);
}

.rail__track {
  position: relative;
  display: flex;
  gap: var(--rail-gap);
  width: 100%;
  transition: transform var(--dur-rail-page) var(--ease-grow);
}

.rail__track--start  { align-items: flex-start; }
.rail__track--center { align-items: center; }

.rail__track--shadow {
  filter:
    drop-shadow(0 10px 7.5px rgba(0, 0, 0, 0.1))
    drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
}

.rail__edge {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  padding: 0 var(--space-l);
  border: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-nav-fade) ease;
}

.rail__edge--next {
  top: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(to right, var(--color-background-0), var(--color-background) 60%);
}

.rail__edge--prev {
  top: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(to left, var(--color-background-0), var(--color-background) 60%);
}

.rail__edge--prev .icon { transform: scaleX(-1); }

.rail:hover .rail__edge.is-available,
.rail:focus-within .rail__edge.is-available,
.rail__edge.is-available:focus-visible { opacity: 1; pointer-events: auto; }

.rail__edge .icon { transition: transform var(--dur-ring) var(--ease-zoom); }
.rail__edge:hover .icon { transform: scale(1.12); }
.rail__edge--prev:hover .icon { transform: scaleX(-1) scale(1.12); }


/* ==========================================================================
   5. POSTER CARD — carried over, plus the rating mark
   ========================================================================== */

.card-poster {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-vertical-width);
  height: var(--card-vertical-height);
  border-radius: var(--radius-s);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface);
}

.card-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border: 1px solid var(--card-outline);
  border-radius: var(--radius-s);
  transition: border-color var(--dur-outline) ease;
}

.card-poster:hover::after,
.card-poster:focus-visible::after { border-color: var(--card-outline-hover); }
.card-poster:focus-visible { outline: none; }

/* THE WRAPPER SCALES, THE IMAGE FADES — and they are two elements on
   purpose. `transition` is a shorthand and `transition-property` holds one
   list, so two rules that both set it on the same element do not compose:
   the later one wins outright and the earlier one is simply gone. The media
   fade (§17) sets it on every `img` inside a fading page, which silently
   deleted the zoom that used to live here. Splitting them across the
   wrapper and the image means neither rule can reach the other. */
.card-poster__art {
  position: absolute;
  inset: 0;
  transition: transform var(--dur-overlay) var(--ease-zoom);
}

.card-poster__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

/* ONLY ONE THING HAPPENS ON HOVER. The card used to zoom its artwork AND
   grow a panel out of itself — two animations on one gesture, and once
   there is a panel the zoom is just a false start before it. The panel IS
   the hover now; the card keeps its outline, which is a state rather than a
   move and says where the panel came from.

   A genre tile cannot open a panel, so the zoom is its hover and stays —
   but it is the tile's own zoom now, not the card's. Softer and slower, and
   held back long enough that crossing the row does not set six of them
   going. Tokens carry the reasoning; see css/tokens.css. */
.card-poster--genre .card-poster__art {
  transition: transform var(--dur-genre) var(--ease-enter);
  transition-delay: 0s;
}

.card-poster--genre:hover .card-poster__art,
.card-poster--genre:focus-visible .card-poster__art {
  transform: scale(var(--genre-zoom));
  transition-delay: var(--genre-hold);
}

/* NO CORNER MARK, ON ANY CARD. There was one — first three states, then
   one — and it is gone entirely.

   A small disc pinned to the top-right corner of artwork is a sticker. It
   is the same shape whatever it contains, it lands in the one place a
   poster's own composition tends to put something, and on a rail of seven
   it is seven stickers. The rating is readable where ratings belong: on
   the title's own row, in the control, and in the way the profile groups
   its rails. It does not need to be stamped on the picture.

   The plus sign on a pick row went for the same reason — it was a glyph in
   a box in a corner, doing a job the row's own Add button already does. */

/* The genre tile. BritBox draws its genre art 1:1 with the label set into
   the picture, so the tile is SQUARE — centre-cropping a square into the
   2:3 poster frame throws away a third of the width and clips the longest
   labels at both ends ("DOC & LIFESTYLE" came through as "IFESTYLE").
   Same rule, same reason, as the home prototype, where the height is a
   theme value for exactly this reason. */
.card-poster--genre {
  height: var(--card-vertical-width);
  cursor: pointer;
}


/* ==========================================================================
   5b. NUMBERED CARD — the chart rail
   --------------------------------------------------------------------------
   Carried over from the home prototype verbatim, comments and all, because
   the numeral treatment is the part of it that took the work.

   Digit frame 90 x 117, poster overlapping it by 14px.
   ========================================================================== */

.card-top10 {
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
}

.card-top10__digit {
  position: relative;
  width: 90px;
  height: 117px;
  margin-right: -14px;
  flex: 0 0 auto;
}

/* NO INNER LINES. `-webkit-text-stroke` strokes every contour in the glyph,
   and Inter's numerals are built from overlapping sub-paths that are never
   unioned — filled, the overlaps are invisible; stroked, their internal
   boundaries get drawn too, which is why the 4 came out with lines through
   it.

   The fix is to stroke at double weight and then lay a fill in the page's
   own ground colour over the top. The stroke is centred on each contour, so
   the fill covers the inner half of it everywhere — and covers the internal
   boundaries completely, because those lie wholly inside the shape. What is
   left is a clean outline at half the stroke width.

   The ::after carries that fill; js/app.js copies the character into
   data-digit for it. */
.card-top10__digit span {
  position: absolute;
  right: 0;
  bottom: -19.5px;                   /* -> ink sits on the card's bottom edge */
  font-size: 158px;                  /* -> 112px ink height                   */
  font-weight: var(--type-weight-semi-bold);
  line-height: 1;
  color: transparent;
  /* on-surface @72 — themed, or the numerals stay warm grey on navy. */
  -webkit-text-stroke: 5px color-mix(in srgb, var(--color-on-surface) 72%, transparent);
  user-select: none;
}

.card-top10__digit span::after {
  content: attr(data-digit);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-background);    /* the ground these numerals sit on */
  -webkit-text-stroke-width: 0;
  pointer-events: none;
}


/* ==========================================================================
   6. CONTINUE WATCHING CARD — carried over from the home prototype
   --------------------------------------------------------------------------
   The card is all picture, with the chrome floating on it behind a soft
   scrim. Measurements are proportions of the card, as they are there, so
   the lockup holds its place at any width.

   The one thing dropped is the bar's grow-on-arrival animation. It is an
   extra, and leaving it out is also what keeps the entrance the only thing
   on these pages that animates — see §17.
   ========================================================================== */

.card-cw {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-horizontal-width);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-s);
  background: var(--color-surface);
  overflow: hidden;
  cursor: pointer;
}

.card-cw::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border: 1px solid var(--card-outline);
  border-radius: var(--radius-s);
  transition: border-color var(--dur-outline) ease;
}

.card-cw:hover::after { border-color: var(--card-outline-hover); }

.card-cw__art { position: absolute; inset: 0; overflow: hidden; }

/* NOTHING IS REFRAMED HERE. Two of the three stills used to carry a zoom
   and an anchor to get their subject out from under the wordmark; the two
   `-wide` plates do it by moving the picture instead of cropping it, so
   every still is drawn the same way and the card has no opinion about
   which episode it is showing. */
.card-cw__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

/* Figma places the lockup at 144 x 47.706 from x=157 on a 313-wide card;
   expressed as proportions so the same rule holds at 424. */
.card-cw__logo {
  position: absolute;
  left: 50.16%;
  top: 50%;
  transform: translateY(-50%);
  width: 46.01%;
  height: 27.1%;
  z-index: 1;
}

.card-cw__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Episode stills are unpredictable behind a wordmark, so the lockup
     carries its own legibility rather than relying on the frame. */
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9))
          drop-shadow(0 2px 10px rgba(0, 0, 0, 0.75))
          drop-shadow(0 0 22px rgba(0, 0, 0, 0.6));
}

.card-cw__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(0, 16, 21, 0.34) 0%,
      rgba(0, 16, 21, 0.20) 34%,
      rgba(0, 16, 21, 0.06) 52%,
      rgba(0, 16, 21, 0) 66%),
    linear-gradient(to bottom,
      rgba(0, 16, 21, 0) 50%,
      rgba(0, 16, 21, 0.23) 59.808%,
      rgba(0, 16, 21, 0.8) 100%);
}

.card-cw__info {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  padding: var(--space-m);
}

.card-cw__text {
  display: flex;
  flex-direction: column;
  flex: 1 0 0;
  min-width: 0;
}

.card-cw__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.card-cw__ep {
  flex: 0 0 auto;
  color: var(--color-on-surface);
  /* 600 and a token, not a hand-set 700. The variable collection has two
     weights — 400 and 600 — and this was the only 700 in the set, which
     means the one place the type was bolder than anything else on the
     platform was an episode number. Found by listing every rendered
     size/weight pair on each screen rather than by reading the file. */
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 20px;
}

.card-cw__name {
  color: var(--color-on-surface);
  /* The same 16 as the episode line above it, and now the same token:
     it was the last hand-set body size in the file, and a literal
     sitting beside the token for its own value is how a scale starts
     coming apart. */
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-cw__progress-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.card-cw__bar {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 104px;
  height: 6px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.card-cw__bar span {
  position: absolute;
  display: block;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--accent-progress, var(--color-primary));
}

.card-cw__remaining {
  color: var(--color-white-80);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-regular);
  line-height: 1.5;
  white-space: nowrap;
}


/* ==========================================================================
   7. SHELF CARD — a collection, or a note
   --------------------------------------------------------------------------
   424 x 238.5, which is 16:9 and is also the home prototype's Continue
   Watching box. Reusing that number is not thrift: a shelf and a
   part-watched episode are the two things on this platform that are a PLACE
   you are in rather than a title you might start, and drawing them the same
   size is what makes a shelf read as furniture of the product.

   TWO FACES, and the earlier ones are in source.md §5.2. The card used to be
   three of the shelf's own posters laid side by side under a scrim — which
   has no aspect ratio of its own, no composition and no author: it is a
   contact sheet, not a cover. A collection the BritBox team publishes now
   carries 16:9 key art like any other collection on the service, and a
   shelf a person wrote carries type, because there is no artwork for it and
   collaging its contents is the same mistake in a smaller font.
   ========================================================================== */

.card-shelf {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: var(--card-horizontal-width);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
}

.card-shelf::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border: 1px solid var(--card-outline);
  border-radius: var(--radius-s);
  transition: border-color var(--dur-outline) ease;
}

.card-shelf:hover::after,
.card-shelf:focus-visible::after { border-color: var(--card-outline-hover); }
.card-shelf:focus-visible { outline: none; }

/* ---- The ground, and the one thing on this card that moves -------------
   EVERY SHELF CARD HAS ONE, and it holds whatever the cover is made of: a
   collection's photograph, or a person's wash and fan. Having one wrapper
   is what lets both kinds answer the pointer with the same gesture instead
   of each inventing its own.

   AND THE GESTURE IS THE SLOW ONE. It has been three things. First the
   picture snapped from 1.18 to 1.24 in 0.2s on an overshoot curve, which
   is a flinch on a 424px card and six flinches crossing a rail; the fan
   re-splayed at the same moment, so three posters and a ground all moved
   at once. Then the fan was pinned and the ground drifted 3.5% over 0.62s
   after a short hold — slow enough to read as the card leaning towards
   you. Then the generated covers arrived and took the ground element with
   them, which left no hover at all.

   This is the drift, on both kinds of card. Same travel, same duration and
   the same hold as the genre tile, because they are the same gesture on
   two sizes of rectangle: crossing a rail costs nothing, and stopping is
   what moves it. */

.card-shelf__ground {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  transition: transform var(--dur-fan) var(--ease-fan);
  transition-delay: 0s;
}

.card-shelf__ground > img { width: 100%; height: 100%; object-fit: cover; }

.card-shelf:hover .card-shelf__ground,
.card-shelf:focus-visible .card-shelf__ground {
  transform: scale(1.05);
  transition-delay: var(--fan-hold);
}

/* ---- A collection -----------------------------------------------------
   THE SAME CARD, WITH A PICTURE. It was square and wearing the 1:1
   Collection asset: a navy duotone with the collection's name burned into
   it in a face that is not this product's, which in a rail of full-colour
   posters read as a flat blue tile and told you nothing a line of type
   would not have told you better.

   The plate is editorial 16:9 now — two of the collection's own programmes
   parted by a hairline in the brand's pale cyan — and the name is set in
   the card's own type over it, which is also what makes a rail of
   collections and a rail of shelves look like one product. The byline is
   the difference: BritBox's mark against somebody's initial. */

/* ---- Somebody's shelf, with a cover it generated itself ----------------
   Two ingredients, both belonging to the shelf: its author's colour as a
   wash, and the first three titles on it, fanned. No catalogue key art
   pressed into service as a backdrop — that is what this replaced.

   The wash is the author's tone on the brand navy, so every member's
   shelves come out the same temperature as their own tile on the picker
   and nobody else's. */

.card-shelf__wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* THE TONE GLOWS WHERE THE CARD IS EMPTY. It used to sit at 88% 6% —
     the top-right corner — which is exactly where the fan now is, so the
     author's colour was entirely behind three posters and the visible
     half of the card was plain navy. The fan moved; the glow moves to
     meet the space it left. */
  background:
    radial-gradient(130% 150% at 12% 10%,
      var(--tone, var(--color-surface)) 0%, rgba(0, 0, 0, 0) 68%),
    linear-gradient(118deg,
      var(--tone, var(--color-surface)) -10%,
      var(--color-surface) 70%);
}

/* The titles, fanned, middle one forward.

   NOTHING IS CUT BY THE CARD'S EDGE. The last pass hung the fan 34px off
   the top on the theory that a cropped stack reads like books on a shelf.
   It does not — it reads like three posters with their heads cut off,
   which is the one thing you cannot do to key art. The whole fan is
   inside the card at rest AND at the end of the hover, and the numbers
   below are what makes that true rather than a hope:

     poster            104 x 156   (the rail's card at 0.515)
     resting rotation  +/- 6deg -> half-height 83, top edge at 11
     hover rotation    +/- 15deg -> half-height 89, top edge at 5
     deepest point     16 + 78 + 89 + 12 + 4 = 199, against a 239 card

   The bottom 40-odd pixels of the fan sit behind the type band, which is
   the Continue Watching card's arrangement and is what the foot of the
   scrim is for. Behind a 0.6-0.85 ramp is not the same as cut off.

   AND IT FANS FROM A PIVOT, which is the rebuild. Every previous version
   rotated each poster about its own centre and then translated it
   outwards to compensate — three transform parts changing at once, on
   three elements, in opposite directions. That is why it was jumpy
   whatever the duration was: nothing about it was one motion, it was
   nine simultaneous small ones that had to agree.

   A fan has a pivot. `transform-origin: 50% 120%` puts one 31px below
   each poster's bottom edge, and then the whole gesture is a single
   property on each card — `rotate`, from 7 degrees to 14 — and the
   outward swing, the lift and the arc come out of the geometry for
   free. One interpolating value per element cannot stutter.

   SOFT, NOT QUICK. `--ease-fan` is the quintic ease-out this set used
   before it started borrowing the genre tile's curve: it covers most of
   its distance early and then settles for a long time, which is what
   reads as fluid. 0.5s of it with a 0.07s hold — the hold is short
   enough that pointing at the card feels answered, and the curve is
   doing the work that shortening the duration was being asked to do.

   Nothing is clipped at either end; the numbers are in source.md §5.2. */

.shelf-stack {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 58px;
  display: flex;
  align-items: flex-start;
}

.shelf-stack__card {
  width: 104px;
  height: 156px;
  margin-left: -20px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.10);
  /* The pivot, below the stack, is the whole trick. */
  transform-origin: 50% 120%;
  transition: rotate var(--dur-fan) var(--ease-fan),
              translate var(--dur-fan) var(--ease-fan);
  transition-delay: 0s;
}

.shelf-stack__card:nth-child(1) { margin-left: 0; rotate: -7deg; z-index: 1; }
.shelf-stack__card:nth-child(2) { translate: 0 -4px;  z-index: 3; }
.shelf-stack__card:nth-child(3) { rotate: 7deg;  z-index: 2; }

/* ---- THE PHYSICS, which is the part that was still missing ------------
   Rotating from a pivot fixed the stutter; it did not make the thing
   feel like a fan, because all three cards were starting and stopping
   at the same instant and a fan does not do that. A real one unfurls:
   the middle leaf is the one your thumb is on, it moves first, and the
   outer two follow it round because they are being pushed, arriving
   later and taking longer because they have further to go.

   So: the middle lifts at the hold, the outer two start 100ms after it
   and take 140ms longer to settle. Nothing moves twice and nothing
   bounces — it is the same single rotation per card, offset in time by
   the amount that makes it read as one object opening rather than as
   three objects agreeing to move.

   THE SPREAD HAS ITS OWN CURVE AND THE CLOSE KEEPS THE OLD ONE. Opening
   from rest on an ease-OUT is a flick at any duration, because the
   curve spends its speed in the first few frames and then has nothing
   left to do; the leaves were stationary and then they were simply
   open. `--ease-fan-spread` is eased at both ends, so they take up the
   movement the way a hand opening a fan does and are a long time
   arriving — which is what lets the duration go to 0.72s without going
   slack. Closing is still `--ease-fan`: a fan falls shut. */
.card-shelf--made:hover .shelf-stack__card:nth-child(2),
.card-shelf--made:focus-visible .shelf-stack__card:nth-child(2) {
  translate: 0 -10px;
  transition-timing-function: var(--ease-fan-spread);
  transition-duration: var(--dur-fan);
  transition-delay: var(--fan-hold);
}

.card-shelf--made:hover .shelf-stack__card:nth-child(1),
.card-shelf--made:focus-visible .shelf-stack__card:nth-child(1) {
  rotate: -12deg;
  transition-timing-function: var(--ease-fan-spread);
  transition-duration: var(--dur-fan-outer);
  transition-delay: calc(var(--fan-hold) + var(--fan-follow));
}

.card-shelf--made:hover .shelf-stack__card:nth-child(3),
.card-shelf--made:focus-visible .shelf-stack__card:nth-child(3) {
  rotate: 12deg;
  transition-timing-function: var(--ease-fan-spread);
  transition-duration: var(--dur-fan-outer);
  transition-delay: calc(var(--fan-hold) + var(--fan-follow));
}

/* CLOSING IS NOT OPENING PLAYED BACKWARDS. A fan collapses because it
   is let go of: the outer leaves fall in first and the middle settles
   last, which is the reverse order, and the whole thing is quicker
   because nothing is being pushed. No hold on the way out — the card
   should be shut by the time the pointer has reached the next one. */
.shelf-stack__card:nth-child(1),
.shelf-stack__card:nth-child(3) { transition-duration: var(--dur-fan-close); }

.shelf-stack__card:nth-child(2) {
  transition-duration: var(--dur-fan-close);
  transition-delay: var(--fan-follow);
}

/* IT RAMPS THE WAY THE TYPE SITS, and for one round it did not. The last
   pass put a hard left-to-right ramp on the card — 90% black at the left
   edge, still 52% at the middle — because the fan was centred and ran
   straight under the title. That is a scrim covering for a layout: the
   metadata is a band at the FOOT of the card, so a sideways wedge darkens
   two thirds of a picture to protect type that is nowhere near it, and on
   the collection plates it buried half the artwork.

   The fan moved up and out of the way instead. One ramp now, downward,
   deep enough at the foot to carry two lines of title and a byline over
   anything, and clear across the top three fifths — which is the whole
   picture on a collection and the whole fan on a shelf.

   A gradient and not a flat tint: a panel of 70% black over a photograph
   is a card that stopped being a photograph. */
.card-shelf__scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(0, 16, 21, 0.00) 0%,
      rgba(0, 16, 21, 0.06) 28%,
      rgba(0, 16, 21, 0.58) 54%,
      rgba(0, 16, 21, 0.90) 76%,
      rgba(0, 16, 21, 0.96) 100%);
}

/* The foot deepens as the card opens — the third strand of one gesture:
   the picture leans in, the fan spreads, and the type they are both
   moving towards gets more ground under it.

   A SECOND LAYER FADING IN, not a second `background` on the same
   element. Gradients do not interpolate between keywords, so swapping the
   stops on hover is a jump cut; opacity on a layer above is the only way
   this arrives at the same speed as everything else on the card. */
.card-shelf__scrim::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--dur-fan) var(--ease-fan);
  transition-delay: 0s;
  background:
    linear-gradient(to bottom,
      rgba(0, 16, 21, 0.00) 0%,
      rgba(0, 16, 21, 0.10) 40%,
      rgba(0, 16, 21, 0.34) 62%,
      rgba(0, 16, 21, 0.52) 100%);
}

.card-shelf:hover .card-shelf__scrim::after,
.card-shelf:focus-visible .card-shelf__scrim::after {
  opacity: 1;
  transition-delay: var(--fan-hold);
}

.card-shelf__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-l);
}

/* ---- The empty one, first in the member's own rail --------------------
   Dashed because it is an outline waiting to be filled, and card-sized
   because the thing it makes is a card. It was a text link in the rail's
   header: the smallest thing on a row of 424px cards, in the corner where
   a "see all" caret goes. */
/* QUIETER THAN THE SHELVES IT SITS NEXT TO, not louder. The first pass
   drew it in full white — a solid dashed rule, a primary-ringed disc and
   the title weight — and an empty card shouting next to six covers is an
   empty card pretending to be the content. It is an invitation: it recedes
   until the pointer is on it, and then it answers in full. */
/* AND IT IS NARROWER THAN THE SHELVES. It was the shelf card's own 424,
   which is a lot of empty dashed ground to put in front of six covers —
   the first thing in the rail, the widest thing in the rail, and the
   only thing in it with nothing inside. It is a control, not an entry.

   240 is the width, which is a shade over half a shelf card and leaves
   the first real shelf visible at the rail's start on every width the
   set supports. It keeps the shelf card's full HEIGHT, because a short
   card in a row of tall ones is a hole in the row rather than a card
   standing beside them. */
.card-shelf--new {
  width: 240px;
  flex: 0 0 240px;
  /* THE SAME HEIGHT AS EVERY OTHER CARD IN THE RAIL, and getting there
     needs both lines. `.card-shelf` takes its height from a 16:9 ratio
     off its width, so narrowing it to 240 alone made it 135 tall — a
     notch cut out of a row of 238s. */
  aspect-ratio: auto;
  height: var(--card-horizontal-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-m);
  padding: var(--space-xl);
  /* IT IS AN OBJECT ON THE GROUND, NOT A HOLE IN IT. This was
     transparent with a dashed rule at white@11 and its type in the
     variant ink: against the page's own near-black, next to two
     full-colour photographs, there was almost nothing there to read.
     Quiet is not the same as faint. It has the shelf card's own surface
     under it now, the dashed rule at the same white@20 every other card
     is outlined in, and its label in the full ink — so what recedes is
     the FILL and the dashes, not the words. */
  border: 1px dashed var(--color-white-20);
  background: var(--color-surface);
  color: var(--color-on-surface);
  transition: border-color var(--dur-ring) ease, background var(--dur-ring) ease;
}

.card-shelf--new::after { content: none; }

.card-shelf--new:hover,
.card-shelf--new:focus-visible {
  border-color: var(--accent-ring-hover);
  background: var(--color-surface-variant);
}

.card-shelf__plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-full);
  color: var(--color-on-surface);
  transition: border-color var(--dur-ring) ease, background var(--dur-ring) ease;
}

.card-shelf--new:hover .card-shelf__plus,
.card-shelf--new:focus-visible .card-shelf__plus {
  border-color: var(--accent-ring-hover);
  background: var(--color-white-5);
}

.card-shelf__newLabel {
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
}

/* The note is the one thing here that SHOULD be quiet — it is the
   explanation, not the control. It wraps to two lines at this width. */
.card-shelf__newNote {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  line-height: 1.4;
}

/* ---- Shared type ---- */

/* Two lines, then an ellipsis. A shelf title is a sentence and some of them
   are long; letting it run further eats the scrim. The fan takes the right
   side, so the type gets a little over half.

   THERE IS NO "WRITTEN" VARIANT ANY MORE. A shelf with no picture used to
   be a different card — type on a plain surface with a hairline down its
   edge — because a person's shelf had no artwork to draw. It has one now:
   it makes its own, from its author's colour and its own first three
   titles. One shelf card, every shelf.

   AND IT IS THE CARD'S FULL WIDTH. It was 58%, which is what made the
   left-hand ramp necessary: the type was a column down one side of a
   picture with a fan of posters crossing it. The fan is above the band
   now and the band runs edge to edge, so a long title gets the whole 392
   before it has to wrap. */
.card-shelf .card-shelf__info { width: 100%; }

.card-shelf__title {
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-shelf__by {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  min-width: 0;
  color: var(--color-on-surface);
  font-size: var(--type-body-s-size);
  white-space: nowrap;
}

.card-shelf__by > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A shelf's author is a person or it is the BritBox team, and the two are
   told apart by the disc, not by a word. */
.byline__disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-s);
  height: var(--icon-s);
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: var(--tone, var(--color-surface-variant));
  color: var(--color-on-surface);
  /* A GLYPH IN A 24px CIRCLE, not type — which is why it is the one
     size in this file below the scale and why it is named here rather
     than quietly left as a number. An initial has to fit the avatar it
     is in; 14 in a 24 disc touches the edges. */
  font-size: var(--avatar-glyph-s);
  font-weight: var(--type-weight-semi-bold);
}

/* The house's disc carries BritBox's own 1:1 icon, clipped round like any
   other avatar — see the note in ui.byline() and ASSETS.md. The artwork
   brings its own navy ground, so the disc does not paint one. */
/* A RING, BECAUSE THE MARK IS MOSTLY GROUND. BritBox's square icon is a
   pale wordmark on the brand's own navy, so a disc of it dropped onto a
   dark cover is a navy circle on a navy card — the mark reads, its edge
   does not, and on the darker ground it disappears entirely. A hairline at
   white@20 and a soft ring under it give it an edge without drawing one. */
.byline__disc--house {
  background: none;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--color-white-20),
              0 1px 4px rgba(0, 0, 0, 0.45);
}

.byline__disc--house img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ==========================================================================
   8. WHO'S WATCHING — the entry
   --------------------------------------------------------------------------
   The one screen in this set that is a full-viewport moment rather than a
   page of the product, because that is what this screen is everywhere else
   and the point of starting here is that nobody has to be taught it.
   ========================================================================== */

.who {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4xl);
  padding: var(--space-huge) var(--frame-gutter);
}

.who__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  text-align: center;
}

.who__title {
  display: grid;
  font-size: var(--type-heading-l-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.2;
}

/* ---- TWO LABELS IN ONE BOX ---------------------------------------------
   The heading and the button both say one thing at the picker and
   another while managing, and both used to get there by having their
   text rewritten — on the same frame the tiles started easing. An
   instant word swap in a 40px heading is a jump; the button was worse,
   going from 164px wide to 83 and moving 41px left in nothing flat
   while everything around it took 0.26s.

   Both wordings are always in the DOM, stacked in a single grid cell,
   so the box is the width of the longer one in both states and never
   reflows. Only opacity changes, on the same duration and curve as the
   tiles and the grid. This is the whole fix — the tiles were never the
   problem.

   THIS COMMENT CLOSED ITSELF HALFWAY THROUGH AND THE RULE UNDER IT WAS
   NEVER APPLIED. A premature close left the second half of the prose outside
   the comment, so the parser read it as the start of a selector and
   swallowed `.who__swap`'s block as that selector's body — which took
   `grid-area: 1 / 1` with it. The two labels stopped sharing a cell and
   stacked, so the button drew at twice its height with the word at the
   top of it and the invisible one holding the space underneath. It
   looked like a broken pill and it was one missing character.

   `visibility` RATHER THAN OPACITY ALONE, because an element at zero
   opacity is still in the accessibility tree: with both spans readable
   the heading announced itself as "Who's watching?Manage profiles".
   Visibility is a discrete property, so it flips at the END of the
   transition on the way out and at the START on the way in — which is
   exactly the timing wanted, and needs no JavaScript to arrange. */
/* This is the ARRIVING state: it waits out the other word's exit before
   it starts, so the cell is never holding two of them at once. */
.who__swap {
  grid-area: 1 / 1;
  transition: opacity var(--dur-swap-in) var(--ease-fan) var(--dur-swap-out),
              visibility var(--dur-swap-in) var(--ease-fan) var(--dur-swap-out);
}

/* And this is the LEAVING state: immediately, and quicker. */
[data-managing='false'] .who__swap[data-for='manage'],
[data-managing='true']  .who__swap[data-for='pick'] {
  opacity: 0;
  visibility: hidden;
  transition-duration: var(--dur-swap-out);
  transition-delay: 0s;
}

/* THE TILES WERE 72px APART AND LOOKED IT. The gap said 40, but each tile
   was 180 wide around a 148 face, so there were 16px of empty tile on each
   side of the gap as well — 72px of ground between two squares 148 across.
   The tile is the width of its own face now, so the number in `gap` is the
   distance you can see, and 32 is that distance. */
.who__grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-3xl);
  flex-wrap: wrap;
}

.member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  width: 148px;
  cursor: pointer;
  color: var(--color-on-surface-variant);
  transition: color var(--dur-ring) ease;
}

.member:hover,
.member:focus-visible { color: var(--color-on-surface); outline: none; }

.member__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border-radius: var(--radius-s);
  background: var(--tone, var(--color-surface));
  border: 1px solid var(--color-white-20);
  color: var(--color-on-surface);
  font-size: var(--avatar-glyph-l);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1;
  /* The shadow is what stops four squares reading as holes cut in the
     ground. It deepens on hover with everything else on this element —
     one transition list, one gesture. */
  box-shadow: var(--shadow-tile);
  /* FOUR PROPERTIES, ONE LIST, AND THE LIST IS DECLARED ONCE. There were
     two `.member__face` rules each setting `transition`, and `transition`
     is a shorthand holding a single list — the later one replaced the
     earlier outright, so border-color stopped easing at all and the hover
     scale was being run at the managing stagger's duration AND its
     per-tile delay. That is what "bumpy" was: pointing at the third tile
     did nothing for 150ms and then moved slowly. Recorded in source.md §8
     because it is the third time this shorthand has caught this file.

     `scale` is the separate property, not `transform`. Managing shrinks
     the tile and hovering grows it; sharing one `transform` means one of
     them always has to cancel the other, and the delay that belongs to
     the mode change ends up on the pointer. They compose. */
  transition: border-color var(--dur-outline) ease,
              box-shadow var(--dur-outline) ease,
              transform var(--dur-overlay) var(--ease-zoom),
              scale var(--dur-manage) var(--ease-fan);
}

.member:hover .member__face,
.member:focus-visible .member__face {
  border-color: var(--card-outline-hover);
  box-shadow: var(--shadow-tile-hover);
  transform: scale(1.04);
}

/* NOBODY IS HIGHLIGHTED. One tile used to carry an accent ring for the
   member held in sessionStorage, and it was nonsense on this screen: at the
   picker nobody is signed in yet — that is what the picker is for — so
   marking one tile as the current one answers a question before it has been
   asked, and reads as a recommendation about which person to be. All four
   tiles are equal until one is chosen. `--accent-active` went with it; the
   accent budget in theme.britbox.css is back to three slots. */

.member__name {
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
  color: var(--color-on-surface);
}

/* No shadow on this one. It is an outline around empty ground rather than
   an object sitting on it, and a shadow under a dashed box with nothing in
   it reads as a rendering mistake. */
.member--add .member__face {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  color: var(--color-on-surface-variant);
  /* A PLUS, NOT AN INITIAL, so it is deliberately not `--avatar-glyph-l`
     even though it sits in the same 148px tile. A cross drawn at 56
     reads heavier than a letter at 56 — it is all stroke and no
     counter — and at that size on a dashed outline it was the loudest
     thing on the picker. It keeps its own number, which is the point of
     writing the glyph scale down: this is now visibly an exception
     rather than one of three forty-somethings nobody had compared. */
  font-size: 40px;
}

.member--add:hover .member__face,
.member--add:focus-visible .member__face { box-shadow: none; }

/* ---- Managing the household -------------------------------------------
   The same grid and the same tiles, told which mode they are in. Nothing
   is rebuilt and nothing navigates until you pick somebody. See the note
   in screens.who(). */

/* The pencil scrims its own tile rather than sitting in a corner of it:
   the whole square becomes the control, which is what it is — the tile
   goes to that profile's settings, not into the product. */
.member__initial,
.member__pencil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-manage) var(--ease-fan);
}

/* ---- Going into managing, and coming back out ------------------------
   THE GRID ITSELF ANSWERS, and it did not: the only thing that changed
   was a pencil crossfading in, which on four large squares is a change
   you have to be looking for. The tiles step back, one after another
   from the left, and the pencils arrive on the same stagger. Done runs
   it in reverse. It is a mode, so it holds rather than blipping.

   SWIFT AND SOFT, which took three passes. The first was 0.32s of scale
   AND 4px of travel at 50ms apart, on top of the shorthand bug above —
   two transforms, a stale duration and a delay leaking onto the
   pointer. The second kept a 35ms per-tile stagger, which on three
   tiles that are already moving with the grid under them reads as the
   row arriving in pieces.

   EVERYTHING GOES AT ONCE NOW. One property (`scale`, to 0.96), one
   duration, one curve, no stagger — the tiles, their pencils and the
   grid's slide all start and finish together. A stagger is for a list
   arriving; this is three things changing state, and they changed at
   the same instant.

   ON `.member__face`, NOT ON `.member`. The tile carries `.enter` and
   the entrance animates its transform; two systems on one element is the
   bug this prototype has a whole section about. The face is a child and
   nothing else touches it. */
.member__face { position: relative; }

[data-managing='true'] .member__face { scale: 0.96; }

/* A LIGHT SCRIM, NOT A BLACKOUT. The first pass used the full overlay and
   dropped the initial to a quarter, which took the one thing that tells
   these four squares apart — their colour — down to nothing in the exact
   mode where you are choosing between them. Enough to carry a glyph and
   no more. */
.member__pencil {
  opacity: 0;
  background: var(--color-overlay-variant);
  border-radius: inherit;
  color: var(--color-on-surface);
}

.member__pencil .icon {
  width: 26px;
  height: 26px;
}

/* THE INITIAL GETS OUT OF THE WAY, and it has to: a diagonal glyph laid
   across a 40px letter reads as a strike through the letter, which is the
   mark for "delete this", not "edit this". At 0.4 the J and the pencil
   were one shape. The tile keeps its colour and the name is still set
   under it, so nothing identifying is lost by taking the letter down. */
[data-managing='true'] .member__pencil { opacity: 1; }
[data-managing='true'] .member__initial { opacity: 0.14; }

/* MAKING A NEW PROFILE IS NOT MANAGING THE ONES YOU HAVE. Offering both at
   once is two different jobs in one row of identical squares.

   NOTHING ABOUT THIS ANIMATES LAYOUT, and that is the third attempt.
   `display: none` took the tile out of a centred flex row, so the other
   three jumped sideways to re-centre on the frame the stagger started.
   Collapsing its cell — width to zero with a negative margin eating the
   gap — fixed the jump and replaced it with a judder: animating `width`
   on a flex item relays out the row every frame, and three tiles were
   scaling while it did.

   The cell stays exactly where it is and the GRID slides instead. The
   add tile's cell is 148 plus a 32 gap, so moving the row half of that
   — 90px — puts the remaining tiles back on the centre line while the
   tile itself fades where it stands. One transform on one element, off
   the layout path entirely, over the same 0.26s as the scale, so the
   whole thing is one move. `--manage-shift` is written by
   screens.who(), because at four profiles there is no add tile and
   nothing to compensate for.

   THE TILE'S INSIDES FADE, NOT THE TILE. `.member` carries `.enter`,
   and `enter-rise` animates both its opacity and its transform — a
   transition on either here is the two-systems-on-one-element bug, and
   it would fire if anybody pressed Manage during the entrance.

   AND THERE IS NO `overflow: hidden` HERE, THOUGH THERE WAS. It was put
   on to keep the collapsing cell tidy, and it clipped the hover: the
   face grows to 1.04 on hover, which is 154px inside a 148px box, so
   three sides of the dashed outline were shaved off and the tile looked
   broken the moment you pointed at it. */
.who__grid { transition: transform var(--dur-manage) var(--ease-fan); }

[data-managing='true'] .who__grid {
  transform: translateX(var(--manage-shift, 0px));
}

[data-managing='true'] .member--add { pointer-events: none; }

.member--add .member__name {
  transition: opacity var(--dur-manage) var(--ease-fan);
}

/* The face keeps its own four-property list — adding a fifth here would
   replace it, which is the shorthand trap again. */
.member--add .member__face {
  transition: border-color var(--dur-outline) ease,
              box-shadow var(--dur-outline) ease,
              transform var(--dur-overlay) var(--ease-zoom),
              opacity var(--dur-manage) var(--ease-fan);
}

[data-managing='true'] .member--add .member__face,
[data-managing='true'] .member--add .member__name { opacity: 0; }

.who__foot { display: flex; justify-content: center; }

/* A BUTTON, AND A QUIET ONE. It has been both extremes: a bare text link
   floating under the grid, then an accent-ringed pill carrying the pencil
   — which put the brand colour and an icon on the least important control
   on the screen, directly under four large tiles that are the screen.
   Neither the ring nor the glyph was doing any work: the label says what
   it does, and the pencil's job is to appear on the tiles.

   So: the outline at white@20, the label in the variant ink, no icon. It
   is legible, it is obviously pressable, and it stops competing. */
.who__manage {
  display: grid;
  place-items: center;
  padding: var(--space-s) var(--space-xl);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-surface-variant);
  font-family: inherit;
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-regular);
  cursor: pointer;
  transition: border-color var(--dur-ring) ease, color var(--dur-ring) ease,
              background var(--dur-ring) ease;
}

.who__manage:hover,
.who__manage:focus-visible {
  border-color: var(--color-white-80);
  color: var(--color-on-surface);
  outline: none;
}

/* Pressed, it is the way out of the mode it put you in — so it is the one
   solid thing in the foot, and still no accent. NOT bolder: a weight
   change re-measures the text and moved the centred button 5px, which
   is the same class of fault as the label swap above. */
.who__manage[aria-pressed='true'] {
  background: var(--color-white-5);
  border-color: var(--color-white-20);
  color: var(--color-on-surface);
}

/* ---- Delete, on a profile's own screen ---------------------------------
   Apart from Save and Cancel and below them, because it is the one control
   on that form that cannot be undone. Two presses rather than a dialog: a
   modal for a one-word question is a second surface nobody needed, and the
   button can ask it itself. */
/* THE FAR END OF THE ACTIONS ROW. `margin-left: auto` is what sets it
   apart — same row as Save and Cancel, because that is where anybody
   looks for it, with the whole gap between them and a text treatment
   against their two filled ones. */
.add__delete {
  margin-left: auto;
  padding: var(--space-s) var(--space-m);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-on-surface-variant);
  font-family: inherit;
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-regular);
  cursor: pointer;
  transition: color var(--dur-ring) ease, background var(--dur-ring) ease;
}

.add__delete:hover,
.add__delete:focus-visible {
  color: var(--color-on-surface);
  text-decoration: underline;
  outline: none;
}

/* ARMED, IT IS THE LOUDEST THING IN THE ROW — and only then. The second
   press is the one that cannot be undone, so that is the press that gets
   a filled control to aim at; the first press is a question asked by the
   quietest thing on the form. */
.add__delete[data-armed='true'] {
  background: var(--color-on-surface);
  color: var(--color-background);
  font-weight: var(--type-weight-semi-bold);
  text-decoration: none;
}


/* ==========================================================================
   8b. ADD A PROFILE
   --------------------------------------------------------------------------
   No frame for this one — BritBox has no profiles — so it is built from
   what the rest of the set already establishes. The tile on the left is the
   thing being made and updates as the name is typed; the fields are the
   make screen's own `.field` and `.make__label`, because a form is a form.

   SIX TONES, from the brand's palette. The picker draws an initial on a
   tile, so the tile's colour is what tells two profiles apart at a glance —
   which makes it a real choice rather than decoration.
   ========================================================================== */

/* 240 of tile, 64 of gap, 560 of fields — and centred, rather than
   stretched across 1208 of page. See the note on `.shell--add`. */
.add {
  display: grid;
  grid-template-columns: 240px minmax(0, 560px);
  justify-content: center;
  gap: var(--space-5xl);
  align-items: start;
  width: 100%;
}

/* THERE IS NO APP BAR ON THIS SCREEN, so the one number that assumed there
   was becomes zero. `.head` pads itself by the bar's height plus 64, and
   the preview sticks below it; both read the same token, so setting it here
   corrects the page's top and the sticky offset together rather than
   leaving two magic numbers to drift apart. See js/app.js, PRE_SIGN_IN. */
/* BOTH OF THEM, because a custom property that references another is
   resolved where it is DECLARED, not where it is used: `--back-clear` is
   computed on :root with the root's 88px bar and inherits as a finished
   value, so overriding --appbar-height here alone changes the sticky
   preview and leaves the page's top padding at 188. Caught by measuring
   it, not by reading it. */
/* THIS SCREEN IS A FULL-VIEWPORT MOMENT, LIKE THE PICKER IT CAME FROM,
   and it had been laid out as though it were a page of the product.
   There is no app bar on it and no footer worth reaching, the form is
   636 tall, and on a 900px window it sat hard against the top-left
   corner with half the height and two thirds of the width empty behind
   it. The picker solves exactly this by centring itself in the
   viewport; this is the same screen one step further in, so it gets the
   same treatment.

   Centred on both axes, and the column is only as wide as the form
   needs — 240 of tile, 64 of gap and 560 of fields. Stretched to the
   full 1208 the fields were a metre wide and the eye had to travel the
   whole way back for the next label. */
.shell--add {
  --appbar-height: 0px;
  --back-clear: 0px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-huge) 0;
}

.add__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  position: sticky;
  top: calc(var(--appbar-height) + var(--space-5xl));
}

.add__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border-radius: var(--radius-s);
  border: 1px solid var(--color-white-20);
  background: var(--tone, var(--color-surface));
  box-shadow: var(--shadow-tile);
  color: var(--color-on-surface);
  font-size: var(--avatar-glyph-l);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1;
  transition: background var(--dur-ring) var(--ease-standard);
}

.add__previewName {
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
}

.add__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
  max-width: 520px;
}

.add__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.add__hint {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

.add__tones { display: flex; gap: var(--space-m); flex-wrap: wrap; }

.add__tone {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-s);
  border: 1px solid var(--color-white-20);
  cursor: pointer;
  transition: box-shadow var(--dur-ring) ease;
}

.add__tone[aria-checked='true'],
.add__tone:focus-visible {
  box-shadow: 0 0 0 2px var(--color-background), 0 0 0 4px var(--color-primary);
  outline: none;
}

/* THE SIX, DECLARED AS A VALUE RATHER THAN AS A BACKGROUND. Each one sets
   `--tone` and nothing else, and every element that draws a member reads it
   with its own ground as the fallback:

     background: var(--tone, var(--color-surface));

   Setting `background` here directly made the colour a question of source
   order — `[data-tone='1']` and `.member__face` have the same specificity,
   so whichever came last in the file won, and the answer changed depending
   on which section an avatar's rule happened to live in. As a custom
   property there is nothing to beat: the element asks for the tone, and
   falls back to its own ground when the member has none.

   These are not in the Figma collection. The variable file has no profile
   palette, because the product has no profiles — see source.md §5.1b. They
   are six desaturated darks mixed to sit on the brand navy without any of
   them competing with the accent. */
[data-tone='1'] { --tone: #1B4F63; }   /* Cyan  */
[data-tone='2'] { --tone: #334655; }   /* Slate */
[data-tone='3'] { --tone: #2F4A3C; }   /* Moss  */
[data-tone='4'] { --tone: #5B3B32; }   /* Clay  */
[data-tone='5'] { --tone: #46344F; }   /* Plum  */
[data-tone='6'] { --tone: #5A5138; }   /* Sand  */

.add__tone { background: var(--tone); }

.add__toggle {
  display: flex;
  align-items: flex-start;
  gap: var(--space-l);
  padding: var(--space-l);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-ring) ease;
}

.add__toggle:hover,
.add__toggle:focus-visible { border-color: var(--accent-ring-hover); outline: none; }

.add__switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  margin-top: 2px;
  border-radius: var(--radius-full);
  background: var(--color-surface-variant);
  transition: background var(--dur-ring) var(--ease-standard);
}

.add__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-on-surface);
  transition: transform var(--dur-ring) var(--ease-grow),
              background var(--dur-ring) var(--ease-standard);
}

.add__toggle[aria-pressed='true'] .add__switch { background: var(--accent-action); }
.add__toggle[aria-pressed='true'] .add__switch::after {
  transform: translateX(18px);
  background: var(--color-on-primary);
}

.add__toggleText { display: flex; flex-direction: column; gap: var(--space-2xs); }

.add__toggleTitle {
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
}

/* ---- The maturity ceiling, revealed by the toggle ----------------------
   "For a child" is not a setting a product can act on; the ceiling under it
   is. The group is laid out collapsed rather than removed — a 0fr grid row,
   which is the one way to animate to a height nobody has measured — so the
   reveal grows the field instead of the page jumping, and a screen reader
   can still reach the group the toggle names in aria-controls. */
.add__reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition: grid-template-rows var(--dur-reveal) var(--ease-enter),
              opacity var(--dur-reveal) var(--ease-enter),
              margin-top var(--dur-reveal) var(--ease-enter);
}

.add__reveal[data-open='true'] {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: var(--space-m);
}

/* The row has to clip, or its content keeps its own height and the 0fr
   above it does nothing visible. */
.add__revealInner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding-left: calc(42px + var(--space-l));
}

.add__reveal[data-open='false'] .add__revealInner { visibility: hidden; }

.add__ratings { display: flex; gap: var(--space-s); }

.add__rating {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 40px;
  padding: 0 var(--space-m);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-on-surface-variant);
  cursor: pointer;
  transition: border-color var(--dur-ring) ease,
              background var(--dur-ring) ease,
              color var(--dur-ring) ease;
}

.add__rating:hover,
.add__rating:focus-visible { border-color: var(--accent-ring-hover); outline: none; }

.add__rating[aria-checked='true'] {
  background: var(--color-surface-variant);
  border-color: var(--color-on-surface);
  color: var(--color-on-surface);
}

.add__ratingCode {
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  letter-spacing: 0.02em;
}

.add__actions {
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

.add__actions .button-primary[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ==========================================================================
   9. PAGE HEAD — the shared heading block
   --------------------------------------------------------------------------
   Every screen except Who's watching opens with this. One component: a
   kicker, a title, a standfirst, a byline row and an actions row, each of
   which is simply absent when the screen's data has nothing for it. The
   shelf-reading screen is this block with five of five filled; the browse
   screen is the same block with two.
   ========================================================================== */

.head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-l);
  padding: var(--back-clear) 0 var(--space-4xl);
}

.head__kicker {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.head__title {
  max-width: 900px;
  font-size: var(--type-heading-l-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.2;
}

.head__title--sm { font-size: var(--type-heading-m-size); }

.head__standfirst {
  max-width: 680px;
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
}

.head__by {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

.head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding-top: var(--space-s);
}

.head__rule {
  width: 100%;
  height: 1px;
  background: var(--color-surface-variant);
  opacity: 0.5;
}


/* ==========================================================================
   10. SHELF ENTRY — a title with the reason it is on the shelf
   --------------------------------------------------------------------------
   THE REASON IS THE COMPONENT. A list of posters is a playlist; a list of
   posters each with a sentence saying why it is there is an argument, and
   the argument is the thing being sent. So the reason is not a caption
   under the poster — it sits beside it, at reading width, and it is the
   widest thing in the row.
   ========================================================================== */

.entry {
  display: grid;
  grid-template-columns: 44px var(--card-vertical-width) 1fr;
  align-items: start;
  column-gap: var(--space-2xl);
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--color-surface-variant);
}

.entry:first-child { border-top: 0; }

.entry__index {
  padding-top: var(--space-xs);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
  font-variant-numeric: tabular-nums;
}

.entry__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-m);
  padding-top: var(--space-2xs);
}

.entry__title {
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

.entry__meta {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

/* 64ch, not a pixel width: the measure is a property of the type, and the
   column it sits in is 700px+ at the artboard. */
.entry__reason {
  max-width: 64ch;
  font-size: var(--type-body-m-size);
  color: var(--color-on-surface);
}

.entry__reason em {
  color: var(--color-on-surface-variant);
  font-style: normal;
}

/* The catalogue's own words, on a collection, where a shelf has its
   author's. Set in the variant ink because the two are not the same kind
   of sentence and should not look alike — one is a description, the
   other is somebody telling you why. */
.entry__reason--blurb { color: var(--color-on-surface-variant); }

.entry__actions {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding-top: var(--space-xs);
}


/* ==========================================================================
   11. RATING — three points
   --------------------------------------------------------------------------
   Not five stars and not a thumb. Five stars is an enthusiast's grammar and
   goes uncompleted; a single thumb is too coarse to build a reason from.
   Three points, and the TOP one is deliberately a sentence rather than a
   grade, because "one I'd recommend" is the same gesture as putting a title
   on a shelf — which is how this control and the rest of the prototype are
   one feature instead of two. See source.md §6.

   ONE DISC UNTIL IT IS ASKED. The control was a permanently open pill of
   three labelled choices sitting on its own line above the actions. It is
   now one disc the size and shape of the secondary actions, IN their row,
   that opens into three of the same disc. The group's width is the only
   thing that changes — 44 closed, 156 open — so the row grows sideways
   into space it already had and nothing moves vertically.

   The options are laid out at zero width rather than hidden, so the group
   can animate between the two states without measuring anything, and the
   margin between them is animated alongside the width or three zero-width
   buttons would still be holding 24px of gap open.
   ========================================================================== */

.rate {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  width: var(--rate-size, 44px);
  height: var(--rate-size, 44px);
}

/* IT IS A SECONDARY BUTTON AND NOTHING ELSE. It was drawn in
   on-surface-variant, which beside Add and Info — both on-surface — read as
   a greyed-out, unavailable version of the same disc. Same ground, same
   primary@30 ring, same ink as the two it stands next to, and transparent
   rather than surface-coloured so it is also the ghost button it stands
   next to in a shelf row. */
.rate__toggle {
  position: absolute;
  inset: 0;
  padding: 0;
  background: transparent;
  color: var(--color-on-surface);
  transition: opacity var(--dur-rate) var(--ease-rate),
              border-color var(--dur-ring) ease,
              color var(--dur-ring) ease;
}

/* THE ANSWER FILLS THE GLYPH, NOT THE DISC. Filling the container made a
   rated title's control the brightest, heaviest thing in a row whose one
   primary action is Play — an opinion already given, outranking the thing
   you came to do. */
.rate__toggle[data-value] .icon { fill: currentColor; }
.rate__toggle[data-value='rec'] { color: var(--accent-recommend); }

/* ---- The panel --------------------------------------------------------
   ONE OBJECT WITH THREE CHOICES IN IT. The options used to be three loose
   discs whose widths animated from 0 to 44 independently; three rings
   arriving side by side read as three new buttons rather than as one
   question.

   THE PILL GROWS BY WIDTH, NOT BY SCALE, and that is the second go at it.
   Scaling on X meant everything inside was squashed on the way in and had
   to be counter-scaled back out, each glyph on its own delay — which is
   exactly the stuttery arrival the panel itself was meant to fix. Widening
   the box distorts nothing: the glyphs are their own size from the first
   frame and the pill simply uncovers them.

   SLOWER, AND SYMMETRICAL. 0.30s on an overshoot curve snapped open and
   bounced; this eases in and out over 0.42s and closes on the same curve
   in the same time, so opening and shutting are the same gesture played
   each way rather than two different ones. */
.rate__panel {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  width: var(--rate-size, 44px);
  height: var(--rate-size, 44px);
  padding: 0 2px;
  overflow: hidden;
  border: 1px solid var(--color-primary-30);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  opacity: 0;
  pointer-events: none;
  transition: width var(--dur-rate) var(--ease-rate),
              opacity var(--dur-rate) var(--ease-rate);
}

.rate[data-open='true'] .rate__panel {
  width: var(--rate-panel-width);
  opacity: 1;
  pointer-events: auto;
}

/* The toggle crosses with it rather than cutting: both are on the same
   duration and the same curve, so at every frame of the open there is
   exactly one object's worth of ink in that 44px square. */
.rate[data-open='true'] .rate__toggle {
  opacity: 0;
  pointer-events: none;
}

.rate__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-surface);
  cursor: pointer;
  /* They are never scaled and never staggered: the pill uncovers them.
     The only thing they fade is themselves, and together. */
  opacity: 0;
  transition: opacity calc(var(--dur-rate) * 0.55) var(--ease-rate),
              background var(--dur-ring) ease,
              color var(--dur-ring) ease;
}

.rate[data-open='true'] .rate__opt {
  opacity: 1;
  transition-delay: calc(var(--dur-rate) * 0.3);
}

.rate__opt:hover,
.rate__opt:focus-visible {
  background: var(--color-white-5);
  outline: none;
}

/* The micro: the glyph itself lifts a little under the pointer and presses
   back in on the way down. It is 2px and 140ms, which is the most a 40px
   target can carry without wobbling. */
.rate__opt .icon { transition: transform 0.14s var(--ease-rate); }
.rate__opt:hover .icon,
.rate__opt:focus-visible .icon { transform: translateY(-2px); }
.rate__opt:active .icon { transform: translateY(0) scale(0.92); }

/* The chosen option, same rule as the collapsed disc: the glyph fills, the
   container does not. */
.rate__opt[aria-pressed='true'] .icon { fill: currentColor; }
.rate__opt--recommend[aria-pressed='true'] { color: var(--accent-recommend); }

/* And the answer lands: the collapsed disc gives one short beat when it
   comes back carrying a value it did not have before. Driven by a class
   ui.rate() adds and removes, so it cannot fire on first paint. */
/* ONE BEAT, AND IT NO LONGER BOUNCES. It went 0.84 → 1.07 → 1, which is
   a squash and an overshoot: fine on a control you press once, silly on
   three of them in a row and on a My List button pressed down a whole
   rail. It settles from slightly under to exactly 1 and stops — the
   press is acknowledged, nothing springs.

   EVERY CONTROL THAT ANSWERS USES THIS ONE. The rating disc, My List as a
   word, My List as a disc, Save to your shelves. Four controls, one beat,
   one duration, so pressing things in this prototype feels like pressing
   one product's things. */
@keyframes rate-landed {
  0%   { transform: scale(0.92); }
  100% { transform: scale(1); }
}

.rate__toggle.is-landed { animation: rate-landed var(--dur-landed) var(--ease-rate); }

/* The option you press answers too, which it did not: choosing a rating
   shut the panel and left the three buttons with no acknowledgement of
   which one had been pressed on the way out. */
.rate__opt:active { transform: scale(0.92); }

@media (prefers-reduced-motion: reduce) {
  .rate__toggle, .rate__panel, .rate__opt, .rate__opt .icon { transition: none; }
  .rate__toggle.is-landed { animation: none; }
  .rate__opt { opacity: 1; }
}


/* ==========================================================================
   12. SEND — the shelf leaving
   --------------------------------------------------------------------------
   The research is the design here: this audience's community already exists
   on Facebook, in email and in messages, and every in-product attempt at a
   friend graph has been withdrawn. So there is nothing to follow and
   nothing to subscribe to — a shelf leaves as a LINK, and the panel's job
   is to show what the person at the other end will see before it goes.
   ========================================================================== */

/* The panel's own layout moved to .send__inner when sharing stopped being
   a navigation: .send is the row that opens, and the thing inside it is
   what used to be the panel. See §19. */
/* IT IS A PANEL, NOT A BAND. It ran the full 1208 content column, which
   is 300px wider than anything in it needs: the plate is 424, the copy
   is held to 56ch, and the rest was empty surface — so the thing that
   opens under a button read as a new section of the page rather than as
   that button's answer. Worse on a collection, where it pushed the
   first cover 300px further down a page whose billboard is already 378
   tall.

   Sized to its contents instead: the plate, a gap, and a column wide
   enough for the sentence. `max-width` rather than a fixed width, so at
   960 it still gives way. Padding and gap come down a step with it —
   32 and 40 were set for a full-width band. */
.send__inner {
  display: grid;
  grid-template-columns: var(--card-horizontal-width) minmax(0, 1fr);
  align-items: start;
  max-width: calc(var(--card-horizontal-width) + var(--space-3xl) + 56ch);
  gap: var(--space-3xl);
  padding: var(--space-2xl);
  border: 1px solid var(--color-surface-variant);
  border-radius: var(--radius-s);
  background: var(--color-surface);
}

/* ON A COLLECTION IT IS CENTRED, because the thing that opens it is.
   The hero's Share button sits in the middle of a centred billboard and
   the panel opened hard against the left gutter, so the answer appeared
   nowhere near the question. On a shelf the button is in a left-aligned
   actions row and the panel stays where it is. `.hero + .shell` is the
   same selector the head's clearance already uses. */
.hero--centred + .shell .send__inner { margin-left: auto; margin-right: auto; }

/* Below the width where the plate and a readable column both fit, the
   plate goes rather than the sentence: the copy is what the panel is
   for, and a 424 card squeezed next to a 200px column is neither. */
@media (max-width: 1100px) {
  .send__inner { grid-template-columns: minmax(0, 1fr); }
  .send__art { display: none; }
}

/* ---- THE PLATE IS A PICTURE OF A CARD, NOT A CARD --------------------
   It is built by `ui.shelfCard()`, so it arrived with everything a rail
   card has: a link, a pointer cursor, an outline that lit on hover and
   three posters that fanned out under the pointer. All of it wrong
   here. The panel is saying "this is what arrives" — the plate is an
   illustration of the thing being sent, and an illustration that
   responds to the pointer invites a press that goes nowhere and makes
   the fan perform in a context where nobody asked it to.

   The href comes off in screens.shelf(); this takes the behaviour off
   with it, so the two cannot drift apart. */
.send__art .card-shelf {
  pointer-events: none;
  cursor: default;
}

.send__art .shelf-stack__card { transition: none; }

.send__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-l);
}

.send__title {
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

.send__note {
  max-width: 56ch;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-m-size);
}

.send__ways {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.send__link {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  width: 100%;
  padding: var(--space-m) var(--space-l);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-s);
  background: var(--color-background);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  font-family: inherit;
}

.send__link span {
  flex: 1 0 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==========================================================================
   13. WRITE A SHELF — a page of pictures, not a form
   --------------------------------------------------------------------------
   THE THIRD REBUILD, and the first that is not a form. The previous one
   was honest about its own shape — a band of fields, a numbered step, a
   draft column and a scrolling pool — and that shape was the problem.
   To publish six titles you wrote eight pieces of prose: a name, a line
   under it, and a sentence against every cover. On the one screen that
   is supposed to be the pleasure of this concept, the work was writing.

   What it is now:

     1. a premise, picked from four — fills the name, the line and four
        titles in one press
     2. the shelf itself, drawn as the rail card it will become, with the
        name beside it and three suggested names under that
     3. the titles on it, each offering three written reasons as buttons
     4. a wall of covers to add from, where picking is one press on the
        artwork rather than on a control beside it

   Typing is possible everywhere and required nowhere.
   ========================================================================== */

/* THE SHELL CARRIES THE CLEARANCE, because this screen has no `.head`.
   Every other page's first element is `.head`, which holds
   `--back-clear` — the bar, the back control and the space either side
   of it. The strip is the first thing here instead, and with nothing
   holding that clearance it started at the top of the document and its
   own `position: sticky` pinned it over the heading. The page opened
   with "What are you" already hidden behind it. */
.shell--make { padding-top: var(--back-clear); }

.make {
  display: flex;
  flex-direction: column;
  gap: var(--space-5xl);
  padding-bottom: var(--space-huge);
}

/* ---- PHASE TWO USES THE WIDTH IT HAS -------------------------------
   Stacked, this screen was a column of short rows down the left with
   the right half of the page empty, and a wall of covers at the bottom
   that you had to scroll to reach from the thing it feeds. Side by
   side, what you are making and what you are choosing from are in view
   at the same time, which is the pairing the screen is about.

   One breakpoint, and it is a content breakpoint rather than a device
   one: below 1180 the two columns cannot both hold their contents — the
   shelf's card is 424 and the wall needs four covers to read as a wall
   — so they stack, and the stacked version is the one the narrow end of
   the range gets. */
@media (min-width: 1180px) {
  .make--build {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: start;
    column-gap: var(--space-5xl);
    row-gap: var(--space-4xl);
  }

  .make--build > .make__top { grid-column: 1 / -1; }
  .make--build > .make__sec--on   { grid-column: 1; }
  .make--build > .make__sec--wall { grid-column: 2; }

  /* The wall is the taller half and the one you work from, so it holds
     station while the shelf beside it grows. */
  .make--build > .make__sec--wall {
    position: sticky;
    top: calc(var(--appbar-height) + 108px);
    max-height: calc(100vh - var(--appbar-height) - 140px);
    overflow: hidden;
  }

  .make--build .wall {
    overflow-y: auto;
    min-height: 0;
    padding-right: var(--space-s);
    scrollbar-gutter: stable;
    -webkit-mask-image: linear-gradient(to bottom,
        #000 0, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(to bottom,
        #000 0, #000 calc(100% - 40px), transparent 100%);
  }
}

/* ---- Phase one: the opening question and the four ways in ------------- */

.make__lead {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  max-width: 54ch;
}

.make__leadTitle {
  font-size: var(--type-heading-l-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.15;
}

.make__leadNote {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-m-size);
}

/* THE STARTERS ARE SHELF CARDS, which is the whole point of them: you
   are choosing between four things that already look like the thing you
   are about to make, rather than reading four descriptions of it. Each
   one draws its own first three covers through the same component the
   rail uses, so what you press is what you get. */
/* IT FILLS THE COLUMN. This was capped at two native cards — 872px of
   a 1208 page — which made the opening screen a block in the left half
   with the right half empty, and the whole page look like it had not
   finished loading. The cap was there because a stretched card is wider
   than the fan inside it is positioned for; the answer is a ceiling on
   the CARD, not on the row, so the grid can use the width and the
   previews stay the size the component draws.

   Auto-fill from 300: three across at 1208, two at about 960, one when
   there is no room for two. Nothing is told how many columns to be. */
.starters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3xl) var(--space-2xl);
  align-items: start;
}

.starter {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-m);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.starter__note {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  line-height: 1.45;
}

.starter:hover .starter__note,
.starter:focus-visible .starter__note { color: var(--color-on-surface); }

.starter:focus-visible { outline: none; }

/* The card inside a starter is a preview, so it answers to the button
   around it rather than to itself. */
/* The ceiling that lets the grid above be fluid: a preview grows with
   its column up to the card's native width and no further, because the
   fan inside it is positioned in fixed pixels. */
.card-shelf--preview {
  cursor: inherit;
  width: 100%;
  max-width: var(--card-horizontal-width);
}

.starter .card-shelf--preview {
  transition: transform var(--dur-outline) var(--ease-zoom),
              box-shadow var(--dur-outline) ease;
}

.starter:hover .card-shelf--preview,
.starter:focus-visible .card-shelf--preview {
  transform: translateY(-3px);
  box-shadow: var(--shadow-tile-hover);
}

.starter:hover .card-shelf--preview::after,
.starter:focus-visible .card-shelf--preview::after {
  border-color: var(--card-outline-hover);
}

/* The fifth option, which is the old behaviour kept as a choice rather
   than imposed as a default. Card-shaped so it sits in the same grid,
   dashed for the same reason the write-a-shelf card in the rail is. */
.starter--blank {
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-s);
  min-height: 160px;
  padding: var(--space-xl);
  border: 1px dashed var(--color-white-20);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  transition: border-color var(--dur-ring) ease, background var(--dur-ring) ease;
}

.starter--blank:hover,
.starter--blank:focus-visible {
  border-color: var(--accent-ring-hover);
  background: var(--color-surface-variant);
}

.starter__plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-full);
}

.starter__blankLabel {
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
}

/* ---- Phase two: the shelf, and the name beside it --------------------- */

.make__top {
  display: grid;
  grid-template-columns: var(--card-horizontal-width) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-4xl);
}

.make__cardSlot { width: var(--card-horizontal-width); }

/* AN UNNAMED SHELF SAYS SO QUIETLY. The card prints "Untitled shelf"
   until there is a name, and that placeholder should not be set in the
   same ink as a real title — it is the one piece of type on this screen
   that is standing in for something. */
.card-shelf--unnamed .card-shelf__title { color: var(--color-on-surface-variant); }

.make__name {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  min-width: 0;
}

.make__label {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Three names built from what is already on the shelf. They appear only
   while it is unnamed, and they disappear the moment it is — a row of
   alternative names next to a name you have chosen is a nag. */
.ideas {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  flex-wrap: wrap;
  min-height: 0;
}

.ideas__label {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

.chip--idea {
  font-weight: var(--type-weight-regular);
  text-transform: none;
  letter-spacing: 0;
}

/* ---- Sections -------------------------------------------------------- */

.make__sec {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  min-width: 0;
}

.make__secHead {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

.make__count {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-regular);
}

/* ---- The wall's two controls ----------------------------------------
   A search and three filters, on one line under the heading. They do
   different jobs and compose rather than override: the chips choose
   which pool, the box finds something in it. */
.wall__tools {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.findbox {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  flex: 1 1 200px;
  min-width: 0;
  max-width: 280px;
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-full);
  background: var(--color-background-container);
  color: var(--color-on-surface-variant);
  transition: border-color var(--dur-ring) ease, color var(--dur-ring) ease;
}

.findbox:hover { border-color: var(--color-white-80); }

.findbox:focus-within {
  border-color: var(--accent-ring-hover);
  color: var(--color-on-surface);
}

.findbox .icon { width: 18px; height: 18px; }

.findbox input {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--color-on-surface);
  font-family: inherit;
  font-size: var(--type-body-s-size);
  outline: none;
}

.findbox input::placeholder { color: var(--color-on-surface-variant); }

/* The clear affordance browsers add to type=search is drawn in the UA's
   own colours and sits oddly on a dark pill. */
.findbox input::-webkit-search-cancel-button { -webkit-appearance: none; }

.filters--wall { margin-left: auto; }

/* ---- What is on the shelf -------------------------------------------- */

.on {
  display: flex;
  flex-direction: column;
}

.on__row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-l);
  padding: var(--space-m) 0;
  border-top: 1px solid var(--color-surface-variant);
}

.on__row:first-child { border-top: 0; }

.on__art {
  width: 56px;
  height: 84px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--color-surface);
}

.on__art img { width: 100%; height: 100%; object-fit: cover; }

.on__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.on__title {
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
}

/* The row's second line is the catalogue metadata — genre, year,
   seasons — which is what tells two similar covers apart. It replaced a
   block of three reason chips per row: see source.md §14. */
.on__meta {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

.on__drop {
  padding: var(--space-s);
  border-color: transparent;
  color: var(--color-on-surface-variant);
}

.on__drop:hover,
.on__drop:focus-visible {
  border-color: var(--color-white-20);
  color: var(--color-on-surface);
}

.on__empty {
  padding: var(--space-3xl) var(--space-2xl);
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-s);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-m-size);
  text-align: center;
}

/* ---- The wall -------------------------------------------------------- */

/* NINETEEN ROWS OF THUMBNAIL AND BUTTON IS A TABLE OF CONTENTS. The same
   titles as covers is the product: you know a programme by its artwork
   long before you read its name, and picking is one press on the thing
   itself. The tile IS the control — there is no Add button beside it. */
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--space-2xl) var(--space-l);
}

.wall__tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-on-surface-variant);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.wall__art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--color-surface);
  /* The outline is on the art rather than on the tile, so the name
     underneath is not boxed in with it. */
  box-shadow: inset 0 0 0 1px var(--card-outline);
  transition: box-shadow var(--dur-outline) ease,
              transform var(--dur-outline) var(--ease-zoom);
}

.wall__art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wall__name {
  font-size: var(--type-body-s-size);
  line-height: 1.3;
  color: inherit;
  transition: color var(--dur-ring) ease;
}

.wall__tile:hover .wall__art,
.wall__tile:focus-visible .wall__art {
  box-shadow: inset 0 0 0 1px var(--card-outline-hover);
  transform: translateY(-2px);
}

.wall__tile:hover,
.wall__tile:focus-visible { color: var(--color-on-surface); outline: none; }

/* The mark sits on the artwork and is the tile's whole state: a plus
   while it is a candidate, a tick once it is on the shelf. Same
   arrangement as the poster card's rating mark, one size down. */
.wall__mark {
  position: absolute;
  top: var(--space-s);
  right: var(--space-s);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-white-20);
  background: rgba(0, 16, 21, 0.72);
  color: var(--color-on-surface);
  transition: background var(--dur-ring) ease, border-color var(--dur-ring) ease,
              color var(--dur-ring) ease;
}

.wall__mark .icon { width: 16px; height: 16px; }

.wall__tile[aria-pressed='true'] { color: var(--color-on-surface); }

.wall__tile[aria-pressed='true'] .wall__art {
  box-shadow: inset 0 0 0 2px var(--accent-ring-hover);
}

.wall__tile[aria-pressed='true'] .wall__mark {
  border-color: transparent;
  background: var(--accent-ring-hover);
  color: var(--color-background);
}

/* ---- The fields that survived ----------------------------------------
   The title and the line under it, which are the only two inputs left on
   the screen and are both optional until Publish asks for the name. */
.field {
  width: 100%;
  padding: 10px var(--space-l);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-s);
  background: var(--color-background-container);
  color: var(--color-on-surface);
  font-family: inherit;
  font-size: var(--type-body-m-size);
  line-height: var(--type-line-height);
  transition: border-color var(--dur-ring) ease, background var(--dur-ring) ease;
}

.field:hover { border-color: var(--color-white-80); }

.field:focus {
  border-color: var(--accent-ring-hover);
  background: var(--color-surface);
  outline: none;
}

.field::placeholder { color: var(--color-on-surface-variant); }

.field--title {
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
}


.filters {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  flex-wrap: wrap;
}

.chip {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-s) var(--space-l);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-white-20);
  background: transparent;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-ring) ease, color var(--dur-ring) ease;
}

.chip:hover,
.chip:focus-visible { color: var(--color-on-surface); border-color: var(--accent-ring-hover); outline: none; }

.chip[aria-pressed='true'] {
  background: var(--color-surface-variant);
  border-color: transparent;
  color: var(--color-on-surface);
}

/* ---- The strip, carried over unchanged -------------------------------- */

.make__strip {
  position: sticky;
  top: var(--appbar-height);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-l);
  margin-bottom: var(--space-3xl);
  margin-left: calc(-1 * var(--frame-gutter));
  margin-right: calc(-1 * var(--frame-gutter));
  padding: var(--space-l) var(--frame-gutter);
  border-bottom: 1px solid var(--color-surface-variant);
  background: var(--color-background);
}

.make__status {
  min-width: 0;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

.make__acts {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  flex: 0 0 auto;
}

.make__acts .button-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.make__acts .button-primary:disabled:active { transform: none; }


/* ==========================================================================
   14. PROFILE — the taste record
   --------------------------------------------------------------------------
   PRIVATE BY CONSTRUCTION, and the screen says so once, in one line, where
   the counts are. That line is the difference between this and every
   withdrawn streaming social feature: nothing here is published, followed
   or broadcast — the shelf is the only thing that travels, and it travels
   because the member sent it.
   ========================================================================== */

/* THE SCOREBOARD IS GONE. This was three tiles — titles rated, you'd
   recommend, shelves made — and all three were numbers about the member
   rather than about anything they might want to do next. What is left is
   the one line on the page that is load-bearing: the promise that none of
   this is visible to anybody. */


/* ==========================================================================
   14b. ACCOUNT — the one screen taken from a frame
   --------------------------------------------------------------------------
   Figma 30268:217135, "20.1 Account — Subscribed User (Primary)". The
   numbers below are the frame's, transcribed:

     content column   798, centred (321 + 798 + 321 = 1440)
     label frame       24 tall, block starts at y=40  -> 16 under the label
     block -> block    40
     account info     241 + 20 + 537 across, 249 tall
     the plate        avatar 100, 16, name 27, link 21 — 164, centred in 249
     card padding     24 horizontal, 0 vertical (rows fill the card exactly)
     row padding      16 all round, so text sits 40 in from the card edge
     row heights       59 title only · 83 title + one line · 107 two lines
                      111 the payment row
     title / sub      27 and 24 line boxes — 18px and 16px at 1.5
     plan card        170.2 tall, content inset 24/16, buttons 263 x 44 at
                      x=511 with 16 between them

   These were re-read from 30268:217137 rather than taken off the render,
   and three of them were wrong before: every row had a single 83 minimum
   (so the three legal rows stood 24 too tall), the text was inset 24 where
   the frame insets it 40, and the title was a size small.

   Colour is this prototype's own theme, not the frame's — the frame is
   drawn in Streamit because that is the library it lives in.

   Colour is this prototype's own theme, not the frame's — the frame is
   drawn in Streamit because that is the library it lives in.
   ========================================================================== */

/* The account column is the frame's 798, centred, rather than the reading
   column the shelf screens use. It is a form, not an article. */
.shell--account {
  max-width: calc(798px + 2 * var(--frame-gutter));
  margin: 0 auto;
  /* The frame starts the content 32px under the app bar with no heading
     block between, and that is now literally what happens: the back
     control used to sit in the gap and the page cleared it instead,
     costing 100px before the first label. There is no back control on
     this screen any more — it is one action from the avatar menu, which
     is on this page too — so the frame's own number is the number. */
  padding-top: calc(var(--appbar-height) + var(--space-3xl));
}

.acct {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-bottom: var(--space-4xl);          /* 40 between blocks */
}

.acct__label {
  padding-bottom: var(--space-l);
  color: var(--color-on-surface);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* `color/background-container`, which is what 30268:217137 actually puts
   on these — not `color/surface-container`, which is what they had. See
   the note in css/theme.britbox.css. */
.acct__card {
  border-radius: var(--radius-s);
  background: var(--color-background-container);
  overflow: hidden;
}

/* Account info: the member plate beside the rows, 241 + 20 + 537. */
.acct__split {
  display: grid;
  grid-template-columns: 241px 1fr;
  gap: var(--space-xl);
  align-items: stretch;
}

/* 164 of content centred in 249: avatar 100, 16, name 27, link 21. */
.acct__who {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-2xl);
}

.acct__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  margin-bottom: var(--space-l);
  border-radius: var(--radius-full);
  background: var(--tone, var(--color-primary));
  color: var(--color-on-surface);
  font-size: var(--avatar-glyph-m);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1;
}

.acct__name {
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 27px;
}

/* "Change name", in the accent, where the frame puts it. It used to read
   "Your profile" and go to the profile page, which is a different thing
   from the name on the account — and it left the frame's own destination
   with nowhere to be reached from. */
.acct__link {
  color: var(--color-primary);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 21px;
}

.acct__link:hover { text-decoration: underline; }

/* ---- Rows ---- */

/* THE ROW IS THE FULL WIDTH OF THE CARD; its own padding is what insets
   the text. The card used to hold the 24 and the row added 16 inside it,
   which measured the same — the text still starts 40 from the card's edge
   — but it meant a hovered row could only paint the middle of the card:
   a grey rectangle with 24px of card showing either side of it and square
   corners against a rounded container. The 40 is now 24 + 16 in one
   declaration, so the highlight runs edge to edge and the card's own
   radius clips the first and last row for free. */
.acct__rows { display: flex; flex-direction: column; }

.acct__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-l);
  width: 100%;
  min-height: 59px;            /* 16 + a 27 title + 16 */
  padding: var(--space-l) calc(var(--space-2xl) + var(--space-l));
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-ring) ease;
}

/* A PSEUDO-ELEMENT, NOT A BORDER AND NO LONGER AN INSET SHADOW. The
   frame's Line Divider is 0 tall — it sits between the rows without
   occupying anything — so a 1px border added a pixel per row and the
   three-row block came out 251 against the frame's 249. The shadow had no
   height either, but it ran the row's full width, and the row is the
   card's full width now; the frame stops its dividers 24 short at each
   end, which is what this draws. */
.acct__row + .acct__row::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-2xl);
  right: var(--space-2xl);
  height: 1px;
  background: var(--color-white-20);
  pointer-events: none;
}

/* The row grows with its content from there: 83 with one line of sub, 107
   with two, 111 for the payment row's stacked card. Nothing sets those —
   they are 59 plus the lines, which is how the frame arrives at them. */

/* A LIFT OF THE CONTAINER, NOT A DIFFERENT COLOUR. It was
   --color-surface-variant — #4A5455, a warm grey from the text palette —
   which on a navy card read as a slab of another product dropped into it.
   White at 5% over whatever the container is, which is the hover the rest
   of this set uses. */
.acct__row:hover,
.acct__row:focus-visible { background: var(--color-white-5); outline: none; }

.acct__text {
  display: flex;
  flex-direction: column;
  flex: 1 0 0;
  min-width: 0;
}

/* 18/27 and 16/24 — the frame's two line boxes, which is what makes its
   row heights come out at 59, 83 and 107 rather than near them. */
.acct__title {
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 27px;
}

.acct__sub {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-m-size);
  line-height: 24px;
}

.acct__value {
  flex: 0 0 auto;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-m-size);
  line-height: 24px;
}

.acct__tail {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  color: var(--color-on-surface-variant);
}

/* "Log out" has no sub and no chevron, so it is the bare 59. */
.acct__row--bare { min-height: 59px; }

/* The payment plate. A card is a rectangle with a gradient on it in the
   frame and that is all it is here: no scheme mark is drawn, because a
   redrawn mark is a wrong mark and Visa's is not ours to ship. */
.acct__plate {
  flex: 0 0 auto;
  width: 34px;
  height: 22px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-surface-variant) 100%);
}

/* The payment row's second line: the plate beside the brand and last four,
   with the expiry under them. The frame stacks it this way under the row's
   own title — see the note in ui.accountRows(). */
/* 48 tall — two 24 line boxes — with the plate beside it and 16 between,
   starting 4 under the title. Frame: Payment Details 243.4 x 48 at y=31
   inside a container that starts at 16. */
.acct__method {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  min-height: 48px;
  padding-top: var(--space-xs);
}

.acct__methodText { display: flex; flex-direction: column; }

.acct__brand {
  color: var(--color-on-surface);
  font-size: var(--type-body-m-size);
  line-height: 24px;
}
.acct__dots { letter-spacing: 0.08em; }

/* ---- The plan ---- */

/* 170.2 tall: 16 of padding, 138.2 of content, 16. The detail column is
   467 wide at an inset of 24 and the buttons are 263 at x=511, which in a
   798 card leaves 24 on the right — so the card's horizontal padding is
   24 and the gap between the two columns is 44. Frame 30268:217173. */
.acct__plan {
  display: grid;
  grid-template-columns: 467px 263px;
  justify-content: space-between;
  align-items: center;
  min-height: 170.2px;
  padding: var(--space-l) var(--space-2xl);
  margin-bottom: var(--space-l);
}

.acct__plan-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.acct__plan-name {
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
}

.acct__plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  font-size: var(--type-heading-s-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.2;
}

.acct__plan-price span {
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-regular);
  color: var(--color-on-surface-variant);
}

.acct__plan-renews {
  padding-top: var(--space-s);
  border-top: 1px solid var(--color-surface-variant);
  margin-top: var(--space-s);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

.acct__plan-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  width: 263px;
}

.acct__plan-actions .button-primary,
.acct__plan-actions .button-ghost { width: 100%; height: 44px; }

.acct__help {
  padding: var(--space-4xl) 0 var(--space-huge);
  text-align: center;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-m-size);
}

.acct__help a { margin-left: var(--space-s); }


/* ==========================================================================
   15. FOOTER — carried over from the home prototype
   ========================================================================== */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4xl);
  padding: var(--space-4xl) var(--footer-gutter) var(--space-5xl);
  border-top: 0.4px solid var(--color-outline);
  background: var(--color-background);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: var(--space-xl) 44px;
  width: 100%;
  max-width: 1208px;
}

.footer__link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  white-space: nowrap;
}


/* ==========================================================================
   16. NO SCREEN SWITCH
   --------------------------------------------------------------------------
   The home and paywall prototypes carry a small control at the foot of the
   page for jumping between their brand builds, and this screen set carried
   the same component as a screen jump. It is gone.

   It was scaffolding for the reviewer and it behaved like scaffolding:
   floating over the footer, over the last rail, over the foot of the shelf
   list, in a prototype whose whole argument is that the feature belongs
   inside the product rather than bolted to it. The screens link to each
   other — the picker opens the home page, the avatar opens the profile, a
   shelf card opens its shelf, a shelf you wrote offers Edit — and anything
   a reviewer cannot reach that way is a navigation problem to fix rather
   than to paper over with a jump list.
   ========================================================================== */


/* ==========================================================================
   16b. THE RAIL HOVER — variant A1
   --------------------------------------------------------------------------
   The home prototype's first-rail hover, carried over at its own numbers:
   a 398-wide panel (Figma 7539:166281) that grows out of the card you are
   pointing at, with the artwork on top and a typeset title, synopsis, meta
   and actions under it.

   The box is animated by js/hover.js; everything below is the furniture.
   The chrome waits out most of the growth and then resolves in a short
   stagger — that pause in the middle is what stops the open reading as one
   flat move: the card grows, holds, then furnishes.
   ========================================================================== */

.hover-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;      /* only the panel itself is interactive */
}

.hover-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border: 1.5px solid var(--card-outline-hover);
  border-radius: 10.182px;
  background: var(--color-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6),
              0 4px 14px rgba(0, 0, 0, 0.45);
  /* NO opacity transition on the way in. It used to fade up while sitting
     exactly on the card, so for those frames you saw the card's own artwork
     through the panel's — two of everything at once. */
}

.hover-card.is-open { opacity: 1; pointer-events: auto; }

/* 16:9, which is the shape the reference panel's media block is. The poster
   is cropped to it rather than letterboxed: the panel grew out of this
   picture and has to still be showing it. */
.hover-card__art {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--color-background);
}

.hover-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;   /* posters put the faces high */
}

/* ONE COLUMN, NOT TWO. The reference puts the actions beside the text, and
   at 398px wide that leaves the synopsis about 240px to live in — two lines
   that break after four words and end in an ellipsis halfway through the
   sentence. The actions are a row of three 36px discs; they cost 44px of
   height underneath and buy the text the whole width.

   So the panel reads top to bottom: picture, title, synopsis, meta, then
   what you can do about it. */
.hover-card__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-m);
  padding: var(--space-l) var(--space-l) var(--space-l);
}

.hover-card__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.hover-card__title {
  color: var(--color-on-surface);
  font-size: 20.36px;
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Figma sets this nowrap against a fixed width; clamping instead keeps a
   real sentence readable at this width. */
/* Three lines at full width, where two at half width used to cut a
   sentence off mid-clause. */
.hover-card__desc {
  color: var(--color-on-surface-variant);
  font-size: 15.27px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hover-card__meta {
  color: var(--color-white-80);
  /* 14, the scale's smallest text step. It was 12 — the only body copy
     in the set below the scale, on the one component that appears over
     every rail on two screens. */
  font-size: var(--type-body-s-size);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The hero's buttons at the hero's size — 44px, surface ground, primary@30
   border. The panel used to carry its own 36px version on a different
   ground, and two sets of round actions in one palette that do not match is
   a palette nobody set. */
.hover-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  width: 100%;
}

/* DIRECT CHILDREN ONLY. The rating's three options are `.button-icon` too,
   and they live one level further down inside `.rate` — where their width is
   the thing being animated between 0 and 44. A descendant selector here
   would pin them open at 44 and the control could never close. */
.hover-card .hover-card__actions > .button-icon {
  width: 44px;
  height: 44px;
  padding: 12px;
}

.hover-card .rate { --rate-size: 44px; }
.hover-card .rate .icon { width: 20px; height: 20px; }

/* THE RATING IS IN THIS ROW, not above it. It had its own line — which cost
   the panel a whole row of height for a control nobody had asked to see,
   and made the opinion the thing standing between the writing and "play
   this". As one disc among the actions it costs nothing until it is used,
   and the row has the width for all three: 3 x 44 + 156 + gaps = 324 of
   the panel's 366 — so it opens rightwards into empty ground and the three
   actions beside it do not move at all. */

/* ---- The chrome stagger ----
   Each line carries its place in the order; the two state rules own the
   timing outright, so no other rule may set `transition` on these or its
   shorthand would silently drop the delay. */
.hover-card__title,
.hover-card__desc,
.hover-card__meta,
.hover-card__actions {
  opacity: 0;
  transform: translateY(var(--chrome-lift, 6px));
  transition: opacity var(--dur-chrome-out, 0.18s) var(--ease-standard),
              transform var(--dur-chrome-out, 0.18s) var(--ease-standard);
}

.hover-card.is-settled .hover-card__title,
.hover-card.is-settled .hover-card__desc,
.hover-card.is-settled .hover-card__meta,
.hover-card.is-settled .hover-card__actions {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-chrome, 0.34s) var(--ease-grow)
                calc(var(--chrome-i, 0) * var(--chrome-stagger, 0.06s)),
              transform var(--dur-chrome, 0.34s) var(--ease-grow)
                calc(var(--chrome-i, 0) * var(--chrome-stagger, 0.06s));
}

.hover-card__title   { --chrome-i: 0; }
.hover-card__desc    { --chrome-i: 1; }
.hover-card__meta    { --chrome-i: 2; }
.hover-card__actions { --chrome-i: 3; }

/* The card underneath holds its hover outline while its panel is open, so
   the row still shows where the panel came from. */
.card-poster.is-previewing::after { border-color: var(--card-outline-hover); }

@media (prefers-reduced-motion: reduce) {
  .hover-card__title,
  .hover-card__desc,
  .hover-card__meta,
  .hover-card__actions { opacity: 1; transform: none; transition: none; }
}


/* ==========================================================================
   17. THE ENTRANCE — and there is only one of it
   --------------------------------------------------------------------------
   The companion prototype found the hard way that an element owned by two
   animation systems fades twice, and spent a section of its source.md on
   de-arming one from the other. This prototype does not have that problem
   because it does not have two systems: there is NO scroll-reveal here, one
   staged entrance per load, and it is the only thing in the stylesheet that
   declares an `animation`. Everything else that moves is a transition.

   `.enter` is deliberately NOT hidden by CSS. Content that needs an
   animation to be visible at all is a bug waiting to happen — js/app.js
   adds `.is-entering` to the page synchronously, before first paint, and
   only that class hides anything. With scripting off the page is simply
   there, which is the correct failure.
   ========================================================================== */

@keyframes enter-rise {
  from { opacity: 0; transform: translateY(var(--enter-lift)); }
  to   { opacity: 1; transform: none; }
}

.page.is-entering .enter {
  opacity: 0;
  animation: enter-rise var(--dur-enter) var(--ease-enter) backwards;
  animation-delay: calc(var(--i, 0) * var(--enter-step));
  animation-fill-mode: both;
}

/* ---- Artwork fades as it decodes ----
   A page of thirty posters used to arrive as thirty separate events — each
   appearing the instant its bytes landed, in whatever order the network
   returned them. Each image now fades over --dur-media when it is ready,
   which turns that into one soft settle. It matters most on a profile
   switch, where every picture on the page is replaced at once.

   ARMED BY JS, LIKE THE ENTRANCE, AND FOR THE SAME REASON. `.fades` goes on
   the page synchronously before the first paint; with scripting off it is
   never added and every image is simply visible, which is the correct
   failure. An image that needs a class to be seen at all is a blank page
   waiting to happen. */
/* THE FAN'S LEAVES ARE EXCLUDED, AND THAT IS NOT A DETAIL —
   `.shelf-stack__card` is an `<img>`, so this rule was matching it at
   (0,2,1) against the fan's own (0,1,0), and `transition` is a shorthand:
   it did not add an opacity fade to the fan, it REPLACED the fan's
   property list with `opacity`. The leaves' `rotate` and `translate` had
   no transition at all, so the three posters were snapping to their open
   positions and snapping back, and every attempt to retune the duration
   was retuning a number nothing read. Four rounds of "the fan is jumpy"
   and three sets of timing tokens, against a transition that was not
   running.

   This is the FOURTH time this shorthand has done this in this file —
   twice on `.member__face`, once on the picker, now here. The rule is
   the same every time: two rules setting `transition` on one element do
   not compose, the later or more specific one wins outright.

   `:not()` rather than a more specific fan rule, deliberately. Raising
   the fan's specificity to beat this would have put it above its own
   close and hover rules, which then stop applying — the fix creates the
   next bug. Taking three small posters out of the decode fade costs
   nothing visible: they are inside a card that is already on screen. */
.page.fades img:not(.shelf-stack__card) {
  opacity: 0;
  transition: opacity var(--dur-media) var(--ease-standard);
}

.page.fades img.is-loaded { opacity: 1; }

/* THE CHROME DOES NOT ARRIVE. The fade is for the artwork — thirty posters
   decoding in whatever order the network returns them — and the bar is not
   artwork. Its wordmark and its two glyphs were fading up on every single
   navigation, so the one part of the page that is identical from screen to
   screen was the part that looked like it was loading each time. They are
   the same three files on every page and the browser has them cached
   before the second one; they should simply be there.

   Same argument for the footer's wordmark, which is visible from the start
   on the short pages. */
.page.fades .app-bar img,
.page.fades .footer img { opacity: 1; transition: none; }

@media (prefers-reduced-motion: reduce) {
  .page.is-entering .enter { opacity: 1; animation: none; }
  .page.fades img { opacity: 1; transition: none; }
  /* `.card-shelf__art` was named here and has never existed — the shelf
     cover's parts are __ground / __wash / __scrim. Dropped rather than
     guessed at: none of them transitions. */
  .rail__track,
  .card-poster__art,
  .member__face { transition: none; }
}


/* ==========================================================================
   18. THE REST OF THE ACCOUNT FLOW
   --------------------------------------------------------------------------
   Transcribed from the Account section of BritBox Apollo — Product Design,
   file VTwXbZhC5eXcRZcW0J4fwF, section 30268:216908. Ten destinations, one
   layout, which is why there is one block of rules here rather than ten.

   THE FRAME'S ARITHMETIC, taken from 30268:217398 (Email Change) and true
   of every other frame in the section:

     content frame   1208 wide, starting 128 under the top of the page
     copy column      594 wide at x=307   -> 307 + 594 + 307 = 1208
     card             390 wide at x=409   -> 409 + 390 + 409 = 1208
     card padding      24 on all four sides
     form block       123 tall, buttons block 144, card 291 for one field

   The 128 is the app bar plus its margin; this prototype's bar is 88, so
   the page uses --appbar-height + 40 and lands in the same place.

   MEASURED OFF THE RENDER, not read from the file: the field is 56 tall,
   the primary 52, the label-to-field gap 12, and the gap between the
   primary and Cancel 20. The file gives those only as instance sizes the
   metadata does not expand, so they are honest measurements of the frame's
   own pixels rather than values read out of it. Recorded in source.md.
   ========================================================================== */

.shell--acctf {
  max-width: calc(1208px + 2 * var(--frame-gutter));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--back-clear);
  padding-bottom: var(--space-5xl);
}

/* ---- The copy column --------------------------------------------------- */

.acctf__copy {
  width: 594px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-s);
  padding-bottom: var(--space-3xl);
  text-align: center;
}

.acctf__title {
  font-size: var(--type-heading-s-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.2;
}

.acctf__standfirst {
  max-width: 594px;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-l-size);
  line-height: 1.5;
}

/* ---- The card ---------------------------------------------------------- */

/* `color/background-container`, like the landing page's cards — checked
   against two of the sub-page frames (30268:217354, 30268:219957) and not
   assumed from the one above. */
.acctf {
  display: flex;
  flex-direction: column;
  width: 390px;
  max-width: 100%;
  padding: var(--space-2xl);
  border-radius: var(--radius-s);
  background: var(--color-background-container);
}

.acctf__field { display: flex; flex-direction: column; }

.acctf__field + .acctf__field { margin-top: var(--space-2xl); }

/* The password screen rules off the current password from the new one — the
   two halves answer different questions. Figma 30268:217446. */
.acctf__field--ruled {
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-white-20);
}

.acctf__label {
  padding-bottom: var(--space-m);
  color: var(--color-on-surface);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
}

.acctf__input { position: relative; display: flex; }

.acctf__input input {
  width: 100%;
  height: 56px;
  padding: 0 var(--space-l);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-s);
  /* RECESSED, not raised. The frame fills its fields with a lighter grey
     because Streamit's card is near-black; on BritBox navy the token that
     holds that relationship is the page ground, which is what `.field`
     already uses everywhere else in this set. Same relationship, this
     palette's answer to it. */
  background: var(--color-background);
  color: var(--color-on-surface);
  font-family: inherit;
  font-size: var(--type-body-l-size);
  transition: border-color var(--dur-ring) ease;
}

.acctf__input input::placeholder { color: var(--color-on-surface-variant); }

.acctf__input input:focus {
  border-color: var(--accent-ring-hover);
  outline: none;
}

.acctf__input--reveal input { padding-right: 52px; }

.acctf__reveal {
  position: absolute;
  right: var(--space-l);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  transition: color var(--dur-ring) ease;
}

.acctf__reveal:hover,
.acctf__reveal:focus-visible { color: var(--color-on-surface); outline: none; }

.acctf__hint {
  padding-top: var(--space-s);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  line-height: 1.45;
}

/* Right-aligned under its field, which is where the frame puts
   "Forgot Password?". */
.acctf__link {
  align-self: flex-end;
  padding-top: var(--space-m);
  color: var(--accent-action);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
}

.acctf__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  padding-top: var(--space-2xl);
}

.acctf__primary {
  width: 100%;
  height: 52px;
  justify-content: center;
}

.acctf__primary[disabled] { opacity: 0.4; cursor: not-allowed; }

.acctf__cancel {
  color: var(--accent-action);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
}

/* ---- The four-box code: Connect your TV, Choose a PIN ------------------- */

.acctf__digits {
  display: flex;
  justify-content: center;
  gap: var(--space-l);
}

.acctf__digit {
  width: 52px;
  height: 64px;
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-s);
  background: var(--color-background);
  color: var(--color-on-surface);
  font-family: inherit;
  font-size: var(--type-heading-s-size);
  font-weight: var(--type-weight-semi-bold);
  text-align: center;
  transition: border-color var(--dur-ring) ease;
}

.acctf__digit:focus { border-color: var(--accent-ring-hover); outline: none; }

/* ---- The stored card --------------------------------------------------- */

.acctf__method { display: flex; align-items: center; gap: var(--space-l); }

.acctf__methodText { display: flex; flex-direction: column; gap: var(--space-2xs); }

.acctf__methodName {
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
}

.acctf__dots { font-weight: var(--type-weight-regular); letter-spacing: 0.08em; }

.acctf--payment .acctf__hint { padding-top: 0; }

/* ---- Billing history --------------------------------------------------- */

/* The one page in the flow the frame gives the full column to: a
   transaction table does not fit in a form's width. Figma 30268:219581. */
.shell--acctf-wide .bill { width: 798px; max-width: 100%; }

.bill {
  display: flex;
  flex-direction: column;
  padding: var(--space-2xl);
  border-radius: var(--radius-s);
  background: var(--color-background-container);
}

.bill__next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-l);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-white-20);
}

.bill__rowText { display: flex; flex-direction: column; gap: var(--space-2xs); text-align: left; }

.bill__nextTitle {
  color: var(--color-on-surface);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

.bill__nextAmount {
  color: var(--color-on-surface);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

.bill__when { color: var(--color-on-surface-variant); font-size: var(--type-body-s-size); }

.bill__heading {
  padding: var(--space-2xl) 0 var(--space-l);
  color: var(--color-on-surface);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

.bill__rows { display: flex; flex-direction: column; }

/* The frame bands alternate rows rather than ruling between them. */
.bill__row {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  padding: var(--space-l);
  border-radius: var(--radius-s);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-ring) ease;
}

/* The frame bands alternate rows with a lift off the card. On this palette
   that lift is white at 5% — `--color-surface-variant` is #4A5455, a warm
   grey that reads as a different material dropped onto the navy rather than
   as the same surface, slightly raised. */
.bill__row:nth-child(odd) { background: var(--color-white-5); }
.bill__row:hover,
.bill__row:focus-visible { background: var(--color-white-5); outline: none; }

.bill__plan {
  color: var(--color-on-surface);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
}

.bill__amount {
  margin-left: auto;
  color: var(--color-on-surface);
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-semi-bold);
}

.bill__tail { display: flex; color: var(--color-on-surface-variant); }
.bill__tail .icon { transform: rotate(90deg); }

.bill__tax {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  margin-top: var(--space-2xl);
  padding: var(--space-l);
  border-radius: var(--radius-s);
  background: var(--color-white-5);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
}

.bill__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding-top: var(--space-2xl);
}

.bill__page {
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-m);
  border-radius: var(--radius-s);
  background: var(--color-white-5);
  color: var(--color-on-surface);
  font-family: inherit;
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  cursor: pointer;
  transition: background var(--dur-ring) ease, color var(--dur-ring) ease;
}

.bill__page[aria-current='true'] {
  background: var(--accent-action);
  color: var(--color-on-primary);
}

.bill__page[disabled] {
  background: transparent;
  color: var(--color-on-surface-variant);
  cursor: not-allowed;
}

.bill__showing {
  padding-top: var(--space-m);
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  text-align: center;
}

/* ---- The plan chooser --------------------------------------------------
   Figma 30268:218071, to its own arithmetic: the content frame is 1208, the
   segmented control 340 x 48 centred in it, 20 under that, three 392 x 313
   cards with 16 between them, and a 402-wide button block 40 below. */

.shell--acctf-plan .plan-choose { width: 1208px; max-width: 100%; }

.plan-choose { display: flex; flex-direction: column; align-items: center; }

/* The segmented control. Two halves of one pill, the chosen one filled. */
.seg {
  display: flex;
  width: 340px;
  height: 48px;
  padding: var(--space-xs);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-white-20);
}

.seg__opt {
  flex: 1 1 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-surface-variant);
  font-family: inherit;
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-semi-bold);
  cursor: pointer;
  transition: background var(--dur-ring) ease, color var(--dur-ring) ease;
}

.seg__opt[aria-checked='true'] {
  background: var(--accent-action);
  color: var(--color-on-primary);
}

.seg__opt:focus-visible { outline: 2px solid var(--accent-ring-hover); outline-offset: 2px; }

.plan-choose__grid {
  display: grid;
  grid-template-columns: repeat(3, 392px);
  gap: 16px;
  margin-top: var(--space-xl);
}

.planc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-s);
  min-height: 313px;
  padding: var(--space-2xl);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-ring) ease, background var(--dur-ring) ease;
}

.planc:hover,
.planc:focus-visible { border-color: var(--accent-ring-hover); outline: none; }

.planc[aria-checked='true'] {
  border-color: var(--accent-action);
  background: var(--accent-wash);
}

.planc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  width: 100%;
}

.planc__name {
  color: var(--color-on-surface);
  font-size: var(--type-body-xl-size);
  font-weight: var(--type-weight-semi-bold);
}

/* The frame's radio: an empty ring until chosen, then the accent with a
   tick in it. */
.planc__disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 2px solid var(--accent-action);
  border-radius: var(--radius-full);
  color: transparent;
  transition: background var(--dur-ring) ease, color var(--dur-ring) ease;
}

.planc[aria-checked='true'] .planc__disc {
  background: var(--accent-action);
  color: var(--color-on-primary);
}

.planc__priceRow { display: flex; align-items: baseline; gap: var(--space-xs); flex-wrap: wrap; }

.planc__price {
  color: var(--color-on-surface);
  font-size: var(--type-heading-s-size);
  font-weight: var(--type-weight-semi-bold);
  line-height: 1.1;
}

.planc__per,
.planc__was {
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-regular);
}

.planc__offer {
  color: var(--accent-action);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.planc__trial { color: var(--color-on-surface-variant); font-size: var(--type-body-s-size); }

.planc__lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding-top: var(--space-s);
}

.planc__lines li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
  color: var(--color-on-surface);
  font-size: var(--type-body-s-size);
  line-height: 1.45;
}

.planc__lines .icon { flex: 0 0 auto; color: var(--accent-action); }

/* 402 wide and 40 under the cards, as the frame's Button Footer has it.
   There is no Cancel on this screen in the frame and none added: the back
   control at the gutter is the way out of every page in this flow. */
.plan-choose__actions {
  display: flex;
  justify-content: center;
  width: 402px;
  max-width: 100%;
  margin-top: var(--space-4xl);
}

.plan-choose__actions .acctf__primary { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .page-back, .acctf__input input, .acctf__digit, .seg__opt,
  .bill__row, .bill__page, .planc, .planc__disc { transition: none; }
}

/* ==========================================================================
   9b. THE BACK CONTROL — one shape, one position, every screen
   --------------------------------------------------------------------------
   AT THE FRAME GUTTER, not inside whatever block follows it. Centred
   content and left-aligned content both sit under it at the same x, which
   is the whole point: a reader moving between these screens finds it in the
   same place every time rather than hunting for it beside a heading.

   It carries the appbar's clearance so the block under it does not have to,
   which is why `.head` and `.acctf__copy` both lose their top padding when
   one of these precedes them. See the note in js/ui.js, back().
   ========================================================================== */

/* POSITIONED AGAINST THE PAGE, not against whatever column follows it.
   `.main-content` is the positioning context and the gutter is the x, so
   the control is in the same place on a screen whose content starts at the
   rail gutter and on one whose content the frame centres in 1440. It is a
   `.button-icon` in everything but name — same 44, same ground, same
   primary@30 ring — because it is a secondary action and this set already
   has one of those. */
.main-content { position: relative; }

/* THE GLYPH AND ITS HIT AREA, nothing else. It was a 44px disc with a ring
   and a ground — the treatment this set gives an action — and going back is
   not an action, it is a way out. A filled circle was also the heaviest
   thing on the screen before the reader had got to anything.

   The box stays 44 so the target does; only the drawing goes. */
/* THE SAME COLUMN AS EVERYTHING ELSE. The bar ran gutter to gutter, the
   full width of the frame, which did not matter while it held nothing
   but a kicker at its left end. It carries the view switch at its right
   end now, and against a 1208 content column a control sitting at the
   1376 frame edge is the page's third right edge. Capped so the bar ends
   exactly where the grid does; the 10px pull on the left is kept,
   because that is what optically lines the arrow's glyph up with the
   text under it. Below ~1336 the cap is not reached and the bar is
   gutter to gutter as before. */
.pagebar {
  position: absolute;
  left: calc(var(--frame-gutter) - 10px);
  top: calc(var(--appbar-height) + var(--space-2xl));
  right: auto;
  width: calc(100% - 2 * var(--frame-gutter) + 10px);
  max-width: calc(1208px + 10px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-s);
  height: 44px;
}

.page-back {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-on-surface-variant);
  transition: color var(--dur-ring) ease;
}

/* THE PAGE'S NAME, AT THE KICKER'S SIZE. It was 26px in full white for
   one round and that was far too loud for the smallest fact on the
   screen — and it forced the real heading underneath to be deleted so
   the name was not printed twice. This is `.head__kicker` exactly: 14,
   semi-bold, uppercase, tracked, variant ink. The headings are back. */
/* Pushed to the far end of the bar, which is otherwise empty from the
   kicker to the right gutter. `margin-left: auto` rather than
   `justify-content: space-between`, so the kicker stays beside its arrow
   when there is no tool on the page. */
.pagebar__tool { margin-left: auto; }

.pagebar__name {
  min-width: 0;
  margin: 0;
  color: var(--color-on-surface-variant);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semi-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pagebar__name:empty { display: none; }

.page-back:hover,
.page-back:focus-visible { color: var(--color-on-surface); outline: none; }


.page-back:focus-visible {
  outline: 2px solid var(--accent-ring-hover);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

/* The two screens with no app bar put it where the bar would have been. */
[data-screen='add'] .pagebar,
[data-screen='who'] .pagebar { top: var(--space-4xl); }

/* ---- The profile, with no head above its rails -------------------------
   The page opens straight onto a rail, and there is nothing above it any
   more — no heading block, no back control, and since this is the screen
   the prototype opens on, no name either.

   WHICH MEANS THE CLEARANCE IS DOING ALL OF THE WORK, and 32 was not
   enough of it. That number came from the account page, where the frame
   puts its first label 32 under the bar — but that label is small, grey
   and set in caps, and this is a 20px rail title with a row of artwork
   right behind it. With nothing above it at all, a rail starting 32px
   under a translucent bar reads as content that has been pushed up into
   the chrome rather than as a page that begins there. 64 is the gap the
   rest of this set leaves between blocks, and it is the one that makes
   the page look deliberate. */
[data-screen='profile'] .main-content > .rail:first-of-type {
  padding-top: calc(var(--appbar-height) + var(--space-5xl));
}

@media (prefers-reduced-motion: reduce) {
  .hero { opacity: 1; }
  .hero__media { transform: none; }
}


/* ==========================================================================
   19. A COLLECTION'S PAGE, AND A SHELF'S TWO VIEWS
   --------------------------------------------------------------------------
   A collection leads with the billboard the home page leads with; a shelf
   leads with its argument. Both end in the same titles.

   THE COLLECTION'S OWN PAGE IS GONE and it is this page now. It had its
   own shell and its own bare grid — no actions, no views, no way to keep
   it — which made the claim the card is making (a collection is a shelf
   BritBox wrote) true on the rail and false the moment you pressed it.
   `D.asShelf()` hands it over in a shelf's shape; the only thing it adds
   is a contained hero, because it is the only one of the two with a
   plate to show.
   ========================================================================== */

.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card-vertical-width));
  gap: var(--space-xl);
  padding-bottom: var(--space-5xl);
}

/* ---- The two views -----------------------------------------------------
   COVERS ARE THE DEFAULT. Reading was, on the argument that the reasons
   are the point — they are, and they are still one press away, but a
   column of 367px rows means six titles is a page nobody reaches the
   bottom of, and the first question you bring to a shelf off a rail is
   what is on it.

   THE SWITCH IS IN THE ACTIONS ROW. It had a row of its own carrying
   itself and a count, and the count was already in the byline four lines
   above it — a whole row of furniture to repeat one number.

   BOTH VIEWS ARE ALWAYS IN THE DOM and the stylesheet hides one, so
   switching cannot lose a rating or a My List state: nothing is rebuilt. */

.viewswitch {
  margin-left: auto;
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-xs);
  border: 1px solid var(--color-white-20);
  border-radius: var(--radius-full);
}

.viewswitch__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  transition: background var(--dur-ring) ease, color var(--dur-ring) ease;
}

.viewswitch__opt:hover,
.viewswitch__opt:focus-visible { color: var(--color-on-surface); outline: none; }

.viewswitch__opt[aria-checked='true'] {
  background: var(--color-surface);
  color: var(--color-on-surface);
}

.shell--shelf[data-view='list'] .entries-grid { display: none; }
.shell--shelf[data-view='grid'] .entries { display: none; }

/* ---- Sharing, in place ---------------------------------------------------
   It used to be ?send=1: a navigation, a fresh document, the entrance
   re-run, and a panel above the list you were reading — for a share sheet.
   The same 0fr grid row the maturity picker uses, so the page grows
   instead of being replaced. */
.send {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-bottom: 0;
  transition: grid-template-rows var(--dur-send) var(--ease-send),
              opacity var(--dur-send) var(--ease-send),
              margin-bottom var(--dur-send) var(--ease-send);
}

.send[data-open='true'] {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: var(--space-2xl);
}

/* ---- A button that is a disclosure, drawn as one ------------------------
   The caret is the state. It points down while the panel is shut and up
   while it is open, which is the one thing the control was not doing —
   pressing it a second time put the panel away and left the button
   looking exactly as it had, so the panel read as having been dismissed
   rather than closed. */
.disclose__caret {
  display: flex;
  margin-left: calc(var(--space-xs) * -1);
  transform: rotate(90deg);
  /* Turns with the panel it opens, on the panel's own timing. */
  transition: transform var(--dur-send) var(--ease-send);
}

.disclose[aria-expanded='true'] .disclose__caret { transform: rotate(-90deg); }

/* The clip has to be on a wrapper INSIDE the 0fr row, or the row has
   nothing to collapse — and it cannot be the same element that carries the
   panel's padding and border, or the collapsed state is 66px of border
   box. One more div, and it is load-bearing. */
.send__clip { overflow: hidden; }
.send[data-open='false'] .send__clip { visibility: hidden; }

/* ---- The three buttons that now answer ----------------------------------
   One beat when the state changes, the same one the rating's disc gets.

   THE DISC IS THE THIRD. On the hover panel My List is a round icon rather
   than a word, and it was the one place that still offered to add a title
   that was already on the list — a plus with no handler behind it, on
   every card of a rail made entirely of things you had already added. It
   reads the list now and draws a tick when the answer is yes.

   AND THE TICK DOES NOT FILL IT, same rule as the rating: a filled disc in
   that row is the primary action, and there is one of those on the card
   already. The ring goes solid and the glyph takes the accent. */
.list-button.is-landed,
.save-button.is-landed,
.list-disc.is-landed { animation: rate-landed var(--dur-landed) var(--ease-rate); }

/* And the press itself, on every control in this set that answers. The
   rating's options had nothing, so clicking one felt like clicking the
   card behind it. */
.list-button:active,
.save-button:active,
.list-disc:active,
.button-icon:active,
.button-primary:active,
.button-ghost:active { transform: scale(0.97); }

/* The four controls whose words change. `nowrap` is load-bearing: the
   width eases from the old size to the new one with the NEW label
   already in the box, so without it a growing button wraps its text for
   the length of the animation. */
.list-button,
.save-button,
.disclose,
.add__delete { white-space: nowrap; }

.list-button[aria-pressed='true'],
.save-button[aria-pressed='true'],
.list-disc[aria-pressed='true'] {
  border-color: var(--color-on-surface);
  color: var(--color-on-surface);
}

.list-button[aria-pressed='true'] .icon,
.save-button[aria-pressed='true'] .icon,
.list-disc[aria-pressed='true'] .icon { color: var(--accent-action); }

@media (prefers-reduced-motion: reduce) {
  .send, .viewswitch__opt { transition: none; }
  .list-button.is-landed, .save-button.is-landed,
  .list-disc.is-landed { animation: none; }
}
