/* Экран «Действия» (.p0-stage--actions). Подключается после frontend-demo/styles/presentation0.css.
   Базовые стили — законченный бит 3: дорожки и workflow. Биты 0–2 —
   селекторы [data-beat]; последовательность внутри бита задают задержки
   анимаций, у которых кадр `from` — начальное состояние, а конец — базовый
   стиль. Поэтому при уменьшенном движении и на снимках виден итог бита. */

/* --- Фон ---------------------------------------------------------------------- */

.p0-actions-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 34% 46% at 62% 36%, rgba(var(--gold-rgb), .12), transparent 70%),
    radial-gradient(ellipse 40% 50% at 20% 70%, rgba(var(--lav-rgb), .08), transparent 70%);
  animation: cs-breathe 9s ease-in-out infinite;
}
.p0-actions-grid {
  position: absolute;
  inset: 0;
  opacity: .45;
  background:
    linear-gradient(90deg, rgba(var(--gold-rgb), .05) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(rgba(var(--gold-rgb), .035) 1px, transparent 1px) 0 0 / 64px 64px;
  mask-image: radial-gradient(ellipse at 55% 45%, #000 30%, transparent 75%);
}

/* --- Общее ---------------------------------------------------------------------- */

.p0-stage--actions .p0-stage__frame > :is(.p0-actions-drafts, .p0-actions-gate, .p0-actions-lanes, .p0-actions-journal, .p0-actions-error, .p0-actions-flow) {
  position: absolute;
  z-index: 3;
  transition: opacity .6s var(--ease), visibility .6s;
}
.p0-actions-mock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .35em 1em;
  border-radius: 999px;
  border: 1px solid rgba(var(--gold-rgb), .7);
  background: linear-gradient(180deg, rgba(var(--gold-rgb), .32), rgba(var(--gold-rgb), .14));
  font-size: calc(.9 * var(--su));
  font-weight: 600;
  color: #fbf3df;
  white-space: nowrap;
}
.p0-actions-mock--ghost { background: transparent; border-color: #efe6d54d; color: #d9d2c3; font-weight: 500; }
.p0-actions-sim {
  padding: .05em .5em;
  border-radius: 999px;
  border: 1px dashed rgba(var(--lav-rgb), .7);
  font: normal 500 calc(.68 * var(--su)) var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgb(var(--lav-rgb));
}
@keyframes p0-actions-in { from { opacity: 0; translate: calc(-1.5 * var(--su)) 0; } }
@keyframes p0-actions-rise { from { opacity: 0; translate: 0 calc(1.5 * var(--su)); } }
@keyframes p0-actions-fade { from { opacity: 0; } }
@keyframes p0-actions-draw { from { stroke-dashoffset: 100; } }

/* --- Шлюз подтверждения: замок ---------------------------------------------------- */

.p0-actions-lock { display: block; width: 100%; height: 100%; overflow: visible; }
.p0-actions-lock__halo { stroke: rgba(var(--gold-rgb), .45); stroke-width: .5; stroke-dasharray: 1.4 1.4; }
.p0-actions-lock__shackle { stroke: rgb(var(--gold-rgb)); stroke-width: 1.8; stroke-linecap: round; translate: 0 -3.2px; }
.p0-actions-lock__body { fill: #2a2619; stroke: rgb(var(--gold-rgb)); stroke-width: 1.2; }
.p0-actions-lock__key { fill: rgb(var(--gold-rgb)); stroke: rgb(var(--gold-rgb)); stroke-width: 1.2; stroke-linecap: round; opacity: 0; }
.p0-actions-lock__check { stroke: #fff4d6; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.p0-actions-lock--large { filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), .55)); }
.p0-actions-lock--large .p0-actions-lock__halo { stroke-width: .35; }
@keyframes p0-actions-unlock { from { translate: 0 0; } }
@keyframes p0-actions-key-out { from { opacity: 1; } }
@keyframes p0-actions-lock-shake {
  20% { transform: rotate(-8deg); }
  45% { transform: rotate(6deg); }
  70% { transform: rotate(-3deg); }
}

/* --- Бит 0 · Черновики (приёмник эстафеты `plan`) ------------------------------- */

.p0-actions-drafts {
  left: calc(3 * var(--su));
  top: calc(5.5 * var(--su));
  width: calc(25 * var(--su));
  padding: calc(1 * var(--su)) calc(1.1 * var(--su));
  border-radius: calc(1.2 * var(--su));
  border: 1px solid #8bb5d44d;
  background: linear-gradient(150deg, #17222ae6, #0f1716e6);
  opacity: 0;
  visibility: hidden;
}
.p0-actions-drafts__title,
.p0-actions-lanes__title,
.p0-actions-journal__title {
  margin: 0 0 calc(.6 * var(--su));
  font: 500 calc(.78 * var(--su)) var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8bb5d4;
}
.p0-actions-drafts ol { display: grid; gap: calc(.45 * var(--su)); margin: 0; padding: 0; list-style: none; }
.p0-actions-draft {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .5em;
  align-items: baseline;
  padding: calc(.45 * var(--su)) calc(.7 * var(--su));
  border-radius: calc(.6 * var(--su));
  border: 1px solid rgba(var(--entity-rgb), .4);
  background: rgba(var(--entity-rgb), .09);
}
.p0-actions-draft .entity-icon { color: rgb(var(--entity-rgb)); font-size: calc(1 * var(--su)); }
.p0-actions-draft b { font-size: calc(1.02 * var(--su)); font-weight: 500; color: #eef1ec; }
.p0-actions-draft small { grid-column: 2; font-size: calc(.74 * var(--su)); color: #9fb0ab; }
.p0-actions-draft[data-external="true"] {
  border-color: rgba(var(--gold-rgb), .8);
  background: rgba(var(--gold-rgb), .12);
  box-shadow: 0 0 calc(1.6 * var(--su)) rgba(var(--gold-rgb), .25);
}
.p0-actions-draft[data-external="true"] small { color: rgb(var(--gold-rgb)); }
@keyframes p0-actions-highlight {
  from { border-color: rgba(var(--entity-rgb), .4); background: rgba(var(--entity-rgb), .09); box-shadow: none; }
}

/* --- Бит 0 · Письмо, шлюз, итог --------------------------------------------------- */

.p0-actions-gate { inset: 0; pointer-events: none; opacity: 0; visibility: hidden; }
.p0-actions-gate > * { position: absolute; }
.p0-actions-wires { inset: 0; width: 100%; height: 100%; overflow: visible; }
.p0-actions-wire { stroke: rgba(var(--gold-rgb), .7); stroke-width: .16; stroke-dasharray: 100; stroke-linecap: round; }
.p0-actions-wire--out { stroke: rgba(var(--mint-rgb), .6); }

.p0-actions-mail {
  left: calc(31.2 * var(--su));
  top: calc(9.5 * var(--su));
  width: calc(25 * var(--su));
  padding: calc(1.1 * var(--su)) calc(1.3 * var(--su));
  border-radius: calc(1.2 * var(--su));
  border: 1px solid rgba(var(--gold-rgb), .55);
  background: linear-gradient(150deg, #2b2a22f2, #151a18f2 70%);
  box-shadow: 0 calc(1.2 * var(--su)) calc(3 * var(--su)) #04070766;
}
.p0-actions-mail__label {
  display: flex;
  align-items: center;
  gap: .5em;
  margin-bottom: calc(.7 * var(--su));
  font: 500 calc(.74 * var(--su)) var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgb(var(--gold-rgb));
}
.p0-actions-mail__label .ui-icon { width: 1.4em; height: 1.4em; }
.p0-actions-mail p { margin: 0; }
.p0-actions-mail__to, .p0-actions-mail__subject {
  padding: calc(.3 * var(--su)) 0;
  border-bottom: 1px solid #efe6d51f;
  font-size: calc(.92 * var(--su));
  color: #c9cfc9;
}
.p0-actions-mail__body { margin-top: calc(.7 * var(--su)) !important; font-size: calc(1.12 * var(--su)); line-height: 1.4; color: #f4f0e7; }
@keyframes p0-actions-mail-in { from { opacity: 0; translate: calc(-6 * var(--su)) calc(-1 * var(--su)); scale: .6; } }
@keyframes p0-actions-bump {
  40% { transform: translateX(calc(1.4 * var(--su))); }
  60% { transform: translateX(calc(.6 * var(--su))); }
}

.p0-actions-barrier {
  left: calc(62 * var(--su));
  top: calc(5 * var(--su));
  width: 2px;
  height: calc(27.5 * var(--su));
  translate: -50% 0;
}
.p0-actions-barrier i {
  position: absolute;
  left: 0;
  width: 2px;
  height: calc(9.5 * var(--su));
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgb(var(--gold-rgb)) 40%, rgb(var(--gold-rgb)));
  box-shadow: 0 0 calc(.8 * var(--su)) rgba(var(--gold-rgb), .7);
}
.p0-actions-barrier__top { top: 0; translate: 0 calc(-1.6 * var(--su)); }
.p0-actions-barrier__bottom { bottom: 0; rotate: 180deg; translate: 0 calc(1.6 * var(--su)); }
@keyframes p0-actions-part { from { translate: 0 0; } }
.p0-actions-gate__lock {
  left: calc(59 * var(--su));
  top: calc(15.3 * var(--su));
  width: calc(6 * var(--su));
  height: calc(6.8 * var(--su));
}
.p0-actions-gate__title {
  left: calc(62 * var(--su));
  top: calc(3.6 * var(--su));
  margin: 0;
  translate: -50% 0;
  font: 500 calc(.74 * var(--su)) var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgb(var(--gold-rgb));
}
.p0-actions-gate__human {
  left: calc(62 * var(--su));
  top: calc(33.4 * var(--su));
  width: calc(28 * var(--su));
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: calc(.5 * var(--su));
}
.p0-actions-mock--confirm { font-size: calc(1 * var(--su)); padding: .45em 1.2em; box-shadow: 0 0 calc(1.8 * var(--su)) rgba(var(--gold-rgb), .35); }
.p0-actions-gate__confirmed {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: calc(.88 * var(--su));
  color: rgb(var(--mint-rgb));
}
.p0-actions-gate__confirmed .ui-icon { width: 1.2em; height: 1.2em; }
.p0-actions-gate__note { font-size: calc(.8 * var(--su)); color: #b9b2a2; font-style: italic; }
@keyframes p0-actions-press { 50% { transform: scale(.92); box-shadow: 0 0 calc(3 * var(--su)) rgba(var(--gold-rgb), .8); } }

.p0-actions-envelope {
  left: calc(55 * var(--su));
  top: calc(17.6 * var(--su));
  display: grid;
  place-items: center;
  width: calc(2.8 * var(--su));
  height: calc(2.8 * var(--su));
  border-radius: 50%;
  background: rgba(var(--gold-rgb), .9);
  color: #1b1a12;
  box-shadow: 0 0 calc(1.5 * var(--su)) rgba(var(--gold-rgb), .9);
  opacity: 0;
}
.p0-actions-envelope .ui-icon { width: 60%; height: 60%; }
@keyframes p0-actions-fly {
  0% { opacity: 0; translate: 0 0; }
  12% { opacity: 1; }
  55% { translate: calc(7 * var(--su)) 0; }
  90% { opacity: 1; }
  100% { opacity: 0; translate: calc(12.5 * var(--su)) calc(-7.6 * var(--su)); }
}

.p0-actions-outcome {
  left: calc(68.4 * var(--su));
  top: calc(8.4 * var(--su));
  width: calc(28.6 * var(--su));
  display: grid;
  gap: calc(1 * var(--su));
  margin: 0;
  padding: 0;
  list-style: none;
}
.p0-actions-outcome li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: calc(.8 * var(--su));
  align-items: center;
  min-height: calc(7 * var(--su));
  padding: calc(.7 * var(--su)) calc(1 * var(--su));
  border-radius: calc(1 * var(--su));
  border: 1px solid rgba(var(--mint-rgb), .35);
  background: #0f1918e6;
}
.p0-actions-outcome__dot {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: calc(2.6 * var(--su));
  height: calc(2.6 * var(--su));
  border-radius: 50%;
  background: rgba(var(--mint-rgb), .16);
  color: rgb(var(--mint-rgb));
}
.p0-actions-outcome__dot .ui-icon { width: 55%; height: 55%; }
.p0-actions-outcome b { font-size: calc(1.1 * var(--su)); font-weight: 600; color: #e9f6f1; }
.p0-actions-outcome small { font-size: calc(.84 * var(--su)); line-height: 1.3; color: #a9bdb7; }
.p0-actions-outcome li[data-k="2"] { border-color: rgba(var(--mint-rgb), .7); box-shadow: 0 0 calc(1.6 * var(--su)) rgba(var(--mint-rgb), .18); }
.p0-actions-outcome li[data-k="2"] small { text-decoration: line-through; text-decoration-color: rgba(var(--mint-rgb), .8); }

/* Бит 0: порядок событий. */
.p0-stage--actions[data-beat="0"] :is(.p0-actions-drafts, .p0-actions-gate) { opacity: 1; visibility: visible; }
.p0-stage--actions[data-beat="0"] .p0-actions-draft[data-external="true"] { animation: p0-actions-highlight .6s var(--ease) 1s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-wire { animation: p0-actions-draw .7s var(--ease) 1.2s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-wire:nth-child(2) { animation-delay: 2.4s; }
.p0-stage--actions[data-beat="0"] .p0-actions-wire--out { animation-delay: calc(5.3s + var(--k) * 1.2s); }
.p0-stage--actions[data-beat="0"] .p0-actions-mail {
  animation: p0-actions-mail-in .8s var(--ease-out) 1.3s both, p0-actions-bump .7s ease-in-out 2.7s both;
}
.p0-stage--actions[data-beat="0"] .p0-actions-gate__lock .p0-actions-lock { animation: p0-actions-lock-shake .5s ease-in-out 3.05s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-gate__lock .p0-actions-lock__shackle { animation: p0-actions-unlock .5s var(--ease-out) 4.2s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-gate__lock :is(.p0-actions-lock__key) { animation: p0-actions-key-out .3s 4.2s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-gate__lock .p0-actions-lock__check { animation: p0-actions-fade .3s 4.4s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-barrier i { animation: p0-actions-part .7s var(--ease-out) 4.25s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-mock--confirm { animation: p0-actions-fade .4s 3.2s both, p0-actions-press .4s ease-in-out 3.8s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-gate__confirmed { animation: p0-actions-rise .4s var(--ease-out) 4.4s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-envelope { animation: p0-actions-fly 1.1s ease-in-out 4.6s both; }
.p0-stage--actions[data-beat="0"] .p0-actions-outcome li { animation: p0-actions-in .5s var(--ease-out) calc(5.6s + var(--k) * 1.2s) both; }
.p0-stage--actions[data-beat="0"] .p0-actions-outcome li[data-k="2"] small { animation: p0-actions-strike .5s 8.4s both; }
@keyframes p0-actions-strike { from { text-decoration-color: transparent; } }

/* --- Биты 1–3 · Дорожки ------------------------------------------------------------- */

.p0-actions-lanes { left: calc(3 * var(--su)); top: calc(4.4 * var(--su)); width: calc(52 * var(--su)); }
.p0-actions-lanes ol { display: grid; gap: calc(.9 * var(--su)); margin: 0; padding: 0; list-style: none; }
.p0-actions-lane {
  --lane-rgb: var(--entity-rgb);
  position: relative;
  display: grid;
  gap: calc(.25 * var(--su));
  padding: calc(.75 * var(--su)) calc(1.1 * var(--su)) calc(.8 * var(--su));
  border-radius: calc(1.1 * var(--su));
  border: 1px solid rgba(var(--lane-rgb), .45);
  background: linear-gradient(120deg, rgba(var(--lane-rgb), .12), #0f1716e6 55%);
  transition: opacity .6s var(--ease), border-color .6s;
}
.p0-actions-lane__head { display: flex; justify-content: space-between; align-items: center; gap: 1em; }
.p0-actions-lane__label {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font: 500 calc(.76 * var(--su)) var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgb(var(--lane-rgb));
}
.p0-actions-lane__who { font-size: calc(.88 * var(--su)); color: #d8ddd8; }
.p0-actions-lane__task { margin: 0; font-size: calc(1.18 * var(--su)); line-height: 1.25; color: #f4f0e7; }
.p0-actions-lane__meta { font-size: calc(.78 * var(--su)); color: #97a7a2; }
.p0-actions-lane__track {
  position: relative;
  height: calc(2.6 * var(--su));
  margin-top: calc(.2 * var(--su));
  --gate-x: 30%;
  --res-x: 40%;
}
.p0-actions-lane__line {
  position: absolute;
  left: calc(.6 * var(--su));
  right: 58%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--lane-rgb), .6), rgba(var(--gold-rgb), .8));
}
.p0-actions-lane__draft {
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(1.1 * var(--su));
  height: calc(1.1 * var(--su));
  translate: 0 -50%;
  border-radius: 50%;
  border: 1px solid rgb(var(--lane-rgb));
  background: rgba(var(--lane-rgb), .35);
}
.p0-actions-lane__gate {
  position: absolute;
  left: var(--gate-x);
  top: 0;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: .3em;
  height: 100%;
}
.p0-actions-lane__gate .p0-actions-lock { width: calc(2.1 * var(--su)); height: calc(2.4 * var(--su)); }
.p0-actions-lane__gate small {
  font: 500 calc(.6 * var(--su)) var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgb(var(--gold-rgb));
}
.p0-actions-lane__run { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.p0-actions-lane__run i {
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(1.1 * var(--su));
  height: calc(1.1 * var(--su));
  translate: 0 -50%;
  border-radius: 50%;
  background: rgb(var(--gold-rgb));
  box-shadow: 0 0 calc(1 * var(--su)) rgb(var(--gold-rgb));
}
.p0-actions-lane__result {
  position: absolute;
  left: var(--res-x);
  right: 0;
  top: 50%;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  gap: .5em;
  min-width: 0;
  padding: .2em .7em;
  border-radius: 999px;
  border: 1px solid rgba(var(--mint-rgb), .5);
  background: rgba(var(--mint-rgb), .1);
  font-size: calc(.86 * var(--su));
  color: #dff3ec;
  white-space: nowrap;
}
.p0-actions-lane__result > span { overflow: hidden; text-overflow: ellipsis; }
.p0-actions-lane__r1, .p0-actions-lane__r2 { display: none; }
.p0-actions-lane__check {
  position: absolute;
  right: calc(1.1 * var(--su));
  top: calc(-1.1 * var(--su));
  display: none;
  align-items: center;
  gap: .4em;
  padding: .2em .8em;
  border-radius: 999px;
  border: 1px solid rgba(var(--amber-rgb), .8);
  background: #2a2014f2;
  font-size: calc(.8 * var(--su));
  color: #ffe2bc;
  white-space: nowrap;
}
.p0-actions-lane__check .ui-icon { width: 1.1em; height: 1.1em; }
@keyframes p0-actions-run {
  0% { translate: 0 0; opacity: 0; }
  8% { opacity: 1; }
  45%, 62% { translate: var(--gate-x) 0; }
  90% { opacity: 1; }
  100% { translate: var(--res-x) 0; opacity: 0; }
}
@keyframes p0-actions-bounce {
  0% { translate: calc(var(--res-x) + 2%) 0; opacity: 0; }
  10% { opacity: 1; }
  50% { translate: calc(var(--gate-x) + 1%) 0; }
  68% { translate: calc(var(--gate-x) + 7%) 0; }
  84% { translate: calc(var(--gate-x) + 3%) 0; }
  100% { translate: calc(var(--gate-x) + 5%) 0; opacity: 1; }
}

/* Бит 0: дорожек ещё нет; workflow появляется только на бите 3. */
.p0-stage--actions[data-beat="0"] .p0-actions-lanes,
.p0-stage--actions:is([data-beat="0"], [data-beat="1"], [data-beat="2"]) .p0-actions-flow { opacity: 0; visibility: hidden; }

/* Бит 1: дорожки по очереди — черновик → шлюз → исполнитель → журнал. */
.p0-stage--actions[data-beat="1"] .p0-actions-lane { animation: p0-actions-in .6s var(--ease-out) calc(var(--k) * .2s) both; }
.p0-stage--actions[data-beat="1"] .p0-actions-lane__run { animation: p0-actions-run 1.8s ease-in-out calc(.5s + var(--k) * 2.7s) both; }
.p0-stage--actions[data-beat="1"] .p0-actions-lane .p0-actions-lock__shackle { animation: p0-actions-unlock .45s var(--ease-out) calc(1.35s + var(--k) * 2.7s) both; }
.p0-stage--actions[data-beat="1"] .p0-actions-lane .p0-actions-lock__key { animation: p0-actions-key-out .3s calc(1.35s + var(--k) * 2.7s) both; }
.p0-stage--actions[data-beat="1"] .p0-actions-lane .p0-actions-lock__check { animation: p0-actions-fade .3s calc(1.5s + var(--k) * 2.7s) both; }
.p0-stage--actions[data-beat="1"] .p0-actions-lane__result { animation: p0-actions-in .5s var(--ease-out) calc(2.1s + var(--k) * 2.7s) both; }
.p0-stage--actions[data-beat="1"] .p0-actions-lane__r1 { display: inline; }
.p0-stage--actions[data-beat="1"] .p0-actions-lane__r3 { display: none; }

/* Бит 2: проверка результата, ошибка возвращается жёлтым отскоком. */
.p0-stage--actions[data-beat="2"] .p0-actions-lane:not([data-lane="automation"]) { opacity: .45; }
.p0-stage--actions[data-beat="2"] .p0-actions-lane[data-lane="automation"] { --lane-rgb: var(--amber-rgb); border-color: rgba(var(--amber-rgb), .8); }
.p0-stage--actions[data-beat="2"] .p0-actions-lane__check { display: inline-flex; animation: p0-actions-rise .45s var(--ease-out) .2s both; }
.p0-stage--actions[data-beat="2"] [data-lane="automation"] .p0-actions-lane__run { opacity: 1; animation: p0-actions-bounce 1.3s ease-out 1s both; }
.p0-stage--actions[data-beat="2"] [data-lane="automation"] .p0-actions-lane__run i { background: rgb(var(--amber-rgb)); box-shadow: 0 0 calc(1.2 * var(--su)) rgb(var(--amber-rgb)); }
.p0-stage--actions[data-beat="2"] [data-lane="automation"] .p0-actions-lane__result {
  border-color: rgba(var(--amber-rgb), .8);
  background: rgba(var(--amber-rgb), .14);
  color: #ffe2bc;
  animation: p0-actions-fade .4s 1.9s both;
}
.p0-stage--actions[data-beat="2"] [data-lane="automation"] .p0-actions-lane__r2 { display: inline; }
.p0-stage--actions[data-beat="2"] [data-lane="automation"] .p0-actions-lane__r3 { display: none; }

/* --- Журнал действий (биты 1–2) --------------------------------------------------- */

.p0-actions-journal {
  left: calc(58 * var(--su));
  top: calc(4.4 * var(--su));
  width: calc(39 * var(--su));
  padding: calc(1 * var(--su)) calc(1.2 * var(--su));
  border-radius: calc(1.2 * var(--su));
  border: 1px solid #efe6d52e;
  background: linear-gradient(150deg, #1a2322e6, #0f1716e6);
  opacity: 0;
  visibility: hidden;
}
.p0-actions-journal__title { color: #dcc699; }
.p0-actions-journal ol { display: grid; gap: calc(.4 * var(--su)); margin: 0; padding: 0; list-style: none; }
.p0-actions-journal li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(.8 * var(--su));
  align-items: baseline;
  padding: calc(.35 * var(--su)) calc(.6 * var(--su));
  border-left: 2px solid rgba(var(--mint-rgb), .6);
  background: #ffffff06;
  font-size: calc(.86 * var(--su));
  line-height: 1.3;
  color: #d6ddd9;
}
.p0-actions-journal time { font: 500 calc(.8 * var(--su)) var(--mono); color: #8fa19c; }
.p0-actions-journal li[data-state="failed"] { display: none; border-left-color: rgb(var(--amber-rgb)); background: rgba(var(--amber-rgb), .1); color: #ffe2bc; }
.p0-stage--actions:is([data-beat="1"], [data-beat="2"]) .p0-actions-journal { opacity: 1; visibility: visible; }
.p0-stage--actions[data-beat="1"] .p0-actions-journal li:not([data-i="0"]) { animation: p0-actions-in .5s var(--ease-out) calc(2.3s + var(--lane) * 2.7s) both; }
.p0-stage--actions[data-beat="2"] .p0-actions-journal li[data-state="failed"] { display: grid; animation: p0-actions-in .5s var(--ease-out) 1.9s both; }

/* --- Ошибка и предложения (бит 2) --------------------------------------------------- */

.p0-actions-error {
  left: calc(58 * var(--su));
  top: calc(23.2 * var(--su));
  width: calc(39 * var(--su));
  display: grid;
  gap: calc(.55 * var(--su));
  padding: calc(1.1 * var(--su)) calc(1.3 * var(--su));
  border-radius: calc(1.2 * var(--su));
  border: 1px solid rgba(var(--amber-rgb), .75);
  background: linear-gradient(150deg, #2c2215f2, #15130ff2 70%);
  box-shadow: 0 0 calc(2.4 * var(--su)) rgba(var(--amber-rgb), .18);
  opacity: 0;
  visibility: hidden;
}
.p0-actions-error p { margin: 0; }
.p0-actions-error__title { display: flex; align-items: center; gap: .5em; font-size: calc(1.2 * var(--su)); font-weight: 600; color: #ffd6a3; }
.p0-actions-error__title .ui-icon { width: 1.2em; height: 1.2em; color: rgb(var(--amber-rgb)); }
.p0-actions-error__text { font-size: calc(.95 * var(--su)); line-height: 1.35; color: #eadfcd; }
.p0-actions-error__hint { font-size: calc(.88 * var(--su)); color: rgb(var(--gold-rgb)); }
.p0-actions-error__options { display: flex; flex-wrap: wrap; gap: calc(.5 * var(--su)); margin-top: calc(.2 * var(--su)); }
.p0-stage--actions[data-beat="2"] .p0-actions-error { opacity: 1; visibility: visible; }
.p0-stage--actions[data-beat="2"] .p0-actions-error > * { animation: p0-actions-rise .5s var(--ease-out) 2.3s both; }
.p0-stage--actions[data-beat="2"] .p0-actions-error > :nth-child(n + 3) { animation-delay: 2.8s; }

/* --- Workflow (бит 3, базовый вид) ----------------------------------------------------- */

.p0-actions-flow {
  left: calc(58 * var(--su));
  top: calc(4.4 * var(--su));
  width: calc(39 * var(--su));
  height: calc(35 * var(--su));
}
.p0-actions-flow__head { position: absolute; left: 0; top: 0; display: grid; gap: calc(.15 * var(--su)); }
.p0-actions-flow__label { font: 500 calc(.74 * var(--su)) var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--lav-rgb)); }
.p0-actions-flow__title { font-size: calc(1.45 * var(--su)); font-weight: 600; color: #f4f0e7; }
.p0-actions-flow__trip { font-size: calc(.86 * var(--su)); color: #a9b5b1; }
.p0-actions-flow__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.p0-actions-flow__orbit { stroke: rgba(var(--lav-rgb), .35); stroke-width: .08; stroke-dasharray: .4 .5; }
.p0-actions-flow__spoke { stroke: rgba(var(--lav-rgb), .5); stroke-width: .09; stroke-dasharray: 100; }
.p0-actions-flow__track { stroke: #ffffff1a; stroke-width: .7; }
.p0-actions-flow__progress { stroke: rgb(var(--mint-rgb)); stroke-width: .7; stroke-linecap: round; stroke-dasharray: 40 100; filter: drop-shadow(0 0 .3px rgb(var(--mint-rgb))); }
.p0-actions-flow__core {
  position: absolute;
  translate: -50% -50%;
  display: grid;
  justify-items: center;
  width: calc(10.4 * var(--su));
  height: calc(10.4 * var(--su));
  align-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, #243231f5, #121a19f5 70%);
  box-shadow: 0 0 calc(2.4 * var(--su)) rgba(var(--lav-rgb), .22);
}
.p0-actions-flow__core b { font-size: calc(1.9 * var(--su)); font-weight: 600; color: #e9f6f1; }
.p0-actions-flow__core small { font-size: calc(.8 * var(--su)); color: #9fb0ab; }
.p0-actions-flow__steps { margin: 0; padding: 0; list-style: none; }
.p0-actions-step {
  position: absolute;
  translate: -50% -50%;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .5em;
  align-items: center;
  width: calc(12.4 * var(--su));
  padding: calc(.45 * var(--su)) calc(.7 * var(--su));
  border-radius: calc(.8 * var(--su));
  border: 1px solid rgba(var(--entity-rgb), .45);
  background: #111a19f2;
}
.p0-actions-step__mark {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: calc(1.9 * var(--su));
  height: calc(1.9 * var(--su));
  border-radius: 50%;
  background: rgba(var(--entity-rgb), .18);
  color: rgb(var(--entity-rgb));
  font-size: calc(1 * var(--su));
}
.p0-actions-step b { font-size: calc(.98 * var(--su)); font-weight: 600; color: #eef1ec; }
.p0-actions-step small { font-size: calc(.72 * var(--su)); line-height: 1.25; color: #9fb0ab; }
.p0-actions-step[data-state="done"] { border-color: rgba(var(--mint-rgb), .7); }
.p0-actions-step[data-state="done"] .p0-actions-step__mark { background: rgba(var(--mint-rgb), .25); color: rgb(var(--mint-rgb)); }
.p0-actions-step[data-state="active"] { border-color: rgba(var(--gold-rgb), .8); box-shadow: 0 0 calc(1.4 * var(--su)) rgba(var(--gold-rgb), .25); }
.p0-actions-step[data-state="todo"] { border-style: dashed; }
.p0-actions-step[data-state="todo"] b { color: #c9cfc9; }
.p0-actions-flow__note {
  display: flex;
  align-items: center;
  gap: .45em;
  margin: calc(.2 * var(--su)) 0 0;
  font-size: calc(.8 * var(--su));
  color: rgb(var(--gold-rgb));
}
.p0-actions-flow__note .ui-icon { width: 1.15em; height: 1.15em; }
@keyframes p0-actions-sprout { from { opacity: 0; translate: calc(-50% + var(--dx)) calc(-50% + var(--dy)); scale: .25; } }
@keyframes p0-actions-arc { from { stroke-dasharray: 0 100; } }
@keyframes p0-actions-core-in { from { opacity: 0; scale: .6; } }

/* Бит 3 и уменьшенное движение: журнал и ошибка уступают место workflow. */
.p0-stage--actions[data-beat="3"] .p0-actions-flow__core { animation: p0-actions-core-in .7s var(--ease-out) .2s both; }
.p0-stage--actions[data-beat="3"] .p0-actions-flow__head { animation: p0-actions-fade .6s .1s both; }
.p0-stage--actions[data-beat="3"] .p0-actions-flow__orbit { animation: p0-actions-fade .8s .5s both; }
.p0-stage--actions[data-beat="3"] .p0-actions-flow__spoke { animation: p0-actions-draw .6s var(--ease) calc(.8s + var(--k) * .3s) both; }
.p0-stage--actions[data-beat="3"] .p0-actions-step { animation: p0-actions-sprout .8s var(--ease-out) calc(.9s + var(--k) * .3s) both; }
.p0-stage--actions[data-beat="3"] .p0-actions-flow__progress { animation: p0-actions-arc 1.2s var(--ease) 2.8s both; }
.p0-stage--actions[data-beat="3"] .p0-actions-step[data-state="active"] .p0-actions-step__mark { animation: cs-breathe 2.4s ease-in-out 3.5s infinite; }
.p0-stage--actions[data-beat="3"] .p0-actions-flow__note { animation: p0-actions-fade .6s 3.6s both; }

/* Эстафета `delegation`: дорожка «человек» уходит в «Команду» без затухания. */
.p0-actions-lane[data-handoff-out] { opacity: 1; }
