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

.carbi-chat-launcher {
  position: fixed;
  z-index: 10020;
  right: 22px;
  bottom: max(
    24px,
    env(safe-area-inset-bottom)
  );
  height: 58px;
  padding: 0 19px 0 8px;
  border: 0;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #1678f2,
      #0758cb
    );
  box-shadow:
    0 18px 48px
    rgba(7, 71, 165, 0.35);
  cursor: pointer;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    sans-serif;
}

.carbi-launcher-icon {
  position: relative;
  z-index: 2;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #0962d8;
  background: #ffffff;
  font-size: 20px;
  font-weight: 900;
}

.carbi-launcher-label {
  font-size: 14px;
  font-weight: 800;
}

.carbi-launcher-pulse {
  position: absolute;
  left: 8px;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background:
    rgba(255, 255, 255, 0.38);
  animation:
    carbi-launcher-pulse
    2s ease-out infinite;
}

.carbi-modern-chat {
  position: fixed;
  z-index: 10040;
  inset: 0;
  display: none;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.carbi-modern-chat.open {
  display: block;
}

.carbi-chat-backdrop {
  position: absolute;
  inset: 0;
  background:
    rgba(5, 16, 34, 0.56);
  backdrop-filter:
    blur(8px);
  animation:
    carbi-fade-in
    0.18s ease-out;
}

.carbi-chat-window {
  position: absolute;
  top: 50%;
  left: 50%;
  width:
    min(920px, calc(100vw - 34px));
  height:
    min(820px, calc(100vh - 34px));
  border:
    1px solid
    rgba(131, 179, 235, 0.27);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-rows:
    auto 1fr auto auto;
  color: #172236;
  background: #ffffff;
  box-shadow:
    0 40px 120px
    rgba(2, 20, 49, 0.42);
  transform:
    translate(-50%, -50%);
  animation:
    carbi-chat-rise
    0.25s ease-out;
}

.carbi-chat-header {
  min-height: 78px;
  padding: 14px 18px;
  border-bottom:
    1px solid #e8edf5;
  display: grid;
  grid-template-columns:
    48px 1fr 42px 42px;
  align-items: center;
  gap: 11px;
  background:
    rgba(255, 255, 255, 0.96);
}

.carbi-chat-avatar {
  width: 47px;
  height: 47px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #2187ff,
      #0658c9
    );
  box-shadow:
    0 10px 24px
    rgba(11, 104, 220, 0.25);
}

.carbi-chat-avatar span {
  font-size: 21px;
  font-weight: 900;
}

.carbi-chat-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carbi-chat-identity strong {
  color: #12213a;
  font-size: 18px;
  font-weight: 900;
}

.carbi-chat-identity span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #718099;
  font-size: 12px;
  font-weight: 650;
}

.carbi-chat-identity i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #24c875;
  box-shadow:
    0 0 0 4px
    rgba(36, 200, 117, 0.12);
}

.carbi-chat-new,
.carbi-chat-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #526179;
  background: #f1f5fa;
  cursor: pointer;
  font-size: 23px;
}

.carbi-chat-close {
  font-size: 27px;
}

.carbi-chat-messages {
  overflow-y: auto;
  padding: 28px;
  scroll-behavior: smooth;
  background:
    radial-gradient(
      circle at top right,
      rgba(59, 143, 247, 0.08),
      transparent 36%
    ),
    #f8fafc;
}

.carbi-welcome-card {
  width: min(610px, 100%);
  margin:
    clamp(20px, 7vh, 70px)
    auto 0;
  text-align: center;
}

.carbi-welcome-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #268dff,
      #0961d7
    );
  box-shadow:
    0 16px 35px
    rgba(10, 100, 216, 0.25);
  font-size: 25px;
}

.carbi-welcome-card h2 {
  margin: 0 0 8px;
  color: #14233c;
  font-size:
    clamp(25px, 4vw, 34px);
  font-weight: 900;
}

