.case-card,
.kb-card,
.news-card,
.os-card,
.tpl-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--radius-lg, 20px);
  padding: 12px 12px 11px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-glass, 0 8px 24px rgba(31, 38, 135, 0.15));
  transition: transform var(--transition-fast, 0.16s ease-out),
    box-shadow var(--transition-fast, 0.16s ease-out), opacity 0.18s ease-out;
}

.case-card-badge,
.kb-card-badge,
.news-card-badge,
.os-card-badge,
.tpl-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(229, 231, 235, 0.95);
  font-size: var(--fs-link-sm, 12px);
  font-weight: 600;
  color: var(--text-soft, #4b5563);
  white-space: nowrap;
}

.case-card-badge-dot,
.kb-card-badge-dot,
.news-card-badge-dot,
.os-card-badge-dot,
.tpl-card-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent, #4c6fff);
}

.case-card-date,
.kb-card-meta-top,
.news-card-date,
.tpl-card-format {
  font-size: var(--fs-qtime, 12px);
  color: var(--text-muted, #9ca3af);
  white-space: nowrap;
}

.case-card-excerpt,
.kb-card-excerpt,
.news-card-excerpt,
.os-card-excerpt,
.tpl-card-excerpt {
  margin: 0;
  font-size: var(--fs-card-sub, 12px);
  color: var(--text-soft, #4b5563);
  line-height: 1.35;
}

.case-card-inner,
.kb-card-inner,
.news-card-inner,
.os-card-inner,
.tpl-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-card-meta,
.kb-card-bottom-meta,
.news-card-meta,
.os-card-meta-bottom,
.tpl-card-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-link-sm, 12px);
  color: var(--text-muted, #9ca3af);
}

.case-card-meta i,
.kb-card-bottom-meta i,
.news-card-meta i,
.os-card-meta-bottom i,
.tpl-card-meta i {
  font-size: var(--fs-link-sm, 12px);
}

.case-card-meta span,
.kb-card-bottom-meta span,
.news-card-meta span,
.os-card-meta-bottom span,
.tpl-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.case-card-title,
.kb-card-title,
.news-card-title,
.os-card-title,
.tpl-card-title {
  margin: 0;
  font-size: var(--fs-card-title, 14px);
  font-weight: 700;
  color: var(--text-main, #0f172a);
  line-height: 1.25;
}

.case-card-title a,
.kb-card-title a,
.news-card-title a,
.os-card-title a,
.tpl-card-title a {
  color: inherit;
  text-decoration: none;
}

.case-card-title a:hover,
.kb-card-title a:hover,
.news-card-title a:hover,
.os-card-title a:hover,
.tpl-card-title a:hover {
  text-decoration: none;
}

.case-card-topline,
.kb-card-topline,
.news-card-topline,
.os-card-topline,
.tpl-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.case-card::before,
.kb-card::before,
.os-card::before,
.tpl-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 6% 4%,
    rgba(76, 111, 255, 0.08),
    transparent 55%
  );
  opacity: 0.9;
}

.case-card:active,
.cb-card:active,
.kb-card:active,
.news-card:active,
.os-card:active,
.tpl-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-glass, 0 8px 24px rgba(31, 38, 135, 0.15));
}

