@layer page {
/* Справочник — карточки, toolbar, детальная страница */

.reference-catalog {
  --ref-card-radius: 20px;
  --ref-card-border: rgba(15, 23, 42, 0.08);
  --ref-card-shadow-hover: 0 24px 70px rgba(15, 23, 42, 0.14);
  --ref-muted: #64748b;
  --ref-text: #0f172a;
  --ref-soft: #f8fafc;
}

.reference-catalog__header {
  margin-bottom: var(--space-lg);
}

.reference-catalog__lead {
  max-width: 42rem;
  margin: 0.35rem 0 0;
}

/* Toolbar */
.reference-catalog__toolbar.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

.reference-catalog__search,
.reference-catalog__filter {
  min-width: 0;
}

.reference-catalog__toolbar .input {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.reference-catalog__toolbar .input:focus {
  background: #fff;
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  outline: none;
}

.reference-catalog__toolbar .btn {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* Grid */
.reference-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  align-items: stretch;
  margin-bottom: var(--space-lg);
}

/* Card — z-index контракт: link::after=1, nav/counter/actions=2, badges=3 */
.reference-card.card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  margin-bottom: 0;
  padding: 0;
  border: 1px solid var(--ref-card-border);
  border-radius: var(--ref-card-radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

@media (hover: hover) {
  .reference-card.card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: var(--ref-card-shadow-hover);
  }
}

.reference-card__link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  color: inherit;
  text-decoration: none;
}

.reference-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.reference-card__link:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.35);
  outline-offset: 3px;
  border-radius: var(--ref-card-radius);
}

.reference-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  margin: 10px 10px 0;
  border-radius: calc(var(--ref-card-radius) - 6px);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  overflow: hidden;
}

[data-ref-card-gallery] {
  touch-action: pan-y;
}

.reference-card__badges {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  pointer-events: none;
}

.reference-card__badges .badge {
  flex-shrink: 1;
  min-width: 0;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.reference-card__media img,
.reference-card__media .reference-card__photo {
  width: 94%;
  height: 94%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transition: transform 220ms ease;
}

@media (hover: hover) {
  .reference-card:hover .reference-card__media img,
  .reference-card:hover .reference-card__media .reference-card__photo {
    transform: scale(1.045);
  }
}

.reference-card__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.reference-card__nav::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
}

.reference-card__nav--prev {
  left: 0.35rem;
}

.reference-card__nav--next {
  right: 0.35rem;
}

.reference-card__media:hover .reference-card__nav,
.reference-card__nav:focus-visible {
  opacity: 1;
}

.reference-card__nav:hover,
.reference-card__nav:focus-visible {
  background: rgba(15, 23, 42, 0.88);
}

.reference-card__nav:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 2px;
}

.reference-card__counter {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 2;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
}

@media (hover: none) {
  .reference-card__nav {
    opacity: 1;
  }
}

.reference-card__placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0;
  border-radius: 20px;
  background: #fff;
  color: #94a3b8;
  font-size: 0;
  transform: translate(-50%, -54%);
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.06),
    0 10px 24px rgba(15, 23, 42, 0.06);
}

.reference-card__placeholder::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid currentColor;
  opacity: 0.75;
}

.reference-card__placeholder::after {
  content: "Нет фото";
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  bottom: auto;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 1;
  color: #94a3b8;
  white-space: nowrap;
}

.reference-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.reference-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 16px 18px;
}

.reference-card__article {
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reference-card__title {
  margin: 0;
  color: var(--ref-text);
  font-size: 16px;
  line-height: 1.28;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 41px;
}

.reference-card__brand,
.reference-card__category {
  margin: 8px 0 0;
  color: var(--ref-muted);
  font-size: 13px;
  line-height: 1.35;
}

.reference-card__brand {
  font-weight: 600;
  color: #334155;
}

.reference-card__category {
  margin-top: 2px;
}

.reference-card__meta {
  display: grid;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 14px;
}

.reference-card__meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--ref-soft);
}

.reference-card__meta dt {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reference-card__meta dd {
  margin: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  text-align: right;
}

/* Pagination */
.reference-catalog__pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  margin-bottom: var(--space-lg);
}

.reference-catalog__pagination .ps-pagination__link.is-active,
.reference-catalog__pagination .btn.is-active {
  background: var(--color-accent, #1d4ed8);
  border-color: var(--color-accent, #1d4ed8);
  color: #fff;
  pointer-events: none;
}

.reference-catalog__pagination .ps-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.25rem;
  color: var(--color-muted, #6b7280);
  user-select: none;
}

.reference-catalog__empty,
.reference-catalog__help {
  margin-bottom: var(--space-lg);
}

/* Detail page */
.reference-detail__layout {
  display: grid;
  gap: var(--space-lg) 1.75rem;
  grid-template-columns: minmax(16rem, 42%) minmax(0, 1fr);
  align-items: start;
}

.reference-detail__media img {
  width: 100%;
  max-height: 28rem;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.reference-detail__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 14rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background: var(--color-surface);
}

.reference-detail__placeholder span {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.reference-detail__article {
  margin: 0 0 0.35rem;
  font-size: var(--text-sm);
}

.reference-detail__specs {
  display: grid;
  gap: 0.5rem;
  margin: var(--space-md) 0;
}

.reference-detail__specs div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: var(--space-sm);
}

.reference-detail__specs dt {
  color: var(--color-text-muted);
  font-weight: 600;
}

.reference-detail__specs dd {
  margin: 0;
}

.reference-detail__actions {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.reference-detail__actions-lead {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
}

.reference-detail__actions-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.reference-detail__back {
  margin-top: var(--space-md);
}

/* Autocomplete (формы) */
.reference-suggest-wrap {
  position: relative;
}

.reference-suggest {
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--color-surface-elevated, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-height: 14rem;
  overflow-y: auto;
}

.reference-suggest[hidden] {
  display: none !important;
}

.reference-suggest__item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.reference-suggest__item:hover,
.reference-suggest__item:focus {
  background: var(--color-surface-muted, rgba(0, 0, 0, 0.05));
  outline: none;
}

.reference-suggest__article {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
}

.reference-suggest__name {
  display: block;
  font-size: var(--text-xs, 0.8125rem);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 45rem) {
  .reference-catalog__grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
  }

  .reference-catalog__toolbar.card {
    grid-template-columns: 1fr;
  }

  .reference-detail__layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 30rem) {
  .reference-catalog__grid {
    grid-template-columns: 1fr;
  }
}

/* Redesign v1 — hero, filters, CTA groups, table */
.reference-catalog__hero {
  margin-bottom: var(--space-lg);
  padding: 1.25rem 0 0.5rem;
}

.reference-catalog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: var(--space-lg);
}

.reference-category-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.reference-category-card:hover {
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.reference-category-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.reference-category-card__link {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary, #2563eb);
}

.reference-catalog__steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.reference-catalog__howto,
.reference-catalog__trust {
  margin-bottom: var(--space-lg);
}

.reference-catalog__layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.reference-catalog__filters {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 2rem);
}

.reference-filters-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 0.85rem 1rem 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.reference-catalog__filters .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.ref-filter-group {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  margin-bottom: 0.65rem;
  background: #fff;
  overflow: hidden;
}

.ref-filter-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.95rem;
  user-select: none;
}

