/* changelog.css — /changelog/ feed (page-changelog*.hbs). Layout and resting states
   only: directed or delayed transitions are driven by assets/js/changelog.js (Web
   Animations API). Nothing hides content — the noscript block ships panels expanded. */

.changelog-page {
  /* The zen palette is scoped to the homepage sections, so the accents are
     re-declared here; --cl-forest holds 5.72:1 on white. */
  --cl-forest: #506d59;
  --cl-sage: #90ab8b;
  --cl-blue: #2563eb;
  --cl-amber: #a16207;
  --cl-row-pad: 1.25rem;
  --cl-row-in: 0.5rem;
  /* Entry rows are [date/version | text | chevron]; the panel reuses the same
     two measures so details and media line up with the title. */
  --cl-meta-w: 7rem;
  --cl-col-gap: 1.25rem;
  /* The sticky controls follow --chrome-offset (screen.css) so the bar rises
     with the header when the chrome yields, instead of leaving a hole. */
  --cl-tab-pad: 0.25rem;
  --cl-sticky-top: var(--chrome-offset);
  --cl-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --cl-tab-track: var(--surface-soft);
  --cl-tab-thumb: var(--color-card);
  --cl-tab-thumb-border: var(--color-border);
  --cl-muted-glass: var(--color-muted);
  padding: var(--space-2xl) 0 var(--space-6xl);
}

:root[data-theme="dark"] .changelog-page {
  --cl-forest: #a7c6ae;
  --cl-sage: #7d9a82;
  --cl-blue: #7ab0ff;
  --cl-amber: #fbbf24;
  /* In dark the selected tab reads lighter than its track, not darker. */
  --cl-tab-track: #161a18;
  --cl-tab-thumb: #232a26;
  --cl-tab-thumb-border: #343b37;
  --cl-muted-glass: var(--color-muted);
}

/* Dark accents are light: the pressed-chip tick must go dark with them (a white
   tick on #a7c6ae is ~1.7:1). */
:root[data-theme="dark"] .cl-chip-tick {
  color: #101312;
}

/* Mask behind the fixed header pill: rows sliding under the translucent pill
   would read as noise. It matches the offset used by the pinned month bar. */
.changelog-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--chrome-offset);
  z-index: 40;
  background: var(--color-bg);
  pointer-events: none;
}

.cl-feed {
  width: 100%;
  margin: 0 auto;
}

/* ---------------------------------------------------------- header --- */

.cl-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end; /* pill sits right; the heading lives in doc-head */
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

/* ------------------------------------------------------- subscribe --- */

.cl-subscribe {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
}

.cl-subscribe-shake {
  display: inline-flex;
}

/* Ring surface: the shell paints the frame, .cl-subscribe-inner is the face.
   Width is measured by JS from the face, so it adds one ring width per side. */
.cl-subscribe-shell {
  display: inline-flex;
  align-items: center;
  height: 44px;
  --ring-color: var(--color-border-strong);
  --ring-face: var(--color-card);
  overflow: hidden; /* the morph clips its own states */
  /* width: the shell's size IS its state — JS measures it from the face, and a
     transform would falsify the box the form lives in (DESIGN.md → Motion,
     documented layout morph). */
  transition: width var(--dur-base) var(--ease-out);
}

.cl-subscribe-shell[data-state="editing"],
.cl-subscribe-shell[data-state="done"] {
  justify-content: center;
}

.cl-subscribe-shell[data-error="true"] {
  --ring-color: var(--color-error-fg);
}

.cl-subscribe-shell.ring > .cl-subscribe-inner {
  /* Three classes on purpose: the page's sheets load BEFORE screen.css in this
     theme, so an equal-specificity rule loses to `.ring > .ring-face`. */
  display: inline-flex;
  align-items: center;
  height: 100%;
  width: max-content;
  /* The face must NOT shrink to the shell: the shell's width is measured FROM
     this box, and `min-width: 0` would report the clipped width and freeze the
     morph. */
  flex: 0 0 auto;
  min-width: max-content;
}

