.climb-legal-page, .climb-legal-gate {
  --legal-navy: #101f3b;
  --legal-blue: #184e8c;
  --legal-muted: #465b76;
  --legal-line: #cedbec;
  --legal-sky: #e9f5ff;
  --legal-gold: #ffb719;
  --legal-shadow: 0 12px 32px #132c5315, 0 2px 5px #132c5310;
  color: var(--legal-navy);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

.climb-legal-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  background: linear-gradient(145deg, #f4faff, #e2f2ff);
}

.climb-legal-gate {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #e9f5ff;
}

.climb-legal-gate::backdrop { background: #e9f5ff; }
.climb-legal-gate [hidden] { display: none !important; }
.climb-legal-page *, .climb-legal-gate * { box-sizing: border-box; }
.climb-legal-page a, .climb-legal-gate a { color: var(--legal-blue); }
.climb-legal-page :focus-visible, .climb-legal-gate :focus-visible {
  outline: 3px solid #1e70c5;
  outline-offset: 4px;
}

.climb-legal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1.5rem;
  min-height: 66px;
  padding: 10px clamp(16px, 3.4vw, 56px);
  background: var(--legal-navy);
  color: white;
}
.climb-legal-header a { color: white; }
.climb-legal-header :focus-visible { outline-color: #ffcc53; }
.climb-legal-brand {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-size: clamp(1.12rem, 2.8vw, 1.7rem);
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}
.climb-legal-mark {
  width: 1.55em;
  height: .75em;
  background: #ffbf29;
  clip-path: polygon(0 100%, 26% 56%, 36% 68%, 55% 0, 80% 68%, 87% 57%, 100% 100%, 78% 78%, 56% 39%, 37% 81%, 28% 71%);
}
.climb-legal-nav, .climb-legal-footer, .climb-legal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1.05rem;
}
.climb-legal-nav a { display: inline-block; padding-block: .45rem; }
.climb-legal-nav a[aria-current] { font-weight: 750; }

.climb-legal-scene, .climb-legal-wrap { position: relative; isolation: isolate; }
.climb-legal-scene::before, .climb-legal-wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12px 0 0;
  background: url("/classroom-mountain.svg") right top / min(780px, 75%) auto no-repeat;
  opacity: .12;
  pointer-events: none;
}
[dir=rtl] .climb-legal-wrap::before, .climb-legal-gate[dir=rtl] .climb-legal-scene::before { transform: scaleX(-1); }
.climb-legal-wrap { flex: 1; padding: clamp(18px, 4vw, 48px) clamp(12px, 5vw, 68px); }
.climb-legal-layout {
  display: grid;
  grid-template-columns: minmax(204px, .76fr) minmax(0, 3fr);
  align-items: start;
  gap: clamp(18px, 2.5vw, 38px);
  max-width: 1360px;
  margin-inline: auto;
}
.climb-legal-card, .climb-legal-contents {
  border: 1px solid var(--legal-line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--legal-shadow);
}
.climb-legal-contents { position: sticky; top: 20px; padding: 18px; }
.climb-legal-contents h2 { margin: 0 0 .65rem; font-size: 1.05rem; }
.climb-legal-contents ol { margin: 0; padding-inline-start: 1.4rem; }
.climb-legal-contents li { padding-inline-start: .15rem; }
.climb-legal-contents a { display: block; padding-block: .37rem; text-decoration: none; }
.climb-legal-contents a:hover { text-decoration: underline; }
.climb-legal-card { padding: clamp(19px, 4vw, 44px); overflow-wrap: anywhere; }
.climb-legal-card h1 {
  margin: .5rem 0 .6rem;
  color: var(--legal-navy);
  font-size: clamp(1.65rem, 4.2vw, 2.65rem);
  line-height: 1.22;
  letter-spacing: -.025em;
}
[dir=rtl] .climb-legal-card h1 { letter-spacing: normal; }
.climb-legal-card p { margin: .5rem 0 1rem; font-size: 1rem; }
.climb-legal-card h2 { margin: 0 0 .45rem; font-size: clamp(1.16rem, 2vw, 1.42rem); line-height: 1.35; }
.climb-legal-copy { max-width: 78ch; }
.climb-legal-copy section { padding-block: 1.1rem .5rem; border-top: 1px solid var(--legal-line); scroll-margin-top: 1rem; }
.climb-legal-copy section:first-of-type { margin-block-start: 1.45rem; }
.climb-legal-copy .climb-legal-highlight {
  margin-block: 1rem;
  padding: 1rem 1.2rem .3rem;
  border: 1px solid #bfd9f6;
  border-radius: 12px;
  background: #eef7ff;
}
.climb-legal-card .climb-legal-badge {
  display: inline-block;
  margin: 0 0 .6rem;
  padding: .3rem .8rem;
  border: 1px solid #f3d68d;
  border-radius: 999px;
  background: #fff4d7;
  color: #694300;
  font-size: .83rem;
  font-weight: 670;
}
.climb-legal-footer {
  justify-content: space-between;
  padding: .65rem clamp(16px, 5vw, 68px);
  padding-block-end: max(.65rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--legal-line);
  background: #fff;
}
.climb-legal-footer a { padding-block: .55rem; font-weight: 680; }
.climb-legal-scene {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 66px);
  padding: clamp(18px, 5vw, 56px) 14px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.climb-legal-scene .climb-legal-card { width: min(100%, 650px); }
.climb-legal-scene h1 { font-size: clamp(1.57rem, 4.3vw, 2.2rem); }
.climb-legal-scene h1[tabindex="-1"]:focus { outline: none; }
.climb-legal-scene h1 bdi { display: inline-block; }
.climb-legal-scene .climb-legal-card > h1 + div > p, .climb-legal-hint { color: var(--legal-muted); }
.climb-legal-doc-links { display: grid; gap: .65rem; margin: 1.45rem 0 1rem; }
.climb-legal-doc-links a, .climb-legal-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem 1rem;
  min-height: 58px;
  padding: .78rem 1rem;
  border: 1px solid #bdd6f1;
  border-radius: 12px;
  background: #edf7ff;
  font-weight: 690;
}
.climb-legal-doc-links a::after { content: "→"; }
[dir=rtl] .climb-legal-doc-links a::after { content: "←"; }
.climb-legal-contact { margin-block: 1.25rem; }
.climb-legal-actions { margin-block-start: 1.45rem; }
.climb-legal-actions :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .58rem .95rem;
  border: 1px solid #a7bbd2;
  border-radius: 10px;
  background: white;
  color: var(--legal-navy);
  font: inherit;
  font-weight: 690;
  text-decoration: none;
  cursor: pointer;
}
.climb-legal-actions .climb-legal-primary { border-color: var(--legal-gold); background: var(--legal-gold); }
.climb-legal-actions .climb-legal-signout { border-color: #f3b3b3; background: #fff1f0; color: #9c251f; }
.climb-legal-actions button:disabled { cursor: wait; opacity: .62; }
.climb-legal-status { color: var(--legal-blue); }
.climb-public-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.35rem; margin-block: .45rem; }
.climb-public-legal a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }

@media (max-width: 740px) {
  .climb-legal-layout { grid-template-columns: minmax(0, 1fr); }
  .climb-legal-contents { position: static; box-shadow: none; }
  .climb-legal-contents ol { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; }
  .climb-legal-contents a { padding: .35rem .6rem; border-radius: 8px; background: #ecf6ff; font-size: .9rem; }
  .climb-legal-footer { position: sticky; bottom: 0; z-index: 1; }
  .climb-legal-scene { min-height: auto; }
  .climb-legal-actions { display: grid; }
}
