body.carbi-specialist-chat-open {
  overflow: hidden !important;
}

#carbi-specialist-chat,
#carbi-specialist-chat * {
  box-sizing: border-box;
}

#carbi-specialist-chat {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  display: grid;
  place-items: center;
  padding:
    max(8px, env(safe-area-inset-top))
    8px
    max(8px, env(safe-area-inset-bottom));
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  visibility: visible !important;
}

.csc-backdrop {
  position: absolute;
  inset: 0;
  background:
    rgba(6, 24, 52, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.csc-shell {
  position: relative;
  width: min(760px, 100%);
  height: min(850px, calc(100vh - 16px));
  overflow: hidden;
  border:
    1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  display: grid;
  grid-template-rows:
    auto 1fr auto auto;
  background: #f8fbff;
  box-shadow:
    0 40px 120px rgba(3, 25, 63, 0.46);
}

.csc-header {
  min-height: 91px;
  padding: 14px 17px;
  display: grid;
  grid-template-columns:
    42px 53px 1fr 42px;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  background:
    radial-gradient(
      circle at 90% 0,
      rgba(102, 211, 255, 0.85),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      #075bc1,
      #087ee7 58%,
      #14a3f5
    );
}

.csc-back,
.csc-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    rgba(255, 255, 255, 0.16);
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}

.csc-specialist-icon {
  width: 53px;
  height: 53px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    rgba(255, 255, 255, 0.95);
  box-shadow:
    0 9px 22px rgba(2, 49, 108, 0.22);
  font-size: 27px;
}

.csc-header-copy {
  min-width: 0;
}

.csc-header-copy small {
  display: block;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.14em;
  opacity: 0.82;
}

.csc-header-copy h2 {
  margin: 3px 0 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
}

.csc-header-copy p {
  margin: 0;
  font-size: 11px;
  opacity: 0.88;
}

.csc-messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 17px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    radial-gradient(
      circle at 15% 5%,
      rgba(211, 237, 255, 0.8),
      transparent 26%
    ),
    linear-gradient(
      180deg,
      #f4faff,
      #ffffff
    );
}

.csc-message {
  max-width: 88%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.csc-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.csc-carbi {
  align-self: flex-start;
}

.csc-message-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #0b7fe7,
      #4d4bea
    );
  font-size: 10px;
  font-weight: 850;
}

.csc-user .csc-message-avatar {
  color: #31506e;
  background: #e6eef7;
}

.csc-message-bubble {
  padding: 12px 14px;
  border:
    1px solid #dce8f3;
  border-radius:
    19px 19px 19px 5px;
  color: #243d59;
  background: #ffffff;
  box-shadow:
    0 7px 21px rgba(29, 72, 116, 0.08);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.csc-user .csc-message-bubble {
  border-color: transparent;
  border-radius:
    19px 19px 5px 19px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #0878de,
      #3565e7
    );
}

.csc-thinking .csc-message-bubble {
  color: #77889b;
  font-style: italic;
}

.csc-suggestions {
  min-height: 0;
  padding: 8px 13px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  background: #f8fbff;
  border-top:
    1px solid #e1eaf3;
}

.csc-suggestions:empty {
  display: none;
}

.csc-suggestions button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border:
    1px solid #c9ddf0;
  border-radius: 999px;
  color: #1769bc;
  background: #ffffff;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.csc-composer {
  padding:
    11px
    12px
    max(
      11px,
      env(safe-area-inset-bottom)
    );
  display: grid;
  grid-template-columns:
    42px 1fr 42px 46px;
  align-items: end;
  gap: 8px;
  background: #ffffff;
  border-top:
    1px solid #dce7f2;
}

.csc-composer textarea {
  width: 100%;
  max-height: 130px;
  resize: none;
  padding: 11px 13px;
  border:
    1px solid #ceddeb;
  border-radius: 17px;
  outline: none;
  color: #213b57;
  background: #f7faff;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.csc-composer textarea:focus {
  border-color: #2786df;
  box-shadow:
    0 0 0 3px rgba(28, 128, 224, 0.12);
}

.csc-upload,
.csc-microphone,
.csc-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font: inherit;
  cursor: pointer;
}

.csc-upload {
  color: #146fc4;
  background: #e9f4ff;
  font-size: 27px;
}

.csc-microphone {
  background: #edf3fa;
  font-size: 19px;
}

.csc-send {
  width: 46px;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #097de5,
      #315ee4
    );
  box-shadow:
    0 8px 18px rgba(27, 105, 218, 0.25);
  font-size: 19px;
}

