/* ══════════════════════════════════════════════════════════════════════
   LANDING PAGE
══════════════════════════════════════════════════════════════════════ */

.landing-hero {
  background: var(--wh);
  border-bottom: 1px solid var(--border);
  padding: 36px 48px 30px;
  flex-shrink: 0;
  position: relative;
}
/* Orange left accent bar */
.landing-hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--vb) 0%, var(--or) 100%);
}
.landing-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 6px;
}
.landing-hero p {
  font-size: .92rem;
  color: var(--st);
  max-width: 540px;
}

.landing-body {
  padding: 36px 48px 52px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-header h2 {
  font-size: 1.05rem;
  color: var(--heading);
  font-weight: 700;
}
.section-header .count {
  font-size: .78rem;
  color: var(--st);
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(296px, 1fr));
  gap: 18px;
}

.dash-card {
  background: var(--wh);
  border: 1px solid var(--fg);
  border-radius: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow .14s, border-color .14s, transform .1s;
}
.dash-card:hover {
  box-shadow: 0 6px 22px rgba(0,113,175,.12);
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.dash-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.dash-card__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 6px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 1px 6px rgba(18,39,74,.12);
  opacity: 0;
  transition: opacity .14s;
}
.dash-card:hover .dash-card__actions,
.dash-card__actions:focus-within,
.dash-card:has(.card-star.active) .dash-card__actions {
  opacity: 1;
}

.dash-card__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-card__domain-badge {
  align-self: flex-start;
}

.dash-card__status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.dash-card__title {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.3;
}

.dash-card__desc {
  font-size: .84rem;
  color: var(--st);
  line-height: 1.45;
}

.dash-card__info {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.dash-card__info-row {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: 10px;
  align-items: start;
}

.dash-card__info-label {
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--st);
  padding-top: 3px;
}

.dash-card__info-value {
  min-width: 0;
}

.dash-card__info-value--updated {
  font-size: .78rem;
  color: var(--heading);
  font-weight: 500;
  line-height: 1.45;
}

.dash-card__ownership-badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.dash-card__ownership-badge--shared {
  background: var(--wash-blue);
  color: var(--accent);
  border: 1px solid var(--vb);
}

.dash-card__ownership-badge--yours {
  background: var(--success-tint);
  color: var(--success);
  border: 1px solid var(--success);
}

.dash-card__owner-email {
  display: block;
  font-size: .78rem;
  color: var(--st);
  line-height: 1.35;
  word-break: break-word;
}

.dash-card__owner-email--empty {
  color: var(--muted);
}

/* ── Thumbnail / placeholder ── */
.dash-card__thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  flex-shrink: 0;
}
.dash-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.dash-card__thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: rgba(255,255,255,.95);
  text-align: center; padding: 12px;
  line-height: 1.3;
}

/* ── Search bar ──────────────────────────────────────────────────────── */
.search-bar-row { display: none; }
.search-bar {
  display: flex;
  align-items: center;
  background: var(--wh);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
  min-width: 200px;
  max-width: 300px;
  flex: 1 1 180px;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,175,.09);
}
.search-bar__icon {
  padding: 0 8px 0 12px;
  color: var(--muted);
  font-size: .88rem;
  flex-shrink: 0;
  user-select: none;
}
.search-bar__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: .83rem;
  font-family: inherit;
  color: var(--gr);
  padding: 7px 4px;
  background: transparent;
  min-width: 0;
}
.search-bar__input::placeholder { color: var(--muted); }
.search-bar__clear {
  background: none;
  border: none;
  padding: 5px 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: .8rem;
  transition: color .1s;
  flex-shrink: 0;
}
.search-bar__clear:hover { color: var(--heading); }
.search-result-meta {
  font-size: .76rem;
  color: var(--st);
  padding: 4px 48px 0;
  min-height: 20px;
}
.search-result-meta strong { color: var(--heading); }

/* ── Tag filter bar ───────────────────────────────────────────────────── */
.tag-filter-row {
  padding: 10px 48px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-filter-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--st);
  padding: 5px 0;
  white-space: nowrap;
  margin-right: 2px;
}
.tag-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-pill {
  padding: 4px 11px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--wh);
  color: var(--st);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .1s, border-color .1s, color .1s;
  white-space: nowrap;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--chip); }
