.user-bubble {
  background: var(--bg-surface);
  padding: 12px 20px;
  border-radius: 18px 18px 4px 18px;
  max-width: 80%;
  color: var(--text-high);
  line-height: 1.5;
  border: 1px solid #ebebeb;
  margin-right: -10px;
}

.user-bubble {
  margin-left: auto;
}

.ai-message {
  align-items: flex-start;
  width: 100%;
}

.ai-bubble {
  display: inline-block;
  width: auto;
  max-width: 85%;
  padding: 0 20px 4px 20px;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--text-high);
  background: transparent;
  border-radius: 18px;
}

.chat-generated-image {
  display: block;
  margin: 8px 0 6px;
  width: min(100%, 280px);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.chat-generated-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  background: #ffffff;
  object-fit: contain;
}

.chat-image-fallback {
  display: none;
}

.chat-generated-image.image-load-failed {
  display: flex;
  min-height: 156px;
  border: 1px solid #eeeeee;
  background: #f7f7f7;
  color: #555555;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
}

.chat-generated-image.image-load-failed .chat-image-fallback {
  display: inline-flex;
}

.code-block-container {
  background: #ffffff;
  border-radius: 14px;
  margin: 6px 0;
  overflow: hidden;
  border: 1px solid #dedede;
  box-shadow: none;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background: #ffffff;
  border-bottom: 1px solid #dedede;
}

.code-lang {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: #1f1f1f;
  text-transform: lowercase;
  font-weight: 600;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  color: #1f1f1f;
  cursor: pointer;
  border-radius: 999px;
  transition: 0.2s ease;
  box-shadow: none;
  padding: 0;
  gap: 0;
}

.copy-btn:hover {
  background: #ffffff;
  border-color: #b8b8b8;
}

.copy-btn .material-symbols-rounded {
  font-size: 18px;
  line-height: 1;
}

.code-content {
  padding: 6px 10px;
  margin: 0;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: #1f1f1f;
  white-space: pre;
  line-height: 1.5;
}

.input-region {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 44px;
  z-index: 10;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(to top, var(--bg-page) 72%, transparent);
  transition:
    bottom 0.22s var(--ease),
    top 0.22s var(--ease),
    transform 0.22s var(--ease),
    padding 0.22s var(--ease),
    background 0.22s var(--ease);
}

.composer {
  width: 100%;
  max-width: 800px;
  min-height: 62.5px;
  background: #ffffff;
  border-radius: 999px;
  padding: 0 16px;
  transition: var(--transition);
  position: relative;
  border: 1px solid #e7e7e7 !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.038);
  outline: none;
  display: flex;
  align-items: center;
}

.composer.composer-multiline {
  min-height: 82px;
  border-radius: 24px;
  align-items: flex-start;
  padding-top: 10px;
  padding-bottom: 10px;
}

.composer:focus-within {
  outline: none;
  border-color: #cfcfcf !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.048);
}

#userInput {
  width: 100%;
  height: 38.5px;
  min-height: 38.5px;
  max-height: 140px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-high);
  font-size: 1rem;
  line-height: 24px;
  padding: 8px 204px 8px 42px;
  resize: none;
  margin: 0;
  overflow-y: auto;
  box-sizing: border-box;
}

.composer.composer-multiline #userInput {
  min-height: 56px;
  padding-top: 8px;
  padding-bottom: 8px;
}

#userInput::placeholder {
  color: #9b9b9b;
}

.composer-toolbar {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  width: 100%;
  pointer-events: none;
}

.toolbar-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.composer-right-actions {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
}

.composer.composer-multiline .toolbar-left,
.composer.composer-multiline .composer-right-actions {
  top: 15px;
  transform: none;
}

.btn-action-plus {
  width: 28px;
  height: 28px;
  border-radius: 50% !important;
  background: transparent;
  border: none;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
  box-shadow: none;
  padding: 0;
}

.btn-action-plus .material-symbols-rounded {
  font-size: 24px;
  line-height: 1;
}

.btn-action-plus:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
  transform: none;
}

