/* PUHLIVE: спільні стилі статичних сторінок. Нейтральна сіра палітра — токени збігаються з app.css головної */
:root {
  --bg: #eef0f3;
  --glass: #ffffff;
  --glass-2: #f6f7f9;
  --glass-3: #ffffff;
  --glass-line: rgba(17, 17, 17, 0.08);
  --line: rgba(17, 17, 17, 0.08);
  --line-2: rgba(17, 17, 17, 0.14);
  --txt: #141414;
  --mut: #6b6f76;
  --dim: #9a9ea6;
  --ink: #141414;
  --ink-txt: #ffffff;
  --hover: rgba(17, 17, 17, 0.05);
  --shadow: none;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.04);
  --acc: #141414;
  --acc-soft: rgba(17, 17, 17, 0.07);
  --ok: #1f9d63;
  --ok-soft: #dff5e8;
  --warn: #b7791f;
  --warn-soft: #fbeccc;
  --bad: #d64545;
  --bad-soft: #fbe0e0;
  --vio: #6b6f76;
  --vio-soft: rgba(17, 17, 17, 0.07);
  --gray-soft: rgba(17, 17, 17, 0.06);
  --head: #ffffff;
  --mark: #fbeccc;
  --mark-txt: #3a2a00;
  /* Три радіуси на весь сайт */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --gap: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Шрифти: Golos Text (заголовки) + Onest (текст), локально зі static/vendor/fonts.css; запасні — Manrope, системний */
  --font-logo: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --font-head: 'Golos Text', 'Manrope', system-ui, sans-serif;
  --font-body: 'Onest', 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #111111;
  --glass: #181818;
  --glass-2: #1f1f1f;
  --glass-3: #222222;
  --glass-line: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --txt: #f2f2f2;
  --mut: #a3a6ad;
  --dim: #6f737a;
  --ink: #f2f2f2;
  --ink-txt: #111111;
  --hover: rgba(255, 255, 255, 0.06);
  --shadow: none;
  --shadow-sm: none;
  --acc: #f2f2f2;
  --acc-soft: rgba(255, 255, 255, 0.08);
  --ok: #4cc38a;
  --ok-soft: rgba(76, 195, 138, 0.16);
  --warn: #e0b35a;
  --warn-soft: rgba(224, 179, 90, 0.16);
  --bad: #ef6b6b;
  --bad-soft: rgba(239, 107, 107, 0.16);
  --vio: #a3a6ad;
  --vio-soft: rgba(255, 255, 255, 0.08);
  --gray-soft: rgba(255, 255, 255, 0.07);
  --head: #181818;
  --mark: #e0b35a;
  --mark-txt: #1a1200;
  color-scheme: dark;
}

/* ===================== База ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  min-height: 100vh; color: var(--txt); font-family: var(--font-body); font-size: 16px; line-height: 1.65;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  transition: background-color .4s var(--ease), color .3s;
  display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: var(--font-head); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--txt); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--dim); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-color: currentColor; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--ink-txt); padding: 8px 16px; border-radius: 999px; }
.skip:focus { left: 16px; }

/* ===================== Шапка ===================== */
.top { position: sticky; top: 0; z-index: 50; padding-top: 16px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: var(--head);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--txt); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; flex: none; border-radius: 50%; }
.brand span { min-width: 0; }
.brand b { display: block; font-family: var(--font-logo, var(--font-head)); font-size: 16px; font-weight: 500; letter-spacing: .06em; line-height: 1.15; white-space: nowrap; }
.brand small { display: block; font-size: 12px; font-weight: 600; color: var(--mut); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tright { display: flex; align-items: center; gap: 8px; flex: none; }
.back {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--ink); color: var(--ink-txt); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), opacity .2s;
}
.back:hover { opacity: .9; text-decoration: none; }
.back:active { transform: scale(.96); }
.back svg { width: 18px; height: 18px; }
.themes { display: flex; gap: 4px; height: 40px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass); }
.themes button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--mut); transition: background .25s, color .25s; }
.themes button svg { width: 18px; height: 18px; }
.themes button:hover { color: var(--txt); }
.themes button.on { background: var(--ink); color: var(--ink-txt); }

/* ===================== Картка з текстом ===================== */
main { flex: 1; padding: 24px 0 8px; }
.doc { padding: 48px; animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.kicker { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--acc);
  background: var(--acc-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.doc h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.12; font-weight: 600; letter-spacing: -.025em; margin-bottom: 16px; overflow-wrap: break-word; }
.lead { font-size: 18px; color: var(--mut); max-width: 64ch; }
.meta { margin-top: 16px; font-size: 14px; color: var(--mut); }
.doc h2 { font-size: 22px; line-height: 1.25; font-weight: 500; letter-spacing: -.015em; margin: 40px 0 8px; scroll-margin-top: 96px; }
.doc h3 { font-size: 17px; font-weight: 500; margin: 24px 0 8px; }
.doc p, .doc ul, .doc ol { max-width: 68ch; }
.doc p + p { margin-top: 16px; }
.doc ul, .doc ol { padding-left: 24px; margin: 8px 0; }
.doc li { margin: 8px 0; }
.doc li::marker { color: var(--acc); }
.doc code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; background: var(--gray-soft); padding: 1px 8px; border-radius: 8px; overflow-wrap: anywhere; }
.doc strong { font-weight: 500; }
.muted { color: var(--mut); }
.calc { display: inline-block; font-size: 12px; font-weight: 500; color: var(--mut); background: var(--gray-soft); padding: 0 8px; border-radius: 999px; line-height: 1.6; }

