/* risio.me — legal + pricing pages. Reuses the design tokens, nav, footer and
   buttons from landing.css (linked FIRST); this file only adds the document
   chrome: hero, table of contents, long-form prose, the legal hub cards and the
   pricing tiers. Same system as the landing — white canvas, one emerald accent,
   Inter 500 display, square-ish radii, hairline rules. Fully responsive.

   Bilingual by CSS: Russian shows by default; a synchronous <head> script sets
   `html.lang-en` / `html.lang-ru` before first paint (no flash), and these rules
   swap which `[data-lang]` blocks are visible. `display:revert` restores each
   element's natural display, so it works for block sections and inline spans. */

/* EN blocks ship with the `hidden` attribute so a no-JS visitor sees Russian by
   default. landing.css sets `[hidden]{display:none!important}`, so the reveal rule
   below MUST also be !important (and more specific) to win when EN is selected. */
[data-lang="en"] { display: none; }
html.lang-en [data-lang="ru"] { display: none !important; }
html.lang-en [data-lang="en"] { display: revert !important; }

/* ---------------------------------------------------------- doc shell */
.doc-main { padding-bottom: 8px; }

/* a slim breadcrumb back to the landing + to the legal hub */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 20px; font-size: 12.5px; color: var(--ink-mute-2);
}
.crumbs a { color: var(--ink-mute); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--hair-strong); }

/* ---------------------------------------------------------- doc hero */
.doc-hero { padding: 34px 0 30px; border-bottom: 1px solid var(--hair-cool); }
.doc-eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--green-deep); font-weight: 600;
}
.doc-hero h1 {
  margin: 14px 0 0; font-weight: 500; letter-spacing: -0.03em; line-height: 1.08;
  font-size: clamp(2rem, 4.6vw, 3.1rem); color: var(--ink); max-width: 900px;
  text-wrap: balance;
}
.doc-hero .doc-lede {
  margin: 18px 0 0; max-width: 680px; font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.55; color: var(--ink-mute);
}
.doc-meta {
  margin-top: 20px; font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
}

/* ---------------------------------------------------------- doc layout: TOC + prose */
.doc-grid {
  display: grid; grid-template-columns: 232px 1fr; gap: 60px;
  padding: 44px 0 40px;
}
.doc-toc { position: sticky; top: 24px; align-self: start; }
.doc-toc__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-mute-2); font-weight: 600; margin-bottom: 10px;
}
.doc-toc a {
  display: block; padding: 6px 0; font-size: 13px; line-height: 1.4;
  color: var(--ink-mute); border-bottom: 1px solid var(--hair-cool);
}
.doc-toc a:last-child { border-bottom: none; }
.doc-toc a:hover { color: var(--ink); }
.doc-toc a .num { color: var(--ink-faint); font-family: var(--mono); font-size: 11px; margin-right: 6px; }

/* ---------------------------------------------------------- prose (markdown-rendered)
   The legal docs are authored as markdown → the renderer emits flat <h2>/<p>/<ul>/<table>.
   Sections are delimited by <h2>: each gets a top hairline + an auto "§ NN" label via a CSS
   counter, reproducing the old hand-numbered section look without wrapper elements. The lead
   paragraphs before the first <h2> read as the intro. */
.prose { max-width: 720px; color: var(--ink-2); counter-reset: sec; }

/* intro = the paragraphs before the first heading */
.prose > p:first-child { margin-top: 0; }