.cl-subscribe-idle,
.cl-subscribe-done {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  height: 44px;
  padding: 0 1.1rem;
  border: 0;
  background: transparent;
  color: var(--color-heading);
  font: inherit;
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  white-space: nowrap;
  cursor: pointer;
}

.cl-subscribe-idle {
  text-decoration: none;
}

.cl-subscribe-idle:focus-visible,
.cl-subscribe-undo:focus-visible,
.cl-subscribe-send:focus-visible {
  outline: var(--focus-w) solid var(--focus-color);
  --focus-color: var(--color-heading);
  outline-offset: -2px;
}

.cl-subscribe-bell {
  flex: 0 0 auto;
  color: var(--cl-forest);
}

.cl-subscribe-form {
  display: none;
  align-items: center;
  gap: var(--space-2xs);
  height: 44px;
  padding: 0 0 0 1.1rem;
}

.cl-subscribe-done {
  display: none;
  gap: var(--space-xs);
  color: var(--cl-forest);
}

/* State machine: only the active step is rendered. */
.cl-subscribe-shell[data-state="editing"] .cl-subscribe-idle,
.cl-subscribe-shell[data-state="done"] .cl-subscribe-idle,
.cl-subscribe-shell[data-state="idle"] .cl-subscribe-form,
.cl-subscribe-shell[data-state="idle"] .cl-subscribe-done,
.cl-subscribe-shell[data-state="editing"] .cl-subscribe-done,
.cl-subscribe-shell[data-state="done"] .cl-subscribe-form {
  display: none;
}

.cl-subscribe-shell[data-state="editing"] .cl-subscribe-form {
  display: inline-flex;
}

.cl-subscribe-shell[data-state="done"] .cl-subscribe-done {
  display: inline-flex;
}

.cl-subscribe-form input {
  width: 15rem;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-heading);
  font: inherit;
  font-size: var(--fs-caption);
}

.cl-subscribe-form input:focus {
  outline: none;
}

.cl-subscribe-form input::placeholder {
  color: var(--color-muted);
}

.cl-subscribe-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  cursor: pointer;
}

.cl-subscribe-check {
  flex: 0 0 auto;
}

.cl-subscribe-undo {
  min-height: 36px;
  padding: 0.35rem 0.6rem;
  border: 0;
  --r: var(--radius-xs);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-size: var(--fs-caption);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.cl-subscribe-undo:hover {
  color: var(--color-heading);
}

/* The caption role owns the type; the rules below own the box and the muted ink. */
.cl-subscribe-note {
  min-height: 1.2em;
  margin: 0;
  color: var(--color-muted);
  text-align: right;
}

.cl-subscribe-note[data-error="true"] {
  color: var(--color-error-fg);
}

/* -------------------------------------------------------- toolbar --- */

.cl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.cl-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.cl-chip,
.cl-clear {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-card);
  color: var(--color-body);
  font: inherit;
  font-size: var(--fs-caption);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

/* Chips are ring surfaces. .cl-clear keeps a dashed border — a documented ring
   exception, since a dash pattern is the message. */
.cl-chip {
  --ring-color: var(--color-border);
  --ring-face: var(--color-card);
  border: 0;
  background: var(--ring-color);
}

/* The shared support chip pads its outer box; keep only the ring width here and
   carry the content padding on the face. */
.cl-toolbar .cl-chip {
  padding: var(--ring-w);
}

.cl-clear {
  padding: 0.35rem 0.85rem;
}

.cl-chip > .ring-face {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.35rem 0.85rem;
}

.cl-clear:hover {
  border-color: var(--color-border-strong);
  color: var(--color-heading);
}

.cl-chip:hover {
  color: var(--color-heading);
}

/* Pressed: an opaque sage face — a translucent one lets the ring colour bleed
   through the middle of the chip. */
.cl-chip[aria-pressed="true"] {
  --ring-color: var(--cl-forest);
  --ring-face: color-mix(in srgb, var(--cl-sage) 18%, var(--color-card));
  color: var(--color-heading);
}

.cl-chip:focus-visible {
  outline: var(--focus-w) solid var(--focus-color);
  --focus-color: var(--color-heading);
}

.cl-clear:focus-visible {
  outline: var(--focus-w) solid var(--focus-color);
  --focus-color: var(--color-heading);
  outline-offset: 2px;
}

.cl-chip-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--cl-kind, var(--color-border-strong));
  background: transparent;
  /* 7 → 16 is the state, not a travel: a scaled box would redraw the 1.5px
     ring at a different weight and a ::before would spill into the label —
     size transition kept, documented in DESIGN.md → Motion. */
  transition:
    width var(--dur-base) var(--ease-out),
    height var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

