/* Library view: the browse grid, asset card, type tabs, filter pills, sort and
   the "Show more" progress. Desktop baseline; the column counts step down in
   responsive.css. Photos and video stay square-cornered (--radius is only for
   controls), per the brand. */

.lib {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

/* ---- Search field + suggestions --------------------------------------- */

.lib-search__field {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 80px;
  padding: 0 14px 0 22px;
  background: var(--tone-solid);
  border-radius: var(--radius);
  transition: background var(--t-hover) var(--ease-out);
}
.lib-search__field:focus-within {
  background: var(--field-active);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.lib-search__icon { color: var(--text-quiet); flex: 0 0 auto; display: flex; }
.lib-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font: inherit;
  font-size: 22px;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
.lib-search input::placeholder { color: var(--text-quiet); }
/* The field shows focus via :focus-within; keep the browser's own ring and the
   native search decorations off the input so there is one clean outline. */
.lib-search input:focus,
.lib-search input:focus-visible { outline: 0; box-shadow: none; }
.lib-search input::-webkit-search-cancel-button,
.lib-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.lib-search__filter {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border: 0; border-radius: var(--radius);
  background: transparent;
  color: var(--text-quiet);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
}
.lib-search__filter:hover { background: var(--tone-1); color: var(--text); }
.lib-search__filter svg { stroke: currentColor; }

.lib-suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.lib-suggest__label {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-quiet);
}
.chip {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--tone-1);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.chip:hover { background: var(--tone-2); }

/* ---- Section head (title, meta, right link) --------------------------- */

.lib-sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.lib-sec-head__title { font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.lib-sec-head__meta { font-size: 13px; color: var(--text-quiet); }
.lib-sec-head__link {
  margin-left: auto;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  background: none; border: 0; cursor: pointer; font: inherit;
}
.lib-sec-head__link:hover { color: var(--red-text); }

/* ---- Brand films hero ------------------------------------------------- */

.films { display: flex; gap: 20px; }
.film {
  position: relative;
  overflow: hidden;
  height: clamp(280px, 32vw, 440px);
  background: var(--surface);
}
.film--main { flex: 1 1 auto; }
.film--side { flex: 0 0 clamp(180px, 24%, 290px); }
.film__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.film__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 2; width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-radius: 50%; color: var(--on-media); pointer-events: none;
}
.film__bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(8,8,8,.82), rgba(8,8,8,0));
  color: var(--on-media);
}
.film__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.82); }
.film__title { font-size: 18px; font-weight: 600; margin-top: 4px; }
.film--side .film__title { font-size: 15px; }
.film__title a { color: var(--on-media); text-decoration: none; }
.film__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.film__row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.film__spec { font-size: 12px; color: rgba(255,255,255,.82); }
.film__dl {
  position: relative; z-index: 2;
  margin-left: auto;
  height: 32px; padding: 0 14px;
  border: 0; border-radius: var(--radius);
  background: var(--red); color: var(--on-red);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.film__dl:hover { background: var(--red-hover); }
.film__dl svg { stroke: currentColor; }

/* ---- Search field, results mode (Search button) ----------------------- */

.lib-search__clear {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-quiet);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lib-search__clear:hover { background: var(--tone-1); color: var(--text); }
.lib-search__clear svg { stroke: currentColor; }
.lib-search__btn {
  flex: 0 0 auto;
  height: 52px; padding: 0 22px;
  margin-left: 4px;
  border: 0; border-radius: var(--radius);
  background: var(--inverse-bg); color: var(--inverse-text);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: opacity var(--t-hover) var(--ease-out);
}
.lib-search__btn:hover { opacity: .9; }
.lib-search__btn svg { stroke: currentColor; }

/* ---- Search results --------------------------------------------------- */

.sr { display: flex; flex-direction: column; gap: 22px; }

.sr-related { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-related:empty { display: none; }

.sr-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sr-head__text { display: flex; flex-direction: column; gap: 8px; }
.sr-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -.02em;
  font-size: 34px;
  line-height: 1.1;
}

.sr-section { display: flex; flex-direction: column; gap: 16px; }

/* Collection match card */
.coll {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
}
.coll__covers { display: flex; flex: 0 0 auto; }
.coll__covers img {
  width: 72px; height: 90px;
  object-fit: cover;
  margin-left: -18px;
  border: 3px solid var(--surface);
  border-radius: 2px;
}
.coll__covers img:first-child { margin-left: 0; }
.coll__body { flex: 1 1 auto; min-width: 0; }
.coll__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-quiet); }
.coll__name { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 2px 0 5px; }
.coll__meta { font-size: 13px; color: var(--text-quiet); }
.coll__show {
  flex: 0 0 auto;
  height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--radius);
  background: var(--tone-solid); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--t-hover) var(--ease-out);
}
.coll__show:hover { background: var(--tone-solid-hover); }
.coll__show svg { stroke: currentColor; }

