/* Условия подписки и политика конфиденциальности (terms.html, privacy.html).
   Палитра — та же, что у сайта (style.css); на странице все четыре языка, legal.js оставляет видимым один. */
:root {
  color-scheme: light;
  --page: #eceeeb;
  --surface: #fbfcfa;
  --surface-2: #eff1ee;
  --ink: #0f1e2b;
  --ink-2: #3e4b57;
  --muted: #5c6873;
  --axis: #c2c9cc;
  --border: rgba(15, 30, 43, 0.11);
  --series: #0072ce;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b1016;
    --surface: #121921;
    --surface-2: #1a232c;
    --ink: #e8edf1;
    --ink-2: #b8c2ca;
    --muted: #8a96a1;
    --axis: #36434e;
    --border: rgba(232, 237, 241, 0.1);
    --series: #3d9bf0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1016;
  --surface: #121921;
  --surface-2: #1a232c;
  --ink: #e8edf1;
  --ink-2: #b8c2ca;
  --muted: #8a96a1;
  --axis: #36434e;
  --border: rgba(232, 237, 241, 0.1);
  --series: #3d9bf0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 16px/1.6 "Onest", "Onest Fallback", "Onest Fallback R", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--axis); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; border-radius: 4px; }

.shell {
  width: min(760px, 100%); margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
}

/* Шапка: назад на главную и выбор языка */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0; }
.home { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-weight: 600; text-decoration: none; }
.home-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: var(--page); }
.lang-switch { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lang-switch a {
  display: grid; place-items: center; min-width: 44px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none;
}
.lang-switch a[aria-current="true"] { border-color: var(--series); color: var(--series); font-weight: 600; }
html:not([data-lang]) .lang-switch { display: none; } /* без скрипта видны все языки сразу — выбирать нечего */

/* Видна только версия на выбранном языке; без скрипта — все по очереди */
html[data-lang] article[lang] { display: none; }
html[data-lang="ru"] article[lang="ru"], html[data-lang="en"] article[lang="en"],
html[data-lang="et"] article[lang="et"], html[data-lang="fi"] article[lang="fi"] { display: block; }

article {
  margin-bottom: 20px; padding: 28px 28px 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
}
h1 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.updated { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.lead { margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); }
h2 { margin: 28px 0 8px; font-size: 19px; font-weight: 600; line-height: 1.3; }
h3 { margin: 18px 0 4px; font-size: 16px; font-weight: 600; }
p, li { color: var(--ink-2); }
p { margin: 0 0 10px; }
ul { margin: 0 0 10px; padding-left: 22px; }
li { margin-bottom: 4px; }
strong { color: var(--ink); font-weight: 600; }
.facts { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.see-also { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 560px) {
  :root { --gutter: 12px; }
  article { padding: 22px 18px 18px; }
  h1 { font-size: 24px; }
}
