.legal-acceptance-gate {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--text-primary) 68%, transparent);
}

.legal-acceptance-gate__dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--text-primary) 28%, transparent);
  font-family: var(--app-theme-font-family);
  font-size: var(--app-theme-font-size-md);
}

.legal-acceptance-gate__dialog h2 {
  margin: 0 0 12px;
  font-size: var(--app-theme-font-size-md);
  line-height: 1.2;
}

.legal-acceptance-gate__dialog p {
  color: var(--text-primary);
  font-size: var(--app-theme-font-size-md);
}

.legal-acceptance-gate__items {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.legal-acceptance-gate__items a {
  color: var(--accent-primary);
  font-size: var(--app-theme-font-size-md);
  font-weight: 700;
}

.legal-acceptance-gate__confirmation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: var(--app-theme-font-size-md);
}

.legal-acceptance-gate__confirmation input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.legal-acceptance-gate__error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: var(--app-theme-font-size-md);
}

.legal-acceptance-gate__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.legal-acceptance-gate__secondary {
  margin-right: auto;
  color: var(--text-secondary);
  font-size: var(--app-theme-font-size-md);
}

.legal-acceptance-gate__actions .app-button {
  font-size: var(--app-theme-font-size-md);
}

.legal-acceptance-gate__support {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.legal-acceptance-gate ~ .feedback-overlay {
  z-index: 12001;
}

.legal-public-preview {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.legal-public-preview__header {
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--app-border, #dbe3ef);
  background: var(--app-surface, #fff);
}

.legal-public-preview__header h2 {
  margin: 0;
}

.legal-public-preview__header img {
  width: 18px;
  height: 18px;
}

.legal-public-preview__article {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin-block: 8px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px 24px 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.legal-public-preview__article img,
.legal-public-preview__article table,
.legal-public-preview__article pre {
  max-width: 100%;
}

.legal-public-preview__article table {
  table-layout: fixed;
}

.legal-public-preview__article pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