.cl-chip[data-kind="new"] {
  --cl-kind: var(--cl-forest);
}

.cl-chip[data-kind="improved"] {
  --cl-kind: var(--cl-blue);
}

.cl-chip[data-kind="fixed"] {
  --cl-kind: var(--cl-amber);
}

.cl-chip[aria-pressed="true"] .cl-chip-mark {
  width: 16px;
  height: 16px;
  border-color: var(--cl-kind);
  background: var(--cl-kind);
}

.cl-chip-tick {
  display: inline-flex;
  color: #fff;
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.cl-chip[aria-pressed="true"] .cl-chip-tick {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.06s;
}

.cl-chip-count {
  font-variant-numeric: tabular-nums;
  color: var(--color-muted);
}

.cl-chip[aria-pressed="true"] .cl-chip-count {
  color: var(--color-heading);
}

.cl-clear {
  border-style: dashed;
  color: var(--color-muted);
}

.cl-clear[hidden] {
  display: none;
}

.cl-shown {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--color-heading);
}

.cl-shown-suffix {
  color: var(--color-muted);
}

/* ----------------------------------------------------- month bar --- */

/* Filters, result count and month controls share ONE opaque sticky surface, so
   scrolled rows never show through any part of the control area. */
.cl-sticky-controls {
  position: sticky;
  top: var(--cl-sticky-top);
  z-index: 30;
  background: var(--color-bg);
  border-bottom: 1px solid transparent;
}

.cl-monthbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
  padding: var(--space-md) 0;
}

.cl-sticky-controls[data-stuck="true"] {
  border-bottom-color: var(--color-border);
  box-shadow: 0 12px 16px -16px rgba(0, 0, 0, 0.55);
}

.cl-monthbar-label {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  min-width: 0;
}

.cl-month-roll {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  letter-spacing: var(--track-tight);
  color: var(--color-heading);
}

.cl-month-year {
  font-weight: var(--fw-regular);
  color: var(--cl-muted-glass);
}

.cl-month-count {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2xs);
  font-variant-numeric: tabular-nums;
  color: var(--cl-muted-glass);
  white-space: nowrap;
}

/* Segmented control: one track, one thumb that slides between tabs. The track
   carries the inset (--cl-tab-pad); the thumb sits at `left: 0` and a JS
   transform, measured from the first tab's left edge, moves it. */
.cl-monthnav {
  position: relative;
  display: inline-flex;
  --ring-color: var(--color-border);
  --ring-face: var(--cl-tab-track);
}

.cl-monthnav-face {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--cl-tab-pad);
}

.cl-monthnav button {
  position: relative;
  z-index: 1;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2xs) var(--space-xs);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  cursor: pointer;
  transition: color 0.2s var(--ease-out);
}

.cl-monthnav button:hover {
  color: var(--color-heading);
}

.cl-monthnav button[aria-current="true"] {
  color: var(--color-heading);
  font-weight: var(--fw-bold);
}

.cl-monthnav button[hidden] {
  display: none;
}

.cl-monthnav button:focus-visible {
  outline: var(--focus-w) solid var(--focus-color);
  --focus-color: var(--color-heading);
  outline-offset: 2px;
}

