/* Collection page, ported from the prototype (viewCollection). Shared blocks (.pagehead, .crumbs, .oname, .lhead,
   .state, .chip, .tile, .count, .skel, .btn.iconsq ...) live in common.css. */

.headacts { display: flex; gap: 8px; align-items: center; }
.collection-screen .skel.w-title { width: 220px; max-width: 100%; height: 26px; }

/* ---------- filters and sort ---------- */
.tablebar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { height: 30px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--line-strong); background: var(--surface); display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.filters button[aria-pressed="true"] .count { background: color-mix(in srgb, var(--surface) 25%, transparent); color: var(--surface); }
.filtersel { display: none; }
.tablebar .dd-bar { width: auto; }
.tablebar .dd-sort .ddbtn > span::before { content: attr(data-prefix) " "; }

/* ---------- set rows: the whole row opens the set page (stretched link); chips and the zoomable tile stay on top ---------- */
.crow { position: relative; cursor: pointer; }
.crow .oname a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.crow .btn, .crow .chip, .crow [data-zoom-src] { position: relative; z-index: 1; }
.crow:hover .oname a { text-decoration: underline; }

.crow, .lhead.coll { grid-template-columns: 52px minmax(0, 1.6fr) minmax(0, 1.3fr) 130px minmax(0, 1fr); }
.crow { display: grid; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.lhead > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lhead + .crow, .crow:first-child { border-top: 0; }
.crow:hover { background: var(--surface-2); }
.cstat { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.cstat .when { padding-left: 2px; font-size: 12.5px; color: var(--muted); }
.crow .miss { display: grid; gap: 2px; font: 600 14px var(--font-mono); }
.crow .miss .mlbl, .crow .miss .mnone { display: none; }
.crow .miss small { font: 400 12px var(--font-ui); color: var(--muted); }
.crow .miss.none { color: var(--faint); font-weight: 400; }

.crow.is-skeleton { cursor: default; }
.crow.is-skeleton:hover { background: none; }

/* ---------- phone: a card per set; two menus side by side instead of the filter buttons ---------- */
@media (max-width: 760px) {
  .crow { grid-template-columns: 44px minmax(0, 1fr); gap: 6px 12px; }
  .crow .tile { width: 44px; height: 34px; font-size: 9px; grid-row: span 4; align-self: start; }
  .crow .cstat { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .crow .miss { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font: 400 12.5px var(--font-ui); color: var(--muted); }
  .crow .miss span:not(.mlbl) { font-family: var(--font-mono); }
  .crow .miss small { font-family: var(--font-ui); }
  .crow .miss .mlbl { display: inline; font: 600 10.5px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
  .crow .miss .mdash { display: none; }
  .crow .miss .mnone { display: inline; font-family: var(--font-ui); color: var(--faint); }
  .crow .flags { grid-column: 2; }

  .tablebar { flex-wrap: nowrap; gap: 8px; }
  .tablebar .filters { display: none; }
  .filtersel { display: flex; flex: 1 1 0; min-width: 0; }
  .filtersel > .dd { display: flex; width: 100%; max-width: none; min-width: 0; }
  .tablebar > .dd { display: flex; flex: 1 1 0; min-width: 0; width: auto; max-width: none; }
  .tablebar .dd-sort .ddbtn > span::before { content: none; }
}