.carbi-welcome-card p {
  margin: 0 auto 23px;
  max-width: 480px;
  color: #6f7e95;
  line-height: 1.55;
}

.carbi-starter-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.carbi-starter-grid button {
  min-height: 54px;
  padding: 12px 14px;
  border:
    1px solid #dfe7f1;
  border-radius: 15px;
  color: #33425a;
  background:
    rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.carbi-message-row {
  width: 100%;
  margin: 0 auto 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.carbi-message-row.user {
  justify-content: flex-end;
}

.carbi-message-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #278cff,
      #0759ca
    );
  font-size: 14px;
  font-weight: 900;
}

.carbi-message-bubble {
  max-width: min(680px, 82%);
  padding: 14px 16px;
  border:
    1px solid #e2e8f1;
  border-radius:
    7px 19px 19px 19px;
  color: #29364b;
  background: #ffffff;
  box-shadow:
    0 7px 22px
    rgba(23, 54, 94, 0.07);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.carbi-message-row.user
.carbi-message-bubble {
  border: 0;
  border-radius:
    19px 19px 7px 19px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #167cf4,
      #075cca
    );
  box-shadow:
    0 10px 25px
    rgba(9, 94, 205, 0.2);
}

.carbi-message-name {
  display: block;
  margin-bottom: 5px;
  color: #0865d5;
  font-size: 12px;
  font-weight: 900;
}

.carbi-message-bubble p {
  margin: 0;
}

.carbi-thinking-dots {
  height: 21px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.carbi-thinking-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b83c7;
  animation:
    carbi-thinking
    1s infinite alternate;
}

.carbi-thinking-dots i:nth-child(2) {
  animation-delay: 0.18s;
}

.carbi-thinking-dots i:nth-child(3) {
  animation-delay: 0.36s;
}

.carbi-message-row.visual
.carbi-message-bubble {
  width: min(680px, 88%);
  max-width: min(680px, 88%);
  padding: 14px;
}

.carbi-visual-ready-text {
  margin: 0 2px 12px !important;
}

.carbi-result-image {
  width: 100%;
  border-radius: 17px;
  overflow: hidden;
  background: #edf2f7;
  box-shadow:
    0 15px 38px
    rgba(18, 56, 101, 0.16);
}

.carbi-result-image img {
  width: 100%;
  max-height: 58vh;
  display: block;
  object-fit: contain;
}

.carbi-image-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.carbi-image-actions button {
  min-height: 36px;
  padding: 8px 14px;
  border:
    1px solid #dbe5f0;
  border-radius: 11px;
  color: #33506e;
  background: #f5f8fc;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.carbi-generation-bar {
  display: none;
  padding: 10px 20px 9px;
  border-top:
    1px solid #e4ebf4;
  background: #f5f9ff;
}

.carbi-generation-bar.active {
  display: block;
}

.carbi-generation-track {
  height: 6px;
  border-radius: 20px;
  overflow: hidden;
  background: #dbe8f8;
}

.carbi-generation-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      #157af2,
      #52adff
    );
  transition:
    width 1.2s ease;
}

.carbi-generation-bar p {
  margin: 7px 0 0;
  color: #517295;
  font-size: 11px;
  font-weight: 750;
}

.carbi-chat-composer {
  padding:
    13px 18px
    calc(
      12px +
      env(safe-area-inset-bottom)
    );
  border-top:
    1px solid #e7edf5;
  background: #ffffff;
}

.carbi-chat-input-wrap {
  min-height: 55px;
  padding: 6px;
  border:
    1px solid #d8e2ed;
  border-radius: 20px;
  display: grid;
  grid-template-columns:
    42px 1fr 44px;
  align-items: end;
  gap: 5px;
  background: #f9fbfd;
  box-shadow:
    0 8px 24px
    rgba(27, 58, 96, 0.08);
}

