/*
 * ZNIMOK V2: public pages (content pages, articles, blog index, legal, auth, 404). Ticket znimok-new-44, owner V2C.
 * Loaded after v2.css and uses its tokens only. Prefix v2p-. Section order is set by the markup; no `order`.
 * Long reading: one text column of about 75 characters, a sticky table of contents on wide screens,
 * tables that scroll sideways inside their own box, no horizontal page scroll from 320 px up.
 */

/* Page frame */
body.v2p { min-height: 100vh; display: flex; flex-direction: column; }
body.v2p > main { flex: 1 0 auto; }
.v2p-main { display: block; }
.v2p-main:has(> .v2p-cta:last-child) + .v2-foot { margin-top: 0; border-top: 1px solid var(--v2-navy-line); }
@media (prefers-reduced-motion: no-preference) {
  html:has(body.v2p) { scroll-behavior: smooth; }
}

/* Header band: breadcrumbs, H1, lead, dates */
.v2p-head { background: var(--v2-surface); border-bottom: 1px solid var(--v2-line); }
/* One reading container for header, body, call to action and related links (narrower than the app shell). */
.v2p-head__in, .v2p-layout, .v2p-blog, .v2p-cta__in, .v2p-related > .v2-wrap { max-width: calc(1080px + 56px); }
.v2p-head__in { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; padding-bottom: 34px; }
.v2p-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; line-height: 1.5; color: var(--v2-muted); }
.v2p-crumbs li { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.v2p-crumbs li + li::before { content: "/"; color: #98A2B3; }
.v2p-crumbs a { color: var(--v2-ink-2); }
.v2p-crumbs [aria-current] { color: var(--v2-muted); overflow-wrap: anywhere; }
.v2p-h1 { margin: 0; max-width: 900px; font-size: clamp(30px, 3.3vw, 44px); line-height: 1.12; font-weight: 600; letter-spacing: -.022em; color: var(--v2-ink); overflow-wrap: break-word; }
.v2p-h1 code { font: 500 .8em/1 var(--v2-mono); }
.v2p-lead { margin: 0; max-width: 760px; font-size: 18px; line-height: 1.6; color: var(--v2-ink-2); }
.v2p-lead a { color: var(--v2-brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.v2p-meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.v2p-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--v2-line); background: var(--v2-surface-2); font: 500 12.5px/1.25 var(--v2-mono); color: var(--v2-ink-2); }
.v2p-chip--plain { font-family: var(--v2-font); font-weight: 600; }

/* Body: optional table of contents + one text column */
.v2p-layout { display: grid; grid-template-columns: minmax(0, 780px); justify-content: start; align-items: start; gap: 16px; padding-top: 28px; padding-bottom: 52px; }
.v2p-aside { min-width: 0; }
.v2p-doc {
  min-width: 0; padding: 4px 44px 40px; background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: var(--v2-r); box-shadow: var(--v2-shadow);
  font-size: 16.5px; line-height: 1.72; color: var(--v2-ink-2); overflow-wrap: break-word;
}
.v2p-sec { padding-top: 30px; scroll-margin-top: 20px; }
.v2p-sec + .v2p-sec { margin-top: 30px; border-top: 1px solid var(--v2-line-2); }
.v2p-doc h2 { margin: 0 0 14px; font-size: 23px; line-height: 1.3; font-weight: 600; letter-spacing: -.012em; color: var(--v2-ink); }
.v2p-doc h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.45; font-weight: 600; color: var(--v2-ink); }
.v2p-doc p { margin: 0 0 14px; }
.v2p-doc p:last-child { margin-bottom: 0; }
.v2p-doc strong { color: var(--v2-ink); font-weight: 600; }
.v2p-doc a { color: var(--v2-brand-ink); text-decoration: underline; text-decoration-color: rgba(10, 100, 200, .35); text-underline-offset: 3px; }
.v2p-doc a:hover { text-decoration-color: currentColor; }
.v2p-doc code, .v2p-lead code { font: 500 .86em/1.4 var(--v2-mono); padding: 1px 5px; border-radius: 5px; background: var(--v2-surface-2); border: 1px solid var(--v2-line); color: var(--v2-ink); overflow-wrap: anywhere; }
.v2p-list { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.v2p-list:last-child { margin-bottom: 0; }
.v2p-list li { position: relative; padding-left: 22px; }
.v2p-list li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 2px; background: var(--v2-brand); }
.v2p-note { margin: 6px 0 14px; padding: 12px 16px; border-left: 3px solid var(--v2-brand); border-radius: 0 var(--v2-r-sm) var(--v2-r-sm) 0; background: var(--v2-brand-soft); font-size: 14.5px; line-height: 1.6; color: var(--v2-ink-2); }

/* Tables: sideways scroll inside their own box; first column stays in view */
.v2p-table { margin: 6px 0 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--v2-line); border-radius: var(--v2-r-sm); background: var(--v2-surface); }
.v2p-table:last-child { margin-bottom: 0; }
.v2p-table table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.5; }
.v2p-table th, .v2p-table td { min-width: 7.5em; padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--v2-line-2); }
.v2p-table table:has(th:nth-child(4)) td:last-child { min-width: 16em; }
.v2p-table thead th { background: var(--v2-surface-2); border-bottom-color: var(--v2-line); font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--v2-muted); vertical-align: bottom; }
.v2p-table tbody th { font-weight: 600; color: var(--v2-ink); }
.v2p-table tbody tr:last-child > * { border-bottom: 0; }
.v2p-table tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--v2-surface); box-shadow: inset -1px 0 0 var(--v2-line-2); }
.v2p-table thead tr > :first-child { background: var(--v2-surface-2); }