/* Per-card match line and the underlined matched term */
.card__match { margin-top: 3px; font-size: 12px; color: var(--text-quiet); }
mark.hl {
  background: transparent;
  color: var(--red-text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 2px;
}

/* Document cards (PDF, SVG) with no raster thumbnail */
.card__doc {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.card__doc-fmt { font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--text-quiet); }

/* One-client footer */
.sr-foot { text-align: center; padding: 24px 0 8px; display: flex; flex-direction: column; gap: 4px; }
.sr-foot__line { font-weight: 600; }
.sr-foot__sub { font-size: 13px; color: var(--text-quiet); }
.sr-foot__link { border: 0; background: none; font: inherit; font-size: inherit; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
.sr-foot__link:hover { color: var(--red-text); }

/* ---- Selection bar (floating) ----------------------------------------- */

.sel-bar {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100vw - 32px);
  height: 64px; padding: 0 12px 0 16px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .55);
  color: var(--on-media);
}
.sel-bar[hidden] { display: none; }
.sel-bar__thumbs { display: flex; flex: 0 0 auto; }
.sel-bar__thumbs img,
.sel-bar__doc {
  width: 40px; height: 40px; object-fit: cover; border-radius: 2px;
  margin-left: -10px; border: 2px solid rgba(30, 30, 30, .9);
}
.sel-bar__thumbs img:first-child, .sel-bar__doc:first-child { margin-left: 0; }
.sel-bar__doc {
  display: flex; align-items: center; justify-content: center;
  background: var(--media-chip); font-size: 9px; font-weight: 700; text-transform: uppercase; color: rgba(255, 255, 255, .8);
}
.sel-bar__more {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: -10px;
  border-radius: 2px; background: rgba(255, 255, 255, .14);
  font-size: 12px; font-weight: 600;
}
.sel-bar__text { font-size: 13px; color: rgba(255, 255, 255, .85); white-space: nowrap; }
.sel-bar__text strong { color: var(--on-media); font-weight: 600; }
.sel-bar__btn {
  flex: 0 0 auto;
  height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--radius);
  background: rgba(255, 255, 255, .16); color: var(--on-media);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.sel-bar__btn:hover { background: rgba(255, 255, 255, .26); }
.sel-bar__btn--primary { background: var(--red); }
.sel-bar__btn--primary:hover { background: var(--red-hover); }
.sel-bar__clear {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border: 0; border-radius: var(--radius);
  background: transparent; color: var(--on-media); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sel-bar__clear:hover { background: rgba(255, 255, 255, .16); }
.sel-bar__clear svg { stroke: currentColor; }

/* ---- Section head / toolbar ------------------------------------------- */

.lib-section { display: flex; flex-direction: column; gap: 18px; }

.lib-toolbar {
  display: flex;
  align-items: center;
  gap: 16px 20px;
  flex-wrap: wrap;
}
.lib-section__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
}
.lib-toolbar__spacer { flex: 1 1 auto; }

