/* ============================================================================
   FADEZEN · Chat
   חלון שיחה מהירה בין לקוח לספר — במובייל גיליון תחתון, בדסקטופ חלון צף.
   ========================================================================= */

.chat{
  position: absolute; z-index: var(--z-chat);
  inset-inline: 0; bottom: 0;
  height: min(580px, 88%);
  display: flex; flex-direction: column;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  background: linear-gradient(180deg, rgba(29,31,36,.97), rgba(14,15,18,.99));
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line); border-bottom: 0;
  box-shadow: var(--e-4);
  padding-bottom: var(--safe-b);
  transform: translateY(101%);
  visibility: hidden;
  transition: transform var(--d-4) var(--ease-out), visibility var(--d-4);
}
.chat.is-open{ transform: translateY(0); visibility: visible; }

@media (min-width: 900px){
  .chat{
    inset-inline: auto; left: var(--s-5); right: auto;
    bottom: var(--s-5); width: 384px;
    border-radius: var(--r-xl); border-bottom: 1px solid var(--line);
    padding-bottom: 0;
    transform: translateY(24px) scale(.97); opacity: 0;
    transition: transform var(--d-3) var(--ease-out), opacity var(--d-3), visibility var(--d-3);
  }
  .chat.is-open{ transform: translateY(0) scale(1); opacity: 1; }
}

.chat__head{
  flex: none; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}
.chat__name{ font-weight: 700; font-size: var(--t-md); }
.chat__presence{ display: flex; align-items: center; gap: var(--s-1); font-size: var(--t-xs); color: var(--live); }
.chat__presence i{ width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.chat__presence.is-away{ color: var(--ink-3); }

.chat__body{
  flex: 1; padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}

.msg{
  max-width: 78%;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-lg);
  font-size: var(--t-md); line-height: var(--lh-body);
  word-break: break-word;
  animation: bz-msg-in var(--d-3) var(--ease-out) backwards;
}
.msg--them{
  align-self: flex-start;
  background: rgba(255,255,255,.075); border: 1px solid var(--line);
  border-start-start-radius: 6px;
}
.msg--me{
  align-self: flex-end;
  background: var(--grad-nav); color: var(--ink-on-nav); font-weight: 500;
  border-start-end-radius: 6px;
}
.msg__time{ display: block; font-size: 9.5px; opacity: .62; margin-top: 3px; }
.msg__system{
  align-self: center; max-width: 90%;
  background: rgba(255,255,255,.04); border: 1px dashed var(--line-strong);
  color: var(--ink-3); font-size: var(--t-xs); text-align: center;
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
}

.typing{
  align-self: flex-start; display: flex; gap: 4px;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-lg);
  background: rgba(255,255,255,.075); border: 1px solid var(--line);
  border-start-start-radius: 6px;
}
.typing i{ width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); animation: bz-bob 1.1s infinite; }
.typing i:nth-child(2){ animation-delay: .16s; }
.typing i:nth-child(3){ animation-delay: .32s; }

.chat__quick{ flex: none; display: flex; gap: var(--s-2); padding: 0 var(--s-4) var(--s-2); }
.chat__quick button{
  flex: none; padding: 6px var(--s-3); border-radius: var(--r-pill);
  font-size: var(--t-sm); font-weight: 600; color: var(--nav-ink);
  background: var(--nav-dim); border: 1px solid rgba(0,229,255,.3);
  white-space: nowrap;
  transition: background var(--d-2), transform var(--d-1) var(--ease-out);
}
.chat__quick button:active{ transform: scale(.94); }

.chat__form{
  flex: none; display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-3) calc(var(--s-3) + var(--safe-b));
  border-top: 1px solid var(--line);
}
@media (min-width: 900px){ .chat__form{ padding-bottom: var(--s-3); } }
.chat__form .input{ flex: 1; border-radius: var(--r-pill); height: 46px; }
.chat__send{
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-nav); color: var(--ink-on-nav);
  box-shadow: var(--e-glow-nav);
  transition: transform var(--d-1) var(--ease-out), filter var(--d-2);
}
.chat__send:active{ transform: scale(.9); }
.chat__send:disabled{ opacity: .4; box-shadow: none; }

/* הודעת שקיפות בתחתית הצ׳אט.
   דיסקרטית בכוונה — היא צריכה להיקרא פעם אחת ואז להיעלם מהתודעה,
   לא להתחרות בשיחה עצמה. */
.chat__notice{
  flex: none; margin: 0;
  padding: 0 var(--s-3) calc(var(--s-2) + var(--safe-b));
  font-size: 11px; line-height: 1.5; text-align: center;
  color: var(--ink-3);
}
@media (min-width: 900px){ .chat__notice{ padding-bottom: var(--s-2); } }
.chat__notice a{ color: var(--ink-2); text-decoration: underline; }
.chat__notice a:hover{ color: var(--c-cyan); }