/* Зміст */
.toc { margin-top: 24px; padding: 16px 24px; border-radius: var(--r-md); background: var(--gray-soft); }
.toc b { display: block; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin-bottom: 8px; }
.doc .toc ol { margin: 0; padding-left: 24px; columns: 2; column-gap: 32px; max-width: none; }
.doc .toc li { margin: 4px 0; break-inside: avoid; }
.toc a { color: var(--txt); text-decoration: none; font-weight: 600; }
.toc a:hover { color: var(--acc); }

/* Плашки */
.note { margin: 16px 0; padding: 16px 24px; border-radius: var(--r-md); background: var(--acc-soft); border: 1px solid var(--line); }
.note.ok { background: var(--ok-soft); }
.warn { margin: 32px 0; padding: 24px; border-radius: var(--r-md); background: var(--bad-soft); border: 1px solid var(--bad);
  display: flex; gap: 16px; align-items: flex-start; }
.warn > svg { width: 28px; height: 28px; color: var(--bad); margin-top: 2px; }
.doc .warn h2 { margin: 0 0 8px; color: var(--bad); }
mark.ph { background: var(--mark); color: var(--mark-txt); font-weight: 500; padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

.doc .links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.doc .links li { margin: 0; }
.links a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--glass-2);
  border: 1px solid var(--line-2); color: var(--txt); font-weight: 500; text-decoration: none; transition: background .25s, transform .2s var(--ease); }
.links a:hover { background: var(--glass-3); }
.links a:active { transform: scale(.97); }
.links small { color: var(--mut); font-weight: 600; }

/* Таблиця: на вузькому екрані гортається лише всередині рамки */
.tbl { margin: 16px 0; overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--line-2); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; min-width: 660px; }
th, td { text-align: left; vertical-align: top; padding: 8px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); background: var(--gray-soft); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.scroll-hint { display: none; font-size: 13px; color: var(--mut); }

/* ===================== Футер ===================== */
/* Підвал — як на головній: картка в стилі шапки */
.foot { padding: 16px 16px 32px; }
.foot-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 28px; background: var(--glass); border: 1px solid var(--glass-line); }
/* посилання — точно по центру картки, соцмережі — праворуч (ліва колонка — порожня противага) */
.foot-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.foot-top::before { content: ""; }
.flinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; }
.flinks a { color: var(--mut); font-weight: 500; font-size: 13px; padding: 6px 12px; border-radius: 999px; text-decoration: none; transition: background .25s, color .25s; }
.flinks a:hover { color: var(--txt); background: var(--hover); }
.flinks a[aria-current="page"] { background: var(--ink); color: var(--ink-txt); }
.fsoc { display: flex; gap: 6px; justify-content: flex-end; }
.fsoc .cbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--glass); color: var(--txt); transition: background .25s; }
.fsoc .cbtn:hover { background: var(--hover); }
.fsoc svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fnote { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; font-weight: 400; line-height: 1.5; text-align: center; }
.fnote a { color: var(--mut); font-weight: 500; text-decoration: none; }

/* ===================== Планшет ===================== */
@media (max-width: 700px) {
  .doc { padding: 32px 24px; }
  .lead { font-size: 16.5px; }
  .doc .toc ol { columns: 1; }
  .scroll-hint { display: block; }
}
/* ===================== Телефон ===================== */
@media (max-width: 560px) {
  .top { padding-top: 8px; }
  .topbar { padding: 6px 6px 6px 8px; gap: 8px; }
  .brand small { display: none; }
  .tright { gap: 8px; }
  .back .t { display: none; }
  .back { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .themes { height: 36px; }
  .themes button { width: 28px; height: 28px; }
  main { padding-top: 16px; }
  .doc { padding: 24px 16px; border-radius: var(--r-md); }
  .doc h1 { font-size: 28px; }
  .doc h2 { font-size: 22px; margin-top: 32px; }
  .toc, .note { padding: 16px; }
  .warn { flex-direction: column; gap: 8px; padding: 16px; }
  .foot-card { padding: 14px; border-radius: 24px; }
  .foot-top { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .foot-top::before { display: none; }
  .flinks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .flinks a { text-align: center; background: var(--gray-soft); padding: 9px 8px; font-size: 12.5px; }
  .fsoc { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
