.remecsa-chat-widget { font-family: Inter, Arial, sans-serif; color: #1f2937; }
.remecsa-chat-widget.is-floating { position: fixed; right: 22px; bottom: 22px; z-index: 99999; }
.remecsa-chat-toggle { width: 62px; height: 62px; border-radius: 999px; border: 0; background: var(--remecsa-chat-color, #18823b); color: #fff; font-size: 25px; font-weight: 800; box-shadow: 0 14px 32px rgba(0,0,0,.24); cursor: pointer; display: grid; place-items: center; }
.remecsa-chat-panel { width: 390px; max-width: calc(100vw - 36px); background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 16px 42px rgba(0,0,0,.22); border: 1px solid #e5e7eb; display: flex; flex-direction: column; max-height: min(720px, calc(100vh - 105px)); }
.remecsa-chat-widget.is-floating .remecsa-chat-panel { display: none; position: absolute; right: 0; bottom: 78px; }
.remecsa-chat-widget.is-floating.is-open .remecsa-chat-panel { display: flex; }
.remecsa-chat-widget.is-inline .remecsa-chat-panel { width: 100%; box-shadow: none; }
.remecsa-chat-head { background: linear-gradient(135deg, var(--remecsa-chat-color, #18823b), #0f5f2c); color: #fff; padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; }
.remecsa-chat-head strong { font-size: 17px; letter-spacing: .01em; }
.remecsa-chat-head span { font-size: 12px; opacity: .9; }
.remecsa-chat-messages { min-height: 310px; flex: 1; overflow-y: auto; background: #f8fbf8; padding: 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.remecsa-chat-bubble { max-width: 88%; padding: 10px 12px; border-radius: 15px; font-size: 14px; line-height: 1.42; white-space: pre-wrap; word-break: break-word; }
.remecsa-chat-bubble.is-client { align-self: flex-end; background: var(--remecsa-chat-color, #18823b); color: #fff; border-bottom-right-radius: 5px; }
.remecsa-chat-bubble.is-assistant { align-self: flex-start; background: #fff; color: #213547; border: 1px solid #e1e8e3; border-bottom-left-radius: 5px; }
.remecsa-chat-bubble.is-advisor { align-self: flex-start; background: #eef6ff; color: #1f2f46; border: 1px solid #cfe4ff; border-bottom-left-radius: 5px; }
.remecsa-chat-bubble.is-typing { opacity: .72; font-style: italic; }
.remecsa-chat-bubble-label { display: block; font-size: 11px; font-weight: 800; opacity: .72; margin-bottom: 4px; }
.remecsa-chat-attachments { margin-top: 8px; display: grid; gap: 5px; }
.remecsa-chat-attachments a { color: inherit; text-decoration: underline; font-size: 12px; opacity: .92; }
.remecsa-chat-form { padding: 12px; display: grid; gap: 9px; background: #fff; border-top: 1px solid #eef2ef; }
.remecsa-chat-client-fields { display: grid; gap: 8px; }
.remecsa-chat-client-fields.is-collapsed { display: none; }
.remecsa-chat-form input, .remecsa-chat-form textarea { width: 100%; border: 1px solid #dbe2de; border-radius: 11px; padding: 10px 11px; font: inherit; outline: none; box-sizing: border-box; }
.remecsa-chat-form input:focus, .remecsa-chat-form textarea:focus { border-color: var(--remecsa-chat-color, #18823b); box-shadow: 0 0 0 3px rgba(24,130,59,.12); }
.remecsa-chat-compose { display: grid; grid-template-columns: 38px 38px 1fr 72px; gap: 7px; align-items: end; }
.remecsa-chat-file-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid #dbe2de; background: #f8fbf8; display: grid; place-items: center; cursor: pointer; font-size: 18px; }
.remecsa-chat-file-btn input { display: none; }
.remecsa-chat-compose textarea { min-height: 38px; max-height: 96px; resize: none; padding: 9px 10px; }
.remecsa-chat-form button[type="submit"] { height: 38px; border: 0; border-radius: 11px; background: var(--remecsa-chat-color, #18823b); color: #fff; font-weight: 800; cursor: pointer; }
.remecsa-chat-form button[disabled] { opacity: .65; cursor: not-allowed; }
.remecsa-chat-file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.remecsa-chat-file-list span { font-size: 11px; background: #edf7ef; border: 1px solid #d5ebda; color: #245132; border-radius: 999px; padding: 4px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remecsa-chat-new { border: 0; background: transparent; color: #536171; cursor: pointer; font-size: 12px; justify-self: center; }
.remecsa-chat-status { min-height: 18px; margin: 0; color: #536171; font-size: 12px; line-height: 1.4; text-align: center; }
@media (max-width: 520px) {
  .remecsa-chat-widget.is-floating { right: 14px; bottom: 14px; }
  .remecsa-chat-panel { width: calc(100vw - 28px); max-height: calc(100vh - 94px); }
  .remecsa-chat-compose { grid-template-columns: 36px 36px 1fr 64px; gap: 6px; }
}

/* v24: image previews for material attachments */
.remecsa-chat-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.remecsa-chat-attachments a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 12px;
  overflow: hidden;
  padding: 7px;
  background: rgba(255,255,255,.82);
  color: inherit;
  border: 1px solid rgba(15,23,42,.12);
}
.remecsa-chat-attachments a.is-image img {
  width: 100%;
  height: 95px;
  object-fit: cover;
  border-radius: 9px;
  background: #f3f7f4;
}
.remecsa-chat-attachments a span {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
