/* AG Store — site assistant widget */
.ag-asst-fab {
  position: fixed;
  z-index: 2147483646;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid #e0e7ff;
  cursor: pointer;
  background: #fff;
  color: #0171e3;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease, border-color 0.2s ease;
}
.ag-asst-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(1, 113, 227, 0.15);
  border-color: #bfdbfe;
}
.ag-asst-fab:active {
  transform: scale(0.94);
}
.ag-asst-fab svg {
  width: 22px;
  height: 22px;
}
.ag-asst-fab[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
}
.ag-asst-fab--unread::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
  pointer-events: none;
  animation: ag-asst-pulse 1.5s ease-in-out infinite;
}
@keyframes ag-asst-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); transform: scale(1.15); }
}

.ag-asst-panel {
  position: fixed;
  z-index: 2147483647;
  right: 12px;
  bottom: 12px;
  width: 420px;
  height: 620px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 55px rgba(11, 15, 24, 0.18), 0 6px 18px rgba(11, 15, 24, 0.1);
  border: 1px solid #eef0f4;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.28s ease-out, transform 0.28s ease-out;
}
.ag-asst-panel.on {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ag-asst-panel > :not([class*="ag-asst"]):not([id*="ag-asst"]) {
  display: none !important;
}

@media (max-width: 600px) {
  body.ag-asst-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }
}
body.ag-asst-open #google-eventhandler-iframe-wrapper,
body.ag-asst-open .grecaptcha-badge,
body.ag-asst-open #recaptcha-container,
body.ag-asst-open [id*="google-eventhandler"],
body.ag-asst-open .g-recaptcha,
body.ag-asst-open #tildaoverlay,
body.ag-asst-open #tilda-popup-for-cookie,
body.ag-asst-open .t-tildalabel,
body.ag-asst-open .t-tildalabel__wrapper,
body.ag-asst-open [class*="tildalabel"],
body.ag-asst-open .t-cookie-popup,
body.ag-asst-open [class*="cookie"],
body.ag-asst-open #ag-reg-gift {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}
.ag-asst-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.ag-asst-backdrop.on {
  display: block;
}

