/* Legal pages (privacy / terms / refund) - sticky TOC sidebar + doc column */
body.on-legal{
  --legal-red:#e84855;
  --legal-red-deep:#c93642;
  --legal-ink:#111827;
  --legal-muted:#5b6472;
  --legal-line:#e8eaee;
  --legal-soft:#f4f5f7;
  --legal-card:#ffffff;
  background:var(--legal-soft) !important;
  min-height:100vh;
}
body.on-legal #grid-canvas,
body.on-legal #cursor-glow{display:none !important;}
body.on-legal #page-legal{
  padding-top:100px;
  padding-bottom:0;
  min-height:100vh;
  background:transparent;
}
/* Global body{overflow-x:hidden} makes body a scroll container, which silently
   kills position:sticky for descendants (the aside would scroll away 1:1).
   Clipping horizontally at the html layer keeps the same no-overflow guarantee
   while leaving the viewport as the sticky containing block. */
body.on-legal{overflow-x:clip;}
html:has(body.on-legal){overflow-x:clip;overflow-y:scroll;}

.legal-shell{
  max-width:1080px;
  margin:0 auto;
  padding:28px 24px 80px;
}

/* Hero */
.legal-hero{
  max-width:680px;
  margin:0 0 26px;
}
.legal-hero-kicker{
  margin:0 0 12px;
  font-family:Outfit,system-ui,sans-serif;
  font-size:12px;
  font-weight:500;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--legal-red);
}
.legal-hero h1{
  margin:0 0 14px;
  font-family:Outfit,system-ui,sans-serif;
  font-size:clamp(2.4rem,5vw,3.4rem);
  font-weight:800;
  letter-spacing:-.045em;
  line-height:1.05;
  color:var(--legal-ink);
}
.legal-hero-lead{
  margin:0;
  font-size:1.05rem;
  line-height:1.65;
  color:var(--legal-muted);
}
.legal-hero-lead a{
  color:var(--legal-red-deep);
  font-weight:400;
  text-decoration:underline;
  text-underline-offset:3px;
}

