/*
 * Витрина на Фактурист. Тема: документ и регистър. Шрифтове: IBM Plex Sans (текст и заглавия) и
 * IBM Plex Mono (само за реални данни: номера, кодове, XML). Без JavaScript, без външни ресурси (CSP).
 */

:root {
  color-scheme: light dark;

  /* Палитра от логото: navy #0c1929 и тюркоаз #05a699. Тюркоазът е 3,03:1 върху бяло — само за
     линии и акценти (--brand); за текст и бутони светлата тема ползва #03756c (5,15:1 върху хартията). */
  --paper: #f4f6f8;
  --sheet: #ffffff;
  --tint: #e8edf2;
  --ink: #0c1929;
  --ink-2: #44546a;
  --rule: #cdd5de;
  --brand: #05a699;
  --accent: #03756c;
  --accent-ink: #ffffff;
  --accent-soft: #dff3f0;
  --focus: #03756c;

  /* Тъмният панел с XML е тъмен и в двете теми: едно смело място на страницата. */
  --code-bg: #08111d;
  --code-ink: #e6ecf3;
  --code-dim: #9fb0c3;
  --code-tag: #93b4f5;
  --code-val: #f0cf8e;
  --code-bt: #2cc5b5;
  --code-rule: #22344a;
  --on-code-accent: #2cc5b5;
  --on-code-accent-ink: #0c1929;

  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.35rem, 1.1rem + 0.9vw, 1.8rem);
  --step-3: clamp(1.9rem, 1.2rem + 2.6vw, 3.3rem);

  --measure: 40rem;
  --gap: clamp(1.5rem, 4vw, 3.5rem);
  --pad: clamp(1rem, 4vw, 2rem);
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1929;
    --sheet: #111e2e;
    --tint: #0f1c2c;
    --ink: #e9eff5;
    --ink-2: #a3b3c4;
    --rule: #26374b;
    --brand: #2cc5b5;
    --accent: #2cc5b5;
    --accent-ink: #0c1929;
    --accent-soft: #0f2e36;
    --focus: #2cc5b5;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: 'kern', 'liga';
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-3);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--step-2);
}

h3 {
  font-size: var(--step-1);
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1em;
  max-width: 65ch;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
}

.mono,
.bt {
  font-family: var(--font-mono);
}