.file-upload-input {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-tray {
  width: 100%;
  max-width: 840px;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.attachment-tray[hidden] {
  display: none !important;
}

.attachment-chip {
  max-width: min(260px, 100%);
  height: 36px;
  border: 1px solid #dedede;
  border-radius: 10px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 8px;
  color: #1f1f1f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.attachment-chip img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  background: #eeeeee;
}

.attachment-chip.image-chip {
  height: 48px;
  max-width: min(320px, 100%);
  border-radius: 14px;
}

.attachment-chip.image-chip img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.attachment-chip.has-error {
  border-color: rgba(186, 26, 26, 0.28);
  background: #fff8f7;
}

.attachment-chip.has-error .attachment-name {
  color: #8b1d1d;
}

.attachment-chip > .material-symbols-rounded {
  color: #94764a;
  font-size: 19px;
}

.attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 650;
}

.attachment-chip button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  cursor: pointer;
}

.attachment-chip button:hover {
  background: #eeeeee;
  color: #111111;
}

.attachment-chip button .material-symbols-rounded {
  font-size: 17px;
}

.user-attachment-preview {
  width: min(340px, 88vw);
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.user-attachment-preview img,
.user-attachment-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #e7e7e7;
  background: #f3f3f3;
}

.user-attachment-placeholder {
  display: grid;
  place-items: center;
  color: #6f542f;
}

.btn-tools {
  display: none;
}

.mic-btn {
  width: 28px;
  height: 28px;
  margin-left: -3.5px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.mic-btn .material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
}

.mic-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

#sendBtn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: transparent;
  color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;
  box-shadow: none;
}

#sendBtn.record-idle {
  background: #000000;
  color: #ffffff;
}

#sendBtn.ready {
  background: #000000;
  color: #ffffff;
}

#sendBtn .material-symbols-rounded {
  font-size: 19px;
  line-height: 1;
}

#sendBtn.record-idle #btnIcon {
  width: 22px;
  height: 22px;
  font-size: 0;
  position: relative;
  display: block;
  overflow: hidden;
}

#sendBtn.record-idle #btnIcon::before {
  content: "";
  position: absolute;
  inset: 3px 2px;
  background: currentColor;
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Crect x='1.5' y='6' width='2.4' height='4' rx='1.2'/%3E%3Crect x='6' y='3' width='2.4' height='10' rx='1.2'/%3E%3Crect x='10.2' y='1' width='2.8' height='14' rx='1.4'/%3E%3Crect x='14.6' y='4' width='2.4' height='8' rx='1.2'/%3E%3Crect x='19' y='6.5' width='2.4' height='3' rx='1.2'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Crect x='1.5' y='6' width='2.4' height='4' rx='1.2'/%3E%3Crect x='6' y='3' width='2.4' height='10' rx='1.2'/%3E%3Crect x='10.2' y='1' width='2.8' height='14' rx='1.4'/%3E%3Crect x='14.6' y='4' width='2.4' height='8' rx='1.2'/%3E%3Crect x='19' y='6.5' width='2.4' height='3' rx='1.2'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

#sendBtn:not(.record-idle) #btnIcon::before {
  content: none;
}

#sendBtn.record-idle:hover {
  background: #111111;
  transform: none;
}

#sendBtn.ready:hover {
  background: #111111;
  transform: none;
}

#sendBtn.streaming {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: #000000;
  color: #ffffff;
  border: none !important;
  cursor: pointer;
  animation: pulseStop 2s infinite;
}

#sendBtn.streaming .material-symbols-rounded {
  font-size: 22px;
  font-variation-settings:
    "FILL" 1,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

#sendBtn.streaming .material-symbols-rounded.stop-square-icon {
  font-size: 0;
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}

#sendBtn.streaming .material-symbols-rounded.stop-square-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: currentColor;
}

#btnIcon {
  transition:
    opacity 0.06s ease,
    transform 0.06s ease;
}

#btnIcon.icon-swapping {
  opacity: 0;
  transform: scale(0.55);
}

.legal-foot {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-low);
  padding: 10px 0 4px;
}

body.composer-centered .input-region {
  top: calc(50% - 28px);
  bottom: auto;
  transform: translateY(-50%);
  padding: 0 12px;
}

body.composer-centered .composer {
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.05);
}

.idle-composer-brand {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 52px);
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

body.composer-centered:not(.temporary-chat-mode) .idle-composer-brand {
  display: inline-flex;
  animation: idleBrandGlideDown 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes idleBrandGlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -14px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.idle-brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid #dedede;
  background: #ffffff;
  color: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1;
}

