:root {
  --legal-bg: #f6f8fc;
  --legal-surface: #ffffff;
  --legal-ink: #07111f;
  --legal-muted: #556575;
  --legal-line: rgba(7, 17, 31, 0.08);
  --legal-navy: #0a1c2f;
  --legal-blue: #1d63ff;
  --legal-teal: #18a999;
  --legal-green: #2ca25f;
  --legal-amber: #f0b24f;
  --legal-rose: #e65f75;
  --legal-shadow: 0 28px 80px rgba(7, 17, 31, 0.12);
  --legal-panel-shadow: 0 18px 44px rgba(7, 17, 31, 0.07);
}

.md-content__inner:has(.legal-home) {
  margin: 0;
  max-width: none;
  padding: 0;
}

.md-content__inner:has(.legal-home)::before {
  display: none;
}

.md-content__inner:has(.legal-home) > .md-content__button {
  display: none;
}

.md-main__inner:has(.legal-home) {
  margin-top: 0;
  max-width: none;
}

.md-content:has(.legal-home) {
  max-width: none;
}

.md-typeset .legal-home {
  background:
    radial-gradient(circle at top left, rgba(24, 169, 153, 0.12), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(29, 99, 255, 0.12), transparent 24%),
    var(--legal-bg);
  color: var(--legal-ink);
  margin: 0 calc(50% - 50vw);
  overflow: hidden;
}

.md-typeset .legal-home *,
.md-typeset .legal-home *::before,
.md-typeset .legal-home *::after {
  box-sizing: border-box;
}

.md-typeset .legal-hero,
.md-typeset .legal-signal-grid,
.md-typeset .legal-section,
.md-typeset .legal-card-grid,
.md-typeset .legal-code-section,
.md-typeset .legal-footer-cta {
  margin-left: auto;
  margin-right: auto;
  max-width: 1180px;
  width: calc(100% - 40px);
}

.md-typeset .legal-hero {
  align-items: center;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  min-height: 740px;
  padding: 96px 0 78px;
  position: relative;
}