.prose h2 {
  counter-increment: sec;
  margin: 30px 0 0; padding-top: 26px; border-top: 1px solid var(--hair-cool);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.18;
  font-size: 22px; color: var(--ink);
}
.prose h2::before {
  content: "§ " counter(sec, decimal-leading-zero);
  display: block; margin-bottom: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--ink-faint); text-transform: uppercase; font-weight: 400;
}
.prose h3 { margin: 20px 0 0; font-weight: 600; font-size: 16px; color: var(--ink); }
.prose p { font-size: 15.5px; line-height: 1.65; margin: 12px 0 0; }
.prose ul, .prose ol { margin: 12px 0 0; padding-left: 20px; }
.prose li { font-size: 15.5px; line-height: 1.6; margin: 5px 0 0; }
.prose li::marker { color: var(--ink-faint); }
.prose a { color: var(--green-deep); border-bottom: 1px solid var(--green-ring); }
.prose a:hover { border-color: var(--green); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .note,
.prose blockquote {
  margin: 14px 0 0; padding: 14px 16px; background: var(--canvas-soft);
  border: 1px solid var(--hair-cool); border-radius: var(--r-md);
  font-size: 14px; line-height: 1.6; color: var(--ink-mute);
}
.prose blockquote p { margin: 0; font-size: 14px; color: var(--ink-mute); }

/* fact table (payment info) */
.prose table {
  width: 100%; border-collapse: collapse; margin: 16px 0 0;
  font-size: 14px; border: 1px solid var(--hair); border-radius: var(--r-md); overflow: hidden;
}
.prose th, .prose td { text-align: left; padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--hair-cool); }
.prose tr:last-child th, .prose tr:last-child td { border-bottom: none; }
.prose th {
  width: 34%; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-mute-2); font-weight: 500;
  background: var(--canvas-soft);
}
.prose td { color: var(--ink-2); }

/* payment card logos row */
.cards-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.cards-row svg {
  height: 40px; width: auto; border: 1px solid var(--hair); border-radius: var(--r-sm);
  background: var(--canvas); box-shadow: var(--sh-1);
}

/* ---------------------------------------------------------- legal hub cards */
.hub-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair); border-radius: var(--r-lg);
  overflow: hidden; margin-top: 36px;
}
.hub-card { background: var(--canvas); padding: 26px 24px; display: flex; flex-direction: column; }
.hub-card:hover { background: var(--canvas-soft); }
.hub-card .num {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--ink-faint); text-transform: uppercase;
}
.hub-card h2 { margin: 10px 0 0; font-weight: 500; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.hub-card p { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-mute); flex: 1; }
.hub-card .go { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--green-deep); }
.hub-card:hover .go { color: var(--green); }