.ag-asst-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #eef0f4;
}
.ag-asst-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0b1220;
  line-height: 1.25;
}
.ag-asst-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(11, 18, 32, 0.55);
  line-height: 1.35;
}
.ag-asst-head-titles {
  flex: 1;
  min-width: 0;
}
.ag-asst-head-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ag-asst-tool {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-asst-tool:hover {
  color: #0171e3;
  background: #eff6ff;
}
.ag-asst-x {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 0;
}
.ag-asst-x svg {
  width: 20px;
  height: 20px;
}
.ag-asst-x:hover {
  color: #0b1220;
  background: #f1f5f9;
}

.ag-asst-msgs-wrap {
  flex: 1 1 0%;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ag-asst-float-date {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  max-width: min(340px, 92%);
  text-align: center;
  line-height: 1.3;
}
.ag-asst-float-date[hidden] {
  display: none !important;
}
.ag-asst-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfc;
}
.ag-asst-daysep {
  align-self: center;
  width: 100%;
  text-align: center;
  padding: 2px 0 4px;
  flex-shrink: 0;
}
.ag-asst-daysep span {
  display: inline-block;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #eef2f7;
  border-radius: 999px;
}
.ag-asst-msgwrap {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
}
.ag-asst-msgwrap--user {
  align-self: flex-end;
  max-width: 92%;
  flex-direction: row-reverse;
}
.ag-asst-msgwrap--bot {
  align-self: flex-start;
  max-width: 100%;
}
.ag-asst-msgwrap-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.ag-asst-avatar {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}
.ag-asst-avatar--bot {
  background: #0171e3;
  color: #fff;
}
.ag-asst-avatar--bot svg {
  width: 14px;
  height: 14px;
}
.ag-asst-avatar--user {
  background: #e8ecf1;
  color: #64748b;
}
.ag-asst-avatar--user svg {
  width: 13px;
  height: 13px;
}
.ag-asst-avatar--user img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.ag-asst-msgmeta {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.25;
  padding: 0 2px 1px;
}
.ag-asst-msgmeta--user {
  text-align: right;
}
.ag-asst-msgwrap--bot .ag-asst-msgmeta {
  text-align: left;
}
.ag-asst-msgtime {
  white-space: nowrap;
}
.ag-asst-msg {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ag-asst-msg--welcome {
  align-self: center;
  max-width: 100%;
  background: #fff;
  color: #0b1220;
  border: 1px solid #e8ecf1;
  border-radius: 12px;
}
.ag-asst-msg.user {
  align-self: flex-end;
  background: #0171e3;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ag-asst-msgwrap--user .ag-asst-msg.user {
  align-self: flex-end;
  white-space: pre-wrap;
}
.ag-asst-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #0b1220;
  border: 1px solid #e8ecf1;
  border-bottom-left-radius: 4px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.ag-asst-msgwrap--bot .ag-asst-msg.bot {
  max-width: 100%;
}
.ag-asst-msg--system {
  align-self: center;
  max-width: 94%;
  margin: 2px 0;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  text-align: center;
}
.ag-asst-msg.bot .ag-asst-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ag-asst-text a.ag-asst-autolink {
  color: #0171e3;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.ag-asst-text a.ag-asst-autolink:hover {
  color: #0b5fc4;
}
.ag-asst-text a.ag-asst-autolink.ag-asst-link--repair {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c !important;
  border: 1px solid #fecaca;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  word-break: break-word;
}
.ag-asst-text a.ag-asst-autolink.ag-asst-link--repair:hover {
  background: #fee2e2;
}
.ag-asst-text a.ag-asst-autolink.ag-asst-link--tradein {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #f8fafc;
  color: #0369a1 !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  word-break: break-word;
}
.ag-asst-text a.ag-asst-autolink.ag-asst-link--tradein:hover {
  background: #eff6ff;
}
.ag-asst-text a.ag-asst-link--contact {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ag-asst-msg.user a.ag-asst-autolink {
  color: #e0f2fe;
  text-decoration: underline;
  word-break: break-all;
}
.ag-asst-msg.user a.ag-asst-link--contact {
  color: #fff !important;
  text-decoration: underline;
}
.ag-asst-msg.user a.ag-asst-link--repair,
.ag-asst-msg.user a.ag-asst-link--tradein {
  color: #0f172a !important;
  background: #fff;
  border-color: #e2e8f0;
  text-decoration: none;
}
.ag-asst-msg.bot.thinking {
  color: #64748b;
  font-style: normal;
}

/* Горизонтальная карусель карточек */
.ag-asst-carousel {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 4px;
  padding: 4px 2px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ag-asst-carousel::-webkit-scrollbar {
  height: 6px;
}
.ag-asst-carousel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.ag-asst-carousel--compact .ag-asst-card--tradein,
.ag-asst-carousel--compact .ag-asst-card--repair {
  flex: 0 0 min(220px, 75vw);
  scroll-snap-align: start;
}
.ag-asst-carousel--upgrade {
  max-width: 100%;
}
.ag-asst-upgrade-pack {
  margin-top: 8px;
  padding: 0 0 8px;
}
.ag-asst-upgrade-sum {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(165deg, #f0f7ff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  margin-bottom: 8px;
}
.ag-asst-upgrade-sum-old {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.ag-asst-upgrade-sum-row {
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
  margin-bottom: 10px;
}
.ag-asst-upgrade-sum-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #0171e3;
  margin-right: 4px;
}
.ag-asst-upgrade-sum-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.ag-asst-upgrade-sum-buy-k {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.ag-asst-upgrade-sum-buy-v {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}
.ag-asst-upgrade-sum-math {
  margin-top: 8px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}
.ag-asst-upgrade-sum-note {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: #94a3b8;
}
.ag-asst-upgrade-swipe-hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}
.ag-asst-card--upgrade-compact {
  display: flex;
  flex-direction: column;
  text-align: left;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  padding: 0;
  min-height: 0;
  border-radius: 14px;
}
.ag-asst-card--upgrade-compact .ag-asst-card-imgwrap {
  border-radius: 14px 14px 0 0;
  aspect-ratio: 1;
  max-height: 140px;
}
.ag-asst-upgrade-compact-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}
.ag-asst-carousel--upgrade .ag-asst-card--upgrade-compact {
  flex: 0 0 min(200px, 78vw);
  max-width: min(200px, 78vw);
  scroll-snap-align: start;
}
.ag-asst-carousel--upgrade .ag-asst-card--upgrade {
  flex: 0 0 min(248px, 84vw);
  max-width: min(248px, 84vw);
  scroll-snap-align: start;
}
.ag-asst-card--upgrade-split {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  text-decoration: none;
  color: inherit;
  padding: 12px 14px;
  min-height: 0;
}
.ag-asst-upgrade-split-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.ag-asst-upgrade-split-condition {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 8px;
}
.ag-asst-upgrade-split-k {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 2px;
}
.ag-asst-upgrade-split-topup {
  font-size: 24px;
  font-weight: 700;
  color: #0171e3;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.ag-asst-upgrade-split-buyback {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
  padding: 8px 0;
  border-top: 1px solid #eef0f4;
  border-bottom: 1px solid #eef0f4;
}
.ag-asst-upgrade-split-buyback-k {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 2px;
}
.ag-asst-upgrade-split-footer {
  margin-top: auto;
  padding-top: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ag-asst-upgrade-split-cat-k {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.ag-asst-upgrade-split-newtitle {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}
.ag-asst-upgrade-split-newprice {
  font-size: 13px;
  font-weight: 700;
  color: #0b1220;
}
.ag-asst-card--upgrade-split .ag-asst-card-link {
  margin-top: 6px;
}
.ag-asst-upgrade-split-disclaimer {
  margin: 10px 0 0;
  font-size: 9px;
  line-height: 1.4;
  color: #94a3b8;
}

.ag-asst-card-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}
.ag-asst-card {
  border-radius: 12px;
  border: 1px solid #e8ecf1;
  background: #f8fafc;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.ag-asst-card:hover {
  border-color: rgba(1, 113, 227, 0.35);
  box-shadow: 0 4px 14px rgba(11, 18, 32, 0.08);
}
.ag-asst-carousel .ag-asst-card--catalog,
.ag-asst-carousel .ag-asst-card--accessory {
  flex: 0 0 min(280px, 78vw);
  max-width: min(280px, 78vw);
  scroll-snap-align: start;
}
.ag-asst-card--catalog,
.ag-asst-card--accessory {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}
.ag-asst-card--catalog,
.ag-asst-card--accessory {
  background: #fff;
}
.ag-asst-card-imgwrap {
  width: 104px;
  min-width: 104px;
  min-height: 96px;
  flex-shrink: 0;
  align-self: stretch;
  background: #fff;
  border-right: 1px solid #eef0f4;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Sklad pod názvem — nepřekrývá fotku telefonu */
.ag-asst-stock-line {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  color: #475569;
  margin-top: 2px;
}
.ag-asst-card-imgwrap--empty {
  background: linear-gradient(135deg, #f1f5f9, #e8edf3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-asst-card-imgwrap--empty svg {
  width: 36px;
  height: 36px;
  color: #c0c9d4;
}
.ag-asst-card-imgwrap img {
  width: 100%;
  height: auto;
  max-height: 132px;
  object-fit: contain;
  object-position: center;
  padding: 6px 8px;
  box-sizing: border-box;
  display: block;
  flex: 0 1 auto;
}
.ag-asst-card-body {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ag-asst-card-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  color: #0b1220;
}
.ag-asst-card-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}
.ag-asst-card-price {
  font-size: 14px;
  font-weight: 700;
  color: #0171e3;
  margin-top: 2px;
}
.ag-asst-card-priceblock {
  margin-top: 4px;
}
.ag-asst-card-pricerow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.ag-asst-card-price--current {
  font-size: 14px;
  font-weight: 700;
  color: #0171e3;
}
.ag-asst-card-price--old {
  font-size: 11px;
  font-weight: 500;
  text-decoration: line-through;
  color: #94a3b8;
}
.ag-asst-card-pct {
  font-size: 10px;
  font-weight: 700;
  color: #b91c1c;
  white-space: nowrap;
}
.ag-asst-card-discount-hint {
  font-size: 9px;
  line-height: 1.3;
  color: #64748b;
  margin-top: 4px;
}
.ag-asst-card-link {
  font-size: 11px;
  font-weight: 600;
  color: #0171e3;
  margin-top: 4px;
}
.ag-asst-card--upgrade {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e8ecf1;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}
.ag-asst-upgrade-old {
  font-size: 12px;
  font-weight: 600;
  color: #0b1220;
  margin-bottom: 8px;
  line-height: 1.35;
}
.ag-asst-upgrade-head {
  font-size: 13px;
  font-weight: 700;
  color: #0171e3;
  letter-spacing: -0.01em;
}
.ag-asst-upgrade-grade {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  margin-bottom: 10px;
}
.ag-asst-upgrade-topups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ag-asst-upgrade-topup-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}
.ag-asst-up-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  flex: 0 1 44%;
  min-width: 0;
  line-height: 1.25;
}
.ag-asst-up-big {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 700;
  color: #0171e3;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-align: right;
}
.ag-asst-upgrade-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef0f4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ag-asst-upgrade-meta-line {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
}
.ag-asst-upgrade-meta-line--muted {
  color: #64748b;
  font-size: 11px;
}
.ag-asst-meta-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 2px;
}
.ag-asst-meta-strong {
  font-weight: 600;
  color: #334155;
}
.ag-asst-meta-price {
  font-weight: 500;
  color: #64748b;
  font-size: 11px;
}
.ag-asst-upgrade-link {
  font-size: 11px;
  font-weight: 600;
  color: #0171e3;
  text-decoration: none;
  margin-left: 4px;
}
.ag-asst-upgrade-link:hover {
  text-decoration: underline;
}
.ag-asst-upgrade-note {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 4px;
}
.ag-asst-card--tradein,
.ag-asst-card--repair {
  padding: 10px 12px;
}
.ag-asst-card--tradein .ag-asst-card-title,
.ag-asst-card--repair .ag-asst-card-title {
  font-size: 12px;
}

/* Интерактивный квиз (trade-in и др.) */
.ag-asst-quiz {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e8ecf1;
  font-size: 12px;
  line-height: 1.4;
}
.ag-asst-quiz-intro {
  margin: 0 0 10px;
  color: #334155;
}
.ag-asst-quiz-q {
  margin: 0 0 12px;
  padding: 0;
  border: none;
}
.ag-asst-quiz-q legend {
  padding: 0;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
}
.ag-asst-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ag-asst-quiz-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px 10px 40px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ag-asst-quiz-opt:hover {
  border-color: #cbd5e1;
  background: #fafbfc;
}
.ag-asst-quiz-opt input {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  left: 12px;
  top: 11px;
  cursor: pointer;
  z-index: 2;
}
.ag-asst-quiz-opt-ui {
  position: absolute;
  left: 14px;
  top: 13px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  z-index: 1;
  pointer-events: none;
}
.ag-asst-quiz-opt:has(input:checked) {
  border-color: rgba(1, 113, 227, 0.35);
  background: #f8fbff;
}
.ag-asst-quiz-opt:has(input:checked) .ag-asst-quiz-opt-ui {
  border-color: #0171e3;
  background: #0171e3;
  box-shadow: inset 0 0 0 3px #fff;
}
.ag-asst-quiz-opt-text {
  flex: 1;
  min-width: 0;
  color: #334155;
  line-height: 1.4;
}
.ag-asst-quiz-custom,
.ag-asst-quiz-extra {
  width: 100%;
  margin-top: 8px;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 44px;
}
.ag-asst-quiz-custom:focus,
.ag-asst-quiz-extra:focus {
  outline: none;
  border-color: #0171e3;
  box-shadow: 0 0 0 2px rgba(1, 113, 227, 0.12);
}
.ag-asst-quiz-progress {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin: 0 0 8px;
}
.ag-asst-quiz-nav {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 12px;
  align-items: stretch;
}
.ag-asst-quiz-nav-spacer {
  flex: 0 0 auto;
  width: 8px;
}
.ag-asst-quiz-nav-spacer--grow {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.ag-asst-quiz-back {
  flex-shrink: 0;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.ag-asst-quiz-back-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
.ag-asst-quiz-back:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.ag-asst-quiz-next {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #0171e3;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.ag-asst-quiz-next:hover {
  background: #0b5fc4;
}
.ag-asst-quiz-submit {
  margin-top: 0;
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #0171e3;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.ag-asst-quiz-submit:hover {
  background: #0b5fc4;
}
.ag-asst-quiz-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ag-asst-quiz-done {
  margin-top: 8px;
  font-size: 11px;
  color: #64748b;
}

.ag-asst-foot {
  padding: 8px 12px 10px;
  border-top: 1px solid #eef0f4;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ag-asst-foot textarea {
  flex: 1;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  resize: none;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 16px;
  line-height: 1.4;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  outline: none;
  touch-action: manipulation;
}
.ag-asst-foot textarea:focus {
  border-color: #0171e3;
  box-shadow: 0 0 0 3px rgba(1, 113, 227, 0.12);
}
.ag-asst-send {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: #0171e3;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
}
.ag-asst-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ag-asst-thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  min-height: 22px;
  font-style: normal;
}
.ag-asst-thinking span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: ag-asst-dot 1s infinite ease-in-out;
}
.ag-asst-thinking span:nth-child(2) {
  animation-delay: 0.15s;
}
.ag-asst-thinking span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes ag-asst-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}
.ag-asst-thinking--inline {
  margin-bottom: 2px;
}

/* Ожидание показа квиза (после текста «ответьте на вопросы» пока бежит tool). */
.ag-asst-quiz-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(110deg, #f1f5f9 0%, #f8fafc 45%, #eef2ff 90%, #f1f5f9 100%);
  background-size: 220% 100%;
  animation: ag-asst-quiz-wait-shimmer 1.8s ease-in-out infinite;
}
@keyframes ag-asst-quiz-wait-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.ag-asst-quiz-wait-txt {
  font-size: 13px;
  line-height: 1.35;
  color: #475569;
}

.ag-asst-upgrade-split-sub {
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  margin: 2px 0 6px;
}
.ag-asst-type-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: #0171e3;
  animation: ag-asst-blink 0.85s step-end infinite;
}
@keyframes ag-asst-blink {
  50% {
    opacity: 0;
  }
}

.ag-asst-starters {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 12px 8px;
  background: #fff;
  border-top: 1px solid #eef0f4;
}
.ag-asst-chip {
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.ag-asst-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #0b1220;
}

.ag-asst-hint {
  font-size: 11px;
  color: #94a3b8;
  padding: 0 14px 10px;
  line-height: 1.35;
}
.ag-asst-gdpr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f8fafc;
  border-top: 1px solid #e8ecf1;
  font-size: 11px;
  line-height: 1.4;
  color: #64748b;
}
.ag-asst-gdpr[hidden] { display: none !important; }
.ag-asst-gdpr-text {
  flex: 1;
}
.ag-asst-gdpr-text a {
  color: #0171e3;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ag-asst-gdpr-ok {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #0171e3;
  cursor: pointer;
  transition: background 0.15s;
}
.ag-asst-gdpr-ok:hover {
  background: #eff6ff;
}