.csc-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 620px) {
  #carbi-specialist-chat {
    padding: 0;
  }

  .csc-shell {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .csc-header {
    padding-top:
      max(
        12px,
        env(safe-area-inset-top)
      );
    grid-template-columns:
      39px 47px 1fr 39px;
    gap: 8px;
  }

  .csc-back,
  .csc-close {
    width: 39px;
    height: 39px;
  }

  .csc-specialist-icon {
    width: 47px;
    height: 47px;
    border-radius: 16px;
    font-size: 24px;
  }

  .csc-header-copy h2 {
    font-size: 18px;
  }

  .csc-messages {
    padding: 16px 11px;
  }

  .csc-message {
    max-width: 94%;
  }

  .csc-message-bubble {
    font-size: 13px;
  }

  .csc-composer {
    grid-template-columns:
      39px 1fr 39px 43px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .csc-upload,
  .csc-microphone {
    width: 39px;
    height: 39px;
  }

  .csc-send {
    width: 43px;
    height: 43px;
  }
}


/*
============================================================================
CARBI SPECIALIST CHAT V2 — RICH UPLOADS AND VOICE STATES
============================================================================
*/

.csc-message-content {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 7px;
}

.csc-user .csc-message-content {
  justify-items: end;
}

.csc-image-attachment {
  width:
    min(360px, 72vw);
  margin: 0;
  overflow: hidden;
  border:
    1px solid rgba(
      184,
      207,
      229,
      0.9
    );
  border-radius: 19px;
  background: #ffffff;
  box-shadow:
    0 9px 26px
    rgba(28, 68, 110, 0.12);
}

.csc-image-attachment img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  background: #eef5fb;
}

.csc-image-attachment figcaption {
  padding: 8px 11px;
  overflow: hidden;
  color: #64788d;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.csc-file-attachment {
  width:
    min(360px, 75vw);
  min-height: 72px;
  padding: 11px;
  border:
    1px solid #d6e3ef;
  border-radius: 18px;
  display: grid;
  grid-template-columns:
    50px 1fr;
  align-items: center;
  gap: 11px;
  background: #ffffff;
  box-shadow:
    0 8px 22px
    rgba(28, 68, 110, 0.1);
}

.csc-file-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #ef4747,
      #bd1f36
    );
  font-size: 11px;
  font-weight: 900;
}

.csc-file-copy {
  min-width: 0;
  display: grid;
}

.csc-file-copy strong {
  overflow: hidden;
  color: #203c59;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.csc-file-copy small {
  margin-top: 4px;
  color: #71859a;
  font-size: 10px;
}

.csc-microphone {
  height: 46px;
  padding: 4px 3px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
}

.csc-microphone-icon {
  font-size: 17px;
  line-height: 1;
}

.csc-microphone-label {
  max-width: 38px;
  margin-top: 2px;
  overflow: hidden;
  color: #577088;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7px;
  font-weight: 750;
}

.csc-microphone[
  data-voice-state="starting"
] {
  color: #0d6ec6;
  background: #ddecfb;
}

.csc-microphone[
  data-voice-state="listening"
] {
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #0789ea,
      #11b6d7
    );
  box-shadow:
    0 0 0 4px
    rgba(10, 151, 223, 0.13);
  animation:
    cscVoicePulse
    1.15s ease-in-out infinite;
}

.csc-microphone[
  data-voice-state="listening"
]
.csc-microphone-label {
  color: #ffffff;
}

.csc-microphone[
  data-voice-state="processing"
] {
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #10a875,
      #14c6a4
    );
}

.csc-microphone[
  data-voice-state="processing"
]
.csc-microphone-label {
  color: #ffffff;
}

.csc-upload[
  data-uploading="true"
] {
  cursor: wait;
  opacity: 0.65;
}

@keyframes cscVoicePulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

@media (max-width: 620px) {
  .csc-image-attachment {
    width:
      min(330px, 76vw);
  }

  .csc-file-attachment {
    width:
      min(330px, 79vw);
  }

  .csc-microphone {
    height: 43px;
  }
}


/*
============================================================================
CARBI PENDING PHOTO SEND FIX
============================================================================
*/

.csc-send:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.csc-send[
  data-ready="true"
] {
  opacity: 1;
  pointer-events: auto;
  animation:
    cscSendReadyPulse
    1.8s ease-in-out infinite;
}

.csc-pending-upload {
  position: relative;
}

.csc-pending-upload.is-sending {
  opacity: 0.72;
  pointer-events: none;
}

.csc-pending-caption {
  width: 100%;
  padding: 7px 10px;
  border:
    1px solid #c9dced;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content:
    space-between;
  gap: 12px;
  color: #35617f;
  background: #edf7ff;
  font-size: 10px;
  font-weight: 750;
}

