/* Suntc legal documents: /offer, /privacy, /personal-data-consent.
   Tokens follow the cart (suntc-dialog.css): ink, line, surface, gold, focus; spacing 4/8/12/16/24/32/48; radii 6/10.
   Edges follow the theme .container: max 1700px, side padding 40 / 25 (≤1101) / 15 (≤768). */
#content.suntc-legal {
  --ink: #23241f; --ink-2: #53564d; --line: #d6d8cf; --control: #a8aaa2;
  --surface: #f6f6f2; --surface-2: #ebebe5; --gold: #ffad17; --focus: #995c00; --attention: #fff4dc;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --r-ctl: 6px; --r-card: 10px; --t-fast: 140ms;
  --head: 108px; /* fixed theme header (83px) + air */
  box-sizing: border-box; width: 100%; max-width: 1700px; margin: 0 auto; padding: var(--s-6) 40px 96px;
  color: var(--ink); font-size: 16px; line-height: 1.5;
}
#content.suntc-legal *, #content.suntc-legal *::before, #content.suntc-legal *::after { box-sizing: border-box; }
/* The theme sets overflow-x:hidden on html/body, which disables position:sticky; clip keeps sideways scroll off. */
html:has(#content.suntc-legal), body:has(#content.suntc-legal) { overflow-x: clip; overflow-y: visible; }
.suntc-legal :is(h1, h2, h3) { padding: 0; font-family: inherit; color: var(--ink); text-transform: none; text-align: left; text-indent: 0; }
.suntc-legal h2::before, .suntc-legal h2::after { content: none !important; display: none !important; }
.suntc-legal a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--control); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.suntc-legal :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.suntc-legal button { font-family: inherit; }

/* ---- Head: crumbs, title, meta, switcher ---- */
.suntc-legal__head { margin-bottom: var(--s-6); }
.suntc-legal .suntc-legal__crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s-2); margin: 0 0 var(--s-4); color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.suntc-legal .suntc-legal__crumbs a { color: var(--ink-2); text-decoration: none; }
#content.suntc-legal .suntc-legal__head h1 {
  width: auto !important; max-width: none !important; margin: 0 0 var(--s-3) !important; padding: 0 !important;
  font-size: clamp(30px, 4.5vw, 52px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; overflow-wrap: break-word; text-wrap: balance;
}
.suntc-legal__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: 0 0 var(--s-5); color: var(--ink-2); font-size: 15px; }
.suntc-legal__meta p { margin: 0; font-size: inherit; line-height: 1.4; }
.suntc-legal__print {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1; cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
/* One segmented bar on the grid: from the text edge to the contents edge (≥1200) or the text width. */
.suntc-legal__switch ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); max-width: calc(720px + var(--s-7) + 340px); margin: 0; padding: 0; list-style: none; }
.suntc-legal__switch li { margin: 0; }
.suntc-legal .suntc-legal__switch a {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--control); border-radius: var(--r-ctl); background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 500; line-height: 1.25; text-align: center; text-decoration: none;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.suntc-legal .suntc-legal__switch a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: #fff; cursor: default; }
.suntc-legal__short { display: none; }

/* ---- Layout: reading column + sticky contents ---- */
/* Contents sit next to the text, not at the far edge: the theme's fixed call/up buttons live at right:30px. */
.suntc-legal__layout { display: grid; grid-template-columns: minmax(0, 720px) 340px; grid-template-areas: "text aside"; justify-content: start; column-gap: var(--s-7); align-items: start; }
.suntc-legal__text { grid-area: text; min-width: 0; }
.suntc-legal__aside { grid-area: aside; position: sticky; top: var(--head); }