/* ---------------------------------------------------------- pricing tiers */
.pricing-head { padding: 34px 0 6px; text-align: center; }
.pricing-head .doc-eyebrow { display: block; }
.pricing-head h1 {
  margin: 14px auto 0; max-width: 760px; font-weight: 500; letter-spacing: -0.03em;
  line-height: 1.08; font-size: clamp(2rem, 4.6vw, 3rem); color: var(--ink); text-wrap: balance;
}
.pricing-head .doc-lede { margin: 16px auto 0; max-width: 620px; text-align: center; font-size: 1.05rem; color: var(--ink-mute); line-height: 1.55; }
.cur-note { margin-top: 12px; font-size: 13px; color: var(--ink-mute-2); }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 34px 0 0; align-items: stretch; }
.tiers--4 { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tier {
  position: relative;
  display: flex; flex-direction: column; padding: 26px 20px 22px;
  border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--canvas);
  box-shadow: var(--sh-1);
}
.tier--featured { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--sh-2); }
/* badge sits ON the top border as a ribbon → out of flow, so every card's name/price/CTA line up */
.tier__badge {
  position: absolute; top: -10px; left: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--on-green); background: var(--green); padding: 3px 9px; border-radius: var(--r-full);
  text-transform: uppercase;
}
.tier__name { font-weight: 600; font-size: 18px; color: var(--ink); }
.tier__tagline { margin-top: 6px; font-size: 13px; color: var(--ink-mute); line-height: 1.4; min-height: 54px; }
.tier__price { margin-top: 14px; display: flex; align-items: baseline; gap: 6px; }
.tier__amount { font-weight: 600; font-size: 30px; letter-spacing: -0.02em; color: var(--ink); }
.tier__amount--soft { font-size: 22px; color: var(--green-deep); }
.tier__per { font-size: 13px; color: var(--ink-mute-2); }
/* сом equivalent — shown ONLY to Kyrgyzstan visitors (Worker sets html[data-kg="1"]) */
.tier__som { display: none; margin-top: 4px; font-size: 12.5px; color: var(--ink-mute-2); font-family: var(--mono); }
html[data-kg="1"] .tier__som { display: block; }
.tier__cta { margin-top: 18px; width: 100%; text-align: center; display: inline-block; }
.tier__cta.is-ghost {
  background: var(--canvas); color: var(--ink); border-color: var(--hair-strong);
}
.tier__cta.is-ghost:hover { background: var(--canvas-soft); border-color: var(--ink-mute); }
.tier__feats { list-style: none; margin: 20px 0 0; padding: 0; }
.tier__feats li {
  position: relative; padding: 7px 0 7px 24px; font-size: 13.5px; line-height: 1.45;
  color: var(--ink-2); border-top: 1px solid var(--hair-cool);
}
.tier__feats li:first-child { border-top: none; }
.tier__feats li::before {
  content: ""; position: absolute; left: 2px; top: 12px; width: 12px; height: 12px;
  background: var(--icon-check); background-size: contain; background-repeat: no-repeat;
}
.tier__feats b { color: var(--ink); font-weight: 600; }
:root { --icon-check: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20viewBox='0%200%2016%2016'%20fill='none'%20stroke='%2324b47e'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='3,8.5%207,12.5%2013,4'/%3E%3C/svg%3E"); }

.pricing-fine {
  max-width: 720px; margin: 22px auto 0;
  font-size: 13px; line-height: 1.6; color: var(--ink-mute);
}
.pricing-fine a { color: var(--green-deep); border-bottom: 1px solid var(--green-ring); }

/* pricing FAQ */
.pricing-faq { max-width: 720px; margin: 40px auto 0; }
.pricing-faq h2 { text-align: center; font-weight: 500; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 20px; }
.faq-item { padding: 18px 0; border-top: 1px solid var(--hair-cool); }
.faq-item:last-child { border-bottom: 1px solid var(--hair-cool); }
.faq-item h3 { margin: 0; font-weight: 600; font-size: 15px; color: var(--ink); }
.faq-item p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-mute); }

/* ---------------------------------------------------------- pricing comparison matrix */
.compare { margin: 52px 0 0; }
.compare h2 { text-align: center; font-weight: 500; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 20px; }
/* wide table scrolls inside its own container on phones — the page never scrolls sideways.
   NB: the (i) tooltip is NOT clipped by this overflow because it's rendered position:fixed and
   positioned by legal.js (see .hint__tip below) — it lives in the viewport, outside this box. */
