.terms-pending {
  overflow: hidden;
}

.terms-pending #site-content {
  visibility: hidden;
  pointer-events: none;
}

.terms-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  display: grid;
  place-items: center;
  padding: 28px;
}

.terms-declined {
  max-width: 520px;
  text-align: center;
}

.terms-declined h2 {
  font-size: clamp(40px, 6vw, 62px);
  margin: 24px 0;
}

.terms-declined p:not(.chapter-label) {
  color: var(--muted);
  margin-bottom: 28px;
}

.terms-dialog {
  width: min(730px, calc(100% - 32px));
  max-width: 730px;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--ink);
  overflow: auto;
}

.terms-dialog::backdrop {
  background: rgba(29, 34, 27, .76);
}

.terms-header {
  padding: 30px 34px 22px;
  border-bottom: 1px solid var(--line);
}

.terms-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
}

.terms-brand-row img {
  width: 130px;
  height: 66px;
  object-fit: contain;
}

.terms-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 27px;
}

.terms-header h2 {
  margin: 12px 0;
  font-size: clamp(40px, 6vw, 58px);
  letter-spacing: -1px;
}

.terms-header > p:not(.chapter-label) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.terms-text {
  max-height: 30dvh;
  min-height: 135px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px 34px;
  font-size: 12px;
  line-height: 1.9;
  scrollbar-gutter: stable;
}

.terms-text h3 {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  margin: 22px 0 7px;
}

.terms-text h3:first-of-type {
  margin-top: 12px;
}

.terms-text p {
  margin-bottom: 10px;
}

.terms-text a,
.terms-storage-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terms-date {
  font-size: 10px;
  color: var(--muted);
}

.terms-actions {
  padding: 22px 34px 26px;
  border-top: 1px solid var(--line);
  background: #f4f1e8;
}

.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  line-height: 1.85;
  cursor: pointer;
}

.terms-checkbox input {
  margin: 4px 0 0;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  accent-color: var(--olive);
}

.terms-action-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.terms-action-row .button {
  min-height: 48px;
}

.terms-dialog .button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.terms-decline {
  background: none;
  border: 0;
  padding: 12px 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.terms-status,
.terms-storage-note {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 12px;
}

.terms-status:empty {
  display: none;
}

.footer-terms {
  border: 0;
  background: none;
  padding: 10px 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 560px) {
  .terms-header {
    padding: 18px 22px 18px;
  }

  .terms-brand-row {
    margin-bottom: 15px;
  }

  .terms-brand-row img {
    width: 108px;
    height: 52px;
  }

  .terms-text {
    padding: 18px 22px;
    max-height: 28dvh;
  }

  .terms-actions {
    padding: 18px 22px;
  }

  .terms-action-row {
    gap: 14px;
  }

  .terms-dialog {
    max-height: calc(100dvh - 20px);
    width: calc(100% - 20px);
  }
}