.muted {
  color: var(--ink-2);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.skip:focus {
  top: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Връзки и бутони */

.link {
  color: var(--accent);
  font-weight: 500;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.link:hover {
  text-decoration-thickness: 2px;
}

.link-quiet {
  font-size: var(--step--1);
  text-decoration: none;
  padding: 0.4rem 0.2rem;
}

.link-quiet:hover {
  text-decoration: underline;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  background: transparent;
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-small {
  padding: 0.45rem 0.8rem;
  font-size: var(--step--1);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.actions p {
  margin: 0;
}

/* Горна лента */

.top {
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--rule);
  background: var(--sheet);
}

.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding-block: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.logo {
  display: block;
  min-width: 0;
}

.logo img {
  display: block;
  max-width: 100%;
  height: auto;
}

.brand {
  min-width: 0;
  padding-block: 0.15rem;
}

.nav {
  order: 3;
  width: 100%;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  list-style: none;
}

.nav a {
  display: block;
  padding: 0.45rem 0;
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  border-bottom-color: var(--rule);
}

.nav a[aria-current='page'] {
  border-bottom-color: var(--accent);
}

.top-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

@media (min-width: 52rem) {
  .nav {
    order: 0;
    width: auto;
    margin-left: auto;
  }

  .top-cta {
    margin-left: 0;
  }
}

/* Пътека */

.crumbs {
  padding-top: 1.1rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.crumbs li + li::before {
  content: '/';
  margin-right: 0.4rem;
  color: var(--rule);
}

.crumbs a {
  color: inherit;
}

/* Секции */

main {
  display: block;
}

.section {
  padding-block: clamp(2.75rem, 7vw, 5rem);
}

.section.tight {
  padding-top: 0;
}

.section-tint {
  background: var(--tint);
}

.page-head {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.75rem, 4vw, 2.5rem);
}

.page-head h1 {
  max-width: 22ch;
}

.lead {
  margin-top: 1.25rem;
  max-width: 58ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink);
}

.split {
  display: grid;
  gap: 1.75rem var(--gap);
}

.split-head > p:first-of-type {
  margin-top: 1rem;
}

.two {
  display: grid;
  gap: 2.5rem var(--gap);
}

.two h2 {
  margin-bottom: 1rem;
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .two {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .two > * + * {
    padding-left: var(--gap);
    border-left: 1px solid var(--rule);
  }
}

/* Начало: заглавна част с примерния документ */

.hero {
  padding-block: clamp(2rem, 5vw, 4rem) clamp(2.5rem, 6vw, 4.5rem);
}

.hero-grid {
  display: grid;
  gap: 2.5rem var(--gap);
  align-items: start;
}

.hero-copy h1 {
  max-width: 14ch;
}

@media (min-width: 64rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

.specimen {
  min-width: 0;
}

.doc {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1.4rem 1.25rem 1rem 3.4rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule);
  /* Поле на счетоводна книга: две вертикални линии. */
  background-image:
    linear-gradient(
      to right,
      transparent 2.55rem,
      var(--accent) 2.55rem,
      var(--accent) calc(2.55rem + 1px),
      transparent calc(2.55rem + 1px)
    ),
    linear-gradient(
      to right,
      transparent 2.75rem,
      var(--rule) 2.75rem,
      var(--rule) calc(2.75rem + 1px),
      transparent calc(2.75rem + 1px)
    );
}

.doc-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--ink);
}

.doc-kind {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.doc-no {
  margin: 0;
}

.doc-no .mono {
  font-size: 1.15rem;
  font-weight: 500;
}

.doc-label {
  color: var(--ink-2);
}

.bt {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--accent);
  font-size: 0.7rem;
  line-height: 1.5;
  vertical-align: 0.15em;
  white-space: nowrap;
}

.doc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem 1rem;
  margin-block: 0.9rem;
  font-size: var(--step--1);
}

.doc-meta dt {
  color: var(--ink-2);
}

.doc-meta dd {
  font-weight: 500;
}

.doc-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.doc-lines th,
.doc-lines td {
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  font-weight: 400;
}

.doc-lines td {
  text-align: right;
}

.doc-total th,
.doc-total td {
  border-top: 2px solid var(--ink);
  font-weight: 600;
  font-size: var(--step-0);
}

.doc-seal {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: none;
  margin: 1rem 0 0.8rem;
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.45;
}

.doc-seal .mono {
  color: var(--ink);
}

.seal-mark {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 28%, transparent 30%);
}

figcaption {
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.4;
}

.doc figcaption {
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

/* Панелът с XML: тъмен и в двете теми */

.xml {
  position: relative;
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
}

.specimen .xml {
  margin-top: -0.5rem;
  z-index: 0;
}

@media (min-width: 40rem) {
  .specimen .xml {
    margin-left: 3rem;
    margin-top: -1.5rem;
    padding-top: 0.75rem;
  }
}

.xml-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--code-rule);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--code-dim);
}

.xml-scroll {
  overflow-x: auto;
  padding: 0.75rem 0;
}

.xml-code {
  margin: 0;
  width: max-content;
  min-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.75;
  white-space: pre;
}

.xml-code code {
  display: block;
  font: inherit;
}

.xl {
  display: grid;
  grid-template-columns: 4.1rem auto;
}

.xl-bt {
  padding-right: 0.8rem;
  text-align: right;
  color: var(--code-bt);
  font-weight: 500;
  user-select: none;
}

.xl-src.i1 {
  padding-left: 1.2rem;
}

.xl-src.i2 {
  padding-left: 2.4rem;
}

.x-t {
  color: var(--code-tag);
}

.x-v {
  color: var(--code-val);
}

.xml figcaption {
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid var(--code-rule);
  color: var(--code-dim);
}

/* Правила: книга с редове */

.ledger {
  border-bottom: 1px solid var(--rule);
}

.ledger-row {
  display: grid;
  gap: 0.2rem 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.ledger dt {
  font-weight: 600;
}

.ledger dd {
  max-width: 55ch;
}

.ledger-ref {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-2);
}

@media (min-width: 40rem) {
  .ledger-row {
    grid-template-columns: 11rem minmax(0, 1fr);
  }

  .ledger-ref {
    grid-column: 2;
  }
}