/* Language switch */
.legal-langbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 34px;
  flex-wrap:wrap;
}
.legal-lang-label{
  font-size:12px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:#98a2b3;
  margin-right:2px;
}
.legal-lang-btn{
  padding:8px 16px;
  border:1px solid var(--legal-line);
  border-radius:999px;
  background:var(--legal-card);
  font-family:Outfit,system-ui,sans-serif;
  font-size:13px;
  font-weight:600;
  color:var(--legal-muted);
  cursor:pointer;
  transition:border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.legal-lang-btn:hover{border-color:rgba(232,72,85,.4);color:var(--legal-ink);}
.legal-lang-btn.is-on{
  background:var(--legal-ink);
  border-color:var(--legal-ink);
  color:#fff;
}

/* Layout: sticky TOC rail + document column */
.legal-layout{
  display:grid;
  grid-template-columns:212px minmax(0,1fr);
  gap:48px;
  align-items:start;
}

.legal-aside{
  position:sticky;
  top:96px;
}
.legal-aside-h{
  margin:0 0 10px;
  padding-left:13px;
  font-family:Outfit,system-ui,sans-serif;
  font-size:11px;
  font-weight:600;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#98a2b3;
}
.legal-toc{
  display:flex;
  flex-direction:column;
}
.legal-toc[hidden]{display:none !important;}
.legal-toc a{
  display:block;
  padding:7px 12px;
  border-left:2px solid transparent;
  border-radius:0 9px 9px 0;
  font-family:Outfit,system-ui,sans-serif;
  font-size:13.5px;
  font-weight:500;
  color:var(--legal-muted);
  text-decoration:none;
  transition:color .15s ease, background .15s ease, border-color .15s ease;
}
.legal-toc a:hover{
  color:var(--legal-ink);
  background:rgba(232,72,85,.04);
}
.legal-toc a.is-on{
  color:var(--legal-red-deep);
  border-left-color:var(--legal-red);
  background:rgba(232,72,85,.06);
  font-weight:600;
}

/* Document card */
.legal-doc{
  background:var(--legal-card);
  border:1px solid var(--legal-line);
  border-radius:18px;
  padding:clamp(24px,3.5vw,46px);
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.legal-doc-updated{
  display:inline-block;
  margin:0 0 24px;
  padding:5px 12px;
  border-radius:999px;
  background:var(--legal-soft);
  border:1px solid var(--legal-line);
  font-size:12px;
  font-weight:600;
  color:var(--legal-muted);
}

/* Sections */
.legal-section{margin:0 0 32px;}
.legal-section:last-child{margin-bottom:0;}
.legal-section h2{
  margin:0 0 12px;
  font-family:Outfit,system-ui,sans-serif;
  font-size:1.28rem;
  font-weight:700;
  letter-spacing:-.015em;
  color:var(--legal-ink);
}
.legal-section p{
  margin:0 0 10px;
  font-size:.97rem;
  line-height:1.75;
  color:#3f4754;
}
.legal-section p:last-child{margin-bottom:0;}
.legal-section a{
  color:var(--legal-red-deep);
  text-decoration:underline;
  text-underline-offset:3px;
}
.legal-section ul{
  margin:8px 0 12px;
  padding-left:22px;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.legal-section li{
  font-size:.97rem;
  line-height:1.7;
  color:#3f4754;
}
.legal-section li::marker{color:#b3bac4;}
.legal-section strong{color:var(--legal-ink);font-weight:600;}

/* Small info callout inside a section */
.legal-note{
  margin:14px 0 0;
  padding:13px 16px;
  border:1px solid var(--legal-line);
  border-left:3px solid var(--legal-red);
  border-radius:10px;
  background:var(--legal-soft);
  font-size:.92rem;
  line-height:1.65;
  color:var(--legal-muted);
}
.legal-note strong{color:var(--legal-ink);}

/* Cross links to other policies */
.legal-other{
  margin-top:30px;
  padding-top:24px;
  border-top:1px solid var(--legal-line);
}
.legal-other-h{
  margin:0 0 12px;
  font-family:Outfit,system-ui,sans-serif;
  font-size:.8rem;
  font-weight:600;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:#98a2b3;
}
.legal-other-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.legal-other-links a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 18px;
  border:1px solid var(--legal-line);
  border-radius:12px;
  background:var(--legal-card);
  font-family:Outfit,system-ui,sans-serif;
  font-size:14px;
  font-weight:600;
  color:var(--legal-ink);
  text-decoration:none;
  transition:border-color .15s ease,box-shadow .15s ease;
}
.legal-other-links a:hover{border-color:rgba(232,72,85,.45);box-shadow:0 1px 3px rgba(15,23,42,.06);}
.legal-other-links a.is-current{border-color:rgba(232,72,85,.45);background:rgba(232,72,85,.06);}

/* Footer (same simple footer as faq) */
.legal-shell .footer--simple{max-width:none;}

/* Mobile: TOC becomes one horizontally scrollable line above the doc */
@media (max-width:900px){
  .legal-layout{
    grid-template-columns:1fr;
    gap:20px;
  }
  .legal-aside{position:static;min-width:0;}
  .legal-aside-h{padding-left:2px;margin-bottom:8px;}
  .legal-toc{
    flex-direction:row;
    gap:4px;
    max-width:100%;
    min-width:0;
    overflow-x:auto;
    overflow-y:hidden;
    padding:2px 2px 8px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .legal-toc::-webkit-scrollbar{display:none;}
  .legal-toc a{
    white-space:nowrap;
    border-left:none;
    border:1px solid var(--legal-line);
    border-radius:999px;
    padding:7px 13px;
    font-size:12.5px;
    background:var(--legal-card);
  }
  .legal-toc a.is-on{
    border-color:rgba(232,72,85,.4);
    background:rgba(232,72,85,.07);
  }
}
@media (max-width:640px){
  .legal-shell{padding:20px 16px 64px;}
  .legal-doc{border-radius:14px;}
  .legal-langbar{gap:6px;}
  .legal-lang-btn{padding:7px 13px;font-size:12px;}
}
