/* ---------- Gallery ---------- */
.grid { min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(15rem, 19vw, 19.5rem)), 1fr)); gap: var(--space-m); }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--card-hairline, var(--line)); padding: 0; text-align: left; width: 100%;
  background-color: var(--surface);
  background-image: var(--surface-sheen, none);
  border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-1);
  transition: translate 0.35s var(--ease), scale 0.2s var(--ease), box-shadow 0.35s var(--ease);
  container-type: inline-size;
}
.card:hover { translate: 0 -3px; box-shadow: var(--shadow-2); }
.card:active { translate: 0 -1px; scale: 0.99; }
.card.is-idea {
  border: 1px dashed var(--line-2);
  box-shadow: var(--shadow-1);
}
.card.is-idea:hover {
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
}
.card.is-idea .media {
  background-color: var(--canvas);
}
.media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; width: 100%;
  background-color: var(--canvas);
  background-image: var(--stage-ambient), radial-gradient(circle, var(--canvas-dot) 1px, transparent 1.2px);
  background-size: 100% 100%, 18px 18px;
  background-position: center, 0 0;
  display: grid; place-items: center;
}
.media > img,
.media .img-shell > img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease), opacity 0.24s var(--ease); display: block; }
.card:hover .media > img,
.card:hover .media .img-shell > img { transform: scale(1.04); }
.media .pair { position: absolute; inset: 10%; display: grid; grid-template-columns: 1fr 1fr; gap: 6%; }
.media .pair > * { min-width: 0; min-height: 0; display: grid; place-items: center; }
.media .pair img { object-fit: contain; width: 100%; height: 100%; border-radius: 6px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.12)); transition: opacity 0.24s var(--ease); }
.media .pair.wire-pair { inset: 6% 7%; gap: 4.5%; }
.media .pair.wire-pair .wire-slot { width: 100%; height: 100%; display: grid; place-items: center; }
.media .wire { width: 100%; height: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-1); border: 1px solid var(--line); background: var(--wf-paper, var(--surface)); }
.media .pair .wire { width: 100%; height: 100%; }
.badge-tr { position: absolute; top: 12px; right: 12px; }
.badge-bl { position: absolute; left: 12px; bottom: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: var(--step--2); font-weight: 600; white-space: nowrap; letter-spacing: 0.005em;
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.pos { color: var(--pos); } .pill.neg { color: var(--neg); } .pill.mix { color: var(--mix); } .pill.run { color: var(--run); } .pill.idea { color: var(--ink-2); }
.pill.soft { box-shadow: none; background: var(--hover); color: var(--ink-2); }
.pill.soft.pos { background: var(--pos-soft); color: var(--pos); } .pill.soft.neg { background: var(--neg-soft); color: var(--neg); }
.pill.soft.mix { background: var(--mix-soft); color: var(--mix); } .pill.soft.run { background: var(--run-soft); color: var(--run); }
.pill.soft.idea { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); border: 1px solid var(--line); }
.pill.unverified { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.65rem; padding: 0 8px; height: 22px; }
.pill.soft.unverified {
  background: rgba(255, 255, 255, 0.86);
  color: #2b2e35;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card-body { padding: var(--space-s) var(--space-s) calc(var(--space-s) + 2px); display: flex; flex-direction: column; gap: 6px; flex: 1; width: 100%; }
.card-title { font-weight: 600; font-size: var(--step-0); line-height: 1.3; letter-spacing: -0.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: var(--step--1); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.card-meta-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 10px; }
.meter { flex: 1; height: 4px; border-radius: 2px; background: var(--ev-track); overflow: hidden; display: block; }
.meter > i { display: block; height: 100%; border-radius: 2px; background: var(--ev); transform-origin: left; }
.meter-v { font-size: var(--step--2); color: var(--ink-2); white-space: nowrap; }
.meter-v b { color: var(--ink); font-weight: 600; }
@container (max-width: 15rem) { .badge-bl .pill { max-width: 70cqi; overflow: hidden; } }

/* Learning cards */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(17rem, 24vw, 23rem)), 1fr)); gap: var(--space-m); }
.lcard { border: 0; text-align: left; width: 100%; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-1); padding: var(--space-m); display: flex; flex-direction: column; gap: var(--space-s); transition: translate 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.lcard:hover { translate: 0 -3px; box-shadow: var(--shadow-2); }
.lcard h3 { margin: 0; font-size: var(--step-1); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
.lcard p { margin: 0; color: var(--ink-2); font-size: var(--step--1); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ev-big { display: flex; align-items: baseline; gap: 8px; }
.ev-big .n { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.04em; }
.stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--ev-track); gap: 2px; }
.stack i { display: block; height: 100%; }
.stack i.s { background: var(--pos); } .stack i.r { background: var(--neg); } .stack i.m { background: var(--mix); }