/* Верига от отпечатъци */

.chain {
  margin: 0;
}

.chain-list {
  list-style: none;
}

.chain-list li {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  font-size: 0.85rem;
}

.chain-list li + li {
  margin-top: 1.1rem;
}

.chain-list li + li::before {
  content: '';
  position: absolute;
  left: 1.6rem;
  top: -1.1rem;
  height: 1.1rem;
  border-left: 2px solid var(--accent);
}

.chain-doc {
  font-size: 1rem;
  font-weight: 500;
}

.chain-k {
  display: inline-block;
  min-width: 5.5rem;
  color: var(--ink-2);
}

.chain figcaption {
  margin-top: 0.75rem;
}

/* Дати */

.timeline-label {
  margin-bottom: 1rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.timeline {
  list-style: none;
  border-left: 2px solid var(--ink);
}

.timeline li {
  position: relative;
  padding: 0 0 1.5rem 1.4rem;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -0.45rem;
  top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--paper);
  border: 2px solid var(--ink);
}

.section-tint .timeline li::before {
  background: var(--tint);
}

.timeline p {
  margin: 0;
}

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.tl-title {
  font-weight: 600;
}

.tl-text {
  max-width: 48ch;
  color: var(--ink-2);
  font-size: var(--step--1);
}

/* Цени накратко */

.mini {
  width: 100%;
  border-collapse: collapse;
}

.mini tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}

.mini tr:last-child {
  border-bottom: 1px solid var(--rule);
}

.mini th {
  text-align: left;
  font-weight: 600;
}

