/* mishas.tips — статья. Дополнение к styles.css раздела /distributors/ (фирменный стиль MISHAS CONTENT). */

/* плашка черновика */
.draftbar { background: var(--ink); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: var(--track); line-height: 1.15; }
.draftbar-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.draftbar button { font: inherit; text-transform: uppercase; letter-spacing: inherit; color: #fff; background: none; border: 1px solid rgba(255, 255, 255, .45); min-height: 36px; padding: 8px 12px; cursor: pointer; transition: background .15s, color .15s; }
.draftbar button:hover, .draftbar button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.draftbar button:focus-visible { outline-color: #fff; }

/* шапка статьи */
.page-head--article h1 { font-size: clamp(36px, 6.2vw, 88px); max-width: 17ch; }
.h1-accent { display: block; margin-top: 14px; font-size: clamp(24px, 3.2vw, 44px); line-height: 1.15; color: var(--red); max-width: 24ch; }
.page-head--article .lead { max-width: 68ch; }

/* сетка */
.layout--article { grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; padding-bottom: 72px; }
.article { min-width: 0; }
.sec { scroll-margin-top: 24px; }
.sec + .sec { margin-top: 72px; }
.sec .group-head h2, .sec .group-num { font-size: clamp(24px, 3vw, 40px); }
.sec .group-head { gap: 16px; }
.sec .group-num { flex: none; }

/* текст */
.body { padding-top: 24px; font-size: 17px; line-height: 1.62; }
.body > * { max-width: 70ch; }
.body > .table-wrap, .body > .fig, .body > .stats, .body > .faq, .body > .sources, .body > .sources-group { max-width: none; }
.body > * + * { margin-top: 16px; }
.body h3 { font-size: 17px; font-weight: 800; line-height: 1.2; margin-top: 44px; scroll-margin-top: 24px; }
.body h3 + * { margin-top: 12px; }
.body strong { font-weight: 600; }
.body ul, .body ol { padding-left: 24px; margin-bottom: 0; }
.body li + li { margin-top: 8px; }
.body ul > li::marker { color: var(--red); }
.body ol > li::marker { color: var(--red); font-weight: 500; font-variant-numeric: tabular-nums; }
.body a { overflow-wrap: anywhere; }

/* сноски на источники */
.cite { font-size: .68em; line-height: 0; vertical-align: super; margin-left: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 400; }
.cite a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.cite a + a::before { content: ','; margin-right: 2px; }
.cite a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--red); }

/* выноски */
.callout { background: var(--surface); border-top: 1px solid var(--line-strong); padding: 18px 22px 20px; margin-top: 28px; }
.callout + * { margin-top: 28px; }
.callout-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: var(--track); line-height: 1.15; }
.callout-label::before { content: '●'; color: var(--red); font-size: 11px; }
.callout p:not(.callout-label) { font-size: 16px; line-height: 1.55; }

/* пометки редактора (только в черновике) */
.ed { border: 1px dashed var(--red); padding: 16px 20px 18px; margin-top: 28px; }
.ed + * { margin-top: 28px; }
.ed-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.ed-label .accent { font-size: 22px; line-height: 1.1; color: var(--red); }
.ed-kind { font-size: 11px; text-transform: uppercase; letter-spacing: var(--track); color: var(--muted); }
.ed-text { font-size: 15px; line-height: 1.5; }
body.hide-ed .ed { display: none; }

/* цифры */
.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; padding: 0 !important; }
.stats--4 + * { margin-top: 28px; }
.stats--4 li { padding: 16px 16px 0 0; align-content: start; gap: 8px; margin: 0 !important; }
.stats--4 .stat-num { display: flex; align-items: baseline; font-size: clamp(32px, 3.4vw, 48px); line-height: 1; white-space: nowrap; }
.stats--4 .stat-num small { font-size: .42em; line-height: 1; font-weight: 500; margin-left: .25em; letter-spacing: 0; }
.stats--4 .stat-label { line-height: 1.3; }

