/* === Библиотека текстильщика === */
.dx-dict-page { padding: 2rem 0 4rem; }
.dx-dict-page .dx-section-head { margin-bottom: 1.4rem; max-width: 760px; margin-left: auto; margin-right: auto; }

#dx-dict { max-width: 1100px; margin: 0 auto; padding: 0 15px; }
.dx-dict__err { color:#c33; padding:2rem; text-align:center; }

/* Поиск */
.dx-dict__top {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
  padding: 1rem 0;
  display: flex;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid #eef0f3;
}
.dx-dict__search {
  flex: 1;
  position: relative;
}
.dx-dict__search input[type="search"] {
  width: 100%;
  padding: .85rem 3rem .85rem 1.2rem;
  border: 2px solid #eef0f3;
  border-radius: 999px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
  background: #fafbfc;
}
.dx-dict__search input[type="search"]:focus {
  border-color: #5b3df5;
  background: #fff;
}
.dx-dict__clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: 0; background: #eef0f3;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: #555;
}
.dx-dict__clear:hover { background: #ddd; color: #000; }
.dx-dict__counter {
  white-space: nowrap;
  color: #5a6878;
  font-size: .9rem;
  font-weight: 500;
}

/* Алфавит */
.dx-dict__alpha {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 1rem 0;
  margin-bottom: .5rem;
  border-bottom: 1px solid #eef0f3;
}
.dx-dict__alpha-letter {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #f7f9fc;
  color: #0a1929;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s;
}
.dx-dict__alpha-letter:hover {
  background: #5b3df5;
  color: #fff;
}

/* Категории-фильтры */
.dx-dict__cats {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 1rem 0 1.4rem;
  border-bottom: 1px solid #eef0f3;
  margin-bottom: 2rem;
}
.dx-dict__cat {
  border: 1px solid #d2d8e0;
  background: #fff;
  color: #0a1929;
  padding: .45rem 1rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.dx-dict__cat:hover { border-color: #0a1929; }
.dx-dict__cat.is-active {
  background: #0a1929;
  color: #fff;
  border-color: #0a1929;
}

/* Группа букв */
.dx-dict__group { margin-bottom: 2.5rem; scroll-margin-top: 100px; }
.dx-dict__letter {
  font-family: 'Sofia Sans Condensed', system-ui, sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: #5b3df5;
  margin: 0 0 1rem;
  line-height: 1;
}

/* Термин */
.dx-dict__item {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  margin-bottom: .6rem;
  transition: border-color .2s, box-shadow .2s;
}
.dx-dict__item:hover { border-color: #d2d8e0; }
.dx-dict__item[open] {
  border-color: #5b3df5;
  box-shadow: 0 6px 18px rgba(91, 61, 245, .08);
}
.dx-dict__item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.dx-dict__item summary::-webkit-details-marker { display: none; }
.dx-dict__item summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.4rem;
  font-weight: 600;
  color: #888;
  flex: 0 0 auto;
  transition: transform .2s;
}
.dx-dict__item[open] summary::after { transform: rotate(45deg); color: #5b3df5; }
.dx-dict__term {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0a1929;
}
.dx-dict__cat-tag {
  font-size: .75rem;
  color: #5a6878;
  background: #f7f9fc;
  padding: .25rem .65rem;
  border-radius: 999px;
  text-transform: lowercase;
  white-space: nowrap;
}
.dx-dict__def {
  padding: 0 1.2rem 1.2rem;
  margin: 0;
  color: #4a5663;
  line-height: 1.65;
  font-size: .98rem;
  border-top: 1px solid #f0f2f5;
  padding-top: 1rem;
}
.dx-dict__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
  font-size: 1.1rem;
}

/* Mobile */
@media (max-width: 767px) {
  .dx-dict__top { flex-wrap: wrap; }
  .dx-dict__counter { width: 100%; text-align: center; }
  .dx-dict__alpha-letter { width: 32px; height: 32px; font-size: .9rem; }
  .dx-dict__letter { font-size: 2.2rem; }
  .dx-dict__item summary { flex-wrap: wrap; padding: .8rem 1rem; }
  .dx-dict__cat-tag { order: 3; flex-basis: 100%; margin-top: .3rem; }
}

/* Подсветка буквы при переходе с алфавит-навигации */
.dx-dict__letter.is-flash {
  animation: dx-letter-flash 0.8s ease-out;
}
@keyframes dx-letter-flash {
  0%   { color: #5b3df5; transform: scale(1); }
  20%  { color: #fff; background: #5b3df5; transform: scale(1.05); border-radius: 8px; padding: 0 .4rem; }
  100% { color: #5b3df5; transform: scale(1); }
}
