/* Страница «Как агент учится» (ucheba.html). Подключается после skhemy.css. Только токены из vitrina.css. */

/* ================= С5.1 «Петля» ================= */
/* Телефон и планшет: столбец шагов на рельсе с номерами, возвратная скоба слева от 5 к 1.
   Десктоп: настоящее кольцо в центре, пять карточек вокруг него по часовой стрелке. */
.petlya { position: relative; display: grid; gap: 32px; }

.petlya__shagi { position: relative; display: grid; gap: 14px; padding-left: 64px; max-width: 44em; }
/* возврат: от низа рельса влево, вверх и обратно в шаг 1 */
.petlya__shagi::before {
  content: ""; position: absolute; left: 4px; top: 24px; bottom: 0; width: 38px;
  border: 2px solid var(--ink-3); border-right: 0; border-radius: 16px 0 0 16px;
}
.petlya__shagi::after { /* наконечник у шага 1 */
  content: ""; position: absolute; left: 13px; top: 19px; width: 10px; height: 10px;
  border-top: 2px solid var(--ink-3); border-right: 2px solid var(--ink-3); transform: rotate(45deg);
}
.petlya__shag { position: relative; }
.petlya__shag::after { /* рельс между номерами */
  content: ""; position: absolute; left: -23px; top: 24px; bottom: -14px; width: 2px; background: var(--ink-3);
}
.petlya__shag--5::after { bottom: 0; }

.petlya__k {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-plashka);
}
.petlya__k b { font-family: var(--f-display); font-size: 19px; font-weight: 620; letter-spacing: -.012em; line-height: 1.2; }
.petlya__k > span:last-child { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.petlya__k--razbor { border: 1.5px solid var(--red); }
.petlya__k--razbor b { color: var(--red); }
.petlya__k--pravilo { border: 1.5px solid var(--ink); }

.petlya__n {
  position: absolute; z-index: 1; left: -40px; top: 8px;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--ink-3);
  font-family: var(--f-display); font-size: 15px; font-weight: 650; color: var(--ink);
}
.petlya__k--razbor .petlya__n { border: 2px solid var(--red); color: var(--red); }
.petlya__k--pravilo .petlya__n { border: 2px solid var(--ink); }

/* вход сотрудника: человек - чёрная рамка 2 px, короткая стрелка вверх к разбору */
.petlya__menedzher {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 24px); margin: 30px 0 0 24px; padding: 10px 16px 10px 12px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r-plashka);
  color: var(--ink);
}
.petlya__menedzher::before { content: ""; position: absolute; left: 28px; bottom: 100%; width: 2px; height: 26px; background: var(--ink); }
.petlya__menedzher::after {
  content: ""; position: absolute; left: 24px; bottom: calc(100% + 18px); width: 8px; height: 8px;
  border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); transform: rotate(45deg);
}
.petlya__menedzher svg { flex: none; }
.petlya__menedzher span { display: flex; flex-direction: column; line-height: 1.3; }
.petlya__menedzher b { font-size: 15px; }
.petlya__menedzher small { font-size: var(--t-small); color: var(--ink-2); }

/* кольцо: на узком экране вместо него - крупная подпись под шагами */
.petlya__krug { position: relative; }
.petlya__krug svg { display: none; }
.petlya__centr {
  font-family: var(--f-display); font-size: clamp(21px, 1rem + 1vw, 28px); font-weight: 650;
  letter-spacing: -.02em; line-height: 1.18; max-width: 18em; text-wrap: balance;
}

