/* ---------- Sigrix Refined — Marketplace overrides ----------
 * Sits alongside sx-home.css (which already supplies the design tokens,
 * nav, footer, button, card and chip rules). This file only contains
 * marketplace-specific layout: hero, toolbar, sidebar filters, feature
 * panel, pagination, and the loader. */

.sx { color-scheme: light; }

/* base.css applies a 38–44px `min-height` to every <button> for mobile
 * tap-target compliance, which makes the toolbar pills (32 px tall) and
 * the grid/list view buttons (28 px tall) overflow their tracks — the
 * "is-active" highlight then visibly extends past the surrounding
 * pill/track. Reset min-height on the marketplace toolbar controls so
 * they honour their declared `height`. */
.mp-tab,
.mp-view button,
.mp-filters-toggle,
.mp-side-toggle,
.mp-side-reset,
.mp-sort-select,
.mp-chip,
.mp-active-chip,
.mp-modal__close,
.mp-pagination__btn { min-height: 0; }

/* ---------- Hero (compact variant for marketplace) ---------- */
.mp-hero {
  position: relative;
  padding: 56px 0 40px;
  overflow: hidden;
}
.mp-hero h1 {
  font-size: 44px;
  font-weight: 600;
  font-family: var(--sx-font-display);
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 22ch;
  margin: 0;
}
.mp-hero h1 .accent { color: var(--sx-text-2); font-weight: 600; }
.mp-hero .lede {
  margin-top: 14px;
  color: var(--sx-text-2);
  font-size: 16px;
  max-width: 56ch;
}
.mp-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.mp-hero-counts {
  display: flex;
  gap: 28px;
  padding: 16px 20px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.mp-hero-counts > div { display: flex; flex-direction: column; gap: 4px; min-width: 72px; }
.mp-hero-counts .label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sx-text-3); font-weight: 600; }
.mp-hero-counts .val { font-family: var(--sx-font-mono); font-size: 18px; font-weight: 500; color: var(--sx-text); }
.mp-hero-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.mp-hero-search {
  margin-top: 24px;
  display: flex; align-items: center; gap: 8px;
  height: 44px;
  padding: 0 12px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  max-width: 560px;
  position: relative;
}
.mp-hero-search:focus-within { box-shadow: 0 0 0 2px var(--sx-brand) inset; }
.mp-hero-search svg.mp-hero-search__icon { width: 16px; height: 16px; color: var(--sx-text-3); flex: 0 0 auto; }
.mp-hero-search input[type="search"].mp-hero-search__input {
  flex: 1; min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--sx-text);
  font: inherit;
  font-size: 14px;
  height: 100%;
  padding: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.mp-hero-search input[type="search"].mp-hero-search__input::placeholder { color: var(--sx-text-3); }

.mp-search__suggestions {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset, 0 12px 30px -16px rgba(14,19,32,0.18);
  padding: 8px;
  z-index: 6;
}
.mp-search__suggestions.hidden { display: none; }
.mp-search__suggestions .search-suggestions-heading {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sx-text-3);
  font-weight: 600;
  padding: 6px 10px;
  margin: 0;
}
.mp-search__suggestions .search-suggestion-item {
  display: block;
  padding: 8px 10px;
  border-radius: var(--sx-r-sm);
  font-size: 13px;
  color: var(--sx-text);
}
.mp-search__suggestions .search-suggestion-item:hover { background: var(--sx-surface-2); }

