/* =============================================================================
 * Connecting Covers — Component library
 * One block per component in 02-component-library.md. Depends on tokens.css +
 * base.css. Per-set color comes in via the inline --set-accent custom property.
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * TopNav
 * ------------------------------------------------------------------------- */
.cl-topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-page);
  border-bottom: 0.5px solid rgba(226, 75, 74, 0.4); /* crimson @ 40% */
}
.cl-topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.cl-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cl-brand__glyph { display: block; flex: 0 0 auto; }
/* Sentence-case wordmark per the rebrand (crimson "Covers"). */
.cl-brand__word {
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 17px;
  white-space: nowrap;
}
.cl-brand__word-accent { color: var(--accent); }
.cl-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.cl-nav__link {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--motion-fast) var(--ease-out);
}
.cl-nav__link:hover { color: rgba(255, 255, 255, 0.8); }
.cl-nav__link.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.cl-nav__cta {
  color: #fff;
  background: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border-bottom: none;
}
.cl-nav__cta:hover { color: #fff; background: var(--accent-strong); }

.cl-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--purple-600);
}
.cl-avatar.is-active { box-shadow: 0 0 0 2px var(--accent); }
.cl-avatar__initials { font-size: 13px; font-weight: 700; color: #fff; }
.cl-avatar__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1.5px solid var(--bg-page);
}

/* ---- Account dropdown (avatar menu) ---- */
.cl-usermenu { position: relative; display: inline-flex; }
.cl-usermenu__trigger {
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.cl-usermenu__trigger:focus-visible { box-shadow: var(--focus-ring); outline: none; }

.cl-usermenu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 208px;
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 48px -16px rgba(0, 0, 0, 0.75);
  padding: 6px;
  z-index: 200;
  /* Hidden by default; opened by toggling .is-open on .cl-usermenu (JS). */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--motion-fast) var(--ease-out),
              transform var(--motion-fast) var(--ease-out),
              visibility var(--motion-fast) var(--ease-out);
}
/* A tiny crimson cap so the panel reads as part of the brand chrome. */
.cl-usermenu__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--grad-completion);
}
.cl-usermenu.is-open .cl-usermenu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cl-usermenu__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--divider);
}
.cl-usermenu__name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.cl-usermenu__role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--purple-text);
}

.cl-usermenu__item {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-row);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  transition: background var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out);
}
.cl-usermenu__item:hover,
.cl-usermenu__item:focus-visible {
  background: var(--surface-2);
  color: #fff;
  outline: none;
}
.cl-usermenu__sep {
  height: 1px;
  margin: 4px 2px;
  background: var(--divider);
}
.cl-usermenu__item--danger { color: var(--accent-on-dark); }
.cl-usermenu__item--danger:hover,
.cl-usermenu__item--danger:focus-visible {
  background: rgba(226, 75, 74, 0.12);
  color: #fff;
}

/* ---------------------------------------------------------------------------
 * Status badges (shared)
 * ------------------------------------------------------------------------- */
.cl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.cl-badge--owned    { background: var(--success-deep); color: var(--success-text); }
.cl-badge--complete { background: var(--success-deep); color: var(--success-text); }
.cl-badge--missing  { background: transparent; color: var(--muted); border: 1px solid var(--muted-line); }
.cl-badge--searching{ background: transparent; color: var(--muted); border: 1px solid var(--muted-line); }
.cl-badge--watching { background: rgba(186, 117, 23, 0.18); color: var(--warn-text); }
.cl-badge--alert    { background: var(--accent-strong); color: #fff; }
.cl-badge--featured { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------------------
 * ConnectingDots
 * ------------------------------------------------------------------------- */
.cl-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px; /* 9px center-to-center with 4px dots */
}
.cl-dots__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--set-accent);
}
.cl-dots__dot:nth-child(1) { opacity: 1; }
.cl-dots__dot:nth-child(2) { opacity: 0.5; }
.cl-dots__dot:nth-child(3) { opacity: 0.25; }

/* ---------------------------------------------------------------------------
 * CoverCard (standard + wide)
 * ------------------------------------------------------------------------- */
.cl-card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform var(--motion-fast) var(--ease-out);
}
.cl-card:hover { transform: scale(var(--lift-scale)); }
.cl-card:hover .cl-art::after { opacity: 0.7; } /* fade retracts → more art */
.cl-card:focus-within { box-shadow: var(--focus-ring); }
.cl-card__art {
  aspect-ratio: 4 / 3;
}
.cl-card__art--grad-a { background: var(--grad-a); }
.cl-card__art--grad-b { background: var(--grad-b); }
.cl-card__art--grad-c { background: var(--grad-c); }
.cl-card__art--grad-d { background: var(--grad-d); }
.cl-card__art--grad-e { background: var(--grad-e); }
.cl-card__art img { width: 100%; height: 100%; object-fit: cover; }
/* Composite connecting art shown whole (no crop) on the surface, so the joined
 * scene reads end-to-end. Used with an inline natural aspect-ratio. */