.tag-pill.active {
  background: var(--vb);
  border-color: var(--accent);
  color: var(--on-brand);
}
.tag-filter-clear {
  padding: 4px 10px;
  border-radius: 100px;
  border: 1.5px dashed var(--border);
  background: none;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
  font-family: inherit;
  transition: color .1s, border-color .1s;
}
.tag-filter-clear:hover { color: var(--heading); border-color: var(--heading); }

/* ── Filter bar ──────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--wh);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  scrollbar-width: none;
  flex-wrap: nowrap;
  min-height: 46px;
}
.filter-bar__spacer { flex: 1 1 16px; min-width: 16px; }
.filter-bar__search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  flex-shrink: 0;
}
/* PI-11 — Owner facet in the filter bar */
.filter-bar__owner-wrap {
  display: flex;
  align-items: center;
  padding: 5px 0;
  flex-shrink: 0;
}
.owner-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.owner-filter__label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.owner-filter__select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: .8rem;
  font-family: inherit;
  color: var(--gr);
  background: var(--surface);
  cursor: pointer;
  max-width: 220px;
}
.owner-filter__select:hover  { border-color: var(--accent); }
.owner-filter__select:focus  { outline: none; border-color: var(--accent); }
.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--st);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: color .12s, border-color .12s, background .12s;
  border-radius: 4px 4px 0 0;
}
.filter-pill:hover { color: var(--heading); background: var(--chip); }
.filter-pill.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--chip);
}
.filter-pill__count {
  display: inline-block;
  background: var(--bg);
  color: var(--st);
  border-radius: 100px;
  padding: 1px 7px;
  font-size: .7rem;
  font-weight: 700;
}
.filter-pill.active .filter-pill__count {
  background: var(--vb);
  color: var(--on-brand);
}
/* Favorites pill special styling */
.filter-pill.fav-pill { color: var(--st); }
.filter-pill.fav-pill:hover { color: var(--or); background: var(--warning-tint); }
.filter-pill.fav-pill.active {
  color: var(--or);
  border-bottom-color: var(--or);
  background: var(--warning-tint);
}
.filter-pill.fav-pill.active .filter-pill__count {
  background: var(--or);
  color: var(--on-or);
}
.filter-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
  margin: 0 4px;
}

/* ── Domain group sections ────────────────────────────────────────────── */
.domain-group {
  margin-bottom: 40px;
}
.domain-group:last-child { margin-bottom: 0; }

.domain-group__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.domain-group__swatch {
  width: 4px;
  height: 22px;
  border-radius: 2px;
  flex-shrink: 0;
}
.domain-group__name {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
}
.domain-group__count {
  font-size: .76rem;
  color: var(--st);
}

/* ── What's New strip ── */
.whats-new-section { margin-bottom: 28px; }
.whats-new-section__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.whats-new-section__title {
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.whats-new-dismiss {
  background: none; border: none; cursor: pointer;
  font-size: .78rem; color: var(--muted); padding: 2px 6px;
}
.whats-new-strip {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 6px;
}
.whats-new-card {
  flex: 0 0 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; cursor: pointer;
  transition: box-shadow .15s;
  position: relative; overflow: hidden;
}
.whats-new-card:hover { box-shadow: 0 4px 14px rgba(0,113,175,.13); }
.whats-new-badge {
  display: inline-block; background: var(--or); color: var(--on-or);
  font-size: .65rem; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; letter-spacing: .06em; margin-bottom: 6px;
}
.whats-new-card__title {
  font-size: .87rem; font-weight: 600; color: var(--heading);
  margin-bottom: 4px; line-height: 1.3;
}
.whats-new-card__meta { font-size: .72rem; color: var(--muted); }

/* ── Recently Viewed section ─────────────────────────────────────────── */
.recent-section {
  padding: 0 0 4px;
}
.recent-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--st);
}
.recent-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.recent-card {
  flex-shrink: 0;
  width: 200px;
  background: var(--wh);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow .12s, transform .1s;
  border-top: 3px solid transparent;
}
.recent-card:hover {
  box-shadow: 0 3px 12px rgba(0,113,175,.10);
  transform: translateY(-1px);
}
.recent-card__domain {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-card__title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Empty states ─────────────────────────────────────────────────────── */
.empty-state-branded {
  text-align: center;
  padding: 56px 24px 48px;
  max-width: 460px;
  margin: 0 auto;
}
.empty-state-branded__icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  opacity: .6;
}
.empty-state-branded__title {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 10px;
}
.empty-state-branded__sub {
  font-size: .88rem;
  color: var(--st);
  line-height: 1.65;
}
.empty-state-branded__divider {
  width: 40px;
  height: 3px;
  background: var(--or);
  border-radius: 2px;
  margin: 16px auto;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--st);
}
.empty-state h3 { color: var(--heading); margin-bottom: 8px; }

