:root {
  --primary-color: rgba(37, 99, 235, 0.75);
  --primary-color-solid: #2563eb;
  --bg-color: #eef1f5;
}

/* ===== Заголовок страницы ===== */
h1 {
  display: flex;
  justify-content: center;
  font-weight: 800;
  font-size: 1.8rem;
  text-align: center;
  background: linear-gradient(145deg, #4d8bf0, #133670);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Tabs ===== */
.tabs-wrapper {
  position: relative;
  overflow: hidden;
}
.tabs-wrapper::before,
.tabs-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30px;
  pointer-events: none;
  z-index: 1;
}
.tabs-wrapper::before {
  left: 0;
  background: linear-gradient(to right, #eef1f5 60%, transparent);
}
.tabs-wrapper::after {
  right: 0;
  background: linear-gradient(to left, #eef1f5 60%, transparent);
}

.tabs {
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  margin: 0 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(13, 16, 40, 0.1);
  background: linear-gradient(180deg, #fff, #f7f7fb);
  color: #133670;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(6, 12, 38, 0.06);
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s,
    border-color 0.18s;
  cursor: pointer;
}
.tabs button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(6, 12, 38, 0.1);
}
.tabs button:active {
  transform: translateY(0);
}
.tabs button:focus-visible {
  outline: 2px solid rgba(77, 139, 240, 0.85);
  outline-offset: 2px;
}
.tabs button.active {
  background: linear-gradient(145deg, #4d8bf0, #133670);
  color: #fff;
  border-color: transparent;
  box-shadow: none; /* убираем «полосу» под табами */
}

@media (max-width: 768px) {
  .tabs button {
    white-space: normal;
    line-height: 1.25;
    min-height: 44px;
    text-align: center;
    max-width: 160px;
    padding: 10px 12px;
  }
}

/* ===== Сетка карточек ===== */
.cards,
.tab-content,
#external-results,
.news-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 25px;
  padding: 15px;
  margin-bottom: 12px;
}
.cards:not(.active),
#external-results:not(.active) {
  display: none;
}

/* ===== Карточки (единый стиль) ===== */
.cards .card,
.news-item {
  position: relative;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f7f7fb);
  border: 1px solid rgba(13, 16, 40, 0.08);
  box-shadow: 0 4px 12px rgba(6, 12, 38, 0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cards .card:hover,
.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(6, 12, 38, 0.1);
}
.card-title,
.cards .card .title,
.news-item h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f1220;
  line-height: 1.28;
}
.cards .card .description,
.news-item p {
  margin: 0;
  font-size: 0.9rem;
  color: #5a647b;
  line-height: 1.42;
  padding: 0;
}

/* «Водяная» иконка */
.cards .card .icon-bg,
.card-icon-bg {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 64px;
  color: rgba(19, 54, 112, 0.06);
  pointer-events: none;
  transition: transform 0.28s, opacity 0.28s;
}
.cards .card:hover .icon-bg,
.news-item:hover .card-icon-bg {
  transform: scale(1.06) rotate(2deg);
  opacity: 0.12;
}

/* ===== Поиск (одна «пилюля», 640px на десктопе) ===== */
.search-wrapper {
  margin: 1rem auto 1.8rem;
  max-width: 640px;
  width: 100%;
}
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1px;
  border-radius: 15px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.search-input-wrapper:focus-within {
  border-color: rgba(77, 139, 240, 0.45);
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.2);
}
.search-input-wrapper .search-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  outline: none;
  padding: 5px 54px 5px 48px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f1220;
  background-repeat: no-repeat;
  background-size: 22px 22px;
  background-position: left 16px center;
}
.search-input-wrapper .search-input::placeholder {
  color: rgba(31, 41, 55, 0.55);
  font-weight: 500;
}
/* пастельная подложка под лупой */
.search-input-wrapper::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(180deg, #eaf3ff, #eef2ff);
  box-shadow: inset 0 0 0 1px rgba(13, 16, 40, 0.06);
}
/* гасим старую «внутреннюю» рамку, чтобы не было двойной */
.search-wrapper input.search-input {
  border: none;
  background: transparent;
  box-shadow: none;
}

