/* Rootpad v3: FAQ, Terms, Official and 404 (docs/design-v3/DESIGN.md §5.7, §5.8). Loaded after css/site.css by these
   four pages only. Owner: S (DOCS). Every rule is scoped under main.docs-page and uses the base tokens; no keyframes,
   no transition and no motion block here (what moves is in the one motion block of site.css).
   The texts are frozen (the FAQ is marketing/02-FAQ.md word for word; the terms and /oficial are pinned): only the
   markup around them changed, so a few rules below find their element by its place (the first two paragraphs of
   /oficial, its last list) instead of a class. */

/* ------------------------------------------------------------ page head: the kicker as a muted pill, then the H1 */
.docs-page .page-head {
  padding: var(--s7) 0 var(--s5);
}
.docs-page .page-head .kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 0 var(--s3);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card-2);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.docs-page .page-head .kicker:last-child {
  margin-bottom: 0;
}
.docs-page .page-head h1 {
  margin: 0;
}
@media (min-width: 600px) {
  .docs-page .page-head {
    padding: var(--s8) 0 var(--s7);
  }
}
/* the terms' head is only the kicker: their first h1 is part of the pinned text, right under it */
.docs-page .terms > .page-head {
  padding-bottom: var(--s3);
}

/* ------------------------------------------------------------ the reading column (720px) and "On this page" */
.docs-page .prose {
  max-width: 720px;
  margin-inline: auto;
}
/* below 1080px the contents are chips that wrap (never a sideways scroller) */
.docs-page .faq-toc,
.docs-page .page-toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0 0 var(--s7);
}
.docs-page .faq-toc a,
.docs-page .page-toc a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}
.docs-page .faq-toc a:hover,
.docs-page .page-toc a:hover {
  border-color: var(--line-field);
  background: var(--card-2);
  color: var(--text);
}
/* "you are here" (lib/motion.js initSpy sets aria-current="location" on the section in view) */
.docs-page .faq-toc a[aria-current],
.docs-page .page-toc a[aria-current] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

/* from 1080px: two columns, the contents a sticky card on the left (240px), the text on the right (720px) */
@media (min-width: 1080px) {
  .docs-page .faq,
  .docs-page .terms {
    display: grid;
    grid-template-columns: 240px minmax(0, 720px);
    column-gap: var(--s9);
    justify-content: center;
    max-width: none;
  }
  .docs-page .faq > .page-head,
  .docs-page .terms > .page-head {
    grid-column: 2;
    grid-row: 1;
  }
  .docs-page .faq > [data-lang],
  .docs-page .terms > [data-lang] {
    grid-column: 2;
    grid-row: 2;
  }
  .docs-page .faq-toc,
  .docs-page .page-toc {
    position: sticky;
    top: calc(var(--header-h) + var(--s6));
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    margin: var(--s8) 0 0;
    padding: var(--s2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
  }
  .docs-page .faq-toc a,
  .docs-page .page-toc a {
    padding: 0 12px 0 16px;
    border: 0;
    border-radius: var(--r);
    background: none;
    color: var(--muted);
  }
  .docs-page .faq-toc a:hover,
  .docs-page .page-toc a:hover {
    background: var(--card-2);
    color: var(--text);
  }
  .docs-page .faq-toc a[aria-current],
  .docs-page .page-toc a[aria-current] {
    background: var(--card-2);
    color: var(--accent);
  }
  .docs-page .faq-toc a[aria-current]::before,
  .docs-page .page-toc a[aria-current]::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: var(--r-pill);
    background: var(--accent);
  }
}

/* ------------------------------------------------------------ prose: headings, text, lists, code */
.docs-page .prose > [data-lang] > :first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.docs-page .prose h2 {
  margin: var(--s8) 0 var(--s3);
  line-height: 1.25;
}
.docs-page .prose h3 {
  margin: var(--s7) 0 var(--s2);
  line-height: 1.35;
}
.docs-page .prose h2 + h3 {
  margin-top: var(--s4);
}
.docs-page .prose p,
.docs-page .prose li {
  font-size: var(--fs-body);
}
.docs-page .prose p,
.docs-page .prose ul {
  margin: 0 0 var(--s4);
}
.docs-page .prose li::marker {
  color: var(--soft);
}
.docs-page .prose a {
  overflow-wrap: anywhere;
}
.docs-page .prose em {
  color: var(--muted);
}
.docs-page .prose code {
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: 0.9em;
}
.docs-page .prose pre {
  margin: 0 0 var(--s4);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-2);
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.docs-page .prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}
/* old links with the Portuguese ids land here (span.alias right before the English section; lib/anchors.js) */
.docs-page .alias {
  display: block;
  height: 0;
}