.cl-month-pill > .ring-face {
  display: block;
  height: 100%; /* the thumb's height is set on the outer (absolute box) */
}

.cl-month-pill {
  position: absolute;
  /* The containing block is the track's padding box, which starts inside the
     ring: the thumb clears the frame plus the track's own inset. */
  top: calc(var(--ring-w) + var(--cl-tab-pad));
  left: 0;
  height: calc(100% - 2 * (var(--ring-w) + var(--cl-tab-pad)));
  --ring-color: var(--cl-tab-thumb-border);
  --ring-face: var(--cl-tab-thumb);
  pointer-events: none;
  /* width follows the month label's measured box while transform slides it —
     the resize is the content, documented in DESIGN.md → Motion. */
  transition:
    transform var(--dur-base) var(--ease-out),
    width var(--dur-base) var(--ease-out);
}

/* Clear the full sticky controls stack for deep links and focus scrolling. */
.changelog-page [id] {
  scroll-margin-top: calc(var(--cl-sticky-top) + 14rem);
}

/* --------------------------------------------------------- list --- */

/* The page is the single scroller: that is what lets the month bar stick. */
.cl-scroller {
  overflow: visible;
  /* Filtering collapses rows above the fold. The browser's own scroll anchoring
     would correct at the same moment the script moves the page to the first
     visible group and the two would add up: the script owns the position. */
  overflow-anchor: none;
}

.cl-list {
  padding: 0 0 var(--space-xs);
}

/* --------------------------------------------------------- groups --- */

.cl-group {
  padding: 0 var(--cl-row-pad);
}

.cl-group-title {
  margin: 0;
  padding: var(--space-xl) 0 var(--space-sm);
  color: var(--cl-forest);
}

/* The month bar names the newest month right above the list, so a visible title
   would repeat it; the heading stays in the tree as the group's aria-labelledby
   target. Higher specificity than `.cl-group-title` on purpose: this sheet loads
   after screen.css and would lose to `.sr-only` on padding. */
.cl-group[data-first="true"] > .cl-group-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.cl-entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cl-entry {
  border-top: 1px solid var(--color-border);
}

.cl-entry:first-child {
  border-top-color: transparent;
}

.cl-row {
  display: grid;
  grid-template-columns: var(--cl-meta-w) minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--cl-col-gap);
  width: 100%;
  padding: var(--space-md) var(--cl-row-in);
  border: 0;
  --r: var(--radius-md);
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cl-row:focus-visible {
  outline: var(--focus-w) solid var(--focus-color);
  --focus-color: var(--color-heading);
  outline-offset: -2px;
}

.cl-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.15rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.cl-meta time {
  font-variant-numeric: tabular-nums;
  color: var(--color-body);
}

.cl-version {
  align-self: flex-start;
  --ring-r: var(--radius-xs);
  --ring-color: var(--color-border);
  --ring-face: var(--surface-soft);
  font-family: var(--cl-mono);
  font-size: var(--fs-label);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

.cl-version > .ring-face {
  display: inline-flex;
  padding: 0.05rem 0.4rem;
}

.cl-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

/* The kind label's shape lives in support.css (the shared sheet); here the page
   supplies only its vocabulary — the three accents scoped to .changelog-page. */
.cl-kind[data-kind="new"] {
  --kind-color: var(--cl-forest);
}

.cl-kind[data-kind="improved"] {
  --kind-color: var(--cl-blue);
}

.cl-kind[data-kind="fixed"] {
  --kind-color: var(--cl-amber);
}

.cl-entry-title {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  line-height: var(--lh-ui);
  color: var(--color-heading);
  text-wrap: balance;
}

.cl-entry-summary {
  max-width: 62ch;
  font-size: var(--fs-caption);
  line-height: var(--lh-prose);
  color: var(--color-body);
  text-wrap: pretty;
}

.cl-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px; /* 32-grid: the face grows to the top tier, glyph stays 16 */
  margin-top: 0; /* the 32px box centres without a nudge */
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  transition: transform var(--dur-base) var(--ease-out);
}