.empty { padding: var(--space-xl) var(--space-m); text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: var(--space-s); grid-column: 1 / -1; }
.empty h3 { margin: 0; color: var(--ink); font-size: var(--step-1); font-weight: 600; letter-spacing: -0.02em; }
.empty p { margin: 0; max-width: 44ch; }
.empty svg { width: 52px; height: 52px; color: var(--ink-3); }

/* Filter transition modal */
.modal.filter-transition-modal {
  width: min(100%, 620px);
  max-height: min(90vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
}
.fm-head {
  align-items: flex-start;
  padding: 18px 20px;
  gap: 14px;
}
.fm-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fm-MorphPill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 30px;
  font-size: var(--step--2);
  font-weight: 600;
}
.fm-MorphPill svg {
  width: 13px;
  height: 13px;
}
.fm-title {
  margin: 10px 0 4px !important;
  font-size: var(--step-1) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.fm-desc {
  margin: 0;
  font-size: var(--step--1);
  color: var(--ink-2);
  line-height: 1.48;
}
.fm-body {
  padding: 16px 20px;
  gap: 14px;
}
.fm-context-bridge {
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--hover);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fm-context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.fm-context-lbl {
  font-size: var(--step--2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.fm-context-split {
  font-size: var(--step--2);
  color: var(--ink-2);
}
.fm-context-split b {
  color: var(--ink);
  font-weight: 600;
}
.fm-context-txt {
  margin: 0;
  font-size: var(--step--2);
  color: var(--ink-2);
  line-height: 1.45;
}
.fm-context-txt b {
  color: var(--ink);
  font-weight: 600;
}
.fm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.fm-stat {
  background: var(--surface);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fm-stat-lbl {
  font-size: var(--step--2);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.fm-stat-val {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.fm-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--step--2);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 2px;
}
.fm-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.fm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}
.fm-row + .fm-row {
  border-top: 1px solid var(--line);
}
.fm-row:hover {
  background: var(--hover);
}
.fm-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.fm-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--step--1);
  color: var(--ink);
  min-width: 0;
}
.fm-row-title b {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-row-sub {
  font-size: var(--step--2);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fm-rigor {
  font-size: var(--step--2);
  color: var(--ink-2);
  min-width: 54px;
  text-align: right;
}
.fm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.fm-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Enhanced interactive filter chips */
.filter-chip {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s, color 0.18s;
  user-select: none;
  text-decoration: none;
  border: 1px solid transparent;
}
.filter-chip svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  transition: transform 0.2s, opacity 0.2s;
}
.filter-chip:hover {
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--line);
}
.filter-chip:hover svg {
  opacity: 1;
  transform: translate(1px, -1px);
}
.filter-chip:active {
  transform: translateY(0) scale(0.96);
}
.filter-chip .num {
  font-size: var(--step--2);
  opacity: 0.75;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--hover);
  line-height: 1.2;
}

/* Card match indicator in the grid */
.card-match {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--step--2);
  font-weight: 500;
  color: var(--ink-2);
  background: var(--hover);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: var(--radius-s);
  width: fit-content;
  margin-bottom: 3px;
}

/* ---------- Pagination Bar (for 200+ Ideas & Large Result Sets) ---------- */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-m) 0 var(--space-xl);
  margin-top: var(--space-l);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.pagination-summary {
  font-size: var(--step--1);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.pagination-summary .num {
  font-weight: 600;
  color: var(--ink);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: var(--step--1);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}

.page-num:hover {
  background: var(--hover);
  color: var(--ink);
  border-color: var(--line);
}

.page-num:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.page-num.is-active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 34px;
  color: var(--ink-3);
  font-size: var(--step--1);
  user-select: none;
}

.page-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-s);
  font-size: var(--step--1);
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}

.page-btn:hover {
  background: var(--raised);
  border-color: var(--line-2);
  box-shadow: var(--shadow-1), 0 2px 6px -1px rgba(0, 0, 0, 0.08);
}

.page-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.page-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.page-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.page-size-label select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: var(--step--1);
  font-family: inherit;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s var(--ease);
}

.page-size-label select:hover {
  border-color: var(--line-2);
}

.page-size-label select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

@media (max-width: 680px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-s);
  }
  .pagination-nav {
    justify-content: center;
    order: 1;
  }
  .pagination-summary {
    justify-content: center;
    order: 2;
  }
  .pagination-size {
    justify-content: center;
    order: 3;
  }
}