.csc-pending-caption button {
  padding: 5px 9px;
  border:
    1px solid #c5d7e8;
  border-radius: 999px;
  color: #a12d38;
  background: #ffffff;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

@keyframes cscSendReadyPulse {
  0%,
  100% {
    box-shadow:
      0 8px 18px
      rgba(27, 105, 218, 0.25);
  }

  50% {
    box-shadow:
      0 8px 24px
      rgba(27, 105, 218, 0.48);
  }
}


/*
============================================================================
CARBI HANDS-FREE CONVERSATION MODE
============================================================================
*/

.csc-conversation-banner {
  min-height: 48px;
  padding: 8px 11px;
  border-top:
    1px solid #d6e5f1;
  display: grid;
  grid-template-columns:
    13px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #24506e;
  background:
    linear-gradient(
      90deg,
      #eaf7ff,
      #f4fbff
    );
}

.csc-conversation-banner[hidden] {
  display: none !important;
}

.csc-conversation-indicator {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2489e8;
  box-shadow:
    0 0 0 4px
    rgba(36, 137, 232, 0.12);
}

.csc-conversation-banner strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.csc-conversation-banner button {
  min-height: 31px;
  padding: 6px 10px;
  border:
    1px solid #ef9da3;
  border-radius: 999px;
  color: #a51f30;
  background: #fff7f7;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.csc-conversation-banner[
  data-stage="listening"
] {
  color: #065aaa;
  background:
    linear-gradient(
      90deg,
      #dff3ff,
      #edfaff
    );
}

.csc-conversation-banner[
  data-stage="listening"
]
.csc-conversation-indicator {
  background: #098dea;
  animation:
    cscConversationListening
    1.1s ease-in-out infinite;
}

.csc-conversation-banner[
  data-stage="thinking"
],
.csc-conversation-banner[
  data-stage="processing"
] {
  color: #704e0b;
  background:
    linear-gradient(
      90deg,
      #fff6d8,
      #fffaf0
    );
}

.csc-conversation-banner[
  data-stage="thinking"
]
.csc-conversation-indicator,
.csc-conversation-banner[
  data-stage="processing"
]
.csc-conversation-indicator {
  background: #e4a215;
  animation:
    cscConversationThinking
    0.9s linear infinite;
}

.csc-conversation-banner[
  data-stage="speaking"
] {
  color: #08724e;
  background:
    linear-gradient(
      90deg,
      #ddf9ef,
      #edfff9
    );
}

.csc-conversation-banner[
  data-stage="speaking"
]
.csc-conversation-indicator {
  background: #16ad78;
  animation:
    cscConversationSpeaking
    0.65s ease-in-out infinite alternate;
}

.csc-microphone[
  data-voice-state="speaking"
] {
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #0aa875,
      #17cfa5
    );
}

.csc-microphone[
  data-voice-state="speaking"
]
.csc-microphone-label {
  color: #ffffff;
}

@keyframes cscConversationListening {
  0%,
  100% {
    transform: scale(0.85);
    box-shadow:
      0 0 0 3px
      rgba(9, 141, 234, 0.13);
  }

  50% {
    transform: scale(1.15);
    box-shadow:
      0 0 0 7px
      rgba(9, 141, 234, 0.1);
  }
}

@keyframes cscConversationThinking {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes cscConversationSpeaking {
  from {
    transform: scaleY(0.72);
  }

  to {
    transform: scaleY(1.25);
  }
}

@media (max-width: 620px) {
  .csc-conversation-banner {
    grid-template-columns:
      11px 1fr auto;
    padding: 7px 8px;
  }

  .csc-conversation-banner strong {
    font-size: 9px;
  }

  .csc-conversation-banner button {
    padding: 5px 7px;
    font-size: 8px;
  }
}


/*
============================================================================
CARBI INTERRUPT CORRECTED
============================================================================
*/

#csc-stop-conversation[
  data-action="interrupt"
] {
  border-color: #178bd8;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #087fe1,
      #15b6d8
    );
  box-shadow:
    0 8px 21px
    rgba(8, 126, 213, 0.28);
  animation:
    cscCorrectedInterruptPulse
    1.15s ease-in-out infinite;
}

.csc-microphone[
  data-interrupt="true"
] {
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #087fe1,
      #15b6d8
    );
  box-shadow:
    0 0 0 4px
    rgba(8, 135, 218, 0.14);
  animation:
    cscCorrectedInterruptPulse
    1.15s ease-in-out infinite;
}

.csc-microphone[
  data-interrupt="true"
]
.csc-microphone-label {
  color: #ffffff;
}

@keyframes cscCorrectedInterruptPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.045);
  }
}
