/* Момент 3 (ТЗ 14.3): проверка партии как ритуал. Анимируются только transform и opacity. */
.rit { margin-top: var(--s-5); }
.rit__stage { position: relative; display: grid; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-panel); background: radial-gradient(120% 90% at 20% 0%, rgba(112, 70, 163, 0.22), transparent 60%), #0B0A0F; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
@media (min-width: 900px) { .rit__stage { grid-template-columns: 320px minmax(0, 1fr); gap: var(--s-6); padding: var(--s-6); align-items: start; } }
.rit__left { display: grid; gap: var(--s-3); align-content: start; justify-items: center; }
@media (min-width: 900px) { .rit__left { position: sticky; top: 96px; } }

/* этикетка */
.rlabel { position: relative; width: min(100%, 300px); border-radius: 16px; background: var(--paper); color: var(--paper-ink); padding: 10px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); }
.rlabel__head { display: grid; gap: 4px; padding: 14px 16px; border-radius: 10px; background: var(--violet); color: #fff; }
.rlabel__head b { font-weight: 400; font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; }
.rlabel__head span { font-family: var(--font-mono); font-size: 12px; opacity: 0.9; }
.rlabel__rows { margin-top: 8px; display: grid; gap: 4px; }
.rlabel__rows > div { position: relative; display: grid; grid-template-columns: 52px 1fr; padding: 6px 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 13px; }
.rlabel__rows dt { color: var(--paper-muted); }
.rlabel__rows dd { overflow-wrap: anywhere; }
.rlabel__rows > .is-lot::before { content: ""; position: absolute; inset: 0; border-radius: 6px; background: rgba(46, 133, 86, 0.28); opacity: 0; }
.rlabel__rows > div > * { position: relative; }
.rlabel__scan { position: absolute; left: -6%; right: -6%; top: 0; height: 2px; background: var(--ok); box-shadow: 0 0 14px 2px rgba(91, 214, 138, 0.8), 0 0 36px 6px rgba(91, 214, 138, 0.35); opacity: 0; transform: translateY(0); will-change: transform; }
.rit[data-st="scan"] .rlabel__scan { animation: rscan 1s cubic-bezier(.45, 0, .25, 1) both; }
.rit[data-st="scan"] .rlabel__rows > .is-lot::before { animation: rhl 0.5s 0.55s ease-out forwards; }
.rit:is([data-st="print"], [data-st="done"]) .rlabel__rows > .is-lot::before { opacity: 1; }
@keyframes rscan { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; transform: translateY(var(--rh, 150px)); } }
@keyframes rhl { to { opacity: 1; } }
.rlabel { --rh: 150px; }

/* подпись-статус (моноширинная: это служебный текст) */
.rit__cap { position: relative; width: min(100%, 300px); min-height: 20px; font-size: 12px; line-height: 1.4; color: var(--ok); }
.rit__cap > span { display: block; position: absolute; inset: 0 auto auto 0; opacity: 0; width: 100%; }
.rit[data-st="scan"] .rit__cap1, .rit[data-st="print"] .rit__cap2, .rit[data-st="done"] .rit__cap3 { opacity: 1; }
.rit__cap { transition: none; }
.rit:not([data-instant]) .rit__cap > span { transition: opacity 0.25s; }
.rit__cap3 { position: static !important; }
.rit[data-st="done"] .rit__cap, .rit[data-st="done"] .rit__cap3 { min-height: 0; }
.rit[data-st="done"] .rit__cap1, .rit[data-st="done"] .rit__cap2 { display: none; }
.rit[data-st="scan"] .rit__cap3, .rit[data-st="print"] .rit__cap3 { position: absolute !important; }

/* «принтер» */
.rit__right { min-width: 0; }
.rit__slot { position: relative; z-index: 2; height: 18px; border-radius: 9px; background: linear-gradient(#26222d, #15131a); box-shadow: inset 0 0 0 1px var(--line-strong), 0 6px 18px rgba(0, 0, 0, 0.5); }
.rit__slot::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 3px; border-radius: 2px; background: #050407; }
.rit__out { position: relative; overflow: hidden; margin: -9px 14px 0; padding-top: 9px; }
.rit__sheet { position: relative; transform: translateY(-101%); will-change: transform; }
.rit__sheet .paper { border-radius: 4px 4px 16px 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.rit[data-st="print"] .rit__sheet, .rit[data-st="done"] .rit__sheet, .rit[data-st="miss"] .rit__sheet { transform: none; }
.rit[data-st="print"] .rit__sheet { transition: transform 0.8s cubic-bezier(.3, .75, .2, 1); }
.rit[data-instant] .rit__sheet { transition: none; }

/* штамп */
.rit .coa__actions { position: relative; padding-bottom: 84px; }
.stamp { position: absolute; right: 4px; bottom: 6px; z-index: 3; display: grid; gap: 2px; justify-items: center; padding: 8px 16px 9px; border: 3px solid #2e8556; border-radius: 12px; color: #2e8556; background: rgba(244, 240, 250, 0.55); transform: rotate(-8deg); opacity: 0; pointer-events: none; font-family: var(--font-mono); text-transform: uppercase; }
.stamp b { font-weight: 500; font-size: clamp(22px, 3.4vw, 32px); letter-spacing: 0.22em; padding-left: 0.22em; line-height: 1.1; }
.stamp span { font-size: 11px; letter-spacing: 0.06em; }
.rit[data-st="done"] .stamp { opacity: 1; animation: rstamp 0.42s cubic-bezier(.2, .9, .3, 1.15) both; }
.rit[data-instant] .stamp { animation: none; }
@keyframes rstamp { 0% { opacity: 0; transform: rotate(-14deg) scale(1.7); } 55% { opacity: 1; } 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }
.rit__links { margin-top: var(--s-3); }
.rit--miss { margin-top: var(--s-5); }

/* в «ритуале» отчёт без собственных кнопок-дублей скролла; на узких экранах штамп не перекрывает чистоту */
.rit__slot { scroll-margin-top: 130px; }
@media (max-width: 899px) { .rit__out { margin-inline: 6px; } .stamp { right: 2px; bottom: 8px; padding: 6px 12px 7px; } .stamp b { font-size: 20px; } .stamp span { font-size: 10px; } }

@media (prefers-reduced-motion: reduce) {
  .rit .rlabel__scan { animation: none !important; opacity: 0; }
  .rit__sheet { transform: none !important; transition: none !important; }
  .stamp { animation: none !important; }
  .rit__cap > span { transition: none !important; }
}
