/* Живая демонстрация бота в hero главной страницы. Логика — static/js/bot-demo.js. */
.bd { position: relative; width: 100%; max-width: 520px; margin: 0 auto 38px; font-family: inherit; }
.bd-glow { position: absolute; inset: -34px; background: radial-gradient(ellipse at 60% 40%, rgba(108,92,231,0.14), transparent 68%); pointer-events: none; }
.bd-card { position: relative; z-index: 2; background: #fff; border-radius: 24px; padding: 22px; border: 1px solid rgba(13,13,26,0.06);
  box-shadow: 0 28px 70px rgba(13,13,26,0.10), 0 4px 18px rgba(108,92,231,0.08); animation: floatCard 7s ease-in-out infinite; }
.bd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.bd-product { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bd-ico { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg,#6C5CE7,#4F46E5); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bd-name { font-size: 14px; font-weight: 800; color: #0d0d1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-sub { font-size: 11px; color: #9898b0; }
.bd-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: #00a383; background: rgba(0,184,148,0.09); border: 1px solid rgba(0,184,148,0.2); border-radius: 100px; padding: 5px 11px; white-space: nowrap; }
.bd-live i { width: 7px; height: 7px; border-radius: 50%; background: #00b894; animation: bdPulse 1.8s infinite; }
@keyframes bdPulse { 0% { box-shadow: 0 0 0 0 rgba(0,184,148,.5); } 70% { box-shadow: 0 0 0 7px rgba(0,184,148,0); } 100% { box-shadow: 0 0 0 0 rgba(0,184,148,0); } }

.bd-main { display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; background: #F8F9FB; border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.bd-label { font-size: 10.5px; font-weight: 700; color: #a4a4bd; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.bd-price { font-size: 32px; font-weight: 800; letter-spacing: -0.035em; color: #6C5CE7; line-height: 1; font-variant-numeric: tabular-nums; }
.bd-price small { font-size: 18px; font-weight: 700; }
.bd-price.is-flash { animation: bdFlash .9s ease; }
@keyframes bdFlash { 0% { color: #00b894; transform: scale(1.04); } 100% { color: #6C5CE7; transform: none; } }
.bd-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 11px; font-weight: 700; color: #00a383; background: rgba(0,184,148,0.11); border-radius: 100px; padding: 4px 10px; transition: background .3s, color .3s; }
.bd-chip.is-wait { color: #6C5CE7; background: rgba(108,92,231,0.11); }
.bd-chip.is-wait svg { animation: bdSpin 1s linear infinite; }
@keyframes bdSpin { to { transform: rotate(360deg); } }
.bd-chip.is-min { color: #b7791f; background: rgba(255,177,27,0.16); }
.bd-comps { display: flex; flex-direction: column; gap: 7px; }
.bd-comps .bd-label { margin-bottom: 2px; }
.bd-row { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 8px; font-size: 12px; }
.bd-shop { color: #6e6e8a; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-bar { height: 6px; border-radius: 100px; background: rgba(13,13,26,0.06); overflow: hidden; }
.bd-bar b { display: block; height: 100%; width: 50%; border-radius: 100px; background: #c9c9dc; transition: width .8s cubic-bezier(.2,.8,.2,1), background .3s; }
.bd-val { font-weight: 800; color: #0d0d1a; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.bd-row.is-best .bd-bar b { background: #e84057; }
.bd-row.is-best .bd-val { color: #e84057; }
.bd-row.is-flash { animation: bdRow 1.1s ease; }
@keyframes bdRow { 0% { background: rgba(232,64,87,0.14); } 100% { background: transparent; } }
.bd-row { border-radius: 8px; margin: 0 -6px; padding: 2px 6px; }

.bd-chart-wrap { position: relative; margin-bottom: 14px; }
.bd-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; font-weight: 700; color: #52526e; margin-bottom: 8px; }
.bd-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: #9898b0; flex-wrap: wrap; }
.bd-legend i { width: 14px; height: 3px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.bd-legend .l-mine { background: #6C5CE7; } .bd-legend .l-best { background: #e84057; opacity: .75; } .bd-legend .l-min { background: repeating-linear-gradient(90deg,#e84057 0 4px,transparent 4px 7px); height: 2px; }
.bd-chart { display: block; width: 100%; height: 112px; background: linear-gradient(180deg, rgba(108,92,231,0.04), transparent); border-radius: 12px; }
.bd-minlabel { position: absolute; right: 8px; font-size: 10px; font-weight: 700; color: #e84057; background: rgba(255,255,255,.9); padding: 1px 6px; border-radius: 6px; }

.bd-log-head { font-size: 11.5px; font-weight: 700; color: #52526e; margin-bottom: 6px; }
.bd-log { display: flex; flex-direction: column; min-height: 96px; overflow: hidden; }
.bd-log-item { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid rgba(13,13,26,0.05); font-size: 12px; color: #3d3d54; animation: bdIn .45s ease both; }
.bd-log-item:last-child { border-bottom: 0; }
.bd-log-item i { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-style: normal; font-size: 10px; font-weight: 800; background: rgba(108,92,231,0.1); color: #6C5CE7; }
.bd-log-item.k-comp i { background: rgba(232,64,87,0.1); color: #e84057; } .bd-log-item.k-ok i { background: rgba(0,184,148,0.12); color: #00a383; } .bd-log-item.k-guard i { background: rgba(255,177,27,0.18); color: #b7791f; }
.bd-log-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-log-item time { font-size: 10.5px; color: #b0b0c8; font-variant-numeric: tabular-nums; flex-shrink: 0; }
@keyframes bdIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.bd-float { position: absolute; z-index: 3; background: #fff; border-radius: 14px; border: 1px solid rgba(13,13,26,0.06); box-shadow: 0 10px 30px rgba(13,13,26,0.10); padding: 10px 14px; display: flex; align-items: center; gap: 10px; animation: floatCard2 6s ease-in-out infinite; }
.bd-float-a { left: -18px; bottom: -30px; } .bd-float-b { right: -14px; top: -14px; animation-delay: -2s; }
.bd-float-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.bd-float-ico.g { background: rgba(0,184,148,0.11); color: #00b894; } .bd-float-ico.p { background: rgba(108,92,231,0.1); color: #6C5CE7; }
.bd-float-t { font-size: 13px; font-weight: 800; color: #0d0d1a; font-variant-numeric: tabular-nums; } .bd-float-s { font-size: 10.5px; color: #9898b0; }

@media (max-width: 640px) {
  .bd-card { padding: 16px; border-radius: 20px; }
  .bd-main { grid-template-columns: 1fr; }
  .bd-price { font-size: 28px; }
  .bd-float-a { left: 8px; bottom: -30px; padding: 8px 11px; } .bd-float-b { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bd-card, .bd-float, .bd-live i { animation: none; } .bd-log-item, .bd-price.is-flash, .bd-row.is-flash { animation: none; } }

/* ── список товаров (до 5) ── */
.bd-list { display: flex; flex-direction: column; margin-bottom: 12px; border: 1px solid rgba(13,13,26,0.06); border-radius: 14px; overflow: hidden; }
.bd-list-head, .bd-li { display: grid; grid-template-columns: minmax(0, 1.5fr) 1fr 1fr 12px; align-items: center; gap: 8px; padding: 0 12px; }
.bd-list-head { padding-top: 8px; padding-bottom: 6px; background: #F8F9FB; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #a4a4bd; }
.bd-list-head span:nth-child(2), .bd-list-head span:nth-child(3) { text-align: right; }
.bd-list-head::after { content: ""; }
.bd-li { height: 34px; border: 0; border-top: 1px solid rgba(13,13,26,0.05); background: #fff; font: inherit; text-align: left; cursor: default; transition: background .25s; }
.bd-li-name { font-size: 12px; font-weight: 700; color: #0d0d1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-li-best { font-size: 11.5px; font-weight: 600; color: #e84057; text-align: right; font-variant-numeric: tabular-nums; }
.bd-li-mine { font-size: 12px; font-weight: 800; color: #6C5CE7; text-align: right; font-variant-numeric: tabular-nums; }
.bd-li-dot { width: 8px; height: 8px; border-radius: 50%; background: #00b894; transition: background .25s; }
.bd-li.is-min .bd-li-dot { background: #ffb11b; }
.bd-li.is-wait .bd-li-dot { background: #6C5CE7; animation: bdPulse 1s infinite; }
.bd-li.is-active { background: rgba(108,92,231,0.07); box-shadow: inset 3px 0 0 #6C5CE7; }
.bd-active { font-size: 11.5px; color: #9898b0; margin: 0 0 8px; } .bd-active b { color: #0d0d1a; font-weight: 800; }
@media (max-width: 640px) {
  .bd-list-head, .bd-li { grid-template-columns: minmax(0, 1.4fr) 1fr 12px; }
  .bd-list-head .bd-col-best, .bd-li-best { display: none; }
  .bd-list-head span:nth-child(3) { text-align: right; }
}

/* ── компактный размер окна ── */
.bd { max-width: 420px; margin-bottom: 30px; }
.bd-card { padding: 14px; border-radius: 20px; }
.bd-head { margin-bottom: 10px; }
.bd-ico { width: 30px; height: 30px; border-radius: 9px; } .bd-ico svg { width: 15px; height: 15px; }
.bd-name { font-size: 13px; } .bd-sub { font-size: 10px; }
.bd-live { font-size: 10px; padding: 4px 9px; }
.bd-list { margin-bottom: 8px; border-radius: 12px; }
.bd-list-head { padding-top: 6px; padding-bottom: 5px; font-size: 9px; }
.bd-li { height: 27px; } .bd-li-name { font-size: 11.5px; } .bd-li-best { font-size: 11px; } .bd-li-mine { font-size: 11.5px; }
.bd-active { font-size: 10.5px; margin-bottom: 6px; }
.bd-main { padding: 11px 12px; gap: 10px; border-radius: 13px; margin-bottom: 10px; }
.bd-label { font-size: 9.5px; margin-bottom: 5px; }
.bd-price { font-size: 25px; } .bd-price small { font-size: 14px; }
.bd-chip { font-size: 10px; margin-top: 7px; padding: 3px 8px; }
.bd-row { font-size: 11px; grid-template-columns: 66px 1fr auto; } .bd-comps { gap: 4px; } .bd-val { min-width: 50px; }
.bd-chart-wrap { margin-bottom: 8px; } .bd-chart-head { font-size: 10.5px; margin-bottom: 5px; } .bd-legend { font-size: 9.5px; }
.bd-chart { height: 78px; }
.bd-log-head { font-size: 10.5px; margin-bottom: 3px; }
.bd-log { min-height: 58px; } .bd-log-item { font-size: 11px; padding: 4px 0; } .bd-log-item i { width: 17px; height: 17px; font-size: 9px; } .bd-log-item time { font-size: 10px; }
.bd-float { padding: 8px 11px; border-radius: 12px; } .bd-float-ico { width: 28px; height: 28px; border-radius: 8px; }
.bd-float-t { font-size: 12px; } .bd-float-s { font-size: 9.5px; }
.bd-float-a { bottom: -24px; left: -12px; } .bd-float-b { top: -12px; right: -10px; }
@media (max-width: 640px) { .bd-card { padding: 12px; } .bd-main { grid-template-columns: 1fr; } .bd-price { font-size: 24px; } }
.bd-row { grid-template-columns: 82px 1fr auto; }
.bd-float-b { display: none; }

/* ── мобильные: ещё меньше ── */
@media (max-width: 640px) {
  .bd { max-width: 300px; margin: 0 auto 22px; }
  .bd-card { padding: 10px; border-radius: 16px; }
  .bd-head { margin-bottom: 7px; }
  .bd-ico { width: 24px; height: 24px; border-radius: 7px; } .bd-ico svg { width: 12px; height: 12px; }
  .bd-name { font-size: 11.5px; } .bd-sub { font-size: 9px; }
  .bd-live { font-size: 9px; padding: 3px 7px; }
  .bd-list { margin-bottom: 6px; border-radius: 10px; }
  .bd-list-head { font-size: 8px; padding-top: 4px; padding-bottom: 4px; }
  .bd-li { height: 22px; } .bd-li-name, .bd-li-mine { font-size: 10px; }
  .bd-active { font-size: 9.5px; margin-bottom: 4px; }
  .bd-main { padding: 8px 10px; gap: 6px; margin-bottom: 7px; border-radius: 11px; }
  .bd-label { font-size: 8.5px; margin-bottom: 3px; }
  .bd-price { font-size: 20px; } .bd-price small { font-size: 12px; }
  .bd-chip { font-size: 9px; margin-top: 5px; padding: 2px 7px; }
  .bd-row { font-size: 10px; grid-template-columns: 58px 1fr auto; } .bd-val { min-width: 44px; }
  .bd-chart-wrap { margin-bottom: 5px; } .bd-chart-head { font-size: 9.5px; margin-bottom: 3px; } .bd-legend { font-size: 8.5px; }
  .bd-chart { height: 56px; }
  .bd-log-head { font-size: 9.5px; margin-bottom: 2px; }
  .bd-log { min-height: 42px; } .bd-log-item { font-size: 10px; padding: 3px 0; } .bd-log-item i { width: 15px; height: 15px; font-size: 8px; } .bd-log-item time { font-size: 9px; }
  .bd-float-a { bottom: -18px; left: 4px; padding: 6px 9px; } .bd-float-t { font-size: 11px; } .bd-float-s { font-size: 8.5px; } .bd-float-ico { width: 24px; height: 24px; }
}
