/* Legal pages (terms, privacy): one reading column with a contents rail.
   Wraps the existing .terms-section / .privacy-policy-section markup; the text is untouched. */
.ow-legal { max-width: var(--ow-max, 1240px); margin: 0 auto; padding: 4px var(--ow-gutter, 16px) 40px; font-family: var(--ow-font, inherit); color: #1e293b; }
.ow-legal *, .ow-legal *::before, .ow-legal *::after { box-sizing: border-box; }

/* head */
.ow-legal__head { background: transparent; color: #1e293b; text-align: left; padding: 8px 0 14px; border-bottom: 1px solid #e2e8f0; margin-bottom: 14px; }
.ow-legal__head h1 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 34px); font-weight: 900; letter-spacing: -.02em; color: #0f172a; text-align: left; }
.ow-legal__lead { text-align: left; margin: 0 0 10px; font-size: 14.5px; color: #475569; max-width: 60em; }
.ow-legal__meta { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.ow-legal__meta li { margin: 0; padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 999px; background: #f8fafc; color: #475569; box-shadow: none; }
.ow-legal__meta li strong { color: #0f172a; font-weight: 700; }
.ow-legal__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ow-legal__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 14px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #4f46e5; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.ow-legal__btn:hover { background: #eef2ff; border-color: #c7d2fe; }
.ow-legal__btn[hidden] { display: none; }
.ow-legal__btn.is-on { background: #4f46e5; border-color: #4f46e5; color: #fff; }

/* layout */
.ow-legal__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ow-legal__toc { border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; padding: 0; }
.ow-legal__toc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-size: 14px; font-weight: 800; color: #0f172a; }
.ow-legal__toc summary::-webkit-details-marker { display: none; }
.ow-legal__toc summary::after { content: "+"; font-size: 18px; color: #64748b; }
.ow-legal__toc[open] summary::after { content: "\2212"; }
.ow-legal__toc ol { margin: 0; padding: 0 8px 10px; list-style: none; counter-reset: toc; }
.ow-legal__toc li { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.ow-legal__toc a { display: flex; gap: 8px; align-items: baseline; padding: 7px 8px; border-radius: 8px; color: #334155; text-decoration: none; font-size: 13.5px; line-height: 1.35; counter-increment: toc; }
.ow-legal__toc a::before { content: counter(toc); flex: 0 0 22px; font-size: 11px; font-weight: 800; color: #94a3b8; }
.ow-legal__toc a:hover { background: #f1f5f9; color: #0f172a; }
.ow-legal__toc a.is-active { background: #eef2ff; color: #4f46e5; }
.ow-legal__toc a.is-active::before { color: #4f46e5; }

/* the document */
.ow-legal__doc { min-width: 0; font-size: 15px; line-height: 1.65; }
.ow-legal__doc > div > p { margin: 0 0 12px; color: #334155; }
.ow-legal__doc ol { list-style: none; margin: 0; padding: 0; counter-reset: sec; }
.ow-legal__doc ol > li { scroll-margin-top: 90px; margin: 0 0 8px; padding: 18px 18px 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: none; counter-increment: sec; }
.ow-legal__doc ol > li:target { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.ow-legal__doc h2 { display: flex; gap: 10px; align-items: baseline; margin: 0 0 10px; font-size: clamp(17px, 1.3vw, 21px); font-weight: 800; color: #0f172a; text-align: left; scroll-margin-top: 90px; }
.ow-legal__doc h2::before { content: counter(sec, decimal-leading-zero); flex-shrink: 0; font-size: 12px; font-weight: 800; color: #4f46e5; background: #eef2ff; border-radius: 999px; padding: 2px 8px; }
.ow-legal__doc h3 { margin: 16px 0 6px; font-size: 15px; font-weight: 800; color: #0f172a; text-align: left; }
.ow-legal__doc p { margin: 0 0 10px; color: #334155; }
.ow-legal__doc ul { margin: 6px 0 12px; padding-left: 22px; list-style: disc !important; }
.ow-legal__doc ul li { font-size: inherit; line-height: inherit; margin: 0 0 5px; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; display: list-item; color: #334155; }
.ow-legal__doc a { color: #4f46e5; font-weight: 600; }
.ow-legal__doc em { color: #64748b; }
.ow-legal__doc li.ow-legal__note { padding: 10px 14px; font-size: 13px; color: #64748b; background: #f8fafc; counter-increment: none; }
.ow-legal__doc li.ow-legal__note sup { color: #4f46e5; font-weight: 800; }
.ow-legal__doc .returns-policy h2 { margin-top: 0; }
.ow-legal__doc .returns-policy > p:last-child { margin-top: 12px; font-size: 12.5px; }
.ow-legal__top { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: #4f46e5; font-weight: 700; font-size: 13.5px; text-decoration: none; }

@media (min-width: 900px) {
  .ow-legal { padding-top: 10px; }
  .ow-legal__grid { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
  .ow-legal__toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
  .ow-legal__toc summary { pointer-events: none; }
  .ow-legal__toc summary::after { content: none; }
  .ow-legal__doc { font-size: 15.5px; }
  .ow-legal__doc ol > li { padding: 22px 24px 10px; margin-bottom: 12px; }
}
@media (min-width: 1440px) { .ow-legal__grid { grid-template-columns: 300px minmax(0, 1fr); gap: 36px; } .ow-legal__doc { font-size: 16px; max-width: 72em; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