/* FAQ and sources */
.v2p-faq__item { padding: 16px 0; border-top: 1px solid var(--v2-line-2); }
.v2p-faq h2 + .v2p-faq__item { border-top: 0; padding-top: 2px; }
.v2p-faq__item:last-child { padding-bottom: 0; }
.v2p-faq__item p { margin: 0; }
.v2p-sources ol { margin: 0; padding: 0; list-style: none; counter-reset: v2p-src; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.55; }
.v2p-sources li { counter-increment: v2p-src; position: relative; padding-left: 34px; }
.v2p-sources li::before { content: counter(v2p-src, decimal-leading-zero); position: absolute; left: 0; top: .15em; font: 500 12px/1.6 var(--v2-mono); color: var(--v2-muted); }
.v2p-sources__host { font: 400 12px/1.4 var(--v2-mono); color: var(--v2-muted); white-space: nowrap; }

/* Table of contents: collapsed box on narrow screens, sticky column on wide ones */
.v2p-toc { background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: var(--v2-r); }
.v2p-toc__sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; font: 600 12px/1.4 var(--v2-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--v2-muted); }
.v2p-toc__sum::-webkit-details-marker { display: none; }
.v2p-toc__sum::after { content: ""; width: 8px; height: 8px; border: solid var(--v2-muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
.v2p-toc[open] > .v2p-toc__sum::after { transform: rotate(-135deg) translateY(-2px); }
.v2p-toc ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.v2p-toc a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13.5px; line-height: 1.4; color: var(--v2-ink-2); }
.v2p-toc a:hover { background: var(--v2-surface-2); text-decoration: none; }
.v2p-toc a[aria-current] { color: var(--v2-brand-ink); background: var(--v2-brand-soft); font-weight: 600; }
@media (min-width: 1100px) {
  .v2p-layout.has-toc { grid-template-columns: 236px minmax(0, 780px); gap: 44px; }
  .v2p-main:has(.v2p-layout.has-toc) .v2p-head__in > * { margin-left: 280px; }
  .v2p-aside { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding-top: 6px; }
  .v2p-toc { background: none; border: 0; }
  .v2p-toc__sum { padding: 0 0 10px 12px; pointer-events: none; }
  .v2p-toc__sum::after { display: none; }
  .v2p-toc ol { padding: 0; border-left: 1px solid var(--v2-line); }
  .v2p-toc a { margin-left: -1px; padding: 6px 12px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; }
  .v2p-toc a[aria-current] { border-left-color: var(--v2-brand); }
}

/* Closing call to action (navy band) */
.v2p-cta { position: relative; overflow: hidden; padding: 52px 0; background: var(--v2-navy); color: var(--v2-on-navy); }
.v2p-cta::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 12% 30%, rgba(18, 129, 252, .22), transparent 42%), radial-gradient(circle at 88% 90%, rgba(90, 168, 255, .10), transparent 38%); }
.v2p-cta__in { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px 48px; align-items: center; }
.v2p-cta__h { margin: 0 0 8px; font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; color: #FFFFFF; }
.v2p-cta__lead { margin: 0; max-width: 560px; font-size: 16px; line-height: 1.6; color: var(--v2-on-navy-2); }
.v2p-cta a:not(.v2-btn) { color: #9CC8FF; text-decoration: underline; text-underline-offset: 3px; }
.v2p-cta code { font: 500 .88em/1.4 var(--v2-mono); color: #FFFFFF; }
.v2p-check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; }
.v2p-check .v2-input:focus { outline: none; border-color: #5AA8FF; box-shadow: 0 0 0 3px rgba(90, 168, 255, .25); }
.v2p-check__error { grid-column: 1 / -1; margin: 0; font-size: 14px; color: #FDA29B; }
.v2p-check__note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--v2-on-navy-muted); }
.v2p-check__note a { color: var(--v2-on-navy-2) !important; }

/* Related pages */
.v2p-related { padding: 44px 0 4px; }
.v2p-related__h { margin: 0 0 16px; font-size: 20px; line-height: 1.3; font-weight: 600; }
.v2p-related__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--v2-gap); }
.v2p-related__item { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 46px 18px 18px; transition: border-color .15s ease; }
.v2p-related__item:hover, .v2p-related__item:focus-within { border-color: #9EC5F4; }
.v2p-related__item a { font-weight: 600; color: var(--v2-ink); }
.v2p-related__item a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.v2p-related__item p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--v2-muted); }
.v2p-related__go { position: absolute; top: 19px; right: 18px; color: var(--v2-brand-ink); }

