.cookie-consent {
  position: fixed;
  z-index: 10000;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  max-width: 920px;
  max-height: calc(100vh - 2rem);
  margin: 0 auto;
  padding: 1rem;
  overflow: auto;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border, #d7dde8);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 12px 40px rgb(15 23 42 / 24%);
  color: var(--text, #172033);
}

.cookie-consent h2,
.cookie-consent p { margin: 0; }
.cookie-consent h2 { margin-bottom: .35rem; font-size: 1rem; }
.cookie-consent p { line-height: 1.45; }
.cookie-consent__copy { min-width: 0; }
/* Кнопки набираются сеткой, а не flex с переносом: у flex каждая кнопка
   берёт ширину своего текста, и «Отклонить необязательные» шире соседей
   (#70819346). */
.cookie-consent__actions {
  display: grid;
  grid-template-columns: minmax(0, max-content);
  gap: .5rem;
  flex: 0 0 auto;
  justify-content: end;
}
/* Баннер — сетка 2×2 (ретест #70819346): «Отклонить необязательные» занимает
   обе колонки, «Настроить» и «Принять все» стоят под ней в одной строке.
   Равенство «верхняя = две нижние + промежуток» получается из одинаковых
   колонок и общего gap, а не из подобранных px, — поэтому держится на любой
   ширине и при любой длине подписей. */
.cookie-consent__actions--banner {
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cookie-consent__actions--banner > .cookie-consent__button:first-child {
  grid-column: 1 / -1;
}
.cookie-consent__settings .cookie-consent__actions {
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cookie-consent__button {
  width: 100%;
  min-height: 40px;
  padding: .55rem .85rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 9px;
  background: var(--surface, #fff);
  color: inherit;
  cursor: pointer;
}
.cookie-consent__button--primary { border-color: #2457d6; background: #2457d6; color: #fff; }
.cookie-consent__settings { width: 100%; }
.cookie-consent__settings > p { margin-bottom: .75rem; }
.cookie-consent__category { display: flex; gap: .65rem; padding: .55rem 0; cursor: pointer; }
.cookie-consent__category input { margin-top: .2rem; }
.cookie-consent__category span { display: grid; gap: .15rem; }
.cookie-consent__category small { opacity: .78; }
.legal-footer__cookie-settings { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

@media (max-width: 720px) {
  .cookie-consent { align-items: stretch; flex-direction: column; }
  .cookie-consent__actions,
  .cookie-consent__settings .cookie-consent__actions {
    width: auto;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }
  /* Узкий экран растягивает сетку баннера на всю ширину, но не разворачивает
     её в три строки: «Настроить» и «Принять все» остаются одной строкой. */
  .cookie-consent__actions--banner {
    width: auto;
    margin-left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