.ref-filter-group__summary::-webkit-details-marker {
  display: none;
}

.ref-filter-group__summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 160ms ease;
  flex: 0 0 auto;
  margin-left: auto;
}

.ref-filter-group[open] > .ref-filter-group__summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.ref-filter-group__title {
  flex: 1 1 auto;
}

.ref-filter-group__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.ref-filter-group__body {
  padding: 0 0.85rem 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

[data-ref-filter-groups].is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.ref-filter-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85em;
  color: #64748b;
}

.ref-filter-error {
  margin: 0.4rem 0 0;
  font-size: 0.85em;
  color: #b42318;
}

.reference-catalog__range.is-invalid .input {
  border-color: #f04438;
}

.reference-catalog__range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.reference-catalog__checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Специфичнее .field label / .field input — иначе на desktop чекбокс width:100% */
.reference-catalog__filters .reference-catalog__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: inherit;
  cursor: pointer;
}

.reference-catalog__filters .reference-catalog__checkbox input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  margin: 0.15rem 0 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--color-accent, #007aff);
}

.reference-catalog__toolbar-secondary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reference-catalog__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
}

.reference-catalog__tag {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.reference-catalog__view-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
}

.reference-catalog__views .btn.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.reference-catalog__grid--list {
  grid-template-columns: 1fr;
}

.reference-card--list {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  grid-template-rows: auto auto;
  height: auto;
}

.reference-card--list .reference-card__media {
  grid-column: 1;
  grid-row: 1;
  margin: 10px 0 10px 10px;
}

.reference-card--list .reference-card__link {
  display: flex;
  flex-direction: column;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.reference-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.85rem 0.85rem;
}

.reference-card__status {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--ref-muted);
}

.reference-catalog__table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

.reference-catalog__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.reference-catalog__table th,
.reference-catalog__table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  vertical-align: top;
}

.reference-catalog__table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  white-space: nowrap;
}

.reference-detail__price-alt {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.reference-detail__rrp-hero {
  margin: 1rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reference-detail__rrp-hero-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ref-muted, #64748b);
  letter-spacing: 0.02em;
}

.reference-detail__rrp-hero-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.reference-detail__rrp-hero-note {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
}

.reference-detail__quick-actions {
  position: static;
  display: flex;
  gap: 0.35rem;
  margin: 0.75rem 0 0.25rem;
}

.reference-detail__compare-btn {
  min-height: 40px;
  font-weight: 600;
}

.reference-detail__compare-btn.is-active {
  border-color: rgba(0, 122, 255, 0.4);
  color: var(--color-accent, #007aff);
  background: rgba(0, 122, 255, 0.08);
}

.reference-detail__seller-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.reference-detail__seller-link-wrap {
  margin: 0;
  font-size: 0.875rem;
}

.reference-detail__seller-link-wrap a,
.reference-detail__seller-link-wrap .link-btn {
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.reference-detail__seller-link-wrap a:hover,
.reference-detail__seller-link-wrap .link-btn:hover {
  color: var(--color-accent, #007aff);
}

.reference-detail__rrp {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1px solid rgba(22, 101, 52, 0.12);
}

.reference-detail__rrp-label {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ref-muted);
}

.reference-detail__rrp-value {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.reference-detail__rrp-note {
  margin: 0;
  font-size: 0.82rem;
}

.reference-card__badge--flex {
  background: rgba(59, 130, 246, 0.15);
  color: #1e40af;
}

.reference-card__badge--rrp {
  display: none;
}

.field--actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: flex-end;
}

.reference-detail__price-alt p {
  margin: 0 0 0.35rem;
}

.reference-detail__action-group {
  margin-bottom: 1rem;
}

.reference-detail__action-label {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ref-muted);
}

.reference-detail__actions-btns .btn.is-muted,
.reference-detail__action-group--seller .btn.is-muted {
  opacity: 0.75;
}

.reference-seller-dialog {
  border: none;
  padding: 0;
  border-radius: 16px;
  max-width: min(28rem, calc(100vw - 2rem));
}

.reference-seller-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.reference-seller-dialog__inner {
  padding: 1.25rem;
}

.reference-suggest__meta {
  display: block;
  font-size: 0.7rem;
  color: var(--ref-muted);
}

.reference-detail__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background: #f8fafc;
  border-radius: 16px;
  color: var(--ref-muted);
}

.reference-catalog__similar {
  margin-top: var(--space-xl);
}

.reference-gallery__main {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: #f8fafc;
}

.reference-gallery__main img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  border-radius: 16px;
  background: #f8fafc;
}

.reference-gallery {
  position: relative;
}

.reference-gallery__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: var(--color-text, #1d1d1f);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.12);
}

.badge--service {
  background: #e8f1ff;
  color: #0055b8;
}

.badge--sellers {
  background: #ecfdf3;
  color: #067647;
}

.badge--flex {
  background: #fff7ed;
  color: #9a3412;
}

.badge--painted {
  background: #ecfdf3;
  color: #067647;
}