.cl-entry[data-open="true"] .cl-chevron {
  transform: rotate(180deg);
  color: var(--color-heading);
}

/* --------------------------------------------------------- panels --- */

/* 0fr → 1fr animates the height without measuring and needs no JS: the noscript
   block in the template forces 1fr when nothing enhances. */
.cl-panel {
  display: grid;
  grid-template-rows: 0fr;
  /* Rows, not height: the panel's height is content-sized and unknowable in
     CSS — the same accordion family as the FAQ stack (AGENTS.md, load-bearing
     580ms height). Documented in DESIGN.md → Motion. */
  transition: grid-template-rows var(--dur-base) var(--ease-out);
}

.cl-entry[data-open="true"] .cl-panel {
  grid-template-rows: 1fr;
}

.cl-panel-inner {
  /* Details first, then the media, both on the body column: the same left
     measure the title uses, so nothing runs under the date column. */
  display: block;
  /* The group already contributes --cl-row-pad, so this adds the row's own
     inset plus the two column measures. */
  padding: 0 var(--cl-row-pad) 1.5rem
    calc(var(--cl-row-in) + var(--cl-meta-w) + var(--cl-col-gap));
  min-height: 0;
  overflow: hidden;
  /* Collapsed content leaves the tab order even where `inert` is missing; the
     no-JS block flips this back on with the open grid row. */
  visibility: hidden;
}

.cl-entry[data-open="true"] .cl-panel-inner {
  visibility: visible;
}

.cl-details {
  margin: 0;
  padding: 0 0 var(--space-lg);
  max-width: 62ch;
  list-style: none;
  font-size: var(--fs-caption);
  line-height: var(--lh-prose);
  color: var(--color-body);
}

.cl-details li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: var(--space-xs);
}

.cl-details li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--cl-sage);
}

.cl-details li:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------- media: photo --- */

.cl-photo {
  margin: 0;
  max-width: 16rem;
}

.cl-photo-frame {
  --ring-r: var(--radius-lg);
  --ring-color: var(--color-border);
  --ring-face: var(--color-bg-muted);
}

.cl-photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top;
}

.cl-photo figcaption {
  margin-top: var(--space-xs);
  font-size: var(--fs-label);
  line-height: var(--lh-body);
  color: var(--color-muted);
}

/* -------------------------------------------------- media: code --- */

.cl-code {
  max-width: 34rem;
  margin: 0;
  --ring-r: var(--radius-md);
  --ring-color: var(--color-border);
  --ring-face: var(--surface-soft);
}

.cl-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) 0.875rem;
  border-bottom: 1px solid var(--color-border);
}

