.legal-document {
  background: var(--paper);
}

.legal-document ::selection {
  color: var(--ink);
  background: var(--peach);
}

.legal-header {
  border-bottom: 1px solid var(--line);
}

.legal-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
}

.legal-header .legal-home {
  min-height: 44px;
  gap: 8px;
  padding: 9px 13px;
  font-weight: 700;
}

.legal-home svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legal-hero {
  background: linear-gradient(125deg, var(--paper) 25%, #eeeaf5 75%, #f8dfc9);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(36px, 6vw, 66px) clamp(28px, 4vw, 44px);
}

.legal-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
}

.legal-hero .v2-atmosphere * {
  animation: none;
}

.legal-art {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  justify-self: center;
}

.legal-hero h1 {
  max-width: none;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.legal-intro {
  max-width: 58ch;
  margin-top: 16px;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.legal-date {
  margin-top: 18px;
  color: var(--muted);
  font-size: .875rem;
}

.legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 24px;
}

.legal-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  padding: 7px 15px;
  background: #fffaf3;
  color: var(--ink);
  font-weight: 650;
}

.legal-tabs a[aria-current="page"],
.legal-tabs a:hover {
  background: var(--ink);
  color: var(--paper);
}

.legal-reading {
  background: linear-gradient(#eeeaf5, #fffdf8 320px);
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 6vw, 80px);
  padding-block: clamp(30px, 6vw, 72px);
}

.legal-index {
  background: #f8dfc9;
  border-radius: 14px;
  padding: 16px;
  color: var(--ink);
}

.legal-index ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.legal-index a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  font-size: .9rem;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-prose {
  max-width: 68ch;
  min-width: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
}

.legal-prose section + section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.legal-prose section {
  scroll-margin-top: 24px;
}

.legal-prose h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.legal-prose p {
  margin-top: 12px;
}

.legal-prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.legal-document a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.legal-document .footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.legal-document .footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (max-width: 720px) {
  .legal-header .wrap { min-height: 68px; }
  .legal-header .brand img { width: 118px; height: auto; }
  .legal-hero-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .legal-art { width: min(100%, 290px); max-height: 170px; }
  .legal-tabs { gap: 8px; }
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .legal-index { max-width: 68ch; }
}
