/* Живая цепочка одной сделки — общий вид для /ii-agenty/ и главной
   (разметка — app/partials/ii-chain.php, движок — public/ii-chain.js).
   Своя палитра на .ia-run: на главной нет переменных страницы агентов. */
.ia-run {
	--ia-blue: #1769e0;
	--ia-violet: #6d4aff;
	--ia-grad: linear-gradient(90deg, #1769e0, #6d4aff);
	--ia-ink: #0b1b3a;
	--ia-muted: #43506b;
	--ia-soft: #8a96ab;
	--ia-line: rgba(11, 27, 58, .09);
	--ia-ok: #16a34a;
	--ia-warn: #b45309;
}
.ia-run .ia-robot { display: block; width: 100%; height: 100%; }
/* ── Живая цепочка одной сделки (прототип cepochka.html): дирижёр, линия из
   восьми станций с «посылкой», экран агента, счёт и журнал, итог. ── */
.ia-run__cond { display: flex; gap: 16px; align-items: center; padding: 14px 20px; border-radius: 22px; background: linear-gradient(90deg, #1e2a5a, #3b2a8f); color: #fff; box-shadow: 0 16px 40px rgba(30, 42, 90, .25); }
.ia-run__condbot { width: 56px; height: 63px; flex: none; padding: 3px; border-radius: 14px; background: #fff; }
.ia-run__condtxt { min-width: 0; }
.ia-run__condtxt > b { font-size: 16px; font-weight: 800; }
.ia-run__cmd { min-height: 22px; font-size: 15px; color: #e0e7ff; }
.ia-run__cmd b { color: #fff; }
.ia-run__clock { flex: none; margin-left: auto; padding: 6px 14px; border-radius: 14px; background: rgba(255, 255, 255, .12); font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.ia-run__track { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin: 18px 0; padding-top: 6px; }
.ia-run__rail { position: absolute; left: 6%; right: 6%; top: 44px; height: 4px; border-radius: 2px; background: #e3e8f0; }
.ia-run__rail i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--ia-grad); transition: width .8s ease; }
.ia-run__st { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: transform .4s; }
.ia-run__bot { position: relative; z-index: 1; display: grid; place-items: center; width: 62px; height: 70px; border-radius: 20px; background: #fff; border: 2px solid var(--ia-line); transition: all .4s; }
.ia-run__bot .ia-robot { width: 42px; height: 47px; }
.ia-run__bot .ia-coin { width: 38px; height: 38px; }
.ia-run__nm { font-size: 12px; font-weight: 700; color: var(--ia-muted); }
.ia-run__tm { min-height: 16px; font-size: 11px; font-weight: 700; color: var(--ia-soft); font-variant-numeric: tabular-nums; }
.ia-run__st.is-on { transform: translateY(-4px); }
.ia-run__st.is-on .ia-run__bot { border-color: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent), 0 10px 24px rgba(11, 27, 58, .12); animation: iac-bob 1.2s ease-in-out infinite; }
.ia-run__st.is-on .ia-run__nm { color: var(--ia-ink); }
.ia-run__st.is-done .ia-run__bot { border-color: var(--ia-ok); }
.ia-run__st.is-done .ia-run__bot::after { content: "✓"; position: absolute; right: -6px; top: -6px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ia-ok); color: #fff; font-size: 12px; font-weight: 800; }
.ia-run__st.is-done .ia-run__tm { color: var(--ia-ok); }
.ia-run__pkg { position: absolute; z-index: 2; top: 30px; left: 6%; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #d6a463, #a16207); box-shadow: 0 6px 14px rgba(0, 0, 0, .18); color: #fff; font-size: 12px; font-weight: 800; transform: translateX(-50%); transition: left .9s cubic-bezier(.4, .1, .2, 1); }

.ia-run__screen { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: stretch; }
.ia-run__work { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 340px; padding: 18px 20px; border-radius: 22px; background: #fff; border: 1px solid var(--ia-line); box-shadow: 0 12px 30px rgba(11, 27, 58, .06); }
.ia-run__whead { display: flex; gap: 12px; align-items: center; }
.ia-run__wbot { width: 44px; height: 50px; flex: none; }
.ia-run__wbot .ia-coin { width: 40px; height: 40px; }
.ia-run__whead b { display: block; font-size: 18px; }
.ia-run__status { font-size: 13px; font-weight: 700; color: var(--c, var(--ia-blue)); }
.ia-run__status.is-done { color: var(--ia-ok); }
.ia-run__dots i { display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: currentColor; animation: iac-blink 1s infinite; }
.ia-run__dots i:nth-child(2) { animation-delay: .15s; }
.ia-run__dots i:nth-child(3) { animation-delay: .3s; }
.ia-run__stage { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ia-run__side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ia-run__card { padding: 16px 18px; border-radius: 20px; background: #fff; border: 1px solid var(--ia-line); }
.ia-run__lbl { margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--ia-soft); text-transform: uppercase; letter-spacing: .06em; }
.ia-run__v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ia-run__money.is-hit { background: linear-gradient(135deg, #ecfdf3, #fff); border-color: rgba(22, 163, 74, .4); }
.ia-run__money.is-hit .ia-run__v { color: var(--ia-ok); }
.ia-run__log { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ia-muted); }
.ia-run__log div { animation: iac-pop .3s ease-out; }
.ia-run__log b { color: var(--ia-ink); font-variant-numeric: tabular-nums; }

.ia-run__row { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: #f6f8fb; font-size: 13px; animation: iac-pop .25s ease-out; }
.ia-run__ok { margin-left: auto; color: var(--ia-ok); font-weight: 800; }
.ia-run__big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ia-run__post { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.ia-run__img { display: flex; align-items: flex-end; width: 150px; height: 110px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, var(--ia-ink), var(--ia-blue)); color: #fff; font-size: 13px; font-weight: 800; }
.ia-run__txt { flex: 1; min-width: 180px; min-height: 110px; padding: 10px; border-radius: 12px; background: #f6f8fb; font-size: 13px; }
.ia-run__nets { display: flex; flex-wrap: wrap; gap: 10px; }
.ia-run__net { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: #f1f4f9; color: var(--ia-soft); font-size: 13px; font-weight: 700; transition: all .4s; }
.ia-run__ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #cbd5e1; color: #fff; font-size: 12px; font-weight: 800; }
.ia-run__net small { font-weight: 600; }
.ia-run__net.is-live { color: var(--ia-ink); background: #fff; box-shadow: 0 6px 16px rgba(11, 27, 58, .08); }
.ia-run__net.is-live small { color: var(--ia-ok); }
.ia-run__net.is-soon small { color: var(--ia-warn); }
.ia-run__net.is-live[data-n="tg"] .ia-run__ic { background: #229ed9; }
.ia-run__net.is-live[data-n="ig"] .ia-run__ic { background: linear-gradient(135deg, #f58529, #dd2a7b); }
.ia-run__net.is-live[data-n="fb"] .ia-run__ic { background: #1877f2; }
.ia-run__net.is-live[data-n="site"] .ia-run__ic { background: var(--ia-ink); }
.ia-run__toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ia-run__sw { position: relative; flex: none; width: 44px; height: 24px; border-radius: 12px; background: #cbd5e1; transition: background .3s; }
.ia-run__sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .3s; }
.ia-run__sw.is-on { background: var(--ia-ok); }
.ia-run__sw.is-on::after { left: 23px; }
.ia-run__counters { display: flex; flex-wrap: wrap; gap: 12px; }
.ia-run__cnt { flex: 1; min-width: 110px; padding: 12px; border-radius: 14px; background: #f6f8fb; }
.ia-run__cnt span { font-size: 12px; font-weight: 600; color: var(--ia-soft); }
.ia-run__cnt b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ia-run__bub { max-width: 80%; padding: 9px 12px; border-radius: 14px; font-size: 13px; animation: iac-pop .25s ease-out; }
.ia-run__bub--c { align-self: flex-end; background: var(--ia-grad); color: #fff; }
.ia-run__bub--a { align-self: flex-start; background: #f1f4f9; }
.ia-run__doc { position: relative; display: flex; flex-direction: column; gap: 6px; overflow: hidden; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--ia-line); }
.ia-run__l { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 4px; border-bottom: 1px dashed var(--ia-line); font-size: 13px; animation: iac-pop .25s ease-out; }
.ia-run__l span { color: var(--ia-muted); }
.ia-run__stamp { position: absolute; right: 16px; bottom: 12px; padding: 4px 10px; border: 3px solid #4f46e5; border-radius: 10px; color: #4f46e5; font-weight: 800; opacity: 0; transform: rotate(-10deg) scale(2); transition: all .35s cubic-bezier(.3, 1.6, .5, 1); }
.ia-run__stamp.is-on { opacity: .9; transform: rotate(-10deg) scale(1); }
.ia-run__pay { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.ia-run__payv { font-size: clamp(30px, 5vw, 48px); font-weight: 800; color: var(--ia-ok); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ia-run__coins { position: relative; width: 100%; height: 40px; }
.ia-run__coin { position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fde68a, #f59e0b); animation: iac-drop 1.1s ease-in forwards; }
.ia-run__bars { display: flex; flex-direction: column; gap: 8px; }
.ia-run__bar { display: grid; grid-template-columns: 120px 1fr 120px; gap: 10px; align-items: center; font-size: 13px; }
.ia-run__bar i { display: block; width: 0; height: 12px; border-radius: 6px; transition: width .9s ease; }
.ia-run__bar em { font-style: normal; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.ia-run__tg { align-self: flex-start; max-width: 92%; padding: 10px 12px; border-radius: 14px; background: #e8f4fd; font-size: 13px; animation: iac-pop .3s ease-out; }
.ia-run__tg b { display: block; margin-bottom: 2px; font-size: 12px; color: #229ed9; }
.ia-run__final { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin-top: 18px; padding: 20px 24px; border-radius: 22px; background: linear-gradient(135deg, #1e2a5a, #3b2a8f); color: #fff; animation: iac-pop .4s ease-out; }
.ia-run__final[hidden] { display: none; }
.ia-run__k { font-size: 12px; font-weight: 700; color: #c7d2fe; text-transform: uppercase; letter-spacing: .06em; }
.ia-run__n { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ia-run__final .ia-btn { margin-left: auto; }
@keyframes iac-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes iac-drop { to { transform: translateY(46px); opacity: 0; } }
@keyframes iac-pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes iac-blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

@media (max-width: 900px) {
	.ia-run__track { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
	.ia-run__rail, .ia-run__pkg { display: none; }
	.ia-run__screen { grid-template-columns: 1fr; }
	.ia-run__clock { font-size: 22px; }
	.ia-run__cond { flex-wrap: wrap; }
	.ia-run__bar { grid-template-columns: 90px 1fr 90px; }
}

@media (prefers-reduced-motion: reduce) {
	.ia-run *, .ia-run__st { animation: none !important; transition: none !important; }
}

/* ── Компактный вид главной (Figma 665:5858): белая сцена на тёмном фоне,
   без шапки экрана и итоговой плашки, под станциями «✓ N мин» / «сейчас» /
   «ждёт», журнал справа от экрана. ── */
.ia-run--compact { padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); color: var(--ia-ink); }
.ia-run--compact .ia-run__cond { padding: 12px 16px; border-radius: 18px; box-shadow: none; }
.ia-run--compact .ia-run__condbot { width: 44px; height: 50px; }
.ia-run--compact .ia-run__cmd { font-size: 13.5px; }
.ia-run--compact .ia-run__clock { font-size: 24px; padding: 4px 12px; }
.ia-run--compact .ia-run__track { gap: 6px; margin: 12px 0; }
.ia-run--compact .ia-run__bot { width: 52px; height: 56px; border-radius: 16px; }
.ia-run--compact .ia-run__bot .ia-robot { width: 36px; height: 40px; }
.ia-run--compact .ia-run__bot .ia-coin { width: 32px; height: 32px; }
.ia-run--compact .ia-run__rail { top: 34px; }
.ia-run--compact .ia-run__pkg { top: 22px; width: 24px; height: 24px; font-size: 10px; }
.ia-run--compact .ia-run__nm { max-width: 100%; overflow: hidden; font-size: 11.5px; color: var(--ia-ink); text-overflow: ellipsis; white-space: nowrap; }
.ia-run--compact .ia-run__tm { font-size: 11px; color: var(--ia-soft); }
.ia-run--compact .ia-run__st:not(.is-on):not(.is-done) .ia-run__bot { opacity: .45; }
.ia-run--compact .ia-run__st:not(.is-on):not(.is-done) .ia-run__nm { color: var(--ia-soft); }
.ia-run--compact .ia-run__st.is-on .ia-run__tm { color: var(--ia-ok); }
.ia-run--compact .ia-run__st.is-done .ia-run__tm::before { content: "✓ "; }
.ia-run--compact .ia-run__screen { grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; }
.ia-run--compact .ia-run__work { min-height: 230px; padding: 14px 16px; border-radius: 18px; box-shadow: none; background: #fbfcfe; }
.ia-run--compact .ia-run__card { padding: 12px 14px; border-radius: 16px; background: #f6f8fb; border: 0; }
.ia-run--compact .ia-run__logcard { height: 100%; }
.ia-run--compact .ia-run__log { gap: 5px; font-size: 12px; }
.ia-run--compact .ia-run__payv { font-size: clamp(26px, 3.2vw, 38px); }
.ia-run--compact .ia-run__bar { grid-template-columns: 96px 1fr 96px; }

@media (max-width: 900px) {
	.ia-run--compact { padding: 12px; }
	.ia-run--compact .ia-run__screen { grid-template-columns: 1fr; }
	.ia-run--compact .ia-run__work { min-height: 200px; }
}