.cl-card__art--contain { background: var(--surface-sunken); }
.cl-card__art--contain img { object-fit: contain; }
.cl-card__body { padding: var(--card-pad); }
.cl-card__title { margin-bottom: 4px; }
.cl-card__meta { margin-bottom: 10px; }
.cl-card__featured {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}
.cl-card--wide .cl-card__art { aspect-ratio: 16 / 6; }
.cl-card__ministrip {
  display: flex;
  gap: 0;
  margin-top: 10px;
  border-radius: var(--radius-row);
  overflow: hidden;
}
.cl-card__ministrip > * { flex: 1; aspect-ratio: 2 / 3; }

/* CoverCard — stacked variant (gallery grid).
 * Uniform 3:4 tile holding the set's individual covers stacked with row/column
 * offsets (each cover sliced from the composite via background-position). Uniform
 * height kills the panoramic/vertical deadspace problem in the grid. */
.cl-card--stack .cl-card__art {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: transparent;
}
.cl-card__stack { position: absolute; inset: 0; }
.cl-cover {
  position: absolute;
  aspect-ratio: 2 / 3;          /* a single comic cover */
  border-radius: 5px;
  border: 1px solid var(--border-hairline);
  background-color: var(--surface-2);
  background-repeat: no-repeat;
  box-shadow: -2px 3px 7px rgba(0, 0, 0, 0.5);  /* depth between stacked covers */
  /* 300ms = doubled rise/fall for the hover-shuffle pop. */
  transition: transform 0.3s var(--ease-out),
              box-shadow 0.3s var(--ease-out);
}
/* Hover-shuffle: the active cover pops in place (scaled, lifted) and rises above the
 * whole stack so it can be previewed. z-index needs !important to beat the inline
 * per-cover z-index set on each .cl-cover. */
.cl-card--stack .cl-cover.is-front {
  z-index: 60 !important;
  transform: scale(1.07) translateY(-3%);
  box-shadow: -5px 7px 16px rgba(0, 0, 0, 0.65);
}
.cl-card__count {
  position: absolute;
  top: 6px; left: 6px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: rgba(10, 10, 18, 0.78);
  border: 1px solid var(--border-hairline);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ---------------------------------------------------------------------------
 * FilterPills
 * ------------------------------------------------------------------------- */
.cl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cl-pill {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: 0.5px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: all var(--motion-fast) var(--ease-out);
}
.cl-pill:hover { color: rgba(255, 255, 255, 0.85); }
.cl-pill.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------------------
 * PanoramicViewer
 * ------------------------------------------------------------------------- */
.cl-pano { position: relative; }
.cl-pano__track {
  display: flex;
  overflow-x: auto;
  height: 220px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.cl-pano__track::-webkit-scrollbar { display: none; }
.cl-pano__cover {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: 2 / 3;
}
.cl-pano__cover img { width: 100%; height: 100%; object-fit: cover; }
/* Panorama covers show full, unobstructed art — suppress the bottom-up legibility fade
 * (.cl-art::after) that the cover-card thumbnails use. */
.cl-pano__cover.cl-art::after { display: none; }
.cl-pano__cover--gap {
  background: var(--surface-sunken);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cl-pano__gapmark { color: var(--muted); font-size: 28px; font-weight: 700; }
.cl-pano__num {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  opacity: 0.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.cl-pano__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 10, 18, 0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border-hairline);
}
.cl-pano__nav--prev { left: 8px; }
.cl-pano__nav--next { right: 8px; }
.cl-pano__rule {
  height: 1px;
  background: var(--accent);
  margin-top: 8px;
}

/* Multi-row connecting sets: render the panorama as a grid (one tile per cell) instead of a
 * single horizontally-scrolling strip. --cl-pano-cols = the set's horizontal cover count; covers
 * are emitted row-major so they flow into the grid in reading order.
 * Tile size is capped to the single-row cover width (the 220px strip's aspect-2/3 width ≈ 147px) so
 * a multi-row set's covers match a single-row set's instead of stretching to fill the container; the
 * grid centers and still shrinks to fit narrow phones (1fr columns inside the capped track). */
.cl-pano__track--grid {
  display: grid;
  grid-template-columns: repeat(var(--cl-pano-cols, 1), minmax(0, 1fr));
  height: auto;
  overflow-x: visible;
  max-width: calc(var(--cl-pano-cols, 1) * 147px);
  margin-inline: auto;
}
.cl-pano__track--grid .cl-pano__cover {
  height: auto;
  width: 100%;
}
/* In grid mode there's nothing to scroll — drop the scroll affordances + edge fade. */
.cl-pano--grid .cl-pano__nav { display: none; }
.cl-pano--grid.cl-edge-fade::before,
.cl-pano--grid.cl-edge-fade::after { display: none; }

/* ---------------------------------------------------------------------------
 * ProgressBar / CompletionBar
 * ------------------------------------------------------------------------- */
.cl-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cl-progress__track {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.cl-progress__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--set-accent);
  width: 0; /* JS animates to --target on first paint */
  transition: width var(--motion-bar) var(--ease-out);
}
.cl-progress__fill--global { background: var(--grad-completion); }
.cl-progress__label {
  font-size: var(--fs-meta);
  font-weight: 600;
  opacity: 0.7;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * IssueRow
 * ------------------------------------------------------------------------- */
.cl-issue {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--surface-2);
}
.cl-issue.is-missing {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
}
.cl-issue__thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}
.cl-issue.is-missing .cl-issue__thumb { opacity: 0.5; }
.cl-issue__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.cl-issue__text { flex: 1; min-width: 0; }
.cl-issue__title { font-size: 13px; font-weight: 600; }
.cl-issue.is-missing .cl-issue__title { color: rgba(255, 255, 255, 0.5); }
.cl-issue__meta { font-size: var(--fs-meta); opacity: var(--meta-opacity); }