/* ---------- Sticky toolbar ---------- */
.mp-toolbar {
  position: sticky;
  top: 60px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--sx-line);
  border-top: 1px solid var(--sx-line);
}
.mp-toolbar.is-stuck { box-shadow: 0 4px 16px -12px rgba(14,19,32,0.18); }
.mp-toolbar-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.mp-tabs {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
}
.mp-tab {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--sx-r-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sx-text-2);
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.mp-tab:hover { background: var(--sx-surface); color: var(--sx-text); }
.mp-tab.is-active,
.mp-tab[aria-selected="true"] {
  background: var(--sx-surface);
  color: var(--sx-text);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.mp-tab.is-disabled { opacity: 0.5; cursor: not-allowed; }
.mp-tab .dot { width: 6px; height: 6px; border-radius: 50%; }
.mp-tab .dot--prompt    { background: #3D4DFF; }
.mp-tab .dot--persona   { background: #F5B454; }
.mp-tab .dot--agent     { background: #7CE3D4; }
.mp-tab .dot--assistant { background: #B48CFF; }
.mp-tab .dot--product   { background: #F47B7B; }
.mp-tab .count {
  font-family: var(--sx-font-mono);
  font-size: 11px;
  color: var(--sx-text-3);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--sx-bg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.mp-tab.is-active .count,
.mp-tab[aria-selected="true"] .count {
  color: var(--sx-text-2);
  background: var(--sx-bg-2);
}

.mp-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mp-sort-select {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 28px 0 12px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--sx-text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none' stroke='%237A8294' stroke-width='1.6'><path d='M2 4l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.mp-sort-select:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.mp-sort-select:focus-visible { outline: 2px solid var(--sx-brand); outline-offset: 2px; }

.mp-view {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 2px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.mp-view button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sx-text-3);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.mp-view button:hover { color: var(--sx-text); }
.mp-view button.is-active,
.mp-view button[aria-pressed="true"] {
  background: var(--sx-bg);
  color: var(--sx-text);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.mp-view button:focus-visible { outline: 2px solid var(--sx-brand); outline-offset: 2px; }

.mp-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border: 0;
  color: var(--sx-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.mp-filters-toggle:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.mp-filters-toggle.is-active { color: var(--sx-brand); box-shadow: 0 0 0 1px var(--sx-brand) inset; }
.mp-filters-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  height: 18px;
  border-radius: 9px;
  background: var(--sx-brand);
  color: var(--sx-brand-ink);
  font-family: var(--sx-font-mono);
  font-size: 11px;
  line-height: 1;
}
.mp-filters-toggle__count.hidden { display: none; }

/* ---------- Body layout ---------- */
.mp-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  padding: 32px 0 80px;
  align-items: start;
}
.mp-body[data-side="collapsed"] {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 20px;
}
.mp-body[data-side="collapsed"] .mp-side { display: none; }
.mp-body[data-side="collapsed"] .mp-side-rail { display: flex; }
.mp-body[data-side="expanded"] .mp-side-rail { display: none; }
.mp-results { min-width: 0; }

/* ---------- Sidebar ---------- */
.mp-side {
  position: sticky;
  top: 132px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 152px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sx-line) transparent;
  padding-right: 4px;
}
.mp-side::-webkit-scrollbar { width: 6px; }
.mp-side::-webkit-scrollbar-thumb { background: var(--sx-line); border-radius: 3px; }
.mp-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mp-side-head h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.mp-side-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mp-side-reset {
  font-size: 12px;
  color: var(--sx-text-3);
  font-weight: 500;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.mp-side-reset:hover { color: var(--sx-text-2); }

.mp-side-toggle {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sx-text-3);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border: 0;
  cursor: pointer;
  transition: color 120ms ease, box-shadow 120ms ease;
}
.mp-side-toggle:hover {
  color: var(--sx-text);
  box-shadow: 0 0 0 1px var(--sx-line-2) inset;
}
.mp-side-toggle:focus-visible { outline: 2px solid var(--sx-brand); outline-offset: 2px; }

.mp-side-rail {
  display: none;
  position: sticky;
  top: 132px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}
.mp-side-rail .mp-side-toggle {
  width: 32px;
  height: 32px;
}
.mp-side-rail-count {
  font-family: var(--sx-font-mono);
  font-size: 10px;
  color: var(--sx-text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: 4px;
}

.mp-group {
  padding: 14px 0;
  border-bottom: 1px solid var(--sx-line);
}
.mp-group:last-child { border-bottom: 0; }
.mp-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sx-text-3);
  font-weight: 600;
}

.mp-group-list { display: flex; flex-direction: column; gap: 2px; }

.mp-cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--sx-r-sm);
  font-size: 13px;
  color: var(--sx-text-2);
  text-decoration: none;
  transition: background 120ms, color 120ms;
}
.mp-cat-link:hover { background: var(--sx-surface); color: var(--sx-text); }
.mp-cat-link .dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--sx-bg);
  box-shadow: 0 0 0 1px var(--sx-line-2) inset;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.mp-cat-link .name { flex: 1; min-width: 0; }
.mp-cat-link.is-active {
  color: var(--sx-text);
  background: var(--sx-surface);
}
.mp-cat-link.is-active .dot {
  background: var(--sx-brand);
  box-shadow: 0 0 0 1px var(--sx-brand) inset;
}
.mp-cat-link.is-active .dot::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sx-brand-ink);
}

/* Filter chip group (price / model / use case / tag) */
.mp-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}
.mp-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--sx-text-2);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 120ms, color 120ms, box-shadow 120ms;
}
.mp-chip:hover { color: var(--sx-text); box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.mp-chip.is-active {
  color: var(--sx-brand-ink);
  background: var(--sx-brand);
  box-shadow: 0 0 0 1px var(--sx-brand) inset;
}

/* Active filter chip strip (rendered by marketplace.js) */
.mp-active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 16px 0;
  min-height: 0;
}
.mp-active-filters:empty { margin: 0; }
.mp-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  font-size: 12px;
  color: var(--sx-text);
  font-family: inherit;
  border: 0;
  cursor: pointer;
}
.mp-active-chip:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.mp-active-chip__remove {
  font-size: 14px;
  line-height: 1;
  color: var(--sx-text-3);
}