.md-typeset .legal-hero::before {
  background:
    linear-gradient(90deg, rgba(29, 99, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(24, 169, 153, 0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
  height: 100%;
  left: 50%;
  max-width: 1200px;
  opacity: 0.75;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 100%;
}

.md-typeset .legal-hero > * {
  position: relative;
  z-index: 1;
}

.md-typeset .legal-brandline {
  align-items: center;
  color: var(--legal-navy);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 800;
  gap: 10px;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.md-typeset .legal-brandline img {
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(11, 31, 51, 0.16);
  height: 46px;
  width: 46px;
}

.md-typeset .legal-kicker,
.md-typeset .legal-section__eyebrow,
.md-typeset .legal-card__label,
.md-typeset .legal-system__top {
  color: var(--legal-teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.md-typeset .legal-hero h1 {
  color: var(--legal-ink);
  font-size: clamp(2.5rem, 3.9vw, 3.7rem);
  font-weight: 860;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin: 0;
  max-width: 760px;
  text-wrap: balance;
}

.md-typeset .legal-lede {
  color: var(--legal-muted);
  font-size: 1.05rem;
  line-height: 1.72;
  margin: 24px 0 0;
  max-width: 700px;
}

.md-typeset .legal-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.md-typeset .legal-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--legal-line);
  border-radius: 999px;
  color: var(--legal-ink);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  line-height: 1.2;
  min-height: 44px;
  padding: 11px 16px;
  text-align: center;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.md-typeset .legal-button:hover {
  border-color: rgba(29, 99, 255, 0.34);
  box-shadow: 0 12px 24px rgba(29, 99, 255, 0.12);
  color: var(--legal-blue);
  transform: translateY(-2px);
}

.md-typeset .legal-button--primary {
  background: linear-gradient(135deg, var(--legal-navy), var(--legal-blue));
  border-color: transparent;
  color: #ffffff;
}

.md-typeset .legal-button--primary:hover {
  background: linear-gradient(135deg, var(--legal-blue), var(--legal-teal));
  color: #ffffff;
}

.md-typeset .legal-button--ghost {
  background: transparent;
}

.md-typeset .legal-hero__system {
  background: linear-gradient(145deg, #07111f 0%, #112642 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(7, 17, 31, 0.22);
  color: #dbeafe;
  overflow: hidden;
  position: relative;
}

.md-typeset .legal-hero__system::after {
  background: linear-gradient(130deg, rgba(24, 169, 153, 0.25), transparent 56%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.md-typeset .legal-system__top {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: #a7f3d0;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
}

.md-typeset .legal-dot {
  background: var(--legal-green);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(47, 158, 68, 0.16);
  display: inline-block;
  height: 9px;
  width: 9px;
}

.md-typeset .legal-flow {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 32px 1fr 32px 1fr;
  padding: 22px 22px 8px;
}

.md-typeset .legal-node {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  min-height: 98px;
  padding: 16px;
}

.md-typeset .legal-node strong {
  color: #67e8f9;
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.md-typeset .legal-node span {
  color: #f8fafc;
  display: block;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.35;
}

.md-typeset .legal-node--active {
  border-color: rgba(20, 184, 166, 0.74);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.28);
}

.md-typeset .legal-connector {
  align-self: center;
  background: linear-gradient(90deg, var(--legal-teal), rgba(20, 184, 166, 0.12));
  height: 2px;
}

.md-typeset .legal-hero__system pre,
.md-typeset .legal-code-section pre {
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 18px 22px 22px;
  overflow-x: auto;
}

.md-typeset .legal-hero__system pre {
  background: #020617;
  color: #ccfbf1;
}

.md-typeset .legal-signal-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 0 34px;
}

.md-typeset .legal-signal-grid article,
.md-typeset .legal-card-grid article,
.md-typeset .legal-section--accent,
.md-typeset .legal-code-section,
.md-typeset .legal-footer-cta {
  background: var(--legal-surface);
  border: 1px solid rgba(7, 17, 31, 0.06);
  border-radius: 24px;
  box-shadow: 0 18px 46px rgba(7, 17, 31, 0.06);
}

.md-typeset .legal-signal-grid article {
  min-height: 120px;
  padding: 20px;
}

.md-typeset .legal-signal-grid strong {
  color: var(--legal-blue);
  display: block;
  font-size: 1.42rem;
  margin-bottom: 10px;
}

.md-typeset .legal-signal-grid span {
  color: var(--legal-muted);
  display: block;
  font-size: 0.9rem;
  line-height: 1.45;
}

.md-typeset .legal-section {
  padding: 54px 0;
}

.md-typeset .legal-section--split {
  align-items: start;
  display: grid;
  gap: 46px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.md-typeset .legal-section h2,
.md-typeset .legal-code-section h2,
.md-typeset .legal-footer-cta h2 {
  color: var(--legal-ink);
  font-size: 2.15rem;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

.md-typeset .legal-section p,
.md-typeset .legal-card-grid p,
.md-typeset .legal-code-section p,
.md-typeset .legal-footer-cta p {
  color: var(--legal-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin: 16px 0 0;
}

.md-typeset .legal-card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 48px;
}

.md-typeset .legal-card-grid article {
  border-top: 4px solid var(--legal-teal);
  min-height: 230px;
  padding: 24px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.md-typeset .legal-card-grid article:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(7, 17, 31, 0.1);
}

.md-typeset .legal-card-grid article:nth-child(2) {
  border-top-color: var(--legal-blue);
}

.md-typeset .legal-card-grid article:nth-child(3) {
  border-top-color: var(--legal-amber);
}

.md-typeset .legal-card-grid h3 {
  color: var(--legal-ink);
  font-size: 1.32rem;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 34px 0 0;
}

.md-typeset .legal-section--accent {
  align-items: center;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  margin-bottom: 48px;
  padding: 36px;
}

.md-typeset .legal-checklist {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.md-typeset .legal-checklist span {
  background:
    linear-gradient(90deg, rgba(24, 169, 153, 0.16), transparent),
    #f8fafc;
  border: 1px solid rgba(24, 169, 153, 0.2);
  border-radius: 14px;
  color: var(--legal-ink);
  font-size: 0.9rem;
  font-weight: 760;
  min-height: 48px;
  padding: 13px 14px;
}

.md-typeset .legal-code-section {
  align-items: start;
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  margin-bottom: 48px;
  padding: 34px;
}

.md-typeset .legal-code-section pre {
  background: #101827;
  color: #d1fae5;
  margin: 0;
}

.md-typeset .legal-footer-cta {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 72px;
  padding: 36px;
}

.md-typeset .legal-footer-cta .legal-actions {
  justify-content: end;
  margin-top: 0;
}

@media screen and (max-width: 960px) {
  .md-typeset .legal-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 56px;
  }

  .md-typeset .legal-hero h1 {
    font-size: 3rem;
    max-width: 820px;
  }

  .md-typeset .legal-signal-grid,
  .md-typeset .legal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md-typeset .legal-section--split,
  .md-typeset .legal-section--accent,
  .md-typeset .legal-code-section,
  .md-typeset .legal-footer-cta {
    grid-template-columns: 1fr;
  }

  .md-typeset .legal-footer-cta .legal-actions {
    justify-content: start;
  }
}

@media screen and (max-width: 640px) {
  .md-typeset .legal-hero,
  .md-typeset .legal-signal-grid,
  .md-typeset .legal-section,
  .md-typeset .legal-card-grid,
  .md-typeset .legal-code-section,
  .md-typeset .legal-footer-cta {
    width: calc(100% - 28px);
  }

  .md-typeset .legal-hero {
    gap: 28px;
    padding: 38px 0 38px;
  }

  .md-typeset .legal-hero h1 {
    font-size: 2.28rem;
    line-height: 1.08;
  }

  .md-typeset .legal-lede {
    font-size: 1rem;
  }

  .md-typeset .legal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .md-typeset .legal-button {
    width: 100%;
  }

  .md-typeset .legal-flow,
  .md-typeset .legal-signal-grid,
  .md-typeset .legal-card-grid,
  .md-typeset .legal-checklist {
    grid-template-columns: 1fr;
  }

  .md-typeset .legal-connector {
    height: 20px;
    justify-self: center;
    width: 2px;
  }

  .md-typeset .legal-section h2,
  .md-typeset .legal-code-section h2,
  .md-typeset .legal-footer-cta h2 {
    font-size: 1.74rem;
  }

  .md-typeset .legal-section--accent,
  .md-typeset .legal-code-section,
  .md-typeset .legal-footer-cta {
    padding: 24px;
  }
}