.cl-code-file {
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.cl-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  --r: var(--radius-xs);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.cl-copy:hover {
  color: var(--color-heading);
}

.cl-copy:focus-visible {
  outline: var(--focus-w) solid var(--focus-color);
  --focus-color: var(--color-heading);
  outline-offset: -2px;
}

.cl-copy-check {
  display: none;
  color: var(--cl-forest);
}

.cl-copy[data-copied="true"] .cl-copy-icon {
  display: none;
}

.cl-copy[data-copied="true"] .cl-copy-check {
  display: block;
}

.cl-code-body {
  margin: 0;
  padding: 0.875rem;
  overflow-x: auto;
  font-family: var(--cl-mono);
  font-size: var(--fs-label);
  line-height: var(--lh-prose);
  color: var(--color-heading);
}

.cl-code-body code {
  font: inherit;
}

/* ----------------------------------------------------- swap units --- */

/* Every swapping value (month name, counts, suffixes) is a grid slot so incoming
   and outgoing share one cell: the box never grows and both read as one
   cross-fade. The base style is the resting state and `data-state` holds the
   offset, so a frozen document shows the clean result. */
.cl-roll,
.cl-swap,
.cl-month-roll {
  display: inline-grid;
}

.cl-roll {
  justify-items: center;
  overflow: hidden;
  vertical-align: bottom;
  --cl-swap-rise: 60%;
}

.cl-month-roll {
  --cl-swap-rise: 12px;
  --cl-swap-blur: 3px;
}

.cl-swap {
  --cl-swap-rise: 6px;
  --cl-swap-blur: 3px;
}

.cl-swap-item {
  grid-area: 1 / 1;
  font-variant-numeric: tabular-nums;
  transition:
    opacity 0.2s var(--ease-out),
    translate 0.26s var(--ease-out),
    filter 0.26s var(--ease-out);
}

.cl-swap-item[data-state="in-up"],
.cl-swap-item[data-state="in-down"],
.cl-swap-item[data-state="in-fade"] {
  opacity: 0;
  filter: blur(var(--cl-swap-blur, 4px));
}

.cl-swap-item[data-state="in-up"] {
  translate: 0 var(--cl-swap-rise);
}

.cl-swap-item[data-state="in-down"] {
  translate: 0 calc(-1 * var(--cl-swap-rise));
}

.cl-swap-item[data-state="out-up"],
.cl-swap-item[data-state="out-down"],
.cl-swap-item[data-state="out-fade"] {
  opacity: 0;
  filter: blur(var(--cl-swap-blur, 4px));
}

.cl-swap-item[data-state="out-up"] {
  translate: 0 calc(-1 * var(--cl-swap-rise));
}

.cl-swap-item[data-state="out-down"] {
  translate: 0 var(--cl-swap-rise);
}

/* ------------------------------------------------------- endings --- */

.cl-empty {
  margin: 0;
  padding: var(--space-3xl) var(--cl-row-pad);
  text-align: center;
  color: var(--color-muted);
}

.cl-empty[hidden] {
  display: none;
}

.cl-end {
  margin: var(--space-2xl) 0 var(--space-xl);
  padding: 0 var(--cl-row-pad);
  color: var(--color-muted);
}

/* Entry rows removed by a filter: JS applies the FLIP transform, so this is the
   resting hidden state and the exit still reads as its fade + collapse. */
.cl-entry[data-filtered="true"] {
  display: none;
}

.cl-group[data-filtered="true"] {
  display: none;
}

/* ----------------------------------------------------- responsive --- */

@media (max-width: 900px) {
  .cl-group {
    padding: 0;
  }

  /* Two rows here (month + count, then the tabs). One row measured 351px of
     351px available in Spanish — no slack at all — and the Catalan count noun is
     longer still. Trimmed rather than forced. */
  .cl-monthbar {
    padding: var(--space-xs) 0;
    row-gap: 0.375rem;
  }
}

@media (max-width: 700px) {
  .cl-header {
    flex-direction: column;
  }

  .cl-subscribe {
    align-items: flex-start;
    width: 100%;
  }

  .cl-subscribe-shake {
    width: 100%;
  }

  .cl-subscribe-form input {
    width: 100%;
  }

  .cl-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-xs) var(--space-sm);
    padding: var(--space-md) var(--cl-row-in);
  }

  /* The segmented control spans the column here: three 44px tabs plus the track
     inset do not fit next to the month label on a phone. */
  .cl-monthnav {
    display: flex;
    width: 100%;
  }

  .cl-monthnav button {
    flex: 1 1 0;
  }

  /* The meta line sits above the text on phones, so the panel starts at the row
     inset instead of the body column. */
  .cl-panel-inner {
    padding-left: var(--cl-row-in);
  }

  .cl-meta {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-xs);
    grid-column: 1;
    order: -1;
  }

  .cl-body {
    grid-column: 1;
  }

  .cl-chevron {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .cl-photo {
    max-width: 100%;
  }

  .cl-photo-frame {
    max-width: 14rem;
  }

  .cl-subscribe-note {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cl-subscribe-shell,
  .cl-panel,
  .cl-chip-mark,
  .cl-chip-tick,
  .cl-chevron,
  .cl-swap-item,
  .cl-month-pill,
  .cl-monthbar,
  .changelog-page::before {
    transition: none;
  }
}
