#askai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#askai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#askai-panel {
  width: 100%;
  max-width: 920px;
  height: 80vh;
  max-height: 720px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.askai-hidden {
  display: none !important;
}

#askai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #eef0f3;
  font-weight: 600;
  font-size: 15px;
}

#askai-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

#askai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  background: #ffffff;
}

/* ---- message row layout ---- */
.askai-msg-row {
  display: flex;
  padding: 0 24px;
  margin-bottom: 24px;
}

.askai-msg-row.askai-user {
  justify-content: flex-end;
}

.askai-msg-row.askai-assistant {
  justify-content: flex-start;
}

/* ---- user bubble ---- */
.askai-msg-row.askai-user .askai-msg-body {
  background: #f3f3f3;
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- assistant markdown ---- */
.askai-msg-row.askai-assistant .askai-msg-body {
  width: 100%;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.75;
  color: #1a1a1a;
}

.askai-msg-row.askai-assistant .askai-msg-body p {
  margin: 0 0 12px;
}

.askai-msg-row.askai-assistant .askai-msg-body p:last-child {
  margin-bottom: 0;
}

.askai-msg-row.askai-assistant .askai-msg-body h1,
.askai-msg-row.askai-assistant .askai-msg-body h2,
.askai-msg-row.askai-assistant .askai-msg-body h3 {
  margin: 16px 0 8px;
  line-height: 1.3;
}

.askai-msg-row.askai-assistant .askai-msg-body ul,
.askai-msg-row.askai-assistant .askai-msg-body ol {
  margin: 4px 0 12px;
  padding-left: 24px;
}

.askai-msg-row.askai-assistant .askai-msg-body li {
  margin-bottom: 4px;
}

.askai-msg-row.askai-assistant .askai-msg-body code {
  background: #f3f4f6;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.askai-msg-row.askai-assistant .askai-msg-body pre {
  background: #f8f8f8;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 8px 0 12px;
}

.askai-msg-row.askai-assistant .askai-msg-body pre code {
  background: none;
  padding: 0;
  font-size: 13px;
}

.askai-msg-row.askai-assistant .askai-msg-body blockquote {
  border-left: 3px solid #d1d5db;
  margin: 8px 0 12px;
  padding: 4px 0 4px 14px;
  color: #555;
}

/* ---- "thinking" indicator ---- */
.askai-thinking {
  color: #888;
}

/* ---- input area ---- */
#askai-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #eef0f3;
  background: #ffffff;
}

#askai-input {
  flex: 1;
  resize: none;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.4;
  min-height: 42px;
  max-height: 120px;
  outline: none;
}

#askai-send {
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
  min-width: 64px;
}

#askai-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
