/* «Цифровий підпис» — digitalsignature.stalkersoft.com
   One stylesheet for every page. No scripts, web fonts or external resources.
   Mobile first; light and dark follow the system setting. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --text: #1b1d22;
  --muted: #545a65;
  --line: #dce0e8;
  --accent: #315cd4;
  --link: #2b51bf;
  --note-bg: #eef2fd;
  --warn-bg: #fff4df;
  --warn-line: #a35f00;
  --code-bg: #eff1f5;
  --test-bg: #ffe18a;
  --test-text: #392800;
  --radius: 0.75rem;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --bg-soft: #191c22;
    --text: #e7e9ee;
    --muted: #a9afba;
    --line: #2f343d;
    --accent: #8ea7f2;
    --link: #a5baf7;
    --note-bg: #182036;
    --warn-bg: #2a2214;
    --warn-line: #e3a845;
    --code-bg: #1e2128;
    --test-bg: #ffd666;
    --test-text: #291b00;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1rem; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -100vw; top: 0; }
.skip:focus { left: 1rem; top: 0.5rem; z-index: 1; padding: 0.5rem 0.75rem; background: var(--bg); color: var(--text); }

/* Header */
header.site { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.5rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem;
  color: var(--text); font-weight: 700; font-size: 1.125rem; text-decoration: none;
}
.brand::before {
  content: ""; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 0.45rem;
  background: linear-gradient(135deg, var(--accent), #1f3f9e);
}
.lang { display: inline-flex; align-items: center; min-height: 2.75rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; padding-bottom: 0.25rem; }
.site-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--text); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; }

/* Content */
main { padding-top: 1.5rem; padding-bottom: 3rem; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.875rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.375rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol, dl, pre, .table-wrap { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: 0.4rem; }
.lead { font-size: 1.125rem; color: var(--muted); }
.meta { font-size: 0.9375rem; color: var(--muted); }

.promise, .note, .warn { margin: 0 0 1.25rem; padding: 1rem 1.125rem; border-radius: var(--radius); }
.promise, .note { background: var(--note-bg); border-left: 4px solid var(--accent); }
.warn { background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
.promise > :last-child, .note > :last-child, .warn > :last-child { margin-bottom: 0; }
.promise strong { font-size: 1.0625rem; }

.toc { margin: 0 0 1.5rem; padding: 0.875rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.toc h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.toc ol { margin: 0; }
.toc li + li { margin-top: 0.15rem; }

dl.facts { display: grid; grid-template-columns: 1fr; gap: 0.15rem 1rem; padding: 0.875rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
dl.facts dt { margin-top: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
dl.facts dt:first-child { margin-top: 0; }
dl.facts dd { margin: 0; }

ol.steps > li { padding-left: 0.25rem; }
ol.steps > li + li { margin-top: 0.75rem; }

code, kbd, pre { font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
code { padding: 0.1em 0.3em; border-radius: 0.3em; background: var(--code-bg); }
pre { padding: 0.875rem 1rem; border-radius: 0.5rem; background: var(--code-bg); line-height: 1.45; overflow-x: auto; }
pre code { padding: 0; background: none; }
.fp { overflow-wrap: anywhere; word-break: break-all; }

.badge-test {
  display: inline-block; padding: 0.05rem 0.45rem; border-radius: 0.35rem;
  background: var(--test-bg); color: var(--test-text);
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { border-bottom-width: 2px; }

ul.links { padding-left: 0; list-style: none; }
ul.links li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
ul.links li + li { margin-top: 0; }
ul.links a { font-weight: 600; }

/* Footer */
footer.site { padding: 1.25rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; }
footer.site p { margin: 0 0 0.5rem; }

@media (min-width: 40rem) {
  body { font-size: 1.0625rem; }
  .wrap { padding: 0 1.5rem; }
  h1 { font-size: 2.25rem; }
  dl.facts { grid-template-columns: minmax(8rem, 11rem) 1fr; row-gap: 0.6rem; }
  dl.facts dt { margin-top: 0; }
}

@media print {
  .skip, .lang, .site-nav { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
