.se-legal-modal[hidden],
.se-legal-reopen[hidden] {
  display: none !important;
}

html.se-legal-scroll-locked,
body.se-legal-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

.se-legal-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.se-legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 28, 0.55);
}

.se-legal-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(calc(100vw - 40px), 920px);
  max-height: calc(100dvh - 40px);
  border-radius: 20px;
  overflow: hidden;
  color: #243743;
  background: #f0f5fa;
  border: 1px solid rgba(200, 215, 228, 0.8);
  box-shadow: 0 20px 60px rgba(12, 24, 34, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.se-legal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 18px 20px 14px;
  background: #f8fbfe;
  border-bottom: 1px solid #d6e3ec;
}

.se-legal-modal__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.se-legal-modal__brand-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #3552e3;
  box-shadow: 10px 0 0 #3552e3, 20px 0 0 #3552e3;
}

.se-legal-modal__brand-text {
  display: inline-block;
  padding-left: 24px;
  color: #334a57;
  font: 700 16px/1.1 "Helvetica Neue", Arial, sans-serif;
}

.se-legal-modal .se-legal-modal__close {
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid rgba(160, 180, 200, 0.5) !important;
  border-radius: 50% !important;
  background: rgb(218, 228, 238) !important;
  background-color: rgb(218, 228, 238) !important;
  background-image: none !important;
  color: #2e4255 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
  transition: background 0.15s ease !important;
  text-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.se-legal-modal .se-legal-modal__close:hover {
  background: rgb(196, 212, 226) !important;
  background-color: rgb(196, 212, 226) !important;
}

.se-legal-modal .se-legal-modal__close:focus-visible {
  outline: 2px solid rgba(53, 82, 227, 0.4);
  outline-offset: 2px;
}

.se-legal-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll; /* 'scroll' gives inertial scroll on iOS without native layer */
  overscroll-behavior: contain;
  padding: 20px;
  background: #f0f5fa !important;
}

.se-legal-modal__title {
  margin: 0;
  color: #263742;
  font: 700 24px/1.08 "Helvetica Neue", Arial, sans-serif;
}

.se-legal-modal__intro {
  margin: 14px 0 0;
  color: #3d515d;
  font: 400 16px/1.55 "Helvetica Neue", Arial, sans-serif;
}

.se-legal-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
}

.se-legal-modal__links a {
  color: #3593d3;
  font: 500 15px/1.35 "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
}

.se-legal-modal__links a:hover {
  text-decoration: underline;
}

.se-legal-modal__categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid rgba(214, 223, 229, 0.9);
  border-bottom: 1px solid rgba(214, 223, 229, 0.9);
  background: #e9f1f7;
}

.se-legal-modal__category {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 110px;
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid rgba(214, 223, 229, 0.9);
}

.se-legal-modal__category:last-child {
  border-right: 0;
}

.se-legal-modal__category-title {
  color: #31434d;
  font: 700 15px/1.2 "Helvetica Neue", Arial, sans-serif;
}

.se-legal-modal__switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.se-legal-modal__switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.se-legal-modal__slider {
  position: relative;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: #282d36;
  transition: background-color 0.2s ease;
}

.se-legal-modal__slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  transition: transform 0.2s ease;
}

.se-legal-modal__switch input:checked + .se-legal-modal__slider {
  background: #3552e3;
}

.se-legal-modal__switch input:checked + .se-legal-modal__slider::after {
  transform: translateX(22px);
}

.se-legal-modal__category--locked .se-legal-modal__slider {
  background: #d1d8df;
}

.se-legal-modal__help {
  margin: 14px 0 0;
  color: #4a5e69;
  font: 400 14px/1.5 "Helvetica Neue", Arial, sans-serif;
}

.se-legal-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.se-legal-cookie__button,
.se-legal-cookie__button.glassy-btn1 {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  box-shadow: 0 10px 22px rgba(21, 36, 46, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.34) !important;
  color: #314652 !important;
  font: 700 15px/1 "Helvetica Neue", Arial, sans-serif !important;
  text-align: center;
}

.se-legal-cookie__button--block {
  flex: 1 1 0;
}

.se-legal-cookie__button[data-se-legal-action="save"] {
  background: rgba(255, 255, 255, 0.38) !important;
  color: #2c52d6 !important;
}

.se-legal-cookie__button[data-se-legal-action="reject"] {
  background: rgba(255, 255, 255, 0.34) !important;
  color: #51626e !important;
}

.se-legal-cookie__button[data-se-legal-action="accept"] {
  background: rgba(255, 255, 255, 0.4) !important;
  color: #1e8d5a !important;
}

.se-legal-cookie__button:hover {
  transform: translateY(-1px);
}

.se-legal-reopen,
button.se-legal-reopen,
a.se-legal-reopen {
  position: fixed !important;
  left: 14px !important;
  right: auto !important;
  top: auto !important;
  bottom: 14px !important;
  z-index: 99998 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 10px 22px rgba(20, 31, 39, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.36) !important;
  color: #1f3153 !important;
  font-size: 0 !important;
  line-height: 1 !important;
  overflow: hidden !important;
}

.se-legal-reopen::before,
.se-legal-reopen::after {
  display: none !important;
}

.se-legal-reopen__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  border-radius: 50% !important;
  background: transparent !important;
  font-size: 18px !important;
  line-height: 1 !important;
  color: #3552e3 !important;
}

@media (max-width: 900px) {
  .se-legal-modal__dialog {
    width: min(calc(100vw - 24px), 920px);
  }

  .se-legal-modal__categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .se-legal-modal__category {
    border-bottom: 1px solid rgba(214, 223, 229, 0.9);
  }

  .se-legal-modal__category:nth-child(2n) {
    border-right: 0;
  }

  .se-legal-modal__category:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

/* ── Mobile: full-screen popup (12 px margin all sides) ── */
@media (max-width: 680px) {
  .se-legal-modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 12px;
  }

  .se-legal-modal__dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 20px;
    margin: 0;
    background: #f0f5fa;
  }

  .se-legal-modal__header {
    padding: 14px 16px 12px;
    background: #f4f8fc;
    border-bottom: 1px solid #cfdce6;
  }

  .se-legal-modal__body {
    padding: 14px 16px 14px;
  }

  .se-legal-modal__title {
    font-size: 20px;
  }

  .se-legal-modal__intro {
    font-size: 15px;
    margin-top: 10px;
  }

  /* Categories: horizontal rows (label left, toggle right) */
  .se-legal-modal__categories {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
    background: #e8f0f7;
  }

  .se-legal-modal__category,
  .se-legal-modal__category:nth-child(2n) {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    padding: 12px 16px;
    text-align: left;
    border-right: 0;
    border-bottom: 1px solid rgba(214, 223, 229, 0.9);
    gap: 12px;
  }

  .se-legal-modal__category:last-child {
    border-bottom: 0;
  }

  .se-legal-modal__help {
    font-size: 13px;
    margin-top: 12px;
  }

  .se-legal-modal__actions {
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
  }

  .se-legal-cookie__button,
  .se-legal-cookie__button.glassy-btn1 {
    width: 100%;
    min-height: 52px;
    font-size: 16px !important;
  }
}