.carbi-chat-input-wrap:focus-within {
  border-color: #5b9df0;
  box-shadow:
    0 0 0 4px
    rgba(30, 126, 239, 0.1);
}

.carbi-chat-attach,
.carbi-chat-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.carbi-chat-attach {
  color: #53647b;
  background: transparent;
  font-size: 25px;
}

.carbi-chat-send {
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #2188ff,
      #0759ca
    );
  font-size: 18px;
}

.carbi-chat-send.busy {
  opacity: 0.55;
}

.carbi-chat-input-wrap textarea {
  width: 100%;
  min-height: 42px;
  max-height: 150px;
  padding: 11px 5px 7px;
  border: 0;
  outline: 0;
  resize: none;
  color: #1c2c43;
  background: transparent;
  font: inherit;
  line-height: 1.45;
}

.carbi-chat-input-wrap textarea::placeholder {
  color: #8996a9;
}

.carbi-chat-composer small {
  margin-top: 7px;
  display: block;
  color: #96a1b0;
  font-size: 10px;
  text-align: center;
}

@keyframes carbi-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes carbi-chat-rise {
  from {
    opacity: 0;
    transform:
      translate(-50%, -46%)
      scale(0.97);
  }
}

@keyframes carbi-launcher-pulse {
  from {
    transform: scale(1);
    opacity: 0.6;
  }

  to {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes carbi-thinking {
  to {
    transform: translateY(-5px);
    opacity: 0.45;
  }
}

@media (max-width: 700px) {
  .carbi-chat-launcher {
    right: 15px;
    bottom:
      max(
        18px,
        env(safe-area-inset-bottom)
      );
    width: 58px;
    padding: 0;
    justify-content: center;
  }

  .carbi-launcher-pulse {
    left: 8px;
  }

  .carbi-launcher-label {
    display: none;
  }

  .carbi-chat-window {
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    transform: none;
    animation:
      carbi-mobile-rise
      0.22s ease-out;
  }

  .carbi-chat-header {
    padding-top:
      calc(
        11px +
        env(safe-area-inset-top)
      );
  }

  .carbi-chat-messages {
    padding: 18px 13px;
  }

  .carbi-message-bubble {
    max-width: 87%;
  }

  .carbi-message-row.visual
  .carbi-message-bubble {
    width: calc(100% - 44px);
    max-width: calc(100% - 44px);
  }

  .carbi-starter-grid {
    grid-template-columns: 1fr;
  }

  .carbi-chat-composer {
    padding-left: 11px;
    padding-right: 11px;
  }

  .carbi-chat-new {
    display: none;
  }

  .carbi-chat-header {
    grid-template-columns:
      46px 1fr 42px;
  }
}

@keyframes carbi-mobile-rise {
  from {
    opacity: 0;
    transform:
      translateY(25px);
  }
}


/* =========================================================
   CARBI CHAT ROOM — CLEAR FRIENDLY BUTTON V3
   ========================================================= */

.carbi-chat-launcher {
  right: 20px;
  bottom:
    max(
      24px,
      env(safe-area-inset-bottom)
    );
  width: auto;
  min-width: 220px;
  height: 68px;
  padding: 8px 20px 8px 9px;
  border:
    1px solid
    rgba(255, 255, 255, 0.38);
  border-radius: 35px;
  gap: 12px;
  overflow: visible;
  background:
    linear-gradient(
      125deg,
      #087ff5 0%,
      #2469ed 48%,
      #7438e9 100%
    );
  box-shadow:
    0 19px 48px
    rgba(32, 90, 225, 0.38),
    0 0 0 5px
    rgba(40, 122, 245, 0.09);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.carbi-chat-launcher:hover {
  transform:
    translateY(-2px);
  box-shadow:
    0 23px 55px
    rgba(32, 90, 225, 0.44),
    0 0 0 6px
    rgba(40, 122, 245, 0.11);
}

.carbi-chat-launcher:active {
  transform:
    scale(0.97);
}

.carbi-launcher-icon {
  position: relative;
  z-index: 2;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    rgba(255, 255, 255, 0.18);
  border:
    1px solid
    rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0
    rgba(255, 255, 255, 0.3),
    0 8px 20px
    rgba(14, 53, 159, 0.22);
}

.carbi-launcher-icon svg {
  width: 29px;
  height: 29px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carbi-launcher-icon svg circle {
  fill: currentColor;
  stroke: none;
}

.carbi-launcher-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  color: #ffffff;
  white-space: nowrap;
}

.carbi-launcher-copy strong {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.carbi-launcher-copy small {
  color:
    rgba(255, 255, 255, 0.84);
  font-size: 10.5px;
  font-weight: 650;
}

.carbi-launcher-pulse {
  left: 10px;
  width: 48px;
  height: 48px;
  background:
    rgba(255, 255, 255, 0.3);
}

.carbi-chat-avatar {
  width: 57px;
  height: 57px;
  border-radius: 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #1686fa,
      #245fe4 58%,
      #6b3ce9
    );
  box-shadow:
    0 12px 28px
    rgba(35, 99, 222, 0.27);
}

.carbi-chat-avatar span {
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
}

.carbi-chat-avatar small {
  margin-top: 2px;
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  font-weight: 850;
}

.carbi-chat-header {
  grid-template-columns:
    58px 1fr 42px 42px;
}

.carbi-result-image {
  border:
    1px solid #e1e9f4;
  border-radius: 22px;
  padding: 10px;
  background:
    linear-gradient(
      145deg,
      #f8fbff,
      #edf4fd
    );
}

.carbi-result-image img {
  border-radius: 16px;
}

.carbi-message-row.visual
.carbi-message-bubble {
  border:
    1px solid
    rgba(96, 145, 215, 0.2);
  border-radius:
    8px 24px 24px 24px;
  box-shadow:
    0 16px 42px
    rgba(25, 74, 143, 0.11);
}

.carbi-image-actions button {
  border: 0;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #1683f6,
      #315fe0
    );
  box-shadow:
    0 7px 18px
    rgba(30, 101, 222, 0.18);
}

@media (max-width: 700px) {
  .carbi-chat-launcher {
    right: 13px;
    bottom:
      max(
        17px,
        env(safe-area-inset-bottom)
      );
    width: auto;
    min-width: 178px;
    height: 60px;
    padding:
      7px 15px 7px 7px;
    justify-content: flex-start;
  }

  .carbi-launcher-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .carbi-launcher-icon svg {
    width: 27px;
    height: 27px;
  }

  .carbi-launcher-copy {
    display: flex;
  }

  .carbi-launcher-copy strong {
    font-size: 14px;
  }

  .carbi-launcher-copy small {
    font-size: 9.5px;
  }

  .carbi-launcher-pulse {
    left: 8px;
    width: 44px;
    height: 44px;
  }

  .carbi-chat-avatar {
    width: 54px;
    height: 54px;
  }

  .carbi-chat-header {
    grid-template-columns:
      55px 1fr 42px;
  }
}


/* =========================================================
   CARBI PREMIUM CHAT V4
   ========================================================= */

.carbi-chat-window {
  border:
    1px solid
    rgba(91, 139, 213, 0.22);
  background:
    linear-gradient(
      180deg,
      #ffffff,
      #f8fbff
    );
  box-shadow:
    0 42px 130px
    rgba(13, 48, 103, 0.38);
}

.carbi-chat-header {
  min-height: 86px;
  padding: 14px 20px;
  border-bottom:
    1px solid #e4ebf5;
  grid-template-columns:
    58px 1fr 42px 42px;
  background:
    rgba(255, 255, 255, 0.94);
  backdrop-filter:
    blur(20px);
}

.carbi-ai-avatar {
  width: 56px;
  height: 56px;
  border-radius: 19px;
  background:
    linear-gradient(
      145deg,
      #07a7ff,
      #2464ef 52%,
      #6d3cf0
    );
  box-shadow:
    0 12px 28px
    rgba(43, 89, 224, 0.3),
    inset 0 1px 0
    rgba(255, 255, 255, 0.35);
}

.carbi-ai-avatar svg {
  width: 39px;
  height: 39px;
  fill:
    rgba(8, 31, 80, 0.88);
  stroke: #ffffff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carbi-chat-identity strong {
  font-size: 19px;
  letter-spacing: -0.25px;
}

.carbi-chat-identity span {
  color: #74839b;
  font-size: 11.5px;
}

.carbi-chat-messages {
  padding:
    22px clamp(14px, 4vw, 31px);
  background:
    radial-gradient(
      circle at 75% 5%,
      rgba(82, 139, 255, 0.09),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #fbfdff,
      #f6f9fd
    );
}

.carbi-message-row.visual
.carbi-message-bubble {
  width:
    min(700px, calc(100% - 44px));
  max-width:
    min(700px, calc(100% - 44px));
  padding: 13px;
  border:
    1px solid
    rgba(107, 150, 214, 0.2);
  border-radius:
    9px 25px 25px 25px;
  box-shadow:
    0 18px 48px
    rgba(24, 61, 119, 0.12);
}

.carbi-result-image {
  padding: 9px;
  border:
    1px solid #dfe8f3;
  border-radius: 22px;
  background:
    linear-gradient(
      145deg,
      #f8fbff,
      #eef4fb
    );
}

.carbi-result-image img {
  border-radius: 16px;
  max-height: 53vh;
}

.carbi-result-meta {
  padding: 10px 5px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #6680a1;
  font-size: 11px;
  font-weight: 700;
}

.carbi-result-meta span {
  color: #52739e;
}

.carbi-result-meta time {
  white-space: nowrap;
}

.carbi-image-actions {
  margin-top: 13px;
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.carbi-image-actions button {
  min-width: 0;
  min-height: 48px;
  padding: 8px 9px;
  border:
    1px solid
    rgba(111, 151, 211, 0.17);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #1765d5;
  background:
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 8px 22px
    rgba(29, 69, 127, 0.09);
  font-size: 12px;
  font-weight: 850;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.carbi-image-actions button:hover {
  transform:
    translateY(-2px);
  background: #ffffff;
  box-shadow:
    0 12px 28px
    rgba(29, 69, 127, 0.15);
}

.carbi-image-actions button:active {
  transform:
    scale(0.96);
}

.carbi-image-actions button:disabled {
  opacity: 0.65;
}

.carbi-action-icon {
  width: 25px;
  height: 25px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #1786fb,
      #2761e8
    );
  font-size: 14px;
  font-weight: 900;
}

.carbi-image-actions
button[data-action="save"]
.carbi-action-icon {
  background:
    linear-gradient(
      145deg,
      #16b9b5,
      #03999f
    );
}

.carbi-image-actions
button[data-action="edit"]
.carbi-action-icon {
  background:
    linear-gradient(
      145deg,
      #9b55f4,
      #7133e8
    );
}

.carbi-image-actions
button[data-action="variation"]
.carbi-action-icon {
  background:
    linear-gradient(
      145deg,
      #7554f5,
      #335ce8
    );
}

.carbi-image-edit-panel {
  margin-top: 12px;
  padding: 13px;
  border:
    1px solid #dfe8f3;
  border-radius: 16px;
  background:
    linear-gradient(
      145deg,
      #f9fbff,
      #f1f6fd
    );
  animation:
    carbi-edit-panel-in
    0.2s ease-out;
}

.carbi-image-edit-panel strong {
  display: block;
  margin-bottom: 9px;
  color: #273954;
  font-size: 12px;
}

.carbi-image-edit-panel > div {
  display: grid;
  grid-template-columns:
    1fr auto auto;
  gap: 7px;
}

.carbi-image-edit-panel input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border:
    1px solid #d4dfec;
  border-radius: 12px;
  outline: none;
  color: #263852;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
}

.carbi-image-edit-panel input:focus {
  border-color: #438be7;
  box-shadow:
    0 0 0 3px
    rgba(38, 126, 233, 0.11);
}

.carbi-image-edit-panel button {
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #1682f5,
      #6a3be9
    );
  cursor: pointer;
  font-weight: 800;
}

.carbi-image-edit-panel
button[data-edit-cancel] {
  color: #52647d;
  background: #e8eef6;
}

.carbi-chat-input-wrap {
  min-height: 59px;
  border:
    1px solid #d6e1ee;
  border-radius: 23px;
  background:
    rgba(250, 252, 255, 0.97);
  box-shadow:
    0 11px 30px
    rgba(25, 62, 111, 0.09);
}

.carbi-chat-send {
  border-radius: 16px;
  box-shadow:
    0 8px 19px
    rgba(24, 102, 222, 0.25);
}

.carbi-image-viewer {
  position: fixed;
  z-index: 10150;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease;
}

.carbi-image-viewer.open {
  opacity: 1;
  pointer-events: auto;
}

.carbi-viewer-backdrop {
  position: absolute;
  inset: 0;
  background:
    rgba(3, 12, 29, 0.82);
  backdrop-filter:
    blur(16px);
}

.carbi-viewer-window {
  position: relative;
  z-index: 2;
  width:
    min(950px, calc(100vw - 28px));
  height:
    min(880px, calc(100vh - 28px));
  border:
    1px solid
    rgba(255, 255, 255, 0.22);
  border-radius: 26px;
  overflow: hidden;
  display: grid;
  grid-template-rows:
    auto 1fr auto;
  color: #17243a;
  background: #ffffff;
  box-shadow:
    0 40px 120px
    rgba(0, 0, 0, 0.5);
  transform:
    translateY(16px)
    scale(0.98);
  transition:
    transform 0.22s ease;
}

.carbi-image-viewer.open
.carbi-viewer-window {
  transform:
    translateY(0)
    scale(1);
}

.carbi-viewer-window header {
  min-height: 72px;
  padding: 13px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom:
    1px solid #e5ebf3;
}

.carbi-viewer-window header div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.carbi-viewer-window header strong {
  color: #162844;
  font-size: 15px;
}

.carbi-viewer-window header span {
  max-width: 700px;
  overflow: hidden;
  color: #75839a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carbi-viewer-window header button {
  width: 43px;
  height: 43px;
  border: 0;
  border-radius: 14px;
  color: #506078;
  background: #eef3f8;
  cursor: pointer;
  font-size: 28px;
}

.carbi-viewer-image {
  min-height: 0;
  padding: 15px;
  display: grid;
  place-items: center;
  overflow: auto;
  background:
    linear-gradient(
      145deg,
      #eff4fa,
      #e5edf7
    );
}

.carbi-viewer-image img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 17px;
  object-fit: contain;
  box-shadow:
    0 17px 48px
    rgba(8, 31, 67, 0.22);
}

