#naghamy-chat-root {
  --naghamy-green: #184d3b;
  --naghamy-mint: #b9f1d5;
  --naghamy-paper: #fffdf8;
  --naghamy-ink: #14271f;
  --naghamy-muted: #66756e;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--naghamy-ink);
}

#naghamy-chat-root[dir="rtl"] { right: auto; left: 22px; }

.naghamy-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--naghamy-green);
  color: #fff;
  box-shadow: 0 14px 30px rgba(24, 77, 59, .25);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.naghamy-chat-launcher-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px 9px 9px 3px;
  background: var(--naghamy-mint);
  color: var(--naghamy-green);
  font-family: Georgia, serif;
  font-size: 18px;
}

.naghamy-chat-panel {
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 108px));
  overflow: hidden;
  border: 1px solid rgba(20, 39, 31, .16);
  border-radius: 22px;
  background: var(--naghamy-paper);
  box-shadow: 0 24px 70px rgba(20, 39, 31, .22);
}

.naghamy-chat-panel[hidden], .naghamy-chat-launcher[hidden] { display: none; }

.naghamy-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 17px 15px;
  background: var(--naghamy-green);
  color: #fff;
}

.naghamy-chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.naghamy-chat-title-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px 10px 10px 3px; background: var(--naghamy-mint); color: var(--naghamy-green); font-family: Georgia, serif; font-size: 20px; }
.naghamy-chat-title strong, .naghamy-chat-title span { display: block; }
.naghamy-chat-title strong { font-size: 14px; }
.naghamy-chat-title span { margin-top: 3px; color: #d7f6e5; font-size: 11px; }
.naghamy-chat-actions { display: flex; gap: 5px; }
.naghamy-chat-icon-button { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.26); border-radius: 9px; background: transparent; color: #fff; cursor: pointer; font-size: 17px; }
.naghamy-chat-icon-button:hover { background: rgba(255,255,255,.12); }

.naghamy-chat-language { display: flex; gap: 6px; padding: 10px 15px 0; background: var(--naghamy-paper); }
.naghamy-chat-language button { border: 1px solid rgba(20,39,31,.15); border-radius: 999px; padding: 5px 10px; background: transparent; color: var(--naghamy-muted); cursor: pointer; font-size: 11px; font-weight: 800; }
.naghamy-chat-language button.active { border-color: var(--naghamy-green); background: #e9f6ee; color: var(--naghamy-green); }

.naghamy-chat-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 15px; }
.naghamy-chat-message { max-width: 88%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.naghamy-chat-message.assistant { align-self: flex-start; border: 1px solid rgba(20,39,31,.1); background: #eef6ef; }
.naghamy-chat-message.user { align-self: flex-end; background: var(--naghamy-green); color: #fff; }
.naghamy-chat-message.typing { color: var(--naghamy-muted); font-style: italic; }

.naghamy-chat-quick { display: flex; gap: 7px; overflow-x: auto; padding: 0 15px 11px; scrollbar-width: thin; }
.naghamy-chat-quick button { flex: 0 0 auto; border: 1px solid rgba(20,39,31,.14); border-radius: 999px; padding: 7px 10px; background: #fff; color: var(--naghamy-green); cursor: pointer; font-size: 11px; }
.naghamy-chat-quick button:hover { background: #eef6ef; }

.naghamy-chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid rgba(20,39,31,.12); background: #fff; }
.naghamy-chat-input { flex: 1; min-height: 42px; max-height: 110px; resize: none; border: 1px solid rgba(20,39,31,.18); border-radius: 13px; padding: 11px 12px; background: var(--naghamy-paper); color: var(--naghamy-ink); font: inherit; font-size: 13px; line-height: 1.4; }
.naghamy-chat-input:focus { outline: 2px solid #52b98b; outline-offset: 1px; }
.naghamy-chat-send { display: grid; place-items: center; width: 43px; height: 42px; border: 0; border-radius: 13px; background: var(--naghamy-green); color: #fff; cursor: pointer; font-size: 18px; }
.naghamy-chat-send:disabled { opacity: .55; cursor: wait; }
.naghamy-chat-note { padding: 0 15px 12px; color: var(--naghamy-muted); font-size: 10px; line-height: 1.4; }

@media (max-width: 520px) {
  #naghamy-chat-root { right: 12px; bottom: 12px; left: 12px; }
  #naghamy-chat-root[dir="rtl"] { right: 12px; left: 12px; }
  .naghamy-chat-launcher { width: 100%; justify-content: center; }
  .naghamy-chat-panel { width: 100%; height: min(650px, calc(100vh - 82px)); }
}
