:root {
  --na-green: #08783f;
  --na-green-deep: #035631;
  --na-lime: #83c735;
  --na-gold: #d7ad67;
  --na-ink: #082f2d;
}

.na-assistant,
.na-assistant * { box-sizing: border-box; }

.na-assistant {
  position: fixed;
  inset: auto auto 22px 22px;
  z-index: 220;
  direction: rtl;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: #102f32;
}

.na-assistant-launcher {
  position: relative;
  min-width: 164px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 9px 7px 16px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 19px;
  background: linear-gradient(135deg, var(--na-green-deep), var(--na-green) 65%, #159152);
  color: #fff;
  box-shadow: 0 18px 45px rgba(3, 70, 43, .3), inset 0 1px 0 rgba(255,255,255,.18);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s ease, box-shadow .25s ease;
}

.na-assistant-launcher::before {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  inset: -42px auto auto -28px;
  background: rgba(139, 205, 59, .22);
  z-index: -1;
}

.na-assistant-launcher:hover { transform: translateY(-3px); box-shadow: 0 23px 55px rgba(3, 70, 43, .38); }
.na-assistant-launcher:focus-visible { outline: 3px solid rgba(215,173,103,.5); outline-offset: 3px; }
.na-assistant-launcher[aria-expanded="true"] { min-width: 58px; width: 58px; padding: 7px; border-radius: 18px; }
.na-assistant-launcher[aria-expanded="true"] .na-launcher-copy { display: none; }

.na-launcher-icon {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
}
.na-launcher-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.na-launcher-copy { display: flex; flex-direction: column; text-align: right; line-height: 1.25; white-space: nowrap; }
.na-launcher-copy strong { font-size: .78rem; font-weight: 900; }
.na-launcher-copy small { margin-top: 3px; color: #d4f0df; font-size: .58rem; }
.na-online-dot { width: 8px; height: 8px; border-radius: 50%; background: #7ef2b1; box-shadow: 0 0 0 5px rgba(126,242,177,.12); }

.na-assistant-panel {
  position: absolute;
  bottom: 72px;
  left: 0;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 110px));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  border: 1px solid rgba(4,78,48,.13);
  border-radius: 28px;
  background: rgba(250,253,250,.98);
  box-shadow: 0 30px 90px rgba(3,42,35,.24), 0 0 0 1px rgba(255,255,255,.8) inset;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.97);
  transform-origin: left bottom;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.na-assistant-panel.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.na-assistant-head {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 10%, rgba(139,205,59,.32), transparent 30%),
    linear-gradient(125deg, #034a30, #08783f 68%, #159152);
}
.na-assistant-avatar { width: 49px; height: 49px; flex: 0 0 49px; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.2); }
.na-assistant-avatar svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.na-assistant-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.na-assistant-title strong { font-size: .88rem; font-weight: 900; }
.na-assistant-title small { display: flex; align-items: center; gap: 7px; color: #cfecda; font-size: .61rem; }
.na-assistant-title small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #70efa5; box-shadow: 0 0 0 4px rgba(112,239,165,.12); }
.na-assistant-close, .na-assistant-reset { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 11px; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; transition: .18s ease; }
.na-assistant-close:hover, .na-assistant-reset:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.na-assistant-close svg, .na-assistant-reset svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.na-assistant-safety { padding: 9px 14px; color: #7c5b27; background: #fff7e9; border-bottom: 1px solid rgba(184,132,50,.13); font-size: .58rem; line-height: 1.65; }
.na-assistant-safety b { color: #704816; }

.na-assistant-messages { display: flex; flex-direction: column; gap: 11px; min-height: 0; padding: 17px 14px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(8,120,63,.3) transparent; }
.na-message { max-width: 86%; padding: 11px 13px; border-radius: 16px; font-size: .72rem; line-height: 1.9; white-space: pre-line; animation: na-message-in .28s ease both; }
.na-message.assistant { align-self: flex-end; color: #27464a; background: #fff; border: 1px solid rgba(3,86,49,.09); border-top-right-radius: 5px; box-shadow: 0 7px 20px rgba(5,67,47,.06); }
.na-message.user { align-self: flex-start; color: #fff; background: linear-gradient(135deg, #07693b, #098a49); border-top-left-radius: 5px; box-shadow: 0 8px 20px rgba(4,96,52,.17); }
.na-message.is-alert { color: #6c351f; background: #fff3ee; border-color: rgba(183,70,32,.16); }
.na-message-meta { display: block; margin-top: 4px; opacity: .58; font-size: .52rem; }
.na-message-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.na-message-actions a { padding: 6px 9px; border-radius: 9px; color: var(--na-green-deep); background: #edf8f1; font-size: .56rem; font-weight: 800; }

.na-typing { align-self: flex-end; display: none; align-items: center; gap: 4px; padding: 12px 14px; border-radius: 15px 5px 15px 15px; background: #fff; border: 1px solid rgba(3,86,49,.09); }
.na-typing.is-visible { display: flex; }
.na-typing span { width: 6px; height: 6px; border-radius: 50%; background: #51a775; animation: na-bounce 1.1s infinite ease-in-out; }
.na-typing span:nth-child(2) { animation-delay: .12s; }
.na-typing span:nth-child(3) { animation-delay: .24s; }

.na-assistant-suggestions { display: flex; gap: 6px; padding: 8px 13px 10px; overflow-x: auto; scrollbar-width: none; }
.na-assistant-suggestions::-webkit-scrollbar { display: none; }
.na-assistant-suggestions button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid rgba(8,120,63,.13); border-radius: 999px; color: #31594b; background: #f1f8f3; font: 700 .58rem/1.4 inherit; cursor: pointer; transition: .18s ease; }
.na-assistant-suggestions button:hover { color: #fff; background: var(--na-green); transform: translateY(-1px); }

.na-assistant-form { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: end; padding: 10px 12px 12px; background: #fff; border-top: 1px solid rgba(4,78,48,.08); }
.na-assistant-form textarea { width: 100%; min-height: 44px; max-height: 100px; resize: none; padding: 10px 12px; border: 1px solid rgba(4,78,48,.12); border-radius: 13px; background: #f7faf8; color: #143e38; outline: none; font: 500 .69rem/1.7 inherit; transition: .18s ease; }
.na-assistant-form textarea:focus { background: #fff; border-color: rgba(8,120,63,.45); box-shadow: 0 0 0 4px rgba(8,120,63,.07); }
.na-assistant-form button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--na-green-deep), var(--na-green)); box-shadow: 0 8px 18px rgba(4,96,52,.2); cursor: pointer; transition: .18s ease; }
.na-assistant-form button:hover { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(4,96,52,.28); }
.na-assistant-form button:disabled { opacity: .55; cursor: wait; transform: none; }
.na-assistant-form button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }

@keyframes na-message-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes na-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

@media (max-width: 640px) {
  .na-assistant { inset: auto 12px 12px 12px; }
  .na-assistant-launcher { margin-right: auto; min-width: 58px; width: 58px; padding: 7px; border-radius: 18px; }
  .na-assistant-launcher[aria-expanded="true"] { opacity: 0; visibility: hidden; pointer-events: none; }
  .na-launcher-copy { display: none; }
  .na-assistant-panel { position: fixed; inset: 10px; width: auto; height: auto; max-height: none; border-radius: 23px; transform-origin: center bottom; }
  .na-assistant-head { min-height: 75px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .na-assistant-panel, .na-assistant-launcher, .na-message, .na-typing span { transition: none; animation: none; }
}