/* Type tabs: a padded track, selected item on the inverse fill, each a count. */
.type-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--tone-1);
  border-radius: var(--radius);
}
.type-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-hover) var(--ease-out);
}
.type-tab:hover { background: var(--tone-2); }
.type-tab.on { background: var(--inverse-bg); color: var(--inverse-text); }
.type-tab__count {
  font-size: 11px;
  font-weight: 600;
  opacity: .7;
}

/* Filter pills (Rights, Size, Tags). Inert placeholders until their menus are
   built; they carry the resting look from the boards. */
.filter-pills { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  background: var(--tone-1);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.pill:hover { background: var(--tone-2); }
.pill svg { stroke: currentColor; opacity: .7; }

/* ---- Filter menus ----------------------------------------------------- */

.filter-wrap { position: relative; display: inline-flex; }
.pill.is-active { background: var(--active-tint); color: var(--active-text); }
.pill.is-active svg { opacity: 1; }
.pill__label { white-space: nowrap; }

.filter-clear {
  align-self: center;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--text);
  text-decoration: underline; text-underline-offset: 3px;
  padding: 0 4px;
}
.filter-clear[hidden] { display: none; }
.filter-clear:hover { color: var(--red-text); }

.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 232px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), 0 16px 34px -16px rgba(0, 0, 0, .4);
}
.filter-menu--right { left: auto; right: 0; }
.filter-menu__list { display: flex; flex-direction: column; gap: 2px; }
.filter-menu__empty { padding: 12px; font-size: 13px; color: var(--text-quiet); }

.filter-opt {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--radius); cursor: pointer;
  background: transparent; color: var(--text);
  font: inherit; font-size: 14px; text-align: left;
  transition: background var(--t-hover) var(--ease-out);
}
.filter-opt:hover { background: var(--tone-1); }
.filter-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter-opt__box {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; border: 1.5px solid var(--rule); color: var(--on-media);
}
.filter-opt__box svg { opacity: 0; }
.filter-opt input:checked + .filter-opt__box { background: var(--red); border-color: var(--red); }
.filter-opt input:checked + .filter-opt__box svg { opacity: 1; }
.filter-opt input:focus-visible + .filter-opt__box { box-shadow: var(--focus); }
.filter-opt__label { flex: 1 1 auto; }
.filter-opt--btn.on { color: var(--active-text); font-weight: 600; }
.filter-opt__tick { color: var(--red-text); display: flex; }

.filter-menu--size { width: 340px; display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.size-group { display: flex; flex-direction: column; gap: 8px; }
.size-group__label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-quiet); }
.size-shapes, .size-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.size-shape {
  height: 40px; border: 0; border-radius: var(--radius);
  background: var(--tone-1); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.size-shape:hover { background: var(--tone-2); }
.size-shape.on { background: var(--active-tint); color: var(--active-text); }
.size-preset {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 8px 10px; border: 0; border-radius: var(--radius);
  background: var(--tone-1); color: var(--text); cursor: pointer; text-align: left; font: inherit;
  transition: background var(--t-hover) var(--ease-out);
}
.size-preset:hover { background: var(--tone-2); }
.size-preset strong { font-size: 13px; font-weight: 600; }
.size-preset span { font-size: 11px; color: var(--text-quiet); }
.size-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.size-dim { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-quiet); }
.size-dim input {
  height: 38px; padding: 0 10px; border: 0; border-radius: var(--radius);
  background: var(--tone-1); color: var(--text); font: inherit; font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.size-dim input:focus-visible { box-shadow: var(--focus); }
.size-note { font-size: 12px; color: var(--text-quiet); line-height: 1.4; }

/* Sort and grid toggle. */
.lib-tools { display: inline-flex; align-items: center; gap: 12px; }
.sort { display: inline-flex; align-items: center; gap: 8px; }
.sort__label { font-size: 12px; color: var(--text-quiet); text-transform: uppercase; letter-spacing: .06em; }
.sort select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 0;
  background: var(--tone-1);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235F5F5F' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.grid-toggle { display: inline-flex; gap: 2px; padding: 4px; background: var(--tone-1); border-radius: var(--radius); }
.grid-toggle button {
  width: 34px; height: 32px;
  border: 0; background: transparent; border-radius: 4px;
  color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-hover) var(--ease-out);
}
.grid-toggle button:hover { background: var(--tone-2); }
.grid-toggle button.on { background: var(--inverse-bg); color: var(--inverse-text); }
.grid-toggle svg { stroke: currentColor; }