/* ---------------------------------------------------------------------------
 * StatCard
 * ------------------------------------------------------------------------- */
.cl-stat-card {
  position: relative;
  background: var(--surface-1);
  border: 0.5px solid var(--purple-600);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}
.cl-stat-card__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(175, 169, 236, 0.7); /* purple-text @ 70% */
}
.cl-stat-card__value { margin-top: 8px; }
.cl-stat-card__delta {
  position: absolute;
  bottom: 14px;
  right: 16px;
  font-size: 11px;
  font-weight: 600;
}
.cl-stat-card__delta--up      { color: var(--success-text); }
.cl-stat-card__delta--alert   { color: var(--accent-on-dark); }
.cl-stat-card__delta--neutral { color: var(--muted); }
.cl-stat-card__minibar { margin-top: 12px; }

/* ---------------------------------------------------------------------------
 * SetProgressRow
 * ------------------------------------------------------------------------- */
.cl-setrow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 14px 20px;
  background: var(--surface-1);
}
.cl-setrow__strip { display: flex; gap: 2px; flex: 0 0 auto; }
.cl-setrow__tile {
  width: 32px;
  height: 40px;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.cl-setrow__tile--gap {
  background: var(--surface-sunken);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cl-setrow__tile--gap::after { content: "?"; color: var(--muted); font-size: 13px; font-weight: 700; }
.cl-setrow__body { flex: 1; min-width: 0; }
.cl-setrow__title { font-size: 14px; font-weight: 600; }
.cl-setrow__meta { font-size: var(--fs-meta); opacity: var(--meta-opacity); margin-bottom: 8px; }
.cl-setrow__cta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--set-accent);
  border: 1px solid var(--set-accent);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}

/* ---------------------------------------------------------------------------
 * CompletedSetCard
 * ------------------------------------------------------------------------- */
.cl-trophy {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.cl-trophy__art { aspect-ratio: 3 / 4; }
.cl-trophy__badge { position: absolute; top: 8px; right: 8px; z-index: 2; }
.cl-trophy__body { padding: 10px 12px; }
.cl-trophy__title { font-size: 12px; font-weight: 600; }
.cl-trophy__meta { font-size: 10px; opacity: var(--meta-opacity); }

/* ---------------------------------------------------------------------------
 * WantListRow
 * ------------------------------------------------------------------------- */
.cl-want {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--surface-2);
}
.cl-want__thumb { width: 32px; height: 40px; border-radius: 3px; flex: 0 0 auto; }
.cl-want__body { flex: 1; min-width: 0; }
.cl-want__title { font-size: 13px; font-weight: 600; }
.cl-want__meta { font-size: var(--fs-meta); opacity: var(--meta-opacity); }
.cl-want.is-alert .cl-want__meta { color: var(--accent-on-dark); opacity: 1; }
.cl-want__remove {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 4px;
}
.cl-want__remove:hover { color: var(--accent); }

/* ---------------------------------------------------------------------------
 * ActivityItem
 * ------------------------------------------------------------------------- */