.petlya__fon { fill: var(--surface); }
.petlya__duga { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.petlya__tochki circle { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.5; }
.petlya__tochki text { fill: var(--ink); font-family: var(--f-display); font-size: 15px; font-weight: 650; text-anchor: middle; dominant-baseline: central; }
.petlya__tochki circle.petlya__tochka--razbor { stroke: var(--red); stroke-width: 2; }
.petlya__tochki text.petlya__tochka--razbor { fill: var(--red); }
.petlya__tochki circle.petlya__tochka--pravilo { stroke: var(--ink); stroke-width: 2; }

/* пример у петли: пунктирная карточка с видимой меткой */
.petlya__primer { padding: 20px 22px; border: 1px dashed var(--ink-3); border-radius: var(--r-kartochka); max-width: 44em; }
.petlya__primer p + p { margin-top: 8px; }
.petlya__primer > p:not(.petlya__metka) { font-size: 15.5px; line-height: 1.5; }
.petlya__primer small { display: block; margin-top: 12px; font-size: var(--t-label); color: var(--ink-2); }
.petlya__metka {
  display: inline-flex; align-items: center; margin-bottom: 4px; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  font-size: var(--t-label); font-weight: 600; letter-spacing: .02em; color: var(--ink-2);
}

@media (min-width: 1080px) {
  .petlya {
    grid-template-columns: minmax(0, 1fr) clamp(330px, 30vw, 380px) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    column-gap: 44px; row-gap: 18px; align-items: end;
  }
  .petlya__shagi { display: contents; }
  .petlya__shagi::before, .petlya__shagi::after, .petlya__shag::after { content: none; }
  .petlya__shag--1 { grid-area: 1 / 2; }
  .petlya__shag--2 { grid-area: 2 / 3; }
  .petlya__shag--3 { grid-area: 3 / 3; }
  .petlya__shag--4 { grid-area: 3 / 1; }
  .petlya__shag--5 { grid-area: 2 / 1; }
  .petlya__shag--3, .petlya__shag--4 { align-self: center; }
  .petlya__shag--4 .petlya__k, .petlya__shag--5 .petlya__k { margin-left: auto; }
  .petlya__k { max-width: 23em; }
  .petlya__shag--1 .petlya__k { max-width: none; text-align: center; align-items: center; }
  .petlya__n { position: static; width: 30px; height: 30px; font-size: 14px; margin-bottom: 4px; }

  .petlya__krug { grid-area: 2 / 2 / 4 / 3; align-self: center; aspect-ratio: 1; }
  .petlya__krug svg { display: block; width: 100%; height: 100%; overflow: visible; }
  .petlya__centr {
    position: absolute; inset: 0; display: grid; place-items: center;
    padding: 0 21%; text-align: center; font-size: clamp(19px, .8rem + .7vw, 23px);
  }

  .petlya__menedzher { position: absolute; left: 18px; top: calc(100% + 34px); margin: 0; }
  .petlya__primer { grid-area: 4 / 1 / 5 / 3; margin-top: 40px; max-width: 40em; }
}

/* кольцо прорисовывается один раз по часовой, когда схема видна */
@media (prefers-reduced-motion: no-preference) {
  .js .petlya .petlya__duga { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
  .js .petlya.vidno .petlya__duga { animation: s-ucheba-duga 460ms var(--ease-out) forwards; animation-delay: calc(300ms + var(--i) * 150ms); }
}
@keyframes s-ucheba-duga { to { stroke-dashoffset: 0; } }

/* текст под петлёй */
.cikl-tekst { display: grid; gap: 20px; margin-top: clamp(56px, 7vw, 88px); }
.cikl-tekst .tekst { margin-top: 0; }
.cikl-tekst a, .kanon-tekst a, .zamer__schitaem a, .razlichie__p a, .riski a, .navyk__marshrut a { color: var(--blue); text-underline-offset: 3px; }
.u-vas {
  padding: 16px 20px; border-left: 3px solid var(--ink); border-radius: 0 var(--r-plashka) var(--r-plashka) 0;
  background: var(--surface); color: var(--ink-2); max-width: 44em; text-wrap: pretty;
}
.u-vas b { color: var(--ink); }
@media (min-width: 900px) { .cikl-tekst { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; } }

/* ================= Первый шаг сотрудника + С5.1а «Отметка в черновике» ================= */
.otmetka { display: grid; gap: 40px; }
.otmetka .z-pod { max-width: 16em; }
.otmetka .tekst { margin-top: 16px; }
.otmetka__shagi { display: grid; gap: 0; margin-top: 24px; }
.otmetka__shagi > div { padding: 14px 0; border-top: 1px solid var(--line); }
.otmetka__shagi > div:last-child { border-bottom: 1px solid var(--line); }
.otmetka__shagi dt { font-weight: 600; }
.otmetka__shagi dd { margin-top: 4px; color: var(--ink-2); }
@media (min-width: 900px) { .otmetka { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; align-items: start; } .otmetka .maket { position: sticky; top: 96px; } }

.maket__okno { padding: 18px 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-kartochka); }
.maket__z { padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
.maket__stroka { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.maket__stroka i, .maket__kol i { display: block; height: 8px; border-radius: 4px; background: var(--line); }
.maket__tovar { width: 56%; }
.maket__tovar--d { width: 44%; }
.maket__tovar--k { width: 14%; }
.maket__stroka--pravka { margin-top: 6px; border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--bg-alt); }
.maket__kol { display: flex; align-items: center; gap: 10px; width: 26%; justify-content: flex-end; }
.maket__kol s { position: relative; display: block; width: 44%; text-decoration: none; }
.maket__kol s i { background: var(--ink-3); opacity: .45; }
.maket__kol s::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px; margin-top: -1px; background: var(--red); border-radius: 1px; }
.maket__kol .maket__novoe { width: 44%; background: var(--ink); }
.maket__pochemu {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px; border-radius: 0 0 10px 10px; background: var(--bg-alt);
}
.maket__vopros { margin-right: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.maket__var {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.maket__var--vybrano { background: var(--knopka-bg); border-color: var(--knopka-bg); color: var(--knopka-tekst); }
.maket__zavtra { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--bg-alt); font-size: 14.5px; line-height: 1.4; }
.maket__zavtra small { display: block; margin-bottom: 2px; font-size: var(--t-label); font-weight: 600; color: var(--ink-3); }
.maket figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--ink-2); }