@media (max-width: 600px) {
  .ag-asst-fab {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
  }
  .ag-asst-fab svg {
    width: 20px;
    height: 20px;
  }
  .ag-asst-panel {
    inset: 0 0 0 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    height: 100dvh !important;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .ag-asst-panel:not(.on) {
    transform: translateY(100%);
  }
  .ag-asst-panel.on {
    transform: translateY(0);
  }
  .ag-asst-msgs-wrap {
    flex: 1 1 0%;
    max-height: none;
    min-height: 0;
  }
  .ag-asst-backdrop {
    background: transparent;
  }
}

/* Clear chat confirmation */
.ag-asst-clear-confirm {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}
.ag-asst-clear-confirm[hidden] {
  display: none !important;
}
.ag-asst-clear-confirm:not([hidden]) {
  pointer-events: auto;
}
.ag-asst-clear-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}
.ag-asst-clear-confirm-box {
  position: relative;
  z-index: 1;
  width: min(320px, 100%);
  padding: 18px 18px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(11, 15, 24, 0.2);
  border: 1px solid #e2e8f0;
}
.ag-asst-clear-confirm-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}
.ag-asst-clear-confirm-body {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}
.ag-asst-clear-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.ag-asst-clear-confirm-actions button {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ag-asst-clear-confirm-actions button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
#ag-asst-clear-yes {
  background: #ef4444;
  border-color: #dc2626;
  color: #fff;
}
#ag-asst-clear-yes:hover {
  background: #dc2626;
  border-color: #b91c1c;
}

