.cs-fab,
.cs-win {
  --cs-stripe: linear-gradient(
    90deg,
    var(--accent-red),
    var(--accent-yellow),
    var(--accent-green),
    var(--accent-blue),
    var(--accent-purple),
    var(--accent-red)
  );
  font-family: var(--font-family, sans-serif);
}
.cs-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px 0 9px;
  border: 1px solid var(--gray-700);
  border-radius: 26px;
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  font: 800 0.95rem/1 var(--font-family, sans-serif);
  letter-spacing: 0.01em;
  background: linear-gradient(
    135deg,
    var(--gray-800) 0%,
    var(--header-footer-bg) 45%,
    var(--gray-950) 100%
  );
  box-shadow: 0 8px 24px #12173a66;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    opacity 0.25s,
    visibility 0.25s,
    bottom 0.25s;
  animation: csPulse 2.6s ease-out 1.5s 3;
}
.cs-fab:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--cs-stripe);
  background-size: 200% 100%;
  animation: csShimmer 6s linear infinite;
}
.cs-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px #12173a80;
}
.cs-fab:focus-visible,
.cs-win button:focus-visible,
.cs-win input:focus-visible {
  outline: 3px solid var(--accent-blue);
  outline-offset: 2px;
}
.cs-fab-ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-yellow);
  color: var(--gray-950);
}
@keyframes csPulse {
  0% {
    box-shadow:
      0 8px 24px #12173a66,
      0 0 #f3c0328c;
  }
  70%,
  to {
    box-shadow:
      0 8px 24px #12173a66,
      0 0 0 16px #f3c03200;
  }
}
@keyframes csShimmer {
  to {
    background-position: 200% 50%;
  }
}
.cs-win {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  width: min(396px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 120px), var(--cs-avail, 100vh));
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px #12173a61;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
  transform-origin: 100% 100%;
  transition:
    opacity 0.22s,
    transform 0.22s,
    visibility 0.22s;
}
.cs-win.cs-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.cs-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 18px 16px;
  color: #fff;
  background:
    radial-gradient(circle at left center, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at right center, rgba(246, 123, 2, 0.2), transparent 62%),
    linear-gradient(135deg, var(--gray-800) 0%, var(--header-footer-bg) 55%, var(--gray-950) 100%);
}
.cs-head:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--cs-stripe);
  background-size: 200% 100%;
  animation: csShimmer 6s linear infinite;
}
.cs-ttl {
  flex: 1;
  min-width: 0;
}
.cs-ttl strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cs-ttl span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--gray-300);
}
.cs-ttl span:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}
.cs-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #ffffff1a;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.cs-x:hover {
  background: #ffffff38;
}
.cs-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.cs-m {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
}
.cs-m:has(.cs-chips) {
  max-width: 100%;
}
.cs-me {
  align-self: flex-end;
  align-items: flex-end;
}
.cs-b {
  padding: 11px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.cs-bot .cs-b {
  background: #fff;
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
  border-radius: 4px 16px 16px;
}
.cs-me .cs-b {
  background: linear-gradient(135deg, var(--gray-800), var(--gray-950));
  color: #fff;
  border-radius: 16px 16px 4px;
}
.cs-b p + p,
.cs-b ul {
  margin-top: 8px;
}
.cs-b ul {
  padding-left: 18px;
}
.cs-b li {
  margin-top: 3px;
}
.cs-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-spk,
.cs-act,
.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 0.78rem/1 var(--font-family, sans-serif);
  cursor: pointer;
  border-radius: 16px;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.cs-spk {
  height: 30px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--gray-700);
}
.cs-spk:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}
.cs-spk.on {
  background: var(--accent-yellow);
  border-color: var(--accent-yellow);
  color: var(--gray-950);
}
.cs-wv {
  display: none;
  align-items: center;
  gap: 2px;
  height: 12px;
}
.cs-wv i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  animation: csWave 0.8s ease-in-out infinite;
}
.cs-wv i:nth-child(2) {
  animation-delay: 0.15s;
}
.cs-wv i:nth-child(3) {
  animation-delay: 0.3s;
}
.cs-spk.on .cs-wv {
  display: inline-flex;
}
.cs-spk.on .cs-ic {
  display: none;
}
@keyframes csWave {
  0%,
  to {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}
.cs-act {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: var(--accent-blue);
  color: var(--gray-950);
}
.cs-act:hover {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--accent-blue);
}
.cs-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}
.cs-chip {
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-left: 3px solid var(--c, var(--accent-yellow));
  background: #fff;
  color: var(--gray-800);
  font-weight: 600;
  font-size: 0.74rem;
  line-height: 1.25;
  border-radius: 10px;
  text-align: left;
}
.cs-chip:hover {
  background: var(--gray-100);
}
.cs-dots {
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
}
.cs-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-yellow);
  animation: csDot 1s ease-in-out infinite;
}
.cs-dots i:nth-child(2) {
  background: var(--accent-blue);
  animation-delay: 0.15s;
}
.cs-dots i:nth-child(3) {
  background: var(--accent-green);
  animation-delay: 0.3s;
}
@keyframes csDot {
  0%,
  to {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.cs-form {
  display: flex;
  gap: 8px;
  padding: 12px 12px 6px;
  background: #fff;
  border-top: 1px solid var(--gray-200);
}
.cs-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--gray-300);
  border-radius: 22px;
  background: var(--gray-50);
  color: var(--gray-900);
  font: inherit;
  font-size: 0.93rem;
}
.cs-form input:focus {
  border-color: var(--steam-blue);
  outline: 0;
  box-shadow: 0 0 0 3px #9fc6e799;
}
.cs-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-yellow);
  color: var(--gray-950);
  cursor: pointer;
  transition:
    transform 0.15s,
    opacity 0.2s;
}
.cs-send:hover:not(:disabled) {
  transform: scale(1.07);
}
.cs-send:disabled {
  opacity: 0.45;
  cursor: default;
}
.cs-note {
  padding: 0 14px 10px;
  background: #fff;
  font-size: 0.7rem;
  color: var(--gray-500);
  text-align: center;
}
.cs-win {
  padding: 4px;
  background: #c6c6c6;
  border: 0;
  border-radius: 0;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px gray,
    inset 2px 2px #dfdfdf,
    8px 8px #080c3c73,
    0 24px 56px #00000059;
}
.cs-head {
  flex: none;
  height: 28px;
  padding: 0 3px 0 6px;
  gap: 8px;
  color: #fff;
  background: navy;
  font-size: 0.86rem;
  -webkit-user-select: none;
  user-select: none;
}
.cs-head:after {
  display: none;
}
.cs-bar-ic {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
}
.cs-ttl {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-ttl strong {
  display: inline;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.cs-ttl span {
  display: inline;
  font-size: 0.76rem;
  font-weight: 600;
  color: #c1cbec;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-ttl span:before {
  display: none;
}
.cs-x {
  width: 21px;
  height: 21px;
  border-radius: 0;
  background: #c6c6c6;
  color: #12173a;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px gray,
    inset 2px 2px #dfdfdf;
}
.cs-x:hover {
  background: #d4d4d4;
}
.cs-x:active {
  box-shadow:
    inset 1px 1px #0a0a0a,
    inset -1px -1px #fff,
    inset 2px 2px gray,
    inset -2px -2px #dfdfdf;
}
.cs-x svg {
  width: 10px;
  height: 10px;
}
.cs-corpo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
  padding: 2px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    inset 1px 1px #0a0a0a,
    inset -1px -1px #fff,
    inset 2px 2px gray,
    inset -2px -2px #dfdfdf;
}
.cs-log {
  background: var(--gray-50);
}
.cs-bot .cs-b {
  border-radius: 0;
  box-shadow: 2px 2px #00000024;
}
.cs-me .cs-b {
  border-radius: 0;
  box-shadow: 2px 2px #00000040;
}
.cs-spk,
.cs-act,
.cs-chip {
  border-radius: 0;
}
.cs-spk,
.cs-act {
  border: 0;
  background: #c6c6c6;
  color: #000;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px gray,
    inset 2px 2px #dfdfdf;
}
.cs-spk:hover,
.cs-act:hover {
  background: #d4d4d4;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px gray,
    inset 2px 2px #dfdfdf;
}
.cs-spk.on {
  background: var(--accent-yellow);
  color: var(--gray-950);
}
.cs-chip {
  border: 1px solid var(--gray-400);
  border-left: 4px solid var(--c, var(--accent-yellow));
}
.cs-form {
  padding: 10px 10px 6px;
  gap: 8px;
}
.cs-form input {
  height: 40px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow:
    inset 1px 1px #0a0a0a,
    inset -1px -1px #fff,
    inset 2px 2px gray,
    inset -2px -2px #dfdfdf;
}
.cs-form input:focus {
  box-shadow:
    inset 1px 1px #0a0a0a,
    inset -1px -1px #fff,
    inset 2px 2px gray,
    inset -2px -2px #dfdfdf,
    0 0 0 2px var(--accent-blue);
}
.cs-send {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: #c6c6c6;
  color: #000;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px gray,
    inset 2px 2px #dfdfdf;
}
.cs-send:hover:not(:disabled) {
  transform: none;
  background: var(--accent-yellow);
}
.cs-send:active:not(:disabled) {
  box-shadow:
    inset 1px 1px #0a0a0a,
    inset -1px -1px #fff,
    inset 2px 2px gray,
    inset -2px -2px #dfdfdf;
}
.cs-win {
  z-index: 10000;
}
@media (max-width: 520px) {
  .cs-fab {
    padding-right: 16px;
    height: 48px;
  }
  .cs-fab.cs-away {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .cs-win {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 12px !important;
    height: min(82vh, 640px, var(--cs-avail, 100vh));
  }
  .cs-m {
    max-width: 94%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs-fab,
  .cs-fab:after,
  .cs-head:after,
  .cs-wv i,
  .cs-dots i {
    animation: none !important;
  }
  .cs-win,
  .cs-log {
    transition: none;
    scroll-behavior: auto;
  }
}