/* ================= различия «холдинг / небольшая компания» ================= */
.razlichie { margin-top: clamp(56px, 8vw, 96px); }
.razlichie .vybor { margin-top: 16px; }
.razlichie__p { margin-top: 18px; max-width: 46em; color: var(--ink-2); text-wrap: pretty; }
.razlichie__p .metka { margin-right: 6px; vertical-align: 1px; }
.razlichie__p + .razlichie__p { margin-top: 12px; }

/* ================= 5.2 Три документа ================= */
.dokumenty { display: grid; gap: 20px; }
@media (min-width: 900px) { .dokumenty { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.dokument {
  padding: 24px 24px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 6px 6px 0 var(--bg-alt);
}
.dokument h3 { font-family: var(--f-display); font-size: var(--t-h3); font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
.dokument p { margin-top: 10px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }

.sverka { margin-top: clamp(40px, 5vw, 56px); padding: 22px 24px 24px; border: 1px dashed var(--ink-3); border-radius: var(--r-kartochka); max-width: 52em; }
.sverka__tekst { margin-top: 4px; max-width: 44em; text-wrap: pretty; }
.sverka__para { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.sverka__list { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; background: var(--surface); font-size: 15px; font-weight: 500; }
.sverka__list small { font-size: var(--t-label); font-weight: 600; color: var(--ink-3); }
.sverka__list--pismo { border: 1.5px dashed var(--ink-3); }
.sverka__list--pismo s { color: var(--ink-3); text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.sverka__list--faktura { border: 1px solid var(--ink-3); }
.sverka__ne { font-family: var(--f-display); font-size: 24px; font-weight: 650; color: var(--red); }

.kanon-tekst .tekst { margin-top: 0; }

/* ================= 5.3 Пять правил ================= */
.pravila { display: grid; max-width: 64em; }
.pravila__r { display: grid; gap: 6px; padding: 18px 0; border-top: 1px solid var(--line); }
.pravila__r:last-child { border-bottom: 1px solid var(--line); }
.pravila dt { font-family: var(--f-display); font-size: 19px; font-weight: 620; letter-spacing: -.012em; line-height: 1.25; }
.pravila dd { margin: 0; color: var(--ink-2); max-width: 40em; }
@media (min-width: 768px) { .pravila__r { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; padding: 22px 0; } }

/* ================= С5.2 «Отладка и замер»: две стопки и разделительная линия ================= */
.nabory__ryad { display: grid; gap: 28px; justify-items: center; }
.nabory__liniya { width: 100%; max-width: 360px; height: 2px; border-radius: 1px; background: var(--ink); }
.nabor { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 22em; text-align: center; }
.nabor b { font-size: 16.5px; line-height: 1.35; }
.nabor small { font-size: var(--t-small); color: var(--ink-2); }
.nabor__pisma { position: relative; width: 168px; height: 110px; margin: 0 0 35px 35px; }
.nabor--zamer .nabor__pisma { width: 132px; height: 88px; margin: 0 0 14px 14px; }
.nabor__pisma i {
  position: absolute; inset: 0; border: 1.5px solid var(--ink-3); border-radius: 6px; background: var(--surface);
  transform: translate(calc(var(--k, 0) * -7px), calc(var(--k, 0) * 7px));
}
.nabor__pisma i:nth-last-child(2) { --k: 1; }
.nabor__pisma i:nth-last-child(3) { --k: 2; }
.nabor__pisma i:nth-last-child(4) { --k: 3; }
.nabor__pisma i:nth-last-child(5) { --k: 4; }
.nabor__pisma i:nth-last-child(6) { --k: 5; }
.nabor__pisma i:last-child::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 52%; clip-path: polygon(0 0, 50% 100%, 100% 0); background: var(--line); border-radius: 5px 5px 0 0; }
.nabory .podpis-krupno { margin: 40px auto 0; text-align: center; max-width: 26em; }
@media (min-width: 768px) {
  .nabory__ryad { grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr); gap: 56px; align-items: end; }
  .nabory__liniya { width: 2px; max-width: none; height: auto; align-self: stretch; }
}

.zamer__schitaem { margin-top: clamp(48px, 6vw, 72px); }

.u-menya { display: grid; gap: 14px; margin-top: 20px; }
@media (min-width: 768px) { .u-menya { grid-template-columns: 1fr 1fr; gap: 16px; } }
.u-menya__k { padding: 22px 24px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-kartochka); }
.u-menya__k h4 { margin: 0; font-family: var(--f-display); font-size: 19px; font-weight: 620; letter-spacing: -.012em; line-height: 1.25; }
.u-menya__k p { margin-top: 8px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }

/* ================= 5.4 раскрывающийся пример, причины, С5.3 ================= */
.raskryt { margin-top: clamp(36px, 5vw, 48px); max-width: 52em; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-kartochka); }
.raskryt summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 14px 20px; cursor: pointer; list-style: none;
  font-weight: 600; border-radius: var(--r-kartochka);
  -webkit-tap-highlight-color: transparent;
}
.raskryt summary::-webkit-details-marker { display: none; }
.raskryt summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-top: -4px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg); transition: transform 200ms var(--ease-out);
}
.raskryt[open] summary::after { transform: translateY(4px) rotate(-135deg); }
@media (hover: hover) { .raskryt summary:hover::after { border-color: var(--ink); } }
.raskryt__telo { padding: 0 20px 20px; }
.raskryt__telo p { color: var(--ink-2); max-width: 46em; text-wrap: pretty; }