/* Favorites empty state */
.fav-empty {
  text-align: center;
  padding: 52px 24px;
  color: var(--st);
}
.fav-empty .fav-empty__icon { font-size: 2.5rem; margin-bottom: 12px; }
.fav-empty h3 { color: var(--heading); margin-bottom: 6px; }

/* ══════════════════════════════════════════════════════════════════════
   SECTION TABS (Recent / Shared / All Dashboards)
══════════════════════════════════════════════════════════════════════ */
.section-header--tabs {
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.section-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex-wrap: wrap;
}
.section-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 14px 12px;
  margin-bottom: -14px;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--st);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
  border-radius: 6px 6px 0 0;
}
.section-tab:hover {
  color: var(--heading);
  background: var(--chip);
}
.section-tab.active {
  color: var(--heading);
  border-bottom-color: var(--or);
  background: transparent;
}
.section-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  background: var(--chip);
  color: var(--st);
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 700;
}
.section-tab.active .section-tab__count {
  background: var(--or);
  color: var(--on-or);
}

/* ══════════════════════════════════════════════════════════════════════
   PERMISSION CARDS (BigQuery rows for Recent / Shared sections)
══════════════════════════════════════════════════════════════════════ */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.perm-card {
  background: var(--wh);
  border: 1px solid var(--border);
  border-top: 3px solid var(--st);
  border-radius: 8px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 130px;
  transition: box-shadow .12s ease, transform .12s ease;
}
.perm-card--clickable {
  cursor: pointer;
}
.perm-card--clickable:hover {
  box-shadow: 0 4px 14px rgba(0,113,175,.13);
  transform: translateY(-1px);
}
.perm-card__id {
  font-size: .68rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--st);
  letter-spacing: .02em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perm-card__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.3;
}
.perm-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .72rem;
  color: var(--st);
  flex-wrap: wrap;
}
.perm-card__who {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 75%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perm-card__when {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.perm-card__nolink {
  align-self: flex-start;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--chip);
  padding: 2px 8px;
  border-radius: 10px;
}

/* TM-9962 — catalog layout variants */
.card-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.card-grid--compact .dash-card__thumb { min-height: 100px; }
.card-grid--compact .dash-card__title { font-size: .9rem; }
.card-grid--compact .dash-card__body { padding: 10px 12px 12px; }

.card-grid--large {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}
.card-grid--large .dash-card__thumb { min-height: 200px; }
.card-grid--large .dash-card__title { font-size: 1.08rem; }

.catalog-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--wh);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}
.catalog-view-btn {
  border: none;
  background: transparent;
  color: var(--st);
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
}
.catalog-view-btn:hover { background: var(--chip); color: var(--heading); }
.catalog-view-btn.active {
  background: var(--vb);
  color: var(--on-brand);
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-list__row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  background: var(--wh);
  border: 1px solid var(--fg);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow .12s, border-color .12s;
}
.dash-list__row:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0,113,175,.1);
}
.dash-list__thumb {
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 6px;
  overflow: hidden;
}
.dash-list__thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-list__thumb-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-brand); font-weight: 700; font-size: 1.2rem;
}
.dash-list__main { flex: 1; min-width: 0; }
.dash-list__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.dash-list__title {
  font-weight: 700;
  color: var(--heading);
  font-size: .95rem;
}
.dash-list__desc {
  font-size: .82rem;
  color: var(--st);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dash-list__meta { font-size: .75rem; color: var(--st); }
.dash-list__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   PI-18 — CATALOG AT VOLUME: facets rail + sort/group controls
══════════════════════════════════════════════════════════════════════ */

/* Two-column shell: sticky facets rail on the left, results on the right.
   Collapses to a single column on narrow viewports. */
.catalog-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.catalog-shell__results { min-width: 0; }

.facets-rail {
  position: sticky;
  top: 12px;
  align-self: start;
  background: var(--wh);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 12px 6px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.facets-rail__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.facets-rail__title {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--st);
  /* Push "Clear all" + the collapse icon to the right edge of the header. */
  margin-right: auto;
}
.facets-rail__clear,
.facet__clear {
  background: none;
  border: none;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.facets-rail__clear:hover,
.facet__clear:hover { text-decoration: underline; }

.facet { border-top: 1px solid var(--border); padding: 10px 0 8px; }
.facet:first-of-type { border-top: none; }
.facet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.facet__title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--heading);
}
.facet__search { margin-bottom: 6px; }
.facet__search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  font-size: .76rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}
.facet__search-input:focus { outline: none; border-color: var(--accent); }