/* tables (FAQ 12, 13, 14): the data-table look, inside their own box (only that box may scroll sideways) */
.docs-page .table-scroll {
  margin: var(--s2) 0 var(--s4);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
}
.docs-page .table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.docs-page .table-scroll thead {
  background: var(--card-2);
}
.docs-page .table-scroll thead th,
.docs-page .table-scroll thead td {
  height: 40px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  vertical-align: middle;
}
.docs-page .table-scroll tbody th,
.docs-page .table-scroll tbody td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.docs-page .table-scroll tbody th {
  color: var(--muted);
  font-weight: 700;
}
/* the narrowest phones: tighter cells, so FAQ 14 (six columns) fits down to 320px without scrolling its box */
@media (max-width: 399px) {
  .docs-page .table-scroll thead th,
  .docs-page .table-scroll thead td,
  .docs-page .table-scroll tbody th,
  .docs-page .table-scroll tbody td {
    padding-inline: 8px;
  }
}

/* FAQ 21: Dig's own words, in a well with his head (the green mushroom miner, DESIGN §6.1) */
.docs-page .prose blockquote {
  position: relative;
  min-height: 74px;
  margin: var(--s3) 0 var(--s4);
  padding: var(--s4) var(--s5) var(--s4) 72px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-lg);
}
.docs-page .prose blockquote p {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}
.docs-page .faq blockquote::before {
  content: '';
  position: absolute;
  left: var(--s4);
  top: var(--s4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: url('/img/dig-head-192.webp') center / 40px 40px no-repeat;
  box-shadow: 0 0 0 1px var(--line-strong);
}
/* the FAQ's last line: the honest summary, set apart from the answers */
.docs-page .faq .third-party {
  margin-top: var(--s8);
}

/* ------------------------------------------------------------ terms: four documents, four h1 (pinned) */
.docs-page .terms [data-lang] > h1 ~ h1 {
  position: relative;
  margin-top: var(--s10);
  padding-top: var(--s8);
  border-top: 1px solid var(--line-strong);
  font-size: clamp(26px, 2.4vw, 32px);
}
/* a short accent bar on the rule: a new document starts here, not just a new section */
.docs-page .terms [data-lang] > h1 ~ h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: -2px;
  width: 48px;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

/* ------------------------------------------------------------ /oficial */
/* the first two paragraphs ("Official addresses only here." and "Testnet only"): one notice card */
.docs-page .official [data-lang] > p:nth-of-type(1),
.docs-page .official [data-lang] > p:nth-of-type(2) {
  position: relative;
  margin: 0;
  padding: var(--s4) var(--s5) var(--s1) 52px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-left: 3px solid var(--accent);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--card);
}
.docs-page .official [data-lang] > p:nth-of-type(2) {
  margin-bottom: var(--s2);
  padding: var(--s1) var(--s5) var(--s4) 52px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.docs-page .official [data-lang] > p:nth-of-type(1)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 19px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  -webkit-mask: url('/img/ui/check.svg') center / 20px 20px no-repeat;
  mask: url('/img/ui/check.svg') center / 20px 20px no-repeat;
}
/* the address and account lists: one card each, a row per item, the label on line 1 and the value on line 2 */
.docs-page .official [data-lang] > ul:not(:last-of-type) {
  margin: 0 0 var(--s4);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  list-style: none;
}
.docs-page .official [data-lang] > ul:not(:last-of-type) > li {
  margin: 0;
  padding: var(--s3) var(--s4);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.docs-page .official [data-lang] > ul:not(:last-of-type) > li + li {
  border-top: 1px solid var(--line);
}
.docs-page .official [data-official],
.docs-page .official [data-lang] > ul:not(:last-of-type) > li > a {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: var(--s1);
  font: 400 var(--fs-sm) / 1.5 var(--mono);
  font-variant-ligatures: none;
  overflow-wrap: anywhere;
}
/* an address read from the chain (static.js): the explorer link, then its Copy button */
.docs-page .official [data-official] > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
}
.docs-page .official [data-official] .chip {
  font-family: var(--font);
}
.docs-page .official [data-official] .placeholder,
.docs-page .official [data-lang] > ul:not(:last-of-type) > li > .placeholder {
  display: flex;
  width: fit-content;
  margin-top: var(--s1);
  font-family: var(--font);
  font-weight: 400;
}
.docs-page .official [data-official] .placeholder {
  margin-top: 0;
}
/* "Report a problem": a caution callout (it carries the "we never ask for your seed phrase" line) */
.docs-page .official #report + p {
  position: relative;
  padding: var(--s3) var(--s4) var(--s3) 44px;
  border: 1px solid var(--amber-line);
  border-left: 3px solid var(--amber);
  border-radius: var(--r);
  background: var(--amber-bg);
}
.docs-page .official #report + p::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 16px;
  width: 18px;
  height: 18px;
  background: var(--amber);
  -webkit-mask: url('/img/ui/caution.svg') center / 18px 18px no-repeat;
  mask: url('/img/ui/caution.svg') center / 18px 18px no-repeat;
}
/* the rules: a check per line */
.docs-page .official [data-lang] > ul:last-of-type {
  padding: 0;
  list-style: none;
}
.docs-page .official [data-lang] > ul:last-of-type > li {
  position: relative;
  padding-left: 32px;
}
.docs-page .official [data-lang] > ul:last-of-type > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  -webkit-mask: url('/img/ui/check.svg') center / 20px 20px no-repeat;
  mask: url('/img/ui/check.svg') center / 20px 20px no-repeat;
}
.docs-page .official #official-note:not(:empty) {
  margin-top: var(--s6);
}

