/* Chistovik · цвета продукта и монтажный стол: кадр чистовика, главы, таймлайн записи и чистовика одной шкалы. */
:root {
  --brand: #5b2a86; --brand-2: #7442a6; --brand-ink: #44206a; --brand-soft: #f2ecf8; --brand-line: #dccdec;
  --accent: #ef476f; --accent-soft: #fde8ee; --accent-ink: #a3183c;
  --cut-p: #e4dfea; --cut-s: #cbc2d6; --cut-d: #a99bbb;
}
.ch { display: flex; flex-direction: column; gap: 12px; }
.ch-head { display: flex; flex-direction: column; gap: 8px; }
.ch-no { font-size: 13px; color: var(--muted); font-weight: 500; }
.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 31px; }
.ch-chip { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 14px; font-weight: 600; border: 1px solid var(--brand-line); white-space: nowrap; }
.ch-chip.c2 { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* верх: кадр чистовика слева, длина и главы справа */
.ch-top { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 22px; align-items: start; }
.ch-mon { margin: 0; min-width: 0; }
.ch-scr { padding: 5px; border-radius: 13px; background: #1f1530; box-shadow: 0 10px 22px -12px rgba(31, 21, 48, .6); }
.ch-msvg { display: block; width: 100%; height: auto; border-radius: 8px; }
.ch-msvg text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ch-cap { margin-top: 7px; font-size: 13px; color: var(--ink-2); }
.ch-cap b { color: var(--good-ink); font-weight: 700; }
.ch-bf .cur { fill: #1d1428; stroke: #fff; stroke-width: 1.2; }
.s-br { fill: var(--brand); }
.s-ac { fill: var(--accent); }
.s-t { font-size: 15px; font-weight: 750; fill: #1d1428; }
.s-f { font-size: 21px; font-weight: 800; fill: var(--brand); }
.s-pw { font-size: 14px; }
.s-fr { font-size: 15px; font-weight: 700; fill: #1d1428; }
.s-s { font-size: 14px; font-weight: 500; fill: #6f6880; }
.s-b { font-size: 14px; font-weight: 550; fill: #2b2236; }
.s-bl { font-size: 14px; }
.s-dot { fill: var(--brand-2); }
.s-bar { fill: #cdbfe0; }
.s-bar.x { fill: var(--accent); }
.s-card rect { fill: #fff; stroke: #d9cde8; }
.s-card .im { fill: #efe7f8; stroke: none; }
.s-card .ln { fill: #ddd3ea; stroke: none; }
.s-card.x > rect:first-child { stroke: var(--accent); stroke-width: 2; }
.s-card.x .im { fill: #fbd7e1; }
.s-n { font-size: 15px; font-weight: 750; fill: #1d1428; }
.s-r { font-size: 14px; font-weight: 500; fill: #6f6880; }
.s-sub { font-size: 15px; font-weight: 700; fill: #fff; }
.ch-bar .bg { fill: rgba(20, 12, 30, .8); }
.ch-bar .sg { fill: rgba(255, 255, 255, .34); }
.ch-bar .pl { fill: var(--accent); }
.ch-bar .hd { fill: #fff; stroke: var(--accent); stroke-width: 2; }

.ch-side { min-width: 0; display: flex; flex-direction: column; }
.ch-cnt { display: flex; align-items: baseline; gap: 12px; min-height: 40px; font-size: 38px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-cr s { position: relative; text-decoration: none; color: var(--ink-2); }
.ch-cr s::after { content: ""; position: absolute; left: -3px; right: -3px; top: 52%; height: 3px; border-radius: 2px; background: var(--accent);
  transform-origin: 0 50%; transform: scaleX(var(--st, 1)); }
.ch-ca { font-style: normal; font-size: 30px; font-weight: 700; color: var(--accent); }
.ch-cf { color: var(--brand); }
.ch-leg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 5px; font-size: 13.5px; color: var(--ink-2); }
.ch-cut em { font-style: normal; font-weight: 750; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.ch-lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ch-lg i { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.ch-lg em { font-style: normal; font-variant-numeric: tabular-nums; }
.ch-lg.p i { background: var(--cut-p); box-shadow: inset 0 0 0 1px #d2c8dc; }
.ch-lg.s i { background: var(--cut-s); }
.ch-lg.d i { background: var(--cut-d); }
.ch-chap { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.ch-chap li { position: relative; display: flex; align-items: center; gap: 10px; padding: 1px 10px 1px 3px; border-radius: 8px; font-size: 14px; line-height: 18px; }
.ch-chap li > i { flex: none; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--brand); color: #fff;
  font-style: normal; font-size: 12px; font-weight: 750; }
.ch-chap li span { min-width: 0; }
.ch-chap li.on:has(> span.in) { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
/* пока главы не собраны, строки стоят заготовками */
.ch-chap li:has(> i:not(.in))::before { content: ""; position: absolute; left: 3px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; border-radius: 50%; background: #ece6f3; }
.ch-chap li:has(> span:not(.in))::after { content: ""; position: absolute; left: 32px; top: 50%; width: 46%; height: 8px; margin-top: -4px; border-radius: 4px; background: #ece6f3; }
.ch-chap li:nth-child(3n + 2):has(> span:not(.in))::after { width: 58%; }
.ch-chap li:nth-child(3n):has(> span:not(.in))::after { width: 38%; }

/* таймлайн: запись и чистовик в одной шкале */
.ch-tl { position: relative; padding: 8px 12px 10px; border: 1px solid var(--brand-line); border-radius: 14px; background: #fcfbfe; }
/* сетка и полосы глав только по дорожкам: штамп, перенесённый строкой ниже, стоит на чистом поле */
.ch-grid { position: absolute; left: 86px; right: 12px; top: 25px; height: 111px; pointer-events: none; }
.ch-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--brand) 9%, transparent); }
.ch-ruler { position: relative; height: 17px; margin-left: 74px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ch-ruler span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.ch-ruler span:first-child { transform: none; }
.ch-ruler span.end { transform: translateX(-100%); font-weight: 700; color: var(--ink-2); }
.ch-row { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; }
.ch-lb { font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.ch-lane { position: relative; height: 26px; }
.ch-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.ch-wave { clip-path: inset(0 calc((1 - var(--rv, 1)) * 100%) 0 0); }
.ch-wave path { fill: var(--brand-2); }
.ch-cuts { clip-path: inset(-2px calc((1 - var(--sc, 1)) * 100%) -2px 0); }
.ch-ct { opacity: .95; }
.t-p { fill: var(--cut-p); }
.t-s { fill: var(--cut-s); }
.t-d { fill: var(--cut-d); }
.ch-scan { position: absolute; top: -4px; bottom: -4px; left: calc(var(--sc, 1) * 100%); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--accent);
  opacity: var(--sl, 0); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.ch-gh { opacity: var(--gh, 0); }
.ch-gh g { transform: translateX(calc(var(--off) * -1 * (1 - var(--gs, 1)))); }
.ch-gh path { fill: var(--accent); }

.ch-clean { position: relative; margin-top: 9px; }
.ch-bands { position: absolute; left: 74px; right: 0; top: -3px; height: 82px; pointer-events: none; }
.ch-bands i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: color-mix(in srgb, var(--brand) 6%, transparent); }
.ch-r-chp .ch-lane { height: 20px; }
.ch-flag { position: absolute; top: 0; margin-left: -1px; }
.ch-flag b { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 750;
  box-shadow: 0 0 0 2px #fcfbfe; }
.ch-r-l2 { margin-top: 3px; }
.ch-r-l2 .ch-lane { height: 22px; }
.ch-it .sl { fill: #fff; stroke: #c9b8de; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.ch-it .tb { fill: var(--brand-2); }
.ch-it.a .sl { fill: #e3d8f0; stroke: #fff; }
.ch-it.a .tb { fill: #c3b0dc; }
.m-subs .ch-it .sl { fill: #f6f2fa; stroke: #b9a3d6; }
.ch-it.on .sl { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2px; }
.ch-it.on .tb { fill: var(--accent); }
.ch-r-cl { margin-top: 3px; }
.ch-r-cl .ch-lane { height: 28px; }
.ch-wave2 path { fill: var(--brand); }
.ch-seg { transform: translateX(calc(var(--dx) * (1 - var(--ks, 1)))); }
.ch-drop { opacity: calc(1 - var(--kd, 1)); transform: translateY(calc(var(--kd, 1) * 14px)); }
/* за концом чистовика одной строкой поверх трёх дорожек: метка длины, потом штамп у правого края.
   Не влезает штамп до рамки (узкий экран, длинный чистовик), он сам переносится строкой под дорожки. */
.ch-free { position: relative; display: flex; flex-wrap: wrap; align-items: center; row-gap: 12px; margin-top: -76px; pointer-events: none; }
.ch-free > i { flex: none; width: calc(74px + (100% - 74px) * var(--fk)); height: 76px; }
.ch-end { align-self: flex-end; margin: 0 18px 3px 6px; padding: 3px 8px; border-radius: 7px; background: var(--brand); color: #fff; font-size: 13px;
  font-weight: 750; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-stamp { --rot: -5deg; margin: 0 6px 2px auto; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 14px;
  border: 3px solid var(--brand); border-radius: 10px; color: var(--brand); background: rgba(255, 255, 255, .93); white-space: nowrap;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent); }
.ch-stamp b { font-size: 16px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.ch-stamp span { font-size: 13.5px; font-weight: 650; }
.ch-stamp.w-stamp:not(.in) { transform: rotate(var(--rot)) scale(1.3); }

/* пузырь переписки: сообщение и под ним папка с Диска, строки плотные, чтобы после прогона сообщение и файлы оставались в кадре */
.ch-fc { margin-top: 7px; padding-left: 11px; border-left: 3px solid var(--brand-line); line-height: 1.25; }
.ch-fc-h { font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 2px; }
.ch-fr { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.ch-fr + .ch-fr { border-top: 1px dashed var(--line); }
.ch-fi { position: relative; flex: none; display: grid; place-items: end center; width: 28px; height: 32px; padding-bottom: 4px; border-radius: 6px;
  background: var(--fc); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; }
.ch-fi::after { content: ""; position: absolute; top: 0; right: 0; border: 5px solid transparent; border-top-color: #fff; border-right-color: #fff; opacity: .85; }
.ch-fx b { display: block; font-size: 14px; font-weight: 600; }
.ch-fx small { display: block; font-size: 12.5px; color: var(--muted); }
.w-timer.ch-ck { font-size: 15px; }
/* шаги чуть плотнее, чтобы на ноутбуке шапка оставалась в одну строку */
.w-right .w-ph { gap: 8px; }
.w-right .w-st { padding-right: 9px; }
@media (max-width: 1365px) { .w-right .w-st { font-size: 12.5px; gap: 5px; padding-right: 8px; } }
@media (min-width: 1181px) and (max-width: 1365px) { html:not(.w-og) .w-right .w-pt { display: none; } }

/* режим проверки (?qa=1): без переходов и анимаций, кадр в любой момент чёткий */
.ch-qa .ch *, .ch-qa .ch *::after, .ch-qa .w-msg, .ch-qa .w-msg *, .ch-qa .w-note, .ch-qa .w-result, .ch-qa .w-st, .ch-qa .w-st i,
.ch-qa .w-pill, .ch-qa .w-card { transition: none !important; animation: none !important; }

/* ноутбук 1366: шесть чипов в одну строку */
@container (max-width: 860px) {
  .ch-chips { gap: 5px; }
  .ch-chip { padding: 5px 9px; }
}
@container (max-width: 800px) {
  .ch-chip { padding: 4px 9px; font-size: 13px; }
  .ch-chip.k2 { display: none; }
  /* ноутбук 1280: штамп плотнее, чтобы и у длинных чистовиков вставал в строку за меткой длины */
  .ch-stamp { padding: 4px 10px; }
  .ch-stamp b { font-size: 14.5px; letter-spacing: .04em; }
}
@container (max-width: 740px) {
  .ch-top { grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
  .ch-cnt { font-size: 32px; gap: 10px; }
  .ch-ca { font-size: 25px; }
}
@container (max-width: 560px) {
  .ch-top { grid-template-columns: minmax(0, 1fr); }
  .ch-mon { max-width: 440px; }
  .ch-row { grid-template-columns: 72px minmax(0, 1fr); }
  .ch-ruler { margin-left: 72px; }
  .ch-ruler span.nr { display: none; }
  .ch-grid { left: 84px; }
  .ch-bands { left: 72px; }
  .ch-flag b { width: 17px; height: 17px; font-size: 11px; margin-top: 1px; }
  .tight .ch-flag b { width: 9px; height: 9px; margin-top: 5px; font-size: 0; }
  .ch-free > i { width: calc(72px + (100% - 72px) * var(--fk)); }
  .ch-stamp { margin-right: auto; }
}

/* итог (?final=1, ?og=1): шаги и карточки сразу в конечном цвете; в превью 1200×630 зелёная плашка уходит за край */
.w-final .w-st, .w-final .w-st i, .w-final .w-pill, .w-final .w-card { transition: none !important; }
.w-og .ch { margin-bottom: 36px; }
