/* Legal documents: terms and privacy */
.lg-body {
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(41, 98, 255, 0.2), transparent 70%),
    radial-gradient(60% 40% at 100% 10%, rgba(188, 19, 254, 0.1), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.lg-body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(0, 243, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 243, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(80% 50% at 50% 0%, #000 0%, transparent 75%); mask-image: radial-gradient(80% 50% at 50% 0%, #000 0%, transparent 75%);
}

/* Header */
.lg-header { background: rgba(4, 5, 16, 0.6); -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); }
.lg-header .brand-word { display: inline; }
.lg-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; min-width: 0; }
.lg-back {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 12px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--ink-2); font-size: 0.9rem; font-weight: 500; white-space: nowrap;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.lg-back svg { width: 14px; height: 14px; flex: none; transition: translate 0.35s var(--ease); }
.lg-back:hover { color: #fff; border-color: var(--line-c); background: rgba(0, 243, 255, 0.07); }
.lg-back:hover svg { translate: -3px 0; }
[dir="rtl"] .lg-back:hover svg { translate: 3px 0; }
.lg-progress { position: fixed; inset: 0 0 auto 0; z-index: 1001; height: 2px; pointer-events: none; }
.lg-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple)); box-shadow: 0 0 10px rgba(0, 243, 255, 0.6); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
[dir="rtl"] .lg-progress span { transform-origin: 100% 50%; }