.facet__opts { display: flex; flex-direction: column; gap: 1px; }
.facet__opts--scroll { max-height: 216px; overflow-y: auto; }

.facet__opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-size: .8rem;
  color: var(--muted);
}
.facet__opt:hover { background: var(--chip); }
.facet__opt.is-checked { background: var(--chip); }
.facet__opt input { flex-shrink: 0; cursor: pointer; }
.facet__opt-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facet__opt-count {
  flex-shrink: 0;
  font-size: .7rem;
  color: var(--st);
  background: var(--chip);
  border-radius: 100px;
  padding: 1px 7px;
}
.facet__empty { font-size: .76rem; color: var(--st); padding: 4px 6px; }
.facet__showall {
  background: none;
  border: none;
  color: var(--accent);
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px 0;
}
.facet__showall:hover { text-decoration: underline; }

/* Active-facet chips above the results */
.facet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--info-border);
  background: var(--chip);
  color: var(--info);
  font-size: .74rem;
  cursor: pointer;
}
.facet-chip:hover { background: var(--chip); }
.facet-chip__dim { font-weight: 700; }
.facet-chip__x { font-size: .68rem; opacity: .7; }
.facet-chips__clear {
  background: none;
  border: none;
  color: var(--st);
  font-size: .74rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Sort + group selects (sit with the view toggle) */
.catalog-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  color: var(--st);
}
.catalog-ctrl__label { font-weight: 600; }
.catalog-ctrl__select {
  padding: 5px 8px;
  font-size: .76rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--wh);
  color: var(--muted);
  cursor: pointer;
}
.catalog-ctrl__select:focus { outline: none; border-color: var(--accent); }

@media (max-width: 900px) {
  .catalog-shell { grid-template-columns: 1fr; }
  .facets-rail {
    position: static;
    max-height: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   PI-18 — Option C sortable-column table (list view)
══════════════════════════════════════════════════════════════════════ */
.pi-table { width: 100%; }
.pi-thead,
.pi-trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px 130px 130px 96px 62px 76px;
  align-items: center;
  gap: 10px;
}
.pi-thead {
  padding: 8px 14px;
  color: var(--st);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border-soft);
}
.pi-sortbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--st);
  padding: 3px 6px;
  margin: -3px -6px;
  border-radius: 5px;
}
.pi-sortbtn:hover { color: var(--accent); background: var(--chip); }
.pi-sortbtn:focus-visible { outline: 2px solid var(--vb); outline-offset: 1px; }
.pi-sortic { font-size: .62rem; color: var(--muted); }
.pi-sortic.active { color: var(--or); }
.pi-thead [role="columnheader"][aria-sort="ascending"] .pi-sortbtn,
.pi-thead [role="columnheader"][aria-sort="descending"] .pi-sortbtn { color: var(--heading); }

.pi-trow {
  background: var(--wh);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 9px 14px;
  margin-top: 7px;
  cursor: pointer;
}
.pi-trow:hover { border-color: var(--border); box-shadow: 0 1px 6px rgba(18, 39, 74, .06); }
.pi-trow.card-retired { opacity: .6; }

