/* Shared legal-page presentation, built from the same tokens as the main planner. */

body.legal-page-body {
  min-height: 100dvh;
  height: auto;
  overflow: auto;
  padding: 0;
}

.legal-app {
  width: min(100%, 1440px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: var(--ptp-rail) minmax(0, 1fr);
  gap: 16px;
}

.legal-rail,
.ptp-topbar,
.legal-hero,
.legal-index,
.legal-document,
.legal-footer {
  border: 1px solid var(--ptp-line);
  background: var(--ptp-panel);
  box-shadow: var(--ptp-shadow);
  backdrop-filter: blur(18px);
}

.legal-rail {
  position: sticky;
  top: 18px;
  height: calc(100dvh - 36px);
  min-height: 560px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-radius: var(--ptp-radius);
  background: var(--ptp-panel-solid);
  box-shadow: none;
  backdrop-filter: none;
}

.legal-brand {
  min-height: 92px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ptp-line);
  color: var(--ptp-ink);
  font-size: .7rem;
  font-weight: 950;
  line-height: .95;
  text-align: center;
  text-decoration: none;
}

.legal-brand svg {
  display: block;
  width: 42px;
  height: 42px;
}

.legal-rail-nav {
  display: grid;
  gap: 6px;
}

.legal-rail-nav a {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--ptp-radius);
  color: var(--ptp-muted);
  text-decoration: none;
}

.legal-rail-nav a:hover,
.legal-rail-nav a:focus-visible,
.legal-rail-nav a.is-active {
  border-color: color-mix(in srgb, var(--ptp-blue) 30%, var(--ptp-line));
  background: var(--ptp-blue-soft);
  color: var(--ptp-blue);
}

.legal-rail-nav small {
  color: inherit;
  font-size: .64rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-rail-nav span {
  font-size: .78rem;
  font-weight: 900;
}

.legal-rail-foot {
  margin-top: auto;
  display: grid;
  gap: 7px;
  color: var(--ptp-muted);
  font-size: .68rem;
  line-height: 1.4;
  text-align: center;
}

.legal-rail-foot a {
  color: var(--ptp-blue);
  font-weight: 900;
  text-decoration: none;
}

.legal-workspace {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}

body.legal-page-body .ptp-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.legal-breadcrumb,
.legal-topbar-actions,
.legal-language-switch {
  display: flex;
  align-items: center;
}

.legal-breadcrumb {
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--ptp-muted);
  font-size: .82rem;
  font-weight: 800;
}

.legal-breadcrumb a {
  color: var(--ptp-blue);
  text-decoration: none;
}

.legal-breadcrumb strong {
  color: var(--ptp-ink);
}

.legal-topbar-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.legal-language-switch {
  padding: 3px;
  border: 1px solid var(--ptp-line);
  border-radius: var(--ptp-radius);
  background: var(--ptp-panel-solid);
}

.legal-language-switch button {
  min-width: 42px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ptp-muted);
  font-size: .72rem;
  font-weight: 950;
  cursor: pointer;
}

.legal-language-switch button.is-active,
.legal-language-switch button:hover {
  background: var(--ptp-blue-soft);
  color: var(--ptp-blue);
}

.legal-main {
  display: grid;
  gap: 16px;
}

.legal-hero {
  position: relative;
  overflow: hidden;
  min-height: 216px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--ptp-radius);
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--ptp-purple) 24%, transparent), transparent 38%),
    linear-gradient(135deg, color-mix(in srgb, var(--ptp-blue-soft) 84%, var(--ptp-panel-solid)), var(--ptp-panel-solid));
}

.legal-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -65px;
  bottom: -105px;
  border: 26px solid color-mix(in srgb, var(--ptp-blue) 24%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.legal-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.legal-kicker,
.legal-panel-label,
.legal-section-number {
  margin: 0;
  color: var(--ptp-muted);
  font-size: .74rem;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.legal-kicker {
  margin-bottom: 12px;
  color: var(--ptp-blue);
}

.legal-hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--ptp-ink);
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -.045em;
  line-height: .98;
}