/* схемы */
.fig { margin: 32px 0 0; }
.fig + * { margin-top: 32px; }
.fig-cap { margin-top: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: var(--track); line-height: 1.15; color: var(--muted); }
.flow { list-style: none; margin: 0; padding: 0 !important; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.flow li { position: relative; display: grid; align-content: start; gap: 8px; padding: 16px 20px 20px; border-right: 1px solid var(--line); margin: 0 !important; }
.flow li:first-child { padding-left: 0; }
.flow li:last-child { border-right: 0; padding-right: 0; }
.flow li:not(:last-child)::after { content: '▶'; position: absolute; right: -6px; top: 15px; font-size: 11px; line-height: 1; color: var(--red); background: var(--bg); padding: 3px 0; }
.flow-num { font-size: 12px; color: var(--muted); letter-spacing: var(--track); }
.flow-title { font-size: 19px; font-weight: 500; text-transform: uppercase; letter-spacing: var(--track); line-height: 1.1; overflow-wrap: anywhere; }
.flow-text { font-size: 14px; line-height: 1.45; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0 !important; border-top: 1px solid var(--line-strong); }
.steps > li { display: grid; grid-template-columns: 48px minmax(0, 230px) minmax(0, 1fr); gap: 6px 20px; padding: 16px 0 18px; border-bottom: 1px solid var(--line); margin: 0 !important; }
.step-num { font-size: 19px; font-weight: 500; color: var(--red); letter-spacing: var(--track); line-height: 1.15; }
.step-title { font-size: 19px; font-weight: 500; text-transform: uppercase; letter-spacing: var(--track); line-height: 1.15; }
.step-meta { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: var(--track); line-height: 1.15; color: var(--muted); }
.step-out { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }
.step-out li { position: relative; padding-left: 18px; margin: 0 !important; }
.step-out li::before { content: '▶'; position: absolute; left: 0; top: .42em; font-size: 9px; line-height: 1; color: var(--red); }

/* таблицы */
.body .table-wrap { margin-top: 24px; }
.body .table-wrap + * { margin-top: 24px; }
.body .ctable { font-size: 15px; line-height: 1.5; }
.body .ctable thead th { font-weight: 400; vertical-align: bottom; }
.body .ctable td:last-child { color: inherit; font-variant-numeric: normal; padding-right: 0; }
.body .ctable td:first-child { width: 30%; font-weight: 500; }
.body .ctable td:first-child strong { font-weight: 500; }

/* FAQ */
.faq details p { font-size: 16px; line-height: 1.6; }
.faq + * { margin-top: 28px; }

/* источники */
.sources-note { font-size: 15px; color: var(--muted); }
.sources-group { font-size: 12px !important; font-weight: 500 !important; margin-top: 32px !important; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.sources { list-style: none; margin: 0 !important; padding: 0 !important; font-size: 14px; line-height: 1.45; }
.sources li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 8px; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0 !important; scroll-margin-top: 24px; }
.src-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.src-title { display: block; }
.src-url { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; text-decoration-color: var(--line); }
.src-url:hover { color: var(--text); }
.sources li:target { background: var(--surface); box-shadow: -12px 0 0 var(--surface), 12px 0 0 var(--surface), -15px 0 0 var(--red); }

/* оглавление */
.side--toc { top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.3; text-decoration: none; transition: color .15s; }
.toc-num { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.toc a.is-active { font-weight: 600; }
.toc a.is-active .toc-num { color: var(--red); font-weight: 600; }
.toc-m { display: none; }

@media (max-width: 960px) {
  .layout--article { grid-template-columns: 1fr; gap: 0; padding-bottom: 56px; }
  .side--toc { display: none; }
  .toc-m { display: block; margin-bottom: 40px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
  .toc-m summary { display: flex; justify-content: space-between; align-items: center; min-height: 52px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: var(--track); }
  .toc-m summary::-webkit-details-marker { display: none; }
  .toc-m summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--red); }
  .toc-m[open] summary::after { content: '−'; }
  .toc-m .toc { padding-bottom: 12px; }
  .toc-m .toc a { padding: 11px 0; }
  .toc-m .toc li:last-child a { border-bottom: 0; }
}
@media (max-width: 720px) {
  .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .stats--4 li:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 16px; }
  .flow { grid-template-columns: 1fr; border-bottom: 0; }
  .flow li, .flow li:first-child, .flow li:last-child { grid-template-columns: 40px minmax(0, 1fr); gap: 4px 8px; padding: 14px 0 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .flow li:not(:last-child)::after { content: none; }
  .flow-num { grid-row: 1 / span 2; padding-top: 4px; }
  .flow-title, .flow-text { grid-column: 2; }
  .steps > li { grid-template-columns: 40px minmax(0, 1fr); gap: 4px 8px; }
  .step-out { grid-column: 2; margin-top: 8px !important; }
}
@media (max-width: 640px) {
  .sec + .sec { margin-top: 56px; }
  .sec .group-head { gap: 10px; }
  .body { font-size: 16px; line-height: 1.6; }
  .callout, .ed { padding-left: 16px; padding-right: 16px; }
  .ctable--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ctable--stack, .ctable--stack tbody { display: block; }
  .ctable--stack tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .ctable--stack td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; }
  .ctable--stack td:first-child { font-size: 16px; }
  .ctable--stack td + td { margin-top: 10px; }
  .ctable--stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 11px; text-transform: uppercase; letter-spacing: var(--track); line-height: 1.15; color: var(--muted); }
}
@media print {
  .draftbar, .tm, .side--toc, .toc-m { display: none; }
}

/* FAQ внутри секции: без двойной линии под заголовком */
.body > .faq:first-child { margin-top: -12px; }
.body > .faq details:first-of-type { border-top: 0; }

/* скриншоты */
.fig--shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #0f0f0f; }