.badge--white {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.badge--ral {
  background: #f5f3ff;
  color: #6d28d9;
}

.badge--promo {
  background: #fff7ed;
  color: #c2410c;
}

.badge--discount {
  background: #fef2f2;
  color: #b91c1c;
}

.badge--best-price {
  background: #ecfdf5;
  color: #047857;
}

.badge--exclusive {
  background: #ecfdf3;
  color: #067647;
}

.badge--new {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge--hit {
  background: #fff7ed;
  color: #c2410c;
}

.badge--recommended {
  background: #eef2ff;
  color: #4338ca;
}

.badge--bundle {
  background: #ecfeff;
  color: #0e7490;
}

.badge--discontinued {
  background: #f1f5f9;
  color: #64748b;
}

.badge--moisture {
  background: #e0f2fe;
  color: #0369a1;
}

.badge--tall {
  background: #faf5ff;
  color: #7e22ce;
}

.badge--narrow {
  background: #fdf4ff;
  color: #a21caf;
}

.badge--wood {
  background: #fef3c7;
  color: #92400e;
}

.badge--led {
  background: #fef9c3;
  color: #a16207;
}

.reference-detail__header {
  position: relative;
  margin-bottom: 0.5rem;
}

.reference-detail__brand-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.reference-detail__brand-eyebrow a {
  color: #64748b;
  text-decoration: none;
}

.reference-detail__brand-eyebrow a:hover,
.reference-detail__brand-eyebrow a:focus-visible {
  color: var(--color-accent, #007aff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reference-detail__heading {
  margin: 0;
  padding-right: 0;
  line-height: 1.25;
}

.reference-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.45rem 0 0.35rem;
  font-size: 0.9rem;
}

.reference-detail__meta--compact {
  align-items: center;
}

.reference-detail__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.reference-detail__facts-sep {
  color: #94a3b8;
  font-weight: 500;
}

.reference-detail__article {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.reference-detail__howto-compact {
  margin: 0.85rem 0 1.25rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.875rem;
  line-height: 1.45;
  color: #475569;
}

.reference-detail__howto-compact a {
  margin-left: 0.35rem;
  font-weight: 600;
  color: var(--color-accent, #007aff);
  text-decoration: none;
  white-space: nowrap;
}

.reference-detail__howto-compact a:hover,
.reference-detail__howto-compact a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border, rgba(29, 29, 31, 0.12));
  border-radius: 8px;
  background: #fff;
  color: var(--color-text-muted, rgba(29, 29, 31, 0.62));
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.icon-btn:hover,
.icon-btn.is-active {
  color: var(--color-accent, #007aff);
  border-color: var(--color-accent, #007aff);
}

.icon-btn.is-copied {
  color: #166534;
  border-color: rgba(22, 101, 52, 0.4);
  background: rgba(22, 101, 52, 0.08);
}

.rfq-sticky-bar__open {
  flex: 0 0 auto;
  white-space: nowrap;
}

.rfq-panel {
  padding: 16px;
  margin-bottom: 1rem;
  background: var(--color-surface, #f5f5f7);
  border: 1px solid var(--color-border, rgba(29, 29, 31, 0.12));
  border-radius: 12px;
}

.rfq-panel__headline {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}

.rfq-panel__hint {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.rfq-panel__trust {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text, #1d1d1f);
}

.rfq-panel__note {
  margin: 10px 0 0;
  font-size: 0.8rem;
}

.rfq-panel .rfq-widget__add {
  flex: 1 1 auto;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.22);
}

.rfq-panel .rfq-widget__add.rfq-widget__add--in-draft {
  box-shadow: none;
}

.reference-detail__links {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
}

.reference-detail__links .link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--color-accent, #007aff);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reference-detail__seller-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border, rgba(29, 29, 31, 0.12));
}

.reference-detail__seller-block .text-muted {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}

.howto-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.howto-steps__item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.925rem;
  line-height: 1.4;
}

.howto-steps__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--color-accent, #007aff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.reference-detail__faq {
  margin-top: 1.5rem;
}

.rfq-sticky-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--color-border, rgba(29, 29, 31, 0.12));
  box-shadow: 0 -4px 16px rgba(20, 30, 45, 0.08);
}

.rfq-sticky-bar__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
}

.rfq-sticky-bar__label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.rfq-sticky-bar__actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.rfq-sticky-bar__actions .btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0.625rem 0.65rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .rfq-sticky-bar:not([hidden]) {
    display: block;
    z-index: 90;
  }

  .reference-catalog-detail-page .page-wrap {
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
    overflow-x: clip;
    max-width: 100%;
  }

  .reference-catalog-detail-page .reference-detail.card {
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    max-width: 100%;
  }

  .reference-catalog-detail-page .reference-detail.card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .reference-detail__layout {
    gap: 1rem;
    min-width: 0;
  }

  .reference-detail__media,
  .reference-detail__content {
    min-width: 0;
    max-width: 100%;
  }

  .reference-gallery__main {
    aspect-ratio: 4 / 3;
    max-height: min(70vw, 320px);
  }

  .reference-gallery__main img {
    object-fit: contain;
  }

  .reference-gallery__thumbs {
    margin-top: 0.5rem;
    gap: 0.4rem;
  }

  .reference-gallery__thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
  }

  /* tools-bar над sticky RFQ, чтобы не наезжали друг на друга */
  .reference-catalog-detail-page .reference-tools-bar {
    bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
    z-index: 85;
  }

  .reference-catalog-detail-page:has(.rfq-sticky-bar:not([hidden])) .reference-tools-bar {
    display: none !important;
  }

  .reference-catalog-detail-page:has(.rfq-sticky-bar:not([hidden])) .page-wrap {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }
}


.reference-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.reference-gallery__thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
}

.reference-gallery__thumb.is-active,
.reference-gallery__thumb:hover {
  border-color: #0f172a;
}

.reference-gallery__thumb img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.reference-docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.reference-docs__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.reference-docs__type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ref-muted);
}

.reference-docs__link {
  font-weight: 600;
  text-decoration: none;
}

.reference-docs__file {
  font-size: 0.8rem;
}

.reference-lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(920px, calc(100vw - 2rem));
}

.reference-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.72);
}

.reference-lightbox__inner {
  position: relative;
  padding: 1rem;
}

.reference-lightbox__inner img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 12px;
  background: #fff;
}

.reference-lightbox__close,
.reference-lightbox__nav {
  position: absolute;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.reference-lightbox__close {
  top: 0.25rem;
  right: 0.25rem;
}

.reference-lightbox__nav--prev {
  left: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.reference-lightbox__nav--next {
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 40rem) {
  .reference-docs__item {
    grid-template-columns: 1fr;
  }
}

.reference-tools-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  max-width: 100%;
}

.reference-tools-nav__short {
  display: none;
}

.reference-tools-nav a {
  text-decoration: none;
  color: #0f172a;
  flex: 0 0 auto;
}

.reference-tools-nav a:hover {
  text-decoration: underline;
}

.reference-tools-bar {
  position: sticky;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  margin: 1rem auto 0;
  max-width: 42rem;
  padding: 0 0.75rem;
}

.reference-tools-bar[hidden] {
  display: none !important;
}

.reference-tools-bar__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.28);
}