/* Кнопка очистки (поддерживаем обе версии id для надёжности) */
#clear-search,
#clearSearch {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
#clear-search:hover,
#clearSearch:hover {
  background: rgba(15, 23, 42, 0.06);
}
#clear-search:focus,
#clearSearch:focus {
  outline: none;
}

/* ===== Заголовки разделов ===== */
.section-title,
.title,
.block-title,
.heading {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  color: #0f172a;
  margin: 2rem 0 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  position: relative;
}
.section-title::after,
.title::after,
.block-title::after,
.heading::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 3px;
  width: 42px;
  background: var(--primary-color-solid);
  border-radius: 2px;
}

/* ===== Показать ещё ===== */
#load-more {
  background: none;
  border: none;
  border-radius: 16px;
  color: #133670;
  font-size: 1rem;
  font-weight: 600;
  padding: 17px 54px 17px 38px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.55, 1.4, 0.3, 1), color 0.16s;
}
#load-more:hover {
  color: #234485;
  transform: scale(1.035);
}
#load-more .showmore-arrow {
  width: 22px;
  height: 22px;
  margin-left: 8px;
  transition: transform 0.28s cubic-bezier(0.37, 2.2, 0.2, 0.8), stroke 0.15s;
}
#load-more:hover .showmore-arrow {
  transform: translateY(3px) scale(1.18);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .cards,
  .tab-content.active,
  #external-results {
    grid-template-columns: 1fr;
  }
  .cards .card {
    padding: 14px;
    margin: 5px 0;
  }
  .cards .card .icon-bg,
  .card-icon-bg {
    top: 6px;
    right: 8px;
    font-size: 60px;
  }
  .news-item h4 {
    font-size: 0.96rem;
  }
  .news-item p {
    font-size: 0.86rem;
  }
  .search-wrapper {
    margin: 0.7rem auto 1.2rem;
    max-width: 100%;
  }
  .search-input-wrapper {
    padding: 6px;
    border-radius: 15px;
    max-width: 100%;
  }
  .search-input-wrapper .search-input {
    padding: 1px 48px 1px 44px;
    font-size: 1rem;
  }
}
/* --- Meta-ряд на карточке --- */
.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.card .chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #f7f7fb);
  border: 1px solid rgba(13, 16, 40, 0.1);
  box-shadow: 0 2px 6px rgba(6, 12, 38, 0.06);
  font-size: 0.82rem;
  font-weight: 600;
  color: #133670;
}

.card .meta .muted {
  font-size: 0.88rem;
  color: #6b7280;
}

.card .meta .dot {
  color: #cbd5e1;
}

/* Низ карточки с кнопкой */
.card__footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

/* Кнопка “Читать” — визуально как в макете (ghost/pill) */
.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f7f7fb);
  border: 1px solid rgba(13, 16, 40, 0.1);
  box-shadow: 0 4px 12px rgba(6, 12, 38, 0.06);
  color: #133670;
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
}
.read-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(6, 12, 38, 0.1);
}
.read-btn:active {
  transform: translateY(0);
}
/* Мета-ряд (⏱ и 📅) под описанием */
.k-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.5rem;
  font-size: 0.88rem;
  color: #6b7280;
}
.k-meta .dot {
  color: #cbd5e1;
}

/* «Читать →» внизу карточки */
.news-item .k-read {
  margin-top: 0.25rem;
  font-weight: 700;
  color: #133670;
  display: inline-block;
}
.news-item .k-read:hover {
  text-decoration: underline;
}
.searchbar {
  display: flex;
  gap: 10px;
  background: var(--bg-elev, #fff);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke, #ddd);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.searchbar input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  padding: 12px 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn--primary {
  background: linear-gradient(180deg, #4f46e5, #4338ca);
  color: #fff;
}

.btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: #666;
  border-color: #ddd;
}