/* ---- Grid ------------------------------------------------------------- */

/* Mosaic: true shapes in reading order. Cards are dealt left to right across the
   columns (row-major) by the view, so Name sort reads A, B, C, D along the top
   row and then continues on the next row, not down each column. Column count is
   --cols, set per breakpoint in responsive.css. */
.grid--mosaic {
  --cols: 4;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Even grid: a uniform square grid. */
/* minmax(0, 1fr), not 1fr: a plain 1fr track will not shrink below its content, so a card with a
   wide image or a long title stretched its column and the squares came out in different sizes. */
.grid--even {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.grid--even .card { min-width: 0; }
.grid--even .card__frame { aspect-ratio: 1 / 1; }
.grid--even .card__img { height: 100%; object-fit: cover; }

/* Logos and brand wordmarks are thin wide files; show them contained on a dark
   panel rather than cropped or stretched (a logo is never distorted). */
.card.is-logo .card__frame { aspect-ratio: 16 / 9; background: var(--media-bg-soft); }
.card.is-logo .card__img { width: 100%; height: 100%; object-fit: contain; padding: 16%; }
.grid--even .card.is-logo .card__frame { aspect-ratio: 1 / 1; }

/* ---- Asset card ------------------------------------------------------- */

.card { position: relative; display: block; }

.card__frame {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: var(--ratio, 3 / 2);
  transition: transform var(--t-hover) var(--ease-out);
}
.card__img {
  display: block;
  width: 100%;
  height: auto;
}
.grid--mosaic .card:hover .card__frame { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .grid--mosaic .card:hover .card__frame { transform: none; } }

/* The title is a real link stretched over the whole card, so a click anywhere
   opens the asset, while Download and Similar stay separate real buttons
   (accessibility finding 3). */
.card__title {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__title::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card:hover .card__title { color: var(--red-text); }
.card__meta {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-quiet);
}

/* New badge and rights overlay ride on the image. */
.card__badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  padding: 3px 8px;
  background: var(--red);
  color: var(--on-red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: var(--radius);
}
.card__overlay {
  position: absolute;
  bottom: 10px; right: 10px;
  z-index: 2;
  padding: 4px 9px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--on-media);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-radius: var(--radius);
}

/* Video: centred play glyph and a duration chip. */
.card__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 50%;
  color: var(--on-media);
  pointer-events: none;
}
.card__dur {
  position: absolute;
  bottom: 10px; left: 10px;
  z-index: 2;
  padding: 3px 8px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--on-media);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius);
  pointer-events: none;
}

/* Hover bar: dimensions, size, Download and Similar. Hidden at rest, revealed
   on hover or keyboard focus. pointer-events off at rest so clicks fall through
   to the stretched link; keyboard activation still works. */
.card__bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-hover) var(--ease-out);
}
.card:hover .card__bar,
.card:focus-within .card__bar { opacity: 1; pointer-events: auto; }
.card__dims { font-size: 11px; color: rgba(255,255,255,.85); }
.card__actions { display: inline-flex; gap: 6px; }
.card__act {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255,255,255,.16);
  color: var(--on-media);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.card__act:hover { background: rgba(255,255,255,.28); }
