.codex-chat-panel {
  position: fixed;
  left: 12px;
  top: 108px;
  bottom: 18px;
  width: 292px;
  border: 1px solid #d7dce3;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  font-family: Arial, Helvetica, sans-serif;
}

.codex-chat-panel.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}

.codex-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #dde2e8;
  background: linear-gradient(#fbfbfb, #f1f3f5);
}

.codex-chat-title {
  margin: 0;
  font-size: 20px;
  color: #2c2c2c;
}

.codex-chat-close {
  width: 34px;
  height: 34px;
  border: 1px solid #ccd3db;
  border-radius: 4px;
  background: #fff;
  color: #4a4a4a;
  cursor: pointer;
}

.codex-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
}

.codex-chat-empty {
  color: #888;
  font-size: 13px;
}

.codex-chat-message {
  padding: 10px;
  border: 1px solid #e7eaee;
  border-radius: 4px;
  background: #fafafa;
}

.codex-chat-message + .codex-chat-message {
  margin-top: 10px;
}

.codex-chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #7c7c7c;
}

.codex-chat-author {
  font-weight: 700;
  color: #2f2f2f;
}

.codex-chat-body {
  margin: 0;
  color: #3b3b3b;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
}

.codex-chat-image {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 4px;
  border: 1px solid #dfe3e8;
}

.codex-chat-form {
  padding: 10px;
  border-top: 1px solid #dde2e8;
  background: #fcfcfc;
}

.codex-chat-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #666;
}

.codex-chat-label span {
  display: block;
  margin-bottom: 4px;
}

.codex-chat-input,
.codex-chat-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfd5dc;
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

.codex-chat-textarea {
  resize: vertical;
  min-height: 78px;
}

.codex-chat-upload {
  display: block;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px dashed #c6ccd4;
  border-radius: 4px;
  background: #fff;
  color: #555;
  cursor: pointer;
}

.codex-chat-upload input {
  display: none;
}

.codex-chat-submit {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #bcc8d4;
  border-radius: 4px;
  background: linear-gradient(#fff, #e8edf2);
  color: #274866;
  cursor: pointer;
  font-weight: 700;
}

.codex-chat-footer-trigger {
  display: inline-block;
  margin-top: 6px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #f28c28 !important;
  background: transparent;
  border: 0;
  text-decoration: none !important;
  cursor: pointer;
}

@media (max-width: 900px) {
  .codex-chat-panel {
    top: 76px;
    left: 10px;
    width: min(292px, calc(100vw - 20px));
  }
}
