.terms-gate[aria-hidden="true"] { display: none; }
.terms-gate {
  position: fixed; inset: 0;
  z-index: 9999;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.terms-gate__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
}

.terms-gate__modal {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  height: min(86vh, 860px);
  margin: 7vh auto 0 auto;
  background: #0b0f14;
  color: #e6edf3;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.terms-gate__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.terms-gate__title { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.terms-gate__subtitle { font-size: 12px; opacity: .8; margin-top: 2px; }

.terms-gate__x {
  background: transparent;
  color: #e6edf3;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  width: 36px; height: 36px;
  cursor: pointer;
}

.terms-gate__body { display: flex; flex-direction: column; height: calc(100% - 66px); }
.terms-gate__notice {
  padding: 10px 18px;
  font-size: 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.terms-gate__scroll {
  flex: 1;
  overflow: auto;
  padding: 18px;
  background: rgba(255,255,255,0.01);
}

.terms-gate__content h1, .terms-gate__content h2, .terms-gate__content h3 {
  margin: 16px 0 8px;
}
.terms-gate__content p, .terms-gate__content li {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.95;
}
.terms-gate__content code {
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 6px;
}

.terms-gate__controls {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.terms-gate__checkbox {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px;
}

.terms-gate__actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 12px;
}

.terms-gate__btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: #1f6feb;
  color: white;
  cursor: pointer;
  font-weight: 600;
}
.terms-gate__btn:disabled { opacity: 0.45; cursor: not-allowed; }
.terms-gate__btn--ghost {
  background: transparent;
  color: #e6edf3;
}

.terms-gate__error {
  margin-top: 10px;
  font-size: 12px;
  color: #ffb4b4;
}
/* --- Typography isolation: prevent base.css from forcing dark text --- */
.terms-gate,
.terms-gate * {
  color-scheme: dark; /* helps form controls render appropriately */
}

.terms-gate__modal {
  color: #e6edf3; /* keep */
}

/* Override global h/p/li colors from base.css */
.terms-gate__content,
.terms-gate__content h1,
.terms-gate__content h2,
.terms-gate__content h3,
.terms-gate__content p,
.terms-gate__content li,
.terms-gate__content strong,
.terms-gate__content em,
.terms-gate__content code,
.terms-gate__content a {
  color: inherit;
}

/* Make links readable + consistent */
.terms-gate__content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Optional: better list spacing */
.terms-gate__content ul,
.terms-gate__content ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0.75rem;
}

/* Optional: hr styling in dark UI */
.terms-gate__content hr {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 14px 0;
}