.card__act--download { background: var(--red); }
.card__act--download:hover { background: var(--red-hover); }

/* Indexing and failed states sit over a dimmed image. */
.card.is-processing .card__frame::after,
.card.is-failed .card__frame::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(10,10,10,.5);
  z-index: 1;
}
.card__status {
  position: absolute;
  left: 10px; bottom: 10px; right: 10px;
  z-index: 2;
  display: flex; align-items: center; gap: 8px;
  color: var(--on-media);
  font-size: 12px;
  font-weight: 600;
}
.card__status .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--on-media);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.card__retry {
  margin-left: auto;
  height: 26px; padding: 0 10px;
  border: 0; border-radius: var(--radius);
  background: rgba(255,255,255,.18); color: var(--on-media);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .card__status .spinner { animation: none; } }

/* ---- Selection (per-card tick + selected state) ----------------------- */

.card__select {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  width: 26px; height: 26px;
}
.card__check { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.card__tick {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1.5px solid rgba(255, 255, 255, .85);
  color: var(--on-media);
  opacity: 0;
  transition: opacity var(--t-hover) var(--ease-out), background var(--t-hover) var(--ease-out);
}
.card__tick svg { opacity: 0; }
.card:hover .card__tick,
.card:focus-within .card__tick { opacity: 1; }
.card__check:focus-visible + .card__tick { opacity: 1; box-shadow: var(--focus); }
.card.is-selected .card__tick { opacity: 1; background: var(--red); border-color: var(--red); }
.card.is-selected .card__tick svg { opacity: 1; }
.card.is-selected .card__frame { outline: 2px solid var(--red); outline-offset: -2px; }

/* ---- Show more / progress --------------------------------------------- */

.lib-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.lib-more__count { font-size: 13px; color: var(--text-quiet); }
.btn-more {
  height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--tone-solid);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-hover) var(--ease-out);
}
.btn-more:hover { background: var(--tone-solid-hover); }

/* ---- Loading and empty ------------------------------------------------ */

.lib-skeleton { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.lib-skeleton span {
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--surface);
  border-radius: 2px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .lib-skeleton span { animation: none; } }

.lib-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-quiet);
  background: var(--surface);
  border-radius: var(--radius);
}
.lib-empty h3 { font-size: var(--section); font-weight: 600; color: var(--text); margin-bottom: 6px; }
.lib-empty .btn-more { margin-top: 16px; }

/* ---- Board 4 states: first run + no results --------------------------- */

.firstrun, .noresults { max-width: 620px; padding: 8px 0 24px; }
.firstrun__title, .noresults__title {
  font-family: var(--font-display);
  font-weight: 900; letter-spacing: -.02em;
  font-size: 34px; line-height: 1.1;
  margin: 8px 0 24px;
}
.firstrun__steps { list-style: none; margin: 0 0 28px; padding: 0; }
.firstrun__steps li {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 18px 2px;
  border-top: 1px solid var(--rule);
}
.firstrun__steps li:last-child { border-bottom: 1px solid var(--rule); }
.firstrun__n { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--text); min-width: 18px; }
.firstrun__body strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.firstrun__body p { color: var(--text-quiet); }
.firstrun__cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-upload-lg { height: 52px; padding: 0 28px; border-radius: var(--radius); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; }
.firstrun__hint { color: var(--text-quiet); font-size: 14px; }

.noresults__desc { font-size: 16px; line-height: 1.5; margin-bottom: 24px; max-width: 560px; }
.noresults__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-quiet); margin-bottom: 10px; }
.noresults__alts { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.noresults__alts li { font-size: 15px; color: var(--text-quiet); }
.noresults__alt { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 15px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.noresults__alt:hover { color: var(--red-text); }
.noresults__tip { border-top: 1px solid var(--rule); padding-top: 18px; max-width: 560px; }
.noresults__tip .micro { display: block; margin-bottom: 6px; }
.noresults__tip p { color: var(--text-quiet); }
