/* Модуль «Подписки и рассрочка»: год подписки на живом графике платежей (автодемо) и мини-виджеты особенностей.
   Разметка — resources/views/site/modules/subscriptions.blade.php, сценарий — subscriptions.js */
.sb, .sbf {
    --sb-ease: cubic-bezier(.2, .7, .2, 1);
    --sb-spring: cubic-bezier(.3, 1.6, .5, 1);
    --sb-green: #22a35a; --sb-mint: #5fd38d;
    --sb-red: #e05555; --sb-ice: #6cb4f5; --sb-ice-d: #3d8bd9; --sb-ice-bg: #e6f1fc;
    --sb-amber: #e0a030; --sb-violet: #8f9cff;
    --sb-night: #15151d; --sb-night-2: #1d1d2b;
}
.sb-head { max-width: 800px; }
.sb-head .lead { margin-top: 18px; }

/* ── Окно ── */
.sb-app {
    position: relative; margin-top: 44px; background: #fff; border: 1px solid var(--line-card); border-radius: 16px;
    box-shadow: 0 1px 2px rgba(20, 20, 19, .04), 0 30px 80px rgba(20, 20, 19, .10); overflow: hidden; user-select: none; font-size: 13px;
}
.sb-bar { min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.sb-ava { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #f0a35e, #d9668a); }
.sb-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sb-who b { font-size: 14px; font-weight: 600; }
.sb-who small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--chip); color: var(--ink-2); transition: background .35s, color .35s; }
.sb-st i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sb-st[data-st='active'], .sb-st[data-st='open'] { background: var(--ok-soft); color: var(--ok); }
.sb-st[data-st='active'] i, .sb-st[data-st='open'] i { animation: sb-pulse 1.6s infinite; }
.sb-st[data-st='frozen'] { background: var(--sb-ice-bg); color: var(--sb-ice-d); }
.sb-st[data-st='debt'], .sb-st[data-st='paused'] { background: var(--bad-soft); color: var(--bad); }
.sb-st[data-st='open'] { background: var(--accent-soft); color: var(--accent); }
@keyframes sb-pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.sb-card { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.sb-card-n { display: inline-block; overflow: hidden; height: 18px; line-height: 18px; }
.sb-card-n b { display: block; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sb-card.is-flip b { animation: sb-flipin .5s var(--sb-ease); }
@keyframes sb-flipin { from { transform: translateY(100%); opacity: 0; } }

.sb-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.sb-main { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* KPI */
.sb-kpis { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 10px; }
.sb-kpi { position: relative; border: 1px solid var(--line-card); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: border-color .3s, background .3s; }
.sb-kpi small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-kpi b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sb-kpi b i { font-style: normal; color: var(--faint); font-weight: 500; font-size: 15px; }
.sb-kpi-paid b { font-size: 22px; }
.sb-kpi-paid.is-bump { border-color: rgba(34, 163, 90, .5); background: var(--ok-soft); }
.sb-kpi-paid.is-bump b { animation: sb-bump .45s var(--sb-spring); }
@keyframes sb-bump { 40% { transform: scale(1.06); } }
.sb-gate b { font-size: 15px; }
.sb-gate-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; transition: background .3s, color .3s; }
.sb-gate[data-g='open'] .sb-gate-ico { background: var(--ok-soft); color: var(--ok); }
.sb-gate[data-g='closed'] { border-color: rgba(178, 58, 58, .35); }
.sb-gate[data-g='closed'] .sb-gate-ico { background: var(--bad-soft); color: var(--bad); }
.sb-gate[data-g='closed'] b { color: var(--bad); }
.sb-gate[data-g='frozen'] .sb-gate-ico { background: var(--sb-ice-bg); color: var(--sb-ice-d); }
.sb-gate[data-g='frozen'] b { color: var(--sb-ice-d); }
.sb-gate.is-flash { animation: sb-shake .45s; }

/* ── Река года ── */
.sb-river {
    position: relative; border-radius: 14px; padding: 14px 16px 16px; color: #ececf3;
    background: radial-gradient(120% 140% at 0% 0%, #23233a 0%, var(--sb-night) 55%), var(--sb-night);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.sb-river::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 22px 22px; }
.sb-rail-h { display: flex; align-items: center; gap: 12px; min-height: 22px; }
.sb-rail-h b { font-size: 13px; font-weight: 600; color: #fff; letter-spacing: .04em; }
.sb-band-t { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--sb-ice); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .4s; }
.sb-band-t.is-off { opacity: 0; }
.sb-rail { position: relative; height: 4px; margin: 12px 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.sb-rail > i { position: absolute; top: -3px; width: 1px; height: 10px; background: rgba(255, 255, 255, .18); }
.sb-flow { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, #1b7a45, var(--sb-mint)); box-shadow: 0 0 14px rgba(95, 211, 141, .55); }
.sb-flow::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: sb-shine 2.4s linear infinite; }
@keyframes sb-shine { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.sb-band { position: absolute; top: -5px; height: 14px; border-radius: 4px; background: repeating-linear-gradient(135deg, rgba(108, 180, 245, .85) 0 4px, rgba(108, 180, 245, .45) 4px 8px); box-shadow: 0 0 12px rgba(108, 180, 245, .6); transform-origin: left; }
.sb-band.is-off { transform: scaleX(0); opacity: 0; }
.sb-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18), 0 0 18px rgba(255, 255, 255, .7); }

.sb-tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.sb-tile {
    position: relative; padding: 8px 7px 9px; border-radius: 10px; min-width: 0; min-height: 92px;
    background: rgba(255, 255, 255, .04); border: 1px dashed rgba(255, 255, 255, .16);
    display: flex; flex-direction: column; gap: 1px; opacity: 0; transform: translateY(10px) scale(.92);
    transition: opacity .45s var(--sb-ease), transform .45s var(--sb-spring), background .35s, border-color .35s, box-shadow .35s;
}
.sb-tile.is-in { opacity: 1; transform: none; }
.sb-tile small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: rgba(236, 236, 243, .55); }
.sb-day { position: relative; display: block; height: 24px; overflow: hidden; font-size: 20px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-day span { display: block; transition: transform .55s var(--sb-spring); }
.sb-day-b { position: absolute; left: 0; top: 0; transform: translateY(110%); color: var(--sb-ice); }
.sb-tile.is-sh .sb-day-a { transform: translateY(-110%); }
.sb-tile.is-sh .sb-day-b { transform: none; }
.sb-tile[data-st='paid'] .sb-day-b, .sb-tile[data-st='link'] .sb-day-b { color: #fff; }
.sb-amt { font-size: 11px; color: rgba(236, 236, 243, .6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-fee { font-size: 9.5px; color: var(--sb-amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ico { position: absolute; top: 7px; right: 6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .3s, transform .4s var(--sb-spring); }
.sb-ico-paid { background: var(--sb-green); color: #fff; }
.sb-ico-bad { background: var(--sb-red); color: #fff; }
.sb-ico-link { background: var(--sb-violet); color: #161626; }
.sb-tile[data-st='paid'] .sb-ico-paid, .sb-tile[data-st='declined'] .sb-ico-bad, .sb-tile[data-st='link'] .sb-ico-link { opacity: 1; transform: none; }
.sb-tag { margin-top: auto; font-style: normal; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 13px; color: var(--sb-violet); }
.sb-tile[data-st='paid'] { background: rgba(34, 163, 90, .17); border: 1px solid rgba(95, 211, 141, .45); }
.sb-tile[data-st='link'] { background: rgba(143, 156, 255, .16); border: 1px solid rgba(143, 156, 255, .55); }
.sb-tile[data-st='charging'] { border: 1px solid rgba(255, 255, 255, .7); animation: sb-charge 1s ease-in-out infinite; }
.sb-tile[data-st='charging'] .sb-tag { color: #fff; }
@keyframes sb-charge { 50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .12), 0 0 22px rgba(255, 255, 255, .25); } }
.sb-tile[data-st='declined'] { background: rgba(224, 85, 85, .17); border: 1px solid rgba(224, 85, 85, .6); }
.sb-tile[data-st='declined'] .sb-tag { color: #ff9b9b; }
.sb-tile.is-shake { animation: sb-shake .45s; }
@keyframes sb-shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.sb-tile.is-ice { box-shadow: 0 0 0 1px rgba(108, 180, 245, .7), 0 0 16px rgba(108, 180, 245, .35); }
.sb-tile.is-ice .sb-tag { color: var(--sb-ice); }
.sb-tile.is-now { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.sb-att { position: absolute; left: 7px; right: 7px; bottom: -11px; display: flex; justify-content: center; gap: 4px; }
.sb-att i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .2); transition: background .3s, transform .3s var(--sb-spring); }
.sb-att i.is-bad { background: var(--sb-red); box-shadow: 0 0 8px rgba(224, 85, 85, .8); }
.sb-att i.is-try { background: #fff; transform: scale(1.35); }
.sb-tile:not([data-st='declined']) .sb-att { opacity: .55; }

/* Следующий год */
.sb-next { margin-top: 18px; opacity: .16; transition: opacity .5s; }
.sb-next:not(.is-on) p { visibility: hidden; }
.sb-next.is-on { opacity: 1; }
.sb-next p { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent); color: #9fb6ff; font-weight: 600; margin-bottom: 8px; }
.sb-next-cells { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.sb-next span { border-radius: 8px; border: 1px dashed rgba(159, 182, 255, .45); padding: 5px 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 2px; min-width: 0; }
.sb-next span small { font-size: 9.5px; text-transform: uppercase; color: rgba(236, 236, 243, .5); }
.sb-next span b { font-size: 12px; font-weight: 600; color: #cfd9ff; }
.sb-next.is-on span { animation: sb-pop .5s var(--sb-spring) backwards; animation-delay: calc(var(--k) * 45ms + .2s); }
@keyframes sb-pop { from { opacity: 0; transform: scale(.6); } }

/* Монитор */
.sb-mon { border: 1px solid var(--line-card); border-radius: 12px; padding: 10px 12px; }
.sb-cap { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.sb-log { list-style: none; margin: 0; padding: 0; height: 84px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.sb-log li { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; align-items: center; padding: 4px 0 4px 12px; position: relative; font-size: 12.5px; flex: none; }
.sb-log li::before { content: ''; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--ok); }
.sb-log li[data-t='bad']::before { background: var(--bad); }
.sb-log li[data-t='warn']::before { background: var(--sb-amber); }
.sb-log li[data-t='ice']::before { background: var(--sb-ice-d); }
.sb-log li[data-t='acc']::before { background: var(--accent); }
.sb-log time { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-log span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-log li.is-new { animation: sb-logIn .45s var(--sb-ease); }
.sb-log li.is-new span { color: var(--ink); }
@keyframes sb-logIn { from { opacity: 0; transform: translateY(10px); } }

/* ── Чат клиента ── */
.sb-chat { position: relative; border-left: 1px solid var(--line); background: var(--screen); display: flex; flex-direction: column; min-height: 0; }
.sb-chat-h { height: 59px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.sb-chat-ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #6d5cf5, #2f5bd8); flex: none; }
.sb-chat-h span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.sb-chat-h b { font-size: 13px; font-weight: 600; }
.sb-chat-h small { font-size: 11.5px; color: var(--muted); }
.sb-msgs { position: absolute; left: 0; right: 0; top: 59px; bottom: 0; overflow: hidden; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.sb-msg { display: none; flex: none; max-width: 94%; background: #fff; border: 1px solid var(--line-card); border-radius: 4px 14px 14px 14px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.sb-msg.is-on { display: block; }
.sb-msg.is-new { animation: sb-msgIn .5s var(--sb-spring); }
@keyframes sb-msgIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.sb-msg[data-t='decline'] { border-color: rgba(178, 58, 58, .3); background: #fffafa; }
.sb-msg[data-t='freeze'] { border-color: rgba(61, 139, 217, .3); background: #f7fbff; }
.sb-msg[data-t='paid'] { border-color: rgba(31, 122, 69, .3); background: #f6fcf8; }
.sb-paylink { margin-top: 8px; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 10px; background: var(--ink); color: #fff; transition: transform .15s, background .3s; }
.sb-paylink > span { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.sb-paylink b { font-size: 13px; font-weight: 600; }
.sb-paylink small { font-size: 11px; color: rgba(255, 255, 255, .65); }
.sb-paylink.is-press { transform: scale(.94); background: var(--ok); }
.sb-paylink.is-done { background: var(--ok); }

/* Монета */
.sb-coin { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #0e3d22; background: linear-gradient(135deg, #8ff0b4, #3fcf7e); box-shadow: 0 6px 18px rgba(34, 163, 90, .45); white-space: nowrap; will-change: transform, opacity; }

/* ── Управление ── */
.sb-ctl { display: flex; align-items: stretch; gap: 16px; margin-top: 16px; }
.sb-steps { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.sb-steps button { align-content: start; position: relative; width: 100%; height: 100%; text-align: left; border: 1px solid var(--line-card); background: #fff; border-radius: 12px; padding: 12px 12px 10px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px; font: inherit; color: var(--ink); overflow: hidden; transition: border-color .2s, background .2s; }
.sb-steps button:hover { border-color: var(--line-strong); background: var(--hover-soft); }
.sb-st-n { grid-row: span 2; font-size: 12px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 1px; }
.sb-steps b { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.sb-steps small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.sb-st-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: transparent; }
.sb-st-bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.sb-steps li.is-done .sb-st-bar i { transform: scaleX(1); background: var(--sb-green); }
.sb-steps li.is-cur button { border-color: var(--ink); }
.sb-steps li.is-cur .sb-st-n { color: var(--ink); }
.sb-steps li.is-done .sb-st-n { color: var(--ok); }
.sb-ctl-btns { display: flex; flex-direction: column; gap: 8px; }
.sb-ctl-btns .btn { white-space: nowrap; justify-content: center; }

/* ── Особенности ── */
.sbf-grid { margin-top: 40px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sbf-card { border: 1px solid var(--line-card); border-radius: 16px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.sbf-card > h3 { display: flex; align-items: flex-start; gap: 9px; font-size: 17px; font-weight: 600; line-height: 1.35; margin: 18px 20px 8px; }
.sbf-card > h3 .i { flex: none; margin-top: 3px; color: var(--accent); }
.sbf-card > p { margin: 0 20px 20px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.sbf-vis {
    position: relative; height: 196px; padding: 18px; border-bottom: 1px solid var(--line); overflow: hidden;
    background-color: #fbfbfa;
    background-image: linear-gradient(rgba(47, 91, 216, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(47, 91, 216, .06) 1px, transparent 1px);
    background-size: 18px 18px; background-position: -1px -1px;
    display: flex; flex-direction: column; justify-content: center; gap: 10px; font-size: 12.5px;
}
.sbf.is-on .sbf-vis * { animation-play-state: running; }
.sbf-vis * { animation-play-state: paused; }

/* Доступ */
.sbf-strip { position: relative; display: flex; height: 40px; border-radius: 10px; overflow: visible; }
.sbf-seg { display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; }
.sbf-seg.is-paid { flex: 0 0 60%; background: var(--ok-soft); color: var(--ok); border-radius: 10px 0 0 10px; border: 1px solid rgba(31, 122, 69, .25); }
.sbf-seg.is-unpaid { flex: 1; background: repeating-linear-gradient(135deg, #fff 0 6px, var(--bad-soft) 6px 12px); color: var(--bad); border-radius: 0 10px 10px 0; border: 1px dashed rgba(178, 58, 58, .4); border-left: 0; }
.sbf-today { position: absolute; top: -8px; bottom: -8px; left: 10%; width: 2px; background: var(--ink); border-radius: 2px; animation: sbf-today 6s var(--sb-ease) infinite; }
.sbf-today::before { content: ''; position: absolute; top: -5px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
@keyframes sbf-today { 0%, 8% { left: 10%; } 45%, 92% { left: 82%; } 100% { left: 10%; } }
.sbf-turn { position: relative; height: 36px; }
.sbf-turn span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; font-weight: 600; font-size: 13px; }
.sbf-turn-a { background: var(--ok); color: #fff; animation: sbf-tA 6s infinite; }
.sbf-turn-b { background: var(--bad); color: #fff; opacity: 0; animation: sbf-tB 6s infinite; }
@keyframes sbf-tA { 0%, 30% { opacity: 1; transform: none; } 34%, 96% { opacity: 0; transform: translateY(-6px); } 100% { opacity: 1; } }
@keyframes sbf-tB { 0%, 30% { opacity: 0; transform: translateY(6px); } 34%, 92% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }

/* Карта истекает */
.sbf-cardexp .sbf-vis { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; gap: 14px 10px; }
.sbf-plastic { position: relative; width: 138px; height: 64px; border-radius: 10px; padding: 9px 12px; color: #fff; background: linear-gradient(135deg, #3b3b55, #15151d); box-shadow: 0 8px 20px rgba(20, 20, 30, .25); display: flex; flex-direction: column; justify-content: flex-end; animation: sbf-card 6s var(--sb-ease) infinite; }
.sbf-plastic b { font-size: 13px; letter-spacing: .08em; font-weight: 600; }
.sbf-plastic small { font-size: 10.5px; color: #ffb4a8; }
.sbf-chip { position: absolute; top: 10px; left: 12px; width: 20px; height: 14px; border-radius: 3px; background: linear-gradient(135deg, #e8c879, #b3923f); }
@keyframes sbf-card { 0% { transform: translateX(-30px) rotate(-6deg); opacity: 0; } 12%, 100% { transform: rotate(-3deg); opacity: 1; } }
.sbf-due { display: flex; min-width: 0; flex-direction: column; align-items: flex-end; gap: 5px; }
.sbf-due small { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line-card); border-radius: 999px; padding: 3px 8px; color: var(--ink-2); font-size: 11px; }
.sbf-due em { font-style: normal; display: inline-flex; align-items: center; gap: 4px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 600; animation: sbf-blink 6s infinite; }
@keyframes sbf-blink { 0%, 20% { opacity: 0; transform: scale(.8); } 26%, 100% { opacity: 1; transform: none; } 30%, 38% { box-shadow: 0 0 0 5px rgba(138, 90, 14, .12); } }
.sbf-bubble { grid-column: 1 / -1; justify-self: end; margin: 0; max-width: 88%; background: #fff; border: 1px solid var(--line-card); border-radius: 14px 4px 14px 14px; padding: 8px 10px; font-size: 12px; line-height: 1.4; box-shadow: 0 6px 16px rgba(20, 20, 19, .06); animation: sbf-bub 6s var(--sb-spring) infinite; }
@keyframes sbf-bub { 0%, 40% { opacity: 0; transform: translateY(10px) scale(.95); } 48%, 100% { opacity: 1; transform: none; } }

/* Льготное окно */
.sbf-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.sbf-days i { height: 46px; border-radius: 8px; background: #fff; border: 1px solid var(--line-card); display: grid; place-items: center; font-style: normal; animation: sbf-day 7s infinite; animation-delay: calc(var(--k) * .55s); }
.sbf-days b { font-size: 14px; font-weight: 600; color: var(--ink-2); }
@keyframes sbf-day { 0% { background: #fff; } 6%, 60% { background: var(--warn-soft); border-color: rgba(138, 90, 14, .3); } 70%, 100% { background: #f1f1ef; border-color: var(--line-card); opacity: .55; } }
.sbf-gstate { position: relative; height: 30px; margin: 0; }
.sbf-gstate span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.sbf-gstate .a { background: var(--warn-soft); color: var(--warn); animation: sbf-gA 7s infinite; }
.sbf-gstate .b { background: var(--ink); color: #fff; opacity: 0; animation: sbf-gB 7s infinite; }
@keyframes sbf-gA { 0%, 66% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes sbf-gB { 0%, 68% { opacity: 0; transform: scale(.9); } 72%, 96% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Закрытие клуба */
.sbf-clubs { display: flex; flex-direction: column; gap: 8px; }
.sbf-clubs p { margin: 0; }
.sbf-clubs .is-closing { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-card); border-radius: 10px; padding: 7px 10px; font-weight: 600; }
.sbf-clubs .is-closing span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbf-clubs em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.sbf-pays { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.sbf-pays i { height: 22px; border-radius: 6px; background: var(--ok-soft); border: 1px solid rgba(31, 122, 69, .3); position: relative; }
.sbf-pays i.is-stop { animation: sbf-stop 6s infinite; animation-delay: calc((var(--k) - 3) * .15s); }
.sbf-pays i.is-stop::after { content: ''; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; margin-top: -1px; background: var(--bad); transform: scaleX(0); animation: sbf-strike 6s infinite; animation-delay: inherit; }
@keyframes sbf-stop { 0%, 30% { background: #fff; border: 1px dashed var(--line-strong); } 40%, 100% { background: #f3f3f1; border: 1px dashed var(--line-strong); } }
@keyframes sbf-strike { 0%, 34% { transform: scaleX(0); } 44%, 100% { transform: scaleX(1); } }
.sbf-stop { display: inline-flex; align-items: center; gap: 6px; color: var(--bad); font-weight: 600; animation: sbf-fade 6s infinite; }
.sbf-keep { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 11.5px; animation: sbf-fade2 6s infinite; }
@keyframes sbf-fade { 0%, 36% { opacity: 0; transform: translateY(4px); } 44%, 100% { opacity: 1; transform: none; } }
@keyframes sbf-fade2 { 0%, 56% { opacity: 0; } 64%, 100% { opacity: 1; } }

/* Монитор */
.sbf-monitor .sbf-vis { justify-content: flex-start; gap: 8px; }
.sbf-table { background: #fff; border: 1px solid var(--line-card); border-radius: 10px; padding: 2px 10px; }
.sbf-table p { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--row); font-size: 12px; animation: sbf-row 7s var(--sb-ease) infinite; animation-delay: calc(var(--k) * .35s); }
.sbf-table p:last-child { border-bottom: 0; }
.sbf-table span { color: var(--ink-2); white-space: nowrap; }
.sbf-table b { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.sbf-table b[data-t='ok'] { background: var(--ok-soft); color: var(--ok); }
.sbf-table b[data-t='bad'] { background: var(--bad-soft); color: var(--bad); }
.sbf-table b[data-t='warn'] { background: var(--warn-soft); color: var(--warn); }
.sbf-table b[data-t='mute'] { background: var(--chip); color: var(--muted); }
@keyframes sbf-row { 0% { opacity: 0; transform: translateX(-8px); } 6%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.sbf-run { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }

/* Прогноз */
.sbf-bars { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; min-height: 0; }
.sbf-bars > div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.sbf-bars span { position: relative; width: 100%; max-width: 38px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.sbf-bars i { display: block; width: 100%; height: var(--h); transform-origin: bottom; animation: sbf-grow 6s var(--sb-ease) infinite; animation-delay: calc(var(--k) * .18s); }
.sbf-bars i.d { background: linear-gradient(180deg, #4f7ae6, var(--accent)); border-radius: 0 0 5px 5px; }
.sbf-bars i.d:first-child, .sbf-bars span i.p[style*='--h: 0%'] + i.d { border-radius: 5px; }
.sbf-bars i.p { background: repeating-linear-gradient(135deg, var(--accent-soft) 0 5px, #c9d7fa 5px 10px); border: 1px dashed rgba(47, 91, 216, .5); border-bottom: 0; border-radius: 5px 5px 0 0; }
.sbf-bars i[style*='--h: 0%'] { border: 0; }
.sbf-bars small { font-size: 11px; color: var(--muted); }
@keyframes sbf-grow { 0% { transform: scaleY(0); } 14%, 100% { transform: scaleY(1); } }
.sbf-legend { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.sbf-legend span { display: inline-flex; align-items: center; gap: 4px; }
.sbf-legend i { width: 9px; height: 9px; border-radius: 2px; }
.sbf-legend i.d { background: var(--accent); }
.sbf-legend i.p { background: repeating-linear-gradient(135deg, var(--accent-soft) 0 2px, #c9d7fa 2px 4px); border: 1px dashed rgba(47, 91, 216, .5); }
.sbf-legend b { margin-left: auto; color: var(--ink); font-size: 12px; font-weight: 600; }

/* Лимиты */
.sbf-allow .sbf-vis { gap: 9px; }
.sbf-paid { margin: 0; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 3px 10px; animation: sbf-paidF 6s infinite; }
@keyframes sbf-paidF { 0%, 52% { opacity: .35; transform: scale(.95); } 56%, 72% { opacity: 1; transform: scale(1.05); } 80%, 100% { opacity: 1; transform: none; } }
.sbf-meter { display: grid; grid-template-columns: 1fr 22px; grid-template-rows: auto auto; column-gap: 10px; row-gap: 4px; align-items: center; }
.sbf-meter small { grid-column: 1 / -1; color: var(--ink-2); font-size: 11.5px; }
.sbf-meter span { height: 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line-card); overflow: hidden; }
.sbf-meter span i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--sb-ice-d), var(--sb-ice)); border-radius: inherit; transform-origin: left; animation: sbf-drain 6s var(--sb-ease) infinite; }
.sbf-meter-g span i { background: linear-gradient(90deg, #7c5cf0, #a38bff); animation-name: sbf-drain2; }
.sbf-meter b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
@keyframes sbf-drain { 0% { transform: scaleX(1); } 40%, 52% { transform: scaleX(.4); } 60%, 100% { transform: scaleX(1); } }
@keyframes sbf-drain2 { 0% { transform: scaleX(1); } 40%, 52% { transform: scaleX(.5); } 60%, 100% { transform: scaleX(1); } }
.sbf-burn { font-style: normal; align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #c2410c; background: #fff1e8; border-radius: 999px; padding: 2px 8px; animation: sbf-burnF 6s infinite; }
@keyframes sbf-burnF { 0%, 50% { opacity: 0; transform: translateY(4px); } 56%, 84% { opacity: 1; transform: none; } 92%, 100% { opacity: 0; } }

/* Достройка периодов */
.sbf-pgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.sbf-pgrid i { height: 20px; border-radius: 5px; background: var(--ok-soft); border: 1px solid rgba(31, 122, 69, .3); }
.sbf-pgrid i.is-new { background: var(--accent-soft); border: 1px dashed rgba(47, 91, 216, .55); animation: sbf-newp 6s var(--sb-spring) infinite; animation-delay: calc((var(--k) - 6) * .08s); }
@keyframes sbf-newp { 0%, 42% { opacity: 0; transform: scale(.5); } 50%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.sbf-pstate { position: relative; height: 18px; margin: 0; font-weight: 600; }
.sbf-pstate span { position: absolute; left: 0; top: 0; white-space: nowrap; }
.sbf-pstate .a { color: var(--ok); animation: sbf-gA 6s infinite; animation-name: sbf-psA; }
.sbf-pstate .b { color: var(--accent); opacity: 0; animation: sbf-psB 6s infinite; }
@keyframes sbf-psA { 0%, 42% { opacity: 1; } 46%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes sbf-psB { 0%, 44% { opacity: 0; } 50%, 94% { opacity: 1; } 100% { opacity: 0; } }
.sbf-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 500; font-size: 12px; animation: sbf-press 6s infinite; }
@keyframes sbf-press { 0%, 34% { transform: none; } 38% { transform: scale(.9); background: var(--accent); } 44%, 100% { transform: none; } }

/* ── Адаптив ── */
@media (max-width: 1200px) {
    .sbf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
    .sb-body { grid-template-columns: minmax(0, 1fr) 280px; }
    .sb-kpis { grid-template-columns: 1fr 1fr; }
    .sb-tiles, .sb-next-cells { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 14px; }
    .sb-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .sb-body { grid-template-columns: minmax(0, 1fr); }
    .sb-chat { border-left: 0; border-top: 1px solid var(--line); }
    .sb-msgs { position: static; height: 260px; }
}
@media (max-width: 720px) {
    .sb-app { margin-top: 28px; border-radius: 14px; }
    .sb-bar { flex-wrap: wrap; }
    .sb-card { margin-left: 0; }
    .sb-st { margin-left: auto; }
    .sb-main { padding: 10px; gap: 10px; }
    .sb-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .sb-kpi b { font-size: 16px; }
    .sb-kpi-paid b { font-size: 18px; }
    .sb-river { padding: 12px 10px 14px; }
    .sb-band-t { display: none; }
    .sb-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; row-gap: 14px; }
    .sb-next-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
    .sb-tile { min-height: 84px; padding: 7px 6px 8px; }
    .sb-log li { grid-template-columns: 1fr; gap: 0; }
    .sb-log { height: 112px; }
    .sb-log li:nth-last-child(n+3) { display: none; }
    .sb-ctl { flex-direction: column; }
    .sb-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sb-steps small { display: none; }
    .sb-ctl-btns { flex-direction: row; }
    .sb-ctl-btns .btn { flex: 1; }
    .sbf-grid { grid-template-columns: minmax(0, 1fr); margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .sb *, .sbf * { animation: none !important; transition: none !important; }
}
@media (max-width: 720px) {
    .sb-next-cells { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
    .sb-next span { flex-direction: column; align-items: center; padding: 3px 2px; }
}