.carbi-viewer-window footer {
  padding: 13px 16px;
  display: flex;
  justify-content: center;
  gap: 9px;
  border-top:
    1px solid #e4eaf2;
}

.carbi-viewer-window footer button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #1482f5,
      #663de9
    );
  cursor: pointer;
  font-weight: 850;
}

@keyframes carbi-edit-panel-in {
  from {
    opacity: 0;
    transform:
      translateY(-5px);
  }
}

@media (max-width: 700px) {
  .carbi-chat-header {
    grid-template-columns:
      56px 1fr 42px;
  }

  .carbi-chat-messages {
    padding: 14px 9px;
  }

  .carbi-message-row.visual
  .carbi-message-bubble {
    width:
      calc(100% - 38px);
    max-width:
      calc(100% - 38px);
    padding: 10px;
  }

  .carbi-result-image {
    padding: 7px;
    border-radius: 18px;
  }

  .carbi-result-image img {
    border-radius: 13px;
    max-height: 49vh;
  }

  .carbi-image-actions {
    gap: 6px;
  }

  .carbi-image-actions button {
    min-height: 49px;
    padding: 6px 4px;
    flex-direction: column;
    gap: 3px;
    border-radius: 13px;
    font-size: 10px;
  }

  .carbi-action-icon {
    width: 23px;
    height: 23px;
    border-radius: 8px;
    font-size: 12px;
  }

  .carbi-image-edit-panel > div {
    grid-template-columns: 1fr;
  }

  .carbi-viewer-window {
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .carbi-viewer-window footer {
    padding-bottom:
      calc(
        13px +
        env(safe-area-inset-bottom)
      );
  }
}


/* =========================================================
   CARBI INTEGRATED VISION & DOCUMENT CENTER V5
   ========================================================= */

.carbi-integrated-vision {
  position: absolute;
  z-index: 25;
  inset: 86px 0 0;
  overflow-y: auto;
  color: #172945;
  background:
    radial-gradient(
      circle at top right,
      rgba(54, 137, 255, 0.12),
      transparent 38%
    ),
    linear-gradient(
      180deg,
      #fafdff,
      #f3f8ff
    );
  opacity: 0;
  transform:
    translateY(24px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.carbi-integrated-vision.open {
  opacity: 1;
  transform:
    translateY(0);
  pointer-events: auto;
}

.carbi-vision-panel-header {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 92px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns:
    54px 1fr 42px;
  align-items: center;
  gap: 12px;
  border-bottom:
    1px solid
    rgba(111, 155, 217, 0.18);
  background:
    rgba(255, 255, 255, 0.94);
  backdrop-filter:
    blur(20px);
}

.carbi-vision-panel-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #1590ff,
      #315de5 55%,
      #703ce9
    );
  box-shadow:
    0 12px 27px
    rgba(39, 94, 220, 0.26);
}

.carbi-vision-panel-icon span {
  font-size: 28px;
  font-weight: 500;
}

.carbi-vision-panel-header > div:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carbi-vision-panel-header strong {
  color: #142845;
  font-size: 18px;
  font-weight: 900;
}

.carbi-vision-panel-header
> div:nth-child(2)
> span {
  color: #74849b;
  font-size: 11px;
  line-height: 1.4;
}

.carbi-vision-panel-header button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  color: #586980;
  background: #edf3f9;
  cursor: pointer;
  font-size: 27px;
}