/* Blog index */
.v2p-blog { padding-top: 28px; padding-bottom: 52px; }
.v2p-posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: var(--v2-gap); }
.v2p-post { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; transition: border-color .15s ease; }
.v2p-post:hover, .v2p-post:focus-within { border-color: #9EC5F4; }
.v2p-post__date { margin: 0; font: 500 12px/1.4 var(--v2-mono); color: var(--v2-muted); }
.v2p-post__t { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 600; letter-spacing: -.01em; }
.v2p-post__t a { color: var(--v2-ink); }
.v2p-post__t a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.v2p-post__d { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--v2-ink-2); }
.v2p-post__go { margin-top: auto; padding-top: 4px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--v2-brand-ink); }
.v2p-empty { padding: 24px; }
.v2p-empty p { margin: 0; color: var(--v2-ink-2); }

/* Legal text (static HTML: h2, p, ul) and the switch between the three documents */
.v2p-legalnav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.v2p-legalnav a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #D0D7E2; background: var(--v2-surface); font-size: 13px; font-weight: 500; color: var(--v2-ink-2); }
.v2p-legalnav a:hover { border-color: var(--v2-muted); text-decoration: none; }
.v2p-legalnav a[aria-current] { background: var(--v2-ink); border-color: var(--v2-ink); color: #FFFFFF; }
.v2p-legal { padding-top: 32px; }
.v2p-legal h2 { margin: 30px 0 12px; padding-top: 26px; border-top: 1px solid var(--v2-line-2); scroll-margin-top: 20px; }
.v2p-legal > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.v2p-legal ul { margin: 0 0 14px; padding-left: 22px; }
.v2p-legal li + li { margin-top: 6px; }

/* Auth (login, register, verify) */
.v2p-auth { display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px 56px; background: linear-gradient(var(--v2-navy) 0, var(--v2-navy) 132px, transparent 132px); }
.v2p-auth + .v2-foot { margin-top: 0; }
.v2p-auth__card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; padding: 28px; box-shadow: 0 24px 60px rgba(16, 24, 40, .12); }
.v2p-auth__h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; }
.v2p-auth__text, .v2p-auth__alt { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--v2-ink-2); }
.v2p-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.v2p-field { display: flex; flex-direction: column; gap: 6px; }
.v2p-field label { font-size: 13px; font-weight: 600; color: var(--v2-ink-2); }
.v2p-field .v2-input { min-height: 46px; font: 400 15px/1.2 var(--v2-font); }
.v2p-field .v2-input:focus { outline: none; border-color: var(--v2-brand); box-shadow: 0 0 0 3px rgba(18, 129, 252, .18); }
.v2p-field .v2-input[readonly] { background: var(--v2-surface-2); color: var(--v2-ink-2); }
.v2p-form__submit { width: 100%; }
.v2p-form .seo-muted { margin: 0; font-size: 11.5px !important; line-height: 1.5; color: var(--v2-muted); }
.v2p-alert { margin: 0; padding: 10px 14px; border-radius: var(--v2-r-sm); border: 1px solid #FECDCA; background: var(--v2-crit-soft); color: var(--v2-crit-ink); font-size: 14px; line-height: 1.5; }
.v2p-alert--ok { border-color: #ABEFC6; background: var(--v2-ok-soft); color: var(--v2-ok-ink); }
.v2p-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--v2-muted); }
.v2p-steps li { display: inline-flex; align-items: center; gap: 7px; }
.v2p-steps__n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid #98A2B3; font: 600 11.5px/1 var(--v2-mono); }
.v2p-steps .is-active { color: var(--v2-ink); font-weight: 600; }
.v2p-steps .is-active .v2p-steps__n { border-color: var(--v2-cta); background: var(--v2-cta); color: #FFFFFF; }
.v2p-steps .is-done .v2p-steps__n { border-color: var(--v2-ok); background: var(--v2-ok-soft); color: var(--v2-ok-ink); }

/* 404 */
.v2p-err { padding: 48px 0 64px; }
.v2p-err + .v2-foot { margin-top: 0; }
.v2p-err__card { max-width: 920px; margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: center; padding: 28px; }
.v2p-err__frame { overflow: hidden; border-radius: 10px; border: 1px solid #1F3350; background: var(--v2-navy); box-shadow: 0 18px 40px rgba(15, 27, 45, .22); }
.v2p-err__bar { display: flex; gap: 6px; padding: 9px 11px; background: var(--v2-navy-2); border-bottom: 1px solid var(--v2-navy-line); }
.v2p-err__bar span { width: 8px; height: 8px; border-radius: 50%; background: var(--v2-navy-line); }
.v2p-err__bar span:first-child { background: var(--v2-crit); }
.v2p-err__stage { position: relative; aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background-image: linear-gradient(rgba(143, 180, 232, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(143, 180, 232, .09) 1px, transparent 1px); background-size: 22px 22px; }
.v2p-err__stage::after { content: ""; position: absolute; left: 0; right: 0; top: 12%; height: 2px; background: linear-gradient(90deg, transparent, #5AA8FF, transparent); animation: v2p-scan 2.8s ease-in-out infinite; }
@keyframes v2p-scan { 0% { top: 12%; opacity: 0; } 15%, 85% { opacity: 1; } 100% { top: 86%; opacity: 0; } }
.v2p-err__code { font: 600 44px/1 var(--v2-mono); letter-spacing: -.02em; color: #5AA8FF; }
.v2p-err__signal { margin: 0; font: 500 11px/1.4 var(--v2-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--v2-on-navy-muted); }
.v2p-err__text { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.v2p-err__pill { margin: 0; }
.v2p-err__h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.v2p-err__lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--v2-ink-2); }
.v2p-err__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 6px; }
.v2p-err__note { font-size: 14px; color: var(--v2-muted); }

/* Narrow screens */
@media (max-width: 720px) {
  .v2p-head__in { gap: 12px; padding-top: 20px; padding-bottom: 26px; }
  .v2p-lead { font-size: 16.5px; }
  .v2p-layout { padding-top: 16px; padding-bottom: 40px; gap: 12px; }
  /* The text runs edge to edge on phones: a card frame would cost 36 px of a 390 px line. */
  .v2p-doc { margin: 0 -16px; padding: 0 16px 28px; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; font-size: 16px; line-height: 1.68; }
  .v2p-sec { padding-top: 24px; }
  .v2p-sec + .v2p-sec { margin-top: 24px; }
  .v2p-doc h2 { font-size: 21px; }
  .v2p-legal { padding-top: 24px; }
  .v2p-table th, .v2p-table td { padding: 9px 12px; }
  .v2p-cta { padding: 40px 0; }
  .v2p-cta__h { font-size: 24px; }
  .v2p-check { grid-template-columns: 1fr; }
  .v2p-check .v2-btn { width: 100%; }
  .v2p-related { padding-top: 32px; }
  .v2p-blog { padding-top: 16px; padding-bottom: 40px; }
  .v2p-post { padding: 18px; }
  .v2p-auth { padding-top: 24px; background: linear-gradient(var(--v2-navy) 0, var(--v2-navy) 96px, transparent 96px); }
  .v2p-auth__card { padding: 22px 18px; }
  .v2p-err { padding: 28px 0 44px; }
  .v2p-err__card { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 20px; }
  .v2p-err__frame { max-width: 240px; }
}

/* Print: the text only */
@media print {
  .v2p-aside, .v2p-cta, .v2p-related, .zn-lang-hint { display: none !important; }
  .v2p-head, .v2p-doc { border: 0; box-shadow: none; }
  .v2p-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .v2p-main:has(.v2p-layout.has-toc) .v2p-head__in > * { margin-left: 0; }
}