.pi-c-name { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.pi-thumb {
  flex: 0 0 auto;
  width: 46px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-soft);
  background: var(--wh);
}
.pi-thumb :is(img, svg, div) { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Type-icon tile (Option C mockup .thumb.typeicon): light surface + a crisp,
   domain-tinted 24px type icon (stroke follows currentColor set inline). */
.pi-thumb--typeicon { background: var(--pi-tile-bg); }
.pi-thumb.pi-thumb--typeicon svg { width: 24px; height: 24px; object-fit: none; }
.pi-tn { font-weight: 700; color: var(--heading); }
.pi-td {
  color: var(--st);
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pi-c-name__facets { display: inline-flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; }
/* Tags column — classification / certification / confidence pills in their own
   cell (moved out of the Name cell so they read as a discrete column). Kept on a
   single row (no wrap); each pill keeps its intrinsic width. */
.pi-c-tags { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.pi-c-tags > * { flex: 0 0 auto; white-space: nowrap; }
.pi-c-tags__empty { color: var(--muted); font-size: .78rem; }
.pi-cert {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--vb);
  color: var(--on-brand);
  font-size: .55rem;
  font-weight: 700;
}
.pi-c-owner,
.pi-c-date { color: var(--st); font-size: .78rem; }

/* View counter (Nilesh/Mike) — eye glyph + count in the Views column. The count
   comes from analytics.viewCount, incremented on every viewer open via
   POST /api/track-view. */
.pi-c-views { color: var(--st); font-size: .78rem; }
.pi-views { display: inline-flex; align-items: center; gap: 5px; color: var(--st); }
.pi-views svg { flex: 0 0 auto; opacity: .8; }
.pi-views__n { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Category cell — solid uppercase pill (Option C mockup .pill). Background is
   data-driven (domainColor() inline style) so it stays mapped to the category;
   this rule only provides the pill chrome. Scoped to the table category cell so
   the generic ".pill" name can't clash elsewhere. */
.pi-c-cat .pill {
  display: inline-block;
  color: var(--on-brand);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .03em;
  border-radius: 4px;
  padding: 2px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pi-c-act { display: flex; gap: 10px; justify-content: flex-end; color: var(--muted); }
/* Row action icons (Option C mockup .c-act .act): quiet light-grey buttons that
   brighten to brand-orange on hover; the favourite fills sunray when on. */
.pi-rowact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 2px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
  transition: color .1s, background .1s;
}
.pi-rowact svg { width: 16px; height: 16px; display: block; }
.pi-rowact:hover { color: var(--or); background: var(--chip); }
.pi-rowact:focus-visible { outline: 2px solid var(--vb); outline-offset: 1px; }
.pi-rowact--star.is-on { color: var(--su); }

@media (max-width: 900px) {
  .pi-thead { display: none; }
  .pi-trow {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .pi-c-cat, .pi-c-owner, .pi-c-date, .pi-c-views { font-size: .72rem; }
  .pi-c-act { justify-content: flex-start; }
}

/* ══════════════════════════════════════════════════════════════════════
   OPTION C — Catalog landing redesign (hero + flush sidebar + toolbar)
   Colours/spacing use existing brand tokens only (no hardcoded hex).
══════════════════════════════════════════════════════════════════════ */

/* ── Centered navy hero with in-hero search ── */
.landing-hero--c {
  background: linear-gradient(135deg, var(--dn) 0%, var(--accent-strong) 100%);
  padding: 26px 22px 30px;
  text-align: center;
  flex-shrink: 0;
}
.landing-hero--c h1 {
  color: var(--on-brand);
  margin: 0 0 3px;
  font-size: 1.55rem;
  font-weight: 700;
}
.landing-hero--c__tag {
  color: var(--on-brand);
  font-size: .82rem;
  margin-bottom: 16px;
}
.herosearch {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--wh);
  border-radius: 26px;
  padding: 12px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.herosearch__icon {
  color: var(--heading);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.herosearch__icon svg { display: block; }
.herosearch input {
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 1rem;
  color: var(--gr);
  width: 100%;
  background: transparent;
}
.herosearch input::placeholder { color: var(--muted); }
.herosearch__clear {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  flex-shrink: 0;
}
.herosearch__clear:hover { color: var(--st); }
.herosearch .kbd {
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: .78rem;
  color: var(--st);
  background: var(--surface-2);
  flex-shrink: 0;
}
.hint {
  max-width: 920px;
  margin: 12px auto 0;
  color: var(--on-brand);
  font-size: .78rem;
  line-height: 1.6;
}
.hint-h { color: var(--on-brand); font-weight: 700; margin-right: 6px; }
.hint-sep { margin: 0 12px; color: var(--muted); }

/* ── Flush two-column layout: full-height sidebar + results ── */
.catalog-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}
.catalog-shell__results {
  min-width: 0;
  padding: 16px 22px 60px;
}

/* Sidebar rail (overrides the earlier card-style rail) */
.facets-rail {
  position: sticky;
  top: 63px; /* below sticky header (60px) + accent bar (3px) */
  align-self: start;
  height: calc(100vh - 63px);
  overflow-y: auto;
  background: var(--wh);
  border: 0;
  border-right: 1px solid var(--border-soft);
  border-radius: 0;
  padding: 18px 16px;
}
.facets-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.facets-rail__title {
  font-weight: 700;
  color: var(--heading);
  font-size: .82rem;
  letter-spacing: 0;
  text-transform: none;
}

/* Quick toggles (Favorites / Mine) */
.quicktoggles { display: flex; gap: 6px; margin-bottom: 6px; }
.qtoggle {
  flex: 1 1 0;
  border: 1px solid var(--border-soft);
  background: var(--wh);
  color: var(--st);
  border-radius: 14px;
  padding: 6px 8px;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.qtoggle:hover { border-color: var(--or); color: var(--or); }
.qtoggle.on { background: var(--or); color: var(--on-or); border-color: var(--or); }

/* Collapsible facet sections */
.facet__head { gap: 6px; }
.facet__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.facet__caret { color: var(--muted); font-size: .62rem; transition: transform .15s; flex-shrink: 0; }
.facet--collapsed .facet__caret { transform: rotate(-90deg); }
.facet--collapsed .facet__body { display: none; }
.facet__toggle:hover .facet__title { color: var(--heading); }

/* ── Results toolbar ── */
.resbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.rescount { font-weight: 700; color: var(--heading); white-space: nowrap; font-size: .9rem; }
.rescount__of { color: var(--st); font-weight: 400; font-size: .78rem; margin-left: 4px; }
.resctl {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--st);
  font-size: .78rem;
  flex-wrap: wrap;
}
.resctl label { display: inline-flex; align-items: center; gap: 6px; }
.resctl select {
  font: inherit;
  font-size: .78rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--gr);
  background: var(--wh);
  cursor: pointer;
}
.resctl select:focus { outline: none; border-color: var(--accent); }
.addbtn {
  background: var(--or);
  color: var(--on-brand);
  border: 0;
  border-radius: 7px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.addbtn:hover { background: var(--dn); }

/* Compact section segmented control (All / Private / Shared) */
.segtabs { display: inline-flex; align-items: center; gap: 2px; background: var(--chip); border-radius: 8px; padding: 3px; }
.segtab {
  border: 0;
  background: none;
  font: inherit;
  font-size: .74rem;
  font-weight: 700;
  color: var(--st);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.segtab:hover { color: var(--heading); }
.segtab.active { background: var(--wh); color: var(--heading); box-shadow: 0 1px 3px rgba(18, 39, 74, .12); }
.segtab__count {
  background: var(--chip);
  color: var(--st);
  border-radius: 100px;
  font-size: .66rem;
  font-weight: 700;
  padding: 1px 6px;
}
.segtab.active .segtab__count { background: var(--or); color: var(--on-or); }

/* Filters drawer toggle — mobile only. On desktop the rail carries its own
   collapse icon (.facets-rail__collapse); this button just opens the ≤900px
   drawer, so it stays hidden until that breakpoint (see media query below). */
.filters-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--wh);
  border: 1px solid var(--border-soft);
  color: var(--heading);
  border-radius: 7px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  font-size: .76rem;
  cursor: pointer;
}
.filters-toggle:hover { border-color: var(--or); color: var(--or); }

/* PI-33 — the rail's own collapse icon, to the right of "Clear all". Hidden on
   mobile (the drawer button owns that breakpoint); shown on desktop. */
.facets-rail__collapse {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--st);
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
}
.facets-rail__collapse:hover { color: var(--or); background: var(--chip); }

/* PI-33 — desktop collapse: shrink the rail to a slim strip that keeps only the
   collapse icon visible (so it can be reopened) and let the results reclaim the
   freed width. Scoped to ≥901px so it never collides with the ≤900px drawer
   rules below (which use .filters-open on the same shell). */
@media (min-width: 901px) {
  .facets-rail__collapse { display: inline-flex; }

  .catalog-shell.filters-collapsed { grid-template-columns: 40px minmax(0, 1fr); }
  .catalog-shell.filters-collapsed > .facets-rail { padding: 10px 4px; overflow: visible; }
  .catalog-shell.filters-collapsed > .facets-rail > *:not(.facets-rail__head) { display: none; }
  .catalog-shell.filters-collapsed .facets-rail__head { margin-bottom: 0; justify-content: center; }
  .catalog-shell.filters-collapsed .facets-rail__title,
  .catalog-shell.filters-collapsed .facets-rail__clear { display: none; }
}

/* pi-table thumbnail tile — icon fallback should sit centered, not stretched */
.pi-thumb .pi-typeicon,
.pi-thumb .pi-typeicon--list { width: 24px; height: 24px; }
.pi-thumb .pi-typeicon svg { width: 100%; height: 100%; }

@media (max-width: 900px) {
  .catalog-shell { grid-template-columns: 1fr; }
  .facets-rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
    display: none;
  }
  .catalog-shell.filters-open .facets-rail { display: block; }
  .filters-toggle { display: inline-flex; }
}

/* ── Option C — sidebar facet + chip detail parity with the mockup ── */

/* "Clear all" reads as a light link (mockup .facets-title .clear) */
.facets-rail__clear,
.facet__clear { font-weight: 400; }

/* Facet section headers: uppercase, letter-spaced, stone (mockup .facet-h) */
.facet__title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--st);
}
.facet__toggle:hover .facet__title { color: var(--heading); }