.cl-activity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.cl-activity__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.cl-activity__icon--added       { background: var(--success-deep); color: var(--success-text); }
.cl-activity__icon--completed   { background: var(--success-deep); color: var(--success-text); }
.cl-activity__icon--achievement { background: var(--purple-800); color: var(--purple-text); }
.cl-activity__icon--alert       { background: transparent; border: 1px solid var(--muted-line); color: var(--muted); }
.cl-activity__body { flex: 1; min-width: 0; }
.cl-activity__title { font-size: 13px; }
.cl-activity__meta { font-size: var(--fs-meta); opacity: var(--meta-opacity); }
.cl-activity--alert .cl-activity__meta { color: var(--accent-on-dark); opacity: 1; }

/* ---------------------------------------------------------------------------
 * AchievementBadge
 * ------------------------------------------------------------------------- */
.cl-ach {
  background: var(--surface-2);
  border-radius: var(--radius-card);
  padding: 16px 12px;
  text-align: center;
}
.cl-ach__medal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--purple-800);
  border: 2px solid var(--purple-400);
  box-shadow: 0 0 12px rgba(127, 119, 221, 0.5);
  color: #fff;
}
.cl-ach__name { font-size: 12px; font-weight: 600; }
.cl-ach__sub { font-size: 10px; opacity: var(--meta-opacity); margin-top: 2px; }
.cl-ach.is-locked .cl-ach__medal {
  background: var(--surface-sunken);
  border-color: var(--muted-line);
  box-shadow: none;
  color: var(--muted);
}
.cl-ach.is-locked .cl-ach__name { opacity: 0.25; }

/* ---------------------------------------------------------------------------
 * ArtistInfoCard / CommunityNoteCard
 * ------------------------------------------------------------------------- */
.cl-artist {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 16px;
}
.cl-artist__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cl-artist__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--purple-900);
  border: 1px solid var(--purple-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--purple-text);
  flex: 0 0 auto;
}
.cl-artist__name { font-size: 14px; font-weight: 600; }
.cl-artist__role { font-size: var(--fs-meta); opacity: var(--meta-opacity); }
.cl-artist__table { width: 100%; font-size: 12px; border-collapse: collapse; }
.cl-artist__table th,
.cl-artist__table td { text-align: left; padding: 6px 0; border-top: 1px solid var(--divider); }
.cl-artist__table th { font-weight: 400; opacity: 0.5; }

.cl-note {
  background: var(--surface-1);
  border: 1px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  font-size: 13px;
}
.cl-note__label {
  display: block;
  margin-bottom: 6px;
}

/* ---------------------------------------------------------------------------
 * PrintLayoutCard + DownloadButtons
 * ------------------------------------------------------------------------- */
.cl-print {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.cl-print__well {
  background: var(--surface-sunken);
  border-radius: var(--radius-card);
  padding: 14px;
}
.cl-print__grid {
  display: grid;
  grid-template-columns: repeat(var(--cl-print-cols, 3), 1fr);
  gap: 1.5px;
  background: var(--bg-page);
  border-radius: 4px;
  overflow: hidden;
}
.cl-print__cell { aspect-ratio: 2 / 3; }
.cl-print__buttons { display: flex; gap: 10px; margin-top: 14px; }
.cl-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-text);
  border: 1px solid var(--purple-600);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  background: transparent;
}
.cl-btn-download:hover { background: rgba(83, 74, 183, 0.15); }

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------- */
.cl-footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--divider);
  padding-block: 24px;
  margin-top: 48px;
}
.cl-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.cl-footer__word { font-weight: 600; letter-spacing: 0.2px; font-size: 16px; }
.cl-footer__word-accent { color: var(--accent); }
.cl-footer__tagline { display: block; font-size: var(--fs-meta); opacity: var(--meta-opacity); margin-top: 4px; }
.cl-footer__meta { display: flex; align-items: center; gap: 16px; font-size: var(--fs-meta); opacity: 0.6; }
.cl-footer__meta a:hover { opacity: 1; color: var(--accent-on-dark); }
.cl-footer__submit { color: var(--accent-on-dark); }

/* ---------------------------------------------------------------------------
 * Responsive collapse
 * ------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .cl-nav { gap: 14px; }
  .cl-setrow { flex-wrap: wrap; }
  .cl-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* Phones — the wordmark + nav must fit the 320px floor without horizontal scroll.
 * Shrink the wordmark and tighten the nav gap (paired with the smaller --gutter). */
@media (max-width: 420px) {
  .cl-nav { gap: 10px; }
  .cl-brand__word { font-size: 14px; letter-spacing: 0.2px; }
}
/* Smallest phones: drop to the icon-only mark so the header stays one line (the brand link keeps
   its aria-label, so the name is still announced). */
@media (max-width: 340px) {
  .cl-brand__word { display: none; }
}
