.consent-card {
  align-items: start;
  gap: 12px;
  padding: 15px 16px;
}

.consent-card > input {
  margin-top: 2px;
}

.consent-card > span {
  line-height: 1.65;
}

.consent-card a,
.ask-footer a[data-terms-dialog-trigger] {
  color: #7b2529;
  font-weight: 700;
  text-underline-offset: 3px;
}

.consent-card a:hover,
.ask-footer a[data-terms-dialog-trigger]:hover {
  color: #52171b;
}

body.terms-dialog-open {
  overflow: hidden;
}

.ask-terms-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  height: min(82dvh, 820px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid rgba(102, 67, 50, 0.2);
  border-radius: 28px;
  color: #302520;
  background: #fffdf8;
  box-shadow: 0 28px 80px rgba(44, 27, 19, 0.28);
  overflow: hidden;
}

.ask-terms-dialog::backdrop {
  background: rgba(38, 27, 22, 0.58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.ask-terms-dialog__panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.ask-terms-dialog__header {
  position: relative;
  padding: 26px 74px 20px 30px;
  border-bottom: 1px solid rgba(102, 67, 50, 0.13);
  background:
    radial-gradient(circle at 88% -20%, rgba(129, 40, 44, 0.12), transparent 42%),
    #fffaf1;
}

.ask-terms-dialog__eyebrow {
  margin: 0 0 7px;
  color: #8a5f4b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ask-terms-dialog__header h2 {
  margin: 0;
  color: #2f211c;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.25;
}

.ask-terms-dialog__header h2:focus {
  outline: none;
}

.ask-terms-dialog__summary {
  margin: 9px 0 0;
  color: #725e53;
  font-size: 0.94rem;
  line-height: 1.6;
}

.ask-terms-dialog__close {
  position: absolute;
  top: 20px;
  right: 22px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(102, 67, 50, 0.18);
  border-radius: 50%;
  place-items: center;
  color: #4d3930;
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.ask-terms-dialog__close:hover {
  color: #751f24;
  border-color: rgba(117, 31, 36, 0.35);
  background: #fff;
}

.ask-terms-dialog__close:focus-visible,
.ask-terms-dialog__confirm:focus-visible,
.consent-card a:focus-visible,
.ask-footer a[data-terms-dialog-trigger]:focus-visible {
  outline: 3px solid rgba(123, 37, 41, 0.28);
  outline-offset: 3px;
}

.ask-terms-dialog__body {
  min-height: 0;
  padding: 10px 30px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ask-terms-dialog__section {
  padding: 20px 0 2px;
  border-bottom: 1px solid rgba(102, 67, 50, 0.11);
}

.ask-terms-dialog__section:last-child {
  border-bottom: 0;
}

.ask-terms-dialog__section h3 {
  margin: 0 0 9px;
  color: #352620;
  font-size: 1.06rem;
  line-height: 1.45;
}

.ask-terms-dialog__section p {
  margin: 0 0 13px;
  color: #604e45;
  font-size: 0.95rem;
  line-height: 1.82;
}

.ask-terms-dialog__version {
  color: #8b776c;
  font-size: 0.82rem;
}

.ask-terms-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 30px max(17px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(102, 67, 50, 0.13);
  background: #fffaf1;
}

.ask-terms-dialog__footer p {
  margin: 0;
  color: #806c60;
  font-size: 0.82rem;
  line-height: 1.5;
}

.ask-terms-dialog__confirm {
  flex: 0 0 auto;
  min-width: 148px;
  padding: 13px 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #7b2529;
  box-shadow: 0 8px 22px rgba(123, 37, 41, 0.2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ask-terms-dialog__confirm:hover {
  background: #671d21;
}

@media (max-width: 640px) {
  .consent-card {
    gap: 11px;
    padding: 14px;
  }

  .ask-terms-dialog {
    width: calc(100vw - 24px);
    height: min(88dvh, 780px);
    max-height: calc(100dvh - 24px);
    margin: auto auto max(12px, env(safe-area-inset-bottom));
    border-radius: 24px 24px 18px 18px;
  }

  .ask-terms-dialog__header {
    padding: 22px 66px 17px 20px;
  }

  .ask-terms-dialog__close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  .ask-terms-dialog__body {
    padding: 5px 20px 22px;
  }

  .ask-terms-dialog__section {
    padding-top: 17px;
  }

  .ask-terms-dialog__section p {
    font-size: 0.92rem;
    line-height: 1.75;
  }

  .ask-terms-dialog__footer {
    display: block;
    padding: 13px 16px max(13px, env(safe-area-inset-bottom));
  }

  .ask-terms-dialog__footer p {
    display: none;
  }

  .ask-terms-dialog__confirm {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-terms-dialog,
  .ask-terms-dialog::backdrop {
    scroll-behavior: auto;
  }
}