.snoska { font-size: 12.5px; line-height: 0; }
.snoska a { padding: 0 2px; color: var(--blue); font-weight: 600; text-decoration: none; }
.snoska a:hover { text-decoration: underline; }

#sami .blok > .riski { margin-top: 20px; }
@media (min-width: 1000px) { .riski--tri { grid-template-columns: repeat(3, 1fr); } }
#sami .podpis-krupno { margin-top: clamp(48px, 6vw, 64px); max-width: 32em; }

.navyk { display: grid; justify-items: center; }
.navyk__start {
  position: relative; padding: 14px 22px; text-align: center;
  background: var(--surface); border: 1.5px dashed var(--ink-3); border-radius: var(--r-plashka);
}
.navyk__start::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 28px; background: var(--ink-3); }
.navyk__razvilka { width: 100%; margin-top: 28px; }
.navyk__ramka { padding: 2px; }
.navyk .razvilka__vetka { gap: 12px; }
.navyk__cep { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.navyk .razvilka__vetka b,
.navyk .navyk__zveno {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font-family: var(--f-text); font-size: 16px; font-weight: 600; letter-spacing: 0; line-height: 1.3; color: var(--ink);
}
.navyk .navyk__zveno--kanon { border: 2px solid var(--ink); }
.navyk__zveno--kanon::before { content: ""; position: absolute; left: 22px; bottom: 100%; width: 1.5px; height: 22px; background: var(--ink-3); }
.navyk__zveno--kanon::after {
  content: ""; position: absolute; left: 19px; bottom: calc(100% + 1px); width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg);
}
@media (min-width: 560px) {
  .navyk__cep { flex-direction: row; align-items: center; gap: 32px; }
  .navyk__zveno--kanon::before { left: auto; right: 100%; bottom: 50%; width: 32px; height: 1.5px; }
  .navyk__zveno--kanon::after { left: -10px; bottom: auto; top: 50%; margin-top: -3.5px; transform: rotate(-45deg); }
}
.navyk__podpis { margin-top: 28px; font-size: var(--t-small); font-weight: 600; color: var(--ink-2); text-align: center; }
.navyk__marshrut { margin-top: clamp(40px, 5vw, 56px); }

.istochniki { margin-top: clamp(56px, 7vw, 80px); padding-top: 20px; border-top: 1px solid var(--line); max-width: 52em; }
.istochniki h3 { font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
.istochniki ol { margin-top: 10px; padding-left: 20px; list-style: decimal; font-size: var(--t-small); color: var(--ink-2); }
.istochniki li + li { margin-top: 6px; }
.istochniki li:target { color: var(--ink); }
.istochniki a { color: var(--ink-2); text-underline-offset: 3px; }
.istochniki__adres { overflow-wrap: anywhere; }

/* ================= «Куда дальше» на четыре вопроса ================= */
.dalshe--4 a span { margin-top: 4px; font-size: var(--t-small); color: var(--ink-2); }

/* ================= ритм блоков внутри экранов ================= */
.otmetka { margin-top: clamp(80px, 11vw, 136px); }
#zamer .blok { margin-top: clamp(56px, 7vw, 88px); }
#zamer .razlichie { margin-top: clamp(48px, 6vw, 72px); }
#zamer .razlichie .vybor { margin-top: 0; }
.poyasn > .metka { display: flex; width: max-content; margin-bottom: 12px; }
.ekran--alt .poyasn > .metka--net { background: var(--surface); }
@media (max-width: 1079px) { .petlya { grid-template-columns: minmax(0, 1fr); } }
.petlya > *, .petlya__shag { min-width: 0; }
.petlya__menedzher { width: fit-content; }
#sami .blok { margin-top: clamp(56px, 7vw, 80px); }