/* ------------------------------------------------------------ 404: Dig in a centred card */
.docs-page .lost {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  max-width: 560px;
  margin: var(--s8) auto 0;
  padding: var(--s7);
  text-align: center;
}
.docs-page .lost > * {
  margin: 0;
}
.docs-page .lost-art {
  width: 240px;
  max-width: 100%;
}
.docs-page .lost .cta-row {
  justify-content: center;
  margin-top: var(--s2);
}
@media (max-width: 599px) { .docs-page .lost { margin-top: var(--s6); padding: var(--s6) var(--s4); } }
/* phones and touch screens (§3.3, §9.2, QA T-CHROME-4): the contents chips, the official links and their Copy buttons
   are whole 44-px tap targets; with a mouse the chips stay 40 px */
@media (max-width: 899px), (any-pointer: coarse) {
  .docs-page .faq-toc a, .docs-page .page-toc a, .docs-page .official [data-official] .chip { min-height: 44px; }
  .docs-page .official [data-official] a { display: inline-flex; align-items: center; min-height: 44px; }
  .docs-page .official [data-lang] > ul:not(:last-of-type) > li > a { display: flex; align-items: center; min-height: 44px; }
}

/* ------------------------------------------------------------ forced colours: the drawn marks stay visible */
@media (forced-colors: active) {
  .docs-page .faq-toc a[aria-current]::before,
  .docs-page .page-toc a[aria-current]::before,
  .docs-page .terms [data-lang] > h1 ~ h1::before,
  .docs-page .official [data-lang] > p:nth-of-type(1)::before,
  .docs-page .official #report + p::before,
  .docs-page .official [data-lang] > ul:last-of-type > li::before {
    forced-color-adjust: none;
    background-color: CanvasText;
  }
  /* not while focused: the base :focus-visible outline must stay visible on the current link too */
  .docs-page .faq-toc a[aria-current]:not(:focus-visible),
  .docs-page .page-toc a[aria-current]:not(:focus-visible) {
    outline: 2px solid CanvasText;
    outline-offset: -4px;
  }
  .docs-page .faq-toc,
  .docs-page .page-toc,
  .docs-page .table-scroll,
  .docs-page .prose blockquote,
  .docs-page .official [data-lang] > ul:not(:last-of-type) {
    border: 1px solid CanvasText;
  }
}