/* ---------- Result meta strip ---------- */
.mp-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--sx-text-2);
  flex-wrap: wrap;
}
.mp-result-meta .mp-status {
  flex: 1; min-width: 0;
  margin: 0;
}
.mp-result-meta .mp-status.error { color: var(--sx-danger, #DC2C50); }

/* ---------- Featured strip ---------- */
.mp-featured {
  margin: 0 0 24px 0;
}
.mp-featured__heading {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sx-text-3);
  font-weight: 600;
  margin: 0 0 12px 0;
}
.mp-featured__row {
  display: grid;
  /* `minmax(0, 1fr)` instead of `1fr` so column tracks can shrink below
   * their content's min-content size — otherwise long titles or wide
   * card chrome force the third column past the container's right edge. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.mp-featured.hidden { display: none; }

/* ---------- Listing grid ---------- */
.mp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.mp-grid.hidden { display: none; }

/* List view — cards rotate to a horizontal layout (cover left, body right) */
.mp-grid[data-view="list"],
.mp-featured__row[data-view="list"] {
  grid-template-columns: 1fr;
  gap: 10px;
}
.mp-grid[data-view="list"] .sx-card,
.mp-featured__row[data-view="list"] .sx-card {
  flex-direction: row;
  align-items: stretch;
}
.mp-grid[data-view="list"] .sx-card-cover,
.mp-featured__row[data-view="list"] .sx-card-cover {
  flex: 0 0 220px;
  aspect-ratio: auto;
  width: 220px;
  align-self: stretch;
  border-radius: var(--sx-r-lg) 0 0 var(--sx-r-lg);
}
.mp-grid[data-view="list"] .sx-card-body,
.mp-featured__row[data-view="list"] .sx-card-body {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
}
.mp-grid[data-view="list"] .sx-card-desc,
.mp-featured__row[data-view="list"] .sx-card-desc {
  -webkit-line-clamp: 2;
  min-height: 0;
}
@media (max-width: 720px) {
  .mp-grid[data-view="list"] .sx-card,
  .mp-featured__row[data-view="list"] .sx-card {
    flex-direction: column;
  }
  .mp-grid[data-view="list"] .sx-card-cover,
  .mp-featured__row[data-view="list"] .sx-card-cover {
    width: auto;
    flex: 0 0 auto;
    aspect-ratio: 16/10;
    border-radius: var(--sx-r-lg) var(--sx-r-lg) 0 0;
  }
}

/* Mid-grid feature panel */
.mp-feature {
  margin-top: 24px;
  padding: 24px;
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(26,31,107,0.14), transparent 60%),
    var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.mp-feature h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.mp-feature p { color: var(--sx-text-2); margin-top: 8px; font-size: 14px; max-width: 50ch; }
.mp-feature-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.mp-feature-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mp-feature-stat {
  padding: 12px;
  background: var(--sx-bg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border-radius: var(--sx-r-md);
  text-align: left;
}
.mp-feature-stat .num { font-family: var(--sx-font-mono); font-size: 18px; color: var(--sx-text); font-weight: 500; }
.mp-feature-stat .lbl { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sx-text-3); margin-top: 4px; }

/* ---------- Loader / empty state ---------- */
.mp-load-spinner {
  margin-top: 28px;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--sx-text-3);
  font-family: var(--sx-font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.mp-load-spinner.hidden { display: none; }
.mp-load-spinner__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sx-text-3);
  animation: mp-pulse 1.2s ease-in-out infinite;
}
.mp-load-spinner__dot:nth-child(2) { animation-delay: 0.15s; }
.mp-load-spinner__dot:nth-child(3) { animation-delay: 0.30s; }
.mp-load-spinner__text { margin-left: 6px; }
@keyframes mp-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%           { opacity: 1;    transform: scale(1); }
}

.mp-empty {
  margin-top: 24px;
  padding: 48px 24px;
  text-align: center;
  border-radius: var(--sx-r-lg);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text-2);
  font-size: 14px;
}
.mp-empty.hidden { display: none; }

/* ---------- Pagination (noscript fallback only) ---------- */
.mp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.mp-pagination__btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--sx-r-md);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.mp-pagination__btn:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.mp-pagination__info { color: var(--sx-text-3); font-family: var(--sx-font-mono); font-size: 12px; }

.mp-scroll-sentinel { height: 1px; }

/* ---------- Load-previous control (infinite scroll, deep-link entry) ---------- */
.mp-prev-loader {
  display: flex;
  justify-content: center;
  padding: 8px 0 16px;
}
.mp-prev-loader.hidden { display: none; }
.mp-prev-loader .mp-pagination__btn {
  cursor: pointer;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}