.cases-empty-state,
.kb-empty-state,
.news-empty-state,
.os-empty-state,
.tpl-empty-state {
  margin-top: 10px;
  font-size: var(--fs-caption, 14px);
  color: var(--text-soft, #4b5563);
}

/* ===== Фильтры (чипы) ===== */

.cases-filter-chip,
.kb-filter-chip,
.news-filter-chip,
.os-filter-chip,
.tpl-filter-chip {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: var(--fs-link-sm, 12px);
  font-weight: 500;
  border: 1px solid rgba(209, 213, 219, 1);
  background: #f9fafb;
  color: var(--text-soft, #4b5563);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast, 0.16s ease-out),
    color var(--transition-fast, 0.16s ease-out),
    border-color var(--transition-fast, 0.16s ease-out);
}

.cases-filter-chip--active,
.kb-filter-chip--active,
.news-filter-chip--active,
.os-filter-chip--active,
.tpl-filter-chip--active {
  background: rgba(76, 111, 255, 0.08);
  border-color: rgba(76, 111, 255, 0.65);
  color: var(--accent-strong, #3340ff);
}

.cases-filter-chips,
.kb-filter-chips,
.news-filter-chips,
.os-filter-chips,
.tpl-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ===== Кнопка "Фильтры" ===== */

.cases-filter-toggle,
.kb-filter-toggle,
.news-filter-toggle,
.os-filter-toggle,
.tpl-filter-toggle {
  white-space: nowrap;
  padding-inline: 10px;
  gap: 6px;
}

.cases-filter-toggle i,
.kb-filter-toggle i,
.news-filter-toggle i,
.os-filter-toggle i,
.tpl-filter-toggle i {
  font-size: var(--fs-caption, 14px);
}

/* ===== Состояние вкладок (горизонтальный скролл скрыт) ===== */

.cases-tabs::-webkit-scrollbar,
.kb-tabs::-webkit-scrollbar,
.news-tabs::-webkit-scrollbar,
.os-tabs::-webkit-scrollbar,
.tpl-tabs::-webkit-scrollbar {
  display: none;
}

/* ===== Подвал панели фильтров ===== */

.cases-filters-footer,
.kb-filters-footer,
.news-filters-footer,
.os-filters-footer,
.tpl-filters-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-link-sm, 12px);
  color: var(--text-muted, #9ca3af);
}

/* ===== Панель фильтров (открыта/закрыта) ===== */

.cases-filters-panel,
.kb-filters-panel,
.news-filters-panel,
.os-filters-panel,
.tpl-filters-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(209, 213, 219, 0.9);
  display: none;
}

.cases-filters-panel--open,
.kb-filters-panel--open,
.news-filters-panel--open,
.os-filters-panel--open,
.tpl-filters-panel--open {
  display: block;
}

/* Сброс фильтров */

.cases-filters-reset,
.kb-filters-reset,
.news-filters-reset,
.os-filters-reset,
.tpl-filters-reset {
  border: none;
  background: transparent;
  padding: 4px 6px;
  font-size: var(--fs-link-sm, 12px);
  font-weight: 600;
  color: var(--accent, #4c6fff);
  cursor: pointer;
  border-radius: 999px;
}

/* ===== Сетка карточек ===== */

.cases-grid,
.kb-grid,
.news-grid,
.os-grid,
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cases-list-section,
.kb-list-section,
.news-list-section,
.os-list-section,
.tpl-list-section {
  margin-top: 8px;
}

/* ===== Поисковая строка ===== */

/* Общий стеклянный стиль для всех поисковых полей внутренних разделов */
.cases-search-input,
.kb-search-input,
.news-search-input,
.os-search-input,
.tpl-search-input {
  width: 100%;
  border-radius: var(--radius-lg, 20px); /* как у карточек */
  padding: 9px 12px 9px 32px;
  font-size: var(--fs-ui, 15px);
  outline: none;

  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-glass, 0 8px 24px rgba(31, 38, 135, 0.15));

  color: var(--text-main, #0f172a);
  transition: border-color 0.14s ease-out, box-shadow 0.14s ease-out,
    background 0.14s ease-out;
}

/* Фокус — тоже в одном месте для всех */
.cases-search-input:focus-visible,
.kb-search-input:focus-visible,
.news-search-input:focus-visible,
.os-search-input:focus-visible,
.tpl-search-input:focus-visible {
  outline: none;
  border-color: rgba(76, 111, 255, 0.6);
  box-shadow: var(--shadow-glass-strong, 0 8px 24px rgba(31, 38, 135, 0.25));
  background: rgba(255, 255, 255, 1);
}

.cases-search-input-wrapper,
.kb-search-input-wrapper,
.news-search-input-wrapper,
.os-search-input-wrapper,
.tpl-search-input-wrapper {
  position: relative;
  flex: 1 1 auto;
}

.cases-search-input-wrapper i,
.kb-search-input-wrapper i,
.news-search-input-wrapper i,
.os-search-input-wrapper i,
.tpl-search-input-wrapper i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-caption, 14px);
  color: var(--text-muted, #9ca3af);
  pointer-events: none;
}

.cases-search-input::placeholder,
.kb-search-input::placeholder,
.news-search-input::placeholder,
.os-search-input::placeholder,
.tpl-search-input::placeholder {
  color: var(--text-muted, #9ca3af);
}

.cases-search-row,
.kb-search-row,
.news-search-row,
.os-search-row,
.tpl-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.cases-search-section,
.kb-search-section,
.news-search-section,
.os-search-section,
.tpl-search-section {
  margin-top: 0;
  margin-bottom: 18px;
}

.cases-search-shell,
.kb-search-shell,
.news-search-shell,
.os-search-shell,
.tpl-search-shell {
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

/* ===== Вкладки (темы) ===== */

.cases-tab,
.kb-tab,
.news-tab,
.os-tab,
.tpl-tab {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(209, 213, 219, 1);
  font-size: var(--fs-link-sm, 12px);
  font-weight: 600;
  background: #f9fafb;
  color: var(--text-soft, #4b5563);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast, 0.16s ease-out),
    color var(--transition-fast, 0.16s ease-out),
    border-color var(--transition-fast, 0.16s ease-out),
    transform var(--transition-fast, 0.16s ease-out);
}

.cases-tab--active,
.kb-tab--active,
.news-tab--active,
.os-tab--active,
.tpl-tab--active {
  background: var(--accent-soft, rgba(76, 111, 255, 0.12));
  border-color: rgba(76, 111, 255, 0.65);
  color: var(--accent-strong, #3340ff);
}

.cases-tab:hover,
.kb-tab:hover,
.news-tab:hover,
.os-tab:hover,
.tpl-tab:hover {
  transform: translateY(-1px);
}

/* По умолчанию: на ПК – перенос, без горизонтального скролла */

.cases-tabs,
.kb-tabs,
.news-tabs,
.os-tabs,
.tpl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 0;
  margin-top: 4px;
  overflow-x: visible;
}

/* Разделители меты в некоторых карточках */

.kb-card-meta-top span + span::before,
.os-card-meta-top span + span::before,
.tpl-card-format span + span::before {
  content: " · ";
}

/* Общий отступ снизу для внутренних страниц */

main.container.container--narrow {
  padding-bottom: 22px;
}

/* ===== Мобильные устройства: одна строка + горизонтальный скролл ===== */

@media (max-width: 640px) {
  .cases-tabs,
  .kb-tabs,
  .news-tabs,
  .os-tabs,
  .tpl-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .cases-tabs::-webkit-scrollbar,
  .kb-tabs::-webkit-scrollbar,
  .news-tabs::-webkit-scrollbar,
  .os-tabs::-webkit-scrollbar,
  .tpl-tabs::-webkit-scrollbar {
    display: none;
  }

  .cases-filter-chips,
  .kb-filter-chips,
  .news-filter-chips,
  .os-filter-chips,
  .tpl-filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cases-filter-chips::-webkit-scrollbar,
  .kb-filter-chips::-webkit-scrollbar,
  .news-filter-chips::-webkit-scrollbar,
  .os-filter-chips::-webkit-scrollbar,
  .tpl-filter-chips::-webkit-scrollbar {
    display: none;
  }
}
/* useful.css */

/* ... после общего блока .cases-grid, .kb-grid, .news-grid, .os-grid, .tpl-grid */

@media (max-width: 900px) {
  .cases-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