.compare__scroll { overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--r-lg); }
.compare__table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.compare__table thead th {
  padding: 14px 12px 12px; text-align: center; font-weight: 600; font-size: 15px; color: var(--ink);
  border-bottom: 1px solid var(--hair); vertical-align: top;
}
.compare__table thead th.is-featured { color: var(--green-deep); }
.compare__price { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--ink-mute-2); }
/* сом equivalent under the price — shown ONLY to Kyrgyzstan visitors (html[data-kg="1"]) on the Russian UI */
.compare__som { display: none; margin-top: 1px; font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--ink-mute-2); }
:root[data-kg="1"][lang="ru"] .compare__som { display: block; }
.compare__table .compare__group td {
  text-align: left; padding: 9px 12px; background: var(--canvas-soft);
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute-2);
  border-top: 1px solid var(--hair-cool); border-bottom: 1px solid var(--hair-cool);
}
.compare__table tbody th[scope="row"] {
  text-align: left; font-weight: 500; color: var(--ink-2); padding: 11px 12px; font-size: 14px;
}
.compare__table tbody td {
  text-align: center; padding: 11px 12px; color: var(--ink-2); border-top: 1px solid var(--hair-cool);
}
.compare__table tbody th[scope="row"] { border-top: 1px solid var(--hair-cool); }
.compare__table .is-yes { color: var(--green-deep); font-weight: 700; }
.compare__table .is-no { color: var(--hair-strong); }
/* pin the feature-name column so it stays put while the tier columns scroll on narrow screens */
.compare__table thead th:first-child,
.compare__table tbody th[scope="row"] {
  position: sticky; left: 0; z-index: 2; background: var(--canvas);
  box-shadow: 1px 0 0 var(--hair); /* right hairline that survives the horizontal scroll */
}
.compare__table thead th:first-child { z-index: 3; }
/* phones: tighter cells + a smaller frozen label column, so more tiers show at once */
@media (max-width: 620px) {
  .compare h2 { font-size: 1.3rem; }
  .compare__table { min-width: 480px; font-size: 13px; }
  .compare__table thead th { font-size: 13px; padding: 12px 8px 10px; }
  .compare__price { font-size: 11px; }
  .compare__table tbody th[scope="row"] { font-size: 12.5px; padding: 10px 10px; width: 42%; }
  .compare__table tbody td { padding: 10px 6px; }
  .compare__group td { padding: 8px 10px; }
  /* keep the group label (ПОИСК / ДОСТАВКА / …) pinned left while the table scrolls sideways —
     aligned with the frozen feature column; a fixed px offset sticks reliably (unlike left:%) */
  .compare__grouplabel { position: sticky; left: 10px; display: inline-block; }
}
/* the (i) hint next to a row label — a custom site-styled tooltip (not the native title) */
.compare .hint {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 6px; vertical-align: middle;
  border: 1px solid var(--hair-strong); border-radius: 50%;
  font-family: var(--mono); font-size: 10px; font-style: normal; line-height: 1; color: var(--ink-mute-2);
  cursor: help; user-select: none;
}
.compare .hint:hover, .compare .hint:focus { border-color: var(--green); color: var(--green-deep); outline: none; }
/* tooltip card — position:FIXED so it escapes the table's overflow-x:auto box (which would otherwise
   clip it on any narrow/scrolling viewport). legal.js sets top/left from the icon's rect on
   hover/focus, flips it above when there's no room below, and clamps it inside the viewport; the
   `is-open` class it toggles is the ONLY thing that reveals it (no CSS :hover rule → no mis-placed
   flash before the script positions it). The native `aria-label` is the no-JS fallback. */
.hint__tip {
  display: none; position: fixed; top: 0; left: 0; z-index: 1000;
  max-width: min(280px, calc(100vw - 24px)); padding: 10px 12px;
  background: var(--canvas); color: var(--ink-2);
  border: 1px solid var(--hair); border-radius: var(--r-md); box-shadow: var(--sh-2);
  font-family: var(--font); font-size: 12.5px; font-weight: 400; font-style: normal;
  line-height: 1.5; letter-spacing: 0; white-space: normal; text-transform: none;
}
.hint__tip.is-open { display: block; }

/* ---------------------------------------------------------- footer legal links */
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.footer-links a { color: var(--ink-mute); font-size: 13px; }
.footer-links a:hover { color: var(--ink); }

/* ---------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .doc-grid { grid-template-columns: 1fr; gap: 8px; padding-top: 30px; }
  .doc-toc {
    position: static; margin-bottom: 24px; padding: 16px 0 4px;
    border-bottom: 1px solid var(--hair-cool);
  }
  /* on phones the TOC becomes a compact wrap of chips rather than a tall list */
  .doc-toc nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .doc-toc a { border: 1px solid var(--hair-cool); border-radius: var(--r-full); padding: 5px 11px; }
  .doc-toc a .num { display: none; }
  .hub-cards { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .tiers--4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .tiers--4 { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .doc-hero { padding-top: 24px; }
  .prose { font-size: 15px; }
}