/* Hero */
.lg-main { position: relative; display: block; padding-top: calc(var(--header-h) + clamp(36px, 6vw, 72px)); padding-bottom: clamp(48px, 7vw, 96px); }
.lg-main:focus { outline: none; }
.lg-main > .container { max-width: 1120px; }
.lg-hero { max-width: 860px; padding-bottom: clamp(28px, 4vw, 44px); margin-bottom: clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.lg-title {
  margin-top: 18px; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  font-size: clamp(1.7rem, 4.6vw, 3.1rem); line-height: 1.1; overflow-wrap: anywhere;
  background: linear-gradient(180deg, #fff 0%, #b9c7e6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-block: 0.04em 0.18em;
}
[lang="he"] .lg-title, [lang="ru"] .lg-title { font-family: var(--font-body); font-weight: 700; text-transform: none; letter-spacing: -0.01em; font-size: clamp(1.9rem, 5vw, 3.2rem); }
.lg-lead { margin-top: 14px; max-width: 62ch; color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.14rem); line-height: 1.65; text-wrap: pretty; }
.lg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.lg-updated { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--line-c); background: rgba(0, 243, 255, 0.06); color: #bdfbff; font-size: 0.86rem; }
.lg-updated time { color: #fff; font-weight: 600; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.lg-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding-inline: 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--ink-2); font-size: 0.86rem; font-weight: 500; cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.lg-chip svg { width: 15px; height: 15px; flex: none; }
.lg-chip:hover { color: #fff; border-color: var(--line-c); background: rgba(0, 243, 255, 0.07); }

/* Layout */
.lg-layout { display: grid; grid-template-columns: 1fr; gap: 28px; }
.lg-doc { min-width: 0; max-width: 72ch; }
@media (min-width: 1024px) {
  .lg-layout { grid-template-columns: 264px minmax(0, 72ch); gap: clamp(40px, 5vw, 72px); }
  .lg-aside { position: relative; }
  .lg-toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .lg-toc summary { pointer-events: none; }
  .lg-toc .lg-caret { display: none; }
}

/* Table of contents */
.lg-toc { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.lg-toc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 18px; cursor: pointer; list-style: none;
  color: var(--cyan); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
}
[lang="he"] .lg-toc summary, [lang="ru"] .lg-toc summary { font-family: var(--font-body); font-size: 0.86rem; letter-spacing: 0.04em; }
.lg-toc summary::-webkit-details-marker { display: none; }
.lg-toc summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; border-radius: var(--r-lg); }
.lg-caret { width: 12px; height: 12px; transition: transform 0.35s var(--ease); }
.lg-toc[open] .lg-caret { transform: rotate(180deg); }
.lg-toc-list { list-style: none; margin: 0; padding: 0 8px 10px; counter-reset: none; }
.lg-toc-a {
  position: relative; display: flex; align-items: baseline; gap: 10px; min-height: 40px; padding: 9px 12px; border-radius: 10px;
  color: var(--mute); font-size: 0.9rem; line-height: 1.35; transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.lg-toc-a::before { content: ""; position: absolute; inset-block: 9px; inset-inline-start: 0; width: 2px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); opacity: 0; transform: scaleY(0.4); transition: opacity 0.25s var(--ease), transform 0.35s var(--ease); }
.lg-toc-n { flex: none; min-width: 2ch; color: var(--ink-3, #8c97ad); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; transition: color 0.2s var(--ease); }
.lg-toc-a:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.lg-toc-a[aria-current="true"] { color: #fff; background: linear-gradient(90deg, rgba(0, 243, 255, 0.12), rgba(188, 19, 254, 0.05) 80%, transparent); }
[dir="rtl"] .lg-toc-a[aria-current="true"] { background: linear-gradient(270deg, rgba(0, 243, 255, 0.12), rgba(188, 19, 254, 0.05) 80%, transparent); }
.lg-toc-a[aria-current="true"]::before { opacity: 1; transform: none; }
.lg-toc-a[aria-current="true"] .lg-toc-n { color: var(--cyan); }
.lg-toc-a:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }

/* Document */
.lg-doc { color: var(--ink-2); font-size: 1.02rem; line-height: 1.75; }
.lg-sec { padding-block: 8px 34px; }
.lg-sec + .lg-sec { padding-top: 34px; border-top: 1px solid var(--line); }
.lg-sec h2 { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; color: #fff; font-size: clamp(1.18rem, 2.2vw, 1.42rem); font-weight: 650; line-height: 1.3; letter-spacing: -0.005em; text-wrap: balance; }
.lg-num {
  flex: none; display: inline-grid; place-items: center; min-width: 42px; height: 30px; padding-inline: 8px; border-radius: 9px;
  border: 1px solid var(--line-c); background: linear-gradient(180deg, rgba(0, 243, 255, 0.14), rgba(0, 243, 255, 0.03));
  color: var(--cyan); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px -6px rgba(0, 243, 255, 0.6);
}
.lg-doc p, .lg-doc li { max-width: 58ch; text-wrap: pretty; }
.lg-doc p + p, .lg-doc ul + p, .lg-doc p + ul, .lg-doc .lg-table-wrap + p, .lg-doc p + .lg-table-wrap { margin-top: 14px; }
.lg-doc strong { color: #fff; font-weight: 600; }
.lg-doc a:not(.lg-chip) { color: #8ff8ff; text-decoration: underline; text-decoration-color: rgba(0, 243, 255, 0.4); text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: color 0.2s, text-decoration-color 0.2s; }
.lg-doc a:not(.lg-chip):hover { color: #fff; text-decoration-color: var(--cyan); }
.lg-doc code { padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); color: #bdfbff; font-family: var(--font-mono); font-size: 0.86em; white-space: nowrap; }
.lg-doc ul:not(.lg-contact) { display: grid; gap: 10px; padding: 0; list-style: none; }
.lg-doc ul:not(.lg-contact) > li { position: relative; padding-inline-start: 26px; }
.lg-doc ul:not(.lg-contact) > li::before { content: ""; position: absolute; top: 0.62em; inset-inline-start: 4px; width: 8px; height: 8px; border-radius: 2px; background: linear-gradient(135deg, var(--cyan), var(--purple)); box-shadow: 0 0 10px rgba(0, 243, 255, 0.5); transform: rotate(45deg); }
[lang="ru"] .lg-doc p, [lang="ru"] .lg-doc li { hyphens: auto; -webkit-hyphens: auto; }

/* Summary note */
.lg-note { position: relative; margin-bottom: 34px; padding: 22px 24px; border-radius: var(--r-lg); border: 1px solid var(--line-c); background: linear-gradient(160deg, rgba(0, 243, 255, 0.09), rgba(41, 98, 255, 0.05) 60%, rgba(188, 19, 254, 0.06)); overflow: hidden; }
.lg-note::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent); }
.lg-note-h { margin-bottom: 12px; color: var(--cyan); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
[lang="he"] .lg-note-h, [lang="ru"] .lg-note-h { font-family: var(--font-body); font-size: 0.9rem; letter-spacing: 0.03em; }
.lg-note ul { gap: 8px !important; }
.lg-note li { color: var(--ink); font-size: 0.98rem; }

/* Table */
.lg-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.02); }
.lg-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.lg-table th, .lg-table td { padding: 12px 14px; text-align: start; vertical-align: top; }
.lg-table th { color: var(--cyan); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; background: rgba(0, 243, 255, 0.05); border-bottom: 1px solid var(--line-c); }
[lang="he"] .lg-table th, [lang="ru"] .lg-table th { font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 0.02em; }
.lg-table tbody tr + tr td { border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .lg-table, .lg-table tbody, .lg-table tr, .lg-table td { display: block; }
  .lg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .lg-table tr { padding: 12px 14px; }
  .lg-table tbody tr + tr { border-top: 1px solid var(--line); }
  .lg-table tbody tr + tr td { border-top: 0; }
  .lg-table td { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; padding: 4px 0; }
  .lg-table td::before { content: attr(data-th); color: var(--ink-3, #8c97ad); font-size: 0.78rem; }
  .lg-table td > code { justify-self: start; }
}

/* Contact list */
.lg-contact { display: grid; gap: 8px; margin-top: 16px; padding: 0; list-style: none; }
.lg-contact li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 52px; padding: 10px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.lg-contact-k { min-width: 6.5em; color: var(--ink-3, #8c97ad); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
[lang="he"] .lg-contact-k, [lang="ru"] .lg-contact-k { font-family: var(--font-body); font-size: 0.84rem; letter-spacing: 0.02em; }
.lg-contact a, .lg-contact span:not(.lg-contact-k) { color: #fff; font-weight: 600; }
.lg-doc .lg-contact a { text-decoration: none; }
.lg-doc .lg-contact a:hover { color: var(--cyan); }

/* Floating back to top */
.lg-fab {
  position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); inset-inline-start: max(18px, env(safe-area-inset-left)); z-index: 900;
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line-c);
  background: rgba(6, 10, 26, 0.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--cyan);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7), 0 0 20px -6px rgba(0, 243, 255, 0.4);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease), visibility 0s linear 0.4s, background-color 0.25s;
}
.lg-fab svg { width: 20px; height: 20px; transition: transform 0.35s var(--ease); }
.lg-fab.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.lg-fab:hover { background: rgba(0, 243, 255, 0.14); }
.lg-fab:hover svg { transform: translateY(-3px); }

@media (max-width: 640px) {
  .lg-back { padding-inline: 12px; }
  .lg-back-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lg-sec h2 { gap: 12px; }
  .lg-num { min-width: 38px; height: 28px; }
  .lg-note { padding: 18px; }
  .lg-doc { font-size: 1rem; line-height: 1.72; }
}
@media (max-width: 420px) {
  .lg-header .lang-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lg-header .lang-btn { padding-inline: 8px 12px; gap: 8px; }
}
@media (max-width: 360px) {
  .lg-header .brand-word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-fab, .lg-toc-a::before, .lg-caret { transition: none; }
}

/* Print */
@media print {
  @page { margin: 18mm 16mm; }
  html, body, .lg-body { background: #fff !important; color: #111 !important; }
  .lg-body::before, .lg-progress, .site-header, .skip-link, .lg-aside, .lg-fab, .lg-chip, .site-footer, [id^="enable"], [class*="enable-"] { display: none !important; }
  .lg-main { padding: 0 !important; }
  .container { max-width: none; padding: 0; }
  .lg-hero { border-color: #ccc; margin-bottom: 16px; padding-bottom: 12px; }
  .lg-hero .eyebrow { border: 0; padding: 0; background: none; color: #555; }
  .lg-hero .eyebrow::before { display: none; }
  .lg-title { background: none !important; -webkit-text-fill-color: #000; color: #000 !important; font-size: 24pt; }
  .lg-lead, .lg-doc, .lg-doc p, .lg-doc li { color: #222 !important; }
  .lg-updated { border: 0; padding: 0; background: none; color: #444; }
  .lg-updated time { color: #000; }
  .lg-dot { display: none; }
  .lg-layout { display: block; }
  .lg-doc { max-width: none; font-size: 11pt; line-height: 1.55; }
  .lg-sec { padding-block: 10px !important; border-color: #ddd !important; break-inside: auto; }
  .lg-sec h2 { color: #000; font-size: 13pt; break-after: avoid; }
  .lg-num { border-color: #999; background: none; color: #000; box-shadow: none; }
  .lg-doc strong, .lg-contact a, .lg-contact span:not(.lg-contact-k) { color: #000 !important; }
  .lg-doc a:not(.lg-chip) { color: #000 !important; text-decoration: underline; }
  .lg-doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  .lg-doc ul:not(.lg-contact) > li::before { background: #000; box-shadow: none; }
  .lg-note { border-color: #bbb; background: none; break-inside: avoid; }
  .lg-note::before { display: none; }
  .lg-note-h, .lg-table th { color: #000; background: none; }
  .lg-note li { color: #222; }
  .lg-table-wrap, .lg-contact li { border-color: #ccc; background: none; }
  .lg-table th { border-color: #999; }
  .lg-table td { border-color: #ddd !important; }
  .lg-doc code { border-color: #bbb; background: none; color: #000; }
  .lg-contact-k { color: #555; }
}