.idle-brand-mark span:first-child {
  font-size: 1.58rem;
  transform: translateY(-1px);
}

.idle-brand-mark span:last-child {
  position: absolute;
  font-size: 0.92rem;
  color: #b79353;
  transform: translateY(1px);
}

.idle-brand-text {
  color: #171717;
  font-size: 2.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.idle-composer-brand.idle-brand-message-only {
  width: min(90vw, 780px);
  justify-content: center;
  gap: 0;
  text-align: center;
}

.idle-brand-greeting {
  font-size: clamp(2rem, 5vw, 2.62rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.temporary-chat-notice {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 44px);
  transform: translateX(-50%);
  opacity: 1;
  max-width: 840px;
  width: calc(100% - 24px);
  margin: 0;
  text-align: center;
  pointer-events: none;
}

body.temporary-chat-mode .temporary-chat-notice {
  animation: temporaryNoticeGlideUp 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.temporary-chat-notice.glide-out {
  animation: temporaryNoticeGlideDown 0.24s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes temporaryNoticeGlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 18px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes temporaryNoticeGlideDown {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  to {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
}

.temporary-chat-title {
  color: #111111;
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.temporary-chat-subtitle {
  margin-top: 22px;
  color: #666666;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.45;
}

body:not(.composer-centered) .temporary-chat-notice {
  display: none !important;
}

body.temporary-chat-mode .composer {
  background: #2b2b2b !important;
  border-color: #303030 !important;
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.temporary-chat-mode .composer:focus-within {
  border-color: #3a3a3a !important;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.temporary-chat-mode #userInput {
  color: #ffffff;
}

body.temporary-chat-mode #userInput::placeholder {
  color: #b8b8b8;
}

body.temporary-chat-mode .btn-action-plus,
body.temporary-chat-mode .mic-btn,
body.temporary-chat-mode .model-picker-btn {
  color: #ededed;
}

body.temporary-chat-mode .btn-action-plus:hover,
body.temporary-chat-mode .mic-btn:hover,
body.temporary-chat-mode .model-picker-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.temporary-chat-mode #sendBtn,
body.temporary-chat-mode #sendBtn.record-idle {
  background: #000000;
  color: #ffffff;
}

body.temporary-chat-mode #sendBtn.ready,
body.temporary-chat-mode #sendBtn.streaming {
  background: #000000;
  color: #ffffff;
}

body.temporary-chat-mode #sendBtn:hover,
body.temporary-chat-mode #sendBtn.record-idle:hover {
  background: #111111;
}

body.temporary-chat-mode #sendBtn.ready:hover {
  background: #111111;
}

body.composer-centered .legal-foot {
  display: none;
}

@keyframes pulseStop {
  0% {
    box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.05);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.1);
  }
}

@media screen and (max-width: 768px) {
  .input-region {
    left: 0;
    right: 0;
    bottom: 12px;
    top: auto;
    transform: none;
    padding: 0 12px;
  }
  .composer {
    max-width: none;
    min-height: 58px;
    padding: 0 14px;
  }
  #userInput {
    font-size: 0.95rem;
    padding: 0 92px 0 38px;
  }
  .toolbar-left {
    left: 12px;
  }
  .composer-right-actions {
    right: 12px;
    gap: 8px;
  }
  #sendBtn,
  #sendBtn.record-idle,
  #sendBtn.ready,
  #sendBtn.streaming {
    width: 38px !important;
    height: 38px !important;
  }
  body.composer-centered .input-region {
    top: 69%;
    padding: 0 12px;
  }
}

.model-picker-wrap {
  position: relative;
}

.provider-picker-menu {
  min-width: 150px;
}

.model-picker-btn {
  height: 32px;
  padding: 0 5px 0 8px;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f1f1f;
}

#selectedProviderLabel,
#selectedModelLabel {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#selectedProviderLabel {
  max-width: 68px;
}

#selectedModelLabel {
  max-width: 128px;
}

.model-picker-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.model-picker-btn:focus,
.model-picker-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.model-picker-btn .material-symbols-rounded {
  font-size: 17px;
}

.model-picker-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #1f1f1f;
}

.model-picker-item:hover,
.model-picker-item.active {
  background: rgba(0, 0, 0, 0.05);
}
 
