.measurement-consent[hidden],
.measurement-consent [hidden] { display: none; }

.measurement-consent {
  position: fixed;
  z-index: 2147483000;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(392px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 18px 20px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #051c2c;
  text-align: left;
  background: radial-gradient(130% 90% at 0% 0%, #fff2f5 0%, rgba(255, 242, 245, 0) 58%), #fff;
  border: 1px solid rgba(5, 28, 44, .08);
  border-radius: 24px;
  box-shadow: 0 24px 54px -16px rgba(5, 28, 44, .3), 0 2px 8px rgba(5, 28, 44, .06);
  transition: opacity .35s ease, transform .55s cubic-bezier(.16, 1, .3, 1);
}
.measurement-consent[data-view="notice"] { transition-delay: .45s; }
@starting-style {
  .measurement-consent { opacity: 0; transform: translateY(18px) scale(.98); }
}
.measurement-consent[hidden] {
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
  transition: opacity .2s ease, transform .2s ease, display .2s allow-discrete;
}
body.has-preloader:not(.loaded) .measurement-consent:not([hidden]) {
  visibility: hidden;
  opacity: 0;
  transform: translateY(18px) scale(.98);
  animation: measurement-fallback 0s linear 6s forwards;
}
@keyframes measurement-fallback {
  to { visibility: visible; opacity: 1; transform: none; }
}

.measurement-head { display: flex; align-items: center; gap: 10px; }
.measurement-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #fa3e6b 0%, #ff5e8b 55%, #ff8595 100%);
  box-shadow: 0 6px 14px rgba(250, 62, 107, .26);
}
.measurement-head h2 {
  margin: 0;
  color: #051c2c;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.measurement-head h2:focus { outline: none; }
.measurement-text {
  margin: 10px 0 0;
  color: #4a6274;
  font-size: 13.5px;
  line-height: 1.55;
  text-wrap: pretty;
}
.measurement-text a {
  color: #051c2c;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(5, 28, 44, .28);
  text-underline-offset: 3px;
}

.measurement-options { min-width: 0; margin: 14px 0 0; padding: 0; border: 0; display: grid; gap: 8px; }
.measurement-options:not([hidden]) { animation: measurement-options-in .35s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes measurement-options-in {
  from { opacity: 0; transform: translateY(6px); }
}
.measurement-options legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.measurement-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(5, 28, 44, .08);
  border-radius: 16px;
  background: #f8f9fe;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.measurement-option:has(input:disabled) { cursor: default; }
.measurement-option input:disabled + .measurement-switch { opacity: .45; }
.measurement-option:has(input:checked) { background: #fff5f8; border-color: rgba(249, 94, 133, .34); }
.measurement-option:has(input:focus-visible) { outline: 2px solid #d43a60; outline-offset: 2px; }
.measurement-option-copy { flex: 1 1 auto; min-width: 0; color: #4a6274; font-size: 12.5px; line-height: 1.45; }
.measurement-option-copy strong { display: block; margin-bottom: 2px; color: #051c2c; font-size: 14px; font-weight: 700; line-height: 1.35; }
.measurement-option input {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 42px;
  height: 26px;
  margin: -13px 0 0;
  opacity: 0;
  pointer-events: none;
}
.measurement-switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 26px;
  border: 2px solid #7f91a2;
  border-radius: 999px;
  background: #fff;
  transition: background-color .2s ease, border-color .2s ease;
}
.measurement-switch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: #7f91a2;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), width .2s ease, height .2s ease, margin .2s ease, background-color .2s ease;
}
.measurement-option input:checked + .measurement-switch { border-color: #f95e85; background: #f95e85; }
.measurement-option input:checked + .measurement-switch::after {
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(5, 28, 44, .2);
  transform: translateX(14px);
}

.measurement-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.measurement-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: #355168;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color .2s ease;
}
.measurement-link svg { flex: none; }
.measurement-link[data-action="back"]::before {
  content: '';
  width: 7px;
  height: 7px;
  margin: 0 1px 0 4px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}
.measurement-decisions { display: flex; flex: 1 1 auto; gap: 8px; }
.measurement-decisions button {
  flex: 1 1 0;
  min-height: 42px;
  padding: 0 14px;
  border: 1.5px solid rgba(5, 28, 44, .14);
  border-radius: 999px;
  background: #fff;
  color: #051c2c;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.measurement-decisions button:active { transform: scale(.97); }
.measurement-consent :focus-visible { outline: 2px solid #d43a60; outline-offset: 2px; }

.measurement-preferences {
  display: inline-flex;
  align-items: center;
  margin: -6px 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(98, 119, 138, .35);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .2s ease;
}
.measurement-preferences:focus-visible { outline: 2px solid #d43a60; outline-offset: 2px; border-radius: 4px; }

body:has(> .measurement-consent:not([hidden])) .back-to-top.is-visible {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (hover: hover) {
  .measurement-text a:hover { color: #d43a60; text-decoration-color: currentColor; }
  .measurement-link:hover { color: #d43a60; }
  .measurement-option:hover { border-color: rgba(249, 94, 133, .34); }
  .measurement-decisions button:hover { border-color: rgba(249, 94, 133, .5); background: #fff5f8; color: #c8355b; }
  .measurement-preferences:hover { color: #f95e85; text-decoration-color: currentColor; }
}

@media (max-width: 520px) {
  .measurement-consent {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px 16px 12px;
    border-radius: 22px;
  }
  .measurement-icon { width: 30px; height: 30px; border-radius: 10px; }
  .measurement-icon svg { width: 18px; height: 18px; }
  .measurement-head h2 { font-size: 15.5px; }
  .measurement-text { margin-top: 8px; font-size: 13px; line-height: 1.5; }
  .measurement-actions { margin-top: 10px; gap: 6px 12px; }
  .measurement-option { padding: 11px 12px; gap: 12px; }
}

@media print {
  .measurement-consent,
  .measurement-preferences { display: none !important; }
}