.mini-limits {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.mini-price {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
}

@media (min-width: 40rem) {
  .mini tr {
    grid-template-columns: 10rem minmax(0, 1fr) auto;
    align-items: baseline;
  }

  .mini-limits {
    grid-column: 2;
    grid-row: 1;
  }

  .mini-price {
    grid-column: 3;
    min-width: 10rem;
  }
}

.price-net {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.price-unit {
  font-size: 0.8rem;
  color: var(--ink-2);
}

.price-gross {
  font-size: 0.8rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.notice {
  padding: 1rem 1.1rem;
  border: 1px solid var(--ink);
  background: var(--sheet);
  max-width: none;
}

/* Сигурност, роли */

.trio {
  display: grid;
  gap: 1.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.trio dt,
.roles dt {
  font-weight: 600;
}

.trio dd,
.roles dd {
  color: var(--ink-2);
  font-size: var(--step--1);
  max-width: 34ch;
}

.roles {
  display: grid;
  gap: 0;
}

.roles > div {
  display: grid;
  gap: 0.1rem 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--rule);
}

.roles > div:last-child {
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 30rem) {
  .roles > div {
    grid-template-columns: 9rem 1fr;
  }
}

.h-quiet {
  margin-bottom: 0.75rem;
}

/* Поток на кантората: това е истинска последователност */

.steps {
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0 0 1.5rem 3.2rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
}

.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 1.05rem;
  top: 2.3rem;
  bottom: 0.2rem;
  border-left: 1px solid var(--rule);
}

.steps h3 {
  margin-bottom: 0.25rem;
}

.steps p {
  margin: 0;
  color: var(--ink-2);
}

/* Калкулация */

.calc {
  width: 100%;
  max-width: 34rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.calc th,
.calc td {
  padding: 0.7rem 0.5rem 0.7rem 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  font-weight: 400;
}

.calc thead th {
  border-top: 0;
  border-bottom: 2px solid var(--ink);
  font-size: 0.8rem;
  color: var(--ink-2);
  font-weight: 500;
  vertical-align: bottom;
}

.calc tbody th {
  font-weight: 600;
}

.calc tbody tr:last-child th,
.calc tbody tr:last-child td {
  border-bottom: 1px solid var(--rule);
}

.num {
  text-align: right !important;
  padding-right: 0 !important;
}

.feat {
  list-style: none;
}

.feat li {
  display: grid;
  gap: 0.1rem 0.75rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}

.feat li:last-child {
  border-bottom: 1px solid var(--rule);
}

.f-name {
  font-weight: 600;
}

.f-desc {
  display: block;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.45;
}

.tag-planned {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1px dashed var(--ink-2);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.feat .tag-planned {
  justify-self: start;
}

/* Сравнителна таблица на плановете */

.scroll-hint {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-2);
}

@media (min-width: 70rem) {
  .scroll-hint {
    display: none;
  }
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--sheet);
}

.compare {
  width: 100%;
  min-width: 58rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.compare th,
.compare td {
  padding: 0.7rem 0.8rem;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}

.compare thead th,
.compare thead td {
  border-top: 0;
  border-bottom: 2px solid var(--ink);
  vertical-align: bottom;
}

.compare tbody th[scope='row'] {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 16rem;
  min-width: 14rem;
  background: var(--sheet);
  font-weight: 500;
}

.compare .grp {
  padding-top: 1.4rem;
  background: var(--tint);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.compare .is-hl {
  background: var(--accent-soft);
}

.compare thead .is-hl {
  box-shadow: inset 0 4px 0 var(--accent);
}

.plan-name {
  display: block;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
}

.plan-for {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-2);
}

.compare .f-desc {
  margin-top: 0.15rem;
}

.tick {
  color: var(--accent);
}

/* Въпроси */

.faq-list {
  border-bottom: 1px solid var(--rule);
}

.faq details {
  border-top: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  flex: none;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.2;
}

.faq details[open] summary::after {
  content: '\2212';
}

.faq summary:hover {
  color: var(--accent);
}

.faq details p {
  padding-bottom: 0.5rem;
  max-width: 60ch;
}

/* Затваряща лента: вторият тъмен панел, един на страница */

.closing {
  background: var(--code-bg);
  color: var(--code-ink);
}

.closing .wrap {
  align-items: center;
}

.closing p {
  margin: 0.75rem 0 0;
  color: var(--code-dim);
}

.closing .muted {
  color: var(--code-dim);
}

.closing-act {
  display: flex;
}

.closing .btn {
  background: var(--on-code-accent);
  border-color: var(--on-code-accent);
  color: var(--on-code-accent-ink);
}

.closing .btn:hover {
  background: transparent;
  color: var(--on-code-accent);
}

.closing :focus-visible {
  outline-color: var(--on-code-accent);
}

@media (min-width: 60rem) {
  .closing-act {
    justify-content: flex-end;
  }
}

/* Статията */

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 1.25rem 0 0;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.article-grid {
  display: grid;
  gap: 1.5rem var(--gap);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

@media (min-width: 64rem) {
  .article-grid {
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 1.5rem;
  }
}

.toc {
  font-size: var(--step--1);
  padding-top: 0.9rem;
  border-top: 2px solid var(--ink);
}

.toc-title {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.toc ol {
  padding-left: 1.2rem;
}

.toc li {
  padding: 0.2rem 0;
}

.prose {
  max-width: var(--measure);
  min-width: 0;
}

.prose p,
.prose li {
  max-width: none;
  line-height: 1.65;
}

.prose h2 {
  margin: 2.6rem 0 0.9rem;
  scroll-margin-top: 1rem;
}

.summary {
  margin: 0 0 1rem;
  padding: 1.1rem 0;
  border-block: 2px solid var(--ink);
  font-size: var(--step-1);
  line-height: 1.55;
}

.prose .timeline {
  margin: 1.2rem 0;
}

.prose .xml {
  margin: 1.4rem 0;
}

.codes {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: var(--step--1);
}

.codes th,
.codes td {
  padding: 0.6rem 0.8rem 0.6rem 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}

.codes thead th {
  border-top: 0;
  border-bottom: 2px solid var(--ink);
  font-weight: 500;
  color: var(--ink-2);
}

.codes tbody tr:last-child th,
.codes tbody tr:last-child td {
  border-bottom: 1px solid var(--rule);
}

.codes .bt {
  margin: 0;
}

.check {
  list-style: none;
}

.check li {
  position: relative;
  padding: 0.3rem 0 0.3rem 2rem;
}

.check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--ink);
}

.sources {
  padding-left: 1.2rem;
}

.sources li {
  padding: 0.2rem 0;
}

/* Грешки */

.err-code {
  margin: 0 0 0.5rem;
  max-width: none;
  font-size: clamp(3.5rem, 12vw, 7rem);
  line-height: 1;
  font-weight: 500;
  color: var(--rule);
}

.err {
  min-height: 50vh;
}

/* Подножие */

.foot {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-size: var(--step--1);
}

.foot-grid {
  display: grid;
  gap: 2rem var(--gap);
  padding-block: 2.5rem 1.5rem;
}

@media (min-width: 52rem) {
  .foot-grid {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  }
}

.foot {
  border-top-color: var(--brand);
}

.foot-name {
  margin: 0 0 0.25rem;
  font-size: var(--step-1);
  font-weight: 600;
}

.foot-tag {
  max-width: 34ch;
  color: var(--ink-2);
}

.foot address {
  font-style: normal;
  line-height: 1.7;
}

.foot ul {
  list-style: none;
}

.foot li a {
  display: inline-block;
  padding: 0.25rem 0;
  text-decoration: none;
}

.foot li a:hover,
.foot-credit a:hover {
  text-decoration: underline;
}

.foot [aria-current] {
  font-weight: 600;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1rem 2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}

.foot-base p {
  margin: 0;
  max-width: none;
}

.foot-credit a {
  font-weight: 600;
  color: var(--ink);
}

/* Правни страници: удобен за четене текст, мярка ~70 знака */

.legal {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4.5rem);
}

.legal-head,
.legal-body,
.legal-others {
  max-width: 46rem;
}

.legal-head {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--ink);
}

.legal-head h1 {
  max-width: 24ch;
}

.legal-meta {
  margin: 0.75rem 0 0;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.legal-body {
  font-size: var(--step-0);
  line-height: 1.7;
}

.legal-body p,
.legal-body li {
  max-width: 70ch;
}

.legal-body h2 {
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.legal-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-body h3 {
  margin: 1.75rem 0 0.5rem;
}

.legal-body ul,
.legal-body ol {
  margin: 0 0 1em;
  padding-left: 1.4rem;
}

.legal-body li {
  padding: 0.15rem 0;
}

.legal-body li::marker {
  color: var(--accent);
}

.legal-body a,
.legal-others a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.legal-body code {
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--tint);
  font-family: var(--font-mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.legal-body .table-wrap {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--sheet);
}

.legal-body table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: var(--step--1);
  line-height: 1.5;
}

.legal-body th,
.legal-body td {
  padding: 0.6rem 0.8rem;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.legal-body thead th {
  border-top: 0;
  border-bottom: 2px solid var(--ink);
  background: var(--tint);
  font-weight: 600;
}

.legal-others {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

.legal-others h2 {
  margin-bottom: 0.5rem;
  font-size: var(--step-1);
}

.legal-others ul {
  list-style: none;
}

.legal-others li a {
  display: inline-block;
  padding: 0.3rem 0;
}

/* Движение: едно оркестрирано появяване на XML, само веднъж и само ако се позволява */

@media (prefers-reduced-motion: no-preference) {
  .specimen .xl {
    animation: line-in 0.45s ease-out both;
  }

  .specimen .xl:nth-child(1) {
    animation-delay: 0.15s;
  }
  .specimen .xl:nth-child(2) {
    animation-delay: 0.3s;
  }
  .specimen .xl:nth-child(3) {
    animation-delay: 0.45s;
  }
  .specimen .xl:nth-child(4) {
    animation-delay: 0.6s;
  }
  .specimen .xl:nth-child(5) {
    animation-delay: 0.75s;
  }
  .specimen .xl:nth-child(6) {
    animation-delay: 0.9s;
  }
  .specimen .xl:nth-child(7) {
    animation-delay: 1.05s;
  }
  .specimen .xl:nth-child(8) {
    animation-delay: 1.2s;
  }
  .specimen .xl:nth-child(9) {
    animation-delay: 1.35s;
  }
  .specimen .xl:nth-child(10) {
    animation-delay: 1.5s;
  }
  .specimen .xl:nth-child(11) {
    animation-delay: 1.65s;
  }
  .specimen .xl:nth-child(12) {
    animation-delay: 1.8s;
  }
  .specimen .xl:nth-child(13) {
    animation-delay: 1.95s;
  }

  .seal-mark {
    animation: stamp 0.5s ease-out 0.1s both;
  }
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateX(-0.4rem);
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: scale(1.6);
  }
}

@media print {
  .top,
  .foot-lang,
  .closing,
  .skip {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