.carbi-vision-panel-body {
  width:
    min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding:
    22px 0
    calc(
      30px +
      env(safe-area-inset-bottom)
    );
}

.carbi-vision-select-row {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.carbi-vision-select-row label,
.carbi-vision-instruction {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.carbi-vision-select-row label > span,
.carbi-vision-instruction > span {
  color: #243954;
  font-size: 12px;
  font-weight: 850;
}

.carbi-vision-select-row select {
  width: 100%;
  height: 52px;
  padding: 0 13px;
  border:
    1px solid #d5e0ed;
  border-radius: 15px;
  outline: none;
  color: #263a55;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.carbi-vision-pick-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.carbi-vision-pick-card {
  min-height: 155px;
  padding: 20px;
  border:
    1.5px dashed #8fc0ed;
  border-radius: 21px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  color: #1a69c8;
  background:
    rgba(247, 251, 255, 0.92);
  cursor: pointer;
  box-shadow:
    0 10px 28px
    rgba(38, 89, 150, 0.06);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.carbi-vision-pick-card:hover {
  transform:
    translateY(-2px);
  border-color: #3189e9;
  box-shadow:
    0 14px 34px
    rgba(38, 89, 150, 0.12);
}

.carbi-vision-pick-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.carbi-pick-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #1688f7,
      #315fe5
    );
  font-size: 23px;
}

.carbi-vision-pick-card strong {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
}

.carbi-vision-pick-card small {
  color: #77869b;
  font-size: 11px;
}

.carbi-vision-file-preview {
  margin-top: 14px;
  min-height: 72px;
  padding: 10px;
  border:
    1px solid #dce6f1;
  border-radius: 17px;
  display: grid;
  grid-template-columns:
    54px 1fr 38px;
  align-items: center;
  gap: 11px;
  background: #ffffff;
  box-shadow:
    0 9px 24px
    rgba(24, 64, 115, 0.07);
}

.carbi-vision-file-preview[hidden] {
  display: none;
}

.carbi-vision-file-preview
[data-vision-thumbnail] {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #edf3f9;
}

.carbi-vision-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carbi-document-icon {
  color: #176cd3;
  font-size: 11px;
  font-weight: 950;
}

.carbi-vision-file-preview > div:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carbi-vision-file-preview strong {
  overflow: hidden;
  color: #203550;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carbi-vision-file-preview
[data-vision-size] {
  color: #79889b;
  font-size: 10px;
}

.carbi-vision-file-preview
[data-vision-remove] {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  color: #667890;
  background: #edf3f8;
  cursor: pointer;
  font-size: 22px;
}

.carbi-vision-instruction {
  margin-top: 17px;
}

.carbi-vision-instruction textarea {
  width: 100%;
  min-height: 125px;
  padding: 14px;
  border:
    1px solid #d5e0ed;
  border-radius: 18px;
  outline: none;
  resize: vertical;
  color: #263a55;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.carbi-vision-instruction textarea:focus,
.carbi-vision-select-row select:focus {
  border-color: #438deb;
  box-shadow:
    0 0 0 4px
    rgba(40, 127, 235, 0.1);
}

.carbi-vision-permission {
  margin-top: 15px;
  padding: 13px 14px;
  border:
    1px solid #dce6f1;
  border-radius: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #586a81;
  background:
    rgba(255, 255, 255, 0.75);
  font-size: 11px;
  line-height: 1.45;
}

.carbi-vision-permission input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  accent-color: #1683f5;
}

.carbi-vision-panel-actions {
  margin-top: 17px;
  display: grid;
  grid-template-columns:
    120px 1fr;
  gap: 10px;
}

.carbi-vision-panel-actions button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 900;
}

.carbi-vision-panel-actions
[data-vision-cancel] {
  color: #586980;
  background: #e8eff7;
}

.carbi-vision-panel-actions
[data-vision-send] {
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  background:
    linear-gradient(
      125deg,
      #0b86f8,
      #315fe5 52%,
      #713de9
    );
  box-shadow:
    0 13px 30px
    rgba(36, 92, 220, 0.25);
}

.carbi-vision-panel-actions
[data-vision-send] b {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background:
    rgba(255, 255, 255, 0.18);
}

.carbi-vision-panel-actions
button:disabled {
  opacity: 0.58;
  cursor: wait;
}

@media (max-width: 700px) {
  .carbi-integrated-vision {
    inset:
      calc(
        82px +
        env(safe-area-inset-top)
      )
      0 0;
  }

  .carbi-vision-panel-header {
    min-height: 84px;
    padding: 13px;
    grid-template-columns:
      48px 1fr 40px;
  }

  .carbi-vision-panel-icon {
    width: 47px;
    height: 47px;
    border-radius: 16px;
  }

  .carbi-vision-panel-header strong {
    font-size: 16px;
  }

  .carbi-vision-panel-body {
    width:
      calc(100% - 22px);
    padding-top: 15px;
  }

  .carbi-vision-select-row,
  .carbi-vision-pick-grid {
    grid-template-columns: 1fr;
  }

  .carbi-vision-pick-card {
    min-height: 122px;
    padding: 17px;
  }

  .carbi-vision-panel-actions {
    grid-template-columns:
      96px 1fr;
  }
}