.mp-prev-loader .mp-pagination__btn[disabled] {
  opacity: 0.65;
  cursor: progress;
}
/* Disable browser scroll-anchoring on grid children so the manual scroll
   restoration in loadPrevPage doesn't double-adjust the viewport. */
.mp-grid > * { overflow-anchor: none; }

/* ---------- Modal (kept for legacy preview-modal hooks) ---------- */
.mp-modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 19, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 24px;
}
.mp-modal.hidden { display: none; }
.mp-modal__content {
  position: relative;
  max-width: 640px; width: 100%;
  background: var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset, 0 30px 60px -20px rgba(14,19,32,0.4);
  padding: 28px 28px 24px;
}
.mp-modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sx-surface-2);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border: 0;
  color: var(--sx-text-2);
  font-size: 18px;
  cursor: pointer;
}
.mp-modal__close:hover { color: var(--sx-text); }
.mp-modal__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.mp-modal__title { font-size: 22px; font-weight: 600; margin: 0 0 4px 0; }
.mp-modal__meta { font-size: 13px; color: var(--sx-text-2); margin: 0 0 4px 0; }
.mp-modal__meta.hidden { display: none; }
.mp-modal__desc { color: var(--sx-text-2); font-size: 14px; line-height: 1.6; margin: 12px 0 0 0; }

/* ---------- Category intro / FAQ (SEO copy on category pages) ---------- */
.mp-category-intro {
  margin-top: 24px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  padding: 24px;
}
.mp-category-intro h2 { font-size: 16px; margin-top: 16px; font-weight: 600; }
.mp-category-intro p { color: var(--sx-text-2); margin-top: 8px; font-size: 14px; line-height: 1.55; }
.mp-category-intro ul { color: var(--sx-text-2); margin: 8px 0 0 18px; padding: 0; font-size: 14px; line-height: 1.55; }
.mp-category-faq h2 { font-size: 16px; }
.mp-category-faq article { padding: 12px 0; border-top: 1px solid var(--sx-line); }
.mp-category-faq h3 { font-size: 14px; font-weight: 600; }
.mp-category-faq p { color: var(--sx-text-2); font-size: 13px; line-height: 1.55; margin-top: 4px; }

/* ---------- Type pill colors inside the modal badge row ---------- */
.mp-modal__badges .type-pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 4px;
  background: var(--sx-surface-2);
  color: var(--sx-text-2);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.mp-modal__badges .type-pill.hidden { display: none; }
.mp-modal__badges .pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 4px;
  background: transparent;
  color: var(--sx-text-3);
  font-size: 12px; font-weight: 500;
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .mp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-featured__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .mp-body { grid-template-columns: 1fr; }
  .mp-body[data-side="collapsed"] { grid-template-columns: 1fr; }
  .mp-side {
    position: static;
    max-height: none;
    overflow: visible;
    display: none;
  }
  .mp-body[data-side="expanded"] .mp-side { display: flex; }
  .mp-body[data-side="collapsed"] .mp-side-rail { display: none; }
  .mp-feature { grid-template-columns: 1fr; }
  .mp-hero-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .mp-hero { padding-top: 40px; padding-bottom: 24px; }
  .mp-hero h1 { font-size: 32px; }
  .mp-grid { grid-template-columns: minmax(0, 1fr); }
  .mp-featured__row { grid-template-columns: minmax(0, 1fr); }
  .mp-toolbar { top: 0; }
  .mp-toolbar-inner { gap: 8px; }
  .mp-tabs { gap: 0; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .mp-toolbar-right { width: 100%; justify-content: space-between; }
}

/* ============================================================
 * Dark theme overrides — mirrors Sigrix_new/Sigrix Marketplace.html
 * ============================================================ */
[data-theme="dark"] .sx { color-scheme: dark; }

/* Sticky toolbar glass over a dark backdrop */
[data-theme="dark"] .mp-toolbar { background: rgba(11,13,18,0.78); }
[data-theme="dark"] .mp-toolbar.is-stuck { box-shadow: 0 4px 16px -12px rgba(0,0,0,0.7); }

/* Search-suggestion popover shadow keys to the dark surface */
[data-theme="dark"] .mp-search__suggestions {
  box-shadow: 0 0 0 1px var(--sx-line) inset, 0 12px 30px -16px rgba(0,0,0,0.7);
}

/* Mid-grid feature panel — boost the indigo glow against the dark surface */
[data-theme="dark"] .mp-feature {
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(91,124,255,0.18), transparent 60%),
    var(--sx-surface);
}

/* Modal scrim and content shadow */
[data-theme="dark"] .mp-modal { background: rgba(0,0,0,0.65); }
[data-theme="dark"] .mp-modal__content {
  box-shadow: 0 0 0 1px var(--sx-line) inset, 0 30px 60px -20px rgba(0,0,0,0.7);
}