/* Facet options: ink label, orange checkbox, plain (pill-free) count (mockup .fopt) */
.facet__opt {
  gap: 8px;
  padding: 3px 0;
  border-radius: 0;
  color: var(--gr);
}
.facet__opt:hover,
.facet__opt.is-checked { background: none; }
.facet__opt input { accent-color: var(--or); }
.facet__opt-count {
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: .72rem;
  color: var(--muted);
}

/* Active-facet chips: borderless, navy on pale-blue, pill radius (mockup .achip) */
.facet-chip {
  border: 0;
  background: var(--chip);
  color: var(--heading);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: .72rem;
}
.facet-chip:hover { background: var(--chip); }
.facet-chip__x { color: var(--st); opacity: 1; }

/* PI-18 B6 — Comfortable / Compact row-density control (results toolbar).
   Segmented control matching the existing .segtabs look, using brand tokens. */
.density-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--vb-tint);
  border-radius: 8px;
  padding: 3px;
}
.density-btn {
  border: 0;
  background: none;
  font: inherit;
  font-size: .74rem;
  font-weight: 700;
  color: var(--st);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition: color .12s, background .12s;
}
.density-btn:hover { color: var(--heading); }
.density-btn.is-active {
  background: var(--wh);
  color: var(--heading);
  box-shadow: 0 1px 3px rgba(18, 39, 74, .12);
}
.density-btn:focus-visible { outline: 2px solid var(--vb); outline-offset: 1px; }

/* PI-18 B6 — Compact density: tighten the table / list / grid rows. Comfortable
   is the default (no class), so these rules only apply when the user opts in. */
.catalog-shell--compact .pi-thead { padding: 5px 12px; }
.catalog-shell--compact .pi-trow { padding: 5px 12px; margin-top: 4px; }
.catalog-shell--compact .pi-c-name { gap: 7px; }
.catalog-shell--compact .pi-thumb { width: 38px; height: 30px; }
.catalog-shell--compact .pi-tn { font-size: .82rem; }
.catalog-shell--compact .pi-c-owner,
.catalog-shell--compact .pi-c-date,
.catalog-shell--compact .pi-c-views,
.catalog-shell--compact .pi-td { font-size: .72rem; }
.catalog-shell--compact .dash-list__row { padding: 6px 10px; gap: 10px; }
.catalog-shell--compact .dash-list__thumb { width: 3.25rem; height: 3.25rem; }
.catalog-shell--compact .card-grid { gap: 12px; }
.catalog-shell--compact .dash-card__body { padding: 10px 12px 12px; gap: 6px; }
.catalog-shell--compact .dash-card__title { font-size: 1rem; }
