.auth-terms-dialog {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, var(--demo-width));
  max-width: none;
  height: 79vh;
  height: 79dvh;
  max-height: none;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: #191612;
  color: #f8e8d1;
}

.auth-terms-dialog::backdrop {
  background: rgb(12 11 10 / 65%);
  backdrop-filter: blur(10px);
}

.legal-sheet {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 16px 0;
}

.legal-handle {
  flex: none;
  width: 40px;
  height: 4px;
  margin: 0 auto 4px;
  border-radius: 999px;
  background: #2e2a28;
}

.legal-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.legal-header h2 {
  margin: 0;
  color: #f5f2ee;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
}

.legal-close {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-inline-end: -5px;
  border-radius: 8px;
  color: #fff;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.legal-close svg { width: 20px; height: 20px; }
.legal-close:hover { background: #ffffff0d; }

.legal-tabs {
  flex: none;
  margin-bottom: 12px;
}

.legal-tabs button[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(var(--color-card-from), var(--color-card-to)) padding-box,
    linear-gradient(110deg, #ccb37a, #322b25) border-box;
  color: #e2c177;
}

.legal-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  color: #dfc89d;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: #605240 transparent;
}

.legal-content article p { margin: 0 0 8px; line-height: inherit; }

.legal-content h3 {
  margin: 18px 0 8px;
  color: #cbb578;
  font-size: 15px;
  font-weight: 750;
}

.legal-content h4 {
  margin: 10px 0 8px;
  color: #f5eee1;
  font-size: 13px;
  font-weight: 550;
}

.legal-content ul {
  margin: 0 0 10px;
  padding-inline-start: 24px;
  list-style: disc;
}

.legal-content li + li { margin-top: 3px; }
.legal-content li::marker { color: #8c7a50; }

.legal-sheet :is(button, .legal-content):focus-visible {
  outline: 2px solid #dfc89d;
  outline-offset: -3px;
}

@media (max-height: 420px) {
  .auth-terms-dialog { height: 91dvh; }
  .legal-sheet { padding-top: 10px; }
}
