html.legal-open { overflow: hidden; overscroll-behavior: none; }
html.legal-open body { position: fixed; top: var(--legal-page-top); width: 100%; overflow: hidden; }
.legal-sheet:focus, .legal-sheet h2:focus, .legal-reader:focus, .legal-reader header button:focus { outline: none; }
.legal-reader header button:focus-visible { text-decoration: underline; }
.legal-sheet, .legal-reader {
  box-sizing: border-box;
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: min(100%, 480px);
  max-width: 100%;
  max-height: 94dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 20px max(24px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 32px 32px 0 0;
  background: rgba(7, 10, 8, .96);
  backdrop-filter: blur(24px);
  color: #fff;
  font-family: Montserrat, sans-serif;
}
.legal-sheet::backdrop { background: rgba(0, 0, 0, .26); }
.legal-sheet h2 { margin: 0; text-align: center; font-size: 20px; line-height: 26px; font-weight: 600; }
.legal-intro { max-width: 285px; margin: 8px auto 24px; text-align: center; font-size: 14px; line-height: 17px; color: #b4b4b4; }
.legal-list { padding: 0 16px; background: rgba(255,255,255,.035); border-radius: 16px; }
.legal-row { display: flex; align-items: center; gap: 12px; padding: 16px 0; font-size: 14px; line-height: 17px; }
.legal-row + .legal-row { border-top: 1px solid rgba(255,255,255,.10); }
.legal-row input { appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid #555; border-radius: 9px; cursor: pointer; }
.legal-row input:checked { background: #f0cc0a; border-color: #f0cc0a; }
.legal-row input:checked::after { content: ''; display: block; width: 6px; height: 12px; margin: 1px 0 0 6px; border: solid #101010; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.legal-row .legal-link { display: inline; padding: 0; border: 0; background: none; color: #f0cc0a; text-decoration: underline; font: inherit; font-weight: 600; text-align: left; }
.legal-sheet .legal-accept, .legal-sheet .legal-decline { display: block; width: 100%; min-height: 48px; border: 0; border-radius: 16px; font: inherit; }
.legal-sheet .legal-accept { margin-top: 24px; min-height: 56px; background: #f0cc0a; color: #080908; font-weight: 600; }
.legal-sheet .legal-accept:disabled { opacity: .4; }
.legal-sheet .legal-decline { margin-top: 12px; background: transparent; color: #b4b4b4; }
.legal-error { color: #ffc8c8; font-size: 14px; }
.legal-error:empty { display: none; }
.legal-reader {
  height: 90dvh;
  padding: 0;
  overflow: hidden;
  background: #101310;
  transform: translateY(calc(100% + 40px));
  transition: transform 280ms cubic-bezier(.22,.68,0,1);
}
.legal-reader[open] { display: flex; flex-direction: column; }
.legal-reader.is-open:not(.is-closing) { transform: translateY(0); }
.legal-reader::backdrop { background: rgba(0,0,0,.6); }
.legal-reader header { flex: none; background: #101310; padding: 8px 20px 4px; touch-action: none; }
.legal-handle { display: block; width: 40px; height: 4px; margin: 0 auto; border-radius: 2px; background: #ffffff40; }
.legal-reader header button { background: transparent; color: #f0cc0a; border: 0; padding: 10px 0; font: inherit; }
.legal-reader article {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px max(24px, env(safe-area-inset-bottom));
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  .legal-reader { transition: none; }
}
.legal-reader h3 { font-size: 16px; }
.legal-reader table { width: 100%; border-collapse: collapse; }
.legal-reader td { border: 1px solid #555; padding: 8px; vertical-align: top; white-space: pre-line; }
.legal-reader a { color: #f0cc0a; }