/* === Animations === */

/* FAB fade out when panel opens */
.ag-asst-fab[aria-expanded="true"] {
  transform: scale(0.7);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

/* Message slide-in */
@keyframes ag-asst-msg-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ag-asst-msg--new {
  animation: ag-asst-msg-in 0.25s ease-out both;
}

/* Card slide-in (staggered via inline style --i) */
@keyframes ag-asst-card-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.ag-asst-card--anim {
  animation: ag-asst-card-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

/* Quiz step transition */
@keyframes ag-asst-quiz-fade {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.ag-asst-quiz--anim .ag-asst-quiz-q {
  animation: ag-asst-quiz-fade 0.2s ease-out both;
}

/* Upgrade pack entrance */
@keyframes ag-asst-pack-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ag-asst-upgrade-pack--anim {
  animation: ag-asst-pack-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Battery guide modal */
.ag-asst-batt-modal {
  position: absolute;
  inset: 0;
  z-index: 25;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.ag-asst-batt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}
.ag-asst-batt-box {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  max-height: calc(100% - 24px);
  overflow: hidden;
  max-height: min(520px, calc(100% - 24px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(11, 15, 24, 0.22);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ag-asst-batt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f4;
}
.ag-asst-batt-head-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.ag-asst-batt-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  line-height: 0;
}
.ag-asst-batt-close:hover {
  color: #0b1220;
  background: #f1f5f9;
}
.ag-asst-batt-carousel {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  flex: 1;
  min-height: 0;
}
.ag-asst-batt-carousel::-webkit-scrollbar {
  height: 4px;
}
.ag-asst-batt-carousel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.ag-asst-batt-step {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 16px;
  text-align: center;
}
.ag-asst-batt-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0171e3;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ag-asst-batt-step img {
  width: auto;
  max-width: min(180px, 50%);
  max-height: 280px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid #e8ecf1;
  margin-bottom: 10px;
}
.ag-asst-batt-step-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 2px;
}
.ag-asst-batt-step-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}
.ag-asst-batt-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 12px;
}
.ag-asst-batt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ag-asst-batt-dot--active {
  background: #0171e3;
}
.ag-asst-batt-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid #eef0f4;
  background: #fef9ee;
}
.ag-asst-batt-hint-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-asst-batt-hint-text {
  font-size: 11px;
  color: #92400e;
  line-height: 1.4;
}
.ag-asst-quiz-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #94a3b8;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  padding: 0;
  line-height: 1;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.ag-asst-quiz-info-btn:hover {
  border-color: #0171e3;
  color: #0171e3;
  background: #eff6ff;
}

/* Trade-in top-up badges (site-wide + chat cards) */
.ag-asst-topup-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  line-height: 1.3;
}
.ag-asst-topup-label {
  color: #64748b;
  font-weight: 500;
}
.ag-asst-topup-val {
  color: #0171e3;
  font-weight: 700;
}
.ag-asst-card-topup {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  font-size: 10px;
  line-height: 1.3;
}
.ag-asst-card-topup-label {
  color: #64748b;
  font-weight: 500;
}
.ag-asst-card-topup-val {
  color: #0171e3;
  font-weight: 700;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ag-asst-fab,
  .ag-asst-fab--unread::after,
  .ag-asst-panel,
  .ag-asst-msg--new,
  .ag-asst-card--anim,
  .ag-asst-quiz--anim .ag-asst-quiz-q,
  .ag-asst-upgrade-pack--anim,
  .ag-asst-thinking span,
  .ag-asst-batt-carousel {
    animation: none !important;
    transition: none !important;
  }
}
