.szai-launcher,
.szai-panel,
.szai-panel * { box-sizing: border-box; }

:root {
  --szai-ink: var(--sez-dark, #20252b);
  --szai-paper: var(--sez-white, #fff);
  --szai-surface: var(--sez-paper, #f5f6f7);
  --szai-muted: var(--sez-muted, #69727b);
  --szai-line: var(--sez-line, #d8dde1);
  --szai-brand: var(--sez-accent, #ec5429);
  --szai-rainbow: conic-gradient(from 0deg, #ff2d2d, #ff9500, #ffd60a, #00c7be, #0a84ff, #bf5af2, #ff2d78, #ff2d2d);
  --szai-font: "Open Sans", Arial, sans-serif;
  --szai-right: 158px;
  --szai-bottom: 18px;
}

.szai-launcher { position: fixed; z-index: 9998; right: var(--szai-right); bottom: var(--szai-bottom); display: block; width: 66px; height: 66px; visibility: visible; }
.szai-glow { position: absolute; z-index: 0; inset: -5px; background: var(--szai-rainbow); filter: blur(15px); opacity: .9; animation: szai-glow 7s ease-in-out infinite; }
.szai-orb { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: pointer; }
.szai-icon { position: relative; z-index: 2; display: block; width: 100%; height: 100%; }
.szai-launcher .szai-star path { fill: #fff; stroke: rgb(32 37 43 / 50%); stroke-width: 1.5; }
.szai-star { transform-origin: center; }
.sA { animation: szai-star 5s ease-in-out infinite; }
.sB { animation: szai-star 5s ease-in-out .6s infinite; }
.sC { animation: szai-star 5s ease-in-out 1.2s infinite; }

@keyframes szai-glow {
  0% { filter: blur(15px) hue-rotate(0); transform: scale(1); opacity: .82; }
  50% { filter: blur(21px) hue-rotate(180deg); transform: scale(1.1); opacity: 1; }
  100% { filter: blur(15px) hue-rotate(360deg); transform: scale(1); opacity: .82; }
}
@keyframes szai-star { 0%, 100% { transform: translateY(2px) scale(.96); } 50% { transform: translateY(-2px) scale(1.06); } }

.szai-panel {
  position: fixed;
  z-index: 9999;
  right: var(--szai-right);
  bottom: calc(var(--szai-bottom) + 80px);
  display: flex;
  width: min(560px, calc(100vw - 40px));
  height: min(720px, calc(100dvh - 140px));
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--szai-line);
  border-radius: 0;
  background: var(--szai-paper);
  box-shadow: 0 24px 70px rgb(32 37 43 / 22%);
  font-family: var(--szai-font);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity .22s ease, transform .22s ease;
}
.szai-panel[hidden] { display: none; }
.szai-panel.is-open { opacity: 1; pointer-events: auto; transform: none; }

.szai-head { display: flex; min-height: 74px; flex: 0 0 auto; align-items: center; gap: 13px; padding: 13px 16px; border-bottom: 1px solid var(--szai-line); background: var(--szai-paper); color: var(--szai-ink); }
.szai-mini { position: relative; width: 42px; height: 42px; flex: 0 0 42px; }
.szai-mini::before { position: absolute; z-index: 0; inset: -3px; background: var(--szai-rainbow); content: ""; filter: blur(7px); opacity: .82; animation: szai-glow 7s ease-in-out infinite; }
.szai-mini .szai-star path { fill: var(--szai-ink); stroke: rgb(255 255 255 / 74%); }
.szai-id { display: grid; gap: 3px; }
.szai-id strong { font-family: "Montserrat", var(--szai-font); font-size: 16px; line-height: 1.15; }
.szai-id small { display: flex; align-items: center; gap: 6px; color: rgb(255 255 255 / 66%); font-size: 11px; }
.szai-id small i { width: 6px; height: 6px; background: #45c784; }
.szai-x { display: grid; width: 42px; height: 42px; margin-left: auto; place-items: center; padding: 0; border: 1px solid var(--szai-line); border-radius: 0; background: transparent; color: var(--szai-ink); cursor: pointer; }
.szai-x span { font: 27px/1 Arial, sans-serif; transform: translateY(-1px); }
.szai-x:hover { border-color: var(--szai-ink); background: var(--szai-ink); color: #fff; }

.szai-body { display: flex; min-height: 0; flex: 1; overflow-y: auto; flex-direction: column; gap: 14px; padding: 18px; background-color: var(--szai-paper); scrollbar-width: thin; scrollbar-color: var(--szai-line) transparent; }
.szai-msg { max-width: 84%; padding: 13px 15px; border-radius: 0; font-size: 14px; line-height: 1.58; overflow-wrap: anywhere; }
.szai-bot { align-self: flex-start; border: 1px solid var(--szai-line); background: #fff; color: var(--szai-ink); }
.szai-me { align-self: flex-end; border: 1px solid var(--szai-ink); background: var(--szai-ink); color: #fff; }
.szai-msg strong { font-weight: 700; }
.szai-list-item { display: block; padding-left: 15px; position: relative; }
.szai-list-item::before { position: absolute; left: 0; color: var(--szai-brand); content: "[ ]"; font-size: 8px; top: 5px; }

.szai-suggestions { display: flex; flex-wrap: wrap; align-self: flex-start; gap: 7px; max-width: 92%; }
.szai-suggestions button { min-height: 38px; padding: 8px 11px; border: 1px solid var(--szai-line); border-radius: 0; background: #fff; color: var(--szai-ink); cursor: pointer; font-size: 12px; }
.szai-suggestions button:hover { border-color: var(--szai-brand); color: var(--szai-brand); }

.szai-typing { display: inline-flex; align-items: center; gap: 4px; }
.szai-typing i { width: 6px; height: 6px; background: var(--szai-brand); animation: szai-dot 1.2s ease-in-out infinite; }
.szai-typing i:nth-child(2) { animation-delay: .2s; }
.szai-typing i:nth-child(3) { animation-delay: .4s; }
.szai-typing span { margin-left: 6px; color: var(--szai-muted); font-size: 11px; }
@keyframes szai-dot { 0%, 80%, 100% { opacity: .35; transform: scale(.65); } 40% { opacity: 1; transform: scale(1); } }

.szai-results { display: grid; gap: 8px; width: 100%; }
.szai-results__head { display: flex; align-items: center; justify-content: space-between; color: var(--szai-ink); font-size: 12px; }
.szai-results__head span { color: var(--szai-brand); font-weight: 700; }
.szai-cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 3px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.szai-cards::-webkit-scrollbar { display: none; }
.szai-card { position: relative; display: flex; overflow: hidden; flex: 0 0 260px; flex-direction: column; border: 1px solid var(--szai-line); background: #fff; color: var(--szai-ink); text-decoration: none; scroll-snap-align: start; scroll-snap-stop: always; transition: border-color .22s ease; }
.szai-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; flex: 0 0 auto; background: #fff; }
.szai-card__media--empty { display: grid; place-items: center; background: var(--szai-ink); color: #fff; font-family: "Montserrat", var(--szai-font); font-size: 28px; font-weight: 700; }
.szai-card__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; transition: opacity .2s ease; }
.szai-card__slide.is-active { opacity: 1; }
.szai-card__media-nav { position: absolute; z-index: 2; right: 8px; bottom: 8px; left: 8px; display: flex; align-items: center; justify-content: space-between; color: #fff; font-size: 10px; }
.szai-card__media-nav button { position: relative; display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid rgb(255 255 255 / 65%); border-radius: 0; background: rgb(32 37 43 / 82%); color: #fff; cursor: pointer; }
.szai-card__media-nav button::before { width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; content: ""; transform: rotate(45deg); }
.szai-card__media-nav [data-card-prev]::before { transform: rotate(-135deg); }
.szai-card__media-nav span { padding: 4px 7px; background: rgb(32 37 43 / 82%); }
.szai-card__body { display: flex; min-height: 168px; flex: 1; flex-direction: column; padding: 16px; background: var(--szai-paper); color: var(--szai-ink); transition: background-color .22s ease, color .22s ease; }
.szai-card__label { margin-bottom: 10px; color: var(--szai-muted); font-size: 9px; font-weight: 700; }
.szai-card h3 { display: -webkit-box; overflow: hidden; margin: 0 0 8px; color: var(--szai-ink); font-family: "Montserrat", var(--szai-font); font-size: 15px; line-height: 1.28; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.szai-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--szai-muted); font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.szai-card__meta { display: flex; min-height: 22px; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--szai-muted); font-size: 10px; }
.szai-card__meta strong { color: var(--szai-ink); font-size: 12px; }
.szai-card__corner { position: absolute; z-index: 4; right: 16px; bottom: 16px; width: 12px; height: 12px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; opacity: 0; transition: opacity .2s ease; }
.szai-card:hover { border-color: var(--szai-ink); }
.szai-card:hover .szai-card__body { background: var(--szai-ink); color: #fff; }
.szai-card:hover :is(h3, p, .szai-card__label, .szai-card__meta, .szai-card__meta strong) { color: #fff; }
.szai-card:hover .szai-card__corner { color: #fff; opacity: 1; }
.szai-card--service .szai-card__media, .szai-card--case .szai-card__media { background: var(--szai-ink); }
.szai-card--service .szai-card__slide, .szai-card--case .szai-card__slide { object-fit: cover; }

.szai-contacts { display: grid; width: min(100%, 420px); align-self: flex-start; border-top: 1px solid var(--szai-line); border-left: 1px solid var(--szai-line); background: #fff; }
.szai-contacts > * { display: grid; gap: 4px; padding: 11px 13px; border-right: 1px solid var(--szai-line); border-bottom: 1px solid var(--szai-line); color: var(--szai-ink); text-decoration: none; }
.szai-contacts span { color: var(--szai-muted); font-size: 9px; text-transform: uppercase; }
.szai-contacts strong { font-size: 12px; line-height: 1.35; }
.szai-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 8px; }
.szai-actions > * { display: grid; min-height: 44px; place-items: center; padding: 9px 12px; border: 1px solid var(--szai-ink); border-radius: 0; background: var(--szai-ink); color: #fff; cursor: pointer; font: 700 12px var(--szai-font); text-align: center; text-decoration: none; }
.szai-actions > *:first-child { border-color: var(--szai-brand); background: var(--szai-brand); }
.szai-actions > *:hover { filter: brightness(.9); }

.szai-foot { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--szai-line); background: #fff; }
.szai-foot textarea { min-width: 0; min-height: 46px; max-height: 112px; flex: 1; resize: none; padding: 12px 14px; border: 1px solid var(--szai-line); border-radius: 0; outline: 0; background: #fff; color: var(--szai-ink); font: 14px/1.45 var(--szai-font); }
.szai-foot textarea:focus { border-color: var(--szai-brand); box-shadow: none; }
.szai-foot textarea::placeholder { color: var(--szai-muted); opacity: .72; }
.szai-send { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; padding: 0; border: 0; border-radius: 0; background: var(--szai-ink); cursor: pointer; }
.szai-send svg { stroke: #fff; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.szai-send:hover { background: var(--szai-brand); }
.szai-send:disabled { cursor: wait; opacity: .55; }

@media (min-width: 1680px) {
  .szai-panel { width: 620px; }
  .szai-card { flex-basis: 260px; }
}

@media (min-width: 2100px) {
  :root { --szai-right: 178px; --szai-bottom: 36px; }
  .szai-launcher { width: 96px; height: 96px; }
  .szai-panel { bottom: 150px; width: min(820px, 38vw); height: min(900px, calc(100dvh - 190px)); }
  .szai-card { flex-basis: 330px; }
  .szai-msg { font-size: 16px; }
}

@media (max-width: 1200px) {
  :root { --szai-right: 12px; --szai-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .szai-launcher { width: 54px; height: 54px; }
  .szai-panel { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); width: min(520px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 190px)); }
}

@media (max-width: 600px) {
  body.szai-open { overflow: hidden; }
  body.szai-open .szai-launcher { opacity: 0; pointer-events: none; }
  .szai-panel { z-index: 2147483000; inset: 0; right: auto; bottom: auto; width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; box-shadow: none; transform: translateY(100%); }
  .szai-panel.is-open { transform: none; }
  .szai-head { min-height: 62px; padding: 9px 11px; }
  .szai-mini { width: 36px; height: 36px; flex-basis: 36px; }
  .szai-id strong { font-size: 14px; }
  .szai-body { gap: 12px; padding: 12px; }
  .szai-msg { max-width: 91%; padding: 10px 11px; font-size: 12px; }
  .szai-card { flex-basis: min(72vw, 260px); }
  .szai-card__body { min-height: 168px; padding: 12px; }
  .szai-actions > * { min-height: 40px; font-size: 10px; }
  .szai-foot { padding: 9px 9px calc(9px + env(safe-area-inset-bottom, 0px)); }
  .szai-foot textarea { min-height: 42px; font-size: 12px; }
  .szai-send { width: 42px; height: 42px; flex-basis: 42px; }
}

body.sez-menu-open .szai-launcher,
body.sez-menu-open .szai-panel,
body.sez-modal-open .szai-launcher,
body.sez-modal-open .szai-panel { opacity: 0 !important; pointer-events: none !important; }

@media (prefers-reduced-motion: reduce) {
  .szai-glow,
  .szai-star,
  .szai-mini::before,
  .szai-typing i { animation: none !important; }
  .szai-panel,
  .szai-card__slide { transition: none; }
}