.legal-hero-copy > p:last-child {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--ptp-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.legal-hero-badge {
  position: absolute;
  right: clamp(22px, 4vw, 44px);
  bottom: 26px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--ptp-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ptp-panel-solid) 78%, transparent);
  color: var(--ptp-muted);
  font-size: .7rem;
  font-weight: 900;
}

.legal-hero-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ptp-green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ptp-green) 16%, transparent);
}

.legal-body-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.legal-index,
.legal-document {
  border-radius: var(--ptp-radius);
}

.legal-index {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.legal-index nav {
  display: grid;
  gap: 3px;
}

.legal-index nav a {
  padding: 7px 0;
  border-bottom: 1px solid var(--ptp-line);
  color: var(--ptp-muted);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.legal-index nav a:hover,
.legal-index nav a:focus-visible {
  color: var(--ptp-blue);
}

.legal-support {
  margin-top: 3px;
  padding-top: 14px;
  border-top: 1px solid var(--ptp-line);
  color: var(--ptp-muted);
  font-size: .72rem;
  line-height: 1.5;
}

.legal-support a {
  display: inline-block;
  margin-top: 5px;
  color: var(--ptp-blue);
  font-weight: 900;
  text-decoration: none;
}

.legal-document {
  min-width: 0;
  padding: clamp(18px, 3vw, 32px);
}

.legal-document-bar {
  min-height: 34px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ptp-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ptp-muted);
  font-size: .74rem;
  font-weight: 800;
}

.legal-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--ptp-green) 30%, var(--ptp-line));
  border-radius: 999px;
  background: var(--ptp-green-soft);
  color: var(--ptp-green);
  font-size: .68rem;
  font-weight: 950;
}

.legal-language-section[hidden] {
  display: none;
}

.legal-section {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--ptp-line);
}

.legal-section:first-child {
  padding-top: 0;
}

.legal-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-section-number {
  padding-top: 4px;
  color: var(--ptp-blue);
  font-size: .7rem;
}

.legal-section h2 {
  margin: 0 0 10px;
  color: var(--ptp-ink);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.15;
}

.legal-section p {
  max-width: 760px;
  margin: 0;
  color: var(--ptp-muted);
  font-size: .94rem;
  line-height: 1.72;
}

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

.legal-section a,
.legal-section button {
  color: var(--ptp-blue);
  font-weight: 850;
}

.legal-section address {
  margin: 0;
  color: var(--ptp-muted);
  font-size: .9rem;
  font-style: normal;
  line-height: 1.7;
}

.legal-section address a {
  text-decoration: none;
}

.legal-footer {
  border-radius: var(--ptp-radius);
  background: var(--ptp-panel-solid);
  color: var(--ptp-muted);
  padding: 10px 14px;
  font-size: .72rem;
  font-weight: 800;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 16px;
}

.legal-footer a,
.legal-footer button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.legal-footer a:hover,
.legal-footer a:focus-visible,
.legal-footer button:hover,
.legal-footer button:focus-visible {
  color: var(--ptp-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-footer button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 980px) {
  body.legal-page-body {
    display: block;
    height: auto;
    overflow: auto;
  }

  .legal-app {
    display: block;
    min-height: 0;
    padding: 10px;
  }

  .legal-rail {
    display: none;
  }

  .legal-index {
    position: static;
  }
}

@media (max-width: 680px) {
  .legal-app {
    padding: 8px;
  }

  body.legal-page-body .ptp-topbar {
    align-items: flex-start;
    padding: 10px;
  }

  .legal-topbar-actions {
    align-items: flex-start;
  }

  .legal-body-grid {
    grid-template-columns: 1fr;
  }

  .legal-hero {
    min-height: 250px;
    padding: 24px 18px;
  }

  .legal-hero-badge {
    right: 18px;
    bottom: 18px;
  }

  .legal-section {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 20px 0;
  }

  .legal-section-number {
    padding-top: 0;
  }

  .legal-document-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  body.legal-page-body .ptp-topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .legal-topbar-actions {
    justify-content: space-between;
  }

  .legal-language-switch {
    flex: 1;
  }

  .legal-language-switch button {
    flex: 1;
  }
}