.reference-tools-bar__chips {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.reference-tools-bar__sep {
  opacity: 0.55;
}

.reference-tools-bar__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.reference-tools-bar__chip {
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.reference-tools-bar .btn {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.reference-tools-bar__dismiss {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.reference-tools-bar__dismiss:hover,
.reference-tools-bar__dismiss:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.reference-catalog__results {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

/* Mobile: компактный dock, не перекрывает контент */
@media (max-width: 47.99rem) {
  .reference-tools-bar {
    position: fixed;
    left: 0.75rem;
    right: 4.25rem; /* место под back-to-top */
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    margin: 0;
    max-width: none;
    padding: 0;
  }

  .reference-tools-bar__inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem 0.35rem 0.75rem;
    border-radius: 999px;
    min-height: 48px;
  }

  .reference-tools-bar__actions,
  .reference-tools-bar__open-btn {
    display: none !important;
  }

  .reference-tools-bar__chips {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .reference-tools-bar__chip {
    font-size: 0.8125rem;
    min-height: 40px;
    white-space: nowrap;
  }

  .reference-tools-bar__dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .reference-catalog__results,
  .reference-detail,
  .page-wrap.reference-catalog {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* —— Mobile contract < 48rem —— */
.reference-catalog__hero .section-title {
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  line-height: 1.2;
}

.reference-catalog__lead {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.reference-catalog__toolbar.card {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.reference-catalog__search {
  position: relative;
}

.reference-catalog__search .input {
  padding-right: 2.75rem;
}

.reference-catalog__search-submit {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  color: #0f172a;
}

.reference-card__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0 0.85rem 0.85rem;
}

.reference-card__cta-primary,
.reference-card__cta-secondary,
.reference-card__more-btn {
  min-height: 44px;
  min-width: 44px;
}

.reference-card__cta-primary {
  flex: 1 1 auto;
}

.reference-card__more {
  position: relative;
  margin: 0;
}

.reference-card__more-btn {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reference-card__more-btn::-webkit-details-marker {
  display: none;
}

.reference-card__more-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 11.5rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.reference-card__more-menu a,
.reference-card__more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
}

.reference-card__more-menu a:hover,
.reference-card__more-menu button:hover {
  background: #f1f5f9;
}

.reference-filters-open {
  display: none;
  width: 100%;
  min-height: 44px;
  margin-bottom: 0.75rem;
}

.reference-filters-drawer__header {
  display: none;
}

.reference-filters-drawer__footer {
  display: none;
}

.reference-filters-backdrop {
  display: none;
}

.reference-catalog__desktop-view {
  display: block;
}

.reference-catalog__mobile-view {
  display: none;
}

.reference-catalog__tag {
  text-decoration: none;
  color: inherit;
}

.reference-compare__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.reference-compare__table th:first-child,
.reference-compare__heads .reference-compare__label-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}

.reference-compare__table {
  min-width: 28rem;
}

.reference-compare__heads {
  display: grid;
  grid-template-columns: 140px repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-width: 28rem;
}

body.ref-filters-drawer-open {
  position: fixed;
  left: 0;
  right: 0;
  overflow: hidden;
  width: 100%;
}

@media (max-width: 47.99rem) {
  .reference-filters-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .reference-catalog__layout {
    grid-template-columns: 1fr;
  }

  .reference-catalog__filters {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(22rem, 92vw);
    z-index: 220;
    margin: 0;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
    overflow: hidden;
  }

  .reference-catalog__filters.is-open {
    transform: translateX(0);
  }

  .reference-filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(15, 23, 42, 0.45);
  }

  .reference-filters-backdrop[hidden] {
    display: none !important;
  }

  .reference-filters-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .reference-filters-drawer__close {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
  }

  .reference-filters-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .reference-filters-drawer__footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .reference-filters-actions--desktop {
    display: none;
  }

  .reference-catalog__views {
    display: none !important;
  }

  .reference-catalog__grid--list,
  .reference-catalog__grid--grid {
    grid-template-columns: 1fr !important;
  }

  .reference-card--list {
    display: block;
  }

  .reference-card--list .reference-card__link {
    display: block;
  }

  .reference-catalog__desktop-view {
    display: none;
  }

  .reference-catalog__mobile-view {
    display: block;
  }

  .reference-catalog__filter--toolbar {
    display: block;
  }

  .reference-tools-nav {
    gap: 0.5rem 0.85rem;
    font-size: 0.875rem;
  }

  .reference-compare__heads {
    grid-template-columns: 120px repeat(4, minmax(140px, 1fr));
  }
}

@media (min-width: 48rem) {
  .reference-catalog__toolbar.card {
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
  }

  .reference-filters-drawer__footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
  }

  .reference-filters-actions--desktop {
    display: none;
  }

  .reference-catalog__filters {
    position: sticky;
    top: 1rem;
    transform: none;
    max-height: calc(100vh - 2rem);
  }

  .reference-catalog__layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

.reference-brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.reference-brand-card {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.reference-brand-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.reference-compare__heads {
  display: grid;
  grid-template-columns: 160px repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reference-compare__title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1rem;
}

.reference-compare__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.reference-compare__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.reference-compare__table th,
.reference-compare__table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  vertical-align: top;
}

.reference-compare__table th {
  width: 160px;
  color: var(--ref-muted);
  font-weight: 600;
}

.reference-selection-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn.is-active[data-ref-compare-add],
.btn.is-active[data-ref-selection-add] {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

@media (max-width: 56rem) {
  /* legacy breakpoint kept for compare heads only if >48rem tablet */
}

@media (min-width: 48rem) and (max-width: 56rem) {
  .reference-catalog__layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

/* ---- RFQ draft widget (карточка эталона) ---- */
.rfq-widget__row { display: flex; gap: 8px; align-items: stretch; }

.rfq-stepper {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--color-border); border-radius: 6px; overflow: hidden;
}
.rfq-stepper__btn {
  width: 34px; border: 0; background: transparent; cursor: pointer;
  font-size: 16px; line-height: 1; color: inherit;
}
.rfq-stepper__btn:hover { background: rgba(0, 0, 0, .05); }
.rfq-stepper__input {
  width: 56px; border: 0; border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center; font: inherit; -moz-appearance: textfield;
}
.rfq-stepper__input::-webkit-outer-spin-button,
.rfq-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.rfq-widget__status {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #166534;
}

.rfq-widget__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.55rem;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 122, 255, 0.35);
  background: rgba(0, 122, 255, 0.08);
  color: var(--color-accent, #007aff);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.rfq-widget__open:hover,
.rfq-widget__open:focus-visible {
  background: rgba(0, 122, 255, 0.14);
  outline: none;
}

.rfq-widget__limit {
  margin: 8px 0 0;
  font-size: 13px;
  color: #b0413e;
}

/* ---- Index Phase A: hero RFQ, draft banner, card CTAs ---- */
.reference-catalog__hero--compact {
  margin-bottom: 1rem;
  padding: 0.25rem 0 0.5rem;
}

.reference-catalog__hero--compact .section-title {
  margin-bottom: 0.35rem;
}

.reference-catalog__hero-search {
  margin: 0.85rem 0 0.5rem;
}

.reference-catalog__search--hero {
  display: flex;
  gap: 8px;
  align-items: stretch;
  position: relative;
}

.reference-catalog__search--hero .input {
  flex: 1;
  min-height: 48px;
  font-size: 1rem;
  padding-right: 1rem;
}

.reference-catalog__search-btn {
  flex: none;
  min-height: 48px;
  padding: 0 1.25rem;
}

.reference-catalog__popular {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted, rgba(29, 29, 31, 0.62));
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.reference-catalog__popular-label {
  margin-right: 0.25rem;
}

.reference-catalog__chip {
  color: var(--color-accent, #007aff);
  text-decoration: none;
}

.reference-catalog__chip:hover {
  text-decoration: underline;
}

.reference-catalog__hero-note {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
}

.reference-catalog__hero-note .link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--color-accent, #007aff);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rfq-draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 0 0 1rem;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.18);
  font-size: 0.925rem;
  font-weight: 600;
}

.rfq-draft-banner.is-pulse {
  animation: rfq-banner-pulse 0.9s ease;
}

@keyframes rfq-banner-pulse {
  0% { background: rgba(0, 122, 255, 0.08); }
  35% { background: rgba(0, 122, 255, 0.22); }
  100% { background: rgba(0, 122, 255, 0.08); }
}

.reference-tools-nav {
  align-items: center;
}

.reference-tools-nav__rfq {
  margin-left: auto;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.reference-tools-nav__rfq.is-active {
  background: var(--color-accent, #007aff);
  color: #fff !important;
  text-decoration: none !important;
}

.reference-tools-nav__rfq.is-active:hover {
  background: var(--color-accent-hover, #0066d6);
}

.reference-card__badge--neutral {
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
}

.reference-card__sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--ref-muted, #64748b);
}

.reference-card__dims {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.reference-card__dimensions {
  display: inline-flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

.reference-card__dim {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  min-width: 40px;
}

.reference-card__dim-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}

.reference-card__dim-label {
  font-size: 0.6rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 500;
}

.reference-card__dim-unit {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1;
  padding: 0 0 0.32rem;
  flex: 0 0 auto;
}

.reference-card__specs {
  font-size: 0.75rem;
  color: var(--ref-muted, #64748b);
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.reference-card__price {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.reference-card__price-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ref-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reference-card__price-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.reference-card__actions--rfq {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 auto;
  margin-top: auto;
  gap: 0.4rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.reference-card__cta-note {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.35;
}

.reference-card__actions-secondary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.reference-card__link-quiet {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.25rem 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-radius: 6px;
}

.reference-card__link-quiet:hover,
.reference-card__link-quiet:focus-visible {
  color: var(--color-accent, #007aff);
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

.reference-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  min-height: 40px;
  font-family: inherit;
}

.reference-card__btn--secondary {
  background: #f1f5f9;
  color: #475569;
}

.reference-card__btn--secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.reference-card__btn--primary {
  background: var(--color-accent, #2563eb);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.reference-card__btn--primary:hover {
  background: var(--color-accent-hover, #1d4ed8);
}

.reference-card__btn--icon {
  background: #f1f5f9;
  color: #64748b;
  padding: 0.5rem;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 auto;
}

.reference-card__btn--icon:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.reference-card--list .reference-card__actions--rfq {
  grid-column: 1 / -1;
}

.reference-card__more {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}

.reference-card__more-btn {
  list-style: none;
}

.reference-card__more-btn::-webkit-details-marker {
  display: none;
}

.reference-card__actions--rfq .reference-card__cta-primary {
  width: 100%;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

@media (max-width: 480px) {
  .reference-card__dim {
    padding: 0.25rem 0.4rem;
    min-width: 36px;
  }

  .reference-card__dim-value {
    font-size: 0.75rem;
  }
}

@media (max-width: 767.98px) {
  .reference-catalog__grid {
    gap: 1.25rem;
  }

  .reference-card__media {
    margin: 6px 6px 0;
  }

  .reference-card__media img,
  .reference-card__media .reference-card__photo {
    width: 98%;
    height: 98%;
  }

  .reference-card__badges .badge {
    padding: 1px 5px;
    font-size: 9px;
    letter-spacing: -0.01em;
  }

  .reference-card__body {
    padding: 14px 14px 16px;
  }

  .reference-card__title {
    min-height: 0;
    font-size: 15px;
    line-height: 1.32;
    -webkit-line-clamp: 3;
  }

  .reference-card__sub,
  .reference-card__specs {
    font-size: 0.8125rem;
  }

  .reference-card__actions--rfq {
    padding: 0.65rem 0.85rem 0.85rem;
    gap: 0.45rem;
  }

  .reference-card__actions-secondary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.4rem;
  }

  .reference-card__link-quiet {
    min-height: 40px;
    padding: 0.35rem 0.15rem;
  }

  .reference-card__btn--icon {
    min-width: 40px;
    min-height: 40px;
    padding: 0.45rem;
  }

  /* nav — вторичная навигация (+ swipe); WCAG hit-area через ::before, не __btn--icon bump */
  .reference-card__nav {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
    background: rgb(255 255 255 / 0.75);
    color: #0f172a;
  }

  .reference-card__nav::before {
    inset: -0.625rem;
  }

  .reference-card__nav:hover,
  .reference-card__nav:focus-visible {
    background: rgb(255 255 255 / 0.92);
  }

  .reference-card__counter {
    font-size: 0.6875rem;
    padding: 1px 6px;
  }

  .reference-card--list .reference-card__link {
    display: flex;
    flex-direction: column;
  }
}

.reference-card__actions--rfq .reference-card__more {
  flex: none;
}

.rfq-quick-add--in-draft {
  background: transparent !important;
  color: var(--color-accent, #007aff) !important;
  border: 1px solid var(--color-accent, #007aff) !important;
}

.reference-catalog__seo-editorial,
.seo-editorial {
  margin: var(--space-xl, 3rem) 0 1.5rem;
  max-width: 72rem;
}

.seo-editorial__intro {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.75rem;
}

.seo-editorial__intro--no-media {
  grid-template-columns: 1fr;
}

.seo-editorial__intro--no-media .seo-editorial__body p {
  max-width: 72ch;
}

.seo-editorial__title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  font-weight: 700;
  color: var(--color-text, #1d1d1f);
}

.seo-editorial__text p,
.seo-editorial__body > p {
  margin: 0 0 0.9rem;
  max-width: 70ch;
  color: var(--color-text-muted, rgba(29, 29, 31, 0.72));
  font-size: 0.95rem;
  line-height: 1.55;
}

.seo-editorial__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.1rem 0 0.4rem;
  padding: 0;
  list-style: none;
}

.seo-editorial__tags li {
  padding: 0;
  background: transparent;
  border: none;
}

.seo-editorial__chip {
  display: inline-flex;
  align-items: center;
  background: var(--color-bg-soft, #f5f7fb);
  border: 1px solid var(--color-border, rgba(29, 29, 31, 0.12));
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.84rem;
  color: var(--color-text, #1d1d1f);
  white-space: nowrap;
  text-decoration: none;
}

.seo-editorial__chip--link {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.seo-editorial__chip--link:hover,
.seo-editorial__chip--link:focus-visible {
  border-color: var(--color-accent, #007aff);
  background: rgba(0, 122, 255, 0.08);
  color: var(--color-accent, #007aff);
  outline: none;
}

.seo-editorial__chip--static {
  cursor: default;
  opacity: 0.85;
}

.reference-catalog__brand-lock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
}

.reference-catalog__brand-lock a {
  font-weight: 600;
}

.seo-editorial__note {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--color-bg-soft, #f5f7fb);
  border-left: 4px solid var(--color-accent, #007aff);
  border-radius: var(--radius-sm, 8px);
  padding: 0.85rem 1.1rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-text-muted, rgba(29, 29, 31, 0.72));
}

.seo-editorial__note-icon {
  flex: none;
  margin-top: 0.15rem;
  color: var(--color-accent, #007aff);
}

.seo-editorial__note a {
  color: var(--color-accent, #007aff);
  font-weight: 600;
}

.seo-editorial__media {
  margin: 0;
  position: relative;
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(29, 29, 31, 0.1);
}

.seo-editorial__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.seo-editorial__media figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.seo-editorial__faq-title {
  margin: 0 0 1.1rem;
}

.seo-editorial__faq .faq-list--compact {
  margin-top: 0.25rem;
}

@media (max-width: 860px) {
  .seo-editorial__intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .seo-editorial__media {
    order: -1;
  }
}

.reference-catalog__howto-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border, rgba(29, 29, 31, 0.12));
}

.howto-steps--row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.reference-catalog__trust-line {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.reference-catalog__seo-brands {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.reference-catalog__seo-brands a {
  color: var(--color-accent, #007aff);
}

.reference-catalog__empty-alt {
  margin: 1rem 0 0.5rem;
  font-weight: 600;
}

.reference-toast__link {
  margin-left: 0.35rem;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
}

.reference-catalog__table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

@media (max-width: 47.99rem) {
  .howto-steps--row {
    grid-template-columns: 1fr;
  }

  .reference-catalog__search--hero {
    flex-direction: column;
  }

  .reference-tools-nav {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    padding: 0 0.15rem 0.65rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .reference-tools-nav::-webkit-scrollbar {
    display: none;
  }

  .reference-tools-nav a {
    white-space: nowrap;
  }

  .reference-tools-nav__long {
    display: none;
  }

  .reference-tools-nav__short {
    display: inline;
  }

  .reference-tools-nav__rfq {
    margin-left: 0;
    flex: none;
    position: static;
  }
}

/* ==========================================================================
   Top-filters layout (как каталог): панель сверху + drawer + сетка 4 колонки
   ========================================================================== */

.reference-catalog--top-filters .reference-catalog__layout--top {
  display: block;
  grid-template-columns: 1fr;
}

.reference-catalog--top-filters .reference-top-filters {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
}

.reference-catalog--top-filters .reference-top-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.75rem;
}

.reference-catalog--top-filters .reference-filters-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 8.5rem;
  margin: 0;
  flex: 0 0 auto;
}

.reference-catalog--top-filters .reference-top-filters__quick {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 18rem;
}

.reference-catalog--top-filters .reference-top-filters__view-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.reference-catalog--top-filters .reference-top-filters__tags {
  margin: 0;
}

.reference-catalog--top-filters .reference-top-filters__meta {
  margin: 0;
  font-size: 0.875rem;
}

/* Drawer overlay на всех ширинах */
.reference-catalog--top-filters .reference-catalog__filters {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(24rem, 92vw);
  z-index: 220;
  margin: 0;
  border-radius: 0;
  transform: translateX(-105%);
  transition: transform 200ms ease;
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  overflow: hidden;
  background: #fff;
}

.reference-catalog--top-filters .reference-catalog__filters.is-open {
  transform: translateX(0);
}

.reference-catalog--top-filters .reference-filters-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(15, 23, 42, 0.45);
}

.reference-catalog--top-filters .reference-filters-backdrop[hidden] {
  display: none !important;
}

.reference-catalog--top-filters .reference-filters-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
}

.reference-catalog--top-filters .reference-filters-drawer__close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
}

.reference-catalog--top-filters .reference-filters-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.reference-catalog--top-filters .reference-filters-drawer__footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  flex: 0 0 auto;
}

.reference-catalog--top-filters .reference-filters-actions--desktop {
  display: none;
}

/* Сетка: 4 карточки на desktop */
.reference-catalog--top-filters .reference-catalog__grid:not(.reference-catalog__grid--list) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

@media (max-width: 64rem) {
  .reference-catalog--top-filters .reference-catalog__grid:not(.reference-catalog__grid--list) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 48rem) {
  .reference-catalog--top-filters .reference-catalog__grid:not(.reference-catalog__grid--list) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .reference-catalog--top-filters .reference-top-filters__view-sort {
    width: 100%;
    margin-left: 0;
  }

  .reference-catalog--top-filters .reference-catalog__views {
    display: none !important;
  }

  .reference-catalog--top-filters .reference-filters-open {
    flex: 1 1 auto;
  }

  .reference-catalog--top-filters .reference-top-filters__quick {
    flex: 1 1 100%;
    max-width: none;
  }
}

@media (max-width: 30rem) {
  .reference-catalog--top-filters .reference-catalog__grid:not(.reference-catalog__grid--list) {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 48rem) {
  .reference-catalog--top-filters .reference-catalog__filters {
    position: fixed;
    transform: translateX(-105%);
    max-height: 100dvh;
  }

  .reference-catalog--top-filters .reference-catalog__filters.is-open {
    transform: translateX(0);
  }

  .reference-catalog--top-filters .reference-catalog__layout--top {
    grid-template-columns: 1fr;
  }
}

/* ——— Витрина (showcase): hero + horizontal pop-out tiles ——— */
.reference-catalog--showcase {
  --ref-showcase-bg: #eceff3;
  --ref-showcase-plate: #e4e8ee;
  --ref-showcase-ink: #1a1d24;
  --ref-showcase-muted: #6b7280;
}

.ref-showcase-hero {
  margin: 0 0 1.5rem;
}

.ref-showcase-hero__panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0;
  min-height: 280px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(135deg, #dfe5ec 0%, #c8d0db 48%, #b7c0cd 100%);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
}

.ref-showcase-hero__panel--compact {
  grid-template-columns: 1fr;
  min-height: 0;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.5), transparent 55%),
    linear-gradient(135deg, #e8ecf1 0%, #d5dce6 100%);
}

.ref-showcase-hero__copy {
  padding: 1.75rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.65rem;
}

.ref-showcase-hero__brand {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ref-showcase-muted);
}

.ref-showcase-hero__title {
  margin: 0;
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ref-showcase-ink);
  font-weight: 800;
}

.ref-showcase-hero__lead {
  margin: 0;
  max-width: 36rem;
  color: #3f4654;
  font-size: 1.02rem;
  line-height: 1.45;
}

.ref-showcase-hero__search {
  margin: 0.35rem 0 0;
  max-width: 32rem;
}

.ref-showcase-hero__paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  max-width: 32rem;
  margin: 0.15rem 0 0;
}

.ref-showcase-hero__path {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 3.35rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ref-showcase-hero__path:hover,
.ref-showcase-hero__path:focus-visible {
  border-color: rgba(0, 122, 255, 0.55);
  background: #fff;
  outline: none;
}

.ref-showcase-hero__path-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ref-showcase-ink, #1a1d24);
}

.ref-showcase-hero__path-hint {
  font-size: 0.78rem;
  color: var(--ref-showcase-muted, #6b7280);
  line-height: 1.3;
}

.ref-guide-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(28rem, calc(100vw - 1.5rem));
}

.ref-guide-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.ref-guide-dialog__inner {
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.ref-guide-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ref-guide-dialog__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.ref-guide-dialog__close {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.ref-guide-dialog__lead {
  margin: 0.45rem 0 0.85rem;
  color: #64748b;
  font-size: 0.9rem;
}

.ref-guide-dialog__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ref-guide-dialog__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ref-guide-dialog__item:hover,
.ref-guide-dialog__item:focus-visible {
  border-color: rgba(0, 122, 255, 0.45);
  background: #fff;
  outline: none;
}

.ref-guide-dialog__item-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.ref-guide-dialog__item-hint {
  font-size: 0.8rem;
  color: #64748b;
}

.ref-guide-dialog__zones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.ref-guide-dialog__zone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.ref-guide-dialog__zone:hover,
.ref-guide-dialog__zone:focus-visible {
  border-color: rgba(0, 122, 255, 0.35);
  outline: none;
}

.ref-guide-dialog__zone-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.ref-guide-dialog__zone-hint {
  font-size: 0.8rem;
  color: #64748b;
}

.ref-guide-dialog__back {
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 0.85rem;
}

.ref-category-hint {
  margin: 0 0 0.45rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #475569;
}

.reference-catalog__empty-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

@media (max-width: 47.99rem) {
  .ref-showcase-hero__paths {
    grid-template-columns: 1fr;
  }
}

.ref-showcase-hero__search .reference-catalog__search--hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: stretch;
}

.ref-showcase-hero__search .input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.88);
}

.ref-showcase-hero__search .btn {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
}

.ref-showcase-hero__note {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--ref-showcase-muted);
}

.ref-showcase-hero__note .link-btn {
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.ref-showcase-hero__visual {
  position: relative;
  min-height: 240px;
}

.ref-showcase-hero__visual-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.ref-showcase-hero__visual-inner img {
  width: auto;
  height: auto;
  max-width: min(100%, 420px);
  max-height: 90%;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 18px 32px rgba(15, 23, 42, 0.22));
  transform: none;
}

.ref-showcase-hero__visual-fallback {
  width: min(70%, 280px);
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 40%),
    linear-gradient(145deg, #9aa6b5, #6f7c8c);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  transform: none;
}

.ref-showcase {
  margin: 0 0 1.75rem;
}

.ref-showcase__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.ref-showcase__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ref-showcase-ink);
}

.ref-showcase__more {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ref-showcase-ink);
  text-decoration: none;
  white-space: nowrap;
}

.ref-showcase__more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ref-showcase__viewport {
  position: relative;
}

.ref-showcase__scroll-hint {
  display: none;
}

.ref-showcase__rail {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.15rem 0.35rem;
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ref-showcase__rail::-webkit-scrollbar {
  display: none;
}

.ref-showcase--wrap .ref-showcase__rail {
  flex-wrap: wrap;
  overflow: visible;
  scroll-snap-type: none;
  padding-top: 0.35rem;
}

.ref-showcase__item {
  flex: 0 0 auto;
  width: 7.75rem;
  scroll-snap-align: start;
}

.ref-showcase--wrap .ref-showcase__item {
  width: 8.25rem;
}

.ref-showcase__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
}

.ref-showcase__plate {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22px;
  background: var(--ref-showcase-plate);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ref-showcase__tile:hover .ref-showcase__plate {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.06),
    0 14px 28px rgba(15, 23, 42, 0.12);
}

.ref-showcase__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.ref-showcase__plate--empty {
  display: grid;
  place-items: center;
}

.ref-showcase__mono {
  font-size: 1.75rem;
  font-weight: 800;
  color: #8b93a3;
  letter-spacing: -0.03em;
}

.ref-showcase__label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ref-showcase-ink);
  max-width: 100%;
}

.ref-showcase__meta {
  font-size: 0.78rem;
  color: var(--ref-showcase-muted);
  margin-top: -0.25rem;
}

.ref-showcase__nav {
  position: absolute;
  top: 42%;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  color: var(--ref-showcase-ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ref-showcase__nav[hidden] {
  display: none !important;
}

.ref-showcase__nav--prev {
  left: -0.35rem;
}

.ref-showcase__nav--next {
  right: -0.35rem;
}

.ref-showcase__nav:hover {
  background: #fff;
}

.ref-showcase__tile.is-active .ref-showcase__plate {
  box-shadow:
    inset 0 0 0 2px var(--ref-showcase-ink),
    0 8px 18px rgba(15, 23, 42, 0.1);
}

.ref-showcase__tile.is-active .ref-showcase__label {
  font-weight: 700;
}

.ref-showcase__tile:focus-visible {
  outline: 2px solid var(--ref-showcase-ink);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Компактные чипсы на странице бренда при выбранной категории */
.ref-showcase--compact {
  margin: 0 0 1rem;
}

.ref-showcase--compact .ref-showcase__head--compact {
  margin-bottom: 0.45rem;
}

.ref-showcase--compact .ref-showcase__title {
  font-size: 1rem;
  font-weight: 700;
}

.ref-showcase--compact .ref-showcase__rail {
  gap: 0.5rem;
  padding: 0.15rem 0;
  scroll-snap-type: x proximity;
}

.ref-showcase--compact .ref-showcase__item {
  width: auto;
  max-width: 11rem;
}

.ref-showcase--compact .ref-showcase__tile {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: #f3f5f8;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: background 140ms ease, box-shadow 140ms ease;
}

.ref-showcase--compact .ref-showcase__tile:hover {
  background: #e8ecf2;
}

.ref-showcase--compact .ref-showcase__tile.is-active {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--ref-showcase-ink);
}

.ref-showcase--compact .ref-showcase__tile.is-active .ref-showcase__plate {
  box-shadow: none;
}

.ref-showcase--compact .ref-showcase__plate {
  width: 2.25rem;
  min-width: 2.25rem;
  aspect-ratio: 1;
  border-radius: 999px;
  box-shadow: none;
}

.ref-showcase--compact .ref-showcase__tile:hover .ref-showcase__plate {
  transform: none;
  box-shadow: none;
}

.ref-showcase--compact .ref-showcase__mono {
  font-size: 0.85rem;
}

.ref-showcase--compact .ref-showcase__label {
  -webkit-line-clamp: 1;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 6.5rem;
}

.ref-showcase--compact .ref-showcase__meta {
  margin-top: 0;
  font-size: 0.72rem;
  white-space: nowrap;
}

.ref-showcase--compact .ref-showcase__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
}

.reference-catalog--brand-rail .ref-showcase:not(.ref-showcase--compact) {
  margin-top: 0.25rem;
}

/* Быстрые чипы задач */
.ref-task-chips {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0 1rem;
  min-width: 0;
}

.ref-task-chips__label {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.ref-task-chips__row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  min-width: 0;
  padding: 0.15rem 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ref-task-chips__row::-webkit-scrollbar {
  display: none;
}

.ref-task-chips__chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ref-task-chips__chip:hover,
.ref-task-chips__chip:focus-visible {
  border-color: rgba(0, 122, 255, 0.45);
  color: var(--color-accent, #007aff);
  outline: none;
}

.ref-task-chips__chip.is-active {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.35);
  color: var(--color-accent, #007aff);
}

/* Контекст выбранной категории */
.ref-category-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ref-category-context__body {
  min-width: 0;
  flex: 1 1 auto;
}

.ref-category-context__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  min-width: 0;
  font-size: 0.925rem;
}

.ref-category-context__name {
  font-weight: 700;
  color: #0f172a;
}

.ref-category-context__sep {
  color: #94a3b8;
}

.ref-category-context__count {
  color: #64748b;
  font-weight: 500;
}

.ref-category-nextstep {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #475569;
  font-weight: 500;
}

.ref-category-context__clear {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent, #007aff);
  text-decoration: none;
  white-space: nowrap;
  margin-top: 0.1rem;
}

.ref-category-context__clear:hover,
.ref-category-context__clear:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

.ref-category-context-sentinel {
  display: block;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  visibility: hidden;
}

.ref-category-sticky {
  display: none;
  position: fixed;
  top: var(--header-offset, 3.5rem);
  left: 0;
  right: 0;
  z-index: 35;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ref-category-sticky__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 42rem;
  margin: 0 auto;
  min-width: 0;
}

.ref-category-sticky__trail {
  flex: 1 1 auto;
  min-width: 0;
}

.ref-category-sticky__trail ol {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  overflow: hidden;
}

.ref-category-sticky__trail li {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 1;
}

.ref-category-sticky__trail li:not(:last-child)::after {
  content: "›";
  margin: 0 0.15rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.ref-category-sticky__trail a,
.ref-category-sticky__label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 8.5rem;
  color: inherit;
  text-decoration: none;
}

.ref-category-sticky__trail a:hover,
.ref-category-sticky__trail a:focus-visible {
  color: var(--color-accent, #007aff);
  outline: none;
}

.ref-category-sticky__ellipsis {
  flex-shrink: 0;
}

.ref-category-sticky__ellipsis .ref-category-sticky__label,
.ref-category-sticky__ellipsis a {
  max-width: 1.25rem;
}

.ref-category-sticky__trail li[aria-current="page"] .ref-category-sticky__label {
  color: #0f172a;
  max-width: 11rem;
}

.ref-category-sticky__count {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.ref-category-sticky__clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 1.125rem;
  line-height: 1;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-radius: 999px;
}

.ref-category-sticky__clear:hover,
.ref-category-sticky__clear:focus-visible {
  color: var(--color-accent, #007aff);
  background: rgba(0, 122, 255, 0.08);
  outline: none;
}

@media (max-width: 767.98px) {
  .ref-category-sticky:not([hidden]) {
    display: block;
  }
}

.reference-catalog__empty {
  padding: 1.35rem 1.25rem 1.4rem;
  text-align: left;
}

.reference-catalog__empty-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.reference-catalog__empty-lead {
  margin: 0 0 1rem;
}

.reference-catalog__empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 56rem) {
  .ref-showcase-hero__panel {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .ref-showcase-hero__visual {
    min-height: 200px;
    order: -1;
  }

  .ref-showcase-hero__visual-inner img {
    max-height: 210px;
    transform: none;
  }

  .ref-showcase__nav {
    display: none;
  }

  .ref-showcase__viewport.is-scrollable:not(.is-at-end) .ref-showcase__rail {
    -webkit-mask-image: linear-gradient(to right, #000 78%, transparent);
    mask-image: linear-gradient(to right, #000 78%, transparent);
  }

  .ref-showcase__viewport.is-scrollable:not(.is-at-start) .ref-showcase__rail {
    -webkit-mask-image: linear-gradient(to left, #000 78%, transparent);
    mask-image: linear-gradient(to left, #000 78%, transparent);
  }

  .ref-showcase__viewport.is-scrollable:not(.is-at-start):not(.is-at-end) .ref-showcase__rail {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 78%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 78%, transparent);
  }

  .ref-showcase__viewport.is-scrollable:not(.is-at-end) .ref-showcase__scroll-hint {
    display: block;
    position: absolute;
    right: 0.65rem;
    bottom: 0.15rem;
    margin: 0;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 2;
  }

  .ref-task-chips {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (max-width: 36rem) {
  .ref-showcase-hero__copy {
    padding: 1.25rem 1.1rem 1.2rem;
  }

  .ref-showcase__item {
    width: 6.85rem;
  }

  .ref-showcase--wrap .ref-showcase__item {
    width: calc(33.333% - 0.6rem);
  }
}

/* Category drawer accordion (filters drawer) */
.ref-category-drawer {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ref-category-drawer__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ref-category-drawer__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.ref-category-drawer__reset {
  font-size: 0.875rem;
  white-space: nowrap;
}

.ref-category-drawer__search {
  width: 100%;
  margin-bottom: 0.75rem;
}

.ref-category-drawer__root + .ref-category-drawer__root {
  margin-top: 0.35rem;
}

.ref-category-drawer__branch {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.5rem;
  background: rgba(248, 250, 252, 0.7);
}

.ref-category-drawer__branch + .ref-category-drawer__branch,
.ref-category-drawer__branch + .ref-category-drawer__leaf,
.ref-category-drawer__leaf + .ref-category-drawer__branch,
.ref-category-drawer__leaf + .ref-category-drawer__leaf {
  margin-top: 0.35rem;
}

.ref-category-drawer__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  list-style: none;
}

.ref-category-drawer__summary::-webkit-details-marker {
  display: none;
}

.ref-category-drawer__link,
.ref-category-drawer__leaf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  color: inherit;
  text-decoration: none;
  border-radius: 0.5rem;
}

.ref-category-drawer__link:hover,
.ref-category-drawer__leaf:hover {
  background: rgba(15, 23, 42, 0.04);
}

.ref-category-drawer__link.is-active,
.ref-category-drawer__leaf.is-active {
  font-weight: 600;
  background: rgba(37, 99, 235, 0.08);
}

.ref-category-drawer__arrow {
  opacity: 0.55;
  font-size: 0.85em;
}

.ref-category-drawer__count {
  flex: 0 0 auto;
  font-size: 0.8125rem;
  color: rgba(15, 23, 42, 0.55);
}

.ref-category-drawer__children {
  list-style: none;
  margin: 0;
  padding: 0 0.35rem 0.45rem 0.75rem;
}

.ref-category-drawer__item + .ref-category-drawer__item {
  margin-top: 0.25rem;
}

.ref-category-drawer__empty {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.ref-category-drawer__summary {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}

.ref-category-drawer__results {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.ref-category-drawer__result-link {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.5rem;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.ref-category-drawer__result-link:hover,
.ref-category-drawer__result-link.is-active {
  background: rgba(37, 99, 235, 0.08);
}

.ref-category-drawer__result-title {
  font-weight: 600;
}

.ref-category-drawer__result-subtitle,
.ref-category-drawer__result-meta {
  font-size: 0.8125rem;
}

.ref-category-drawer__result-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ref-category-drawer__zone-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.72);
}

.ref-category-drawer__mark {
  padding: 0 0.1em;
  border-radius: 0.15em;
  background: rgba(37, 99, 235, 0.16);
  color: inherit;
}

.ref-category-drawer__empty-wrap {
  margin-top: 0.5rem;
}

.ref-category-drawer__empty-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
}

.ref-category-drawer__empty-action {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.reference-top-filters__row .reference-categories-open {
  white-space: nowrap;
}

@media (max-width: 47.99rem) {
  .reference-top-filters__row .reference-categories-open {
    flex: 1 1 auto;
    min-width: 0;
  }
}