/* ---- Reading text ---- */
.suntc-legal__text { max-width: 720px; font-size: 17px; line-height: 1.7; overflow-wrap: break-word; hyphens: manual; }
.suntc-legal__text p, .suntc-legal__text li { margin: 0 0 var(--s-3); font-size: inherit; line-height: inherit; color: var(--ink); }
.suntc-legal__text > :last-child { margin-bottom: 0; }
.suntc-legal .suntc-legal__text h2 {
  margin: var(--s-7) 0 var(--s-4); padding: var(--s-5) 0 0; border-top: 1px solid var(--line);
  font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; scroll-margin-top: var(--head); border-radius: 0 0 var(--r-ctl) var(--r-ctl);
}
.suntc-legal .suntc-legal__text > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* Headings take focus only programmatically (contents link, #hash): the soft highlight marks them, not a ring. */
.suntc-legal .suntc-legal__text h2[tabindex="-1"]:is(:focus, :focus-visible) { outline: none; }
/* Numbered clause: the number hangs in its own column, the text keeps one left edge. */
.suntc-legal__text .suntc-legal__clause { padding-left: 3.4em; }
.suntc-legal__num { display: inline-block; width: 3.4em; margin-left: -3.4em; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.suntc-legal__list, .suntc-legal__text ul, .suntc-legal__text ol { margin: calc(-1 * var(--s-1)) 0 var(--s-4) 3.4em; padding: 0; list-style: none; }
.suntc-legal__list li, .suntc-legal__text ul li { position: relative; margin: 0 0 var(--s-2); padding-left: 1.25em; }
.suntc-legal__list li::before, .suntc-legal__text ul li::before { content: "–"; position: absolute; left: 0; color: var(--ink-2); }
.suntc-legal__text .suntc-legal__requisites {
  margin: 0 0 var(--s-4); padding: var(--s-4) var(--s-5); border-left: 4px solid var(--gold); border-radius: 0 var(--r-card) var(--r-card) 0;
  background: var(--surface); font-size: 16px; line-height: 1.6; font-variant-numeric: tabular-nums;
}

/* ---- Contents ---- */
.suntc-legal__toc { position: relative; border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.suntc-legal__toc::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--gold); }
.suntc-legal__toc summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 52px; padding: var(--s-4) var(--s-5) var(--s-2);
  font-size: 19px; font-weight: 700; line-height: 1.25; list-style: none; cursor: pointer;
}
.suntc-legal__toc summary::-webkit-details-marker { display: none; }
.suntc-legal__toc summary svg { flex: none; color: var(--ink-2); transition: transform var(--t-fast); }
.suntc-legal__toc[open] summary svg { transform: rotate(180deg); }
.suntc-legal__toc ol { max-height: calc(100vh - var(--head) - 96px); margin: 0; padding: 0 var(--s-3) var(--s-6); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; list-style: none; }
.suntc-legal__toc li { margin: 0; }
/* A long list scrolls inside the card: a soft fade says «there is more» instead of a hard cut. */
.suntc-legal__toc[open]::after { content: ""; position: absolute; inset: auto 0 0; height: 32px; border-radius: 0 0 var(--r-card) var(--r-card); background: linear-gradient(#f6f6f200, var(--surface)); pointer-events: none; }
.suntc-legal .suntc-legal__toc a {
  display: block; padding: 6px var(--s-3) 6px 14px; border-left: 2px solid transparent; border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  color: var(--ink-2); font-size: 15px; line-height: 1.4; text-decoration: none;
}
.suntc-legal .suntc-legal__toc a.is-current { border-left-color: var(--ink); background: #fff; color: var(--ink); font-weight: 600; }

/* ---- Back to top ---- */
.suntc-legal__top {
  position: fixed; right: 30px; bottom: 40px; z-index: 3; display: grid; place-items: center; width: 50px; height: 50px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; color: var(--ink); cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.suntc-legal__top[hidden] { display: none; }
/* The theme's own scroll-up control is a non-focusable div; this page has a real button instead. */
body:has(#content.suntc-legal) .f-share .scrollup { display: none; }

/* ---- Hover: only with a real pointer ---- */
@media (hover: hover) {
  .suntc-legal a:hover { text-decoration-color: currentColor; }
  .suntc-legal .suntc-legal__crumbs a:hover { color: var(--ink); text-decoration: underline; }
  .suntc-legal .suntc-legal__switch a:not([aria-current]):hover { border-color: var(--ink); background: var(--surface); }
  .suntc-legal .suntc-legal__toc a:not(.is-current):hover { background: var(--surface-2); color: var(--ink); text-decoration: underline; text-decoration-color: var(--control); }
  .suntc-legal__print:hover, .suntc-legal__top:hover { border-color: var(--ink); background: var(--surface); }
  .suntc-legal__toc summary:hover svg { color: var(--ink); }
}

/* ---- Motion: only when the visitor has not asked to reduce it ---- */
@media (prefers-reduced-motion: no-preference) {
  html:has(#content.suntc-legal) { scroll-behavior: smooth; }
  .suntc-legal__head, .suntc-legal__layout { animation: suntc-legal-in 360ms cubic-bezier(.2, .7, .2, 1) both; }
  .suntc-legal__layout { animation-delay: 60ms; }
  @keyframes suntc-legal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .suntc-legal .suntc-legal__toc a { transition: background-color var(--t-fast), color var(--t-fast); }
  .suntc-legal .suntc-legal__text h2.is-target, .suntc-legal .suntc-legal__text h2:target { animation: suntc-legal-target 1.6s ease-out; }
  @keyframes suntc-legal-target { 0%, 35% { background-color: var(--attention); box-shadow: -12px 0 0 var(--attention), 12px 0 0 var(--attention); } 100% { background-color: transparent; box-shadow: -12px 0 0 transparent, 12px 0 0 transparent; } }
  .suntc-legal__top:not([hidden]) { animation: suntc-legal-fade 200ms ease-out both; }
  @keyframes suntc-legal-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .suntc-legal .suntc-legal__text h2.is-target { background-color: var(--attention); box-shadow: -12px 0 0 var(--attention), 12px 0 0 var(--attention); }
}

/* ---- Up to 1100px: one column, contents fold above the text ---- */
@media (max-width: 1199px) {
  .suntc-legal__layout { display: block; }
  .suntc-legal__switch ul { max-width: 720px; }
  .suntc-legal__aside { position: static; max-width: 720px; margin: 0 0 var(--s-6); }
  .suntc-legal__toc summary { padding: var(--s-4) var(--s-5) var(--s-3); font-size: 17px; }
  .suntc-legal__toc ol { max-height: none; overflow: visible; }
  .suntc-legal .suntc-legal__toc a { display: flex; align-items: center; min-height: 44px; padding-block: 10px; }
  .suntc-legal__print { min-height: 44px; }
}
@media (max-width: 1101px) {
  #content.suntc-legal { --head: 88px; padding: var(--s-6) 25px 80px; }
}
@media (max-width: 768px) {
  .suntc-legal__switch ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-1); max-width: 720px; }
  .suntc-legal .suntc-legal__switch a { width: 100%; padding: 8px 6px; font-size: 14px; }
  .suntc-legal__full { display: none; }
  .suntc-legal__short { display: inline; }
  #content.suntc-legal { padding: var(--s-6) 15px 72px; }
  .suntc-legal__head { margin-bottom: var(--s-5); }
  .suntc-legal .suntc-legal__crumbs { margin-bottom: var(--s-3); }
  .suntc-legal__text { font-size: 16px; line-height: 1.65; }
  .suntc-legal .suntc-legal__text h2 { margin-top: var(--s-6); padding-top: var(--s-4); font-size: 21px; }
  .suntc-legal__text .suntc-legal__requisites { padding: var(--s-3) var(--s-4); font-size: 15px; }
  .suntc-legal__top { right: 15px; bottom: 24px; }
  .suntc-legal__text { padding-bottom: var(--s-7); }
}
@media (max-width: 600px) {
  .suntc-legal__crumbs > span:not([aria-hidden]) { display: none; }
  .suntc-legal__crumbs > span[aria-hidden] { display: none; }
  /* Narrow screens: numbers stay inline so the text keeps its width. */
  .suntc-legal__text .suntc-legal__clause { padding-left: 0; }
  .suntc-legal__num { width: auto; margin: 0 .3em 0 0; color: var(--ink); }
  .suntc-legal__list, .suntc-legal__text ul, .suntc-legal__text ol { margin-left: 0; }
}

/* ---- Print: the document only, black on white ---- */
@media print {
  @page { margin: 18mm 16mm; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  header:not(.suntc-legal__head), footer, .f-share, #suntc-cookie, .suntc-legal__crumbs, .suntc-legal__meta, .suntc-legal__switch, .suntc-legal__aside, .suntc-legal__top { display: none !important; }
  #content.suntc-legal { max-width: none; padding: 0; color: #000; }
  .suntc-legal__head, .suntc-legal__layout { animation: none !important; }
  .suntc-legal__layout { display: block; }
  #content.suntc-legal .suntc-legal__head h1 { margin-bottom: 8mm !important; font-size: 20pt; }
  .suntc-legal__text { max-width: none; font-size: 11pt; line-height: 1.5; }
  .suntc-legal .suntc-legal__text h2 { margin: 6mm 0 2mm; padding: 0; border: 0; font-size: 13pt; break-after: avoid; page-break-after: avoid; }
  .suntc-legal__text p, .suntc-legal__text li { orphans: 3; widows: 3; }
  .suntc-legal__text .suntc-legal__requisites { padding: 0; border: 0; border-radius: 0; background: none; font-size: inherit; line-height: inherit; break-inside: avoid; }
  .suntc-legal a { color: #000; text-decoration: none; }
}

/* 23.11: the document spans the same width as the header — switch across the whole row, contents pinned to the right edge,
   the text takes the rest (lines stay readable: up to ~110 characters). */
@media (min-width: 1200px) {
  .suntc-legal__switch ul { max-width: none; }
  .suntc-legal__layout { grid-template-columns: minmax(0, 1fr) 360px; justify-content: stretch; column-gap: clamp(48px, 5vw, 96px); }
  .suntc-legal__text { max-width: 1000px; }
}
@media (min-width: 769px) and (max-width: 1199px) {
  .suntc-legal__switch ul, .suntc-legal__aside { max-width: none; }
  .suntc-legal__text { max-width: 1000px; }
}
@media (min-width: 1600px) {
  .suntc-legal__text { max-width: none; font-size: 18px; }
}

/* 23.11: print only the document. Instead of listing what to hide (the footer, its mobile <details>, chat widgets keep appearing),
   everything that is neither the document nor contains it is hidden. */
@media print {
  body *:not(:has(.suntc-legal)):not(.suntc-legal):not(.suntc-legal *) { display: none !important; }
  body :has(> .suntc-legal), body :has(.suntc-legal) { margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; max-width: none !important; width: auto !important; }
  .suntc-legal__head { margin: 0 !important; }
}
